aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:37:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:37:49 -0500
commit454d7c9b14e20fd1949e2686e9de4a2926e01476 (patch)
treefae8bd1bfb5fd496977a0639ad71c54a2ee278ae /drivers/net
parent7a12122c7a00347da9669cfcde82954c9e3d6f5e (diff)
netdevice: safe convert to netdev_priv() #part-1
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c501.c2
-rw-r--r--drivers/net/3c505.c45
-rw-r--r--drivers/net/3c523.c29
-rw-r--r--drivers/net/3c59x.c4
-rw-r--r--drivers/net/acenic.c2
-rw-r--r--drivers/net/appletalk/ipddp.c6
-rw-r--r--drivers/net/appletalk/ltpc.c12
-rw-r--r--drivers/net/arcnet/arc-rawmode.c4
-rw-r--r--drivers/net/arcnet/arc-rimi.c16
-rw-r--r--drivers/net/arcnet/arcnet.c32
-rw-r--r--drivers/net/arcnet/capmode.c6
-rw-r--r--drivers/net/arcnet/com20020-isa.c4
-rw-r--r--drivers/net/arcnet/com20020-pci.c2
-rw-r--r--drivers/net/arcnet/com20020.c10
-rw-r--r--drivers/net/arcnet/com90io.c4
-rw-r--r--drivers/net/arcnet/com90xx.c10
-rw-r--r--drivers/net/arcnet/rfc1051.c8
-rw-r--r--drivers/net/arcnet/rfc1201.c12
-rw-r--r--drivers/net/atarilance.c34
-rw-r--r--drivers/net/atl1e/atl1e_main.c6
-rw-r--r--drivers/net/atp.c3
-rw-r--r--drivers/net/au1000_eth.c48
-rw-r--r--drivers/net/bonding/bond_3ad.c7
-rw-r--r--drivers/net/bonding/bond_alb.c6
-rw-r--r--drivers/net/bonding/bond_main.c58
-rw-r--r--drivers/net/bonding/bond_sysfs.c2
-rw-r--r--drivers/net/bonding/bonding.h4
-rw-r--r--drivers/net/iseries_veth.c14
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c6
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c6
-rw-r--r--drivers/net/lp486e.c28
-rw-r--r--drivers/net/mace.c28
32 files changed, 229 insertions, 229 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index 3a44db1ed749..3d1318a3e688 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -297,8 +297,8 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
297 if (el_debug) 297 if (el_debug)
298 printk(KERN_DEBUG "%s", version); 298 printk(KERN_DEBUG "%s", version);
299 299
300 memset(dev->priv, 0, sizeof(struct net_local));
301 lp = netdev_priv(dev); 300 lp = netdev_priv(dev);
301 memset(lp, 0, sizeof(struct net_local));
302 spin_lock_init(&lp->lock); 302 spin_lock_init(&lp->lock);
303 303
304 /* 304 /*
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index e669da76ed09..6124605bef05 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -203,10 +203,10 @@ static inline int inb_command(unsigned int base_addr)
203static inline void outb_control(unsigned char val, struct net_device *dev) 203static inline void outb_control(unsigned char val, struct net_device *dev)
204{ 204{
205 outb(val, dev->base_addr + PORT_CONTROL); 205 outb(val, dev->base_addr + PORT_CONTROL);
206 ((elp_device *)(dev->priv))->hcr_val = val; 206 ((elp_device *)(netdev_priv(dev)))->hcr_val = val;
207} 207}
208 208
209#define HCR_VAL(x) (((elp_device *)((x)->priv))->hcr_val) 209#define HCR_VAL(x) (((elp_device *)(netdev_priv(x)))->hcr_val)
210 210
211static inline void outb_command(unsigned char val, unsigned int base_addr) 211static inline void outb_command(unsigned char val, unsigned int base_addr)
212{ 212{
@@ -247,7 +247,7 @@ static inline int get_status(unsigned int base_addr)
247 247
248static inline void set_hsf(struct net_device *dev, int hsf) 248static inline void set_hsf(struct net_device *dev, int hsf)
249{ 249{
250 elp_device *adapter = dev->priv; 250 elp_device *adapter = netdev_priv(dev);
251 unsigned long flags; 251 unsigned long flags;
252 252
253 spin_lock_irqsave(&adapter->lock, flags); 253 spin_lock_irqsave(&adapter->lock, flags);
@@ -260,7 +260,7 @@ static bool start_receive(struct net_device *, pcb_struct *);
260static inline void adapter_reset(struct net_device *dev) 260static inline void adapter_reset(struct net_device *dev)
261{ 261{
262 unsigned long timeout; 262 unsigned long timeout;
263 elp_device *adapter = dev->priv; 263 elp_device *adapter = netdev_priv(dev);
264 unsigned char orig_hcr = adapter->hcr_val; 264 unsigned char orig_hcr = adapter->hcr_val;
265 265
266 outb_control(0, dev); 266 outb_control(0, dev);
@@ -293,7 +293,7 @@ static inline void adapter_reset(struct net_device *dev)
293 */ 293 */
294static inline void check_3c505_dma(struct net_device *dev) 294static inline void check_3c505_dma(struct net_device *dev)
295{ 295{
296 elp_device *adapter = dev->priv; 296 elp_device *adapter = netdev_priv(dev);
297 if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) { 297 if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) {
298 unsigned long flags, f; 298 unsigned long flags, f;
299 printk(KERN_ERR "%s: DMA %s timed out, %d bytes left\n", dev->name, adapter->current_dma.direction ? "download" : "upload", get_dma_residue(dev->dma)); 299 printk(KERN_ERR "%s: DMA %s timed out, %d bytes left\n", dev->name, adapter->current_dma.direction ? "download" : "upload", get_dma_residue(dev->dma));
@@ -340,7 +340,7 @@ static inline bool send_pcb_fast(unsigned int base_addr, unsigned char byte)
340/* Check to see if the receiver needs restarting, and kick it if so */ 340/* Check to see if the receiver needs restarting, and kick it if so */
341static inline void prime_rx(struct net_device *dev) 341static inline void prime_rx(struct net_device *dev)
342{ 342{
343 elp_device *adapter = dev->priv; 343 elp_device *adapter = netdev_priv(dev);
344 while (adapter->rx_active < ELP_RX_PCBS && netif_running(dev)) { 344 while (adapter->rx_active < ELP_RX_PCBS && netif_running(dev)) {
345 if (!start_receive(dev, &adapter->itx_pcb)) 345 if (!start_receive(dev, &adapter->itx_pcb))
346 break; 346 break;
@@ -375,7 +375,7 @@ static bool send_pcb(struct net_device *dev, pcb_struct * pcb)
375{ 375{
376 int i; 376 int i;
377 unsigned long timeout; 377 unsigned long timeout;
378 elp_device *adapter = dev->priv; 378 elp_device *adapter = netdev_priv(dev);
379 unsigned long flags; 379 unsigned long flags;
380 380
381 check_3c505_dma(dev); 381 check_3c505_dma(dev);
@@ -463,7 +463,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
463 unsigned long timeout; 463 unsigned long timeout;
464 unsigned long flags; 464 unsigned long flags;
465 465
466 elp_device *adapter = dev->priv; 466 elp_device *adapter = netdev_priv(dev);
467 467
468 set_hsf(dev, 0); 468 set_hsf(dev, 0);
469 469
@@ -543,7 +543,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
543static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb) 543static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb)
544{ 544{
545 bool status; 545 bool status;
546 elp_device *adapter = dev->priv; 546 elp_device *adapter = netdev_priv(dev);
547 547
548 if (elp_debug >= 3) 548 if (elp_debug >= 3)
549 printk(KERN_DEBUG "%s: restarting receiver\n", dev->name); 549 printk(KERN_DEBUG "%s: restarting receiver\n", dev->name);
@@ -571,7 +571,7 @@ static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb)
571static void receive_packet(struct net_device *dev, int len) 571static void receive_packet(struct net_device *dev, int len)
572{ 572{
573 int rlen; 573 int rlen;
574 elp_device *adapter = dev->priv; 574 elp_device *adapter = netdev_priv(dev);
575 void *target; 575 void *target;
576 struct sk_buff *skb; 576 struct sk_buff *skb;
577 unsigned long flags; 577 unsigned long flags;
@@ -638,13 +638,10 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
638 int len; 638 int len;
639 int dlen; 639 int dlen;
640 int icount = 0; 640 int icount = 0;
641 struct net_device *dev; 641 struct net_device *dev = dev_id;
642 elp_device *adapter; 642 elp_device *adapter = netdev_priv(dev);
643 unsigned long timeout; 643 unsigned long timeout;
644 644
645 dev = dev_id;
646 adapter = (elp_device *) dev->priv;
647
648 spin_lock(&adapter->lock); 645 spin_lock(&adapter->lock);
649 646
650 do { 647 do {
@@ -837,11 +834,9 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
837 834
838static int elp_open(struct net_device *dev) 835static int elp_open(struct net_device *dev)
839{ 836{
840 elp_device *adapter; 837 elp_device *adapter = netdev_priv(dev);
841 int retval; 838 int retval;
842 839
843 adapter = dev->priv;
844
845 if (elp_debug >= 3) 840 if (elp_debug >= 3)
846 printk(KERN_DEBUG "%s: request to open device\n", dev->name); 841 printk(KERN_DEBUG "%s: request to open device\n", dev->name);
847 842
@@ -970,7 +965,7 @@ static int elp_open(struct net_device *dev)
970 965
971static bool send_packet(struct net_device *dev, struct sk_buff *skb) 966static bool send_packet(struct net_device *dev, struct sk_buff *skb)
972{ 967{
973 elp_device *adapter = dev->priv; 968 elp_device *adapter = netdev_priv(dev);
974 unsigned long target; 969 unsigned long target;
975 unsigned long flags; 970 unsigned long flags;
976 971
@@ -1061,7 +1056,7 @@ static void elp_timeout(struct net_device *dev)
1061static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev) 1056static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
1062{ 1057{
1063 unsigned long flags; 1058 unsigned long flags;
1064 elp_device *adapter = dev->priv; 1059 elp_device *adapter = netdev_priv(dev);
1065 1060
1066 spin_lock_irqsave(&adapter->lock, flags); 1061 spin_lock_irqsave(&adapter->lock, flags);
1067 check_3c505_dma(dev); 1062 check_3c505_dma(dev);
@@ -1103,7 +1098,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
1103 1098
1104static struct net_device_stats *elp_get_stats(struct net_device *dev) 1099static struct net_device_stats *elp_get_stats(struct net_device *dev)
1105{ 1100{
1106 elp_device *adapter = (elp_device *) dev->priv; 1101 elp_device *adapter = netdev_priv(dev);
1107 1102
1108 if (elp_debug >= 3) 1103 if (elp_debug >= 3)
1109 printk(KERN_DEBUG "%s: request for stats\n", dev->name); 1104 printk(KERN_DEBUG "%s: request for stats\n", dev->name);
@@ -1165,9 +1160,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
1165 1160
1166static int elp_close(struct net_device *dev) 1161static int elp_close(struct net_device *dev)
1167{ 1162{
1168 elp_device *adapter; 1163 elp_device *adapter = netdev_priv(dev);
1169
1170 adapter = dev->priv;
1171 1164
1172 if (elp_debug >= 3) 1165 if (elp_debug >= 3)
1173 printk(KERN_DEBUG "%s: request to close device\n", dev->name); 1166 printk(KERN_DEBUG "%s: request to close device\n", dev->name);
@@ -1208,7 +1201,7 @@ static int elp_close(struct net_device *dev)
1208 1201
1209static void elp_set_mc_list(struct net_device *dev) 1202static void elp_set_mc_list(struct net_device *dev)
1210{ 1203{
1211 elp_device *adapter = (elp_device *) dev->priv; 1204 elp_device *adapter = netdev_priv(dev);
1212 struct dev_mc_list *dmi = dev->mc_list; 1205 struct dev_mc_list *dmi = dev->mc_list;
1213 int i; 1206 int i;
1214 unsigned long flags; 1207 unsigned long flags;
@@ -1379,7 +1372,7 @@ static int __init elp_autodetect(struct net_device *dev)
1379 1372
1380static int __init elplus_setup(struct net_device *dev) 1373static int __init elplus_setup(struct net_device *dev)
1381{ 1374{
1382 elp_device *adapter = dev->priv; 1375 elp_device *adapter = netdev_priv(dev);
1383 int i, tries, tries1, okay; 1376 int i, tries, tries1, okay;
1384 unsigned long timeout; 1377 unsigned long timeout;
1385 unsigned long cookie = 0; 1378 unsigned long cookie = 0;
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 0885aeeac98a..59ea2910bcac 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -308,7 +308,7 @@ static int elmc_open(struct net_device *dev)
308 308
309static int __init check586(struct net_device *dev, unsigned long where, unsigned size) 309static int __init check586(struct net_device *dev, unsigned long where, unsigned size)
310{ 310{
311 struct priv *p = (struct priv *) dev->priv; 311 struct priv *p = netdev_priv(dev);
312 char *iscp_addrs[2]; 312 char *iscp_addrs[2];
313 int i = 0; 313 int i = 0;
314 314
@@ -349,7 +349,7 @@ static int __init check586(struct net_device *dev, unsigned long where, unsigned
349 349
350void alloc586(struct net_device *dev) 350void alloc586(struct net_device *dev)
351{ 351{
352 struct priv *p = (struct priv *) dev->priv; 352 struct priv *p = netdev_priv(dev);
353 353
354 elmc_id_reset586(); 354 elmc_id_reset586();
355 DELAY(2); 355 DELAY(2);
@@ -415,7 +415,7 @@ static int __init do_elmc_probe(struct net_device *dev)
415 int i = 0; 415 int i = 0;
416 unsigned int size = 0; 416 unsigned int size = 0;
417 int retval; 417 int retval;
418 struct priv *pr = dev->priv; 418 struct priv *pr = netdev_priv(dev);
419 419
420 if (MCA_bus == 0) { 420 if (MCA_bus == 0) {
421 return -ENODEV; 421 return -ENODEV;
@@ -578,7 +578,8 @@ err_out:
578 578
579static void cleanup_card(struct net_device *dev) 579static void cleanup_card(struct net_device *dev)
580{ 580{
581 mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL); 581 mca_set_adapter_procfn(((struct priv *)netdev_priv(dev))->slot,
582 NULL, NULL);
582 release_region(dev->base_addr, ELMC_IO_EXTENT); 583 release_region(dev->base_addr, ELMC_IO_EXTENT);
583} 584}
584 585
@@ -614,7 +615,7 @@ static int init586(struct net_device *dev)
614 void *ptr; 615 void *ptr;
615 unsigned long s; 616 unsigned long s;
616 int i, result = 0; 617 int i, result = 0;
617 struct priv *p = (struct priv *) dev->priv; 618 struct priv *p = netdev_priv(dev);
618 volatile struct configure_cmd_struct *cfg_cmd; 619 volatile struct configure_cmd_struct *cfg_cmd;
619 volatile struct iasetup_cmd_struct *ias_cmd; 620 volatile struct iasetup_cmd_struct *ias_cmd;
620 volatile struct tdr_cmd_struct *tdr_cmd; 621 volatile struct tdr_cmd_struct *tdr_cmd;
@@ -850,7 +851,7 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
850 volatile struct rfd_struct *rfd = (struct rfd_struct *) ptr; 851 volatile struct rfd_struct *rfd = (struct rfd_struct *) ptr;
851 volatile struct rbd_struct *rbd; 852 volatile struct rbd_struct *rbd;
852 int i; 853 int i;
853 struct priv *p = (struct priv *) dev->priv; 854 struct priv *p = netdev_priv(dev);
854 855
855 memset((char *) rfd, 0, sizeof(struct rfd_struct) * p->num_recv_buffs); 856 memset((char *) rfd, 0, sizeof(struct rfd_struct) * p->num_recv_buffs);
856 p->rfd_first = rfd; 857 p->rfd_first = rfd;
@@ -911,7 +912,7 @@ elmc_interrupt(int irq, void *dev_id)
911 } 912 }
912 /* reading ELMC_CTRL also clears the INT bit. */ 913 /* reading ELMC_CTRL also clears the INT bit. */
913 914
914 p = (struct priv *) dev->priv; 915 p = netdev_priv(dev);
915 916
916 while ((stat = p->scb->status & STAT_MASK)) 917 while ((stat = p->scb->status & STAT_MASK))
917 { 918 {
@@ -967,7 +968,7 @@ static void elmc_rcv_int(struct net_device *dev)
967 unsigned short totlen; 968 unsigned short totlen;
968 struct sk_buff *skb; 969 struct sk_buff *skb;
969 struct rbd_struct *rbd; 970 struct rbd_struct *rbd;
970 struct priv *p = (struct priv *) dev->priv; 971 struct priv *p = netdev_priv(dev);
971 972
972 for (; (status = p->rfd_top->status) & STAT_COMPL;) { 973 for (; (status = p->rfd_top->status) & STAT_COMPL;) {
973 rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset); 974 rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset);
@@ -1010,7 +1011,7 @@ static void elmc_rcv_int(struct net_device *dev)
1010 1011
1011static void elmc_rnr_int(struct net_device *dev) 1012static void elmc_rnr_int(struct net_device *dev)
1012{ 1013{
1013 struct priv *p = (struct priv *) dev->priv; 1014 struct priv *p = netdev_priv(dev);
1014 1015
1015 dev->stats.rx_errors++; 1016 dev->stats.rx_errors++;
1016 1017
@@ -1033,7 +1034,7 @@ static void elmc_rnr_int(struct net_device *dev)
1033static void elmc_xmt_int(struct net_device *dev) 1034static void elmc_xmt_int(struct net_device *dev)
1034{ 1035{
1035 int status; 1036 int status;
1036 struct priv *p = (struct priv *) dev->priv; 1037 struct priv *p = netdev_priv(dev);
1037 1038
1038 status = p->xmit_cmds[p->xmit_last]->cmd_status; 1039 status = p->xmit_cmds[p->xmit_last]->cmd_status;
1039 if (!(status & STAT_COMPL)) { 1040 if (!(status & STAT_COMPL)) {
@@ -1076,7 +1077,7 @@ static void elmc_xmt_int(struct net_device *dev)
1076 1077
1077static void startrecv586(struct net_device *dev) 1078static void startrecv586(struct net_device *dev)
1078{ 1079{
1079 struct priv *p = (struct priv *) dev->priv; 1080 struct priv *p = netdev_priv(dev);
1080 1081
1081 p->scb->rfa_offset = make16(p->rfd_first); 1082 p->scb->rfa_offset = make16(p->rfd_first);
1082 p->scb->cmd = RUC_START; 1083 p->scb->cmd = RUC_START;
@@ -1090,7 +1091,7 @@ static void startrecv586(struct net_device *dev)
1090 1091
1091static void elmc_timeout(struct net_device *dev) 1092static void elmc_timeout(struct net_device *dev)
1092{ 1093{
1093 struct priv *p = (struct priv *) dev->priv; 1094 struct priv *p = netdev_priv(dev);
1094 /* COMMAND-UNIT active? */ 1095 /* COMMAND-UNIT active? */
1095 if (p->scb->status & CU_ACTIVE) { 1096 if (p->scb->status & CU_ACTIVE) {
1096#ifdef DEBUG 1097#ifdef DEBUG
@@ -1126,7 +1127,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
1126#ifndef NO_NOPCOMMANDS 1127#ifndef NO_NOPCOMMANDS
1127 int next_nop; 1128 int next_nop;
1128#endif 1129#endif
1129 struct priv *p = (struct priv *) dev->priv; 1130 struct priv *p = netdev_priv(dev);
1130 1131
1131 netif_stop_queue(dev); 1132 netif_stop_queue(dev);
1132 1133
@@ -1197,7 +1198,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
1197 1198
1198static struct net_device_stats *elmc_get_stats(struct net_device *dev) 1199static struct net_device_stats *elmc_get_stats(struct net_device *dev)
1199{ 1200{
1200 struct priv *p = (struct priv *) dev->priv; 1201 struct priv *p = netdev_priv(dev);
1201 unsigned short crc, aln, rsc, ovrn; 1202 unsigned short crc, aln, rsc, ovrn;
1202 1203
1203 crc = p->scb->crc_errs; /* get error-statistic from the ni82586 */ 1204 crc = p->scb->crc_errs; /* get error-statistic from the ni82586 */
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 3893f505fb5f..665e7fdf27a1 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -803,7 +803,7 @@ static int vortex_suspend(struct pci_dev *pdev, pm_message_t state)
803{ 803{
804 struct net_device *dev = pci_get_drvdata(pdev); 804 struct net_device *dev = pci_get_drvdata(pdev);
805 805
806 if (dev && dev->priv) { 806 if (dev && netdev_priv(dev)) {
807 if (netif_running(dev)) { 807 if (netif_running(dev)) {
808 netif_device_detach(dev); 808 netif_device_detach(dev);
809 vortex_down(dev, 1); 809 vortex_down(dev, 1);
@@ -3214,7 +3214,7 @@ static void __exit vortex_eisa_cleanup(void)
3214#endif 3214#endif
3215 3215
3216 if (compaq_net_device) { 3216 if (compaq_net_device) {
3217 vp = compaq_net_device->priv; 3217 vp = netdev_priv(compaq_net_device);
3218 ioaddr = ioport_map(compaq_net_device->base_addr, 3218 ioaddr = ioport_map(compaq_net_device->base_addr,
3219 VORTEX_TOTAL_SIZE); 3219 VORTEX_TOTAL_SIZE);
3220 3220
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index b9d35f6786b3..109eb7ccff30 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -466,7 +466,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
466 466
467 SET_NETDEV_DEV(dev, &pdev->dev); 467 SET_NETDEV_DEV(dev, &pdev->dev);
468 468
469 ap = dev->priv; 469 ap = netdev_priv(dev);
470 ap->pdev = pdev; 470 ap->pdev = pdev;
471 ap->name = pci_name(pdev); 471 ap->name = pci_name(pdev);
472 472
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c
index 1071144edd66..9a0be9b2eaad 100644
--- a/drivers/net/appletalk/ipddp.c
+++ b/drivers/net/appletalk/ipddp.c
@@ -108,7 +108,7 @@ static struct net_device * __init ipddp_init(void)
108 */ 108 */
109static struct net_device_stats *ipddp_get_stats(struct net_device *dev) 109static struct net_device_stats *ipddp_get_stats(struct net_device *dev)
110{ 110{
111 return dev->priv; 111 return netdev_priv(dev);
112} 112}
113 113
114/* 114/*
@@ -170,8 +170,8 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
170 170
171 skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */ 171 skb->protocol = htons(ETH_P_ATALK); /* Protocol has changed */
172 172
173 ((struct net_device_stats *) dev->priv)->tx_packets++; 173 ((struct net_device_stats *) netdev_priv(dev))->tx_packets++;
174 ((struct net_device_stats *) dev->priv)->tx_bytes+=skb->len; 174 ((struct net_device_stats *) netdev_priv(dev))->tx_bytes += skb->len;
175 175
176 if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0) 176 if(aarp_send_ddp(rt->dev, skb, &rt->at, NULL) < 0)
177 dev_kfree_skb(skb); 177 dev_kfree_skb(skb);
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 8d109a5f5571..dc4d49605603 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -726,7 +726,8 @@ static int sendup_buffer (struct net_device *dev)
726 int dnode, snode, llaptype, len; 726 int dnode, snode, llaptype, len;
727 int sklen; 727 int sklen;
728 struct sk_buff *skb; 728 struct sk_buff *skb;
729 struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats; 729 struct ltpc_private *ltpc_priv = netdev_priv(dev);
730 struct net_device_stats *stats = &ltpc_priv->stats;
730 struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf; 731 struct lt_rcvlap *ltc = (struct lt_rcvlap *) ltdmacbuf;
731 732
732 if (ltc->command != LT_RCVLAP) { 733 if (ltc->command != LT_RCVLAP) {
@@ -822,7 +823,8 @@ static int ltpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
822{ 823{
823 struct sockaddr_at *sa = (struct sockaddr_at *) &ifr->ifr_addr; 824 struct sockaddr_at *sa = (struct sockaddr_at *) &ifr->ifr_addr;
824 /* we'll keep the localtalk node address in dev->pa_addr */ 825 /* we'll keep the localtalk node address in dev->pa_addr */
825 struct atalk_addr *aa = &((struct ltpc_private *)dev->priv)->my_addr; 826 struct ltpc_private *ltpc_priv = netdev_priv(dev);
827 struct atalk_addr *aa = &ltpc_priv->my_addr;
826 struct lt_init c; 828 struct lt_init c;
827 int ltflags; 829 int ltflags;
828 830
@@ -903,7 +905,8 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
903 * and skb->len is the length of the ddp data + ddp header 905 * and skb->len is the length of the ddp data + ddp header
904 */ 906 */
905 907
906 struct net_device_stats *stats = &((struct ltpc_private *)dev->priv)->stats; 908 struct ltpc_private *ltpc_priv = netdev_priv(dev);
909 struct net_device_stats *stats = &ltpc_priv->stats;
907 910
908 int i; 911 int i;
909 struct lt_sendlap cbuf; 912 struct lt_sendlap cbuf;
@@ -942,7 +945,8 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
942 945
943static struct net_device_stats *ltpc_get_stats(struct net_device *dev) 946static struct net_device_stats *ltpc_get_stats(struct net_device *dev)
944{ 947{
945 struct net_device_stats *stats = &((struct ltpc_private *) dev->priv)->stats; 948 struct ltpc_private *ltpc_priv = netdev_priv(dev);
949 struct net_device_stats *stats = &ltpc_priv->stats;
946 return stats; 950 return stats;
947} 951}
948 952
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c
index 60088b3b61c4..3ff9affb1a91 100644
--- a/drivers/net/arcnet/arc-rawmode.c
+++ b/drivers/net/arcnet/arc-rawmode.c
@@ -87,7 +87,7 @@ MODULE_LICENSE("GPL");
87static void rx(struct net_device *dev, int bufnum, 87static void rx(struct net_device *dev, int bufnum,
88 struct archdr *pkthdr, int length) 88 struct archdr *pkthdr, int length)
89{ 89{
90 struct arcnet_local *lp = dev->priv; 90 struct arcnet_local *lp = netdev_priv(dev);
91 struct sk_buff *skb; 91 struct sk_buff *skb;
92 struct archdr *pkt = pkthdr; 92 struct archdr *pkt = pkthdr;
93 int ofs; 93 int ofs;
@@ -167,7 +167,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
167static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, 167static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
168 int bufnum) 168 int bufnum)
169{ 169{
170 struct arcnet_local *lp = dev->priv; 170 struct arcnet_local *lp = netdev_priv(dev);
171 struct arc_hardware *hard = &pkt->hard; 171 struct arc_hardware *hard = &pkt->hard;
172 int ofs; 172 int ofs;
173 173
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c
index 8c8d6c453c45..e3082a9350fc 100644
--- a/drivers/net/arcnet/arc-rimi.c
+++ b/drivers/net/arcnet/arc-rimi.c
@@ -194,7 +194,7 @@ static int __init arcrimi_found(struct net_device *dev)
194 194
195 /* initialize the rest of the device structure. */ 195 /* initialize the rest of the device structure. */
196 196
197 lp = dev->priv; 197 lp = netdev_priv(dev);
198 lp->card_name = "RIM I"; 198 lp->card_name = "RIM I";
199 lp->hw.command = arcrimi_command; 199 lp->hw.command = arcrimi_command;
200 lp->hw.status = arcrimi_status; 200 lp->hw.status = arcrimi_status;
@@ -260,7 +260,7 @@ err_free_irq:
260 */ 260 */
261static int arcrimi_reset(struct net_device *dev, int really_reset) 261static int arcrimi_reset(struct net_device *dev, int really_reset)
262{ 262{
263 struct arcnet_local *lp = dev->priv; 263 struct arcnet_local *lp = netdev_priv(dev);
264 void __iomem *ioaddr = lp->mem_start + 0x800; 264 void __iomem *ioaddr = lp->mem_start + 0x800;
265 265
266 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); 266 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS());
@@ -281,7 +281,7 @@ static int arcrimi_reset(struct net_device *dev, int really_reset)
281 281
282static void arcrimi_setmask(struct net_device *dev, int mask) 282static void arcrimi_setmask(struct net_device *dev, int mask)
283{ 283{
284 struct arcnet_local *lp = dev->priv; 284 struct arcnet_local *lp = netdev_priv(dev);
285 void __iomem *ioaddr = lp->mem_start + 0x800; 285 void __iomem *ioaddr = lp->mem_start + 0x800;
286 286
287 AINTMASK(mask); 287 AINTMASK(mask);
@@ -289,7 +289,7 @@ static void arcrimi_setmask(struct net_device *dev, int mask)
289 289
290static int arcrimi_status(struct net_device *dev) 290static int arcrimi_status(struct net_device *dev)
291{ 291{
292 struct arcnet_local *lp = dev->priv; 292 struct arcnet_local *lp = netdev_priv(dev);
293 void __iomem *ioaddr = lp->mem_start + 0x800; 293 void __iomem *ioaddr = lp->mem_start + 0x800;
294 294
295 return ASTATUS(); 295 return ASTATUS();
@@ -297,7 +297,7 @@ static int arcrimi_status(struct net_device *dev)
297 297
298static void arcrimi_command(struct net_device *dev, int cmd) 298static void arcrimi_command(struct net_device *dev, int cmd)
299{ 299{
300 struct arcnet_local *lp = dev->priv; 300 struct arcnet_local *lp = netdev_priv(dev);
301 void __iomem *ioaddr = lp->mem_start + 0x800; 301 void __iomem *ioaddr = lp->mem_start + 0x800;
302 302
303 ACOMMAND(cmd); 303 ACOMMAND(cmd);
@@ -306,7 +306,7 @@ static void arcrimi_command(struct net_device *dev, int cmd)
306static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, 306static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
307 void *buf, int count) 307 void *buf, int count)
308{ 308{
309 struct arcnet_local *lp = dev->priv; 309 struct arcnet_local *lp = netdev_priv(dev);
310 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; 310 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
311 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 311 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count));
312} 312}
@@ -315,7 +315,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset,
315static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, 315static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset,
316 void *buf, int count) 316 void *buf, int count)
317{ 317{
318 struct arcnet_local *lp = dev->priv; 318 struct arcnet_local *lp = netdev_priv(dev);
319 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; 319 void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
320 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); 320 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
321} 321}
@@ -361,7 +361,7 @@ static int __init arc_rimi_init(void)
361static void __exit arc_rimi_exit(void) 361static void __exit arc_rimi_exit(void)
362{ 362{
363 struct net_device *dev = my_dev; 363 struct net_device *dev = my_dev;
364 struct arcnet_local *lp = dev->priv; 364 struct arcnet_local *lp = netdev_priv(dev);
365 365
366 unregister_netdev(dev); 366 unregister_netdev(dev);
367 iounmap(lp->mem_start); 367 iounmap(lp->mem_start);
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index a5b07691e466..6b53e5ed125c 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -181,7 +181,7 @@ EXPORT_SYMBOL(arcnet_dump_skb);
181static void arcnet_dump_packet(struct net_device *dev, int bufnum, 181static void arcnet_dump_packet(struct net_device *dev, int bufnum,
182 char *desc, int take_arcnet_lock) 182 char *desc, int take_arcnet_lock)
183{ 183{
184 struct arcnet_local *lp = dev->priv; 184 struct arcnet_local *lp = netdev_priv(dev);
185 int i, length; 185 int i, length;
186 unsigned long flags = 0; 186 unsigned long flags = 0;
187 static uint8_t buf[512]; 187 static uint8_t buf[512];
@@ -247,7 +247,7 @@ void arcnet_unregister_proto(struct ArcProto *proto)
247 */ 247 */
248static void release_arcbuf(struct net_device *dev, int bufnum) 248static void release_arcbuf(struct net_device *dev, int bufnum)
249{ 249{
250 struct arcnet_local *lp = dev->priv; 250 struct arcnet_local *lp = netdev_priv(dev);
251 int i; 251 int i;
252 252
253 lp->buf_queue[lp->first_free_buf++] = bufnum; 253 lp->buf_queue[lp->first_free_buf++] = bufnum;
@@ -269,7 +269,7 @@ static void release_arcbuf(struct net_device *dev, int bufnum)
269 */ 269 */
270static int get_arcbuf(struct net_device *dev) 270static int get_arcbuf(struct net_device *dev)
271{ 271{
272 struct arcnet_local *lp = dev->priv; 272 struct arcnet_local *lp = netdev_priv(dev);
273 int buf = -1, i; 273 int buf = -1, i;
274 274
275 if (!atomic_dec_and_test(&lp->buf_lock)) { 275 if (!atomic_dec_and_test(&lp->buf_lock)) {
@@ -357,7 +357,7 @@ struct net_device *alloc_arcdev(char *name)
357 dev = alloc_netdev(sizeof(struct arcnet_local), 357 dev = alloc_netdev(sizeof(struct arcnet_local),
358 name && *name ? name : "arc%d", arcdev_setup); 358 name && *name ? name : "arc%d", arcdev_setup);
359 if(dev) { 359 if(dev) {
360 struct arcnet_local *lp = (struct arcnet_local *) dev->priv; 360 struct arcnet_local *lp = netdev_priv(dev);
361 spin_lock_init(&lp->lock); 361 spin_lock_init(&lp->lock);
362 } 362 }
363 363
@@ -374,7 +374,7 @@ struct net_device *alloc_arcdev(char *name)
374 */ 374 */
375static int arcnet_open(struct net_device *dev) 375static int arcnet_open(struct net_device *dev)
376{ 376{
377 struct arcnet_local *lp = dev->priv; 377 struct arcnet_local *lp = netdev_priv(dev);
378 int count, newmtu, error; 378 int count, newmtu, error;
379 379
380 BUGMSG(D_INIT,"opened."); 380 BUGMSG(D_INIT,"opened.");
@@ -474,7 +474,7 @@ static int arcnet_open(struct net_device *dev)
474/* The inverse routine to arcnet_open - shuts down the card. */ 474/* The inverse routine to arcnet_open - shuts down the card. */
475static int arcnet_close(struct net_device *dev) 475static int arcnet_close(struct net_device *dev)
476{ 476{
477 struct arcnet_local *lp = dev->priv; 477 struct arcnet_local *lp = netdev_priv(dev);
478 478
479 netif_stop_queue(dev); 479 netif_stop_queue(dev);
480 480
@@ -556,7 +556,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
556static int arcnet_rebuild_header(struct sk_buff *skb) 556static int arcnet_rebuild_header(struct sk_buff *skb)
557{ 557{
558 struct net_device *dev = skb->dev; 558 struct net_device *dev = skb->dev;
559 struct arcnet_local *lp = dev->priv; 559 struct arcnet_local *lp = netdev_priv(dev);
560 int status = 0; /* default is failure */ 560 int status = 0; /* default is failure */
561 unsigned short type; 561 unsigned short type;
562 uint8_t daddr=0; 562 uint8_t daddr=0;
@@ -603,7 +603,7 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
603/* Called by the kernel in order to transmit a packet. */ 603/* Called by the kernel in order to transmit a packet. */
604static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev) 604static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
605{ 605{
606 struct arcnet_local *lp = dev->priv; 606 struct arcnet_local *lp = netdev_priv(dev);
607 struct archdr *pkt; 607 struct archdr *pkt;
608 struct arc_rfc1201 *soft; 608 struct arc_rfc1201 *soft;
609 struct ArcProto *proto; 609 struct ArcProto *proto;
@@ -693,7 +693,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
693 */ 693 */
694static int go_tx(struct net_device *dev) 694static int go_tx(struct net_device *dev)
695{ 695{
696 struct arcnet_local *lp = dev->priv; 696 struct arcnet_local *lp = netdev_priv(dev);
697 697
698 BUGMSG(D_DURING, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n", 698 BUGMSG(D_DURING, "go_tx: status=%Xh, intmask=%Xh, next_tx=%d, cur_tx=%d\n",
699 ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx); 699 ASTATUS(), lp->intmask, lp->next_tx, lp->cur_tx);
@@ -723,7 +723,7 @@ static int go_tx(struct net_device *dev)
723static void arcnet_timeout(struct net_device *dev) 723static void arcnet_timeout(struct net_device *dev)
724{ 724{
725 unsigned long flags; 725 unsigned long flags;
726 struct arcnet_local *lp = dev->priv; 726 struct arcnet_local *lp = netdev_priv(dev);
727 int status = ASTATUS(); 727 int status = ASTATUS();
728 char *msg; 728 char *msg;
729 729
@@ -771,8 +771,8 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
771 BUGMSG(D_DURING, "\n"); 771 BUGMSG(D_DURING, "\n");
772 772
773 BUGMSG(D_DURING, "in arcnet_interrupt\n"); 773 BUGMSG(D_DURING, "in arcnet_interrupt\n");
774 774
775 lp = dev->priv; 775 lp = netdev_priv(dev);
776 BUG_ON(!lp); 776 BUG_ON(!lp);
777 777
778 spin_lock(&lp->lock); 778 spin_lock(&lp->lock);
@@ -1010,7 +1010,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
1010 */ 1010 */
1011static void arcnet_rx(struct net_device *dev, int bufnum) 1011static void arcnet_rx(struct net_device *dev, int bufnum)
1012{ 1012{
1013 struct arcnet_local *lp = dev->priv; 1013 struct arcnet_local *lp = netdev_priv(dev);
1014 struct archdr pkt; 1014 struct archdr pkt;
1015 struct arc_rfc1201 *soft; 1015 struct arc_rfc1201 *soft;
1016 int length, ofs; 1016 int length, ofs;
@@ -1074,7 +1074,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum)
1074 */ 1074 */
1075static struct net_device_stats *arcnet_get_stats(struct net_device *dev) 1075static struct net_device_stats *arcnet_get_stats(struct net_device *dev)
1076{ 1076{
1077 struct arcnet_local *lp = dev->priv; 1077 struct arcnet_local *lp = netdev_priv(dev);
1078 return &lp->stats; 1078 return &lp->stats;
1079} 1079}
1080 1080
@@ -1091,7 +1091,7 @@ static void null_rx(struct net_device *dev, int bufnum,
1091static int null_build_header(struct sk_buff *skb, struct net_device *dev, 1091static int null_build_header(struct sk_buff *skb, struct net_device *dev,
1092 unsigned short type, uint8_t daddr) 1092 unsigned short type, uint8_t daddr)
1093{ 1093{
1094 struct arcnet_local *lp = dev->priv; 1094 struct arcnet_local *lp = netdev_priv(dev);
1095 1095
1096 BUGMSG(D_PROTO, 1096 BUGMSG(D_PROTO,
1097 "tx: can't build header for encap %02Xh; load a protocol driver.\n", 1097 "tx: can't build header for encap %02Xh; load a protocol driver.\n",
@@ -1106,7 +1106,7 @@ static int null_build_header(struct sk_buff *skb, struct net_device *dev,
1106static int null_prepare_tx(struct net_device *dev, struct archdr *pkt, 1106static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
1107 int length, int bufnum) 1107 int length, int bufnum)
1108{ 1108{
1109 struct arcnet_local *lp = dev->priv; 1109 struct arcnet_local *lp = netdev_priv(dev);
1110 struct arc_hardware newpkt; 1110 struct arc_hardware newpkt;
1111 1111
1112 BUGMSG(D_PROTO, "tx: no encap for this host; load a protocol driver.\n"); 1112 BUGMSG(D_PROTO, "tx: no encap for this host; load a protocol driver.\n");
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 67bc47aa6904..e544953d8e9a 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -103,7 +103,7 @@ MODULE_LICENSE("GPL");
103static void rx(struct net_device *dev, int bufnum, 103static void rx(struct net_device *dev, int bufnum,
104 struct archdr *pkthdr, int length) 104 struct archdr *pkthdr, int length)
105{ 105{
106 struct arcnet_local *lp = (struct arcnet_local *) dev->priv; 106 struct arcnet_local *lp = netdev_priv(dev);
107 struct sk_buff *skb; 107 struct sk_buff *skb;
108 struct archdr *pkt = pkthdr; 108 struct archdr *pkt = pkthdr;
109 char *pktbuf, *pkthdrbuf; 109 char *pktbuf, *pkthdrbuf;
@@ -197,7 +197,7 @@ static int build_header(struct sk_buff *skb,
197static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, 197static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
198 int bufnum) 198 int bufnum)
199{ 199{
200 struct arcnet_local *lp = (struct arcnet_local *) dev->priv; 200 struct arcnet_local *lp = netdev_priv(dev);
201 struct arc_hardware *hard = &pkt->hard; 201 struct arc_hardware *hard = &pkt->hard;
202 int ofs; 202 int ofs;
203 203
@@ -249,7 +249,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
249 249
250static int ack_tx(struct net_device *dev, int acked) 250static int ack_tx(struct net_device *dev, int acked)
251{ 251{
252 struct arcnet_local *lp = (struct arcnet_local *) dev->priv; 252 struct arcnet_local *lp = netdev_priv(dev);
253 struct sk_buff *ackskb; 253 struct sk_buff *ackskb;
254 struct archdr *ackpkt; 254 struct archdr *ackpkt;
255 int length=sizeof(struct arc_cap); 255 int length=sizeof(struct arc_cap);
diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c
index 9289e6103de5..ea53a940272f 100644
--- a/drivers/net/arcnet/com20020-isa.c
+++ b/drivers/net/arcnet/com20020-isa.c
@@ -52,7 +52,7 @@ static int __init com20020isa_probe(struct net_device *dev)
52{ 52{
53 int ioaddr; 53 int ioaddr;
54 unsigned long airqmask; 54 unsigned long airqmask;
55 struct arcnet_local *lp = dev->priv; 55 struct arcnet_local *lp = netdev_priv(dev);
56 int err; 56 int err;
57 57
58 BUGLVL(D_NORMAL) printk(VERSION); 58 BUGLVL(D_NORMAL) printk(VERSION);
@@ -151,7 +151,7 @@ static int __init com20020_init(void)
151 if (node && node != 0xff) 151 if (node && node != 0xff)
152 dev->dev_addr[0] = node; 152 dev->dev_addr[0] = node;
153 153
154 lp = dev->priv; 154 lp = netdev_priv(dev);
155 lp->backplane = backplane; 155 lp->backplane = backplane;
156 lp->clockp = clockp & 7; 156 lp->clockp = clockp & 7;
157 lp->clockm = clockm & 3; 157 lp->clockm = clockm & 3;
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index b8c0fa6d401d..8b51f632581d 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -72,7 +72,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de
72 dev = alloc_arcdev(device); 72 dev = alloc_arcdev(device);
73 if (!dev) 73 if (!dev)
74 return -ENOMEM; 74 return -ENOMEM;
75 lp = dev->priv; 75 lp = netdev_priv(dev);
76 76
77 pci_set_drvdata(pdev, dev); 77 pci_set_drvdata(pdev, dev);
78 78
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 70124a944e7d..103688358fb8 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -89,7 +89,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum,
89int com20020_check(struct net_device *dev) 89int com20020_check(struct net_device *dev)
90{ 90{
91 int ioaddr = dev->base_addr, status; 91 int ioaddr = dev->base_addr, status;
92 struct arcnet_local *lp = dev->priv; 92 struct arcnet_local *lp = netdev_priv(dev);
93 93
94 ARCRESET0; 94 ARCRESET0;
95 mdelay(RESETtime); 95 mdelay(RESETtime);
@@ -159,7 +159,7 @@ int com20020_found(struct net_device *dev, int shared)
159 159
160 /* Initialize the rest of the device structure. */ 160 /* Initialize the rest of the device structure. */
161 161
162 lp = dev->priv; 162 lp = netdev_priv(dev);
163 163
164 lp->hw.owner = THIS_MODULE; 164 lp->hw.owner = THIS_MODULE;
165 lp->hw.command = com20020_command; 165 lp->hw.command = com20020_command;
@@ -233,7 +233,7 @@ int com20020_found(struct net_device *dev, int shared)
233 */ 233 */
234static int com20020_reset(struct net_device *dev, int really_reset) 234static int com20020_reset(struct net_device *dev, int really_reset)
235{ 235{
236 struct arcnet_local *lp = dev->priv; 236 struct arcnet_local *lp = netdev_priv(dev);
237 u_int ioaddr = dev->base_addr; 237 u_int ioaddr = dev->base_addr;
238 u_char inbyte; 238 u_char inbyte;
239 239
@@ -300,7 +300,7 @@ static int com20020_status(struct net_device *dev)
300 300
301static void com20020_close(struct net_device *dev) 301static void com20020_close(struct net_device *dev)
302{ 302{
303 struct arcnet_local *lp = dev->priv; 303 struct arcnet_local *lp = netdev_priv(dev);
304 int ioaddr = dev->base_addr; 304 int ioaddr = dev->base_addr;
305 305
306 /* disable transmitter */ 306 /* disable transmitter */
@@ -317,7 +317,7 @@ static void com20020_close(struct net_device *dev)
317 */ 317 */
318static void com20020_set_mc_list(struct net_device *dev) 318static void com20020_set_mc_list(struct net_device *dev)
319{ 319{
320 struct arcnet_local *lp = dev->priv; 320 struct arcnet_local *lp = netdev_priv(dev);
321 int ioaddr = dev->base_addr; 321 int ioaddr = dev->base_addr;
322 322
323 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ 323 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */
diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c
index 6599f1046c7b..89de29b3b1dc 100644
--- a/drivers/net/arcnet/com90io.c
+++ b/drivers/net/arcnet/com90io.c
@@ -248,7 +248,7 @@ static int __init com90io_found(struct net_device *dev)
248 return -EBUSY; 248 return -EBUSY;
249 } 249 }
250 250
251 lp = dev->priv; 251 lp = netdev_priv(dev);
252 lp->card_name = "COM90xx I/O"; 252 lp->card_name = "COM90xx I/O";
253 lp->hw.command = com90io_command; 253 lp->hw.command = com90io_command;
254 lp->hw.status = com90io_status; 254 lp->hw.status = com90io_status;
@@ -290,7 +290,7 @@ static int __init com90io_found(struct net_device *dev)
290 */ 290 */
291static int com90io_reset(struct net_device *dev, int really_reset) 291static int com90io_reset(struct net_device *dev, int really_reset)
292{ 292{
293 struct arcnet_local *lp = dev->priv; 293 struct arcnet_local *lp = netdev_priv(dev);
294 short ioaddr = dev->base_addr; 294 short ioaddr = dev->base_addr;
295 295
296 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); 296 BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS());
diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 0d45553ff75c..f4113d26587a 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -468,7 +468,7 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem
468 release_mem_region(shmem, MIRROR_SIZE); 468 release_mem_region(shmem, MIRROR_SIZE);
469 return -ENOMEM; 469 return -ENOMEM;
470 } 470 }
471 lp = dev->priv; 471 lp = netdev_priv(dev);
472 /* find the real shared memory start/end points, including mirrors */ 472 /* find the real shared memory start/end points, including mirrors */
473 473
474 /* guess the actual size of one "memory mirror" - the number of 474 /* guess the actual size of one "memory mirror" - the number of
@@ -585,7 +585,7 @@ static void com90xx_setmask(struct net_device *dev, int mask)
585 */ 585 */
586int com90xx_reset(struct net_device *dev, int really_reset) 586int com90xx_reset(struct net_device *dev, int really_reset)
587{ 587{
588 struct arcnet_local *lp = dev->priv; 588 struct arcnet_local *lp = netdev_priv(dev);
589 short ioaddr = dev->base_addr; 589 short ioaddr = dev->base_addr;
590 590
591 BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS()); 591 BUGMSG(D_INIT, "Resetting (status=%02Xh)\n", ASTATUS());
@@ -621,7 +621,7 @@ int com90xx_reset(struct net_device *dev, int really_reset)
621static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset, 621static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
622 void *buf, int count) 622 void *buf, int count)
623{ 623{
624 struct arcnet_local *lp = dev->priv; 624 struct arcnet_local *lp = netdev_priv(dev);
625 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 625 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
626 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); 626 TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count));
627} 627}
@@ -630,7 +630,7 @@ static void com90xx_copy_to_card(struct net_device *dev, int bufnum, int offset,
630static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset, 630static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset,
631 void *buf, int count) 631 void *buf, int count)
632{ 632{
633 struct arcnet_local *lp = dev->priv; 633 struct arcnet_local *lp = netdev_priv(dev);
634 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; 634 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
635 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); 635 TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
636} 636}
@@ -656,7 +656,7 @@ static void __exit com90xx_exit(void)
656 656
657 for (count = 0; count < numcards; count++) { 657 for (count = 0; count < numcards; count++) {
658 dev = cards[count]; 658 dev = cards[count];
659 lp = dev->priv; 659 lp = netdev_priv(dev);
660 660
661 unregister_netdev(dev); 661 unregister_netdev(dev);
662 free_irq(dev->irq, dev); 662 free_irq(dev->irq, dev);
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index 994be4970a57..49d39a9cb696 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -88,7 +88,7 @@ MODULE_LICENSE("GPL");
88 */ 88 */
89static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) 89static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
90{ 90{
91 struct arcnet_local *lp = dev->priv; 91 struct arcnet_local *lp = netdev_priv(dev);
92 struct archdr *pkt = (struct archdr *) skb->data; 92 struct archdr *pkt = (struct archdr *) skb->data;
93 struct arc_rfc1051 *soft = &pkt->soft.rfc1051; 93 struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
94 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; 94 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
@@ -125,7 +125,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
125static void rx(struct net_device *dev, int bufnum, 125static void rx(struct net_device *dev, int bufnum,
126 struct archdr *pkthdr, int length) 126 struct archdr *pkthdr, int length)
127{ 127{
128 struct arcnet_local *lp = dev->priv; 128 struct arcnet_local *lp = netdev_priv(dev);
129 struct sk_buff *skb; 129 struct sk_buff *skb;
130 struct archdr *pkt = pkthdr; 130 struct archdr *pkt = pkthdr;
131 int ofs; 131 int ofs;
@@ -168,7 +168,7 @@ static void rx(struct net_device *dev, int bufnum,
168static int build_header(struct sk_buff *skb, struct net_device *dev, 168static int build_header(struct sk_buff *skb, struct net_device *dev,
169 unsigned short type, uint8_t daddr) 169 unsigned short type, uint8_t daddr)
170{ 170{
171 struct arcnet_local *lp = dev->priv; 171 struct arcnet_local *lp = netdev_priv(dev);
172 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; 172 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
173 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); 173 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
174 struct arc_rfc1051 *soft = &pkt->soft.rfc1051; 174 struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
@@ -219,7 +219,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
219static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, 219static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
220 int bufnum) 220 int bufnum)
221{ 221{
222 struct arcnet_local *lp = dev->priv; 222 struct arcnet_local *lp = netdev_priv(dev);
223 struct arc_hardware *hard = &pkt->hard; 223 struct arc_hardware *hard = &pkt->hard;
224 int ofs; 224 int ofs;
225 225
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index 962641e96450..2303d3a1f4b6 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -92,7 +92,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
92{ 92{
93 struct archdr *pkt = (struct archdr *) skb->data; 93 struct archdr *pkt = (struct archdr *) skb->data;
94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201; 94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
95 struct arcnet_local *lp = dev->priv; 95 struct arcnet_local *lp = netdev_priv(dev);
96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; 96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
97 97
98 /* Pull off the arcnet header. */ 98 /* Pull off the arcnet header. */
@@ -134,7 +134,7 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
134static void rx(struct net_device *dev, int bufnum, 134static void rx(struct net_device *dev, int bufnum,
135 struct archdr *pkthdr, int length) 135 struct archdr *pkthdr, int length)
136{ 136{
137 struct arcnet_local *lp = dev->priv; 137 struct arcnet_local *lp = netdev_priv(dev);
138 struct sk_buff *skb; 138 struct sk_buff *skb;
139 struct archdr *pkt = pkthdr; 139 struct archdr *pkt = pkthdr;
140 struct arc_rfc1201 *soft = &pkthdr->soft.rfc1201; 140 struct arc_rfc1201 *soft = &pkthdr->soft.rfc1201;
@@ -374,7 +374,7 @@ static void rx(struct net_device *dev, int bufnum,
374static int build_header(struct sk_buff *skb, struct net_device *dev, 374static int build_header(struct sk_buff *skb, struct net_device *dev,
375 unsigned short type, uint8_t daddr) 375 unsigned short type, uint8_t daddr)
376{ 376{
377 struct arcnet_local *lp = dev->priv; 377 struct arcnet_local *lp = netdev_priv(dev);
378 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; 378 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
379 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); 379 struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
380 struct arc_rfc1201 *soft = &pkt->soft.rfc1201; 380 struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
@@ -441,7 +441,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
441static void load_pkt(struct net_device *dev, struct arc_hardware *hard, 441static void load_pkt(struct net_device *dev, struct arc_hardware *hard,
442 struct arc_rfc1201 *soft, int softlen, int bufnum) 442 struct arc_rfc1201 *soft, int softlen, int bufnum)
443{ 443{
444 struct arcnet_local *lp = dev->priv; 444 struct arcnet_local *lp = netdev_priv(dev);
445 int ofs; 445 int ofs;
446 446
447 /* assume length <= XMTU: someone should have handled that by now. */ 447 /* assume length <= XMTU: someone should have handled that by now. */
@@ -474,7 +474,7 @@ static void load_pkt(struct net_device *dev, struct arc_hardware *hard,
474static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, 474static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
475 int bufnum) 475 int bufnum)
476{ 476{
477 struct arcnet_local *lp = dev->priv; 477 struct arcnet_local *lp = netdev_priv(dev);
478 const int maxsegsize = XMTU - RFC1201_HDR_SIZE; 478 const int maxsegsize = XMTU - RFC1201_HDR_SIZE;
479 struct Outgoing *out; 479 struct Outgoing *out;
480 480
@@ -509,7 +509,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
509 509
510static int continue_tx(struct net_device *dev, int bufnum) 510static int continue_tx(struct net_device *dev, int bufnum)
511{ 511{
512 struct arcnet_local *lp = dev->priv; 512 struct arcnet_local *lp = netdev_priv(dev);
513 struct Outgoing *out = &lp->outgoing; 513 struct Outgoing *out = &lp->outgoing;
514 struct arc_hardware *hard = &out->pkt->hard; 514 struct arc_hardware *hard = &out->pkt->hard;
515 struct arc_rfc1201 *soft = &out->pkt->soft.rfc1201, *newsoft; 515 struct arc_rfc1201 *soft = &out->pkt->soft.rfc1201, *newsoft;
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index 701214b3b261..2d81f6afcb58 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -520,7 +520,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
520 return( 0 ); 520 return( 0 );
521 521
522 probe_ok: 522 probe_ok:
523 lp = (struct lance_private *)dev->priv; 523 lp = netdev_priv(dev);
524 MEM = (struct lance_memory *)memaddr; 524 MEM = (struct lance_memory *)memaddr;
525 IO = lp->iobase = (struct lance_ioreg *)ioaddr; 525 IO = lp->iobase = (struct lance_ioreg *)ioaddr;
526 dev->base_addr = (unsigned long)ioaddr; /* informational only */ 526 dev->base_addr = (unsigned long)ioaddr; /* informational only */
@@ -639,8 +639,8 @@ static unsigned long __init lance_probe1( struct net_device *dev,
639 639
640 640
641static int lance_open( struct net_device *dev ) 641static int lance_open( struct net_device *dev )
642 642{
643{ struct lance_private *lp = (struct lance_private *)dev->priv; 643 struct lance_private *lp = netdev_priv(dev);
644 struct lance_ioreg *IO = lp->iobase; 644 struct lance_ioreg *IO = lp->iobase;
645 int i; 645 int i;
646 646
@@ -680,8 +680,8 @@ static int lance_open( struct net_device *dev )
680/* Initialize the LANCE Rx and Tx rings. */ 680/* Initialize the LANCE Rx and Tx rings. */
681 681
682static void lance_init_ring( struct net_device *dev ) 682static void lance_init_ring( struct net_device *dev )
683 683{
684{ struct lance_private *lp = (struct lance_private *)dev->priv; 684 struct lance_private *lp = netdev_priv(dev);
685 int i; 685 int i;
686 unsigned offset; 686 unsigned offset;
687 687
@@ -729,7 +729,7 @@ static void lance_init_ring( struct net_device *dev )
729 729
730static void lance_tx_timeout (struct net_device *dev) 730static void lance_tx_timeout (struct net_device *dev)
731{ 731{
732 struct lance_private *lp = (struct lance_private *) dev->priv; 732 struct lance_private *lp = netdev_priv(dev);
733 struct lance_ioreg *IO = lp->iobase; 733 struct lance_ioreg *IO = lp->iobase;
734 734
735 AREG = CSR0; 735 AREG = CSR0;
@@ -771,8 +771,8 @@ static void lance_tx_timeout (struct net_device *dev)
771/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ 771/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
772 772
773static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) 773static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
774 774{
775{ struct lance_private *lp = (struct lance_private *)dev->priv; 775 struct lance_private *lp = netdev_priv(dev);
776 struct lance_ioreg *IO = lp->iobase; 776 struct lance_ioreg *IO = lp->iobase;
777 int entry, len; 777 int entry, len;
778 struct lance_tx_head *head; 778 struct lance_tx_head *head;
@@ -860,7 +860,7 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id )
860 return IRQ_NONE; 860 return IRQ_NONE;
861 } 861 }
862 862
863 lp = (struct lance_private *)dev->priv; 863 lp = netdev_priv(dev);
864 IO = lp->iobase; 864 IO = lp->iobase;
865 spin_lock (&lp->devlock); 865 spin_lock (&lp->devlock);
866 866
@@ -960,8 +960,8 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id )
960 960
961 961
962static int lance_rx( struct net_device *dev ) 962static int lance_rx( struct net_device *dev )
963 963{
964{ struct lance_private *lp = (struct lance_private *)dev->priv; 964 struct lance_private *lp = netdev_priv(dev);
965 int entry = lp->cur_rx & RX_RING_MOD_MASK; 965 int entry = lp->cur_rx & RX_RING_MOD_MASK;
966 int i; 966 int i;
967 967
@@ -1049,8 +1049,8 @@ static int lance_rx( struct net_device *dev )
1049 1049
1050 1050
1051static int lance_close( struct net_device *dev ) 1051static int lance_close( struct net_device *dev )
1052 1052{
1053{ struct lance_private *lp = (struct lance_private *)dev->priv; 1053 struct lance_private *lp = netdev_priv(dev);
1054 struct lance_ioreg *IO = lp->iobase; 1054 struct lance_ioreg *IO = lp->iobase;
1055 1055
1056 netif_stop_queue (dev); 1056 netif_stop_queue (dev);
@@ -1076,8 +1076,8 @@ static int lance_close( struct net_device *dev )
1076 */ 1076 */
1077 1077
1078static void set_multicast_list( struct net_device *dev ) 1078static void set_multicast_list( struct net_device *dev )
1079 1079{
1080{ struct lance_private *lp = (struct lance_private *)dev->priv; 1080 struct lance_private *lp = netdev_priv(dev);
1081 struct lance_ioreg *IO = lp->iobase; 1081 struct lance_ioreg *IO = lp->iobase;
1082 1082
1083 if (netif_running(dev)) 1083 if (netif_running(dev))
@@ -1118,8 +1118,8 @@ static void set_multicast_list( struct net_device *dev )
1118/* This is needed for old RieblCards and possible for new RieblCards */ 1118/* This is needed for old RieblCards and possible for new RieblCards */
1119 1119
1120static int lance_set_mac_address( struct net_device *dev, void *addr ) 1120static int lance_set_mac_address( struct net_device *dev, void *addr )
1121 1121{
1122{ struct lance_private *lp = (struct lance_private *)dev->priv; 1122 struct lance_private *lp = netdev_priv(dev);
1123 struct sockaddr *saddr = addr; 1123 struct sockaddr *saddr = addr;
1124 int i; 1124 int i;
1125 1125
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index 0f8c7525620c..c8b7cea4b14e 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -2487,7 +2487,7 @@ static pci_ers_result_t
2487atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) 2487atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
2488{ 2488{
2489 struct net_device *netdev = pci_get_drvdata(pdev); 2489 struct net_device *netdev = pci_get_drvdata(pdev);
2490 struct atl1e_adapter *adapter = netdev->priv; 2490 struct atl1e_adapter *adapter = netdev_priv(netdev);
2491 2491
2492 netif_device_detach(netdev); 2492 netif_device_detach(netdev);
2493 2493
@@ -2510,7 +2510,7 @@ atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
2510static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev) 2510static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev)
2511{ 2511{
2512 struct net_device *netdev = pci_get_drvdata(pdev); 2512 struct net_device *netdev = pci_get_drvdata(pdev);
2513 struct atl1e_adapter *adapter = netdev->priv; 2513 struct atl1e_adapter *adapter = netdev_priv(netdev);
2514 2514
2515 if (pci_enable_device(pdev)) { 2515 if (pci_enable_device(pdev)) {
2516 dev_err(&pdev->dev, 2516 dev_err(&pdev->dev,
@@ -2538,7 +2538,7 @@ static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev)
2538static void atl1e_io_resume(struct pci_dev *pdev) 2538static void atl1e_io_resume(struct pci_dev *pdev)
2539{ 2539{
2540 struct net_device *netdev = pci_get_drvdata(pdev); 2540 struct net_device *netdev = pci_get_drvdata(pdev);
2541 struct atl1e_adapter *adapter = netdev->priv; 2541 struct atl1e_adapter *adapter = netdev_priv(netdev);
2542 2542
2543 if (netif_running(netdev)) { 2543 if (netif_running(netdev)) {
2544 if (atl1e_up(adapter)) { 2544 if (atl1e_up(adapter)) {
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index 405c2dc5f3e4..7028b276dfd3 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -912,7 +912,8 @@ static void __exit atp_cleanup_module(void) {
912 struct net_device *next_dev; 912 struct net_device *next_dev;
913 913
914 while (root_atp_dev) { 914 while (root_atp_dev) {
915 next_dev = ((struct net_local *)root_atp_dev->priv)->next_module; 915 struct net_local *atp_local = netdev_priv(root_atp_dev);
916 next_dev = atp_local->next_module;
916 unregister_netdev(root_atp_dev); 917 unregister_netdev(root_atp_dev);
917 /* No need to release_region(), since we never snarf it. */ 918 /* No need to release_region(), since we never snarf it. */
918 free_netdev(root_atp_dev); 919 free_netdev(root_atp_dev);
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 2b69b2bbd14c..ecc2573b3dce 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -193,7 +193,7 @@ struct au1000_private *au_macs[NUM_ETH_INTERFACES];
193 */ 193 */
194static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg) 194static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)
195{ 195{
196 struct au1000_private *aup = (struct au1000_private *) dev->priv; 196 struct au1000_private *aup = netdev_priv(dev);
197 volatile u32 *const mii_control_reg = &aup->mac->mii_control; 197 volatile u32 *const mii_control_reg = &aup->mac->mii_control;
198 volatile u32 *const mii_data_reg = &aup->mac->mii_data; 198 volatile u32 *const mii_data_reg = &aup->mac->mii_data;
199 u32 timedout = 20; 199 u32 timedout = 20;
@@ -228,7 +228,7 @@ static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)
228static void au1000_mdio_write(struct net_device *dev, int phy_addr, 228static void au1000_mdio_write(struct net_device *dev, int phy_addr,
229 int reg, u16 value) 229 int reg, u16 value)
230{ 230{
231 struct au1000_private *aup = (struct au1000_private *) dev->priv; 231 struct au1000_private *aup = netdev_priv(dev);
232 volatile u32 *const mii_control_reg = &aup->mac->mii_control; 232 volatile u32 *const mii_control_reg = &aup->mac->mii_control;
233 volatile u32 *const mii_data_reg = &aup->mac->mii_data; 233 volatile u32 *const mii_data_reg = &aup->mac->mii_data;
234 u32 timedout = 20; 234 u32 timedout = 20;
@@ -283,7 +283,7 @@ static int au1000_mdiobus_reset(struct mii_bus *bus)
283 283
284static int mii_probe (struct net_device *dev) 284static int mii_probe (struct net_device *dev)
285{ 285{
286 struct au1000_private *const aup = (struct au1000_private *) dev->priv; 286 struct au1000_private *const aup = netdev_priv(dev);
287 struct phy_device *phydev = NULL; 287 struct phy_device *phydev = NULL;
288 288
289#if defined(AU1XXX_PHY_STATIC_CONFIG) 289#if defined(AU1XXX_PHY_STATIC_CONFIG)
@@ -415,7 +415,7 @@ void ReleaseDB(struct au1000_private *aup, db_dest_t *pDB)
415 415
416static void enable_rx_tx(struct net_device *dev) 416static void enable_rx_tx(struct net_device *dev)
417{ 417{
418 struct au1000_private *aup = (struct au1000_private *) dev->priv; 418 struct au1000_private *aup = netdev_priv(dev);
419 419
420 if (au1000_debug > 4) 420 if (au1000_debug > 4)
421 printk(KERN_INFO "%s: enable_rx_tx\n", dev->name); 421 printk(KERN_INFO "%s: enable_rx_tx\n", dev->name);
@@ -426,7 +426,7 @@ static void enable_rx_tx(struct net_device *dev)
426 426
427static void hard_stop(struct net_device *dev) 427static void hard_stop(struct net_device *dev)
428{ 428{
429 struct au1000_private *aup = (struct au1000_private *) dev->priv; 429 struct au1000_private *aup = netdev_priv(dev);
430 430
431 if (au1000_debug > 4) 431 if (au1000_debug > 4)
432 printk(KERN_INFO "%s: hard stop\n", dev->name); 432 printk(KERN_INFO "%s: hard stop\n", dev->name);
@@ -438,7 +438,7 @@ static void hard_stop(struct net_device *dev)
438static void enable_mac(struct net_device *dev, int force_reset) 438static void enable_mac(struct net_device *dev, int force_reset)
439{ 439{
440 unsigned long flags; 440 unsigned long flags;
441 struct au1000_private *aup = (struct au1000_private *) dev->priv; 441 struct au1000_private *aup = netdev_priv(dev);
442 442
443 spin_lock_irqsave(&aup->lock, flags); 443 spin_lock_irqsave(&aup->lock, flags);
444 444
@@ -457,7 +457,7 @@ static void enable_mac(struct net_device *dev, int force_reset)
457 457
458static void reset_mac_unlocked(struct net_device *dev) 458static void reset_mac_unlocked(struct net_device *dev)
459{ 459{
460 struct au1000_private *const aup = (struct au1000_private *) dev->priv; 460 struct au1000_private *const aup = netdev_priv(dev);
461 int i; 461 int i;
462 462
463 hard_stop(dev); 463 hard_stop(dev);
@@ -483,7 +483,7 @@ static void reset_mac_unlocked(struct net_device *dev)
483 483
484static void reset_mac(struct net_device *dev) 484static void reset_mac(struct net_device *dev)
485{ 485{
486 struct au1000_private *const aup = (struct au1000_private *) dev->priv; 486 struct au1000_private *const aup = netdev_priv(dev);
487 unsigned long flags; 487 unsigned long flags;
488 488
489 if (au1000_debug > 4) 489 if (au1000_debug > 4)
@@ -572,7 +572,7 @@ static int __init au1000_init_module(void)
572 572
573static int au1000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 573static int au1000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
574{ 574{
575 struct au1000_private *aup = (struct au1000_private *)dev->priv; 575 struct au1000_private *aup = netdev_priv(dev);
576 576
577 if (aup->phy_dev) 577 if (aup->phy_dev)
578 return phy_ethtool_gset(aup->phy_dev, cmd); 578 return phy_ethtool_gset(aup->phy_dev, cmd);
@@ -582,7 +582,7 @@ static int au1000_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
582 582
583static int au1000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 583static int au1000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
584{ 584{
585 struct au1000_private *aup = (struct au1000_private *)dev->priv; 585 struct au1000_private *aup = netdev_priv(dev);
586 586
587 if (!capable(CAP_NET_ADMIN)) 587 if (!capable(CAP_NET_ADMIN))
588 return -EPERM; 588 return -EPERM;
@@ -596,7 +596,7 @@ static int au1000_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
596static void 596static void
597au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 597au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
598{ 598{
599 struct au1000_private *aup = (struct au1000_private *)dev->priv; 599 struct au1000_private *aup = netdev_priv(dev);
600 600
601 strcpy(info->driver, DRV_NAME); 601 strcpy(info->driver, DRV_NAME);
602 strcpy(info->version, DRV_VERSION); 602 strcpy(info->version, DRV_VERSION);
@@ -652,7 +652,7 @@ static struct net_device * au1000_probe(int port_num)
652 printk("%s: Au1xx0 Ethernet found at 0x%x, irq %d\n", 652 printk("%s: Au1xx0 Ethernet found at 0x%x, irq %d\n",
653 dev->name, base, irq); 653 dev->name, base, irq);
654 654
655 aup = dev->priv; 655 aup = netdev_priv(dev);
656 656
657 spin_lock_init(&aup->lock); 657 spin_lock_init(&aup->lock);
658 658
@@ -817,7 +817,7 @@ err_out:
817 */ 817 */
818static int au1000_init(struct net_device *dev) 818static int au1000_init(struct net_device *dev)
819{ 819{
820 struct au1000_private *aup = (struct au1000_private *) dev->priv; 820 struct au1000_private *aup = netdev_priv(dev);
821 unsigned long flags; 821 unsigned long flags;
822 int i; 822 int i;
823 u32 control; 823 u32 control;
@@ -868,7 +868,7 @@ static int au1000_init(struct net_device *dev)
868static void 868static void
869au1000_adjust_link(struct net_device *dev) 869au1000_adjust_link(struct net_device *dev)
870{ 870{
871 struct au1000_private *aup = (struct au1000_private *) dev->priv; 871 struct au1000_private *aup = netdev_priv(dev);
872 struct phy_device *phydev = aup->phy_dev; 872 struct phy_device *phydev = aup->phy_dev;
873 unsigned long flags; 873 unsigned long flags;
874 874
@@ -947,7 +947,7 @@ au1000_adjust_link(struct net_device *dev)
947static int au1000_open(struct net_device *dev) 947static int au1000_open(struct net_device *dev)
948{ 948{
949 int retval; 949 int retval;
950 struct au1000_private *aup = (struct au1000_private *) dev->priv; 950 struct au1000_private *aup = netdev_priv(dev);
951 951
952 if (au1000_debug > 4) 952 if (au1000_debug > 4)
953 printk("%s: open: dev=%p\n", dev->name, dev); 953 printk("%s: open: dev=%p\n", dev->name, dev);
@@ -982,7 +982,7 @@ static int au1000_open(struct net_device *dev)
982static int au1000_close(struct net_device *dev) 982static int au1000_close(struct net_device *dev)
983{ 983{
984 unsigned long flags; 984 unsigned long flags;
985 struct au1000_private *const aup = (struct au1000_private *) dev->priv; 985 struct au1000_private *const aup = netdev_priv(dev);
986 986
987 if (au1000_debug > 4) 987 if (au1000_debug > 4)
988 printk("%s: close: dev=%p\n", dev->name, dev); 988 printk("%s: close: dev=%p\n", dev->name, dev);
@@ -1013,7 +1013,7 @@ static void __exit au1000_cleanup_module(void)
1013 for (i = 0; i < num_ifs; i++) { 1013 for (i = 0; i < num_ifs; i++) {
1014 dev = iflist[i].dev; 1014 dev = iflist[i].dev;
1015 if (dev) { 1015 if (dev) {
1016 aup = (struct au1000_private *) dev->priv; 1016 aup = netdev_priv(dev);
1017 unregister_netdev(dev); 1017 unregister_netdev(dev);
1018 mdiobus_unregister(aup->mii_bus); 1018 mdiobus_unregister(aup->mii_bus);
1019 mdiobus_free(aup->mii_bus); 1019 mdiobus_free(aup->mii_bus);
@@ -1035,7 +1035,7 @@ static void __exit au1000_cleanup_module(void)
1035 1035
1036static void update_tx_stats(struct net_device *dev, u32 status) 1036static void update_tx_stats(struct net_device *dev, u32 status)
1037{ 1037{
1038 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1038 struct au1000_private *aup = netdev_priv(dev);
1039 struct net_device_stats *ps = &dev->stats; 1039 struct net_device_stats *ps = &dev->stats;
1040 1040
1041 if (status & TX_FRAME_ABORTED) { 1041 if (status & TX_FRAME_ABORTED) {
@@ -1064,7 +1064,7 @@ static void update_tx_stats(struct net_device *dev, u32 status)
1064 */ 1064 */
1065static void au1000_tx_ack(struct net_device *dev) 1065static void au1000_tx_ack(struct net_device *dev)
1066{ 1066{
1067 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1067 struct au1000_private *aup = netdev_priv(dev);
1068 volatile tx_dma_t *ptxd; 1068 volatile tx_dma_t *ptxd;
1069 1069
1070 ptxd = aup->tx_dma_ring[aup->tx_tail]; 1070 ptxd = aup->tx_dma_ring[aup->tx_tail];
@@ -1091,7 +1091,7 @@ static void au1000_tx_ack(struct net_device *dev)
1091 */ 1091 */
1092static int au1000_tx(struct sk_buff *skb, struct net_device *dev) 1092static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
1093{ 1093{
1094 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1094 struct au1000_private *aup = netdev_priv(dev);
1095 struct net_device_stats *ps = &dev->stats; 1095 struct net_device_stats *ps = &dev->stats;
1096 volatile tx_dma_t *ptxd; 1096 volatile tx_dma_t *ptxd;
1097 u32 buff_stat; 1097 u32 buff_stat;
@@ -1145,7 +1145,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
1145 1145
1146static inline void update_rx_stats(struct net_device *dev, u32 status) 1146static inline void update_rx_stats(struct net_device *dev, u32 status)
1147{ 1147{
1148 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1148 struct au1000_private *aup = netdev_priv(dev);
1149 struct net_device_stats *ps = &dev->stats; 1149 struct net_device_stats *ps = &dev->stats;
1150 1150
1151 ps->rx_packets++; 1151 ps->rx_packets++;
@@ -1173,7 +1173,7 @@ static inline void update_rx_stats(struct net_device *dev, u32 status)
1173 */ 1173 */
1174static int au1000_rx(struct net_device *dev) 1174static int au1000_rx(struct net_device *dev)
1175{ 1175{
1176 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1176 struct au1000_private *aup = netdev_priv(dev);
1177 struct sk_buff *skb; 1177 struct sk_buff *skb;
1178 volatile rx_dma_t *prxd; 1178 volatile rx_dma_t *prxd;
1179 u32 buff_stat, status; 1179 u32 buff_stat, status;
@@ -1275,7 +1275,7 @@ static void au1000_tx_timeout(struct net_device *dev)
1275 1275
1276static void set_rx_mode(struct net_device *dev) 1276static void set_rx_mode(struct net_device *dev)
1277{ 1277{
1278 struct au1000_private *aup = (struct au1000_private *) dev->priv; 1278 struct au1000_private *aup = netdev_priv(dev);
1279 1279
1280 if (au1000_debug > 4) 1280 if (au1000_debug > 4)
1281 printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags); 1281 printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags);
@@ -1307,7 +1307,7 @@ static void set_rx_mode(struct net_device *dev)
1307 1307
1308static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1308static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1309{ 1309{
1310 struct au1000_private *aup = (struct au1000_private *)dev->priv; 1310 struct au1000_private *aup = netdev_priv(dev);
1311 1311
1312 if (!netif_running(dev)) return -EINVAL; 1312 if (!netif_running(dev)) return -EINVAL;
1313 1313
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index ba1372f2f144..78f645d6471a 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2426,7 +2426,7 @@ int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
2426int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev) 2426int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev)
2427{ 2427{
2428 struct slave *slave, *start_at; 2428 struct slave *slave, *start_at;
2429 struct bonding *bond = dev->priv; 2429 struct bonding *bond = netdev_priv(dev);
2430 int slave_agg_no; 2430 int slave_agg_no;
2431 int slaves_in_agg; 2431 int slaves_in_agg;
2432 int agg_id; 2432 int agg_id;
@@ -2506,7 +2506,7 @@ out:
2506 2506
2507int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev) 2507int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev)
2508{ 2508{
2509 struct bonding *bond = dev->priv; 2509 struct bonding *bond = netdev_priv(dev);
2510 struct slave *slave = NULL; 2510 struct slave *slave = NULL;
2511 int ret = NET_RX_DROP; 2511 int ret = NET_RX_DROP;
2512 2512
@@ -2517,7 +2517,8 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac
2517 goto out; 2517 goto out;
2518 2518
2519 read_lock(&bond->lock); 2519 read_lock(&bond->lock);
2520 slave = bond_get_slave_by_dev((struct bonding *)dev->priv, orig_dev); 2520 slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev),
2521 orig_dev);
2521 if (!slave) 2522 if (!slave)
2522 goto out_unlock; 2523 goto out_unlock;
2523 2524
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e170fa2fa1a1..073d25f357bb 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -374,7 +374,7 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
374 /* update rx hash table for this ARP */ 374 /* update rx hash table for this ARP */
375 printk("rar: update orig %s bond_dev %s\n", orig_dev->name, 375 printk("rar: update orig %s bond_dev %s\n", orig_dev->name,
376 bond_dev->name); 376 bond_dev->name);
377 bond = bond_dev->priv; 377 bond = netdev_priv(bond_dev);
378 rlb_update_entry_from_arp(bond, arp); 378 rlb_update_entry_from_arp(bond, arp);
379 dprintk("Server received an ARP Reply from client\n"); 379 dprintk("Server received an ARP Reply from client\n");
380 } 380 }
@@ -1292,7 +1292,7 @@ void bond_alb_deinitialize(struct bonding *bond)
1292 1292
1293int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) 1293int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
1294{ 1294{
1295 struct bonding *bond = bond_dev->priv; 1295 struct bonding *bond = netdev_priv(bond_dev);
1296 struct ethhdr *eth_data; 1296 struct ethhdr *eth_data;
1297 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); 1297 struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
1298 struct slave *tx_slave = NULL; 1298 struct slave *tx_slave = NULL;
@@ -1713,7 +1713,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
1713 */ 1713 */
1714int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) 1714int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
1715{ 1715{
1716 struct bonding *bond = bond_dev->priv; 1716 struct bonding *bond = netdev_priv(bond_dev);
1717 struct sockaddr *sa = addr; 1717 struct sockaddr *sa = addr;
1718 struct slave *slave, *swap_slave; 1718 struct slave *slave, *swap_slave;
1719 int res; 1719 int res;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 02de3e031237..a08ea4808056 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -454,7 +454,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_de
454 */ 454 */
455static void bond_vlan_rx_register(struct net_device *bond_dev, struct vlan_group *grp) 455static void bond_vlan_rx_register(struct net_device *bond_dev, struct vlan_group *grp)
456{ 456{
457 struct bonding *bond = bond_dev->priv; 457 struct bonding *bond = netdev_priv(bond_dev);
458 struct slave *slave; 458 struct slave *slave;
459 int i; 459 int i;
460 460
@@ -477,7 +477,7 @@ static void bond_vlan_rx_register(struct net_device *bond_dev, struct vlan_group
477 */ 477 */
478static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) 478static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
479{ 479{
480 struct bonding *bond = bond_dev->priv; 480 struct bonding *bond = netdev_priv(bond_dev);
481 struct slave *slave; 481 struct slave *slave;
482 int i, res; 482 int i, res;
483 483
@@ -505,7 +505,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
505 */ 505 */
506static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) 506static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
507{ 507{
508 struct bonding *bond = bond_dev->priv; 508 struct bonding *bond = netdev_priv(bond_dev);
509 struct slave *slave; 509 struct slave *slave;
510 struct net_device *vlan_dev; 510 struct net_device *vlan_dev;
511 int i, res; 511 int i, res;
@@ -939,7 +939,7 @@ static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond,
939 */ 939 */
940static void bond_mc_list_flush(struct net_device *bond_dev, struct net_device *slave_dev) 940static void bond_mc_list_flush(struct net_device *bond_dev, struct net_device *slave_dev)
941{ 941{
942 struct bonding *bond = bond_dev->priv; 942 struct bonding *bond = netdev_priv(bond_dev);
943 struct dev_mc_list *dmi; 943 struct dev_mc_list *dmi;
944 944
945 for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) { 945 for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
@@ -1383,7 +1383,7 @@ done:
1383static void bond_setup_by_slave(struct net_device *bond_dev, 1383static void bond_setup_by_slave(struct net_device *bond_dev,
1384 struct net_device *slave_dev) 1384 struct net_device *slave_dev)
1385{ 1385{
1386 struct bonding *bond = bond_dev->priv; 1386 struct bonding *bond = netdev_priv(bond_dev);
1387 1387
1388 bond_dev->neigh_setup = slave_dev->neigh_setup; 1388 bond_dev->neigh_setup = slave_dev->neigh_setup;
1389 bond_dev->header_ops = slave_dev->header_ops; 1389 bond_dev->header_ops = slave_dev->header_ops;
@@ -1400,7 +1400,7 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
1400/* enslave device <slave> to bond device <master> */ 1400/* enslave device <slave> to bond device <master> */
1401int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) 1401int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1402{ 1402{
1403 struct bonding *bond = bond_dev->priv; 1403 struct bonding *bond = netdev_priv(bond_dev);
1404 struct slave *new_slave = NULL; 1404 struct slave *new_slave = NULL;
1405 struct dev_mc_list *dmi; 1405 struct dev_mc_list *dmi;
1406 struct sockaddr addr; 1406 struct sockaddr addr;
@@ -1802,7 +1802,7 @@ err_undo_flags:
1802 */ 1802 */
1803int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) 1803int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1804{ 1804{
1805 struct bonding *bond = bond_dev->priv; 1805 struct bonding *bond = netdev_priv(bond_dev);
1806 struct slave *slave, *oldcurrent; 1806 struct slave *slave, *oldcurrent;
1807 struct sockaddr addr; 1807 struct sockaddr addr;
1808 int mac_addr_differ; 1808 int mac_addr_differ;
@@ -2013,7 +2013,7 @@ static void bond_destructor(struct net_device *bond_dev)
2013*/ 2013*/
2014int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *slave_dev) 2014int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *slave_dev)
2015{ 2015{
2016 struct bonding *bond = bond_dev->priv; 2016 struct bonding *bond = netdev_priv(bond_dev);
2017 int ret; 2017 int ret;
2018 2018
2019 ret = bond_release(bond_dev, slave_dev); 2019 ret = bond_release(bond_dev, slave_dev);
@@ -2030,7 +2030,7 @@ int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *sl
2030 */ 2030 */
2031static int bond_release_all(struct net_device *bond_dev) 2031static int bond_release_all(struct net_device *bond_dev)
2032{ 2032{
2033 struct bonding *bond = bond_dev->priv; 2033 struct bonding *bond = netdev_priv(bond_dev);
2034 struct slave *slave; 2034 struct slave *slave;
2035 struct net_device *slave_dev; 2035 struct net_device *slave_dev;
2036 struct sockaddr addr; 2036 struct sockaddr addr;
@@ -2161,7 +2161,7 @@ out:
2161 */ 2161 */
2162static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev) 2162static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_device *slave_dev)
2163{ 2163{
2164 struct bonding *bond = bond_dev->priv; 2164 struct bonding *bond = netdev_priv(bond_dev);
2165 struct slave *old_active = NULL; 2165 struct slave *old_active = NULL;
2166 struct slave *new_active = NULL; 2166 struct slave *new_active = NULL;
2167 int res = 0; 2167 int res = 0;
@@ -2210,7 +2210,7 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
2210 2210
2211static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) 2211static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
2212{ 2212{
2213 struct bonding *bond = bond_dev->priv; 2213 struct bonding *bond = netdev_priv(bond_dev);
2214 2214
2215 info->bond_mode = bond->params.mode; 2215 info->bond_mode = bond->params.mode;
2216 info->miimon = bond->params.miimon; 2216 info->miimon = bond->params.miimon;
@@ -2224,7 +2224,7 @@ static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
2224 2224
2225static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info) 2225static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info)
2226{ 2226{
2227 struct bonding *bond = bond_dev->priv; 2227 struct bonding *bond = netdev_priv(bond_dev);
2228 struct slave *slave; 2228 struct slave *slave;
2229 int i, found = 0; 2229 int i, found = 0;
2230 2230
@@ -2717,7 +2717,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2717 if (!(dev->priv_flags & IFF_BONDING) || !(dev->flags & IFF_MASTER)) 2717 if (!(dev->priv_flags & IFF_BONDING) || !(dev->flags & IFF_MASTER))
2718 goto out; 2718 goto out;
2719 2719
2720 bond = dev->priv; 2720 bond = netdev_priv(dev);
2721 read_lock(&bond->lock); 2721 read_lock(&bond->lock);
2722 2722
2723 dprintk("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n", 2723 dprintk("bond_arp_rcv: bond %s skb->dev %s orig_dev %s\n",
@@ -3526,7 +3526,7 @@ static int bond_event_changename(struct bonding *bond)
3526 3526
3527static int bond_master_netdev_event(unsigned long event, struct net_device *bond_dev) 3527static int bond_master_netdev_event(unsigned long event, struct net_device *bond_dev)
3528{ 3528{
3529 struct bonding *event_bond = bond_dev->priv; 3529 struct bonding *event_bond = netdev_priv(bond_dev);
3530 3530
3531 switch (event) { 3531 switch (event) {
3532 case NETDEV_CHANGENAME: 3532 case NETDEV_CHANGENAME:
@@ -3544,7 +3544,7 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *bond
3544static int bond_slave_netdev_event(unsigned long event, struct net_device *slave_dev) 3544static int bond_slave_netdev_event(unsigned long event, struct net_device *slave_dev)
3545{ 3545{
3546 struct net_device *bond_dev = slave_dev->master; 3546 struct net_device *bond_dev = slave_dev->master;
3547 struct bonding *bond = bond_dev->priv; 3547 struct bonding *bond = netdev_priv(bond_dev);
3548 3548
3549 switch (event) { 3549 switch (event) {
3550 case NETDEV_UNREGISTER: 3550 case NETDEV_UNREGISTER:
@@ -3795,7 +3795,7 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb,
3795 3795
3796static int bond_open(struct net_device *bond_dev) 3796static int bond_open(struct net_device *bond_dev)
3797{ 3797{
3798 struct bonding *bond = bond_dev->priv; 3798 struct bonding *bond = netdev_priv(bond_dev);
3799 3799
3800 bond->kill_timers = 0; 3800 bond->kill_timers = 0;
3801 3801
@@ -3844,7 +3844,7 @@ static int bond_open(struct net_device *bond_dev)
3844 3844
3845static int bond_close(struct net_device *bond_dev) 3845static int bond_close(struct net_device *bond_dev)
3846{ 3846{
3847 struct bonding *bond = bond_dev->priv; 3847 struct bonding *bond = netdev_priv(bond_dev);
3848 3848
3849 if (bond->params.mode == BOND_MODE_8023AD) { 3849 if (bond->params.mode == BOND_MODE_8023AD) {
3850 /* Unregister the receive of LACPDUs */ 3850 /* Unregister the receive of LACPDUs */
@@ -3898,7 +3898,7 @@ static int bond_close(struct net_device *bond_dev)
3898 3898
3899static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) 3899static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
3900{ 3900{
3901 struct bonding *bond = bond_dev->priv; 3901 struct bonding *bond = netdev_priv(bond_dev);
3902 struct net_device_stats *stats = &(bond->stats), *sstats; 3902 struct net_device_stats *stats = &(bond->stats), *sstats;
3903 struct net_device_stats local_stats; 3903 struct net_device_stats local_stats;
3904 struct slave *slave; 3904 struct slave *slave;
@@ -3976,7 +3976,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
3976 } 3976 }
3977 3977
3978 if (mii->reg_num == 1) { 3978 if (mii->reg_num == 1) {
3979 struct bonding *bond = bond_dev->priv; 3979 struct bonding *bond = netdev_priv(bond_dev);
3980 mii->val_out = 0; 3980 mii->val_out = 0;
3981 read_lock(&bond->lock); 3981 read_lock(&bond->lock);
3982 read_lock(&bond->curr_slave_lock); 3982 read_lock(&bond->curr_slave_lock);
@@ -4068,7 +4068,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
4068 4068
4069static void bond_set_multicast_list(struct net_device *bond_dev) 4069static void bond_set_multicast_list(struct net_device *bond_dev)
4070{ 4070{
4071 struct bonding *bond = bond_dev->priv; 4071 struct bonding *bond = netdev_priv(bond_dev);
4072 struct dev_mc_list *dmi; 4072 struct dev_mc_list *dmi;
4073 4073
4074 /* 4074 /*
@@ -4129,7 +4129,7 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
4129 */ 4129 */
4130static int bond_change_mtu(struct net_device *bond_dev, int new_mtu) 4130static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
4131{ 4131{
4132 struct bonding *bond = bond_dev->priv; 4132 struct bonding *bond = netdev_priv(bond_dev);
4133 struct slave *slave, *stop_at; 4133 struct slave *slave, *stop_at;
4134 int res = 0; 4134 int res = 0;
4135 int i; 4135 int i;
@@ -4201,7 +4201,7 @@ unwind:
4201 */ 4201 */
4202static int bond_set_mac_address(struct net_device *bond_dev, void *addr) 4202static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
4203{ 4203{
4204 struct bonding *bond = bond_dev->priv; 4204 struct bonding *bond = netdev_priv(bond_dev);
4205 struct sockaddr *sa = addr, tmp_sa; 4205 struct sockaddr *sa = addr, tmp_sa;
4206 struct slave *slave, *stop_at; 4206 struct slave *slave, *stop_at;
4207 int res = 0; 4207 int res = 0;
@@ -4282,7 +4282,7 @@ unwind:
4282 4282
4283static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev) 4283static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
4284{ 4284{
4285 struct bonding *bond = bond_dev->priv; 4285 struct bonding *bond = netdev_priv(bond_dev);
4286 struct slave *slave, *start_at; 4286 struct slave *slave, *start_at;
4287 int i, slave_no, res = 1; 4287 int i, slave_no, res = 1;
4288 4288
@@ -4331,7 +4331,7 @@ out:
4331 */ 4331 */
4332static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev) 4332static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
4333{ 4333{
4334 struct bonding *bond = bond_dev->priv; 4334 struct bonding *bond = netdev_priv(bond_dev);
4335 int res = 1; 4335 int res = 1;
4336 4336
4337 read_lock(&bond->lock); 4337 read_lock(&bond->lock);
@@ -4363,7 +4363,7 @@ out:
4363 */ 4363 */
4364static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev) 4364static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
4365{ 4365{
4366 struct bonding *bond = bond_dev->priv; 4366 struct bonding *bond = netdev_priv(bond_dev);
4367 struct slave *slave, *start_at; 4367 struct slave *slave, *start_at;
4368 int slave_no; 4368 int slave_no;
4369 int i; 4369 int i;
@@ -4409,7 +4409,7 @@ out:
4409 */ 4409 */
4410static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev) 4410static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
4411{ 4411{
4412 struct bonding *bond = bond_dev->priv; 4412 struct bonding *bond = netdev_priv(bond_dev);
4413 struct slave *slave, *start_at; 4413 struct slave *slave, *start_at;
4414 struct net_device *tx_dev = NULL; 4414 struct net_device *tx_dev = NULL;
4415 int i; 4415 int i;
@@ -4552,7 +4552,7 @@ static const struct ethtool_ops bond_ethtool_ops = {
4552 */ 4552 */
4553static int bond_init(struct net_device *bond_dev, struct bond_params *params) 4553static int bond_init(struct net_device *bond_dev, struct bond_params *params)
4554{ 4554{
4555 struct bonding *bond = bond_dev->priv; 4555 struct bonding *bond = netdev_priv(bond_dev);
4556 4556
4557 dprintk("Begin bond_init for %s\n", bond_dev->name); 4557 dprintk("Begin bond_init for %s\n", bond_dev->name);
4558 4558
@@ -4657,7 +4657,7 @@ static void bond_work_cancel_all(struct bonding *bond)
4657 */ 4657 */
4658static void bond_deinit(struct net_device *bond_dev) 4658static void bond_deinit(struct net_device *bond_dev)
4659{ 4659{
4660 struct bonding *bond = bond_dev->priv; 4660 struct bonding *bond = netdev_priv(bond_dev);
4661 4661
4662 list_del(&bond->bond_list); 4662 list_del(&bond->bond_list);
4663 4663
@@ -5149,7 +5149,7 @@ int bond_create(char *name, struct bond_params *params)
5149 5149
5150 up_write(&bonding_rwsem); 5150 up_write(&bonding_rwsem);
5151 rtnl_unlock(); /* allows sysfs registration of net device */ 5151 rtnl_unlock(); /* allows sysfs registration of net device */
5152 res = bond_create_sysfs_entry(bond_dev->priv); 5152 res = bond_create_sysfs_entry(netdev_priv(bond_dev));
5153 if (res < 0) { 5153 if (res < 0) {
5154 rtnl_lock(); 5154 rtnl_lock();
5155 down_write(&bonding_rwsem); 5155 down_write(&bonding_rwsem);
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index aaf2927b5c38..fc490d89d4af 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -39,7 +39,7 @@
39/* #define BONDING_DEBUG 1 */ 39/* #define BONDING_DEBUG 1 */
40#include "bonding.h" 40#include "bonding.h"
41#define to_dev(obj) container_of(obj,struct device,kobj) 41#define to_dev(obj) container_of(obj,struct device,kobj)
42#define to_bond(cd) ((struct bonding *)(to_net_dev(cd)->priv)) 42#define to_bond(cd) ((struct bonding *)(netdev_priv(to_net_dev(cd))))
43 43
44/*---------------------------- Declarations -------------------------------*/ 44/*---------------------------- Declarations -------------------------------*/
45 45
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index b5eb8e65b309..921abacc6074 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -257,7 +257,7 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
257 return NULL; 257 return NULL;
258 } 258 }
259 259
260 return (struct bonding *)slave->dev->master->priv; 260 return (struct bonding *)netdev_priv(slave->dev->master);
261} 261}
262 262
263#define BOND_FOM_NONE 0 263#define BOND_FOM_NONE 0
@@ -287,7 +287,7 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
287 287
288static inline void bond_set_slave_inactive_flags(struct slave *slave) 288static inline void bond_set_slave_inactive_flags(struct slave *slave)
289{ 289{
290 struct bonding *bond = slave->dev->master->priv; 290 struct bonding *bond = netdev_priv(slave->dev->master);
291 if (bond->params.mode != BOND_MODE_TLB && 291 if (bond->params.mode != BOND_MODE_TLB &&
292 bond->params.mode != BOND_MODE_ALB) 292 bond->params.mode != BOND_MODE_ALB)
293 slave->state = BOND_STATE_BACKUP; 293 slave->state = BOND_STATE_BACKUP;
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index c46864d626b2..c7457f97259d 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -952,7 +952,7 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)
952 952
953static void veth_set_multicast_list(struct net_device *dev) 953static void veth_set_multicast_list(struct net_device *dev)
954{ 954{
955 struct veth_port *port = (struct veth_port *) dev->priv; 955 struct veth_port *port = netdev_priv(dev);
956 unsigned long flags; 956 unsigned long flags;
957 957
958 write_lock_irqsave(&port->mcast_gate, flags); 958 write_lock_irqsave(&port->mcast_gate, flags);
@@ -1044,7 +1044,7 @@ static struct net_device *veth_probe_one(int vlan,
1044 return NULL; 1044 return NULL;
1045 } 1045 }
1046 1046
1047 port = (struct veth_port *) dev->priv; 1047 port = netdev_priv(dev);
1048 1048
1049 spin_lock_init(&port->queue_lock); 1049 spin_lock_init(&port->queue_lock);
1050 rwlock_init(&port->mcast_gate); 1050 rwlock_init(&port->mcast_gate);
@@ -1102,7 +1102,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp,
1102 struct net_device *dev) 1102 struct net_device *dev)
1103{ 1103{
1104 struct veth_lpar_connection *cnx = veth_cnx[rlp]; 1104 struct veth_lpar_connection *cnx = veth_cnx[rlp];
1105 struct veth_port *port = (struct veth_port *) dev->priv; 1105 struct veth_port *port = netdev_priv(dev);
1106 HvLpEvent_Rc rc; 1106 HvLpEvent_Rc rc;
1107 struct veth_msg *msg = NULL; 1107 struct veth_msg *msg = NULL;
1108 unsigned long flags; 1108 unsigned long flags;
@@ -1191,7 +1191,7 @@ static void veth_transmit_to_many(struct sk_buff *skb,
1191static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev) 1191static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev)
1192{ 1192{
1193 unsigned char *frame = skb->data; 1193 unsigned char *frame = skb->data;
1194 struct veth_port *port = (struct veth_port *) dev->priv; 1194 struct veth_port *port = netdev_priv(dev);
1195 HvLpIndexMap lpmask; 1195 HvLpIndexMap lpmask;
1196 1196
1197 if (! (frame[0] & 0x01)) { 1197 if (! (frame[0] & 0x01)) {
@@ -1255,7 +1255,7 @@ static void veth_wake_queues(struct veth_lpar_connection *cnx)
1255 if (! dev) 1255 if (! dev)
1256 continue; 1256 continue;
1257 1257
1258 port = (struct veth_port *)dev->priv; 1258 port = netdev_priv(dev);
1259 1259
1260 if (! (port->lpar_map & (1<<cnx->remote_lp))) 1260 if (! (port->lpar_map & (1<<cnx->remote_lp)))
1261 continue; 1261 continue;
@@ -1284,7 +1284,7 @@ static void veth_stop_queues(struct veth_lpar_connection *cnx)
1284 if (! dev) 1284 if (! dev)
1285 continue; 1285 continue;
1286 1286
1287 port = (struct veth_port *)dev->priv; 1287 port = netdev_priv(dev);
1288 1288
1289 /* If this cnx is not on the vlan for this port, continue */ 1289 /* If this cnx is not on the vlan for this port, continue */
1290 if (! (port->lpar_map & (1 << cnx->remote_lp))) 1290 if (! (port->lpar_map & (1 << cnx->remote_lp)))
@@ -1506,7 +1506,7 @@ static void veth_receive(struct veth_lpar_connection *cnx,
1506 continue; 1506 continue;
1507 } 1507 }
1508 1508
1509 port = (struct veth_port *)dev->priv; 1509 port = netdev_priv(dev);
1510 dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000; 1510 dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000;
1511 1511
1512 if ((vlan > HVMAXARCHITECTEDVIRTUALLANS) || !port) { 1512 if ((vlan > HVMAXARCHITECTEDVIRTUALLANS) || !port) {
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index fee56a383819..a610016a0172 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -94,9 +94,9 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
94}; 94};
95 95
96#define IXGBE_QUEUE_STATS_LEN \ 96#define IXGBE_QUEUE_STATS_LEN \
97 ((((struct ixgbe_adapter *)netdev->priv)->num_tx_queues + \ 97 ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \
98 ((struct ixgbe_adapter *)netdev->priv)->num_rx_queues) * \ 98 ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \
99 (sizeof(struct ixgbe_queue_stats) / sizeof(u64))) 99 (sizeof(struct ixgbe_queue_stats) / sizeof(u64)))
100#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN) 100#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN)
101#define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats) 101#define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats)
102#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN) 102#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index b3be579b47ed..ae06d48e9ebb 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4041,7 +4041,7 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
4041 pci_channel_state_t state) 4041 pci_channel_state_t state)
4042{ 4042{
4043 struct net_device *netdev = pci_get_drvdata(pdev); 4043 struct net_device *netdev = pci_get_drvdata(pdev);
4044 struct ixgbe_adapter *adapter = netdev->priv; 4044 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4045 4045
4046 netif_device_detach(netdev); 4046 netif_device_detach(netdev);
4047 4047
@@ -4062,7 +4062,7 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
4062static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev) 4062static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev)
4063{ 4063{
4064 struct net_device *netdev = pci_get_drvdata(pdev); 4064 struct net_device *netdev = pci_get_drvdata(pdev);
4065 struct ixgbe_adapter *adapter = netdev->priv; 4065 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4066 4066
4067 if (pci_enable_device(pdev)) { 4067 if (pci_enable_device(pdev)) {
4068 DPRINTK(PROBE, ERR, 4068 DPRINTK(PROBE, ERR,
@@ -4090,7 +4090,7 @@ static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev)
4090static void ixgbe_io_resume(struct pci_dev *pdev) 4090static void ixgbe_io_resume(struct pci_dev *pdev)
4091{ 4091{
4092 struct net_device *netdev = pci_get_drvdata(pdev); 4092 struct net_device *netdev = pci_get_drvdata(pdev);
4093 struct ixgbe_adapter *adapter = netdev->priv; 4093 struct ixgbe_adapter *adapter = netdev_priv(netdev);
4094 4094
4095 if (netif_running(netdev)) { 4095 if (netif_running(netdev)) {
4096 if (ixgbe_up(adapter)) { 4096 if (ixgbe_up(adapter)) {
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index d6b0036abafa..4d1a059921c6 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -390,7 +390,7 @@ i596_timeout(struct net_device *dev, char *msg, int ct) {
390 struct i596_private *lp; 390 struct i596_private *lp;
391 int boguscnt = ct; 391 int boguscnt = ct;
392 392
393 lp = (struct i596_private *) dev->priv; 393 lp = netdev_priv(dev);
394 while (lp->scb.command) { 394 while (lp->scb.command) {
395 if (--boguscnt == 0) { 395 if (--boguscnt == 0) {
396 printk("%s: %s timed out - stat %4.4x, cmd %4.4x\n", 396 printk("%s: %s timed out - stat %4.4x, cmd %4.4x\n",
@@ -411,7 +411,7 @@ init_rx_bufs(struct net_device *dev, int num) {
411 int i; 411 int i;
412 // struct i596_rbd *rbd; 412 // struct i596_rbd *rbd;
413 413
414 lp = (struct i596_private *) dev->priv; 414 lp = netdev_priv(dev);
415 lp->scb.pa_rfd = I596_NULL; 415 lp->scb.pa_rfd = I596_NULL;
416 416
417 for (i = 0; i < num; i++) { 417 for (i = 0; i < num; i++) {
@@ -468,7 +468,7 @@ remove_rx_bufs(struct net_device *dev) {
468 struct i596_private *lp; 468 struct i596_private *lp;
469 struct i596_rfd *rfd; 469 struct i596_rfd *rfd;
470 470
471 lp = (struct i596_private *) dev->priv; 471 lp = netdev_priv(dev);
472 lp->rx_tail->pa_next = I596_NULL; 472 lp->rx_tail->pa_next = I596_NULL;
473 473
474 do { 474 do {
@@ -517,7 +517,7 @@ CLEAR_INT(void) {
517/* selftest or dump */ 517/* selftest or dump */
518static void 518static void
519i596_port_do(struct net_device *dev, int portcmd, char *cmdname) { 519i596_port_do(struct net_device *dev, int portcmd, char *cmdname) {
520 struct i596_private *lp = dev->priv; 520 struct i596_private *lp = netdev_priv(dev);
521 u16 *outp; 521 u16 *outp;
522 int i, m; 522 int i, m;
523 523
@@ -541,7 +541,7 @@ i596_port_do(struct net_device *dev, int portcmd, char *cmdname) {
541 541
542static int 542static int
543i596_scp_setup(struct net_device *dev) { 543i596_scp_setup(struct net_device *dev) {
544 struct i596_private *lp = dev->priv; 544 struct i596_private *lp = netdev_priv(dev);
545 int boguscnt; 545 int boguscnt;
546 546
547 /* Setup SCP, ISCP, SCB */ 547 /* Setup SCP, ISCP, SCB */
@@ -622,7 +622,7 @@ init_i596(struct net_device *dev) {
622 if (i596_scp_setup(dev)) 622 if (i596_scp_setup(dev))
623 return 1; 623 return 1;
624 624
625 lp = (struct i596_private *) dev->priv; 625 lp = netdev_priv(dev);
626 lp->scb.command = 0; 626 lp->scb.command = 0;
627 627
628 memcpy ((void *)lp->i596_config, init_setup, 14); 628 memcpy ((void *)lp->i596_config, init_setup, 14);
@@ -704,7 +704,7 @@ i596_rx_one(struct net_device *dev, struct i596_private *lp,
704 704
705static int 705static int
706i596_rx(struct net_device *dev) { 706i596_rx(struct net_device *dev) {
707 struct i596_private *lp = (struct i596_private *) dev->priv; 707 struct i596_private *lp = netdev_priv(dev);
708 struct i596_rfd *rfd; 708 struct i596_rfd *rfd;
709 int frames = 0; 709 int frames = 0;
710 710
@@ -737,7 +737,7 @@ i596_cleanup_cmd(struct net_device *dev) {
737 struct i596_private *lp; 737 struct i596_private *lp;
738 struct i596_cmd *cmd; 738 struct i596_cmd *cmd;
739 739
740 lp = (struct i596_private *) dev->priv; 740 lp = netdev_priv(dev);
741 while (lp->cmd_head) { 741 while (lp->cmd_head) {
742 cmd = (struct i596_cmd *)lp->cmd_head; 742 cmd = (struct i596_cmd *)lp->cmd_head;
743 743
@@ -805,7 +805,7 @@ static void i596_reset(struct net_device *dev, struct i596_private *lp, int ioad
805} 805}
806 806
807static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) { 807static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) {
808 struct i596_private *lp = dev->priv; 808 struct i596_private *lp = netdev_priv(dev);
809 int ioaddr = dev->base_addr; 809 int ioaddr = dev->base_addr;
810 unsigned long flags; 810 unsigned long flags;
811 811
@@ -911,7 +911,7 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) {
911 911
912static void 912static void
913i596_tx_timeout (struct net_device *dev) { 913i596_tx_timeout (struct net_device *dev) {
914 struct i596_private *lp = dev->priv; 914 struct i596_private *lp = netdev_priv(dev);
915 int ioaddr = dev->base_addr; 915 int ioaddr = dev->base_addr;
916 916
917 /* Transmitter timeout, serious problems. */ 917 /* Transmitter timeout, serious problems. */
@@ -969,7 +969,7 @@ static int __init lp486e_probe(struct net_device *dev) {
969 return -EBUSY; 969 return -EBUSY;
970 } 970 }
971 971
972 lp = (struct i596_private *) dev->priv; 972 lp = netdev_priv(dev);
973 spin_lock_init(&lp->cmd_lock); 973 spin_lock_init(&lp->cmd_lock);
974 974
975 /* 975 /*
@@ -1146,7 +1146,7 @@ static irqreturn_t
1146i596_interrupt(int irq, void *dev_instance) 1146i596_interrupt(int irq, void *dev_instance)
1147{ 1147{
1148 struct net_device *dev = dev_instance; 1148 struct net_device *dev = dev_instance;
1149 struct i596_private *lp = dev->priv; 1149 struct i596_private *lp = netdev_priv(dev);
1150 unsigned short status, ack_cmd = 0; 1150 unsigned short status, ack_cmd = 0;
1151 int frames_in = 0; 1151 int frames_in = 0;
1152 1152
@@ -1214,7 +1214,7 @@ i596_interrupt(int irq, void *dev_instance)
1214} 1214}
1215 1215
1216static int i596_close(struct net_device *dev) { 1216static int i596_close(struct net_device *dev) {
1217 struct i596_private *lp = dev->priv; 1217 struct i596_private *lp = netdev_priv(dev);
1218 1218
1219 netif_stop_queue(dev); 1219 netif_stop_queue(dev);
1220 1220
@@ -1241,7 +1241,7 @@ static int i596_close(struct net_device *dev) {
1241*/ 1241*/
1242 1242
1243static void set_multicast_list(struct net_device *dev) { 1243static void set_multicast_list(struct net_device *dev) {
1244 struct i596_private *lp = dev->priv; 1244 struct i596_private *lp = netdev_priv(dev);
1245 struct i596_cmd *cmd; 1245 struct i596_cmd *cmd;
1246 1246
1247 if (i596_debug > 1) 1247 if (i596_debug > 1)
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index b52f0507845f..feebbd92aff2 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -143,7 +143,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
143 } 143 }
144 SET_NETDEV_DEV(dev, &mdev->ofdev.dev); 144 SET_NETDEV_DEV(dev, &mdev->ofdev.dev);
145 145
146 mp = dev->priv; 146 mp = netdev_priv(dev);
147 mp->mdev = mdev; 147 mp->mdev = mdev;
148 macio_set_drvdata(mdev, dev); 148 macio_set_drvdata(mdev, dev);
149 149
@@ -164,7 +164,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
164 in_8(&mp->mace->chipid_lo); 164 in_8(&mp->mace->chipid_lo);
165 165
166 166
167 mp = (struct mace_data *) dev->priv; 167 mp = netdev_priv(dev);
168 mp->maccc = ENXMT | ENRCV; 168 mp->maccc = ENXMT | ENRCV;
169 169
170 mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000); 170 mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000);
@@ -275,7 +275,7 @@ static int __devexit mace_remove(struct macio_dev *mdev)
275 275
276 macio_set_drvdata(mdev, NULL); 276 macio_set_drvdata(mdev, NULL);
277 277
278 mp = dev->priv; 278 mp = netdev_priv(dev);
279 279
280 unregister_netdev(dev); 280 unregister_netdev(dev);
281 281
@@ -311,7 +311,7 @@ static void dbdma_reset(volatile struct dbdma_regs __iomem *dma)
311 311
312static void mace_reset(struct net_device *dev) 312static void mace_reset(struct net_device *dev)
313{ 313{
314 struct mace_data *mp = (struct mace_data *) dev->priv; 314 struct mace_data *mp = netdev_priv(dev);
315 volatile struct mace __iomem *mb = mp->mace; 315 volatile struct mace __iomem *mb = mp->mace;
316 int i; 316 int i;
317 317
@@ -366,7 +366,7 @@ static void mace_reset(struct net_device *dev)
366 366
367static void __mace_set_address(struct net_device *dev, void *addr) 367static void __mace_set_address(struct net_device *dev, void *addr)
368{ 368{
369 struct mace_data *mp = (struct mace_data *) dev->priv; 369 struct mace_data *mp = netdev_priv(dev);
370 volatile struct mace __iomem *mb = mp->mace; 370 volatile struct mace __iomem *mb = mp->mace;
371 unsigned char *p = addr; 371 unsigned char *p = addr;
372 int i; 372 int i;
@@ -387,7 +387,7 @@ static void __mace_set_address(struct net_device *dev, void *addr)
387 387
388static int mace_set_address(struct net_device *dev, void *addr) 388static int mace_set_address(struct net_device *dev, void *addr)
389{ 389{
390 struct mace_data *mp = (struct mace_data *) dev->priv; 390 struct mace_data *mp = netdev_priv(dev);
391 volatile struct mace __iomem *mb = mp->mace; 391 volatile struct mace __iomem *mb = mp->mace;
392 unsigned long flags; 392 unsigned long flags;
393 393
@@ -422,7 +422,7 @@ static inline void mace_clean_rings(struct mace_data *mp)
422 422
423static int mace_open(struct net_device *dev) 423static int mace_open(struct net_device *dev)
424{ 424{
425 struct mace_data *mp = (struct mace_data *) dev->priv; 425 struct mace_data *mp = netdev_priv(dev);
426 volatile struct mace __iomem *mb = mp->mace; 426 volatile struct mace __iomem *mb = mp->mace;
427 volatile struct dbdma_regs __iomem *rd = mp->rx_dma; 427 volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
428 volatile struct dbdma_regs __iomem *td = mp->tx_dma; 428 volatile struct dbdma_regs __iomem *td = mp->tx_dma;
@@ -492,7 +492,7 @@ static int mace_open(struct net_device *dev)
492 492
493static int mace_close(struct net_device *dev) 493static int mace_close(struct net_device *dev)
494{ 494{
495 struct mace_data *mp = (struct mace_data *) dev->priv; 495 struct mace_data *mp = netdev_priv(dev);
496 volatile struct mace __iomem *mb = mp->mace; 496 volatile struct mace __iomem *mb = mp->mace;
497 volatile struct dbdma_regs __iomem *rd = mp->rx_dma; 497 volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
498 volatile struct dbdma_regs __iomem *td = mp->tx_dma; 498 volatile struct dbdma_regs __iomem *td = mp->tx_dma;
@@ -512,7 +512,7 @@ static int mace_close(struct net_device *dev)
512 512
513static inline void mace_set_timeout(struct net_device *dev) 513static inline void mace_set_timeout(struct net_device *dev)
514{ 514{
515 struct mace_data *mp = (struct mace_data *) dev->priv; 515 struct mace_data *mp = netdev_priv(dev);
516 516
517 if (mp->timeout_active) 517 if (mp->timeout_active)
518 del_timer(&mp->tx_timeout); 518 del_timer(&mp->tx_timeout);
@@ -525,7 +525,7 @@ static inline void mace_set_timeout(struct net_device *dev)
525 525
526static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev) 526static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
527{ 527{
528 struct mace_data *mp = (struct mace_data *) dev->priv; 528 struct mace_data *mp = netdev_priv(dev);
529 volatile struct dbdma_regs __iomem *td = mp->tx_dma; 529 volatile struct dbdma_regs __iomem *td = mp->tx_dma;
530 volatile struct dbdma_cmd *cp, *np; 530 volatile struct dbdma_cmd *cp, *np;
531 unsigned long flags; 531 unsigned long flags;
@@ -580,7 +580,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
580 580
581static void mace_set_multicast(struct net_device *dev) 581static void mace_set_multicast(struct net_device *dev)
582{ 582{
583 struct mace_data *mp = (struct mace_data *) dev->priv; 583 struct mace_data *mp = netdev_priv(dev);
584 volatile struct mace __iomem *mb = mp->mace; 584 volatile struct mace __iomem *mb = mp->mace;
585 int i, j; 585 int i, j;
586 u32 crc; 586 u32 crc;
@@ -655,7 +655,7 @@ static void mace_handle_misc_intrs(struct mace_data *mp, int intr, struct net_de
655static irqreturn_t mace_interrupt(int irq, void *dev_id) 655static irqreturn_t mace_interrupt(int irq, void *dev_id)
656{ 656{
657 struct net_device *dev = (struct net_device *) dev_id; 657 struct net_device *dev = (struct net_device *) dev_id;
658 struct mace_data *mp = (struct mace_data *) dev->priv; 658 struct mace_data *mp = netdev_priv(dev);
659 volatile struct mace __iomem *mb = mp->mace; 659 volatile struct mace __iomem *mb = mp->mace;
660 volatile struct dbdma_regs __iomem *td = mp->tx_dma; 660 volatile struct dbdma_regs __iomem *td = mp->tx_dma;
661 volatile struct dbdma_cmd *cp; 661 volatile struct dbdma_cmd *cp;
@@ -801,7 +801,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
801static void mace_tx_timeout(unsigned long data) 801static void mace_tx_timeout(unsigned long data)
802{ 802{
803 struct net_device *dev = (struct net_device *) data; 803 struct net_device *dev = (struct net_device *) data;
804 struct mace_data *mp = (struct mace_data *) dev->priv; 804 struct mace_data *mp = netdev_priv(dev);
805 volatile struct mace __iomem *mb = mp->mace; 805 volatile struct mace __iomem *mb = mp->mace;
806 volatile struct dbdma_regs __iomem *td = mp->tx_dma; 806 volatile struct dbdma_regs __iomem *td = mp->tx_dma;
807 volatile struct dbdma_regs __iomem *rd = mp->rx_dma; 807 volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
@@ -872,7 +872,7 @@ static irqreturn_t mace_txdma_intr(int irq, void *dev_id)
872static irqreturn_t mace_rxdma_intr(int irq, void *dev_id) 872static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
873{ 873{
874 struct net_device *dev = (struct net_device *) dev_id; 874 struct net_device *dev = (struct net_device *) dev_id;
875 struct mace_data *mp = (struct mace_data *) dev->priv; 875 struct mace_data *mp = netdev_priv(dev);
876 volatile struct dbdma_regs __iomem *rd = mp->rx_dma; 876 volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
877 volatile struct dbdma_cmd *cp, *np; 877 volatile struct dbdma_cmd *cp, *np;
878 int i, nb, stat, next; 878 int i, nb, stat, next;