netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xander Huff <xander.huff@ni.com>
To: davem@davemloft.net, nicolas.ferre@atmel.com, david.laight@aculab.com
Cc: netdev@vger.kernel.org, jaeden.amero@ni.com,
	rich.tollerton@ni.com, brad.mouring@ni.com,
	linux-kernel@vger.kernel.org, cyrille.pitchen@atmel.com,
	Xander Huff <xander.huff@ni.com>
Subject: [PATCH v3 3/3] net/macb: Create gem_ethtool_ops for new statistics functions
Date: Thu, 15 Jan 2015 15:55:20 -0600	[thread overview]
Message-ID: <1421358920-23897-3-git-send-email-xander.huff@ni.com> (raw)
In-Reply-To: <1421358920-23897-1-git-send-email-xander.huff@ni.com>

10/100 MACB does not have the same statistics possibilities as GEM. Separate
macb_ethtool_ops to make a new GEM-specific struct with the new statistics
functions included.

Signed-off-by: Xander Huff <xander.huff@ni.com>
---
Re-sending to properly include David Laight

 drivers/net/ethernet/cadence/macb.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 9edd787..f2f9ca0 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2032,11 +2032,21 @@ const struct ethtool_ops macb_ethtool_ops = {
 	.get_regs		= macb_get_regs,
 	.get_link		= ethtool_op_get_link,
 	.get_ts_info		= ethtool_op_get_ts_info,
+};
+EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+
+const struct ethtool_ops gem_ethtool_ops = {
+	.get_settings		= macb_get_settings,
+	.set_settings		= macb_set_settings,
+	.get_regs_len		= macb_get_regs_len,
+	.get_regs		= macb_get_regs,
+	.get_link		= ethtool_op_get_link,
+	.get_ts_info		= ethtool_op_get_ts_info,
 	.get_ethtool_stats	= gem_get_ethtool_stats,
 	.get_strings		= gem_get_ethtool_strings,
 	.get_sset_count		= gem_get_sset_count,
 };
-EXPORT_SYMBOL_GPL(macb_ethtool_ops);
+EXPORT_SYMBOL_GPL(gem_ethtool_ops);
 
 int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
@@ -2325,7 +2335,6 @@ static int __init macb_probe(struct platform_device *pdev)
 
 	dev->netdev_ops = &macb_netdev_ops;
 	netif_napi_add(dev, &bp->napi, macb_poll, 64);
-	dev->ethtool_ops = &macb_ethtool_ops;
 
 	dev->base_addr = regs->start;
 
@@ -2339,12 +2348,14 @@ static int __init macb_probe(struct platform_device *pdev)
 		bp->macbgem_ops.mog_free_rx_buffers = gem_free_rx_buffers;
 		bp->macbgem_ops.mog_init_rings = gem_init_rings;
 		bp->macbgem_ops.mog_rx = gem_rx;
+		dev->ethtool_ops = &gem_ethtool_ops;
 	} else {
 		bp->max_tx_length = MACB_MAX_TX_LEN;
 		bp->macbgem_ops.mog_alloc_rx_buffers = macb_alloc_rx_buffers;
 		bp->macbgem_ops.mog_free_rx_buffers = macb_free_rx_buffers;
 		bp->macbgem_ops.mog_init_rings = macb_init_rings;
 		bp->macbgem_ops.mog_rx = macb_rx;
+		dev->ethtool_ops = &macb_ethtool_ops;
 	}
 
 	/* Set features */
-- 
1.9.1

  parent reply	other threads:[~2015-01-15 21:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 22:15 [PATCH 1/2] net/macb: Adding comments to various #defs to make interpretation easier Xander Huff
2015-01-13 22:15 ` [PATCH 2/2] net/macb: improved ethtool statistics support Xander Huff
2015-01-14  5:26   ` David Miller
2015-01-14 15:53   ` Nicolas Ferre
2015-01-14 20:21     ` [PATCH 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier Xander Huff
2015-01-14 20:21       ` [PATCH 2/2] fixup! net/macb: improved ethtool statistics support Xander Huff
2015-01-14 21:09       ` [PATCH 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier David Miller
2015-01-14 21:18         ` Xander Huff
2015-01-14 21:52           ` David Miller
2015-01-14 22:20             ` [PATCH v2 " Xander Huff
2015-01-14 22:20               ` [PATCH v2 2/2] fixup! net/macb: improved ethtool statistics support Xander Huff
2015-01-15 10:35                 ` Nicolas Ferre
2015-01-15 15:32                   ` Xander Huff
2015-01-15 10:05               ` [PATCH v2 1/2] fixup! net/macb: Adding comments to various #defs to make interpretation easier Nicolas Ferre
2015-01-15 11:46               ` David Laight
2015-01-15 21:45                 ` [PATCH v3 1/3] net/macb: Fix comments to meet style guidelines Xander Huff
2015-01-15 21:45                   ` [PATCH v3 2/3] net/macb: Add whitespace around arithmetic operators Xander Huff
2015-01-16  5:32                     ` David Miller
2015-01-15 21:45                   ` [PATCH v3 3/3] net/macb: Create gem_ethtool_ops for new statistics functions Xander Huff
2015-01-16  5:32                     ` David Miller
2015-01-16  5:31                   ` [PATCH v3 1/3] net/macb: Fix comments to meet style guidelines David Miller
2015-01-15 21:55                 ` Xander Huff
2015-01-15 21:55                   ` [PATCH v3 2/3] net/macb: Add whitespace around arithmetic operators Xander Huff
2015-01-15 21:55                   ` Xander Huff [this message]
2015-01-14 21:04     ` [PATCH 2/2] net/macb: improved ethtool statistics support David Miller
2015-01-14  5:26 ` [PATCH 1/2] net/macb: Adding comments to various #defs to make interpretation easier David Miller
2015-01-14 15:11   ` Brad Mouring
2015-01-14 15:10 ` Nicolas Ferre
     [not found] ` <OFE030E01C.93929A2C-ON86257DCD.00524615-86257DCD.0052461A@ni.com>
2015-01-14 21:02   ` David Miller

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=1421358920-23897-3-git-send-email-xander.huff@ni.com \
    --to=xander.huff@ni.com \
    --cc=brad.mouring@ni.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=davem@davemloft.net \
    --cc=david.laight@aculab.com \
    --cc=jaeden.amero@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=rich.tollerton@ni.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).