From: Ben Hutchings <bhutchings@solarflare.com>
To: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [RFC, 2/2] igb: Implementation of ethtool priv_flags for igb driver.
Date: Fri, 02 Sep 2011 22:31:36 +0100 [thread overview]
Message-ID: <1314999096.3419.16.camel@bwh-desktop> (raw)
In-Reply-To: <1314996631-4773-2-git-send-email-carolyn.wyborny@intel.com>
On Fri, 2011-09-02 at 13:50 -0700, Carolyn Wyborny wrote:
> This patch adds igb driver support for the ethtool private flags
> interface. Two features are initially configured for private flags
> support as an example for use with the implementation in ethtoool
> application.
>
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb.h | 2 +
> drivers/net/ethernet/intel/igb/igb_ethtool.c | 28 ++++++++++++++++++++++++++
> drivers/net/ethernet/intel/igb/igb_main.c | 1 +
> 3 files changed, 31 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
> index bb47ed1..a8be3eb 100644
> --- a/drivers/net/ethernet/intel/igb/igb.h
> +++ b/drivers/net/ethernet/intel/igb/igb.h
> @@ -360,6 +360,7 @@ struct igb_adapter {
> u32 rss_queues;
> u32 wvbr;
> int node;
> + u32 pflags;
> };
>
> #define IGB_FLAG_HAS_MSI (1 << 0)
> @@ -367,6 +368,7 @@ struct igb_adapter {
> #define IGB_FLAG_QUAD_PORT_A (1 << 2)
> #define IGB_FLAG_QUEUE_PAIRS (1 << 3)
> #define IGB_FLAG_DMAC (1 << 4)
> +#define IGB_FLAG_EEE (1 << 5)
>
> /* DMA Coalescing defines */
> #define IGB_MIN_TXPBSIZE 20408
> diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
> index 64fb4ef..3a251c7 100644
> --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
> +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
> @@ -696,6 +696,9 @@ static void igb_get_drvinfo(struct net_device *netdev,
> drvinfo->testinfo_len = IGB_TEST_LEN;
> drvinfo->regdump_len = igb_get_regs_len(netdev);
> drvinfo->eedump_len = igb_get_eeprom_len(netdev);
> +#ifdef ETHTOOL_GPFLAGS
That macro is always defined,
> + drvinfo->n_priv_flags = 2;
This is not enough. You need to support ETH_SS_PRIV_FLAGS in the
get_sset_count and get_strings operations.
> +#endif
> }
>
> static void igb_get_ringparam(struct net_device *netdev,
> @@ -2171,6 +2174,29 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
> }
> }
>
> +static int igb_set_pflags(struct net_device *netdev, u32 data)
> +{
> + u32 supported_flags = IGB_FLAG_EEE;
> + struct igb_adapter *adapter = netdev_priv(netdev);
> +
> + if (data & supported_flags) {
[...]
If the number of flags is 2, then the supported flags must be numbered
(1 << 0) and (1 << 1).
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-09-02 21:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 20:50 [RFC, 1/2] ethtool: Implement private flags interface for ethtool application Carolyn Wyborny
2011-09-02 20:50 ` [RFC, 2/2] igb: Implementation of ethtool priv_flags for igb driver Carolyn Wyborny
2011-09-02 21:31 ` Ben Hutchings [this message]
2011-09-02 20:55 ` [RFC, 1/2] ethtool: Implement private flags interface for ethtool application David Miller
2011-09-02 21:11 ` Wyborny, Carolyn
2011-09-02 21:17 ` Michał Mirosław
2011-09-02 21:22 ` Michał Mirosław
2011-09-02 21:29 ` Wyborny, Carolyn
2011-09-02 21:34 ` Ben Hutchings
2011-09-02 21:35 ` Wyborny, Carolyn
2011-09-03 1:39 ` Michał Mirosław
2011-09-02 21:23 ` Ben Hutchings
2011-09-02 21:27 ` Ben Hutchings
2011-09-02 21:33 ` Wyborny, Carolyn
2011-09-02 21:36 ` Ben Hutchings
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=1314999096.3419.16.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=carolyn.wyborny@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).