* [PATCH] ne2k: add minimal ethtool setting support
@ 2008-01-15 23:48 Stephen Hemminger
2008-01-18 20:04 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2008-01-15 23:48 UTC (permalink / raw)
To: Jeff Garzik, Paul Gortmaker; +Cc: netdev
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.
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
--- a/drivers/net/ne2k-pci.c 2008-01-15 11:21:02.000000000 -0800
+++ b/drivers/net/ne2k-pci.c 2008-01-15 15:43:17.000000000 -0800
@@ -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)
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ne2k: add minimal ethtool setting support
2008-01-15 23:48 [PATCH] ne2k: add minimal ethtool setting support Stephen Hemminger
@ 2008-01-18 20:04 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-01-18 20:04 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Paul Gortmaker, netdev
Stephen Hemminger wrote:
> 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.
>
> Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
>
> --- a/drivers/net/ne2k-pci.c 2008-01-15 11:21:02.000000000 -0800
> +++ b/drivers/net/ne2k-pci.c 2008-01-15 15:43:17.000000000 -0800
> @@ -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;
> +}
It's a little bit /too/ minimal... the speed is wrong for a large swath
of 10/100 ne2k chips...
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-18 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15 23:48 [PATCH] ne2k: add minimal ethtool setting support Stephen Hemminger
2008-01-18 20:04 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).