public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>, david.vrabel@csr•com
Cc: netdev@vger•kernel.org
Subject: [PATCH 38/42] uwb: convert devices to net_device_ops
Date: Tue, 06 Jan 2009 16:33:54 -0800	[thread overview]
Message-ID: <20090107003349.555693360@vyatta.com> (raw)
In-Reply-To: 20090107003316.784424362@vyatta.com

[-- Attachment #1: uwb.patch --]
[-- Type: text/plain, Size: 4153 bytes --]

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

--- a/drivers/uwb/i1480/i1480u-wlp/lc.c	2009-01-05 14:31:38.074069717 -0800
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c	2009-01-05 14:36:27.342318530 -0800
@@ -181,6 +181,15 @@ error:
 }
 #endif
 
+static const struct net_device_ops i1480u_netdev_ops = {
+	.ndo_open	= i1480u_open,
+	.ndo_stop 	= i1480u_stop,
+	.ndo_start_xmit = i1480u_hard_start_xmit,
+	.ndo_tx_timeout = i1480u_tx_timeout,
+	.ndo_set_config = i1480u_set_config,
+	.ndo_change_mtu = i1480u_change_mtu,
+};
+
 static
 int i1480u_add(struct i1480u *i1480u, struct usb_interface *iface)
 {
@@ -235,13 +244,7 @@ int i1480u_add(struct i1480u *i1480u, st
 	net_dev->features |= NETIF_F_HIGHDMA;
 	net_dev->watchdog_timeo = 5*HZ;		/* FIXME: a better default? */
 
-	net_dev->open = i1480u_open;
-	net_dev->stop = i1480u_stop;
-	net_dev->hard_start_xmit = i1480u_hard_start_xmit;
-	net_dev->tx_timeout = i1480u_tx_timeout;
-	net_dev->get_stats = i1480u_get_stats;
-	net_dev->set_config = i1480u_set_config;
-	net_dev->change_mtu = i1480u_change_mtu;
+	net_dev->netdev_ops = &i1480u_netdev_ops;
 
 #ifdef i1480u_FLOW_CONTROL
 	/* Notification endpoint setup (submitted when we open the device) */
--- a/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h	2009-01-05 14:35:49.078569623 -0800
+++ b/drivers/uwb/i1480/i1480u-wlp/i1480u-wlp.h	2009-01-05 14:36:06.718845136 -0800
@@ -221,7 +221,6 @@ struct i1480u {
 	struct net_device *net_dev;
 
 	spinlock_t lock;
-	struct net_device_stats stats;
 
 	/* RX context handling */
 	struct sk_buff *rx_skb;
@@ -271,7 +270,6 @@ extern int i1480u_stop(struct net_device
 extern int i1480u_hard_start_xmit(struct sk_buff *, struct net_device *);
 extern void i1480u_tx_timeout(struct net_device *);
 extern int i1480u_set_config(struct net_device *, struct ifmap *);
-extern struct net_device_stats *i1480u_get_stats(struct net_device *);
 extern int i1480u_change_mtu(struct net_device *, int);
 extern void i1480u_uwb_notifs_cb(void *, struct uwb_dev *, enum uwb_notifs);
 
--- a/drivers/uwb/i1480/i1480u-wlp/netdev.c	2009-01-05 14:34:29.010821205 -0800
+++ b/drivers/uwb/i1480/i1480u-wlp/netdev.c	2009-01-05 14:36:19.862975627 -0800
@@ -262,15 +262,6 @@ int i1480u_stop(struct net_device *net_d
 	return 0;
 }
 
-
-/** Report statistics */
-struct net_device_stats *i1480u_get_stats(struct net_device *net_dev)
-{
-	struct i1480u *i1480u = netdev_priv(net_dev);
-	return &i1480u->stats;
-}
-
-
 /**
  *
  * Change the interface config--we probably don't have to do anything.
--- a/drivers/uwb/i1480/i1480u-wlp/rx.c	2009-01-05 14:37:21.409819109 -0800
+++ b/drivers/uwb/i1480/i1480u-wlp/rx.c	2009-01-05 14:46:48.222569803 -0800
@@ -167,7 +167,7 @@ do {							\
 do {							\
 	if (printk_ratelimit())				\
 		dev_err(&i1480u->usb_iface->dev, msg);	\
-	i1480u->stats.rx_dropped++;			\
+	i1480u->net_dev->stats.rx_dropped++;			\
 } while (0)
 
 
@@ -193,10 +193,8 @@ void i1480u_skb_deliver(struct i1480u *i
 	if (!should_parse)
 		goto out;
 	i1480u->rx_skb->protocol = eth_type_trans(i1480u->rx_skb, net_dev);
-	i1480u->stats.rx_packets++;
-	i1480u->stats.rx_bytes += i1480u->rx_untd_pkt_size;
-	net_dev->last_rx = jiffies;
-	/* FIXME: flow control: check netif_rx() retval */
+	net_dev->stats.rx_packets++;
+	net_dev->stats.rx_bytes += i1480u->rx_untd_pkt_size;
 
 	netif_rx(i1480u->rx_skb);		/* deliver */
 out:
--- a/drivers/uwb/i1480/i1480u-wlp/tx.c	2009-01-05 14:38:33.469819531 -0800
+++ b/drivers/uwb/i1480/i1480u-wlp/tx.c	2009-01-05 14:46:39.510569625 -0800
@@ -117,8 +117,8 @@ void i1480u_tx_cb(struct urb *urb)
 	switch (urb->status) {
 	case 0:
 		spin_lock_irqsave(&i1480u->lock, flags);
-		i1480u->stats.tx_packets++;
-		i1480u->stats.tx_bytes += urb->actual_length;
+		net_dev->stats.tx_packets++;
+		net_dev->stats.tx_bytes += urb->actual_length;
 		spin_unlock_irqrestore(&i1480u->lock, flags);
 		break;
 	case -ECONNRESET:	/* Not an error, but a controlled situation; */
@@ -530,7 +530,7 @@ int i1480u_hard_start_xmit(struct sk_buf
 	return NETDEV_TX_OK;
 error:
 	dev_kfree_skb_any(skb);
-	i1480u->stats.tx_dropped++;
+	net_dev->stats.tx_dropped++;
 out:
 	return NETDEV_TX_OK;
 }

-- 


  parent reply	other threads:[~2009-01-07  0:54 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07  0:33 [PATCH 00/42] Still more net_device API updates Stephen Hemminger
2009-01-07  0:33 ` [PATCH 01/42] appletalk: convert aarp to net_device_ops Stephen Hemminger
2009-01-08  1:21   ` David Miller
2009-01-08  3:09     ` Joe Perches
2009-01-08  4:39       ` David Miller
2009-01-07  0:33 ` [PATCH 02/42] appletalk: convert ipddp " Stephen Hemminger
2009-01-08  1:22   ` David Miller
2009-01-07  0:33 ` [PATCH 03/42] bluetooth: driver API update Stephen Hemminger
     [not found]   ` <20090107003345.753201945-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
2009-01-07  1:53     ` Marcel Holtmann
2009-01-08  1:23       ` David Miller
2009-01-07  0:33 ` [PATCH 05/42] cassini: update to net_device_ops Stephen Hemminger
2009-01-08  1:25   ` David Miller
2009-01-07  0:33 ` [PATCH 06/42] ipg: " Stephen Hemminger
2009-01-07  7:59   ` Pekka Enberg
2009-01-08  1:26     ` David Miller
2009-01-07  0:33 ` [PATCH 07/42] plip: " Stephen Hemminger
2009-01-08  1:26   ` David Miller
2009-01-07  0:33 ` [PATCH 08/42] tlan: " Stephen Hemminger
2009-01-08  1:27   ` David Miller
2009-01-07  0:33 ` [PATCH 09/42] epic100: " Stephen Hemminger
2009-01-08  1:27   ` David Miller
2009-01-07  0:33 ` [PATCH 10/42] sunhme: " Stephen Hemminger
2009-01-08  1:28   ` David Miller
2009-01-07  0:33 ` [PATCH 11/42] sungem: " Stephen Hemminger
2009-01-08  1:29   ` David Miller
2009-01-07  0:33 ` [PATCH 12/42] pcnet32: " Stephen Hemminger
2009-01-08  1:29   ` David Miller
2009-01-07  0:33 ` [PATCH 13/42] typhoon: " Stephen Hemminger
2009-01-08  1:29   ` David Miller
2009-01-07  0:33 ` [PATCH 14/42] enc28j60: " Stephen Hemminger
2009-01-08  1:30   ` David Miller
2009-01-07  0:33 ` [PATCH 16/42] de600: " Stephen Hemminger
2009-01-08  1:35   ` David Miller
2009-01-08  1:48     ` [PATCH 15/42] hp100: " Stephen Hemminger
2009-01-08  2:13       ` David Miller
2009-01-07  0:33 ` [PATCH 17/42] sis190: " Stephen Hemminger
2009-01-08  1:35   ` David Miller
2009-01-07  0:33 ` [PATCH 18/42] ns83820: fix net_device_ops support Stephen Hemminger
2009-01-08  1:36   ` David Miller
2009-01-07  0:33 ` [PATCH 19/42] sb1000: update to net_device_ops Stephen Hemminger
2009-01-08  1:57   ` David Miller
2009-01-07  0:33 ` [PATCH 20/42] natsemi: " Stephen Hemminger
2009-01-08  1:57   ` David Miller
2009-01-07  0:33 ` [PATCH 21/42] fealnx: " Stephen Hemminger
2009-01-08  1:57   ` David Miller
2009-01-07  0:33 ` [PATCH 22/42] starfire: " Stephen Hemminger
2009-01-08  1:58   ` David Miller
2009-01-07  0:33 ` [PATCH 23/42] sundance: " Stephen Hemminger
2009-01-08  1:58   ` David Miller
2009-01-07  0:33 ` [PATCH 24/42] tulip: convert devices to new API Stephen Hemminger
2009-01-07  7:49   ` Grant Grundler
2009-01-08  1:59     ` David Miller
2009-01-07  0:33 ` [PATCH 25/42] de2104x: convert to net_device_ops Stephen Hemminger
2009-01-07  7:50   ` Grant Grundler
2009-01-08  1:59   ` David Miller
2009-01-07  0:33 ` [PATCH 26/42] de4x5: " Stephen Hemminger
2009-01-08  2:00   ` David Miller
2009-01-07  0:33 ` [PATCH 27/42] xircom: convert devices to new API Stephen Hemminger
2009-01-08  2:01   ` David Miller
2009-01-07  0:33 ` [PATCH 28/42] dmfe: convert " Stephen Hemminger
2009-01-08 21:16   ` Grant Grundler
2009-01-08 21:32     ` David Miller
2009-01-07  0:33 ` [PATCH 29/42] uli526x: convert devices " Stephen Hemminger
2009-01-08  2:01   ` David Miller
2009-01-07  0:33 ` [PATCH 30/42] windbond: " Stephen Hemminger
2009-01-08  2:02   ` David Miller
2009-01-07  0:33 ` [PATCH 31/42] dvb: update network device to current API Stephen Hemminger
2009-01-08  2:02   ` David Miller
2009-01-07  0:33 ` [PATCH 32/42] hysdn: convert to net_device_ops and other updates Stephen Hemminger
2009-01-08  2:03   ` David Miller
2009-01-07  0:33 ` [PATCH 33/42] I4l: convert to net_device_ops Stephen Hemminger
2009-01-07  0:33 ` [PATCH 34/42] fusion: convert devices to new API Stephen Hemminger
2009-01-08  2:04   ` David Miller
2009-01-07  0:33 ` [PATCH 35/42] xpnet: " Stephen Hemminger
2009-01-08  2:05   ` David Miller
2009-01-07  0:33 ` [PATCH 36/42] gadget: " Stephen Hemminger
2009-01-08  2:05   ` David Miller
2009-01-07  0:33 ` [PATCH 37/42] synclink: " Stephen Hemminger
2009-01-07 23:48   ` [PATCH 37/42] synclink: convert devices to new API (rev2) Stephen Hemminger
2009-01-08  2:08     ` David Miller
2009-01-08 22:49       ` Krzysztof Halasa
2009-01-08 22:55         ` Krzysztof Halasa
2009-01-13  0:18         ` David Miller
2009-01-07  0:33 ` Stephen Hemminger [this message]
2009-01-07 10:38   ` [PATCH 38/42] uwb: convert devices to net_device_ops David Vrabel
2009-01-08  2:09     ` David Miller
2009-01-07  0:33 ` [PATCH 39/42] slip: convert " Stephen Hemminger
2009-01-08  2:09   ` David Miller
2009-01-07  0:33 ` [PATCH 40/42] amd8111e: " Stephen Hemminger
2009-01-08  2:10   ` David Miller
2009-01-07  0:33 ` [PATCH 41/42] atp: " Stephen Hemminger
2009-01-08  2:10   ` David Miller
2009-01-07  0:33 ` [PATCH 42/42] b44: " Stephen Hemminger
2009-01-08  2:10   ` David Miller
     [not found] ` <20090107003345.872219054@vyatta.com>
2009-01-08  1:25   ` [PATCH 04/42] phonet: update " 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=20090107003349.555693360@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=david.vrabel@csr$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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