aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/declance.c2
-rw-r--r--drivers/net/depca.c40
-rw-r--r--drivers/net/dm9000.c32
-rw-r--r--drivers/net/e1000/e1000_main.c9
-rw-r--r--drivers/net/e1000e/netdev.c3
-rw-r--r--drivers/net/eepro.c4
-rw-r--r--drivers/net/epic100.c42
-rw-r--r--drivers/net/eth16i.c2
-rw-r--r--drivers/net/fec.c2
-rw-r--r--drivers/net/ibmveth.c34
-rw-r--r--drivers/net/igb/igb_ethtool.c4
-rw-r--r--drivers/net/irda/ali-ircc.c16
-rw-r--r--drivers/net/irda/donauboe.c8
-rw-r--r--drivers/net/irda/irda-usb.c14
-rw-r--r--drivers/net/irda/nsc-ircc.c16
-rw-r--r--drivers/net/irda/sa1100_ir.c26
-rw-r--r--drivers/net/irda/sir_dev.c12
-rw-r--r--drivers/net/irda/via-ircc.c16
-rw-r--r--drivers/net/irda/vlsi_ir.c36
-rw-r--r--drivers/net/irda/w83977af_ir.c14
-rw-r--r--drivers/net/mvme147.c4
-rw-r--r--drivers/net/myri_sbus.c10
-rw-r--r--drivers/net/ne2k-pci.c2
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c2
-rw-r--r--drivers/net/netxen/netxen_nic_main.c4
-rw-r--r--drivers/net/ni5010.c2
-rw-r--r--drivers/net/ni52.c36
-rw-r--r--drivers/net/pasemi_mac_ethtool.c4
-rw-r--r--drivers/net/pcmcia/com20020_cs.c6
-rw-r--r--drivers/net/plip.c8
-rw-r--r--drivers/net/rionet.c26
-rw-r--r--drivers/net/s2io.c78
32 files changed, 256 insertions, 258 deletions
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index f6988d7fb618..7ce3053530f9 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -1033,7 +1033,7 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
1033 dev = root_lance_dev; 1033 dev = root_lance_dev;
1034 while (dev) { 1034 while (dev) {
1035 i++; 1035 i++;
1036 lp = (struct lance_private *)dev->priv; 1036 lp = netdev_priv(dev);
1037 dev = lp->next; 1037 dev = lp->next;
1038 } 1038 }
1039 snprintf(name, sizeof(name), fmt, i); 1039 snprintf(name, sizeof(name), fmt, i);
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index fda1226d8ec1..ec34f03cb982 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -600,7 +600,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
600 return -ENXIO; 600 return -ENXIO;
601 } 601 }
602 602
603 lp = (struct depca_private *) dev->priv; 603 lp = netdev_priv(dev);
604 mem_start = lp->mem_start; 604 mem_start = lp->mem_start;
605 605
606 if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown) 606 if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown)
@@ -820,7 +820,7 @@ out_priv:
820 820
821static int depca_open(struct net_device *dev) 821static int depca_open(struct net_device *dev)
822{ 822{
823 struct depca_private *lp = (struct depca_private *) dev->priv; 823 struct depca_private *lp = netdev_priv(dev);
824 u_long ioaddr = dev->base_addr; 824 u_long ioaddr = dev->base_addr;
825 s16 nicsr; 825 s16 nicsr;
826 int status = 0; 826 int status = 0;
@@ -865,7 +865,7 @@ static int depca_open(struct net_device *dev)
865/* Initialize the lance Rx and Tx descriptor rings. */ 865/* Initialize the lance Rx and Tx descriptor rings. */
866static void depca_init_ring(struct net_device *dev) 866static void depca_init_ring(struct net_device *dev)
867{ 867{
868 struct depca_private *lp = (struct depca_private *) dev->priv; 868 struct depca_private *lp = netdev_priv(dev);
869 u_int i; 869 u_int i;
870 u_long offset; 870 u_long offset;
871 871
@@ -923,7 +923,7 @@ static void depca_tx_timeout(struct net_device *dev)
923*/ 923*/
924static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev) 924static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
925{ 925{
926 struct depca_private *lp = (struct depca_private *) dev->priv; 926 struct depca_private *lp = netdev_priv(dev);
927 u_long ioaddr = dev->base_addr; 927 u_long ioaddr = dev->base_addr;
928 int status = 0; 928 int status = 0;
929 929
@@ -971,7 +971,7 @@ static irqreturn_t depca_interrupt(int irq, void *dev_id)
971 return IRQ_NONE; 971 return IRQ_NONE;
972 } 972 }
973 973
974 lp = (struct depca_private *) dev->priv; 974 lp = netdev_priv(dev);
975 ioaddr = dev->base_addr; 975 ioaddr = dev->base_addr;
976 976
977 spin_lock(&lp->lock); 977 spin_lock(&lp->lock);
@@ -1009,7 +1009,7 @@ static irqreturn_t depca_interrupt(int irq, void *dev_id)
1009/* Called with lp->lock held */ 1009/* Called with lp->lock held */
1010static int depca_rx(struct net_device *dev) 1010static int depca_rx(struct net_device *dev)
1011{ 1011{
1012 struct depca_private *lp = (struct depca_private *) dev->priv; 1012 struct depca_private *lp = netdev_priv(dev);
1013 int i, entry; 1013 int i, entry;
1014 s32 status; 1014 s32 status;
1015 1015
@@ -1106,7 +1106,7 @@ static int depca_rx(struct net_device *dev)
1106*/ 1106*/
1107static int depca_tx(struct net_device *dev) 1107static int depca_tx(struct net_device *dev)
1108{ 1108{
1109 struct depca_private *lp = (struct depca_private *) dev->priv; 1109 struct depca_private *lp = netdev_priv(dev);
1110 int entry; 1110 int entry;
1111 s32 status; 1111 s32 status;
1112 u_long ioaddr = dev->base_addr; 1112 u_long ioaddr = dev->base_addr;
@@ -1147,7 +1147,7 @@ static int depca_tx(struct net_device *dev)
1147 1147
1148static int depca_close(struct net_device *dev) 1148static int depca_close(struct net_device *dev)
1149{ 1149{
1150 struct depca_private *lp = (struct depca_private *) dev->priv; 1150 struct depca_private *lp = netdev_priv(dev);
1151 s16 nicsr; 1151 s16 nicsr;
1152 u_long ioaddr = dev->base_addr; 1152 u_long ioaddr = dev->base_addr;
1153 1153
@@ -1183,7 +1183,7 @@ static int depca_close(struct net_device *dev)
1183 1183
1184static void LoadCSRs(struct net_device *dev) 1184static void LoadCSRs(struct net_device *dev)
1185{ 1185{
1186 struct depca_private *lp = (struct depca_private *) dev->priv; 1186 struct depca_private *lp = netdev_priv(dev);
1187 u_long ioaddr = dev->base_addr; 1187 u_long ioaddr = dev->base_addr;
1188 1188
1189 outw(CSR1, DEPCA_ADDR); /* initialisation block address LSW */ 1189 outw(CSR1, DEPCA_ADDR); /* initialisation block address LSW */
@@ -1200,7 +1200,7 @@ static void LoadCSRs(struct net_device *dev)
1200 1200
1201static int InitRestartDepca(struct net_device *dev) 1201static int InitRestartDepca(struct net_device *dev)
1202{ 1202{
1203 struct depca_private *lp = (struct depca_private *) dev->priv; 1203 struct depca_private *lp = netdev_priv(dev);
1204 u_long ioaddr = dev->base_addr; 1204 u_long ioaddr = dev->base_addr;
1205 int i, status = 0; 1205 int i, status = 0;
1206 1206
@@ -1232,7 +1232,7 @@ static int InitRestartDepca(struct net_device *dev)
1232*/ 1232*/
1233static void set_multicast_list(struct net_device *dev) 1233static void set_multicast_list(struct net_device *dev)
1234{ 1234{
1235 struct depca_private *lp = (struct depca_private *) dev->priv; 1235 struct depca_private *lp = netdev_priv(dev);
1236 u_long ioaddr = dev->base_addr; 1236 u_long ioaddr = dev->base_addr;
1237 1237
1238 netif_stop_queue(dev); 1238 netif_stop_queue(dev);
@@ -1261,7 +1261,7 @@ static void set_multicast_list(struct net_device *dev)
1261*/ 1261*/
1262static void SetMulticastFilter(struct net_device *dev) 1262static void SetMulticastFilter(struct net_device *dev)
1263{ 1263{
1264 struct depca_private *lp = (struct depca_private *) dev->priv; 1264 struct depca_private *lp = netdev_priv(dev);
1265 struct dev_mc_list *dmi = dev->mc_list; 1265 struct dev_mc_list *dmi = dev->mc_list;
1266 char *addrs; 1266 char *addrs;
1267 int i, j, bit, byte; 1267 int i, j, bit, byte;
@@ -1429,7 +1429,7 @@ static int __init depca_mca_probe(struct device *device)
1429 1429
1430 dev->irq = irq; 1430 dev->irq = irq;
1431 dev->base_addr = iobase; 1431 dev->base_addr = iobase;
1432 lp = dev->priv; 1432 lp = netdev_priv(dev);
1433 lp->depca_bus = DEPCA_BUS_MCA; 1433 lp->depca_bus = DEPCA_BUS_MCA;
1434 lp->adapter = depca_mca_adapter_type[mdev->index]; 1434 lp->adapter = depca_mca_adapter_type[mdev->index];
1435 lp->mem_start = mem_start; 1435 lp->mem_start = mem_start;
@@ -1532,7 +1532,7 @@ static int __init depca_isa_probe (struct platform_device *device)
1532 dev->base_addr = ioaddr; 1532 dev->base_addr = ioaddr;
1533 dev->irq = irq; /* Use whatever value the user gave 1533 dev->irq = irq; /* Use whatever value the user gave
1534 * us, and 0 if he didn't. */ 1534 * us, and 0 if he didn't. */
1535 lp = dev->priv; 1535 lp = netdev_priv(dev);
1536 lp->depca_bus = DEPCA_BUS_ISA; 1536 lp->depca_bus = DEPCA_BUS_ISA;
1537 lp->adapter = adapter; 1537 lp->adapter = adapter;
1538 lp->mem_start = mem_start; 1538 lp->mem_start = mem_start;
@@ -1578,7 +1578,7 @@ static int __init depca_eisa_probe (struct device *device)
1578 1578
1579 dev->base_addr = ioaddr; 1579 dev->base_addr = ioaddr;
1580 dev->irq = irq; 1580 dev->irq = irq;
1581 lp = dev->priv; 1581 lp = netdev_priv(dev);
1582 lp->depca_bus = DEPCA_BUS_EISA; 1582 lp->depca_bus = DEPCA_BUS_EISA;
1583 lp->adapter = edev->id.driver_data; 1583 lp->adapter = edev->id.driver_data;
1584 lp->mem_start = mem_start; 1584 lp->mem_start = mem_start;
@@ -1603,7 +1603,7 @@ static int __devexit depca_device_remove (struct device *device)
1603 int bus; 1603 int bus;
1604 1604
1605 dev = device->driver_data; 1605 dev = device->driver_data;
1606 lp = dev->priv; 1606 lp = netdev_priv(dev);
1607 1607
1608 unregister_netdev (dev); 1608 unregister_netdev (dev);
1609 iounmap (lp->sh_mem); 1609 iounmap (lp->sh_mem);
@@ -1745,7 +1745,7 @@ static int __init DevicePresent(u_long ioaddr)
1745static int __init get_hw_addr(struct net_device *dev) 1745static int __init get_hw_addr(struct net_device *dev)
1746{ 1746{
1747 u_long ioaddr = dev->base_addr; 1747 u_long ioaddr = dev->base_addr;
1748 struct depca_private *lp = dev->priv; 1748 struct depca_private *lp = netdev_priv(dev);
1749 int i, k, tmp, status = 0; 1749 int i, k, tmp, status = 0;
1750 u_short j, x, chksum; 1750 u_short j, x, chksum;
1751 1751
@@ -1780,7 +1780,7 @@ static int __init get_hw_addr(struct net_device *dev)
1780*/ 1780*/
1781static int load_packet(struct net_device *dev, struct sk_buff *skb) 1781static int load_packet(struct net_device *dev, struct sk_buff *skb)
1782{ 1782{
1783 struct depca_private *lp = (struct depca_private *) dev->priv; 1783 struct depca_private *lp = netdev_priv(dev);
1784 int i, entry, end, len, status = 0; 1784 int i, entry, end, len, status = 0;
1785 1785
1786 entry = lp->tx_new; /* Ring around buffer number. */ 1786 entry = lp->tx_new; /* Ring around buffer number. */
@@ -1835,7 +1835,7 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb)
1835 1835
1836static void depca_dbg_open(struct net_device *dev) 1836static void depca_dbg_open(struct net_device *dev)
1837{ 1837{
1838 struct depca_private *lp = (struct depca_private *) dev->priv; 1838 struct depca_private *lp = netdev_priv(dev);
1839 u_long ioaddr = dev->base_addr; 1839 u_long ioaddr = dev->base_addr;
1840 struct depca_init *p = &lp->init_block; 1840 struct depca_init *p = &lp->init_block;
1841 int i; 1841 int i;
@@ -1906,7 +1906,7 @@ static void depca_dbg_open(struct net_device *dev)
1906*/ 1906*/
1907static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1907static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1908{ 1908{
1909 struct depca_private *lp = (struct depca_private *) dev->priv; 1909 struct depca_private *lp = netdev_priv(dev);
1910 struct depca_ioctl *ioc = (struct depca_ioctl *) &rq->ifr_ifru; 1910 struct depca_ioctl *ioc = (struct depca_ioctl *) &rq->ifr_ifru;
1911 int i, status = 0; 1911 int i, status = 0;
1912 u_long ioaddr = dev->base_addr; 1912 u_long ioaddr = dev->base_addr;
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 22dd3081339d..0d9a217e8583 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -137,7 +137,7 @@ typedef struct board_info {
137 137
138static inline board_info_t *to_dm9000_board(struct net_device *dev) 138static inline board_info_t *to_dm9000_board(struct net_device *dev)
139{ 139{
140 return dev->priv; 140 return netdev_priv(dev);
141} 141}
142 142
143/* DM9000 network board routine ---------------------------- */ 143/* DM9000 network board routine ---------------------------- */
@@ -626,7 +626,7 @@ static unsigned char dm9000_type_to_char(enum dm9000_type type)
626static void 626static void
627dm9000_hash_table(struct net_device *dev) 627dm9000_hash_table(struct net_device *dev)
628{ 628{
629 board_info_t *db = (board_info_t *) dev->priv; 629 board_info_t *db = netdev_priv(dev);
630 struct dev_mc_list *mcptr = dev->mc_list; 630 struct dev_mc_list *mcptr = dev->mc_list;
631 int mc_cnt = dev->mc_count; 631 int mc_cnt = dev->mc_count;
632 int i, oft; 632 int i, oft;
@@ -677,7 +677,7 @@ dm9000_hash_table(struct net_device *dev)
677static void 677static void
678dm9000_init_dm9000(struct net_device *dev) 678dm9000_init_dm9000(struct net_device *dev)
679{ 679{
680 board_info_t *db = dev->priv; 680 board_info_t *db = netdev_priv(dev);
681 unsigned int imr; 681 unsigned int imr;
682 682
683 dm9000_dbg(db, 1, "entering %s\n", __func__); 683 dm9000_dbg(db, 1, "entering %s\n", __func__);
@@ -723,7 +723,7 @@ dm9000_init_dm9000(struct net_device *dev)
723/* Our watchdog timed out. Called by the networking layer */ 723/* Our watchdog timed out. Called by the networking layer */
724static void dm9000_timeout(struct net_device *dev) 724static void dm9000_timeout(struct net_device *dev)
725{ 725{
726 board_info_t *db = (board_info_t *) dev->priv; 726 board_info_t *db = netdev_priv(dev);
727 u8 reg_save; 727 u8 reg_save;
728 unsigned long flags; 728 unsigned long flags;
729 729
@@ -751,7 +751,7 @@ static int
751dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) 751dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
752{ 752{
753 unsigned long flags; 753 unsigned long flags;
754 board_info_t *db = dev->priv; 754 board_info_t *db = netdev_priv(dev);
755 755
756 dm9000_dbg(db, 3, "%s:\n", __func__); 756 dm9000_dbg(db, 3, "%s:\n", __func__);
757 757
@@ -831,7 +831,7 @@ struct dm9000_rxhdr {
831static void 831static void
832dm9000_rx(struct net_device *dev) 832dm9000_rx(struct net_device *dev)
833{ 833{
834 board_info_t *db = (board_info_t *) dev->priv; 834 board_info_t *db = netdev_priv(dev);
835 struct dm9000_rxhdr rxhdr; 835 struct dm9000_rxhdr rxhdr;
836 struct sk_buff *skb; 836 struct sk_buff *skb;
837 u8 rxbyte, *rdptr; 837 u8 rxbyte, *rdptr;
@@ -928,7 +928,7 @@ dm9000_rx(struct net_device *dev)
928static irqreturn_t dm9000_interrupt(int irq, void *dev_id) 928static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
929{ 929{
930 struct net_device *dev = dev_id; 930 struct net_device *dev = dev_id;
931 board_info_t *db = dev->priv; 931 board_info_t *db = netdev_priv(dev);
932 int int_status; 932 int int_status;
933 u8 reg_save; 933 u8 reg_save;
934 934
@@ -996,7 +996,7 @@ static void dm9000_poll_controller(struct net_device *dev)
996static int 996static int
997dm9000_open(struct net_device *dev) 997dm9000_open(struct net_device *dev)
998{ 998{
999 board_info_t *db = dev->priv; 999 board_info_t *db = netdev_priv(dev);
1000 unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK; 1000 unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;
1001 1001
1002 if (netif_msg_ifup(db)) 1002 if (netif_msg_ifup(db))
@@ -1046,7 +1046,7 @@ static void dm9000_msleep(board_info_t *db, unsigned int ms)
1046static int 1046static int
1047dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) 1047dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
1048{ 1048{
1049 board_info_t *db = (board_info_t *) dev->priv; 1049 board_info_t *db = netdev_priv(dev);
1050 unsigned long flags; 1050 unsigned long flags;
1051 unsigned int reg_save; 1051 unsigned int reg_save;
1052 int ret; 1052 int ret;
@@ -1093,7 +1093,7 @@ static void
1093dm9000_phy_write(struct net_device *dev, 1093dm9000_phy_write(struct net_device *dev,
1094 int phyaddr_unused, int reg, int value) 1094 int phyaddr_unused, int reg, int value)
1095{ 1095{
1096 board_info_t *db = (board_info_t *) dev->priv; 1096 board_info_t *db = netdev_priv(dev);
1097 unsigned long flags; 1097 unsigned long flags;
1098 unsigned long reg_save; 1098 unsigned long reg_save;
1099 1099
@@ -1134,7 +1134,7 @@ dm9000_phy_write(struct net_device *dev,
1134static void 1134static void
1135dm9000_shutdown(struct net_device *dev) 1135dm9000_shutdown(struct net_device *dev)
1136{ 1136{
1137 board_info_t *db = dev->priv; 1137 board_info_t *db = netdev_priv(dev);
1138 1138
1139 /* RESET device */ 1139 /* RESET device */
1140 dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ 1140 dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
@@ -1150,7 +1150,7 @@ dm9000_shutdown(struct net_device *dev)
1150static int 1150static int
1151dm9000_stop(struct net_device *ndev) 1151dm9000_stop(struct net_device *ndev)
1152{ 1152{
1153 board_info_t *db = ndev->priv; 1153 board_info_t *db = netdev_priv(ndev);
1154 1154
1155 if (netif_msg_ifdown(db)) 1155 if (netif_msg_ifdown(db))
1156 dev_dbg(db->dev, "shutting down %s\n", ndev->name); 1156 dev_dbg(db->dev, "shutting down %s\n", ndev->name);
@@ -1197,7 +1197,7 @@ dm9000_probe(struct platform_device *pdev)
1197 dev_dbg(&pdev->dev, "dm9000_probe()\n"); 1197 dev_dbg(&pdev->dev, "dm9000_probe()\n");
1198 1198
1199 /* setup board info structure */ 1199 /* setup board info structure */
1200 db = ndev->priv; 1200 db = netdev_priv(ndev);
1201 memset(db, 0, sizeof(*db)); 1201 memset(db, 0, sizeof(*db));
1202 1202
1203 db->dev = &pdev->dev; 1203 db->dev = &pdev->dev;
@@ -1408,7 +1408,7 @@ dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
1408 board_info_t *db; 1408 board_info_t *db;
1409 1409
1410 if (ndev) { 1410 if (ndev) {
1411 db = (board_info_t *) ndev->priv; 1411 db = netdev_priv(ndev);
1412 db->in_suspend = 1; 1412 db->in_suspend = 1;
1413 1413
1414 if (netif_running(ndev)) { 1414 if (netif_running(ndev)) {
@@ -1423,7 +1423,7 @@ static int
1423dm9000_drv_resume(struct platform_device *dev) 1423dm9000_drv_resume(struct platform_device *dev)
1424{ 1424{
1425 struct net_device *ndev = platform_get_drvdata(dev); 1425 struct net_device *ndev = platform_get_drvdata(dev);
1426 board_info_t *db = (board_info_t *) ndev->priv; 1426 board_info_t *db = netdev_priv(ndev);
1427 1427
1428 if (ndev) { 1428 if (ndev) {
1429 1429
@@ -1447,7 +1447,7 @@ dm9000_drv_remove(struct platform_device *pdev)
1447 platform_set_drvdata(pdev, NULL); 1447 platform_set_drvdata(pdev, NULL);
1448 1448
1449 unregister_netdev(ndev); 1449 unregister_netdev(ndev);
1450 dm9000_release_board(pdev, (board_info_t *) ndev->priv); 1450 dm9000_release_board(pdev, (board_info_t *) netdev_priv(ndev);
1451 free_netdev(ndev); /* free device structure */ 1451 free_netdev(ndev); /* free device structure */
1452 1452
1453 dev_dbg(&pdev->dev, "released and freed device\n"); 1453 dev_dbg(&pdev->dev, "released and freed device\n");
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 78a4250e004f..7dd4ded13d97 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3786,8 +3786,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
3786 struct net_device *poll_dev = adapter->netdev; 3786 struct net_device *poll_dev = adapter->netdev;
3787 int tx_cleaned = 0, work_done = 0; 3787 int tx_cleaned = 0, work_done = 0;
3788 3788
3789 /* Must NOT use netdev_priv macro here. */ 3789 adapter = netdev_priv(poll_dev);
3790 adapter = poll_dev->priv;
3791 3790
3792 /* e1000_clean is called per-cpu. This lock protects 3791 /* e1000_clean is called per-cpu. This lock protects
3793 * tx_ring[0] from being cleaned by multiple cpus 3792 * tx_ring[0] from being cleaned by multiple cpus
@@ -4782,7 +4781,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
4782 pci_channel_state_t state) 4781 pci_channel_state_t state)
4783{ 4782{
4784 struct net_device *netdev = pci_get_drvdata(pdev); 4783 struct net_device *netdev = pci_get_drvdata(pdev);
4785 struct e1000_adapter *adapter = netdev->priv; 4784 struct e1000_adapter *adapter = netdev_priv(netdev);
4786 4785
4787 netif_device_detach(netdev); 4786 netif_device_detach(netdev);
4788 4787
@@ -4804,7 +4803,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
4804static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev) 4803static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4805{ 4804{
4806 struct net_device *netdev = pci_get_drvdata(pdev); 4805 struct net_device *netdev = pci_get_drvdata(pdev);
4807 struct e1000_adapter *adapter = netdev->priv; 4806 struct e1000_adapter *adapter = netdev_priv(netdev);
4808 struct e1000_hw *hw = &adapter->hw; 4807 struct e1000_hw *hw = &adapter->hw;
4809 int err; 4808 int err;
4810 4809
@@ -4838,7 +4837,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
4838static void e1000_io_resume(struct pci_dev *pdev) 4837static void e1000_io_resume(struct pci_dev *pdev)
4839{ 4838{
4840 struct net_device *netdev = pci_get_drvdata(pdev); 4839 struct net_device *netdev = pci_get_drvdata(pdev);
4841 struct e1000_adapter *adapter = netdev->priv; 4840 struct e1000_adapter *adapter = netdev_priv(netdev);
4842 struct e1000_hw *hw = &adapter->hw; 4841 struct e1000_hw *hw = &adapter->hw;
4843 4842
4844 e1000_init_manageability(adapter); 4843 e1000_init_manageability(adapter);
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 63e5688011e8..3eeae1cf994e 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1988,8 +1988,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
1988 struct net_device *poll_dev = adapter->netdev; 1988 struct net_device *poll_dev = adapter->netdev;
1989 int tx_cleaned = 0, work_done = 0; 1989 int tx_cleaned = 0, work_done = 0;
1990 1990
1991 /* Must NOT use netdev_priv macro here. */ 1991 adapter = netdev_priv(poll_dev);
1992 adapter = poll_dev->priv;
1993 1992
1994 if (adapter->msix_entries && 1993 if (adapter->msix_entries &&
1995 !(adapter->rx_ring->ims_val & adapter->tx_ring->ims_val)) 1994 !(adapter->rx_ring->ims_val & adapter->tx_ring->ims_val))
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 93387f16c2ea..0a984619411b 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -605,7 +605,7 @@ out:
605 605
606static void __init printEEPROMInfo(struct net_device *dev) 606static void __init printEEPROMInfo(struct net_device *dev)
607{ 607{
608 struct eepro_local *lp = (struct eepro_local *)dev->priv; 608 struct eepro_local *lp = netdev_priv(dev);
609 int ioaddr = dev->base_addr; 609 int ioaddr = dev->base_addr;
610 unsigned short Word; 610 unsigned short Word;
611 int i,j; 611 int i,j;
@@ -1674,7 +1674,7 @@ eepro_transmit_interrupt(struct net_device *dev)
1674static int eepro_ethtool_get_settings(struct net_device *dev, 1674static int eepro_ethtool_get_settings(struct net_device *dev,
1675 struct ethtool_cmd *cmd) 1675 struct ethtool_cmd *cmd)
1676{ 1676{
1677 struct eepro_local *lp = (struct eepro_local *)dev->priv; 1677 struct eepro_local *lp = netdev_priv(dev);
1678 1678
1679 cmd->supported = SUPPORTED_10baseT_Half | 1679 cmd->supported = SUPPORTED_10baseT_Half |
1680 SUPPORTED_10baseT_Full | 1680 SUPPORTED_10baseT_Full |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 6f399bdc5f72..4a951b8cb4d7 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -371,7 +371,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
371#endif 371#endif
372 372
373 pci_set_drvdata(pdev, dev); 373 pci_set_drvdata(pdev, dev);
374 ep = dev->priv; 374 ep = netdev_priv(dev);
375 ep->mii.dev = dev; 375 ep->mii.dev = dev;
376 ep->mii.mdio_read = mdio_read; 376 ep->mii.mdio_read = mdio_read;
377 ep->mii.mdio_write = mdio_write; 377 ep->mii.mdio_write = mdio_write;
@@ -654,7 +654,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int value)
654 654
655static int epic_open(struct net_device *dev) 655static int epic_open(struct net_device *dev)
656{ 656{
657 struct epic_private *ep = dev->priv; 657 struct epic_private *ep = netdev_priv(dev);
658 long ioaddr = dev->base_addr; 658 long ioaddr = dev->base_addr;
659 int i; 659 int i;
660 int retval; 660 int retval;
@@ -766,7 +766,7 @@ static int epic_open(struct net_device *dev)
766static void epic_pause(struct net_device *dev) 766static void epic_pause(struct net_device *dev)
767{ 767{
768 long ioaddr = dev->base_addr; 768 long ioaddr = dev->base_addr;
769 struct epic_private *ep = dev->priv; 769 struct epic_private *ep = netdev_priv(dev);
770 770
771 netif_stop_queue (dev); 771 netif_stop_queue (dev);
772 772
@@ -789,7 +789,7 @@ static void epic_pause(struct net_device *dev)
789static void epic_restart(struct net_device *dev) 789static void epic_restart(struct net_device *dev)
790{ 790{
791 long ioaddr = dev->base_addr; 791 long ioaddr = dev->base_addr;
792 struct epic_private *ep = dev->priv; 792 struct epic_private *ep = netdev_priv(dev);
793 int i; 793 int i;
794 794
795 /* Soft reset the chip. */ 795 /* Soft reset the chip. */
@@ -841,7 +841,7 @@ static void epic_restart(struct net_device *dev)
841 841
842static void check_media(struct net_device *dev) 842static void check_media(struct net_device *dev)
843{ 843{
844 struct epic_private *ep = dev->priv; 844 struct epic_private *ep = netdev_priv(dev);
845 long ioaddr = dev->base_addr; 845 long ioaddr = dev->base_addr;
846 int mii_lpa = ep->mii_phy_cnt ? mdio_read(dev, ep->phys[0], MII_LPA) : 0; 846 int mii_lpa = ep->mii_phy_cnt ? mdio_read(dev, ep->phys[0], MII_LPA) : 0;
847 int negotiated = mii_lpa & ep->mii.advertising; 847 int negotiated = mii_lpa & ep->mii.advertising;
@@ -863,7 +863,7 @@ static void check_media(struct net_device *dev)
863static void epic_timer(unsigned long data) 863static void epic_timer(unsigned long data)
864{ 864{
865 struct net_device *dev = (struct net_device *)data; 865 struct net_device *dev = (struct net_device *)data;
866 struct epic_private *ep = dev->priv; 866 struct epic_private *ep = netdev_priv(dev);
867 long ioaddr = dev->base_addr; 867 long ioaddr = dev->base_addr;
868 int next_tick = 5*HZ; 868 int next_tick = 5*HZ;
869 869
@@ -884,7 +884,7 @@ static void epic_timer(unsigned long data)
884 884
885static void epic_tx_timeout(struct net_device *dev) 885static void epic_tx_timeout(struct net_device *dev)
886{ 886{
887 struct epic_private *ep = dev->priv; 887 struct epic_private *ep = netdev_priv(dev);
888 long ioaddr = dev->base_addr; 888 long ioaddr = dev->base_addr;
889 889
890 if (debug > 0) { 890 if (debug > 0) {
@@ -913,7 +913,7 @@ static void epic_tx_timeout(struct net_device *dev)
913/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ 913/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
914static void epic_init_ring(struct net_device *dev) 914static void epic_init_ring(struct net_device *dev)
915{ 915{
916 struct epic_private *ep = dev->priv; 916 struct epic_private *ep = netdev_priv(dev);
917 int i; 917 int i;
918 918
919 ep->tx_full = 0; 919 ep->tx_full = 0;
@@ -959,7 +959,7 @@ static void epic_init_ring(struct net_device *dev)
959 959
960static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) 960static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
961{ 961{
962 struct epic_private *ep = dev->priv; 962 struct epic_private *ep = netdev_priv(dev);
963 int entry, free_count; 963 int entry, free_count;
964 u32 ctrl_word; 964 u32 ctrl_word;
965 unsigned long flags; 965 unsigned long flags;
@@ -1087,7 +1087,7 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
1087static irqreturn_t epic_interrupt(int irq, void *dev_instance) 1087static irqreturn_t epic_interrupt(int irq, void *dev_instance)
1088{ 1088{
1089 struct net_device *dev = dev_instance; 1089 struct net_device *dev = dev_instance;
1090 struct epic_private *ep = dev->priv; 1090 struct epic_private *ep = netdev_priv(dev);
1091 long ioaddr = dev->base_addr; 1091 long ioaddr = dev->base_addr;
1092 unsigned int handled = 0; 1092 unsigned int handled = 0;
1093 int status; 1093 int status;
@@ -1155,7 +1155,7 @@ out:
1155 1155
1156static int epic_rx(struct net_device *dev, int budget) 1156static int epic_rx(struct net_device *dev, int budget)
1157{ 1157{
1158 struct epic_private *ep = dev->priv; 1158 struct epic_private *ep = netdev_priv(dev);
1159 int entry = ep->cur_rx % RX_RING_SIZE; 1159 int entry = ep->cur_rx % RX_RING_SIZE;
1160 int rx_work_limit = ep->dirty_rx + RX_RING_SIZE - ep->cur_rx; 1160 int rx_work_limit = ep->dirty_rx + RX_RING_SIZE - ep->cur_rx;
1161 int work_done = 0; 1161 int work_done = 0;
@@ -1306,7 +1306,7 @@ rx_action:
1306static int epic_close(struct net_device *dev) 1306static int epic_close(struct net_device *dev)
1307{ 1307{
1308 long ioaddr = dev->base_addr; 1308 long ioaddr = dev->base_addr;
1309 struct epic_private *ep = dev->priv; 1309 struct epic_private *ep = netdev_priv(dev);
1310 struct sk_buff *skb; 1310 struct sk_buff *skb;
1311 int i; 1311 int i;
1312 1312
@@ -1356,7 +1356,7 @@ static int epic_close(struct net_device *dev)
1356 1356
1357static struct net_device_stats *epic_get_stats(struct net_device *dev) 1357static struct net_device_stats *epic_get_stats(struct net_device *dev)
1358{ 1358{
1359 struct epic_private *ep = dev->priv; 1359 struct epic_private *ep = netdev_priv(dev);
1360 long ioaddr = dev->base_addr; 1360 long ioaddr = dev->base_addr;
1361 1361
1362 if (netif_running(dev)) { 1362 if (netif_running(dev)) {
@@ -1377,7 +1377,7 @@ static struct net_device_stats *epic_get_stats(struct net_device *dev)
1377static void set_rx_mode(struct net_device *dev) 1377static void set_rx_mode(struct net_device *dev)
1378{ 1378{
1379 long ioaddr = dev->base_addr; 1379 long ioaddr = dev->base_addr;
1380 struct epic_private *ep = dev->priv; 1380 struct epic_private *ep = netdev_priv(dev);
1381 unsigned char mc_filter[8]; /* Multicast hash filter */ 1381 unsigned char mc_filter[8]; /* Multicast hash filter */
1382 int i; 1382 int i;
1383 1383
@@ -1416,7 +1416,7 @@ static void set_rx_mode(struct net_device *dev)
1416 1416
1417static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info) 1417static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *info)
1418{ 1418{
1419 struct epic_private *np = dev->priv; 1419 struct epic_private *np = netdev_priv(dev);
1420 1420
1421 strcpy (info->driver, DRV_NAME); 1421 strcpy (info->driver, DRV_NAME);
1422 strcpy (info->version, DRV_VERSION); 1422 strcpy (info->version, DRV_VERSION);
@@ -1425,7 +1425,7 @@ static void netdev_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *
1425 1425
1426static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 1426static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1427{ 1427{
1428 struct epic_private *np = dev->priv; 1428 struct epic_private *np = netdev_priv(dev);
1429 int rc; 1429 int rc;
1430 1430
1431 spin_lock_irq(&np->lock); 1431 spin_lock_irq(&np->lock);
@@ -1437,7 +1437,7 @@ static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1437 1437
1438static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 1438static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1439{ 1439{
1440 struct epic_private *np = dev->priv; 1440 struct epic_private *np = netdev_priv(dev);
1441 int rc; 1441 int rc;
1442 1442
1443 spin_lock_irq(&np->lock); 1443 spin_lock_irq(&np->lock);
@@ -1449,13 +1449,13 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1449 1449
1450static int netdev_nway_reset(struct net_device *dev) 1450static int netdev_nway_reset(struct net_device *dev)
1451{ 1451{
1452 struct epic_private *np = dev->priv; 1452 struct epic_private *np = netdev_priv(dev);
1453 return mii_nway_restart(&np->mii); 1453 return mii_nway_restart(&np->mii);
1454} 1454}
1455 1455
1456static u32 netdev_get_link(struct net_device *dev) 1456static u32 netdev_get_link(struct net_device *dev)
1457{ 1457{
1458 struct epic_private *np = dev->priv; 1458 struct epic_private *np = netdev_priv(dev);
1459 return mii_link_ok(&np->mii); 1459 return mii_link_ok(&np->mii);
1460} 1460}
1461 1461
@@ -1504,7 +1504,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
1504 1504
1505static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1505static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1506{ 1506{
1507 struct epic_private *np = dev->priv; 1507 struct epic_private *np = netdev_priv(dev);
1508 long ioaddr = dev->base_addr; 1508 long ioaddr = dev->base_addr;
1509 struct mii_ioctl_data *data = if_mii(rq); 1509 struct mii_ioctl_data *data = if_mii(rq);
1510 int rc; 1510 int rc;
@@ -1532,7 +1532,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1532static void __devexit epic_remove_one (struct pci_dev *pdev) 1532static void __devexit epic_remove_one (struct pci_dev *pdev)
1533{ 1533{
1534 struct net_device *dev = pci_get_drvdata(pdev); 1534 struct net_device *dev = pci_get_drvdata(pdev);
1535 struct epic_private *ep = dev->priv; 1535 struct epic_private *ep = netdev_priv(dev);
1536 1536
1537 pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); 1537 pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma);
1538 pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma); 1538 pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma);
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c
index 88b1be05d428..8d9fe4dd346f 100644
--- a/drivers/net/eth16i.c
+++ b/drivers/net/eth16i.c
@@ -1465,7 +1465,7 @@ void __exit cleanup_module(void)
1465 for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) { 1465 for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) {
1466 struct net_device *dev = dev_eth16i[this_dev]; 1466 struct net_device *dev = dev_eth16i[this_dev];
1467 1467
1468 if(dev->priv) { 1468 if (netdev_priv(dev)) {
1469 unregister_netdev(dev); 1469 unregister_netdev(dev);
1470 free_irq(dev->irq, dev); 1470 free_irq(dev->irq, dev);
1471 release_region(dev->base_addr, ETH16I_IO_EXTENT); 1471 release_region(dev->base_addr, ETH16I_IO_EXTENT);
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 2487d83ce5e4..7e33c129d51c 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1155,7 +1155,7 @@ static phy_info_t const phy_info_ks8721bl = {
1155 1155
1156static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) 1156static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev)
1157{ 1157{
1158 struct fec_enet_private *fep = dev->priv; 1158 struct fec_enet_private *fep = netdev_priv(dev);
1159 volatile uint *s = &(fep->phy_status); 1159 volatile uint *s = &(fep->phy_status);
1160 1160
1161 *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); 1161 *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC);
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 2c409570c5d8..02ecfdb4df6b 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -527,7 +527,7 @@ retry:
527 527
528static int ibmveth_open(struct net_device *netdev) 528static int ibmveth_open(struct net_device *netdev)
529{ 529{
530 struct ibmveth_adapter *adapter = netdev->priv; 530 struct ibmveth_adapter *adapter = netdev_priv(netdev);
531 u64 mac_address = 0; 531 u64 mac_address = 0;
532 int rxq_entries = 1; 532 int rxq_entries = 1;
533 unsigned long lpar_rc; 533 unsigned long lpar_rc;
@@ -666,7 +666,7 @@ static int ibmveth_open(struct net_device *netdev)
666 666
667static int ibmveth_close(struct net_device *netdev) 667static int ibmveth_close(struct net_device *netdev)
668{ 668{
669 struct ibmveth_adapter *adapter = netdev->priv; 669 struct ibmveth_adapter *adapter = netdev_priv(netdev);
670 long lpar_rc; 670 long lpar_rc;
671 671
672 ibmveth_debug_printk("close starting\n"); 672 ibmveth_debug_printk("close starting\n");
@@ -722,7 +722,7 @@ static u32 netdev_get_link(struct net_device *dev) {
722 722
723static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data) 723static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
724{ 724{
725 struct ibmveth_adapter *adapter = dev->priv; 725 struct ibmveth_adapter *adapter = netdev_priv(dev);
726 726
727 if (data) 727 if (data)
728 adapter->rx_csum = 1; 728 adapter->rx_csum = 1;
@@ -741,7 +741,7 @@ static void ibmveth_set_rx_csum_flags(struct net_device *dev, u32 data)
741 741
742static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data) 742static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data)
743{ 743{
744 struct ibmveth_adapter *adapter = dev->priv; 744 struct ibmveth_adapter *adapter = netdev_priv(dev);
745 745
746 if (data) { 746 if (data) {
747 dev->features |= NETIF_F_IP_CSUM; 747 dev->features |= NETIF_F_IP_CSUM;
@@ -753,7 +753,7 @@ static void ibmveth_set_tx_csum_flags(struct net_device *dev, u32 data)
753static int ibmveth_set_csum_offload(struct net_device *dev, u32 data, 753static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
754 void (*done) (struct net_device *, u32)) 754 void (*done) (struct net_device *, u32))
755{ 755{
756 struct ibmveth_adapter *adapter = dev->priv; 756 struct ibmveth_adapter *adapter = netdev_priv(dev);
757 u64 set_attr, clr_attr, ret_attr; 757 u64 set_attr, clr_attr, ret_attr;
758 long ret; 758 long ret;
759 int rc1 = 0, rc2 = 0; 759 int rc1 = 0, rc2 = 0;
@@ -805,7 +805,7 @@ static int ibmveth_set_csum_offload(struct net_device *dev, u32 data,
805 805
806static int ibmveth_set_rx_csum(struct net_device *dev, u32 data) 806static int ibmveth_set_rx_csum(struct net_device *dev, u32 data)
807{ 807{
808 struct ibmveth_adapter *adapter = dev->priv; 808 struct ibmveth_adapter *adapter = netdev_priv(dev);
809 809
810 if ((data && adapter->rx_csum) || (!data && !adapter->rx_csum)) 810 if ((data && adapter->rx_csum) || (!data && !adapter->rx_csum))
811 return 0; 811 return 0;
@@ -815,7 +815,7 @@ static int ibmveth_set_rx_csum(struct net_device *dev, u32 data)
815 815
816static int ibmveth_set_tx_csum(struct net_device *dev, u32 data) 816static int ibmveth_set_tx_csum(struct net_device *dev, u32 data)
817{ 817{
818 struct ibmveth_adapter *adapter = dev->priv; 818 struct ibmveth_adapter *adapter = netdev_priv(dev);
819 int rc = 0; 819 int rc = 0;
820 820
821 if (data && (dev->features & NETIF_F_IP_CSUM)) 821 if (data && (dev->features & NETIF_F_IP_CSUM))
@@ -833,7 +833,7 @@ static int ibmveth_set_tx_csum(struct net_device *dev, u32 data)
833 833
834static u32 ibmveth_get_rx_csum(struct net_device *dev) 834static u32 ibmveth_get_rx_csum(struct net_device *dev)
835{ 835{
836 struct ibmveth_adapter *adapter = dev->priv; 836 struct ibmveth_adapter *adapter = netdev_priv(dev);
837 return adapter->rx_csum; 837 return adapter->rx_csum;
838} 838}
839 839
@@ -862,7 +862,7 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev,
862 struct ethtool_stats *stats, u64 *data) 862 struct ethtool_stats *stats, u64 *data)
863{ 863{
864 int i; 864 int i;
865 struct ibmveth_adapter *adapter = dev->priv; 865 struct ibmveth_adapter *adapter = netdev_priv(dev);
866 866
867 for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++) 867 for (i = 0; i < ARRAY_SIZE(ibmveth_stats); i++)
868 data[i] = IBMVETH_GET_STAT(adapter, ibmveth_stats[i].offset); 868 data[i] = IBMVETH_GET_STAT(adapter, ibmveth_stats[i].offset);
@@ -889,7 +889,7 @@ static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
889 889
890static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) 890static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
891{ 891{
892 struct ibmveth_adapter *adapter = netdev->priv; 892 struct ibmveth_adapter *adapter = netdev_priv(netdev);
893 union ibmveth_buf_desc desc; 893 union ibmveth_buf_desc desc;
894 unsigned long lpar_rc; 894 unsigned long lpar_rc;
895 unsigned long correlator; 895 unsigned long correlator;
@@ -1044,7 +1044,7 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
1044static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance) 1044static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance)
1045{ 1045{
1046 struct net_device *netdev = dev_instance; 1046 struct net_device *netdev = dev_instance;
1047 struct ibmveth_adapter *adapter = netdev->priv; 1047 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1048 unsigned long lpar_rc; 1048 unsigned long lpar_rc;
1049 1049
1050 if (netif_rx_schedule_prep(netdev, &adapter->napi)) { 1050 if (netif_rx_schedule_prep(netdev, &adapter->napi)) {
@@ -1058,7 +1058,7 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance)
1058 1058
1059static void ibmveth_set_multicast_list(struct net_device *netdev) 1059static void ibmveth_set_multicast_list(struct net_device *netdev)
1060{ 1060{
1061 struct ibmveth_adapter *adapter = netdev->priv; 1061 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1062 unsigned long lpar_rc; 1062 unsigned long lpar_rc;
1063 1063
1064 if((netdev->flags & IFF_PROMISC) || (netdev->mc_count > adapter->mcastFilterSize)) { 1064 if((netdev->flags & IFF_PROMISC) || (netdev->mc_count > adapter->mcastFilterSize)) {
@@ -1106,7 +1106,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
1106 1106
1107static int ibmveth_change_mtu(struct net_device *dev, int new_mtu) 1107static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
1108{ 1108{
1109 struct ibmveth_adapter *adapter = dev->priv; 1109 struct ibmveth_adapter *adapter = netdev_priv(dev);
1110 struct vio_dev *viodev = adapter->vdev; 1110 struct vio_dev *viodev = adapter->vdev;
1111 int new_mtu_oh = new_mtu + IBMVETH_BUFF_OH; 1111 int new_mtu_oh = new_mtu + IBMVETH_BUFF_OH;
1112 int i; 1112 int i;
@@ -1158,7 +1158,7 @@ static int ibmveth_change_mtu(struct net_device *dev, int new_mtu)
1158#ifdef CONFIG_NET_POLL_CONTROLLER 1158#ifdef CONFIG_NET_POLL_CONTROLLER
1159static void ibmveth_poll_controller(struct net_device *dev) 1159static void ibmveth_poll_controller(struct net_device *dev)
1160{ 1160{
1161 ibmveth_replenish_task(dev->priv); 1161 ibmveth_replenish_task(netdev_priv(dev));
1162 ibmveth_interrupt(dev->irq, dev); 1162 ibmveth_interrupt(dev->irq, dev);
1163} 1163}
1164#endif 1164#endif
@@ -1240,7 +1240,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1240 if(!netdev) 1240 if(!netdev)
1241 return -ENOMEM; 1241 return -ENOMEM;
1242 1242
1243 adapter = netdev->priv; 1243 adapter = netdev_priv(netdev);
1244 dev->dev.driver_data = netdev; 1244 dev->dev.driver_data = netdev;
1245 1245
1246 adapter->vdev = dev; 1246 adapter->vdev = dev;
@@ -1336,7 +1336,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
1336static int __devexit ibmveth_remove(struct vio_dev *dev) 1336static int __devexit ibmveth_remove(struct vio_dev *dev)
1337{ 1337{
1338 struct net_device *netdev = dev->dev.driver_data; 1338 struct net_device *netdev = dev->dev.driver_data;
1339 struct ibmveth_adapter *adapter = netdev->priv; 1339 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1340 int i; 1340 int i;
1341 1341
1342 for(i = 0; i<IbmVethNumBufferPools; i++) 1342 for(i = 0; i<IbmVethNumBufferPools; i++)
@@ -1470,7 +1470,7 @@ const char * buf, size_t count)
1470 kobj); 1470 kobj);
1471 struct net_device *netdev = 1471 struct net_device *netdev =
1472 container_of(kobj->parent, struct device, kobj)->driver_data; 1472 container_of(kobj->parent, struct device, kobj)->driver_data;
1473 struct ibmveth_adapter *adapter = netdev->priv; 1473 struct ibmveth_adapter *adapter = netdev_priv(netdev);
1474 long value = simple_strtol(buf, NULL, 10); 1474 long value = simple_strtol(buf, NULL, 10);
1475 long rc; 1475 long rc;
1476 1476
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 58906c984be9..f89fdc7bd774 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -101,8 +101,8 @@ static const struct igb_stats igb_gstrings_stats[] = {
101}; 101};
102 102
103#define IGB_QUEUE_STATS_LEN \ 103#define IGB_QUEUE_STATS_LEN \
104 ((((struct igb_adapter *)netdev->priv)->num_rx_queues + \ 104 ((((struct igb_adapter *)netdev_priv(netdev))->num_rx_queues + \
105 ((struct igb_adapter *)netdev->priv)->num_tx_queues) * \ 105 ((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues) * \
106 (sizeof(struct igb_queue_stats) / sizeof(u64))) 106 (sizeof(struct igb_queue_stats) / sizeof(u64)))
107#define IGB_GLOBAL_STATS_LEN \ 107#define IGB_GLOBAL_STATS_LEN \
108 sizeof(igb_gstrings_stats) / sizeof(struct igb_stats) 108 sizeof(igb_gstrings_stats) / sizeof(struct igb_stats)
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 9fde748c41f2..3c58e67ef1e4 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -292,7 +292,7 @@ static int ali_ircc_open(int i, chipio_t *info)
292 return -ENOMEM; 292 return -ENOMEM;
293 } 293 }
294 294
295 self = dev->priv; 295 self = netdev_priv(dev);
296 self->netdev = dev; 296 self->netdev = dev;
297 spin_lock_init(&self->lock); 297 spin_lock_init(&self->lock);
298 298
@@ -665,7 +665,7 @@ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
665 665
666 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); 666 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__);
667 667
668 self = dev->priv; 668 self = netdev_priv(dev);
669 669
670 spin_lock(&self->lock); 670 spin_lock(&self->lock);
671 671
@@ -1333,7 +1333,7 @@ static int ali_ircc_net_open(struct net_device *dev)
1333 1333
1334 IRDA_ASSERT(dev != NULL, return -1;); 1334 IRDA_ASSERT(dev != NULL, return -1;);
1335 1335
1336 self = (struct ali_ircc_cb *) dev->priv; 1336 self = netdev_priv(dev);
1337 1337
1338 IRDA_ASSERT(self != NULL, return 0;); 1338 IRDA_ASSERT(self != NULL, return 0;);
1339 1339
@@ -1396,7 +1396,7 @@ static int ali_ircc_net_close(struct net_device *dev)
1396 1396
1397 IRDA_ASSERT(dev != NULL, return -1;); 1397 IRDA_ASSERT(dev != NULL, return -1;);
1398 1398
1399 self = (struct ali_ircc_cb *) dev->priv; 1399 self = netdev_priv(dev);
1400 IRDA_ASSERT(self != NULL, return 0;); 1400 IRDA_ASSERT(self != NULL, return 0;);
1401 1401
1402 /* Stop device */ 1402 /* Stop device */
@@ -1436,7 +1436,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
1436 1436
1437 IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); 1437 IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ );
1438 1438
1439 self = (struct ali_ircc_cb *) dev->priv; 1439 self = netdev_priv(dev);
1440 iobase = self->io.fir_base; 1440 iobase = self->io.fir_base;
1441 1441
1442 netif_stop_queue(dev); 1442 netif_stop_queue(dev);
@@ -1959,7 +1959,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev)
1959 1959
1960 IRDA_ASSERT(dev != NULL, return 0;); 1960 IRDA_ASSERT(dev != NULL, return 0;);
1961 1961
1962 self = (struct ali_ircc_cb *) dev->priv; 1962 self = netdev_priv(dev);
1963 IRDA_ASSERT(self != NULL, return 0;); 1963 IRDA_ASSERT(self != NULL, return 0;);
1964 1964
1965 iobase = self->io.sir_base; 1965 iobase = self->io.sir_base;
@@ -2027,7 +2027,7 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2027 2027
2028 IRDA_ASSERT(dev != NULL, return -1;); 2028 IRDA_ASSERT(dev != NULL, return -1;);
2029 2029
2030 self = dev->priv; 2030 self = netdev_priv(dev);
2031 2031
2032 IRDA_ASSERT(self != NULL, return -1;); 2032 IRDA_ASSERT(self != NULL, return -1;);
2033 2033
@@ -2113,7 +2113,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self)
2113 2113
2114static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev) 2114static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev)
2115{ 2115{
2116 struct ali_ircc_cb *self = (struct ali_ircc_cb *) dev->priv; 2116 struct ali_ircc_cb *self = netdev_priv(dev);
2117 2117
2118 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); 2118 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ );
2119 2119
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 69d16b30323b..687c2d53d4d2 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -979,7 +979,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
979 unsigned long flags; 979 unsigned long flags;
980 struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb; 980 struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb;
981 981
982 self = (struct toshoboe_cb *) dev->priv; 982 self = netdev_priv(dev);
983 983
984 IRDA_ASSERT (self != NULL, return 0; ); 984 IRDA_ASSERT (self != NULL, return 0; );
985 985
@@ -1384,7 +1384,7 @@ toshoboe_net_close (struct net_device *dev)
1384 IRDA_DEBUG (4, "%s()\n", __func__); 1384 IRDA_DEBUG (4, "%s()\n", __func__);
1385 1385
1386 IRDA_ASSERT (dev != NULL, return -1; ); 1386 IRDA_ASSERT (dev != NULL, return -1; );
1387 self = (struct toshoboe_cb *) dev->priv; 1387 self = netdev_priv(dev);
1388 1388
1389 /* Stop device */ 1389 /* Stop device */
1390 netif_stop_queue(dev); 1390 netif_stop_queue(dev);
@@ -1422,7 +1422,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1422 1422
1423 IRDA_ASSERT (dev != NULL, return -1; ); 1423 IRDA_ASSERT (dev != NULL, return -1; );
1424 1424
1425 self = dev->priv; 1425 self = netdev_priv(dev);
1426 1426
1427 IRDA_ASSERT (self != NULL, return -1; ); 1427 IRDA_ASSERT (self != NULL, return -1; );
1428 1428
@@ -1546,7 +1546,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
1546 return -ENOMEM; 1546 return -ENOMEM;
1547 } 1547 }
1548 1548
1549 self = dev->priv; 1549 self = netdev_priv(dev);
1550 self->netdev = dev; 1550 self->netdev = dev;
1551 self->pdev = pci_dev; 1551 self->pdev = pci_dev;
1552 self->base = pci_resource_start(pci_dev,0); 1552 self->base = pci_resource_start(pci_dev,0);
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 761ed8ca6e37..205e4e825a97 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -384,7 +384,7 @@ static void speed_bulk_callback(struct urb *urb)
384 */ 384 */
385static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) 385static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
386{ 386{
387 struct irda_usb_cb *self = netdev->priv; 387 struct irda_usb_cb *self = netdev_priv(netdev);
388 struct urb *urb = self->tx_urb; 388 struct urb *urb = self->tx_urb;
389 unsigned long flags; 389 unsigned long flags;
390 s32 speed; 390 s32 speed;
@@ -628,7 +628,7 @@ static void write_bulk_callback(struct urb *urb)
628static void irda_usb_net_timeout(struct net_device *netdev) 628static void irda_usb_net_timeout(struct net_device *netdev)
629{ 629{
630 unsigned long flags; 630 unsigned long flags;
631 struct irda_usb_cb *self = netdev->priv; 631 struct irda_usb_cb *self = netdev_priv(netdev);
632 struct urb *urb; 632 struct urb *urb;
633 int done = 0; /* If we have made any progress */ 633 int done = 0; /* If we have made any progress */
634 634
@@ -1174,7 +1174,7 @@ static int irda_usb_net_open(struct net_device *netdev)
1174 IRDA_DEBUG(1, "%s()\n", __func__); 1174 IRDA_DEBUG(1, "%s()\n", __func__);
1175 1175
1176 IRDA_ASSERT(netdev != NULL, return -1;); 1176 IRDA_ASSERT(netdev != NULL, return -1;);
1177 self = (struct irda_usb_cb *) netdev->priv; 1177 self = netdev_priv(netdev);
1178 IRDA_ASSERT(self != NULL, return -1;); 1178 IRDA_ASSERT(self != NULL, return -1;);
1179 1179
1180 spin_lock_irqsave(&self->lock, flags); 1180 spin_lock_irqsave(&self->lock, flags);
@@ -1256,7 +1256,7 @@ static int irda_usb_net_close(struct net_device *netdev)
1256 IRDA_DEBUG(1, "%s()\n", __func__); 1256 IRDA_DEBUG(1, "%s()\n", __func__);
1257 1257
1258 IRDA_ASSERT(netdev != NULL, return -1;); 1258 IRDA_ASSERT(netdev != NULL, return -1;);
1259 self = (struct irda_usb_cb *) netdev->priv; 1259 self = netdev_priv(netdev);
1260 IRDA_ASSERT(self != NULL, return -1;); 1260 IRDA_ASSERT(self != NULL, return -1;);
1261 1261
1262 /* Clear this flag *before* unlinking the urbs and *before* 1262 /* Clear this flag *before* unlinking the urbs and *before*
@@ -1305,7 +1305,7 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1305 int ret = 0; 1305 int ret = 0;
1306 1306
1307 IRDA_ASSERT(dev != NULL, return -1;); 1307 IRDA_ASSERT(dev != NULL, return -1;);
1308 self = dev->priv; 1308 self = netdev_priv(dev);
1309 IRDA_ASSERT(self != NULL, return -1;); 1309 IRDA_ASSERT(self != NULL, return -1;);
1310 1310
1311 IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); 1311 IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
@@ -1347,7 +1347,7 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1347 */ 1347 */
1348static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev) 1348static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev)
1349{ 1349{
1350 struct irda_usb_cb *self = dev->priv; 1350 struct irda_usb_cb *self = netdev_priv(dev);
1351 return &self->stats; 1351 return &self->stats;
1352} 1352}
1353 1353
@@ -1640,7 +1640,7 @@ static int irda_usb_probe(struct usb_interface *intf,
1640 goto err_out; 1640 goto err_out;
1641 1641
1642 SET_NETDEV_DEV(net, &intf->dev); 1642 SET_NETDEV_DEV(net, &intf->dev);
1643 self = net->priv; 1643 self = netdev_priv(net);
1644 self->netdev = net; 1644 self->netdev = net;
1645 spin_lock_init(&self->lock); 1645 spin_lock_init(&self->lock);
1646 init_timer(&self->rx_defer_timer); 1646 init_timer(&self->rx_defer_timer);
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 4e1bc08971a8..2c6bf2d11bb1 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -373,7 +373,7 @@ static int __init nsc_ircc_open(chipio_t *info)
373 return -ENOMEM; 373 return -ENOMEM;
374 } 374 }
375 375
376 self = dev->priv; 376 self = netdev_priv(dev);
377 self->netdev = dev; 377 self->netdev = dev;
378 spin_lock_init(&self->lock); 378 spin_lock_init(&self->lock);
379 379
@@ -1354,7 +1354,7 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
1354 __s32 speed; 1354 __s32 speed;
1355 __u8 bank; 1355 __u8 bank;
1356 1356
1357 self = (struct nsc_ircc_cb *) dev->priv; 1357 self = netdev_priv(dev);
1358 1358
1359 IRDA_ASSERT(self != NULL, return 0;); 1359 IRDA_ASSERT(self != NULL, return 0;);
1360 1360
@@ -1427,7 +1427,7 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
1427 __u8 bank; 1427 __u8 bank;
1428 int mtt, diff; 1428 int mtt, diff;
1429 1429
1430 self = (struct nsc_ircc_cb *) dev->priv; 1430 self = netdev_priv(dev);
1431 iobase = self->io.fir_base; 1431 iobase = self->io.fir_base;
1432 1432
1433 netif_stop_queue(dev); 1433 netif_stop_queue(dev);
@@ -2084,7 +2084,7 @@ static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id)
2084 __u8 bsr, eir; 2084 __u8 bsr, eir;
2085 int iobase; 2085 int iobase;
2086 2086
2087 self = dev->priv; 2087 self = netdev_priv(dev);
2088 2088
2089 spin_lock(&self->lock); 2089 spin_lock(&self->lock);
2090 2090
@@ -2165,7 +2165,7 @@ static int nsc_ircc_net_open(struct net_device *dev)
2165 IRDA_DEBUG(4, "%s()\n", __func__); 2165 IRDA_DEBUG(4, "%s()\n", __func__);
2166 2166
2167 IRDA_ASSERT(dev != NULL, return -1;); 2167 IRDA_ASSERT(dev != NULL, return -1;);
2168 self = (struct nsc_ircc_cb *) dev->priv; 2168 self = netdev_priv(dev);
2169 2169
2170 IRDA_ASSERT(self != NULL, return 0;); 2170 IRDA_ASSERT(self != NULL, return 0;);
2171 2171
@@ -2228,7 +2228,7 @@ static int nsc_ircc_net_close(struct net_device *dev)
2228 2228
2229 IRDA_ASSERT(dev != NULL, return -1;); 2229 IRDA_ASSERT(dev != NULL, return -1;);
2230 2230
2231 self = (struct nsc_ircc_cb *) dev->priv; 2231 self = netdev_priv(dev);
2232 IRDA_ASSERT(self != NULL, return 0;); 2232 IRDA_ASSERT(self != NULL, return 0;);
2233 2233
2234 /* Stop device */ 2234 /* Stop device */
@@ -2274,7 +2274,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2274 2274
2275 IRDA_ASSERT(dev != NULL, return -1;); 2275 IRDA_ASSERT(dev != NULL, return -1;);
2276 2276
2277 self = dev->priv; 2277 self = netdev_priv(dev);
2278 2278
2279 IRDA_ASSERT(self != NULL, return -1;); 2279 IRDA_ASSERT(self != NULL, return -1;);
2280 2280
@@ -2309,7 +2309,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2309 2309
2310static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev) 2310static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev)
2311{ 2311{
2312 struct nsc_ircc_cb *self = (struct nsc_ircc_cb *) dev->priv; 2312 struct nsc_ircc_cb *self = netdev_priv(dev);
2313 2313
2314 return &self->stats; 2314 return &self->stats;
2315} 2315}
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index aa6fef8ff130..ccde5829ba21 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -298,7 +298,7 @@ static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state)
298 if (!dev) 298 if (!dev)
299 return 0; 299 return 0;
300 300
301 si = dev->priv; 301 si = netdev_priv(dev);
302 if (si->open) { 302 if (si->open) {
303 /* 303 /*
304 * Stop the transmit queue 304 * Stop the transmit queue
@@ -323,7 +323,7 @@ static int sa1100_irda_resume(struct platform_device *pdev)
323 if (!dev) 323 if (!dev)
324 return 0; 324 return 0;
325 325
326 si = dev->priv; 326 si = netdev_priv(dev);
327 if (si->open) { 327 if (si->open) {
328 /* 328 /*
329 * If we missed a speed change, initialise at the new speed 329 * If we missed a speed change, initialise at the new speed
@@ -359,7 +359,7 @@ static int sa1100_irda_resume(struct platform_device *pdev)
359 */ 359 */
360static void sa1100_irda_hpsir_irq(struct net_device *dev) 360static void sa1100_irda_hpsir_irq(struct net_device *dev)
361{ 361{
362 struct sa1100_irda *si = dev->priv; 362 struct sa1100_irda *si = netdev_priv(dev);
363 int status; 363 int status;
364 364
365 status = Ser2UTSR0; 365 status = Ser2UTSR0;
@@ -532,7 +532,7 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
532 */ 532 */
533static void sa1100_irda_fir_irq(struct net_device *dev) 533static void sa1100_irda_fir_irq(struct net_device *dev)
534{ 534{
535 struct sa1100_irda *si = dev->priv; 535 struct sa1100_irda *si = netdev_priv(dev);
536 536
537 /* 537 /*
538 * Stop RX DMA 538 * Stop RX DMA
@@ -580,7 +580,7 @@ static void sa1100_irda_fir_irq(struct net_device *dev)
580static irqreturn_t sa1100_irda_irq(int irq, void *dev_id) 580static irqreturn_t sa1100_irda_irq(int irq, void *dev_id)
581{ 581{
582 struct net_device *dev = dev_id; 582 struct net_device *dev = dev_id;
583 if (IS_FIR(((struct sa1100_irda *)dev->priv))) 583 if (IS_FIR(((struct sa1100_irda *)netdev_priv(dev))))
584 sa1100_irda_fir_irq(dev); 584 sa1100_irda_fir_irq(dev);
585 else 585 else
586 sa1100_irda_hpsir_irq(dev); 586 sa1100_irda_hpsir_irq(dev);
@@ -593,7 +593,7 @@ static irqreturn_t sa1100_irda_irq(int irq, void *dev_id)
593static void sa1100_irda_txdma_irq(void *id) 593static void sa1100_irda_txdma_irq(void *id)
594{ 594{
595 struct net_device *dev = id; 595 struct net_device *dev = id;
596 struct sa1100_irda *si = dev->priv; 596 struct sa1100_irda *si = netdev_priv(dev);
597 struct sk_buff *skb = si->txskb; 597 struct sk_buff *skb = si->txskb;
598 598
599 si->txskb = NULL; 599 si->txskb = NULL;
@@ -647,7 +647,7 @@ static void sa1100_irda_txdma_irq(void *id)
647 647
648static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev) 648static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
649{ 649{
650 struct sa1100_irda *si = dev->priv; 650 struct sa1100_irda *si = netdev_priv(dev);
651 int speed = irda_get_next_speed(skb); 651 int speed = irda_get_next_speed(skb);
652 652
653 /* 653 /*
@@ -722,7 +722,7 @@ static int
722sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd) 722sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
723{ 723{
724 struct if_irda_req *rq = (struct if_irda_req *)ifreq; 724 struct if_irda_req *rq = (struct if_irda_req *)ifreq;
725 struct sa1100_irda *si = dev->priv; 725 struct sa1100_irda *si = netdev_priv(dev);
726 int ret = -EOPNOTSUPP; 726 int ret = -EOPNOTSUPP;
727 727
728 switch (cmd) { 728 switch (cmd) {
@@ -764,13 +764,13 @@ sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
764 764
765static struct net_device_stats *sa1100_irda_stats(struct net_device *dev) 765static struct net_device_stats *sa1100_irda_stats(struct net_device *dev)
766{ 766{
767 struct sa1100_irda *si = dev->priv; 767 struct sa1100_irda *si = netdev_priv(dev);
768 return &si->stats; 768 return &si->stats;
769} 769}
770 770
771static int sa1100_irda_start(struct net_device *dev) 771static int sa1100_irda_start(struct net_device *dev)
772{ 772{
773 struct sa1100_irda *si = dev->priv; 773 struct sa1100_irda *si = netdev_priv(dev);
774 int err; 774 int err;
775 775
776 si->speed = 9600; 776 si->speed = 9600;
@@ -833,7 +833,7 @@ err_irq:
833 833
834static int sa1100_irda_stop(struct net_device *dev) 834static int sa1100_irda_stop(struct net_device *dev)
835{ 835{
836 struct sa1100_irda *si = dev->priv; 836 struct sa1100_irda *si = netdev_priv(dev);
837 837
838 disable_irq(dev->irq); 838 disable_irq(dev->irq);
839 sa1100_irda_shutdown(si); 839 sa1100_irda_shutdown(si);
@@ -906,7 +906,7 @@ static int sa1100_irda_probe(struct platform_device *pdev)
906 if (!dev) 906 if (!dev)
907 goto err_mem_4; 907 goto err_mem_4;
908 908
909 si = dev->priv; 909 si = netdev_priv(dev);
910 si->dev = &pdev->dev; 910 si->dev = &pdev->dev;
911 si->pdata = pdev->dev.platform_data; 911 si->pdata = pdev->dev.platform_data;
912 912
@@ -985,7 +985,7 @@ static int sa1100_irda_remove(struct platform_device *pdev)
985 struct net_device *dev = platform_get_drvdata(pdev); 985 struct net_device *dev = platform_get_drvdata(pdev);
986 986
987 if (dev) { 987 if (dev) {
988 struct sa1100_irda *si = dev->priv; 988 struct sa1100_irda *si = netdev_priv(dev);
989 unregister_netdev(dev); 989 unregister_netdev(dev);
990 kfree(si->tx_buff.head); 990 kfree(si->tx_buff.head);
991 kfree(si->rx_buff.head); 991 kfree(si->rx_buff.head);
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index 3f32909c24c8..ceef040aa76d 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -584,14 +584,14 @@ EXPORT_SYMBOL(sirdev_receive);
584 584
585static struct net_device_stats *sirdev_get_stats(struct net_device *ndev) 585static struct net_device_stats *sirdev_get_stats(struct net_device *ndev)
586{ 586{
587 struct sir_dev *dev = ndev->priv; 587 struct sir_dev *dev = netdev_priv(ndev);
588 588
589 return (dev) ? &dev->stats : NULL; 589 return (dev) ? &dev->stats : NULL;
590} 590}
591 591
592static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) 592static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
593{ 593{
594 struct sir_dev *dev = ndev->priv; 594 struct sir_dev *dev = netdev_priv(ndev);
595 unsigned long flags; 595 unsigned long flags;
596 int actual = 0; 596 int actual = 0;
597 int err; 597 int err;
@@ -683,7 +683,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
683static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) 683static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
684{ 684{
685 struct if_irda_req *irq = (struct if_irda_req *) rq; 685 struct if_irda_req *irq = (struct if_irda_req *) rq;
686 struct sir_dev *dev = ndev->priv; 686 struct sir_dev *dev = netdev_priv(ndev);
687 int ret = 0; 687 int ret = 0;
688 688
689 IRDA_ASSERT(dev != NULL, return -1;); 689 IRDA_ASSERT(dev != NULL, return -1;);
@@ -795,7 +795,7 @@ static void sirdev_free_buffers(struct sir_dev *dev)
795 795
796static int sirdev_open(struct net_device *ndev) 796static int sirdev_open(struct net_device *ndev)
797{ 797{
798 struct sir_dev *dev = ndev->priv; 798 struct sir_dev *dev = netdev_priv(ndev);
799 const struct sir_driver *drv = dev->drv; 799 const struct sir_driver *drv = dev->drv;
800 800
801 if (!drv) 801 if (!drv)
@@ -840,7 +840,7 @@ errout_dec:
840 840
841static int sirdev_close(struct net_device *ndev) 841static int sirdev_close(struct net_device *ndev)
842{ 842{
843 struct sir_dev *dev = ndev->priv; 843 struct sir_dev *dev = netdev_priv(ndev);
844 const struct sir_driver *drv; 844 const struct sir_driver *drv;
845 845
846// IRDA_DEBUG(0, "%s\n", __func__); 846// IRDA_DEBUG(0, "%s\n", __func__);
@@ -896,7 +896,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
896 IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__); 896 IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__);
897 goto out; 897 goto out;
898 } 898 }
899 dev = ndev->priv; 899 dev = netdev_priv(ndev);
900 900
901 irda_init_max_qos_capabilies(&dev->qos); 901 irda_init_max_qos_capabilies(&dev->qos);
902 dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; 902 dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 84e609ea5fbb..74c78cf7a333 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -334,7 +334,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
334 if (dev == NULL) 334 if (dev == NULL)
335 return -ENOMEM; 335 return -ENOMEM;
336 336
337 self = dev->priv; 337 self = netdev_priv(dev);
338 self->netdev = dev; 338 self->netdev = dev;
339 spin_lock_init(&self->lock); 339 spin_lock_init(&self->lock);
340 340
@@ -824,7 +824,7 @@ static int via_ircc_hard_xmit_sir(struct sk_buff *skb,
824 u16 iobase; 824 u16 iobase;
825 __u32 speed; 825 __u32 speed;
826 826
827 self = (struct via_ircc_cb *) dev->priv; 827 self = netdev_priv(dev);
828 IRDA_ASSERT(self != NULL, return 0;); 828 IRDA_ASSERT(self != NULL, return 0;);
829 iobase = self->io.fir_base; 829 iobase = self->io.fir_base;
830 830
@@ -896,7 +896,7 @@ static int via_ircc_hard_xmit_fir(struct sk_buff *skb,
896 __u32 speed; 896 __u32 speed;
897 unsigned long flags; 897 unsigned long flags;
898 898
899 self = (struct via_ircc_cb *) dev->priv; 899 self = netdev_priv(dev);
900 iobase = self->io.fir_base; 900 iobase = self->io.fir_base;
901 901
902 if (self->st_fifo.len) 902 if (self->st_fifo.len)
@@ -1349,7 +1349,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
1349static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) 1349static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id)
1350{ 1350{
1351 struct net_device *dev = dev_id; 1351 struct net_device *dev = dev_id;
1352 struct via_ircc_cb *self = dev->priv; 1352 struct via_ircc_cb *self = netdev_priv(dev);
1353 int iobase; 1353 int iobase;
1354 u8 iHostIntType, iRxIntType, iTxIntType; 1354 u8 iHostIntType, iRxIntType, iTxIntType;
1355 1355
@@ -1522,7 +1522,7 @@ static int via_ircc_net_open(struct net_device *dev)
1522 IRDA_DEBUG(3, "%s()\n", __func__); 1522 IRDA_DEBUG(3, "%s()\n", __func__);
1523 1523
1524 IRDA_ASSERT(dev != NULL, return -1;); 1524 IRDA_ASSERT(dev != NULL, return -1;);
1525 self = (struct via_ircc_cb *) dev->priv; 1525 self = netdev_priv(dev);
1526 self->stats.rx_packets = 0; 1526 self->stats.rx_packets = 0;
1527 IRDA_ASSERT(self != NULL, return 0;); 1527 IRDA_ASSERT(self != NULL, return 0;);
1528 iobase = self->io.fir_base; 1528 iobase = self->io.fir_base;
@@ -1589,7 +1589,7 @@ static int via_ircc_net_close(struct net_device *dev)
1589 IRDA_DEBUG(3, "%s()\n", __func__); 1589 IRDA_DEBUG(3, "%s()\n", __func__);
1590 1590
1591 IRDA_ASSERT(dev != NULL, return -1;); 1591 IRDA_ASSERT(dev != NULL, return -1;);
1592 self = (struct via_ircc_cb *) dev->priv; 1592 self = netdev_priv(dev);
1593 IRDA_ASSERT(self != NULL, return 0;); 1593 IRDA_ASSERT(self != NULL, return 0;);
1594 1594
1595 /* Stop device */ 1595 /* Stop device */
@@ -1628,7 +1628,7 @@ static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
1628 int ret = 0; 1628 int ret = 0;
1629 1629
1630 IRDA_ASSERT(dev != NULL, return -1;); 1630 IRDA_ASSERT(dev != NULL, return -1;);
1631 self = dev->priv; 1631 self = netdev_priv(dev);
1632 IRDA_ASSERT(self != NULL, return -1;); 1632 IRDA_ASSERT(self != NULL, return -1;);
1633 IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, 1633 IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name,
1634 cmd); 1634 cmd);
@@ -1663,7 +1663,7 @@ static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
1663static struct net_device_stats *via_ircc_net_get_stats(struct net_device 1663static struct net_device_stats *via_ircc_net_get_stats(struct net_device
1664 *dev) 1664 *dev)
1665{ 1665{
1666 struct via_ircc_cb *self = (struct via_ircc_cb *) dev->priv; 1666 struct via_ircc_cb *self = netdev_priv(dev);
1667 1667
1668 return &self->stats; 1668 return &self->stats;
1669} 1669}
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index a3d27d78fc89..0d30f8d659a1 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -178,7 +178,7 @@ static void vlsi_proc_pdev(struct seq_file *seq, struct pci_dev *pdev)
178 178
179static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev) 179static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev)
180{ 180{
181 vlsi_irda_dev_t *idev = ndev->priv; 181 vlsi_irda_dev_t *idev = netdev_priv(ndev);
182 u8 byte; 182 u8 byte;
183 u16 word; 183 u16 word;
184 unsigned delta1, delta2; 184 unsigned delta1, delta2;
@@ -346,7 +346,7 @@ static void vlsi_proc_ring(struct seq_file *seq, struct vlsi_ring *r)
346static int vlsi_seq_show(struct seq_file *seq, void *v) 346static int vlsi_seq_show(struct seq_file *seq, void *v)
347{ 347{
348 struct net_device *ndev = seq->private; 348 struct net_device *ndev = seq->private;
349 vlsi_irda_dev_t *idev = ndev->priv; 349 vlsi_irda_dev_t *idev = netdev_priv(ndev);
350 unsigned long flags; 350 unsigned long flags;
351 351
352 seq_printf(seq, "\n%s %s\n\n", DRIVER_NAME, DRIVER_VERSION); 352 seq_printf(seq, "\n%s %s\n\n", DRIVER_NAME, DRIVER_VERSION);
@@ -543,7 +543,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
543 struct sk_buff *skb; 543 struct sk_buff *skb;
544 int ret = 0; 544 int ret = 0;
545 struct net_device *ndev = (struct net_device *)pci_get_drvdata(r->pdev); 545 struct net_device *ndev = (struct net_device *)pci_get_drvdata(r->pdev);
546 vlsi_irda_dev_t *idev = ndev->priv; 546 vlsi_irda_dev_t *idev = netdev_priv(ndev);
547 547
548 pci_dma_sync_single_for_cpu(r->pdev, rd_get_addr(rd), r->len, r->dir); 548 pci_dma_sync_single_for_cpu(r->pdev, rd_get_addr(rd), r->len, r->dir);
549 /* dma buffer now owned by the CPU */ 549 /* dma buffer now owned by the CPU */
@@ -637,7 +637,7 @@ static void vlsi_fill_rx(struct vlsi_ring *r)
637 637
638static void vlsi_rx_interrupt(struct net_device *ndev) 638static void vlsi_rx_interrupt(struct net_device *ndev)
639{ 639{
640 vlsi_irda_dev_t *idev = ndev->priv; 640 vlsi_irda_dev_t *idev = netdev_priv(ndev);
641 struct vlsi_ring *r = idev->rx_ring; 641 struct vlsi_ring *r = idev->rx_ring;
642 struct ring_descr *rd; 642 struct ring_descr *rd;
643 int ret; 643 int ret;
@@ -855,7 +855,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
855 855
856static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) 856static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev)
857{ 857{
858 vlsi_irda_dev_t *idev = ndev->priv; 858 vlsi_irda_dev_t *idev = netdev_priv(ndev);
859 struct vlsi_ring *r = idev->tx_ring; 859 struct vlsi_ring *r = idev->tx_ring;
860 struct ring_descr *rd; 860 struct ring_descr *rd;
861 unsigned long flags; 861 unsigned long flags;
@@ -1062,7 +1062,7 @@ drop:
1062 1062
1063static void vlsi_tx_interrupt(struct net_device *ndev) 1063static void vlsi_tx_interrupt(struct net_device *ndev)
1064{ 1064{
1065 vlsi_irda_dev_t *idev = ndev->priv; 1065 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1066 struct vlsi_ring *r = idev->tx_ring; 1066 struct vlsi_ring *r = idev->tx_ring;
1067 struct ring_descr *rd; 1067 struct ring_descr *rd;
1068 unsigned iobase; 1068 unsigned iobase;
@@ -1261,7 +1261,7 @@ static inline void vlsi_clear_regs(unsigned iobase)
1261static int vlsi_init_chip(struct pci_dev *pdev) 1261static int vlsi_init_chip(struct pci_dev *pdev)
1262{ 1262{
1263 struct net_device *ndev = pci_get_drvdata(pdev); 1263 struct net_device *ndev = pci_get_drvdata(pdev);
1264 vlsi_irda_dev_t *idev = ndev->priv; 1264 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1265 unsigned iobase; 1265 unsigned iobase;
1266 u16 ptr; 1266 u16 ptr;
1267 1267
@@ -1375,14 +1375,14 @@ static int vlsi_stop_hw(vlsi_irda_dev_t *idev)
1375 1375
1376static struct net_device_stats * vlsi_get_stats(struct net_device *ndev) 1376static struct net_device_stats * vlsi_get_stats(struct net_device *ndev)
1377{ 1377{
1378 vlsi_irda_dev_t *idev = ndev->priv; 1378 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1379 1379
1380 return &idev->stats; 1380 return &idev->stats;
1381} 1381}
1382 1382
1383static void vlsi_tx_timeout(struct net_device *ndev) 1383static void vlsi_tx_timeout(struct net_device *ndev)
1384{ 1384{
1385 vlsi_irda_dev_t *idev = ndev->priv; 1385 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1386 1386
1387 1387
1388 vlsi_reg_debug(ndev->base_addr, __func__); 1388 vlsi_reg_debug(ndev->base_addr, __func__);
@@ -1407,7 +1407,7 @@ static void vlsi_tx_timeout(struct net_device *ndev)
1407 1407
1408static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) 1408static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
1409{ 1409{
1410 vlsi_irda_dev_t *idev = ndev->priv; 1410 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1411 struct if_irda_req *irq = (struct if_irda_req *) rq; 1411 struct if_irda_req *irq = (struct if_irda_req *) rq;
1412 unsigned long flags; 1412 unsigned long flags;
1413 u16 fifocnt; 1413 u16 fifocnt;
@@ -1457,7 +1457,7 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
1457static irqreturn_t vlsi_interrupt(int irq, void *dev_instance) 1457static irqreturn_t vlsi_interrupt(int irq, void *dev_instance)
1458{ 1458{
1459 struct net_device *ndev = dev_instance; 1459 struct net_device *ndev = dev_instance;
1460 vlsi_irda_dev_t *idev = ndev->priv; 1460 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1461 unsigned iobase; 1461 unsigned iobase;
1462 u8 irintr; 1462 u8 irintr;
1463 int boguscount = 5; 1463 int boguscount = 5;
@@ -1498,7 +1498,7 @@ static irqreturn_t vlsi_interrupt(int irq, void *dev_instance)
1498 1498
1499static int vlsi_open(struct net_device *ndev) 1499static int vlsi_open(struct net_device *ndev)
1500{ 1500{
1501 vlsi_irda_dev_t *idev = ndev->priv; 1501 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1502 int err = -EAGAIN; 1502 int err = -EAGAIN;
1503 char hwname[32]; 1503 char hwname[32];
1504 1504
@@ -1557,7 +1557,7 @@ errout:
1557 1557
1558static int vlsi_close(struct net_device *ndev) 1558static int vlsi_close(struct net_device *ndev)
1559{ 1559{
1560 vlsi_irda_dev_t *idev = ndev->priv; 1560 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1561 1561
1562 netif_stop_queue(ndev); 1562 netif_stop_queue(ndev);
1563 1563
@@ -1580,7 +1580,7 @@ static int vlsi_close(struct net_device *ndev)
1580 1580
1581static int vlsi_irda_init(struct net_device *ndev) 1581static int vlsi_irda_init(struct net_device *ndev)
1582{ 1582{
1583 vlsi_irda_dev_t *idev = ndev->priv; 1583 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1584 struct pci_dev *pdev = idev->pdev; 1584 struct pci_dev *pdev = idev->pdev;
1585 1585
1586 ndev->irq = pdev->irq; 1586 ndev->irq = pdev->irq;
@@ -1655,7 +1655,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1655 goto out_disable; 1655 goto out_disable;
1656 } 1656 }
1657 1657
1658 idev = ndev->priv; 1658 idev = netdev_priv(ndev);
1659 1659
1660 spin_lock_init(&idev->lock); 1660 spin_lock_init(&idev->lock);
1661 mutex_init(&idev->mtx); 1661 mutex_init(&idev->mtx);
@@ -1712,7 +1712,7 @@ static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
1712 1712
1713 unregister_netdev(ndev); 1713 unregister_netdev(ndev);
1714 1714
1715 idev = ndev->priv; 1715 idev = netdev_priv(ndev);
1716 mutex_lock(&idev->mtx); 1716 mutex_lock(&idev->mtx);
1717 if (idev->proc_entry) { 1717 if (idev->proc_entry) {
1718 remove_proc_entry(ndev->name, vlsi_proc_root); 1718 remove_proc_entry(ndev->name, vlsi_proc_root);
@@ -1747,7 +1747,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
1747 __func__, pci_name(pdev)); 1747 __func__, pci_name(pdev));
1748 return 0; 1748 return 0;
1749 } 1749 }
1750 idev = ndev->priv; 1750 idev = netdev_priv(ndev);
1751 mutex_lock(&idev->mtx); 1751 mutex_lock(&idev->mtx);
1752 if (pdev->current_state != 0) { /* already suspended */ 1752 if (pdev->current_state != 0) { /* already suspended */
1753 if (state.event > pdev->current_state) { /* simply go deeper */ 1753 if (state.event > pdev->current_state) { /* simply go deeper */
@@ -1786,7 +1786,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
1786 __func__, pci_name(pdev)); 1786 __func__, pci_name(pdev));
1787 return 0; 1787 return 0;
1788 } 1788 }
1789 idev = ndev->priv; 1789 idev = netdev_priv(ndev);
1790 mutex_lock(&idev->mtx); 1790 mutex_lock(&idev->mtx);
1791 if (pdev->current_state == 0) { 1791 if (pdev->current_state == 0) {
1792 mutex_unlock(&idev->mtx); 1792 mutex_unlock(&idev->mtx);
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index fa600200ac01..161d591aeb97 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -178,7 +178,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
178 goto err_out; 178 goto err_out;
179 } 179 }
180 180
181 self = dev->priv; 181 self = netdev_priv(dev);
182 spin_lock_init(&self->lock); 182 spin_lock_init(&self->lock);
183 183
184 184
@@ -497,7 +497,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
497 __u8 set; 497 __u8 set;
498 int mtt; 498 int mtt;
499 499
500 self = (struct w83977af_ir *) dev->priv; 500 self = netdev_priv(dev);
501 501
502 iobase = self->io.fir_base; 502 iobase = self->io.fir_base;
503 503
@@ -1118,7 +1118,7 @@ static irqreturn_t w83977af_interrupt(int irq, void *dev_id)
1118 __u8 set, icr, isr; 1118 __u8 set, icr, isr;
1119 int iobase; 1119 int iobase;
1120 1120
1121 self = dev->priv; 1121 self = netdev_priv(dev);
1122 1122
1123 iobase = self->io.fir_base; 1123 iobase = self->io.fir_base;
1124 1124
@@ -1191,7 +1191,7 @@ static int w83977af_net_open(struct net_device *dev)
1191 IRDA_DEBUG(0, "%s()\n", __func__ ); 1191 IRDA_DEBUG(0, "%s()\n", __func__ );
1192 1192
1193 IRDA_ASSERT(dev != NULL, return -1;); 1193 IRDA_ASSERT(dev != NULL, return -1;);
1194 self = (struct w83977af_ir *) dev->priv; 1194 self = netdev_priv(dev);
1195 1195
1196 IRDA_ASSERT(self != NULL, return 0;); 1196 IRDA_ASSERT(self != NULL, return 0;);
1197 1197
@@ -1255,7 +1255,7 @@ static int w83977af_net_close(struct net_device *dev)
1255 1255
1256 IRDA_ASSERT(dev != NULL, return -1;); 1256 IRDA_ASSERT(dev != NULL, return -1;);
1257 1257
1258 self = (struct w83977af_ir *) dev->priv; 1258 self = netdev_priv(dev);
1259 1259
1260 IRDA_ASSERT(self != NULL, return 0;); 1260 IRDA_ASSERT(self != NULL, return 0;);
1261 1261
@@ -1302,7 +1302,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1302 1302
1303 IRDA_ASSERT(dev != NULL, return -1;); 1303 IRDA_ASSERT(dev != NULL, return -1;);
1304 1304
1305 self = dev->priv; 1305 self = netdev_priv(dev);
1306 1306
1307 IRDA_ASSERT(self != NULL, return -1;); 1307 IRDA_ASSERT(self != NULL, return -1;);
1308 1308
@@ -1338,7 +1338,7 @@ out:
1338 1338
1339static struct net_device_stats *w83977af_net_get_stats(struct net_device *dev) 1339static struct net_device_stats *w83977af_net_get_stats(struct net_device *dev)
1340{ 1340{
1341 struct w83977af_ir *self = (struct w83977af_ir *) dev->priv; 1341 struct w83977af_ir *self = netdev_priv(dev);
1342 1342
1343 return &self->stats; 1343 return &self->stats;
1344} 1344}
diff --git a/drivers/net/mvme147.c b/drivers/net/mvme147.c
index d30b0d0026ec..435e5a847c43 100644
--- a/drivers/net/mvme147.c
+++ b/drivers/net/mvme147.c
@@ -105,7 +105,7 @@ struct net_device * __init mvme147lance_probe(int unit)
105 dev->name, dev->base_addr, MVME147_LANCE_IRQ, 105 dev->name, dev->base_addr, MVME147_LANCE_IRQ,
106 dev->dev_addr); 106 dev->dev_addr);
107 107
108 lp = (struct m147lance_private *)dev->priv; 108 lp = netdev_priv(dev);
109 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ 109 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */
110 if (!lp->ram) 110 if (!lp->ram)
111 { 111 {
@@ -189,7 +189,7 @@ int __init init_module(void)
189 189
190void __exit cleanup_module(void) 190void __exit cleanup_module(void)
191{ 191{
192 struct m147lance_private *lp = dev_mvme147_lance->priv; 192 struct m147lance_private *lp = netdev_priv(dev_mvme147_lance);
193 unregister_netdev(dev_mvme147_lance); 193 unregister_netdev(dev_mvme147_lance);
194 free_pages(lp->ram, 3); 194 free_pages(lp->ram, 3);
195 free_netdev(dev_mvme147_lance); 195 free_netdev(dev_mvme147_lance);
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index a78d4b992616..6833f65f8aec 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -536,7 +536,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev)
536static irqreturn_t myri_interrupt(int irq, void *dev_id) 536static irqreturn_t myri_interrupt(int irq, void *dev_id)
537{ 537{
538 struct net_device *dev = (struct net_device *) dev_id; 538 struct net_device *dev = (struct net_device *) dev_id;
539 struct myri_eth *mp = (struct myri_eth *) dev->priv; 539 struct myri_eth *mp = netdev_priv(dev);
540 void __iomem *lregs = mp->lregs; 540 void __iomem *lregs = mp->lregs;
541 struct myri_channel __iomem *chan = &mp->shmem->channel; 541 struct myri_channel __iomem *chan = &mp->shmem->channel;
542 unsigned long flags; 542 unsigned long flags;
@@ -575,14 +575,14 @@ static irqreturn_t myri_interrupt(int irq, void *dev_id)
575 575
576static int myri_open(struct net_device *dev) 576static int myri_open(struct net_device *dev)
577{ 577{
578 struct myri_eth *mp = (struct myri_eth *) dev->priv; 578 struct myri_eth *mp = netdev_priv(dev);
579 579
580 return myri_init(mp, in_interrupt()); 580 return myri_init(mp, in_interrupt());
581} 581}
582 582
583static int myri_close(struct net_device *dev) 583static int myri_close(struct net_device *dev)
584{ 584{
585 struct myri_eth *mp = (struct myri_eth *) dev->priv; 585 struct myri_eth *mp = netdev_priv(dev);
586 586
587 myri_clean_rings(mp); 587 myri_clean_rings(mp);
588 return 0; 588 return 0;
@@ -590,7 +590,7 @@ static int myri_close(struct net_device *dev)
590 590
591static void myri_tx_timeout(struct net_device *dev) 591static void myri_tx_timeout(struct net_device *dev)
592{ 592{
593 struct myri_eth *mp = (struct myri_eth *) dev->priv; 593 struct myri_eth *mp = netdev_priv(dev);
594 594
595 printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name); 595 printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
596 596
@@ -601,7 +601,7 @@ static void myri_tx_timeout(struct net_device *dev)
601 601
602static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev) 602static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev)
603{ 603{
604 struct myri_eth *mp = (struct myri_eth *) dev->priv; 604 struct myri_eth *mp = netdev_priv(dev);
605 struct sendq __iomem *sq = mp->sq; 605 struct sendq __iomem *sq = mp->sq;
606 struct myri_txd __iomem *txd; 606 struct myri_txd __iomem *txd;
607 unsigned long flags; 607 unsigned long flags;
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index 12a7d6de1411..ea22ae268a5d 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -625,7 +625,7 @@ static void ne2k_pci_block_output(struct net_device *dev, int count,
625static void ne2k_pci_get_drvinfo(struct net_device *dev, 625static void ne2k_pci_get_drvinfo(struct net_device *dev,
626 struct ethtool_drvinfo *info) 626 struct ethtool_drvinfo *info)
627{ 627{
628 struct ei_device *ei = dev->priv; 628 struct ei_device *ei = netdev_priv(dev);
629 struct pci_dev *pci_dev = (struct pci_dev *) ei->priv; 629 struct pci_dev *pci_dev = (struct pci_dev *) ei->priv;
630 630
631 strcpy(info->driver, DRV_NAME); 631 strcpy(info->driver, DRV_NAME);
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 84978f80f396..86379fdd8b0e 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -537,7 +537,7 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
537static int nx_p3_sre_macaddr_change(struct net_device *dev, 537static int nx_p3_sre_macaddr_change(struct net_device *dev,
538 u8 *addr, unsigned op) 538 u8 *addr, unsigned op)
539{ 539{
540 struct netxen_adapter *adapter = (struct netxen_adapter *)dev->priv; 540 struct netxen_adapter *adapter = netdev_priv(dev);
541 nx_nic_req_t req; 541 nx_nic_req_t req;
542 nx_mac_req_t mac_req; 542 nx_mac_req_t mac_req;
543 int rv; 543 int rv;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 33caca90e80c..25bfb3acf5e4 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -541,7 +541,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
541 541
542 SET_NETDEV_DEV(netdev, &pdev->dev); 542 SET_NETDEV_DEV(netdev, &pdev->dev);
543 543
544 adapter = netdev->priv; 544 adapter = netdev_priv(netdev);
545 adapter->netdev = netdev; 545 adapter->netdev = netdev;
546 adapter->pdev = pdev; 546 adapter->pdev = pdev;
547 adapter->ahw.pci_func = pci_func_id; 547 adapter->ahw.pci_func = pci_func_id;
@@ -986,7 +986,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
986 */ 986 */
987static int netxen_nic_open(struct net_device *netdev) 987static int netxen_nic_open(struct net_device *netdev)
988{ 988{
989 struct netxen_adapter *adapter = (struct netxen_adapter *)netdev->priv; 989 struct netxen_adapter *adapter = netdev_priv(netdev);
990 int err = 0; 990 int err = 0;
991 int ctx, ring; 991 int ctx, ring;
992 irq_handler_t handler; 992 irq_handler_t handler;
diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c
index 6c11557945b3..0cf6addbe40f 100644
--- a/drivers/net/ni5010.c
+++ b/drivers/net/ni5010.c
@@ -328,7 +328,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
328 outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ 328 outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */
329 } 329 }
330 printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); 330 printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
331 memset(dev->priv, 0, sizeof(struct ni5010_local)); 331 memset(netdev_priv(dev), 0, sizeof(struct ni5010_local));
332 332
333 dev->open = ni5010_open; 333 dev->open = ni5010_open;
334 dev->stop = ni5010_close; 334 dev->stop = ni5010_close;
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index 6d7cf3c90fbd..10cfd0f91fc0 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -214,7 +214,7 @@ struct priv {
214/* wait for command with timeout: */ 214/* wait for command with timeout: */
215static void wait_for_scb_cmd(struct net_device *dev) 215static void wait_for_scb_cmd(struct net_device *dev)
216{ 216{
217 struct priv *p = dev->priv; 217 struct priv *p = netdev_priv(dev);
218 int i; 218 int i;
219 for (i = 0; i < 16384; i++) { 219 for (i = 0; i < 16384; i++) {
220 if (readb(&p->scb->cmd_cuc) == 0) 220 if (readb(&p->scb->cmd_cuc) == 0)
@@ -233,7 +233,7 @@ static void wait_for_scb_cmd(struct net_device *dev)
233 233
234static void wait_for_scb_cmd_ruc(struct net_device *dev) 234static void wait_for_scb_cmd_ruc(struct net_device *dev)
235{ 235{
236 struct priv *p = dev->priv; 236 struct priv *p = netdev_priv(dev);
237 int i; 237 int i;
238 for (i = 0; i < 16384; i++) { 238 for (i = 0; i < 16384; i++) {
239 if (readb(&p->scb->cmd_ruc) == 0) 239 if (readb(&p->scb->cmd_ruc) == 0)
@@ -298,7 +298,7 @@ static int ni52_open(struct net_device *dev)
298static int check_iscp(struct net_device *dev, void __iomem *addr) 298static int check_iscp(struct net_device *dev, void __iomem *addr)
299{ 299{
300 struct iscp_struct __iomem *iscp = addr; 300 struct iscp_struct __iomem *iscp = addr;
301 struct priv *p = dev->priv; 301 struct priv *p = netdev_priv(dev);
302 memset_io(iscp, 0, sizeof(struct iscp_struct)); 302 memset_io(iscp, 0, sizeof(struct iscp_struct));
303 303
304 writel(make24(iscp), &p->scp->iscp); 304 writel(make24(iscp), &p->scp->iscp);
@@ -318,7 +318,7 @@ static int check_iscp(struct net_device *dev, void __iomem *addr)
318 */ 318 */
319static int check586(struct net_device *dev, unsigned size) 319static int check586(struct net_device *dev, unsigned size)
320{ 320{
321 struct priv *p = dev->priv; 321 struct priv *p = netdev_priv(dev);
322 int i; 322 int i;
323 323
324 p->mapped = ioremap(dev->mem_start, size); 324 p->mapped = ioremap(dev->mem_start, size);
@@ -354,7 +354,7 @@ Enodev:
354 */ 354 */
355static void alloc586(struct net_device *dev) 355static void alloc586(struct net_device *dev)
356{ 356{
357 struct priv *p = (struct priv *) dev->priv; 357 struct priv *p = netdev_priv(dev);
358 358
359 ni_reset586(); 359 ni_reset586();
360 mdelay(32); 360 mdelay(32);
@@ -400,7 +400,7 @@ struct net_device * __init ni52_probe(int unit)
400 if (!dev) 400 if (!dev)
401 return ERR_PTR(-ENOMEM); 401 return ERR_PTR(-ENOMEM);
402 402
403 p = dev->priv; 403 p = netdev_priv(dev);
404 404
405 if (unit >= 0) { 405 if (unit >= 0) {
406 sprintf(dev->name, "eth%d", unit); 406 sprintf(dev->name, "eth%d", unit);
@@ -446,7 +446,7 @@ out:
446static int __init ni52_probe1(struct net_device *dev, int ioaddr) 446static int __init ni52_probe1(struct net_device *dev, int ioaddr)
447{ 447{
448 int i, size, retval; 448 int i, size, retval;
449 struct priv *priv = dev->priv; 449 struct priv *priv = netdev_priv(dev);
450 450
451 dev->base_addr = ioaddr; 451 dev->base_addr = ioaddr;
452 dev->irq = irq; 452 dev->irq = irq;
@@ -588,7 +588,7 @@ static int init586(struct net_device *dev)
588{ 588{
589 void __iomem *ptr; 589 void __iomem *ptr;
590 int i, result = 0; 590 int i, result = 0;
591 struct priv *p = (struct priv *)dev->priv; 591 struct priv *p = netdev_priv(dev);
592 struct configure_cmd_struct __iomem *cfg_cmd; 592 struct configure_cmd_struct __iomem *cfg_cmd;
593 struct iasetup_cmd_struct __iomem *ias_cmd; 593 struct iasetup_cmd_struct __iomem *ias_cmd;
594 struct tdr_cmd_struct __iomem *tdr_cmd; 594 struct tdr_cmd_struct __iomem *tdr_cmd;
@@ -829,7 +829,7 @@ static void __iomem *alloc_rfa(struct net_device *dev, void __iomem *ptr)
829 struct rfd_struct __iomem *rfd = ptr; 829 struct rfd_struct __iomem *rfd = ptr;
830 struct rbd_struct __iomem *rbd; 830 struct rbd_struct __iomem *rbd;
831 int i; 831 int i;
832 struct priv *p = (struct priv *) dev->priv; 832 struct priv *p = netdev_priv(dev);
833 833
834 memset_io(rfd, 0, 834 memset_io(rfd, 0,
835 sizeof(struct rfd_struct) * (p->num_recv_buffs + rfdadd)); 835 sizeof(struct rfd_struct) * (p->num_recv_buffs + rfdadd));
@@ -878,7 +878,7 @@ static irqreturn_t ni52_interrupt(int irq, void *dev_id)
878 int cnt = 0; 878 int cnt = 0;
879 struct priv *p; 879 struct priv *p;
880 880
881 p = (struct priv *) dev->priv; 881 p = netdev_priv(dev);
882 882
883 if (debuglevel > 1) 883 if (debuglevel > 1)
884 printk("I"); 884 printk("I");
@@ -950,7 +950,7 @@ static void ni52_rcv_int(struct net_device *dev)
950 unsigned short totlen; 950 unsigned short totlen;
951 struct sk_buff *skb; 951 struct sk_buff *skb;
952 struct rbd_struct __iomem *rbd; 952 struct rbd_struct __iomem *rbd;
953 struct priv *p = (struct priv *)dev->priv; 953 struct priv *p = netdev_priv(dev);
954 954
955 if (debuglevel > 0) 955 if (debuglevel > 0)
956 printk("R"); 956 printk("R");
@@ -1039,7 +1039,7 @@ static void ni52_rcv_int(struct net_device *dev)
1039 1039
1040static void ni52_rnr_int(struct net_device *dev) 1040static void ni52_rnr_int(struct net_device *dev)
1041{ 1041{
1042 struct priv *p = (struct priv *) dev->priv; 1042 struct priv *p = netdev_priv(dev);
1043 1043
1044 p->stats.rx_errors++; 1044 p->stats.rx_errors++;
1045 1045
@@ -1064,7 +1064,7 @@ static void ni52_rnr_int(struct net_device *dev)
1064static void ni52_xmt_int(struct net_device *dev) 1064static void ni52_xmt_int(struct net_device *dev)
1065{ 1065{
1066 int status; 1066 int status;
1067 struct priv *p = (struct priv *) dev->priv; 1067 struct priv *p = netdev_priv(dev);
1068 1068
1069 if (debuglevel > 0) 1069 if (debuglevel > 0)
1070 printk("X"); 1070 printk("X");
@@ -1112,7 +1112,7 @@ static void ni52_xmt_int(struct net_device *dev)
1112 1112
1113static void startrecv586(struct net_device *dev) 1113static void startrecv586(struct net_device *dev)
1114{ 1114{
1115 struct priv *p = (struct priv *) dev->priv; 1115 struct priv *p = netdev_priv(dev);
1116 1116
1117 wait_for_scb_cmd(dev); 1117 wait_for_scb_cmd(dev);
1118 wait_for_scb_cmd_ruc(dev); 1118 wait_for_scb_cmd_ruc(dev);
@@ -1125,7 +1125,7 @@ static void startrecv586(struct net_device *dev)
1125 1125
1126static void ni52_timeout(struct net_device *dev) 1126static void ni52_timeout(struct net_device *dev)
1127{ 1127{
1128 struct priv *p = (struct priv *) dev->priv; 1128 struct priv *p = netdev_priv(dev);
1129#ifndef NO_NOPCOMMANDS 1129#ifndef NO_NOPCOMMANDS
1130 if (readb(&p->scb->cus) & CU_ACTIVE) { /* COMMAND-UNIT active? */ 1130 if (readb(&p->scb->cus) & CU_ACTIVE) { /* COMMAND-UNIT active? */
1131 netif_wake_queue(dev); 1131 netif_wake_queue(dev);
@@ -1176,7 +1176,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev)
1176#ifndef NO_NOPCOMMANDS 1176#ifndef NO_NOPCOMMANDS
1177 int next_nop; 1177 int next_nop;
1178#endif 1178#endif
1179 struct priv *p = (struct priv *) dev->priv; 1179 struct priv *p = netdev_priv(dev);
1180 1180
1181 if (skb->len > XMIT_BUFF_SIZE) { 1181 if (skb->len > XMIT_BUFF_SIZE) {
1182 printk(KERN_ERR "%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n", dev->name, XMIT_BUFF_SIZE, skb->len); 1182 printk(KERN_ERR "%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n", dev->name, XMIT_BUFF_SIZE, skb->len);
@@ -1273,7 +1273,7 @@ static int ni52_send_packet(struct sk_buff *skb, struct net_device *dev)
1273 1273
1274static struct net_device_stats *ni52_get_stats(struct net_device *dev) 1274static struct net_device_stats *ni52_get_stats(struct net_device *dev)
1275{ 1275{
1276 struct priv *p = (struct priv *) dev->priv; 1276 struct priv *p = netdev_priv(dev);
1277 unsigned short crc, aln, rsc, ovrn; 1277 unsigned short crc, aln, rsc, ovrn;
1278 1278
1279 /* Get error-statistics from the ni82586 */ 1279 /* Get error-statistics from the ni82586 */
@@ -1336,7 +1336,7 @@ int __init init_module(void)
1336 1336
1337void __exit cleanup_module(void) 1337void __exit cleanup_module(void)
1338{ 1338{
1339 struct priv *p = dev_ni52->priv; 1339 struct priv *p = netdev_priv(dev_ni52);
1340 unregister_netdev(dev_ni52); 1340 unregister_netdev(dev_ni52);
1341 iounmap(p->mapped); 1341 iounmap(p->mapped);
1342 release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE); 1342 release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE);
diff --git a/drivers/net/pasemi_mac_ethtool.c b/drivers/net/pasemi_mac_ethtool.c
index 5e8df3afea64..064a4fe1dd90 100644
--- a/drivers/net/pasemi_mac_ethtool.c
+++ b/drivers/net/pasemi_mac_ethtool.c
@@ -109,7 +109,7 @@ static void
109pasemi_mac_ethtool_get_ringparam(struct net_device *netdev, 109pasemi_mac_ethtool_get_ringparam(struct net_device *netdev,
110 struct ethtool_ringparam *ering) 110 struct ethtool_ringparam *ering)
111{ 111{
112 struct pasemi_mac *mac = netdev->priv; 112 struct pasemi_mac *mac = netdev_priv(netdev);
113 113
114 ering->tx_max_pending = TX_RING_SIZE/2; 114 ering->tx_max_pending = TX_RING_SIZE/2;
115 ering->tx_pending = RING_USED(mac->tx)/2; 115 ering->tx_pending = RING_USED(mac->tx)/2;
@@ -130,7 +130,7 @@ static int pasemi_mac_get_sset_count(struct net_device *netdev, int sset)
130static void pasemi_mac_get_ethtool_stats(struct net_device *netdev, 130static void pasemi_mac_get_ethtool_stats(struct net_device *netdev,
131 struct ethtool_stats *stats, u64 *data) 131 struct ethtool_stats *stats, u64 *data)
132{ 132{
133 struct pasemi_mac *mac = netdev->priv; 133 struct pasemi_mac *mac = netdev_priv(netdev);
134 int i; 134 int i;
135 135
136 data[0] = pasemi_read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)) 136 data[0] = pasemi_read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if))
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 831090c75622..7b5c77b7bd27 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -155,7 +155,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)
155 if (!dev) 155 if (!dev)
156 goto fail_alloc_dev; 156 goto fail_alloc_dev;
157 157
158 lp = dev->priv; 158 lp = netdev_priv(dev);
159 lp->timeout = timeout; 159 lp->timeout = timeout;
160 lp->backplane = backplane; 160 lp->backplane = backplane;
161 lp->clockp = clockp; 161 lp->clockp = clockp;
@@ -303,7 +303,7 @@ static int com20020_config(struct pcmcia_device *link)
303 goto failed; 303 goto failed;
304 } 304 }
305 305
306 lp = dev->priv; 306 lp = netdev_priv(dev);
307 lp->card_name = "PCMCIA COM20020"; 307 lp->card_name = "PCMCIA COM20020";
308 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ 308 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
309 309
@@ -364,7 +364,7 @@ static int com20020_resume(struct pcmcia_device *link)
364 364
365 if (link->open) { 365 if (link->open) {
366 int ioaddr = dev->base_addr; 366 int ioaddr = dev->base_addr;
367 struct arcnet_local *lp = dev->priv; 367 struct arcnet_local *lp = netdev_priv(dev);
368 ARCRESET; 368 ARCRESET;
369 } 369 }
370 370
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 2ea78e6b0276..d544d4a086dc 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -229,7 +229,7 @@ static inline void enable_parport_interrupts (struct net_device *dev)
229 if (dev->irq != -1) 229 if (dev->irq != -1)
230 { 230 {
231 struct parport *port = 231 struct parport *port =
232 ((struct net_local *)dev->priv)->pardev->port; 232 ((struct net_local *)netdev_priv(dev))->pardev->port;
233 port->ops->enable_irq (port); 233 port->ops->enable_irq (port);
234 } 234 }
235} 235}
@@ -239,7 +239,7 @@ static inline void disable_parport_interrupts (struct net_device *dev)
239 if (dev->irq != -1) 239 if (dev->irq != -1)
240 { 240 {
241 struct parport *port = 241 struct parport *port =
242 ((struct net_local *)dev->priv)->pardev->port; 242 ((struct net_local *)netdev_priv(dev))->pardev->port;
243 port->ops->disable_irq (port); 243 port->ops->disable_irq (port);
244 } 244 }
245} 245}
@@ -247,7 +247,7 @@ static inline void disable_parport_interrupts (struct net_device *dev)
247static inline void write_data (struct net_device *dev, unsigned char data) 247static inline void write_data (struct net_device *dev, unsigned char data)
248{ 248{
249 struct parport *port = 249 struct parport *port =
250 ((struct net_local *)dev->priv)->pardev->port; 250 ((struct net_local *)netdev_priv(dev))->pardev->port;
251 251
252 port->ops->write_data (port, data); 252 port->ops->write_data (port, data);
253} 253}
@@ -255,7 +255,7 @@ static inline void write_data (struct net_device *dev, unsigned char data)
255static inline unsigned char read_status (struct net_device *dev) 255static inline unsigned char read_status (struct net_device *dev)
256{ 256{
257 struct parport *port = 257 struct parport *port =
258 ((struct net_local *)dev->priv)->pardev->port; 258 ((struct net_local *)netdev_priv(dev))->pardev->port;
259 259
260 return port->ops->read_status (port); 260 return port->ops->read_status (port);
261} 261}
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index bd4f4ad5d360..a6fd27a2cc3d 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -94,7 +94,7 @@ static int rionet_rx_clean(struct net_device *ndev)
94{ 94{
95 int i; 95 int i;
96 int error = 0; 96 int error = 0;
97 struct rionet_private *rnet = ndev->priv; 97 struct rionet_private *rnet = netdev_priv(ndev);
98 void *data; 98 void *data;
99 99
100 i = rnet->rx_slot; 100 i = rnet->rx_slot;
@@ -132,7 +132,7 @@ static int rionet_rx_clean(struct net_device *ndev)
132static void rionet_rx_fill(struct net_device *ndev, int end) 132static void rionet_rx_fill(struct net_device *ndev, int end)
133{ 133{
134 int i; 134 int i;
135 struct rionet_private *rnet = ndev->priv; 135 struct rionet_private *rnet = netdev_priv(ndev);
136 136
137 i = rnet->rx_slot; 137 i = rnet->rx_slot;
138 do { 138 do {
@@ -151,7 +151,7 @@ static void rionet_rx_fill(struct net_device *ndev, int end)
151static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev, 151static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev,
152 struct rio_dev *rdev) 152 struct rio_dev *rdev)
153{ 153{
154 struct rionet_private *rnet = ndev->priv; 154 struct rionet_private *rnet = netdev_priv(ndev);
155 155
156 rio_add_outb_message(rnet->mport, rdev, 0, skb->data, skb->len); 156 rio_add_outb_message(rnet->mport, rdev, 0, skb->data, skb->len);
157 rnet->tx_skb[rnet->tx_slot] = skb; 157 rnet->tx_skb[rnet->tx_slot] = skb;
@@ -175,7 +175,7 @@ static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev,
175static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev) 175static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
176{ 176{
177 int i; 177 int i;
178 struct rionet_private *rnet = ndev->priv; 178 struct rionet_private *rnet = netdev_priv(ndev);
179 struct ethhdr *eth = (struct ethhdr *)skb->data; 179 struct ethhdr *eth = (struct ethhdr *)skb->data;
180 u16 destid; 180 u16 destid;
181 unsigned long flags; 181 unsigned long flags;
@@ -215,7 +215,7 @@ static void rionet_dbell_event(struct rio_mport *mport, void *dev_id, u16 sid, u
215 u16 info) 215 u16 info)
216{ 216{
217 struct net_device *ndev = dev_id; 217 struct net_device *ndev = dev_id;
218 struct rionet_private *rnet = ndev->priv; 218 struct rionet_private *rnet = netdev_priv(ndev);
219 struct rionet_peer *peer; 219 struct rionet_peer *peer;
220 220
221 if (netif_msg_intr(rnet)) 221 if (netif_msg_intr(rnet))
@@ -243,7 +243,7 @@ static void rionet_inb_msg_event(struct rio_mport *mport, void *dev_id, int mbox
243{ 243{
244 int n; 244 int n;
245 struct net_device *ndev = dev_id; 245 struct net_device *ndev = dev_id;
246 struct rionet_private *rnet = (struct rionet_private *)ndev->priv; 246 struct rionet_private *rnet = netdev_priv(ndev);
247 247
248 if (netif_msg_intr(rnet)) 248 if (netif_msg_intr(rnet))
249 printk(KERN_INFO "%s: inbound message event, mbox %d slot %d\n", 249 printk(KERN_INFO "%s: inbound message event, mbox %d slot %d\n",
@@ -258,7 +258,7 @@ static void rionet_inb_msg_event(struct rio_mport *mport, void *dev_id, int mbox
258static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbox, int slot) 258static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbox, int slot)
259{ 259{
260 struct net_device *ndev = dev_id; 260 struct net_device *ndev = dev_id;
261 struct rionet_private *rnet = ndev->priv; 261 struct rionet_private *rnet = netdev_priv(ndev);
262 262
263 spin_lock(&rnet->lock); 263 spin_lock(&rnet->lock);
264 264
@@ -287,7 +287,7 @@ static int rionet_open(struct net_device *ndev)
287 int i, rc = 0; 287 int i, rc = 0;
288 struct rionet_peer *peer, *tmp; 288 struct rionet_peer *peer, *tmp;
289 u32 pwdcsr; 289 u32 pwdcsr;
290 struct rionet_private *rnet = ndev->priv; 290 struct rionet_private *rnet = netdev_priv(ndev);
291 291
292 if (netif_msg_ifup(rnet)) 292 if (netif_msg_ifup(rnet))
293 printk(KERN_INFO "%s: open\n", DRV_NAME); 293 printk(KERN_INFO "%s: open\n", DRV_NAME);
@@ -351,7 +351,7 @@ static int rionet_open(struct net_device *ndev)
351 351
352static int rionet_close(struct net_device *ndev) 352static int rionet_close(struct net_device *ndev)
353{ 353{
354 struct rionet_private *rnet = (struct rionet_private *)ndev->priv; 354 struct rionet_private *rnet = netdev_priv(ndev);
355 struct rionet_peer *peer, *tmp; 355 struct rionet_peer *peer, *tmp;
356 int i; 356 int i;
357 357
@@ -400,7 +400,7 @@ static void rionet_remove(struct rio_dev *rdev)
400static void rionet_get_drvinfo(struct net_device *ndev, 400static void rionet_get_drvinfo(struct net_device *ndev,
401 struct ethtool_drvinfo *info) 401 struct ethtool_drvinfo *info)
402{ 402{
403 struct rionet_private *rnet = ndev->priv; 403 struct rionet_private *rnet = netdev_priv(ndev);
404 404
405 strcpy(info->driver, DRV_NAME); 405 strcpy(info->driver, DRV_NAME);
406 strcpy(info->version, DRV_VERSION); 406 strcpy(info->version, DRV_VERSION);
@@ -410,14 +410,14 @@ static void rionet_get_drvinfo(struct net_device *ndev,
410 410
411static u32 rionet_get_msglevel(struct net_device *ndev) 411static u32 rionet_get_msglevel(struct net_device *ndev)
412{ 412{
413 struct rionet_private *rnet = ndev->priv; 413 struct rionet_private *rnet = netdev_priv(ndev);
414 414
415 return rnet->msg_enable; 415 return rnet->msg_enable;
416} 416}
417 417
418static void rionet_set_msglevel(struct net_device *ndev, u32 value) 418static void rionet_set_msglevel(struct net_device *ndev, u32 value)
419{ 419{
420 struct rionet_private *rnet = ndev->priv; 420 struct rionet_private *rnet = netdev_priv(ndev);
421 421
422 rnet->msg_enable = value; 422 rnet->msg_enable = value;
423} 423}
@@ -455,7 +455,7 @@ static int rionet_setup_netdev(struct rio_mport *mport)
455 RIO_MAX_ROUTE_ENTRIES(mport->sys_size)); 455 RIO_MAX_ROUTE_ENTRIES(mport->sys_size));
456 456
457 /* Set up private area */ 457 /* Set up private area */
458 rnet = (struct rionet_private *)ndev->priv; 458 rnet = netdev_priv(ndev);
459 rnet->mport = mport; 459 rnet->mport = mport;
460 460
461 /* Set the default MAC address */ 461 /* Set the default MAC address */
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index cec9fe0b1132..62369341cb2c 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -357,7 +357,7 @@ static void s2io_vlan_rx_register(struct net_device *dev,
357 struct vlan_group *grp) 357 struct vlan_group *grp)
358{ 358{
359 int i; 359 int i;
360 struct s2io_nic *nic = dev->priv; 360 struct s2io_nic *nic = netdev_priv(dev);
361 unsigned long flags[MAX_TX_FIFOS]; 361 unsigned long flags[MAX_TX_FIFOS];
362 struct mac_info *mac_control = &nic->mac_control; 362 struct mac_info *mac_control = &nic->mac_control;
363 struct config_param *config = &nic->config; 363 struct config_param *config = &nic->config;
@@ -375,7 +375,7 @@ static void s2io_vlan_rx_register(struct net_device *dev,
375static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) 375static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
376{ 376{
377 int i; 377 int i;
378 struct s2io_nic *nic = dev->priv; 378 struct s2io_nic *nic = netdev_priv(dev);
379 unsigned long flags[MAX_TX_FIFOS]; 379 unsigned long flags[MAX_TX_FIFOS];
380 struct mac_info *mac_control = &nic->mac_control; 380 struct mac_info *mac_control = &nic->mac_control;
381 struct config_param *config = &nic->config; 381 struct config_param *config = &nic->config;
@@ -2837,7 +2837,7 @@ static int s2io_poll_msix(struct napi_struct *napi, int budget)
2837 int pkts_processed = 0; 2837 int pkts_processed = 0;
2838 u8 __iomem *addr = NULL; 2838 u8 __iomem *addr = NULL;
2839 u8 val8 = 0; 2839 u8 val8 = 0;
2840 struct s2io_nic *nic = dev->priv; 2840 struct s2io_nic *nic = netdev_priv(dev);
2841 struct XENA_dev_config __iomem *bar0 = nic->bar0; 2841 struct XENA_dev_config __iomem *bar0 = nic->bar0;
2842 int budget_org = budget; 2842 int budget_org = budget;
2843 2843
@@ -2909,7 +2909,7 @@ static int s2io_poll_inta(struct napi_struct *napi, int budget)
2909 */ 2909 */
2910static void s2io_netpoll(struct net_device *dev) 2910static void s2io_netpoll(struct net_device *dev)
2911{ 2911{
2912 struct s2io_nic *nic = dev->priv; 2912 struct s2io_nic *nic = netdev_priv(dev);
2913 struct mac_info *mac_control; 2913 struct mac_info *mac_control;
2914 struct config_param *config; 2914 struct config_param *config;
2915 struct XENA_dev_config __iomem *bar0 = nic->bar0; 2915 struct XENA_dev_config __iomem *bar0 = nic->bar0;
@@ -3171,7 +3171,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data)
3171static void s2io_mdio_write(u32 mmd_type, u64 addr, u16 value, struct net_device *dev) 3171static void s2io_mdio_write(u32 mmd_type, u64 addr, u16 value, struct net_device *dev)
3172{ 3172{
3173 u64 val64 = 0x0; 3173 u64 val64 = 0x0;
3174 struct s2io_nic *sp = dev->priv; 3174 struct s2io_nic *sp = netdev_priv(dev);
3175 struct XENA_dev_config __iomem *bar0 = sp->bar0; 3175 struct XENA_dev_config __iomem *bar0 = sp->bar0;
3176 3176
3177 //address transaction 3177 //address transaction
@@ -3220,7 +3220,7 @@ static u64 s2io_mdio_read(u32 mmd_type, u64 addr, struct net_device *dev)
3220{ 3220{
3221 u64 val64 = 0x0; 3221 u64 val64 = 0x0;
3222 u64 rval64 = 0x0; 3222 u64 rval64 = 0x0;
3223 struct s2io_nic *sp = dev->priv; 3223 struct s2io_nic *sp = netdev_priv(dev);
3224 struct XENA_dev_config __iomem *bar0 = sp->bar0; 3224 struct XENA_dev_config __iomem *bar0 = sp->bar0;
3225 3225
3226 /* address transaction */ 3226 /* address transaction */
@@ -3324,7 +3324,7 @@ static void s2io_updt_xpak_counter(struct net_device *dev)
3324 u64 val64 = 0x0; 3324 u64 val64 = 0x0;
3325 u64 addr = 0x0; 3325 u64 addr = 0x0;
3326 3326
3327 struct s2io_nic *sp = dev->priv; 3327 struct s2io_nic *sp = netdev_priv(dev);
3328 struct stat_block *stat_info = sp->mac_control.stats_info; 3328 struct stat_block *stat_info = sp->mac_control.stats_info;
3329 3329
3330 /* Check the communication with the MDIO slave */ 3330 /* Check the communication with the MDIO slave */
@@ -3990,7 +3990,7 @@ static void remove_inta_isr(struct s2io_nic *sp)
3990 3990
3991static int s2io_open(struct net_device *dev) 3991static int s2io_open(struct net_device *dev)
3992{ 3992{
3993 struct s2io_nic *sp = dev->priv; 3993 struct s2io_nic *sp = netdev_priv(dev);
3994 int err = 0; 3994 int err = 0;
3995 3995
3996 /* 3996 /*
@@ -4048,7 +4048,7 @@ hw_init_failed:
4048 4048
4049static int s2io_close(struct net_device *dev) 4049static int s2io_close(struct net_device *dev)
4050{ 4050{
4051 struct s2io_nic *sp = dev->priv; 4051 struct s2io_nic *sp = netdev_priv(dev);
4052 struct config_param *config = &sp->config; 4052 struct config_param *config = &sp->config;
4053 u64 tmp64; 4053 u64 tmp64;
4054 int offset; 4054 int offset;
@@ -4087,7 +4087,7 @@ static int s2io_close(struct net_device *dev)
4087 4087
4088static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) 4088static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4089{ 4089{
4090 struct s2io_nic *sp = dev->priv; 4090 struct s2io_nic *sp = netdev_priv(dev);
4091 u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off; 4091 u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off;
4092 register u64 val64; 4092 register u64 val64;
4093 struct TxD *txdp; 4093 struct TxD *txdp;
@@ -4485,7 +4485,7 @@ static int do_s2io_chk_alarm_bit(u64 value, void __iomem * addr,
4485static void s2io_handle_errors(void * dev_id) 4485static void s2io_handle_errors(void * dev_id)
4486{ 4486{
4487 struct net_device *dev = (struct net_device *) dev_id; 4487 struct net_device *dev = (struct net_device *) dev_id;
4488 struct s2io_nic *sp = dev->priv; 4488 struct s2io_nic *sp = netdev_priv(dev);
4489 struct XENA_dev_config __iomem *bar0 = sp->bar0; 4489 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4490 u64 temp64 = 0,val64=0; 4490 u64 temp64 = 0,val64=0;
4491 int i = 0; 4491 int i = 0;
@@ -4752,7 +4752,7 @@ reset:
4752static irqreturn_t s2io_isr(int irq, void *dev_id) 4752static irqreturn_t s2io_isr(int irq, void *dev_id)
4753{ 4753{
4754 struct net_device *dev = (struct net_device *) dev_id; 4754 struct net_device *dev = (struct net_device *) dev_id;
4755 struct s2io_nic *sp = dev->priv; 4755 struct s2io_nic *sp = netdev_priv(dev);
4756 struct XENA_dev_config __iomem *bar0 = sp->bar0; 4756 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4757 int i; 4757 int i;
4758 u64 reason = 0; 4758 u64 reason = 0;
@@ -4881,7 +4881,7 @@ static void s2io_updt_stats(struct s2io_nic *sp)
4881 4881
4882static struct net_device_stats *s2io_get_stats(struct net_device *dev) 4882static struct net_device_stats *s2io_get_stats(struct net_device *dev)
4883{ 4883{
4884 struct s2io_nic *sp = dev->priv; 4884 struct s2io_nic *sp = netdev_priv(dev);
4885 struct mac_info *mac_control; 4885 struct mac_info *mac_control;
4886 struct config_param *config; 4886 struct config_param *config;
4887 int i; 4887 int i;
@@ -4948,7 +4948,7 @@ static void s2io_set_multicast(struct net_device *dev)
4948{ 4948{
4949 int i, j, prev_cnt; 4949 int i, j, prev_cnt;
4950 struct dev_mc_list *mclist; 4950 struct dev_mc_list *mclist;
4951 struct s2io_nic *sp = dev->priv; 4951 struct s2io_nic *sp = netdev_priv(dev);
4952 struct XENA_dev_config __iomem *bar0 = sp->bar0; 4952 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4953 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask = 4953 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =
4954 0xfeffffffffffULL; 4954 0xfeffffffffffULL;
@@ -5277,7 +5277,7 @@ static int s2io_set_mac_addr(struct net_device *dev, void *p)
5277 5277
5278static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr) 5278static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr)
5279{ 5279{
5280 struct s2io_nic *sp = dev->priv; 5280 struct s2io_nic *sp = netdev_priv(dev);
5281 register u64 mac_addr = 0, perm_addr = 0; 5281 register u64 mac_addr = 0, perm_addr = 0;
5282 int i; 5282 int i;
5283 u64 tmp64; 5283 u64 tmp64;
@@ -5336,7 +5336,7 @@ static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr)
5336static int s2io_ethtool_sset(struct net_device *dev, 5336static int s2io_ethtool_sset(struct net_device *dev,
5337 struct ethtool_cmd *info) 5337 struct ethtool_cmd *info)
5338{ 5338{
5339 struct s2io_nic *sp = dev->priv; 5339 struct s2io_nic *sp = netdev_priv(dev);
5340 if ((info->autoneg == AUTONEG_ENABLE) || 5340 if ((info->autoneg == AUTONEG_ENABLE) ||
5341 (info->speed != SPEED_10000) || (info->duplex != DUPLEX_FULL)) 5341 (info->speed != SPEED_10000) || (info->duplex != DUPLEX_FULL))
5342 return -EINVAL; 5342 return -EINVAL;
@@ -5362,7 +5362,7 @@ static int s2io_ethtool_sset(struct net_device *dev,
5362 5362
5363static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info) 5363static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
5364{ 5364{
5365 struct s2io_nic *sp = dev->priv; 5365 struct s2io_nic *sp = netdev_priv(dev);
5366 info->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 5366 info->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
5367 info->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 5367 info->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
5368 info->port = PORT_FIBRE; 5368 info->port = PORT_FIBRE;
@@ -5397,7 +5397,7 @@ static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
5397static void s2io_ethtool_gdrvinfo(struct net_device *dev, 5397static void s2io_ethtool_gdrvinfo(struct net_device *dev,
5398 struct ethtool_drvinfo *info) 5398 struct ethtool_drvinfo *info)
5399{ 5399{
5400 struct s2io_nic *sp = dev->priv; 5400 struct s2io_nic *sp = netdev_priv(dev);
5401 5401
5402 strncpy(info->driver, s2io_driver_name, sizeof(info->driver)); 5402 strncpy(info->driver, s2io_driver_name, sizeof(info->driver));
5403 strncpy(info->version, s2io_driver_version, sizeof(info->version)); 5403 strncpy(info->version, s2io_driver_version, sizeof(info->version));
@@ -5427,7 +5427,7 @@ static void s2io_ethtool_gregs(struct net_device *dev,
5427 int i; 5427 int i;
5428 u64 reg; 5428 u64 reg;
5429 u8 *reg_space = (u8 *) space; 5429 u8 *reg_space = (u8 *) space;
5430 struct s2io_nic *sp = dev->priv; 5430 struct s2io_nic *sp = netdev_priv(dev);
5431 5431
5432 regs->len = XENA_REG_SPACE; 5432 regs->len = XENA_REG_SPACE;
5433 regs->version = sp->pdev->subsystem_device; 5433 regs->version = sp->pdev->subsystem_device;
@@ -5487,7 +5487,7 @@ static void s2io_phy_id(unsigned long data)
5487static int s2io_ethtool_idnic(struct net_device *dev, u32 data) 5487static int s2io_ethtool_idnic(struct net_device *dev, u32 data)
5488{ 5488{
5489 u64 val64 = 0, last_gpio_ctrl_val; 5489 u64 val64 = 0, last_gpio_ctrl_val;
5490 struct s2io_nic *sp = dev->priv; 5490 struct s2io_nic *sp = netdev_priv(dev);
5491 struct XENA_dev_config __iomem *bar0 = sp->bar0; 5491 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5492 u16 subid; 5492 u16 subid;
5493 5493
@@ -5525,7 +5525,7 @@ static int s2io_ethtool_idnic(struct net_device *dev, u32 data)
5525static void s2io_ethtool_gringparam(struct net_device *dev, 5525static void s2io_ethtool_gringparam(struct net_device *dev,
5526 struct ethtool_ringparam *ering) 5526 struct ethtool_ringparam *ering)
5527{ 5527{
5528 struct s2io_nic *sp = dev->priv; 5528 struct s2io_nic *sp = netdev_priv(dev);
5529 int i,tx_desc_count=0,rx_desc_count=0; 5529 int i,tx_desc_count=0,rx_desc_count=0;
5530 5530
5531 if (sp->rxd_mode == RXD_MODE_1) 5531 if (sp->rxd_mode == RXD_MODE_1)
@@ -5568,7 +5568,7 @@ static void s2io_ethtool_getpause_data(struct net_device *dev,
5568 struct ethtool_pauseparam *ep) 5568 struct ethtool_pauseparam *ep)
5569{ 5569{
5570 u64 val64; 5570 u64 val64;
5571 struct s2io_nic *sp = dev->priv; 5571 struct s2io_nic *sp = netdev_priv(dev);
5572 struct XENA_dev_config __iomem *bar0 = sp->bar0; 5572 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5573 5573
5574 val64 = readq(&bar0->rmac_pause_cfg); 5574 val64 = readq(&bar0->rmac_pause_cfg);
@@ -5595,7 +5595,7 @@ static int s2io_ethtool_setpause_data(struct net_device *dev,
5595 struct ethtool_pauseparam *ep) 5595 struct ethtool_pauseparam *ep)
5596{ 5596{
5597 u64 val64; 5597 u64 val64;
5598 struct s2io_nic *sp = dev->priv; 5598 struct s2io_nic *sp = netdev_priv(dev);
5599 struct XENA_dev_config __iomem *bar0 = sp->bar0; 5599 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5600 5600
5601 val64 = readq(&bar0->rmac_pause_cfg); 5601 val64 = readq(&bar0->rmac_pause_cfg);
@@ -5825,7 +5825,7 @@ static int s2io_ethtool_geeprom(struct net_device *dev,
5825{ 5825{
5826 u32 i, valid; 5826 u32 i, valid;
5827 u64 data; 5827 u64 data;
5828 struct s2io_nic *sp = dev->priv; 5828 struct s2io_nic *sp = netdev_priv(dev);
5829 5829
5830 eeprom->magic = sp->pdev->vendor | (sp->pdev->device << 16); 5830 eeprom->magic = sp->pdev->vendor | (sp->pdev->device << 16);
5831 5831
@@ -5863,7 +5863,7 @@ static int s2io_ethtool_seeprom(struct net_device *dev,
5863{ 5863{
5864 int len = eeprom->len, cnt = 0; 5864 int len = eeprom->len, cnt = 0;
5865 u64 valid = 0, data; 5865 u64 valid = 0, data;
5866 struct s2io_nic *sp = dev->priv; 5866 struct s2io_nic *sp = netdev_priv(dev);
5867 5867
5868 if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) { 5868 if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) {
5869 DBG_PRINT(ERR_DBG, 5869 DBG_PRINT(ERR_DBG,
@@ -6243,7 +6243,7 @@ static void s2io_ethtool_test(struct net_device *dev,
6243 struct ethtool_test *ethtest, 6243 struct ethtool_test *ethtest,
6244 uint64_t * data) 6244 uint64_t * data)
6245{ 6245{
6246 struct s2io_nic *sp = dev->priv; 6246 struct s2io_nic *sp = netdev_priv(dev);
6247 int orig_state = netif_running(sp->dev); 6247 int orig_state = netif_running(sp->dev);
6248 6248
6249 if (ethtest->flags == ETH_TEST_FL_OFFLINE) { 6249 if (ethtest->flags == ETH_TEST_FL_OFFLINE) {
@@ -6299,7 +6299,7 @@ static void s2io_get_ethtool_stats(struct net_device *dev,
6299 u64 * tmp_stats) 6299 u64 * tmp_stats)
6300{ 6300{
6301 int i = 0, k; 6301 int i = 0, k;
6302 struct s2io_nic *sp = dev->priv; 6302 struct s2io_nic *sp = netdev_priv(dev);
6303 struct stat_block *stat_info = sp->mac_control.stats_info; 6303 struct stat_block *stat_info = sp->mac_control.stats_info;
6304 6304
6305 s2io_updt_stats(sp); 6305 s2io_updt_stats(sp);
@@ -6578,14 +6578,14 @@ static int s2io_ethtool_get_regs_len(struct net_device *dev)
6578 6578
6579static u32 s2io_ethtool_get_rx_csum(struct net_device * dev) 6579static u32 s2io_ethtool_get_rx_csum(struct net_device * dev)
6580{ 6580{
6581 struct s2io_nic *sp = dev->priv; 6581 struct s2io_nic *sp = netdev_priv(dev);
6582 6582
6583 return (sp->rx_csum); 6583 return (sp->rx_csum);
6584} 6584}
6585 6585
6586static int s2io_ethtool_set_rx_csum(struct net_device *dev, u32 data) 6586static int s2io_ethtool_set_rx_csum(struct net_device *dev, u32 data)
6587{ 6587{
6588 struct s2io_nic *sp = dev->priv; 6588 struct s2io_nic *sp = netdev_priv(dev);
6589 6589
6590 if (data) 6590 if (data)
6591 sp->rx_csum = 1; 6591 sp->rx_csum = 1;
@@ -6602,7 +6602,7 @@ static int s2io_get_eeprom_len(struct net_device *dev)
6602 6602
6603static int s2io_get_sset_count(struct net_device *dev, int sset) 6603static int s2io_get_sset_count(struct net_device *dev, int sset)
6604{ 6604{
6605 struct s2io_nic *sp = dev->priv; 6605 struct s2io_nic *sp = netdev_priv(dev);
6606 6606
6607 switch (sset) { 6607 switch (sset) {
6608 case ETH_SS_TEST: 6608 case ETH_SS_TEST:
@@ -6625,7 +6625,7 @@ static void s2io_ethtool_get_strings(struct net_device *dev,
6625 u32 stringset, u8 * data) 6625 u32 stringset, u8 * data)
6626{ 6626{
6627 int stat_size = 0; 6627 int stat_size = 0;
6628 struct s2io_nic *sp = dev->priv; 6628 struct s2io_nic *sp = netdev_priv(dev);
6629 6629
6630 switch (stringset) { 6630 switch (stringset) {
6631 case ETH_SS_TEST: 6631 case ETH_SS_TEST:
@@ -6727,7 +6727,7 @@ static int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
6727 6727
6728static int s2io_change_mtu(struct net_device *dev, int new_mtu) 6728static int s2io_change_mtu(struct net_device *dev, int new_mtu)
6729{ 6729{
6730 struct s2io_nic *sp = dev->priv; 6730 struct s2io_nic *sp = netdev_priv(dev);
6731 int ret = 0; 6731 int ret = 0;
6732 6732
6733 if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) { 6733 if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {
@@ -7331,7 +7331,7 @@ out_unlock:
7331 7331
7332static void s2io_tx_watchdog(struct net_device *dev) 7332static void s2io_tx_watchdog(struct net_device *dev)
7333{ 7333{
7334 struct s2io_nic *sp = dev->priv; 7334 struct s2io_nic *sp = netdev_priv(dev);
7335 7335
7336 if (netif_carrier_ok(dev)) { 7336 if (netif_carrier_ok(dev)) {
7337 sp->mac_control.stats_info->sw_stat.watchdog_timer_cnt++; 7337 sp->mac_control.stats_info->sw_stat.watchdog_timer_cnt++;
@@ -7796,7 +7796,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7796 SET_NETDEV_DEV(dev, &pdev->dev); 7796 SET_NETDEV_DEV(dev, &pdev->dev);
7797 7797
7798 /* Private member variable initialized to s2io NIC structure */ 7798 /* Private member variable initialized to s2io NIC structure */
7799 sp = dev->priv; 7799 sp = netdev_priv(dev);
7800 memset(sp, 0, sizeof(struct s2io_nic)); 7800 memset(sp, 0, sizeof(struct s2io_nic));
7801 sp->dev = dev; 7801 sp->dev = dev;
7802 sp->pdev = pdev; 7802 sp->pdev = pdev;
@@ -8250,7 +8250,7 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev)
8250 8250
8251 flush_scheduled_work(); 8251 flush_scheduled_work();
8252 8252
8253 sp = dev->priv; 8253 sp = netdev_priv(dev);
8254 unregister_netdev(dev); 8254 unregister_netdev(dev);
8255 8255
8256 free_shared_mem(sp); 8256 free_shared_mem(sp);
@@ -8585,7 +8585,7 @@ static void clear_lro_session(struct lro *lro)
8585static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag) 8585static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
8586{ 8586{
8587 struct net_device *dev = skb->dev; 8587 struct net_device *dev = skb->dev;
8588 struct s2io_nic *sp = dev->priv; 8588 struct s2io_nic *sp = netdev_priv(dev);
8589 8589
8590 skb->protocol = eth_type_trans(skb, dev); 8590 skb->protocol = eth_type_trans(skb, dev);
8591 if (sp->vlgrp && vlan_tag 8591 if (sp->vlgrp && vlan_tag
@@ -8634,7 +8634,7 @@ static pci_ers_result_t s2io_io_error_detected(struct pci_dev *pdev,
8634 pci_channel_state_t state) 8634 pci_channel_state_t state)
8635{ 8635{
8636 struct net_device *netdev = pci_get_drvdata(pdev); 8636 struct net_device *netdev = pci_get_drvdata(pdev);
8637 struct s2io_nic *sp = netdev->priv; 8637 struct s2io_nic *sp = netdev_priv(netdev);
8638 8638
8639 netif_device_detach(netdev); 8639 netif_device_detach(netdev);
8640 8640
@@ -8659,7 +8659,7 @@ static pci_ers_result_t s2io_io_error_detected(struct pci_dev *pdev,
8659static pci_ers_result_t s2io_io_slot_reset(struct pci_dev *pdev) 8659static pci_ers_result_t s2io_io_slot_reset(struct pci_dev *pdev)
8660{ 8660{
8661 struct net_device *netdev = pci_get_drvdata(pdev); 8661 struct net_device *netdev = pci_get_drvdata(pdev);
8662 struct s2io_nic *sp = netdev->priv; 8662 struct s2io_nic *sp = netdev_priv(netdev);
8663 8663
8664 if (pci_enable_device(pdev)) { 8664 if (pci_enable_device(pdev)) {
8665 printk(KERN_ERR "s2io: " 8665 printk(KERN_ERR "s2io: "
@@ -8683,7 +8683,7 @@ static pci_ers_result_t s2io_io_slot_reset(struct pci_dev *pdev)
8683static void s2io_io_resume(struct pci_dev *pdev) 8683static void s2io_io_resume(struct pci_dev *pdev)
8684{ 8684{
8685 struct net_device *netdev = pci_get_drvdata(pdev); 8685 struct net_device *netdev = pci_get_drvdata(pdev);
8686 struct s2io_nic *sp = netdev->priv; 8686 struct s2io_nic *sp = netdev_priv(netdev);
8687 8687
8688 if (netif_running(netdev)) { 8688 if (netif_running(netdev)) {
8689 if (s2io_card_up(sp)) { 8689 if (s2io_card_up(sp)) {