Re: [ofa-general] [PATCH 03/77] infiniband: convert c2 to net_device_ops

Previous thread: [PATCH 04/77] infiniband: convert nes driver to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (2 messages)

Next thread: [PATCH 20/77] irda: convert ks959 device to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (3 messages)
From: Stephen Hemminger
Date: Friday, March 20, 2009 - 10:35 pm

Convert this driver to new net_device_ops infrastructure.
Also use default net_device get-stats infrastructure

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/infiniband/hw/amso1100/c2.c          |   41 ++++++++++++---------------
 drivers/infiniband/hw/amso1100/c2.h          |    2 -
 drivers/infiniband/hw/amso1100/c2_provider.c |   22 +++++++-------
 3 files changed, 30 insertions(+), 35 deletions(-)

--- a/drivers/infiniband/hw/amso1100/c2.c	2009-03-19 22:40:30.574963980 -0700
+++ b/drivers/infiniband/hw/amso1100/c2.c	2009-03-19 22:42:42.388718732 -0700
@@ -76,7 +76,6 @@ static irqreturn_t c2_interrupt(int irq,
 static void c2_tx_timeout(struct net_device *netdev);
 static int c2_change_mtu(struct net_device *netdev, int new_mtu);
 static void c2_reset(struct c2_port *c2_port);
-static struct net_device_stats *c2_get_stats(struct net_device *netdev);
 
 static struct pci_device_id c2_pci_table[] = {
 	{ PCI_DEVICE(0x18b8, 0xb001) },
@@ -349,7 +348,7 @@ static void c2_tx_clean(struct c2_port *
 					     elem->hw_desc + C2_TXP_ADDR);
 				__raw_writew((__force u16) cpu_to_be16(TXP_HTXD_DONE),
 					     elem->hw_desc + C2_TXP_FLAGS);
-				c2_port->netstats.tx_dropped++;
+				c2_port->netdev->stats.tx_dropped++;
 				break;
 			} else {
 				__raw_writew(0,
@@ -457,7 +456,7 @@ static void c2_rx_error(struct c2_port *
 		     elem->hw_desc + C2_RXP_FLAGS);
 
 	pr_debug("packet dropped\n");
-	c2_port->netstats.rx_dropped++;
+	c2_port->netdev->stats.rx_dropped++;
 }
 
 static void c2_rx_interrupt(struct net_device *netdev)
@@ -532,8 +531,8 @@ static void c2_rx_interrupt(struct net_d
 		netif_rx(skb);
 
 		netdev->last_rx = jiffies;
-		c2_port->netstats.rx_packets++;
-		c2_port->netstats.rx_bytes += buflen;
+		netdev->stats.rx_packets++;
+		netdev->stats.rx_bytes += buflen;
 	}
 
 	/* Save where we left off */
@@ -797,8 +796,8 @@ static int c2_xmit_frame(struct sk_buff 
 	__raw_writew((__force u16) cpu_to_be16(TXP_HTXD_READY),
 		     ...
From: Steve Wise
Date: Saturday, March 21, 2009 - 11:26 am

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
--

From: David Miller
Date: Saturday, March 21, 2009 - 7:34 pm

From: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--

From: Roland Dreier
Date: Sunday, March 22, 2009 - 9:12 am

Don't I already have this queued in my for-next branch?

Or is this an updated version?

[And same applies to the nes driver changes]

 - R.
--

From: David Miller
Date: Sunday, March 22, 2009 - 9:17 pm

From: Roland Dreier <rdreier@cisco.com>

Any chance you can drop the copies in your tree?

The reason I'm asking is that once all the conversions are in
net-next-2.6 which hit the i386 allmodconfig build there is a change
we can add (which in fast is in net-next-2.6 now) which exposes a
config option to turn all of the pre-netdev_ops compatibility stuff
off.

We can't do that until i386 builds in all configurations.
--

Previous thread: [PATCH 04/77] infiniband: convert nes driver to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (2 messages)

Next thread: [PATCH 20/77] irda: convert ks959 device to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (3 messages)