netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: Jeff Garzik <jgarzik@pobox.com>, Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH] ne2k: add minimal ethtool setting support
Date: Tue, 15 Jan 2008 15:48:05 -0800	[thread overview]
Message-ID: <20080115154805.69150f76@deepthought> (raw)

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>

             reply	other threads:[~2008-01-15 23:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 23:48 Stephen Hemminger [this message]
2008-01-18 20:04 ` [PATCH] ne2k: add minimal ethtool setting support Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080115154805.69150f76@deepthought \
    --to=stephen.hemminger@vyatta.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).