Skip to contentSkip to conversation

ne2k: add minimal ethtool setting support

PATCH In review Stephen Hemminger 2 participants 2 messages Jan 15, 2008 – Jan 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ne2k: add minimal ethtool setting support

Add minimal ethtool settings support for ne2k driver. This is needed for KVM/QEMU environment where ne2k seems to be the simplest stupid hardware used.

drivers/net/ne2k-pci.c +13 -0
@@ -634,8 +634,21 @@ static void ne2k_pci_get_drvinfo(struct 
 	strcpy(info->bus_info, pci_name(pci_dev));
 }
 
+static int ne2k_pci_get_settings(struct net_device *dev,
+				 struct ethtool_cmd *cmd)
+{
+	cmd->speed		= SPEED_10;
+	cmd->duplex		= (ei_status.ne2k_flags & FORCE_FDX)
+				   ? DUPLEX_FULL : DUPLEX_HALF;
+	cmd->port		= PORT_TP;
+	cmd->transceiver	= XCVR_INTERNAL;
+	cmd->autoneg		= AUTONEG_DISABLE;
+	return 0;
+}
+
 static const struct ethtool_ops ne2k_pci_ethtool_ops = {
 	.get_drvinfo		= ne2k_pci_get_drvinfo,
+	.get_settings		= ne2k_get_settings,
 };
 
 static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
Signature · 1 line
Stephen Hemminger <[email protected]>
#1 lore raw
Quoted 13 lines · Stephen Hemminger

Add minimal ethtool settings support for ne2k driver. This is needed for KVM/QEMU environment where ne2k seems to be the simplest stupid hardware used.

drivers/net/ne2k-pci.c +1 -0
@@ -634,8 +634,21 @@ static void ne2k_pci_get_drvinfo(struct 
 	strcpy(info->bus_info, pci_name(pci_dev));
 }
 
+static int ne2k_pci_get_settings(struct net_device *dev,

drivers/net/ne2k-pci.c static void ne2k_pci_get_drvinfo(struct · line 647

Quoted 10 lines
drivers/net/ne2k-pci.c +10 -0
+				 struct ethtool_cmd *cmd)
+{
+	cmd->speed		= SPEED_10;
+	cmd->duplex		= (ei_status.ne2k_flags & FORCE_FDX)
+				   ? DUPLEX_FULL : DUPLEX_HALF;
+	cmd->port		= PORT_TP;
+	cmd->transceiver	= XCVR_INTERNAL;
+	cmd->autoneg		= AUTONEG_DISABLE;
+	return 0;
+}

It's a little bit /too/ minimal... the speed is wrong for a large swath of 10/100 ne2k chips...

Jeff