aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:36 -0500
commit8f15ea42b64941001a401cf855a0869e24f3a845 (patch)
tree27c7534ad70ebda6986491daeac0ebe0f1ca54ed
parent4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff)
netdevice: safe convert to netdev_priv() #part-3
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/sgiseeq.c2
-rw-r--r--drivers/net/sis900.c64
-rw-r--r--drivers/net/smc9194.c6
-rw-r--r--drivers/net/sonic.h20
-rw-r--r--drivers/net/spider_net_ethtool.c8
-rw-r--r--drivers/net/sun3_82586.c38
-rw-r--r--drivers/net/sunbmac.c14
-rw-r--r--drivers/net/sungem.c52
-rw-r--r--drivers/net/sunhme.c24
-rw-r--r--drivers/net/sunqe.c14
-rw-r--r--drivers/net/tehuti.c38
-rw-r--r--drivers/net/tokenring/tms380tr.c14
-rw-r--r--drivers/net/tulip/de2104x.c44
-rw-r--r--drivers/net/tulip/eeprom.c2
-rw-r--r--drivers/net/tulip/uli526x.c2
-rw-r--r--drivers/net/typhoon.c2
-rw-r--r--drivers/net/usb/mcs7830.c4
-rw-r--r--drivers/net/virtio_net.c3
-rw-r--r--drivers/net/wan/dlci.c36
-rw-r--r--drivers/net/wan/sdla.c48
-rw-r--r--drivers/net/wan/x25_asy.c28
-rw-r--r--drivers/net/wireless/libertas/ethtool.c12
-rw-r--r--drivers/net/wireless/libertas/persistcfg.c16
-rw-r--r--drivers/net/wireless/libertas/scan.c4
-rw-r--r--drivers/net/wireless/libertas/tx.c2
25 files changed, 253 insertions, 244 deletions
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index cdffea6c7fa3..97d68560067d 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -656,7 +656,7 @@ static void timeout(struct net_device *dev)
656 656
657static void sgiseeq_set_multicast(struct net_device *dev) 657static void sgiseeq_set_multicast(struct net_device *dev)
658{ 658{
659 struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv; 659 struct sgiseeq_private *sp = netdev_priv(dev);
660 unsigned char oldmode = sp->mode; 660 unsigned char oldmode = sp->mode;
661 661
662 if(dev->flags & IFF_PROMISC) 662 if(dev->flags & IFF_PROMISC)
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 28f6c04a8ef3..9a363dc0db41 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -436,7 +436,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
436 if (ret) 436 if (ret)
437 goto err_out; 437 goto err_out;
438 438
439 sis_priv = net_dev->priv; 439 sis_priv = netdev_priv(net_dev);
440 net_dev->base_addr = ioaddr; 440 net_dev->base_addr = ioaddr;
441 net_dev->irq = pci_dev->irq; 441 net_dev->irq = pci_dev->irq;
442 sis_priv->pci_dev = pci_dev; 442 sis_priv->pci_dev = pci_dev;
@@ -569,7 +569,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
569 569
570static int __devinit sis900_mii_probe(struct net_device * net_dev) 570static int __devinit sis900_mii_probe(struct net_device * net_dev)
571{ 571{
572 struct sis900_private * sis_priv = net_dev->priv; 572 struct sis900_private *sis_priv = netdev_priv(net_dev);
573 const char *dev_name = pci_name(sis_priv->pci_dev); 573 const char *dev_name = pci_name(sis_priv->pci_dev);
574 u16 poll_bit = MII_STAT_LINK, status = 0; 574 u16 poll_bit = MII_STAT_LINK, status = 0;
575 unsigned long timeout = jiffies + 5 * HZ; 575 unsigned long timeout = jiffies + 5 * HZ;
@@ -697,7 +697,7 @@ static int __devinit sis900_mii_probe(struct net_device * net_dev)
697 697
698static u16 sis900_default_phy(struct net_device * net_dev) 698static u16 sis900_default_phy(struct net_device * net_dev)
699{ 699{
700 struct sis900_private * sis_priv = net_dev->priv; 700 struct sis900_private *sis_priv = netdev_priv(net_dev);
701 struct mii_phy *phy = NULL, *phy_home = NULL, 701 struct mii_phy *phy = NULL, *phy_home = NULL,
702 *default_phy = NULL, *phy_lan = NULL; 702 *default_phy = NULL, *phy_lan = NULL;
703 u16 status; 703 u16 status;
@@ -998,7 +998,7 @@ static void sis900_poll(struct net_device *dev)
998static int 998static int
999sis900_open(struct net_device *net_dev) 999sis900_open(struct net_device *net_dev)
1000{ 1000{
1001 struct sis900_private *sis_priv = net_dev->priv; 1001 struct sis900_private *sis_priv = netdev_priv(net_dev);
1002 long ioaddr = net_dev->base_addr; 1002 long ioaddr = net_dev->base_addr;
1003 int ret; 1003 int ret;
1004 1004
@@ -1054,7 +1054,7 @@ sis900_open(struct net_device *net_dev)
1054static void 1054static void
1055sis900_init_rxfilter (struct net_device * net_dev) 1055sis900_init_rxfilter (struct net_device * net_dev)
1056{ 1056{
1057 struct sis900_private *sis_priv = net_dev->priv; 1057 struct sis900_private *sis_priv = netdev_priv(net_dev);
1058 long ioaddr = net_dev->base_addr; 1058 long ioaddr = net_dev->base_addr;
1059 u32 rfcrSave; 1059 u32 rfcrSave;
1060 u32 i; 1060 u32 i;
@@ -1092,7 +1092,7 @@ sis900_init_rxfilter (struct net_device * net_dev)
1092static void 1092static void
1093sis900_init_tx_ring(struct net_device *net_dev) 1093sis900_init_tx_ring(struct net_device *net_dev)
1094{ 1094{
1095 struct sis900_private *sis_priv = net_dev->priv; 1095 struct sis900_private *sis_priv = netdev_priv(net_dev);
1096 long ioaddr = net_dev->base_addr; 1096 long ioaddr = net_dev->base_addr;
1097 int i; 1097 int i;
1098 1098
@@ -1126,7 +1126,7 @@ sis900_init_tx_ring(struct net_device *net_dev)
1126static void 1126static void
1127sis900_init_rx_ring(struct net_device *net_dev) 1127sis900_init_rx_ring(struct net_device *net_dev)
1128{ 1128{
1129 struct sis900_private *sis_priv = net_dev->priv; 1129 struct sis900_private *sis_priv = netdev_priv(net_dev);
1130 long ioaddr = net_dev->base_addr; 1130 long ioaddr = net_dev->base_addr;
1131 int i; 1131 int i;
1132 1132
@@ -1197,7 +1197,7 @@ sis900_init_rx_ring(struct net_device *net_dev)
1197 1197
1198static void sis630_set_eq(struct net_device *net_dev, u8 revision) 1198static void sis630_set_eq(struct net_device *net_dev, u8 revision)
1199{ 1199{
1200 struct sis900_private *sis_priv = net_dev->priv; 1200 struct sis900_private *sis_priv = netdev_priv(net_dev);
1201 u16 reg14h, eq_value=0, max_value=0, min_value=0; 1201 u16 reg14h, eq_value=0, max_value=0, min_value=0;
1202 int i, maxcount=10; 1202 int i, maxcount=10;
1203 1203
@@ -1270,7 +1270,7 @@ static void sis630_set_eq(struct net_device *net_dev, u8 revision)
1270static void sis900_timer(unsigned long data) 1270static void sis900_timer(unsigned long data)
1271{ 1271{
1272 struct net_device *net_dev = (struct net_device *)data; 1272 struct net_device *net_dev = (struct net_device *)data;
1273 struct sis900_private *sis_priv = net_dev->priv; 1273 struct sis900_private *sis_priv = netdev_priv(net_dev);
1274 struct mii_phy *mii_phy = sis_priv->mii; 1274 struct mii_phy *mii_phy = sis_priv->mii;
1275 static const int next_tick = 5*HZ; 1275 static const int next_tick = 5*HZ;
1276 u16 status; 1276 u16 status;
@@ -1340,7 +1340,7 @@ static void sis900_timer(unsigned long data)
1340 1340
1341static void sis900_check_mode(struct net_device *net_dev, struct mii_phy *mii_phy) 1341static void sis900_check_mode(struct net_device *net_dev, struct mii_phy *mii_phy)
1342{ 1342{
1343 struct sis900_private *sis_priv = net_dev->priv; 1343 struct sis900_private *sis_priv = netdev_priv(net_dev);
1344 long ioaddr = net_dev->base_addr; 1344 long ioaddr = net_dev->base_addr;
1345 int speed, duplex; 1345 int speed, duplex;
1346 1346
@@ -1419,7 +1419,7 @@ static void sis900_set_mode (long ioaddr, int speed, int duplex)
1419 1419
1420static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr) 1420static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
1421{ 1421{
1422 struct sis900_private *sis_priv = net_dev->priv; 1422 struct sis900_private *sis_priv = netdev_priv(net_dev);
1423 int i = 0; 1423 int i = 0;
1424 u32 status; 1424 u32 status;
1425 1425
@@ -1454,7 +1454,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
1454 1454
1455static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex) 1455static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex)
1456{ 1456{
1457 struct sis900_private *sis_priv = net_dev->priv; 1457 struct sis900_private *sis_priv = netdev_priv(net_dev);
1458 struct mii_phy *phy = sis_priv->mii; 1458 struct mii_phy *phy = sis_priv->mii;
1459 int phy_addr = sis_priv->cur_phy; 1459 int phy_addr = sis_priv->cur_phy;
1460 u32 status; 1460 u32 status;
@@ -1509,7 +1509,7 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex
1509 1509
1510static void sis900_tx_timeout(struct net_device *net_dev) 1510static void sis900_tx_timeout(struct net_device *net_dev)
1511{ 1511{
1512 struct sis900_private *sis_priv = net_dev->priv; 1512 struct sis900_private *sis_priv = netdev_priv(net_dev);
1513 long ioaddr = net_dev->base_addr; 1513 long ioaddr = net_dev->base_addr;
1514 unsigned long flags; 1514 unsigned long flags;
1515 int i; 1515 int i;
@@ -1568,7 +1568,7 @@ static void sis900_tx_timeout(struct net_device *net_dev)
1568static int 1568static int
1569sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) 1569sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
1570{ 1570{
1571 struct sis900_private *sis_priv = net_dev->priv; 1571 struct sis900_private *sis_priv = netdev_priv(net_dev);
1572 long ioaddr = net_dev->base_addr; 1572 long ioaddr = net_dev->base_addr;
1573 unsigned int entry; 1573 unsigned int entry;
1574 unsigned long flags; 1574 unsigned long flags;
@@ -1638,7 +1638,7 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
1638static irqreturn_t sis900_interrupt(int irq, void *dev_instance) 1638static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
1639{ 1639{
1640 struct net_device *net_dev = dev_instance; 1640 struct net_device *net_dev = dev_instance;
1641 struct sis900_private *sis_priv = net_dev->priv; 1641 struct sis900_private *sis_priv = netdev_priv(net_dev);
1642 int boguscnt = max_interrupt_work; 1642 int boguscnt = max_interrupt_work;
1643 long ioaddr = net_dev->base_addr; 1643 long ioaddr = net_dev->base_addr;
1644 u32 status; 1644 u32 status;
@@ -1700,7 +1700,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
1700 1700
1701static int sis900_rx(struct net_device *net_dev) 1701static int sis900_rx(struct net_device *net_dev)
1702{ 1702{
1703 struct sis900_private *sis_priv = net_dev->priv; 1703 struct sis900_private *sis_priv = netdev_priv(net_dev);
1704 long ioaddr = net_dev->base_addr; 1704 long ioaddr = net_dev->base_addr;
1705 unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; 1705 unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC;
1706 u32 rx_status = sis_priv->rx_ring[entry].cmdsts; 1706 u32 rx_status = sis_priv->rx_ring[entry].cmdsts;
@@ -1849,7 +1849,7 @@ refill_rx_ring:
1849 1849
1850static void sis900_finish_xmit (struct net_device *net_dev) 1850static void sis900_finish_xmit (struct net_device *net_dev)
1851{ 1851{
1852 struct sis900_private *sis_priv = net_dev->priv; 1852 struct sis900_private *sis_priv = netdev_priv(net_dev);
1853 1853
1854 for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) { 1854 for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) {
1855 struct sk_buff *skb; 1855 struct sk_buff *skb;
@@ -1918,7 +1918,7 @@ static void sis900_finish_xmit (struct net_device *net_dev)
1918static int sis900_close(struct net_device *net_dev) 1918static int sis900_close(struct net_device *net_dev)
1919{ 1919{
1920 long ioaddr = net_dev->base_addr; 1920 long ioaddr = net_dev->base_addr;
1921 struct sis900_private *sis_priv = net_dev->priv; 1921 struct sis900_private *sis_priv = netdev_priv(net_dev);
1922 struct sk_buff *skb; 1922 struct sk_buff *skb;
1923 int i; 1923 int i;
1924 1924
@@ -1973,7 +1973,7 @@ static int sis900_close(struct net_device *net_dev)
1973static void sis900_get_drvinfo(struct net_device *net_dev, 1973static void sis900_get_drvinfo(struct net_device *net_dev,
1974 struct ethtool_drvinfo *info) 1974 struct ethtool_drvinfo *info)
1975{ 1975{
1976 struct sis900_private *sis_priv = net_dev->priv; 1976 struct sis900_private *sis_priv = netdev_priv(net_dev);
1977 1977
1978 strcpy (info->driver, SIS900_MODULE_NAME); 1978 strcpy (info->driver, SIS900_MODULE_NAME);
1979 strcpy (info->version, SIS900_DRV_VERSION); 1979 strcpy (info->version, SIS900_DRV_VERSION);
@@ -1982,26 +1982,26 @@ static void sis900_get_drvinfo(struct net_device *net_dev,
1982 1982
1983static u32 sis900_get_msglevel(struct net_device *net_dev) 1983static u32 sis900_get_msglevel(struct net_device *net_dev)
1984{ 1984{
1985 struct sis900_private *sis_priv = net_dev->priv; 1985 struct sis900_private *sis_priv = netdev_priv(net_dev);
1986 return sis_priv->msg_enable; 1986 return sis_priv->msg_enable;
1987} 1987}
1988 1988
1989static void sis900_set_msglevel(struct net_device *net_dev, u32 value) 1989static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
1990{ 1990{
1991 struct sis900_private *sis_priv = net_dev->priv; 1991 struct sis900_private *sis_priv = netdev_priv(net_dev);
1992 sis_priv->msg_enable = value; 1992 sis_priv->msg_enable = value;
1993} 1993}
1994 1994
1995static u32 sis900_get_link(struct net_device *net_dev) 1995static u32 sis900_get_link(struct net_device *net_dev)
1996{ 1996{
1997 struct sis900_private *sis_priv = net_dev->priv; 1997 struct sis900_private *sis_priv = netdev_priv(net_dev);
1998 return mii_link_ok(&sis_priv->mii_info); 1998 return mii_link_ok(&sis_priv->mii_info);
1999} 1999}
2000 2000
2001static int sis900_get_settings(struct net_device *net_dev, 2001static int sis900_get_settings(struct net_device *net_dev,
2002 struct ethtool_cmd *cmd) 2002 struct ethtool_cmd *cmd)
2003{ 2003{
2004 struct sis900_private *sis_priv = net_dev->priv; 2004 struct sis900_private *sis_priv = netdev_priv(net_dev);
2005 spin_lock_irq(&sis_priv->lock); 2005 spin_lock_irq(&sis_priv->lock);
2006 mii_ethtool_gset(&sis_priv->mii_info, cmd); 2006 mii_ethtool_gset(&sis_priv->mii_info, cmd);
2007 spin_unlock_irq(&sis_priv->lock); 2007 spin_unlock_irq(&sis_priv->lock);
@@ -2011,7 +2011,7 @@ static int sis900_get_settings(struct net_device *net_dev,
2011static int sis900_set_settings(struct net_device *net_dev, 2011static int sis900_set_settings(struct net_device *net_dev,
2012 struct ethtool_cmd *cmd) 2012 struct ethtool_cmd *cmd)
2013{ 2013{
2014 struct sis900_private *sis_priv = net_dev->priv; 2014 struct sis900_private *sis_priv = netdev_priv(net_dev);
2015 int rt; 2015 int rt;
2016 spin_lock_irq(&sis_priv->lock); 2016 spin_lock_irq(&sis_priv->lock);
2017 rt = mii_ethtool_sset(&sis_priv->mii_info, cmd); 2017 rt = mii_ethtool_sset(&sis_priv->mii_info, cmd);
@@ -2021,7 +2021,7 @@ static int sis900_set_settings(struct net_device *net_dev,
2021 2021
2022static int sis900_nway_reset(struct net_device *net_dev) 2022static int sis900_nway_reset(struct net_device *net_dev)
2023{ 2023{
2024 struct sis900_private *sis_priv = net_dev->priv; 2024 struct sis900_private *sis_priv = netdev_priv(net_dev);
2025 return mii_nway_restart(&sis_priv->mii_info); 2025 return mii_nway_restart(&sis_priv->mii_info);
2026} 2026}
2027 2027
@@ -2038,7 +2038,7 @@ static int sis900_nway_reset(struct net_device *net_dev)
2038 2038
2039static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) 2039static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol)
2040{ 2040{
2041 struct sis900_private *sis_priv = net_dev->priv; 2041 struct sis900_private *sis_priv = netdev_priv(net_dev);
2042 long pmctrl_addr = net_dev->base_addr + pmctrl; 2042 long pmctrl_addr = net_dev->base_addr + pmctrl;
2043 u32 cfgpmcsr = 0, pmctrl_bits = 0; 2043 u32 cfgpmcsr = 0, pmctrl_bits = 0;
2044 2044
@@ -2109,7 +2109,7 @@ static const struct ethtool_ops sis900_ethtool_ops = {
2109 2109
2110static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd) 2110static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
2111{ 2111{
2112 struct sis900_private *sis_priv = net_dev->priv; 2112 struct sis900_private *sis_priv = netdev_priv(net_dev);
2113 struct mii_ioctl_data *data = if_mii(rq); 2113 struct mii_ioctl_data *data = if_mii(rq);
2114 2114
2115 switch(cmd) { 2115 switch(cmd) {
@@ -2143,7 +2143,7 @@ static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
2143 2143
2144static int sis900_set_config(struct net_device *dev, struct ifmap *map) 2144static int sis900_set_config(struct net_device *dev, struct ifmap *map)
2145{ 2145{
2146 struct sis900_private *sis_priv = dev->priv; 2146 struct sis900_private *sis_priv = netdev_priv(dev);
2147 struct mii_phy *mii_phy = sis_priv->mii; 2147 struct mii_phy *mii_phy = sis_priv->mii;
2148 2148
2149 u16 status; 2149 u16 status;
@@ -2266,7 +2266,7 @@ static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision)
2266static void set_rx_mode(struct net_device *net_dev) 2266static void set_rx_mode(struct net_device *net_dev)
2267{ 2267{
2268 long ioaddr = net_dev->base_addr; 2268 long ioaddr = net_dev->base_addr;
2269 struct sis900_private * sis_priv = net_dev->priv; 2269 struct sis900_private *sis_priv = netdev_priv(net_dev);
2270 u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */ 2270 u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
2271 int i, table_entries; 2271 int i, table_entries;
2272 u32 rx_mode; 2272 u32 rx_mode;
@@ -2341,7 +2341,7 @@ static void set_rx_mode(struct net_device *net_dev)
2341 2341
2342static void sis900_reset(struct net_device *net_dev) 2342static void sis900_reset(struct net_device *net_dev)
2343{ 2343{
2344 struct sis900_private * sis_priv = net_dev->priv; 2344 struct sis900_private *sis_priv = netdev_priv(net_dev);
2345 long ioaddr = net_dev->base_addr; 2345 long ioaddr = net_dev->base_addr;
2346 int i = 0; 2346 int i = 0;
2347 u32 status = TxRCMP | RxRCMP; 2347 u32 status = TxRCMP | RxRCMP;
@@ -2374,7 +2374,7 @@ static void sis900_reset(struct net_device *net_dev)
2374static void __devexit sis900_remove(struct pci_dev *pci_dev) 2374static void __devexit sis900_remove(struct pci_dev *pci_dev)
2375{ 2375{
2376 struct net_device *net_dev = pci_get_drvdata(pci_dev); 2376 struct net_device *net_dev = pci_get_drvdata(pci_dev);
2377 struct sis900_private * sis_priv = net_dev->priv; 2377 struct sis900_private *sis_priv = netdev_priv(net_dev);
2378 struct mii_phy *phy = NULL; 2378 struct mii_phy *phy = NULL;
2379 2379
2380 while (sis_priv->first_mii) { 2380 while (sis_priv->first_mii) {
@@ -2418,7 +2418,7 @@ static int sis900_suspend(struct pci_dev *pci_dev, pm_message_t state)
2418static int sis900_resume(struct pci_dev *pci_dev) 2418static int sis900_resume(struct pci_dev *pci_dev)
2419{ 2419{
2420 struct net_device *net_dev = pci_get_drvdata(pci_dev); 2420 struct net_device *net_dev = pci_get_drvdata(pci_dev);
2421 struct sis900_private *sis_priv = net_dev->priv; 2421 struct sis900_private *sis_priv = netdev_priv(net_dev);
2422 long ioaddr = net_dev->base_addr; 2422 long ioaddr = net_dev->base_addr;
2423 2423
2424 if(!netif_running(net_dev)) 2424 if(!netif_running(net_dev))
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index e35fab1da6a4..e7cc80f32560 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -1034,7 +1034,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
1034 printk("ADDR: %pM\n", dev->dev_addr); 1034 printk("ADDR: %pM\n", dev->dev_addr);
1035 1035
1036 /* set the private data to zero by default */ 1036 /* set the private data to zero by default */
1037 memset(dev->priv, 0, sizeof(struct smc_local)); 1037 memset(netdev_priv(dev), 0, sizeof(struct smc_local));
1038 1038
1039 /* Grab the IRQ */ 1039 /* Grab the IRQ */
1040 retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev); 1040 retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev);
@@ -1108,7 +1108,7 @@ static int smc_open(struct net_device *dev)
1108 int i; /* used to set hw ethernet address */ 1108 int i; /* used to set hw ethernet address */
1109 1109
1110 /* clear out all the junk that was put here before... */ 1110 /* clear out all the junk that was put here before... */
1111 memset(dev->priv, 0, sizeof(struct smc_local)); 1111 memset(netdev_priv(dev), 0, sizeof(struct smc_local));
1112 1112
1113 /* reset the hardware */ 1113 /* reset the hardware */
1114 1114
@@ -1164,7 +1164,7 @@ static void smc_timeout(struct net_device *dev)
1164 smc_enable( dev->base_addr ); 1164 smc_enable( dev->base_addr );
1165 dev->trans_start = jiffies; 1165 dev->trans_start = jiffies;
1166 /* clear anything saved */ 1166 /* clear anything saved */
1167 ((struct smc_local *)dev->priv)->saved_skb = NULL; 1167 ((struct smc_local *)netdev_priv(dev))->saved_skb = NULL;
1168 netif_wake_queue(dev); 1168 netif_wake_queue(dev);
1169} 1169}
1170 1170
diff --git a/drivers/net/sonic.h b/drivers/net/sonic.h
index 7db13e4a7ea5..07091dd27e5d 100644
--- a/drivers/net/sonic.h
+++ b/drivers/net/sonic.h
@@ -371,7 +371,7 @@ static inline __u16 sonic_buf_get(void* base, int bitmode,
371static inline void sonic_cda_put(struct net_device* dev, int entry, 371static inline void sonic_cda_put(struct net_device* dev, int entry,
372 int offset, __u16 val) 372 int offset, __u16 val)
373{ 373{
374 struct sonic_local* lp = (struct sonic_local *) dev->priv; 374 struct sonic_local *lp = netdev_priv(dev);
375 sonic_buf_put(lp->cda, lp->dma_bitmode, 375 sonic_buf_put(lp->cda, lp->dma_bitmode,
376 (entry * SIZEOF_SONIC_CD) + offset, val); 376 (entry * SIZEOF_SONIC_CD) + offset, val);
377} 377}
@@ -379,27 +379,27 @@ static inline void sonic_cda_put(struct net_device* dev, int entry,
379static inline __u16 sonic_cda_get(struct net_device* dev, int entry, 379static inline __u16 sonic_cda_get(struct net_device* dev, int entry,
380 int offset) 380 int offset)
381{ 381{
382 struct sonic_local* lp = (struct sonic_local *) dev->priv; 382 struct sonic_local *lp = netdev_priv(dev);
383 return sonic_buf_get(lp->cda, lp->dma_bitmode, 383 return sonic_buf_get(lp->cda, lp->dma_bitmode,
384 (entry * SIZEOF_SONIC_CD) + offset); 384 (entry * SIZEOF_SONIC_CD) + offset);
385} 385}
386 386
387static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val) 387static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val)
388{ 388{
389 struct sonic_local* lp = (struct sonic_local *) dev->priv; 389 struct sonic_local *lp = netdev_priv(dev);
390 sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val); 390 sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val);
391} 391}
392 392
393static inline __u16 sonic_get_cam_enable(struct net_device* dev) 393static inline __u16 sonic_get_cam_enable(struct net_device* dev)
394{ 394{
395 struct sonic_local* lp = (struct sonic_local *) dev->priv; 395 struct sonic_local *lp = netdev_priv(dev);
396 return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE); 396 return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE);
397} 397}
398 398
399static inline void sonic_tda_put(struct net_device* dev, int entry, 399static inline void sonic_tda_put(struct net_device* dev, int entry,
400 int offset, __u16 val) 400 int offset, __u16 val)
401{ 401{
402 struct sonic_local* lp = (struct sonic_local *) dev->priv; 402 struct sonic_local *lp = netdev_priv(dev);
403 sonic_buf_put(lp->tda, lp->dma_bitmode, 403 sonic_buf_put(lp->tda, lp->dma_bitmode,
404 (entry * SIZEOF_SONIC_TD) + offset, val); 404 (entry * SIZEOF_SONIC_TD) + offset, val);
405} 405}
@@ -407,7 +407,7 @@ static inline void sonic_tda_put(struct net_device* dev, int entry,
407static inline __u16 sonic_tda_get(struct net_device* dev, int entry, 407static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
408 int offset) 408 int offset)
409{ 409{
410 struct sonic_local* lp = (struct sonic_local *) dev->priv; 410 struct sonic_local *lp = netdev_priv(dev);
411 return sonic_buf_get(lp->tda, lp->dma_bitmode, 411 return sonic_buf_get(lp->tda, lp->dma_bitmode,
412 (entry * SIZEOF_SONIC_TD) + offset); 412 (entry * SIZEOF_SONIC_TD) + offset);
413} 413}
@@ -415,7 +415,7 @@ static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
415static inline void sonic_rda_put(struct net_device* dev, int entry, 415static inline void sonic_rda_put(struct net_device* dev, int entry,
416 int offset, __u16 val) 416 int offset, __u16 val)
417{ 417{
418 struct sonic_local* lp = (struct sonic_local *) dev->priv; 418 struct sonic_local *lp = netdev_priv(dev);
419 sonic_buf_put(lp->rda, lp->dma_bitmode, 419 sonic_buf_put(lp->rda, lp->dma_bitmode,
420 (entry * SIZEOF_SONIC_RD) + offset, val); 420 (entry * SIZEOF_SONIC_RD) + offset, val);
421} 421}
@@ -423,7 +423,7 @@ static inline void sonic_rda_put(struct net_device* dev, int entry,
423static inline __u16 sonic_rda_get(struct net_device* dev, int entry, 423static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
424 int offset) 424 int offset)
425{ 425{
426 struct sonic_local* lp = (struct sonic_local *) dev->priv; 426 struct sonic_local *lp = netdev_priv(dev);
427 return sonic_buf_get(lp->rda, lp->dma_bitmode, 427 return sonic_buf_get(lp->rda, lp->dma_bitmode,
428 (entry * SIZEOF_SONIC_RD) + offset); 428 (entry * SIZEOF_SONIC_RD) + offset);
429} 429}
@@ -431,7 +431,7 @@ static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
431static inline void sonic_rra_put(struct net_device* dev, int entry, 431static inline void sonic_rra_put(struct net_device* dev, int entry,
432 int offset, __u16 val) 432 int offset, __u16 val)
433{ 433{
434 struct sonic_local* lp = (struct sonic_local *) dev->priv; 434 struct sonic_local *lp = netdev_priv(dev);
435 sonic_buf_put(lp->rra, lp->dma_bitmode, 435 sonic_buf_put(lp->rra, lp->dma_bitmode,
436 (entry * SIZEOF_SONIC_RR) + offset, val); 436 (entry * SIZEOF_SONIC_RR) + offset, val);
437} 437}
@@ -439,7 +439,7 @@ static inline void sonic_rra_put(struct net_device* dev, int entry,
439static inline __u16 sonic_rra_get(struct net_device* dev, int entry, 439static inline __u16 sonic_rra_get(struct net_device* dev, int entry,
440 int offset) 440 int offset)
441{ 441{
442 struct sonic_local* lp = (struct sonic_local *) dev->priv; 442 struct sonic_local *lp = netdev_priv(dev);
443 return sonic_buf_get(lp->rra, lp->dma_bitmode, 443 return sonic_buf_get(lp->rra, lp->dma_bitmode,
444 (entry * SIZEOF_SONIC_RR) + offset); 444 (entry * SIZEOF_SONIC_RR) + offset);
445} 445}
diff --git a/drivers/net/spider_net_ethtool.c b/drivers/net/spider_net_ethtool.c
index 85691d2a0be2..5bae728c3820 100644
--- a/drivers/net/spider_net_ethtool.c
+++ b/drivers/net/spider_net_ethtool.c
@@ -118,7 +118,7 @@ spider_net_ethtool_nway_reset(struct net_device *netdev)
118static u32 118static u32
119spider_net_ethtool_get_rx_csum(struct net_device *netdev) 119spider_net_ethtool_get_rx_csum(struct net_device *netdev)
120{ 120{
121 struct spider_net_card *card = netdev->priv; 121 struct spider_net_card *card = netdev_priv(netdev);
122 122
123 return card->options.rx_csum; 123 return card->options.rx_csum;
124} 124}
@@ -126,7 +126,7 @@ spider_net_ethtool_get_rx_csum(struct net_device *netdev)
126static int 126static int
127spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n) 127spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n)
128{ 128{
129 struct spider_net_card *card = netdev->priv; 129 struct spider_net_card *card = netdev_priv(netdev);
130 130
131 card->options.rx_csum = n; 131 card->options.rx_csum = n;
132 return 0; 132 return 0;
@@ -137,7 +137,7 @@ static void
137spider_net_ethtool_get_ringparam(struct net_device *netdev, 137spider_net_ethtool_get_ringparam(struct net_device *netdev,
138 struct ethtool_ringparam *ering) 138 struct ethtool_ringparam *ering)
139{ 139{
140 struct spider_net_card *card = netdev->priv; 140 struct spider_net_card *card = netdev_priv(netdev);
141 141
142 ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX; 142 ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX;
143 ering->tx_pending = card->tx_chain.num_desc; 143 ering->tx_pending = card->tx_chain.num_desc;
@@ -158,7 +158,7 @@ static int spider_net_get_sset_count(struct net_device *netdev, int sset)
158static void spider_net_get_ethtool_stats(struct net_device *netdev, 158static void spider_net_get_ethtool_stats(struct net_device *netdev,
159 struct ethtool_stats *stats, u64 *data) 159 struct ethtool_stats *stats, u64 *data)
160{ 160{
161 struct spider_net_card *card = netdev->priv; 161 struct spider_net_card *card = netdev_priv(netdev);
162 162
163 data[0] = netdev->stats.tx_packets; 163 data[0] = netdev->stats.tx_packets;
164 data[1] = netdev->stats.tx_bytes; 164 data[1] = netdev->stats.tx_bytes;
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index e531302d95f5..e8f97d5c9c23 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -247,7 +247,7 @@ static int check586(struct net_device *dev,char *where,unsigned size)
247 */ 247 */
248static void alloc586(struct net_device *dev) 248static void alloc586(struct net_device *dev)
249{ 249{
250 struct priv *p = (struct priv *) dev->priv; 250 struct priv *p = netdev_priv(dev);
251 251
252 sun3_reset586(); 252 sun3_reset586();
253 DELAY(1); 253 DELAY(1);
@@ -363,17 +363,21 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
363 goto out; 363 goto out;
364 } 364 }
365 365
366 ((struct priv *) (dev->priv))->memtop = (char *)dvma_btov(dev->mem_start); 366 ((struct priv *)netdev_priv(dev))->memtop =
367 ((struct priv *) (dev->priv))->base = (unsigned long) dvma_btov(0); 367 (char *)dvma_btov(dev->mem_start);
368 ((struct priv *)netdev_priv(dev))->base = (unsigned long) dvma_btov(0);
368 alloc586(dev); 369 alloc586(dev);
369 370
370 /* set number of receive-buffs according to memsize */ 371 /* set number of receive-buffs according to memsize */
371 if(size == 0x2000) 372 if(size == 0x2000)
372 ((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_8; 373 ((struct priv *)netdev_priv(dev))->num_recv_buffs =
374 NUM_RECV_BUFFS_8;
373 else if(size == 0x4000) 375 else if(size == 0x4000)
374 ((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_16; 376 ((struct priv *)netdev_priv(dev))->num_recv_buffs =
377 NUM_RECV_BUFFS_16;
375 else 378 else
376 ((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_32; 379 ((struct priv *)netdev_priv(dev))->num_recv_buffs =
380 NUM_RECV_BUFFS_32;
377 381
378 printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq); 382 printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
379 383
@@ -397,7 +401,7 @@ static int init586(struct net_device *dev)
397{ 401{
398 void *ptr; 402 void *ptr;
399 int i,result=0; 403 int i,result=0;
400 struct priv *p = (struct priv *) dev->priv; 404 struct priv *p = netdev_priv(dev);
401 volatile struct configure_cmd_struct *cfg_cmd; 405 volatile struct configure_cmd_struct *cfg_cmd;
402 volatile struct iasetup_cmd_struct *ias_cmd; 406 volatile struct iasetup_cmd_struct *ias_cmd;
403 volatile struct tdr_cmd_struct *tdr_cmd; 407 volatile struct tdr_cmd_struct *tdr_cmd;
@@ -631,7 +635,7 @@ static void *alloc_rfa(struct net_device *dev,void *ptr)
631 volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr; 635 volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr;
632 volatile struct rbd_struct *rbd; 636 volatile struct rbd_struct *rbd;
633 int i; 637 int i;
634 struct priv *p = (struct priv *) dev->priv; 638 struct priv *p = netdev_priv(dev);
635 639
636 memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd)); 640 memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd));
637 p->rfd_first = rfd; 641 p->rfd_first = rfd;
@@ -683,7 +687,7 @@ static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id)
683 printk ("sun3_82586-interrupt: irq %d for unknown device.\n",irq); 687 printk ("sun3_82586-interrupt: irq %d for unknown device.\n",irq);
684 return IRQ_NONE; 688 return IRQ_NONE;
685 } 689 }
686 p = (struct priv *) dev->priv; 690 p = netdev_priv(dev);
687 691
688 if(debuglevel > 1) 692 if(debuglevel > 1)
689 printk("I"); 693 printk("I");
@@ -753,7 +757,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)
753 unsigned short totlen; 757 unsigned short totlen;
754 struct sk_buff *skb; 758 struct sk_buff *skb;
755 struct rbd_struct *rbd; 759 struct rbd_struct *rbd;
756 struct priv *p = (struct priv *) dev->priv; 760 struct priv *p = netdev_priv(dev);
757 761
758 if(debuglevel > 0) 762 if(debuglevel > 0)
759 printk("R"); 763 printk("R");
@@ -871,7 +875,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)
871 875
872static void sun3_82586_rnr_int(struct net_device *dev) 876static void sun3_82586_rnr_int(struct net_device *dev)
873{ 877{
874 struct priv *p = (struct priv *) dev->priv; 878 struct priv *p = netdev_priv(dev);
875 879
876 p->stats.rx_errors++; 880 p->stats.rx_errors++;
877 881
@@ -895,7 +899,7 @@ static void sun3_82586_rnr_int(struct net_device *dev)
895static void sun3_82586_xmt_int(struct net_device *dev) 899static void sun3_82586_xmt_int(struct net_device *dev)
896{ 900{
897 int status; 901 int status;
898 struct priv *p = (struct priv *) dev->priv; 902 struct priv *p = netdev_priv(dev);
899 903
900 if(debuglevel > 0) 904 if(debuglevel > 0)
901 printk("X"); 905 printk("X");
@@ -945,7 +949,7 @@ static void sun3_82586_xmt_int(struct net_device *dev)
945 949
946static void startrecv586(struct net_device *dev) 950static void startrecv586(struct net_device *dev)
947{ 951{
948 struct priv *p = (struct priv *) dev->priv; 952 struct priv *p = netdev_priv(dev);
949 953
950 WAIT_4_SCB_CMD(); 954 WAIT_4_SCB_CMD();
951 WAIT_4_SCB_CMD_RUC(); 955 WAIT_4_SCB_CMD_RUC();
@@ -957,7 +961,7 @@ static void startrecv586(struct net_device *dev)
957 961
958static void sun3_82586_timeout(struct net_device *dev) 962static void sun3_82586_timeout(struct net_device *dev)
959{ 963{
960 struct priv *p = (struct priv *) dev->priv; 964 struct priv *p = netdev_priv(dev);
961#ifndef NO_NOPCOMMANDS 965#ifndef NO_NOPCOMMANDS
962 if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */ 966 if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */
963 { 967 {
@@ -999,7 +1003,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
999#ifndef NO_NOPCOMMANDS 1003#ifndef NO_NOPCOMMANDS
1000 int next_nop; 1004 int next_nop;
1001#endif 1005#endif
1002 struct priv *p = (struct priv *) dev->priv; 1006 struct priv *p = netdev_priv(dev);
1003 1007
1004 if(skb->len > XMIT_BUFF_SIZE) 1008 if(skb->len > XMIT_BUFF_SIZE)
1005 { 1009 {
@@ -1108,7 +1112,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
1108 1112
1109static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev) 1113static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev)
1110{ 1114{
1111 struct priv *p = (struct priv *) dev->priv; 1115 struct priv *p = netdev_priv(dev);
1112 unsigned short crc,aln,rsc,ovrn; 1116 unsigned short crc,aln,rsc,ovrn;
1113 1117
1114 crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */ 1118 crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */
@@ -1171,7 +1175,7 @@ void cleanup_module(void)
1171 */ 1175 */
1172void sun3_82586_dump(struct net_device *dev,void *ptr) 1176void sun3_82586_dump(struct net_device *dev,void *ptr)
1173{ 1177{
1174 struct priv *p = (struct priv *) dev->priv; 1178 struct priv *p = netdev_priv(dev);
1175 struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr; 1179 struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr;
1176 int i; 1180 int i;
1177 1181
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 3f57ba0ed03a..977b3e08bbfc 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -916,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id)
916 916
917static int bigmac_open(struct net_device *dev) 917static int bigmac_open(struct net_device *dev)
918{ 918{
919 struct bigmac *bp = (struct bigmac *) dev->priv; 919 struct bigmac *bp = netdev_priv(dev);
920 int ret; 920 int ret;
921 921
922 ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp); 922 ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
@@ -933,7 +933,7 @@ static int bigmac_open(struct net_device *dev)
933 933
934static int bigmac_close(struct net_device *dev) 934static int bigmac_close(struct net_device *dev)
935{ 935{
936 struct bigmac *bp = (struct bigmac *) dev->priv; 936 struct bigmac *bp = netdev_priv(dev);
937 937
938 del_timer(&bp->bigmac_timer); 938 del_timer(&bp->bigmac_timer);
939 bp->timer_state = asleep; 939 bp->timer_state = asleep;
@@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev)
947 947
948static void bigmac_tx_timeout(struct net_device *dev) 948static void bigmac_tx_timeout(struct net_device *dev)
949{ 949{
950 struct bigmac *bp = (struct bigmac *) dev->priv; 950 struct bigmac *bp = netdev_priv(dev);
951 951
952 bigmac_init_hw(bp, 0); 952 bigmac_init_hw(bp, 0);
953 netif_wake_queue(dev); 953 netif_wake_queue(dev);
@@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev)
956/* Put a packet on the wire. */ 956/* Put a packet on the wire. */
957static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) 957static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
958{ 958{
959 struct bigmac *bp = (struct bigmac *) dev->priv; 959 struct bigmac *bp = netdev_priv(dev);
960 int len, entry; 960 int len, entry;
961 u32 mapping; 961 u32 mapping;
962 962
@@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
989 989
990static struct net_device_stats *bigmac_get_stats(struct net_device *dev) 990static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
991{ 991{
992 struct bigmac *bp = (struct bigmac *) dev->priv; 992 struct bigmac *bp = netdev_priv(dev);
993 993
994 bigmac_get_counters(bp, bp->bregs); 994 bigmac_get_counters(bp, bp->bregs);
995 return &bp->enet_stats; 995 return &bp->enet_stats;
@@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
997 997
998static void bigmac_set_multicast(struct net_device *dev) 998static void bigmac_set_multicast(struct net_device *dev)
999{ 999{
1000 struct bigmac *bp = (struct bigmac *) dev->priv; 1000 struct bigmac *bp = netdev_priv(dev);
1001 void __iomem *bregs = bp->bregs; 1001 void __iomem *bregs = bp->bregs;
1002 struct dev_mc_list *dmi = dev->mc_list; 1002 struct dev_mc_list *dmi = dev->mc_list;
1003 char *addrs; 1003 char *addrs;
@@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i
1060 1060
1061static u32 bigmac_get_link(struct net_device *dev) 1061static u32 bigmac_get_link(struct net_device *dev)
1062{ 1062{
1063 struct bigmac *bp = dev->priv; 1063 struct bigmac *bp = netdev_priv(dev);
1064 1064
1065 spin_lock_irq(&bp->lock); 1065 spin_lock_irq(&bp->lock);
1066 bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR); 1066 bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index deb114801da9..44be8dfbcf17 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -164,7 +164,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg)
164 164
165static inline int _phy_read(struct net_device *dev, int mii_id, int reg) 165static inline int _phy_read(struct net_device *dev, int mii_id, int reg)
166{ 166{
167 struct gem *gp = dev->priv; 167 struct gem *gp = netdev_priv(dev);
168 return __phy_read(gp, mii_id, reg); 168 return __phy_read(gp, mii_id, reg);
169} 169}
170 170
@@ -197,7 +197,7 @@ static void __phy_write(struct gem *gp, int phy_addr, int reg, u16 val)
197 197
198static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val) 198static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val)
199{ 199{
200 struct gem *gp = dev->priv; 200 struct gem *gp = netdev_priv(dev);
201 __phy_write(gp, mii_id, reg, val & 0xffff); 201 __phy_write(gp, mii_id, reg, val & 0xffff);
202} 202}
203 203
@@ -932,7 +932,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
932static irqreturn_t gem_interrupt(int irq, void *dev_id) 932static irqreturn_t gem_interrupt(int irq, void *dev_id)
933{ 933{
934 struct net_device *dev = dev_id; 934 struct net_device *dev = dev_id;
935 struct gem *gp = dev->priv; 935 struct gem *gp = netdev_priv(dev);
936 unsigned long flags; 936 unsigned long flags;
937 937
938 /* Swallow interrupts when shutting the chip down, though 938 /* Swallow interrupts when shutting the chip down, though
@@ -978,7 +978,7 @@ static void gem_poll_controller(struct net_device *dev)
978 978
979static void gem_tx_timeout(struct net_device *dev) 979static void gem_tx_timeout(struct net_device *dev)
980{ 980{
981 struct gem *gp = dev->priv; 981 struct gem *gp = netdev_priv(dev);
982 982
983 printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name); 983 printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
984 if (!gp->running) { 984 if (!gp->running) {
@@ -1017,7 +1017,7 @@ static __inline__ int gem_intme(int entry)
1017 1017
1018static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev) 1018static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
1019{ 1019{
1020 struct gem *gp = dev->priv; 1020 struct gem *gp = netdev_priv(dev);
1021 int entry; 1021 int entry;
1022 u64 ctrl; 1022 u64 ctrl;
1023 unsigned long flags; 1023 unsigned long flags;
@@ -2190,7 +2190,7 @@ static void gem_stop_phy(struct gem *gp, int wol)
2190 2190
2191static int gem_do_start(struct net_device *dev) 2191static int gem_do_start(struct net_device *dev)
2192{ 2192{
2193 struct gem *gp = dev->priv; 2193 struct gem *gp = netdev_priv(dev);
2194 unsigned long flags; 2194 unsigned long flags;
2195 2195
2196 spin_lock_irqsave(&gp->lock, flags); 2196 spin_lock_irqsave(&gp->lock, flags);
@@ -2237,7 +2237,7 @@ static int gem_do_start(struct net_device *dev)
2237 2237
2238static void gem_do_stop(struct net_device *dev, int wol) 2238static void gem_do_stop(struct net_device *dev, int wol)
2239{ 2239{
2240 struct gem *gp = dev->priv; 2240 struct gem *gp = netdev_priv(dev);
2241 unsigned long flags; 2241 unsigned long flags;
2242 2242
2243 spin_lock_irqsave(&gp->lock, flags); 2243 spin_lock_irqsave(&gp->lock, flags);
@@ -2312,7 +2312,7 @@ static void gem_reset_task(struct work_struct *work)
2312 2312
2313static int gem_open(struct net_device *dev) 2313static int gem_open(struct net_device *dev)
2314{ 2314{
2315 struct gem *gp = dev->priv; 2315 struct gem *gp = netdev_priv(dev);
2316 int rc = 0; 2316 int rc = 0;
2317 2317
2318 mutex_lock(&gp->pm_mutex); 2318 mutex_lock(&gp->pm_mutex);
@@ -2331,7 +2331,7 @@ static int gem_open(struct net_device *dev)
2331 2331
2332static int gem_close(struct net_device *dev) 2332static int gem_close(struct net_device *dev)
2333{ 2333{
2334 struct gem *gp = dev->priv; 2334 struct gem *gp = netdev_priv(dev);
2335 2335
2336 mutex_lock(&gp->pm_mutex); 2336 mutex_lock(&gp->pm_mutex);
2337 2337
@@ -2350,7 +2350,7 @@ static int gem_close(struct net_device *dev)
2350static int gem_suspend(struct pci_dev *pdev, pm_message_t state) 2350static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
2351{ 2351{
2352 struct net_device *dev = pci_get_drvdata(pdev); 2352 struct net_device *dev = pci_get_drvdata(pdev);
2353 struct gem *gp = dev->priv; 2353 struct gem *gp = netdev_priv(dev);
2354 unsigned long flags; 2354 unsigned long flags;
2355 2355
2356 mutex_lock(&gp->pm_mutex); 2356 mutex_lock(&gp->pm_mutex);
@@ -2414,7 +2414,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
2414static int gem_resume(struct pci_dev *pdev) 2414static int gem_resume(struct pci_dev *pdev)
2415{ 2415{
2416 struct net_device *dev = pci_get_drvdata(pdev); 2416 struct net_device *dev = pci_get_drvdata(pdev);
2417 struct gem *gp = dev->priv; 2417 struct gem *gp = netdev_priv(dev);
2418 unsigned long flags; 2418 unsigned long flags;
2419 2419
2420 printk(KERN_INFO "%s: resuming\n", dev->name); 2420 printk(KERN_INFO "%s: resuming\n", dev->name);
@@ -2488,7 +2488,7 @@ static int gem_resume(struct pci_dev *pdev)
2488 2488
2489static struct net_device_stats *gem_get_stats(struct net_device *dev) 2489static struct net_device_stats *gem_get_stats(struct net_device *dev)
2490{ 2490{
2491 struct gem *gp = dev->priv; 2491 struct gem *gp = netdev_priv(dev);
2492 struct net_device_stats *stats = &gp->net_stats; 2492 struct net_device_stats *stats = &gp->net_stats;
2493 2493
2494 spin_lock_irq(&gp->lock); 2494 spin_lock_irq(&gp->lock);
@@ -2524,7 +2524,7 @@ static struct net_device_stats *gem_get_stats(struct net_device *dev)
2524static int gem_set_mac_address(struct net_device *dev, void *addr) 2524static int gem_set_mac_address(struct net_device *dev, void *addr)
2525{ 2525{
2526 struct sockaddr *macaddr = (struct sockaddr *) addr; 2526 struct sockaddr *macaddr = (struct sockaddr *) addr;
2527 struct gem *gp = dev->priv; 2527 struct gem *gp = netdev_priv(dev);
2528 unsigned char *e = &dev->dev_addr[0]; 2528 unsigned char *e = &dev->dev_addr[0];
2529 2529
2530 if (!is_valid_ether_addr(macaddr->sa_data)) 2530 if (!is_valid_ether_addr(macaddr->sa_data))
@@ -2552,7 +2552,7 @@ static int gem_set_mac_address(struct net_device *dev, void *addr)
2552 2552
2553static void gem_set_multicast(struct net_device *dev) 2553static void gem_set_multicast(struct net_device *dev)
2554{ 2554{
2555 struct gem *gp = dev->priv; 2555 struct gem *gp = netdev_priv(dev);
2556 u32 rxcfg, rxcfg_new; 2556 u32 rxcfg, rxcfg_new;
2557 int limit = 10000; 2557 int limit = 10000;
2558 2558
@@ -2601,7 +2601,7 @@ static void gem_set_multicast(struct net_device *dev)
2601 2601
2602static int gem_change_mtu(struct net_device *dev, int new_mtu) 2602static int gem_change_mtu(struct net_device *dev, int new_mtu)
2603{ 2603{
2604 struct gem *gp = dev->priv; 2604 struct gem *gp = netdev_priv(dev);
2605 2605
2606 if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU) 2606 if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU)
2607 return -EINVAL; 2607 return -EINVAL;
@@ -2632,7 +2632,7 @@ static int gem_change_mtu(struct net_device *dev, int new_mtu)
2632 2632
2633static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 2633static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2634{ 2634{
2635 struct gem *gp = dev->priv; 2635 struct gem *gp = netdev_priv(dev);
2636 2636
2637 strcpy(info->driver, DRV_NAME); 2637 strcpy(info->driver, DRV_NAME);
2638 strcpy(info->version, DRV_VERSION); 2638 strcpy(info->version, DRV_VERSION);
@@ -2641,7 +2641,7 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
2641 2641
2642static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2642static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2643{ 2643{
2644 struct gem *gp = dev->priv; 2644 struct gem *gp = netdev_priv(dev);
2645 2645
2646 if (gp->phy_type == phy_mii_mdio0 || 2646 if (gp->phy_type == phy_mii_mdio0 ||
2647 gp->phy_type == phy_mii_mdio1) { 2647 gp->phy_type == phy_mii_mdio1) {
@@ -2687,7 +2687,7 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2687 2687
2688static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2688static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2689{ 2689{
2690 struct gem *gp = dev->priv; 2690 struct gem *gp = netdev_priv(dev);
2691 2691
2692 /* Verify the settings we care about. */ 2692 /* Verify the settings we care about. */
2693 if (cmd->autoneg != AUTONEG_ENABLE && 2693 if (cmd->autoneg != AUTONEG_ENABLE &&
@@ -2718,7 +2718,7 @@ static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2718 2718
2719static int gem_nway_reset(struct net_device *dev) 2719static int gem_nway_reset(struct net_device *dev)
2720{ 2720{
2721 struct gem *gp = dev->priv; 2721 struct gem *gp = netdev_priv(dev);
2722 2722
2723 if (!gp->want_autoneg) 2723 if (!gp->want_autoneg)
2724 return -EINVAL; 2724 return -EINVAL;
@@ -2735,13 +2735,13 @@ static int gem_nway_reset(struct net_device *dev)
2735 2735
2736static u32 gem_get_msglevel(struct net_device *dev) 2736static u32 gem_get_msglevel(struct net_device *dev)
2737{ 2737{
2738 struct gem *gp = dev->priv; 2738 struct gem *gp = netdev_priv(dev);
2739 return gp->msg_enable; 2739 return gp->msg_enable;
2740} 2740}
2741 2741
2742static void gem_set_msglevel(struct net_device *dev, u32 value) 2742static void gem_set_msglevel(struct net_device *dev, u32 value)
2743{ 2743{
2744 struct gem *gp = dev->priv; 2744 struct gem *gp = netdev_priv(dev);
2745 gp->msg_enable = value; 2745 gp->msg_enable = value;
2746} 2746}
2747 2747
@@ -2753,7 +2753,7 @@ static void gem_set_msglevel(struct net_device *dev, u32 value)
2753 2753
2754static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2754static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2755{ 2755{
2756 struct gem *gp = dev->priv; 2756 struct gem *gp = netdev_priv(dev);
2757 2757
2758 /* Add more when I understand how to program the chip */ 2758 /* Add more when I understand how to program the chip */
2759 if (gp->has_wol) { 2759 if (gp->has_wol) {
@@ -2767,7 +2767,7 @@ static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2767 2767
2768static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 2768static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
2769{ 2769{
2770 struct gem *gp = dev->priv; 2770 struct gem *gp = netdev_priv(dev);
2771 2771
2772 if (!gp->has_wol) 2772 if (!gp->has_wol)
2773 return -EOPNOTSUPP; 2773 return -EOPNOTSUPP;
@@ -2789,7 +2789,7 @@ static const struct ethtool_ops gem_ethtool_ops = {
2789 2789
2790static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 2790static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2791{ 2791{
2792 struct gem *gp = dev->priv; 2792 struct gem *gp = netdev_priv(dev);
2793 struct mii_ioctl_data *data = if_mii(ifr); 2793 struct mii_ioctl_data *data = if_mii(ifr);
2794 int rc = -EOPNOTSUPP; 2794 int rc = -EOPNOTSUPP;
2795 unsigned long flags; 2795 unsigned long flags;
@@ -2921,7 +2921,7 @@ static void gem_remove_one(struct pci_dev *pdev)
2921 struct net_device *dev = pci_get_drvdata(pdev); 2921 struct net_device *dev = pci_get_drvdata(pdev);
2922 2922
2923 if (dev) { 2923 if (dev) {
2924 struct gem *gp = dev->priv; 2924 struct gem *gp = netdev_priv(dev);
2925 2925
2926 unregister_netdev(dev); 2926 unregister_netdev(dev);
2927 2927
@@ -3024,7 +3024,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3024 } 3024 }
3025 SET_NETDEV_DEV(dev, &pdev->dev); 3025 SET_NETDEV_DEV(dev, &pdev->dev);
3026 3026
3027 gp = dev->priv; 3027 gp = netdev_priv(dev);
3028 3028
3029 err = pci_request_regions(pdev, DRV_NAME); 3029 err = pci_request_regions(pdev, DRV_NAME);
3030 if (err) { 3030 if (err) {
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index e55db660f763..b22d3355fb45 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2130,7 +2130,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
2130 2130
2131 for (i = 0; i < 4; i++) { 2131 for (i = 0; i < 4; i++) {
2132 struct net_device *dev = qp->happy_meals[i]; 2132 struct net_device *dev = qp->happy_meals[i];
2133 struct happy_meal *hp = dev->priv; 2133 struct happy_meal *hp = netdev_priv(dev);
2134 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); 2134 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
2135 2135
2136 HMD(("quattro_interrupt: status=%08x ", happy_status)); 2136 HMD(("quattro_interrupt: status=%08x ", happy_status));
@@ -2175,7 +2175,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
2175 2175
2176static int happy_meal_open(struct net_device *dev) 2176static int happy_meal_open(struct net_device *dev)
2177{ 2177{
2178 struct happy_meal *hp = dev->priv; 2178 struct happy_meal *hp = netdev_priv(dev);
2179 int res; 2179 int res;
2180 2180
2181 HMD(("happy_meal_open: ")); 2181 HMD(("happy_meal_open: "));
@@ -2207,7 +2207,7 @@ static int happy_meal_open(struct net_device *dev)
2207 2207
2208static int happy_meal_close(struct net_device *dev) 2208static int happy_meal_close(struct net_device *dev)
2209{ 2209{
2210 struct happy_meal *hp = dev->priv; 2210 struct happy_meal *hp = netdev_priv(dev);
2211 2211
2212 spin_lock_irq(&hp->happy_lock); 2212 spin_lock_irq(&hp->happy_lock);
2213 happy_meal_stop(hp, hp->gregs); 2213 happy_meal_stop(hp, hp->gregs);
@@ -2236,7 +2236,7 @@ static int happy_meal_close(struct net_device *dev)
2236 2236
2237static void happy_meal_tx_timeout(struct net_device *dev) 2237static void happy_meal_tx_timeout(struct net_device *dev)
2238{ 2238{
2239 struct happy_meal *hp = dev->priv; 2239 struct happy_meal *hp = netdev_priv(dev);
2240 2240
2241 printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); 2241 printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
2242 tx_dump_log(); 2242 tx_dump_log();
@@ -2254,7 +2254,7 @@ static void happy_meal_tx_timeout(struct net_device *dev)
2254 2254
2255static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev) 2255static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
2256{ 2256{
2257 struct happy_meal *hp = dev->priv; 2257 struct happy_meal *hp = netdev_priv(dev);
2258 int entry; 2258 int entry;
2259 u32 tx_flags; 2259 u32 tx_flags;
2260 2260
@@ -2343,7 +2343,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
2343 2343
2344static struct net_device_stats *happy_meal_get_stats(struct net_device *dev) 2344static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)
2345{ 2345{
2346 struct happy_meal *hp = dev->priv; 2346 struct happy_meal *hp = netdev_priv(dev);
2347 2347
2348 spin_lock_irq(&hp->happy_lock); 2348 spin_lock_irq(&hp->happy_lock);
2349 happy_meal_get_counters(hp, hp->bigmacregs); 2349 happy_meal_get_counters(hp, hp->bigmacregs);
@@ -2354,7 +2354,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)
2354 2354
2355static void happy_meal_set_multicast(struct net_device *dev) 2355static void happy_meal_set_multicast(struct net_device *dev)
2356{ 2356{
2357 struct happy_meal *hp = dev->priv; 2357 struct happy_meal *hp = netdev_priv(dev);
2358 void __iomem *bregs = hp->bigmacregs; 2358 void __iomem *bregs = hp->bigmacregs;
2359 struct dev_mc_list *dmi = dev->mc_list; 2359 struct dev_mc_list *dmi = dev->mc_list;
2360 char *addrs; 2360 char *addrs;
@@ -2400,7 +2400,7 @@ static void happy_meal_set_multicast(struct net_device *dev)
2400/* Ethtool support... */ 2400/* Ethtool support... */
2401static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2401static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2402{ 2402{
2403 struct happy_meal *hp = dev->priv; 2403 struct happy_meal *hp = netdev_priv(dev);
2404 2404
2405 cmd->supported = 2405 cmd->supported =
2406 (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | 2406 (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
@@ -2445,7 +2445,7 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2445 2445
2446static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) 2446static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2447{ 2447{
2448 struct happy_meal *hp = dev->priv; 2448 struct happy_meal *hp = netdev_priv(dev);
2449 2449
2450 /* Verify the settings we care about. */ 2450 /* Verify the settings we care about. */
2451 if (cmd->autoneg != AUTONEG_ENABLE && 2451 if (cmd->autoneg != AUTONEG_ENABLE &&
@@ -2469,7 +2469,7 @@ static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
2469 2469
2470static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 2470static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
2471{ 2471{
2472 struct happy_meal *hp = dev->priv; 2472 struct happy_meal *hp = netdev_priv(dev);
2473 2473
2474 strcpy(info->driver, "sunhme"); 2474 strcpy(info->driver, "sunhme");
2475 strcpy(info->version, "2.02"); 2475 strcpy(info->version, "2.02");
@@ -2491,7 +2491,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
2491 2491
2492static u32 hme_get_link(struct net_device *dev) 2492static u32 hme_get_link(struct net_device *dev)
2493{ 2493{
2494 struct happy_meal *hp = dev->priv; 2494 struct happy_meal *hp = netdev_priv(dev);
2495 2495
2496 spin_lock_irq(&hp->happy_lock); 2496 spin_lock_irq(&hp->happy_lock);
2497 hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); 2497 hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR);
@@ -2970,7 +2970,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
2970 2970
2971 dev->base_addr = (long) pdev; 2971 dev->base_addr = (long) pdev;
2972 2972
2973 hp = (struct happy_meal *)dev->priv; 2973 hp = netdev_priv(dev);
2974 memset(hp, 0, sizeof(*hp)); 2974 memset(hp, 0, sizeof(*hp));
2975 2975
2976 hp->happy_dev = pdev; 2976 hp->happy_dev = pdev;
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 8f1e7ffb4f2a..6e8f377355fe 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -512,7 +512,7 @@ static irqreturn_t qec_interrupt(int irq, void *dev_id)
512 512
513static int qe_open(struct net_device *dev) 513static int qe_open(struct net_device *dev)
514{ 514{
515 struct sunqe *qep = (struct sunqe *) dev->priv; 515 struct sunqe *qep = netdev_priv(dev);
516 516
517 qep->mconfig = (MREGS_MCONFIG_TXENAB | 517 qep->mconfig = (MREGS_MCONFIG_TXENAB |
518 MREGS_MCONFIG_RXENAB | 518 MREGS_MCONFIG_RXENAB |
@@ -522,7 +522,7 @@ static int qe_open(struct net_device *dev)
522 522
523static int qe_close(struct net_device *dev) 523static int qe_close(struct net_device *dev)
524{ 524{
525 struct sunqe *qep = (struct sunqe *) dev->priv; 525 struct sunqe *qep = netdev_priv(dev);
526 526
527 qe_stop(qep); 527 qe_stop(qep);
528 return 0; 528 return 0;
@@ -548,7 +548,7 @@ static void qe_tx_reclaim(struct sunqe *qep)
548 548
549static void qe_tx_timeout(struct net_device *dev) 549static void qe_tx_timeout(struct net_device *dev)
550{ 550{
551 struct sunqe *qep = (struct sunqe *) dev->priv; 551 struct sunqe *qep = netdev_priv(dev);
552 int tx_full; 552 int tx_full;
553 553
554 spin_lock_irq(&qep->lock); 554 spin_lock_irq(&qep->lock);
@@ -574,7 +574,7 @@ out:
574/* Get a packet queued to go onto the wire. */ 574/* Get a packet queued to go onto the wire. */
575static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) 575static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
576{ 576{
577 struct sunqe *qep = (struct sunqe *) dev->priv; 577 struct sunqe *qep = netdev_priv(dev);
578 struct sunqe_buffers *qbufs = qep->buffers; 578 struct sunqe_buffers *qbufs = qep->buffers;
579 __u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma; 579 __u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma;
580 unsigned char *txbuf; 580 unsigned char *txbuf;
@@ -626,7 +626,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
626 626
627static void qe_set_multicast(struct net_device *dev) 627static void qe_set_multicast(struct net_device *dev)
628{ 628{
629 struct sunqe *qep = (struct sunqe *) dev->priv; 629 struct sunqe *qep = netdev_priv(dev);
630 struct dev_mc_list *dmi = dev->mc_list; 630 struct dev_mc_list *dmi = dev->mc_list;
631 u8 new_mconfig = qep->mconfig; 631 u8 new_mconfig = qep->mconfig;
632 char *addrs; 632 char *addrs;
@@ -692,7 +692,7 @@ static void qe_set_multicast(struct net_device *dev)
692static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 692static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
693{ 693{
694 const struct linux_prom_registers *regs; 694 const struct linux_prom_registers *regs;
695 struct sunqe *qep = dev->priv; 695 struct sunqe *qep = netdev_priv(dev);
696 struct of_device *op; 696 struct of_device *op;
697 697
698 strcpy(info->driver, "sunqe"); 698 strcpy(info->driver, "sunqe");
@@ -707,7 +707,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
707 707
708static u32 qe_get_link(struct net_device *dev) 708static u32 qe_get_link(struct net_device *dev)
709{ 709{
710 struct sunqe *qep = dev->priv; 710 struct sunqe *qep = netdev_priv(dev);
711 void __iomem *mregs = qep->mregs; 711 void __iomem *mregs = qep->mregs;
712 u8 phyconfig; 712 u8 phyconfig;
713 713
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 30d5065f8166..7e36a10423f9 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -251,7 +251,7 @@ static void bdx_isr_extra(struct bdx_priv *priv, u32 isr)
251static irqreturn_t bdx_isr_napi(int irq, void *dev) 251static irqreturn_t bdx_isr_napi(int irq, void *dev)
252{ 252{
253 struct net_device *ndev = dev; 253 struct net_device *ndev = dev;
254 struct bdx_priv *priv = ndev->priv; 254 struct bdx_priv *priv = netdev_priv(ndev);
255 u32 isr; 255 u32 isr;
256 256
257 ENTER; 257 ENTER;
@@ -559,7 +559,7 @@ static int bdx_close(struct net_device *ndev)
559 struct bdx_priv *priv = NULL; 559 struct bdx_priv *priv = NULL;
560 560
561 ENTER; 561 ENTER;
562 priv = ndev->priv; 562 priv = netdev_priv(ndev);
563 563
564 napi_disable(&priv->napi); 564 napi_disable(&priv->napi);
565 565
@@ -588,7 +588,7 @@ static int bdx_open(struct net_device *ndev)
588 int rc; 588 int rc;
589 589
590 ENTER; 590 ENTER;
591 priv = ndev->priv; 591 priv = netdev_priv(ndev);
592 bdx_reset(priv); 592 bdx_reset(priv);
593 if (netif_running(ndev)) 593 if (netif_running(ndev))
594 netif_stop_queue(priv->ndev); 594 netif_stop_queue(priv->ndev);
@@ -633,7 +633,7 @@ static int bdx_range_check(struct bdx_priv *priv, u32 offset)
633 633
634static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) 634static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
635{ 635{
636 struct bdx_priv *priv = ndev->priv; 636 struct bdx_priv *priv = netdev_priv(ndev);
637 u32 data[3]; 637 u32 data[3];
638 int error; 638 int error;
639 639
@@ -698,7 +698,7 @@ static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
698 */ 698 */
699static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable) 699static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable)
700{ 700{
701 struct bdx_priv *priv = ndev->priv; 701 struct bdx_priv *priv = netdev_priv(ndev);
702 u32 reg, bit, val; 702 u32 reg, bit, val;
703 703
704 ENTER; 704 ENTER;
@@ -748,7 +748,7 @@ static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)
748static void 748static void
749bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp) 749bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp)
750{ 750{
751 struct bdx_priv *priv = ndev->priv; 751 struct bdx_priv *priv = netdev_priv(ndev);
752 752
753 ENTER; 753 ENTER;
754 DBG("device='%s', group='%p'\n", ndev->name, grp); 754 DBG("device='%s', group='%p'\n", ndev->name, grp);
@@ -787,7 +787,7 @@ static int bdx_change_mtu(struct net_device *ndev, int new_mtu)
787 787
788static void bdx_setmulti(struct net_device *ndev) 788static void bdx_setmulti(struct net_device *ndev)
789{ 789{
790 struct bdx_priv *priv = ndev->priv; 790 struct bdx_priv *priv = netdev_priv(ndev);
791 791
792 u32 rxf_val = 792 u32 rxf_val =
793 GMAC_RX_FILTER_AM | GMAC_RX_FILTER_AB | GMAC_RX_FILTER_OSEN; 793 GMAC_RX_FILTER_AM | GMAC_RX_FILTER_AB | GMAC_RX_FILTER_OSEN;
@@ -847,7 +847,7 @@ static void bdx_setmulti(struct net_device *ndev)
847 847
848static int bdx_set_mac(struct net_device *ndev, void *p) 848static int bdx_set_mac(struct net_device *ndev, void *p)
849{ 849{
850 struct bdx_priv *priv = ndev->priv; 850 struct bdx_priv *priv = netdev_priv(ndev);
851 struct sockaddr *addr = p; 851 struct sockaddr *addr = p;
852 852
853 ENTER; 853 ENTER;
@@ -929,7 +929,7 @@ static void bdx_update_stats(struct bdx_priv *priv)
929 929
930static struct net_device_stats *bdx_get_stats(struct net_device *ndev) 930static struct net_device_stats *bdx_get_stats(struct net_device *ndev)
931{ 931{
932 struct bdx_priv *priv = ndev->priv; 932 struct bdx_priv *priv = netdev_priv(ndev);
933 struct net_device_stats *net_stat = &priv->net_stats; 933 struct net_device_stats *net_stat = &priv->net_stats;
934 return net_stat; 934 return net_stat;
935} 935}
@@ -1623,7 +1623,7 @@ static inline int bdx_tx_space(struct bdx_priv *priv)
1623 */ 1623 */
1624static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev) 1624static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev)
1625{ 1625{
1626 struct bdx_priv *priv = ndev->priv; 1626 struct bdx_priv *priv = netdev_priv(ndev);
1627 struct txd_fifo *f = &priv->txd_fifo0; 1627 struct txd_fifo *f = &priv->txd_fifo0;
1628 int txd_checksum = 7; /* full checksum */ 1628 int txd_checksum = 7; /* full checksum */
1629 int txd_lgsnd = 0; 1629 int txd_lgsnd = 0;
@@ -2026,7 +2026,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2026 ndev->features |= NETIF_F_HIGHDMA; 2026 ndev->features |= NETIF_F_HIGHDMA;
2027 2027
2028 /************** priv ****************/ 2028 /************** priv ****************/
2029 priv = nic->priv[port] = ndev->priv; 2029 priv = nic->priv[port] = netdev_priv(ndev);
2030 2030
2031 memset(priv, 0, sizeof(struct bdx_priv)); 2031 memset(priv, 0, sizeof(struct bdx_priv));
2032 priv->pBdxRegs = nic->regs + port * 0x8000; 2032 priv->pBdxRegs = nic->regs + port * 0x8000;
@@ -2149,7 +2149,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
2149{ 2149{
2150 u32 rdintcm; 2150 u32 rdintcm;
2151 u32 tdintcm; 2151 u32 tdintcm;
2152 struct bdx_priv *priv = netdev->priv; 2152 struct bdx_priv *priv = netdev_priv(netdev);
2153 2153
2154 rdintcm = priv->rdintcm; 2154 rdintcm = priv->rdintcm;
2155 tdintcm = priv->tdintcm; 2155 tdintcm = priv->tdintcm;
@@ -2180,7 +2180,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
2180static void 2180static void
2181bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) 2181bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
2182{ 2182{
2183 struct bdx_priv *priv = netdev->priv; 2183 struct bdx_priv *priv = netdev_priv(netdev);
2184 2184
2185 strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver)); 2185 strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
2186 strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version)); 2186 strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
@@ -2222,7 +2222,7 @@ bdx_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal)
2222{ 2222{
2223 u32 rdintcm; 2223 u32 rdintcm;
2224 u32 tdintcm; 2224 u32 tdintcm;
2225 struct bdx_priv *priv = netdev->priv; 2225 struct bdx_priv *priv = netdev_priv(netdev);
2226 2226
2227 rdintcm = priv->rdintcm; 2227 rdintcm = priv->rdintcm;
2228 tdintcm = priv->tdintcm; 2228 tdintcm = priv->tdintcm;
@@ -2251,7 +2251,7 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal)
2251{ 2251{
2252 u32 rdintcm; 2252 u32 rdintcm;
2253 u32 tdintcm; 2253 u32 tdintcm;
2254 struct bdx_priv *priv = netdev->priv; 2254 struct bdx_priv *priv = netdev_priv(netdev);
2255 int rx_coal; 2255 int rx_coal;
2256 int tx_coal; 2256 int tx_coal;
2257 int rx_max_coal; 2257 int rx_max_coal;
@@ -2309,7 +2309,7 @@ static inline int bdx_tx_fifo_size_to_packets(int tx_size)
2309static void 2309static void
2310bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) 2310bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
2311{ 2311{
2312 struct bdx_priv *priv = netdev->priv; 2312 struct bdx_priv *priv = netdev_priv(netdev);
2313 2313
2314 /*max_pending - the maximum-sized FIFO we allow */ 2314 /*max_pending - the maximum-sized FIFO we allow */
2315 ring->rx_max_pending = bdx_rx_fifo_size_to_packets(3); 2315 ring->rx_max_pending = bdx_rx_fifo_size_to_packets(3);
@@ -2326,7 +2326,7 @@ bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
2326static int 2326static int
2327bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) 2327bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
2328{ 2328{
2329 struct bdx_priv *priv = netdev->priv; 2329 struct bdx_priv *priv = netdev_priv(netdev);
2330 int rx_size = 0; 2330 int rx_size = 0;
2331 int tx_size = 0; 2331 int tx_size = 0;
2332 2332
@@ -2387,7 +2387,7 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
2387 */ 2387 */
2388static int bdx_get_stats_count(struct net_device *netdev) 2388static int bdx_get_stats_count(struct net_device *netdev)
2389{ 2389{
2390 struct bdx_priv *priv = netdev->priv; 2390 struct bdx_priv *priv = netdev_priv(netdev);
2391 BDX_ASSERT(ARRAY_SIZE(bdx_stat_names) 2391 BDX_ASSERT(ARRAY_SIZE(bdx_stat_names)
2392 != sizeof(struct bdx_stats) / sizeof(u64)); 2392 != sizeof(struct bdx_stats) / sizeof(u64));
2393 return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0); 2393 return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
@@ -2402,7 +2402,7 @@ static int bdx_get_stats_count(struct net_device *netdev)
2402static void bdx_get_ethtool_stats(struct net_device *netdev, 2402static void bdx_get_ethtool_stats(struct net_device *netdev,
2403 struct ethtool_stats *stats, u64 *data) 2403 struct ethtool_stats *stats, u64 *data)
2404{ 2404{
2405 struct bdx_priv *priv = netdev->priv; 2405 struct bdx_priv *priv = netdev_priv(netdev);
2406 2406
2407 if (priv->stats_flag) { 2407 if (priv->stats_flag) {
2408 2408
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index b408397c83e7..5be34c2fd483 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -180,10 +180,14 @@ void tms380tr_wait(unsigned long time);
180static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status); 180static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status);
181static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status); 181static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status);
182 182
183#define SIFREADB(reg) (((struct net_local *)dev->priv)->sifreadb(dev, reg)) 183#define SIFREADB(reg) \
184#define SIFWRITEB(val, reg) (((struct net_local *)dev->priv)->sifwriteb(dev, val, reg)) 184 (((struct net_local *)netdev_priv(dev))->sifreadb(dev, reg))
185#define SIFREADW(reg) (((struct net_local *)dev->priv)->sifreadw(dev, reg)) 185#define SIFWRITEB(val, reg) \
186#define SIFWRITEW(val, reg) (((struct net_local *)dev->priv)->sifwritew(dev, val, reg)) 186 (((struct net_local *)netdev_priv(dev))->sifwriteb(dev, val, reg))
187#define SIFREADW(reg) \
188 (((struct net_local *)netdev_priv(dev))->sifreadw(dev, reg))
189#define SIFWRITEW(val, reg) \
190 (((struct net_local *)netdev_priv(dev))->sifwritew(dev, val, reg))
187 191
188 192
189 193
@@ -2330,7 +2334,7 @@ int tmsdev_init(struct net_device *dev, struct device *pdev)
2330{ 2334{
2331 struct net_local *tms_local; 2335 struct net_local *tms_local;
2332 2336
2333 memset(dev->priv, 0, sizeof(struct net_local)); 2337 memset(netdev_priv(dev), 0, sizeof(struct net_local));
2334 tms_local = netdev_priv(dev); 2338 tms_local = netdev_priv(dev);
2335 init_waitqueue_head(&tms_local->wait_for_tok_int); 2339 init_waitqueue_head(&tms_local->wait_for_tok_int);
2336 if (pdev->dma_mask) 2340 if (pdev->dma_mask)
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index e23a5084c6ca..3aa60fad68c7 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -483,7 +483,7 @@ rx_next:
483static irqreturn_t de_interrupt (int irq, void *dev_instance) 483static irqreturn_t de_interrupt (int irq, void *dev_instance)
484{ 484{
485 struct net_device *dev = dev_instance; 485 struct net_device *dev = dev_instance;
486 struct de_private *de = dev->priv; 486 struct de_private *de = netdev_priv(dev);
487 u32 status; 487 u32 status;
488 488
489 status = dr32(MacStatus); 489 status = dr32(MacStatus);
@@ -589,7 +589,7 @@ next:
589 589
590static int de_start_xmit (struct sk_buff *skb, struct net_device *dev) 590static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
591{ 591{
592 struct de_private *de = dev->priv; 592 struct de_private *de = netdev_priv(dev);
593 unsigned int entry, tx_free; 593 unsigned int entry, tx_free;
594 u32 mapping, len, flags = FirstFrag | LastFrag; 594 u32 mapping, len, flags = FirstFrag | LastFrag;
595 struct de_desc *txd; 595 struct de_desc *txd;
@@ -652,7 +652,7 @@ static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
652 652
653static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) 653static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
654{ 654{
655 struct de_private *de = dev->priv; 655 struct de_private *de = netdev_priv(dev);
656 u16 hash_table[32]; 656 u16 hash_table[32];
657 struct dev_mc_list *mclist; 657 struct dev_mc_list *mclist;
658 int i; 658 int i;
@@ -683,7 +683,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
683 683
684static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) 684static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
685{ 685{
686 struct de_private *de = dev->priv; 686 struct de_private *de = netdev_priv(dev);
687 struct dev_mc_list *mclist; 687 struct dev_mc_list *mclist;
688 int i; 688 int i;
689 u16 *eaddrs; 689 u16 *eaddrs;
@@ -711,7 +711,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
711 711
712static void __de_set_rx_mode (struct net_device *dev) 712static void __de_set_rx_mode (struct net_device *dev)
713{ 713{
714 struct de_private *de = dev->priv; 714 struct de_private *de = netdev_priv(dev);
715 u32 macmode; 715 u32 macmode;
716 unsigned int entry; 716 unsigned int entry;
717 u32 mapping; 717 u32 mapping;
@@ -796,7 +796,7 @@ out:
796static void de_set_rx_mode (struct net_device *dev) 796static void de_set_rx_mode (struct net_device *dev)
797{ 797{
798 unsigned long flags; 798 unsigned long flags;
799 struct de_private *de = dev->priv; 799 struct de_private *de = netdev_priv(dev);
800 800
801 spin_lock_irqsave (&de->lock, flags); 801 spin_lock_irqsave (&de->lock, flags);
802 __de_set_rx_mode(dev); 802 __de_set_rx_mode(dev);
@@ -820,7 +820,7 @@ static void __de_get_stats(struct de_private *de)
820 820
821static struct net_device_stats *de_get_stats(struct net_device *dev) 821static struct net_device_stats *de_get_stats(struct net_device *dev)
822{ 822{
823 struct de_private *de = dev->priv; 823 struct de_private *de = netdev_priv(dev);
824 824
825 /* The chip only need report frame silently dropped. */ 825 /* The chip only need report frame silently dropped. */
826 spin_lock_irq(&de->lock); 826 spin_lock_irq(&de->lock);
@@ -1354,7 +1354,7 @@ static void de_free_rings (struct de_private *de)
1354 1354
1355static int de_open (struct net_device *dev) 1355static int de_open (struct net_device *dev)
1356{ 1356{
1357 struct de_private *de = dev->priv; 1357 struct de_private *de = netdev_priv(dev);
1358 int rc; 1358 int rc;
1359 1359
1360 if (netif_msg_ifup(de)) 1360 if (netif_msg_ifup(de))
@@ -1399,7 +1399,7 @@ err_out_free:
1399 1399
1400static int de_close (struct net_device *dev) 1400static int de_close (struct net_device *dev)
1401{ 1401{
1402 struct de_private *de = dev->priv; 1402 struct de_private *de = netdev_priv(dev);
1403 unsigned long flags; 1403 unsigned long flags;
1404 1404
1405 if (netif_msg_ifdown(de)) 1405 if (netif_msg_ifdown(de))
@@ -1422,7 +1422,7 @@ static int de_close (struct net_device *dev)
1422 1422
1423static void de_tx_timeout (struct net_device *dev) 1423static void de_tx_timeout (struct net_device *dev)
1424{ 1424{
1425 struct de_private *de = dev->priv; 1425 struct de_private *de = netdev_priv(dev);
1426 1426
1427 printk(KERN_DEBUG "%s: NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", 1427 printk(KERN_DEBUG "%s: NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
1428 dev->name, dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), 1428 dev->name, dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
@@ -1573,7 +1573,7 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1573 1573
1574static void de_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) 1574static void de_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info)
1575{ 1575{
1576 struct de_private *de = dev->priv; 1576 struct de_private *de = netdev_priv(dev);
1577 1577
1578 strcpy (info->driver, DRV_NAME); 1578 strcpy (info->driver, DRV_NAME);
1579 strcpy (info->version, DRV_VERSION); 1579 strcpy (info->version, DRV_VERSION);
@@ -1588,7 +1588,7 @@ static int de_get_regs_len(struct net_device *dev)
1588 1588
1589static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) 1589static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1590{ 1590{
1591 struct de_private *de = dev->priv; 1591 struct de_private *de = netdev_priv(dev);
1592 int rc; 1592 int rc;
1593 1593
1594 spin_lock_irq(&de->lock); 1594 spin_lock_irq(&de->lock);
@@ -1600,7 +1600,7 @@ static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1600 1600
1601static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) 1601static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1602{ 1602{
1603 struct de_private *de = dev->priv; 1603 struct de_private *de = netdev_priv(dev);
1604 int rc; 1604 int rc;
1605 1605
1606 spin_lock_irq(&de->lock); 1606 spin_lock_irq(&de->lock);
@@ -1612,14 +1612,14 @@ static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1612 1612
1613static u32 de_get_msglevel(struct net_device *dev) 1613static u32 de_get_msglevel(struct net_device *dev)
1614{ 1614{
1615 struct de_private *de = dev->priv; 1615 struct de_private *de = netdev_priv(dev);
1616 1616
1617 return de->msg_enable; 1617 return de->msg_enable;
1618} 1618}
1619 1619
1620static void de_set_msglevel(struct net_device *dev, u32 msglvl) 1620static void de_set_msglevel(struct net_device *dev, u32 msglvl)
1621{ 1621{
1622 struct de_private *de = dev->priv; 1622 struct de_private *de = netdev_priv(dev);
1623 1623
1624 de->msg_enable = msglvl; 1624 de->msg_enable = msglvl;
1625} 1625}
@@ -1627,7 +1627,7 @@ static void de_set_msglevel(struct net_device *dev, u32 msglvl)
1627static int de_get_eeprom(struct net_device *dev, 1627static int de_get_eeprom(struct net_device *dev,
1628 struct ethtool_eeprom *eeprom, u8 *data) 1628 struct ethtool_eeprom *eeprom, u8 *data)
1629{ 1629{
1630 struct de_private *de = dev->priv; 1630 struct de_private *de = netdev_priv(dev);
1631 1631
1632 if (!de->ee_data) 1632 if (!de->ee_data)
1633 return -EOPNOTSUPP; 1633 return -EOPNOTSUPP;
@@ -1641,7 +1641,7 @@ static int de_get_eeprom(struct net_device *dev,
1641 1641
1642static int de_nway_reset(struct net_device *dev) 1642static int de_nway_reset(struct net_device *dev)
1643{ 1643{
1644 struct de_private *de = dev->priv; 1644 struct de_private *de = netdev_priv(dev);
1645 u32 status; 1645 u32 status;
1646 1646
1647 if (de->media_type != DE_MEDIA_TP_AUTO) 1647 if (de->media_type != DE_MEDIA_TP_AUTO)
@@ -1660,7 +1660,7 @@ static int de_nway_reset(struct net_device *dev)
1660static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs, 1660static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
1661 void *data) 1661 void *data)
1662{ 1662{
1663 struct de_private *de = dev->priv; 1663 struct de_private *de = netdev_priv(dev);
1664 1664
1665 regs->version = (DE_REGS_VER << 2) | de->de21040; 1665 regs->version = (DE_REGS_VER << 2) | de->de21040;
1666 1666
@@ -1954,7 +1954,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
1954 dev->tx_timeout = de_tx_timeout; 1954 dev->tx_timeout = de_tx_timeout;
1955 dev->watchdog_timeo = TX_TIMEOUT; 1955 dev->watchdog_timeo = TX_TIMEOUT;
1956 1956
1957 de = dev->priv; 1957 de = netdev_priv(dev);
1958 de->de21040 = ent->driver_data == 0 ? 1 : 0; 1958 de->de21040 = ent->driver_data == 0 ? 1 : 0;
1959 de->pdev = pdev; 1959 de->pdev = pdev;
1960 de->dev = dev; 1960 de->dev = dev;
@@ -2076,7 +2076,7 @@ err_out_free:
2076static void __devexit de_remove_one (struct pci_dev *pdev) 2076static void __devexit de_remove_one (struct pci_dev *pdev)
2077{ 2077{
2078 struct net_device *dev = pci_get_drvdata(pdev); 2078 struct net_device *dev = pci_get_drvdata(pdev);
2079 struct de_private *de = dev->priv; 2079 struct de_private *de = netdev_priv(dev);
2080 2080
2081 BUG_ON(!dev); 2081 BUG_ON(!dev);
2082 unregister_netdev(dev); 2082 unregister_netdev(dev);
@@ -2093,7 +2093,7 @@ static void __devexit de_remove_one (struct pci_dev *pdev)
2093static int de_suspend (struct pci_dev *pdev, pm_message_t state) 2093static int de_suspend (struct pci_dev *pdev, pm_message_t state)
2094{ 2094{
2095 struct net_device *dev = pci_get_drvdata (pdev); 2095 struct net_device *dev = pci_get_drvdata (pdev);
2096 struct de_private *de = dev->priv; 2096 struct de_private *de = netdev_priv(dev);
2097 2097
2098 rtnl_lock(); 2098 rtnl_lock();
2099 if (netif_running (dev)) { 2099 if (netif_running (dev)) {
@@ -2128,7 +2128,7 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
2128static int de_resume (struct pci_dev *pdev) 2128static int de_resume (struct pci_dev *pdev)
2129{ 2129{
2130 struct net_device *dev = pci_get_drvdata (pdev); 2130 struct net_device *dev = pci_get_drvdata (pdev);
2131 struct de_private *de = dev->priv; 2131 struct de_private *de = netdev_priv(dev);
2132 int retval = 0; 2132 int retval = 0;
2133 2133
2134 rtnl_lock(); 2134 rtnl_lock();
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 0dcced1263b9..391acd32a6a5 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -337,7 +337,7 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l
337{ 337{
338 int i; 338 int i;
339 unsigned retval = 0; 339 unsigned retval = 0;
340 struct tulip_private *tp = dev->priv; 340 struct tulip_private *tp = netdev_priv(dev);
341 void __iomem *ee_addr = tp->base_addr + CSR9; 341 void __iomem *ee_addr = tp->base_addr + CSR9;
342 int read_cmd = location | (EE_READ_CMD << addr_len); 342 int read_cmd = location | (EE_READ_CMD << addr_len);
343 343
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 35c57f6e630b..00cbc5251dcc 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -890,7 +890,7 @@ static struct net_device_stats * uli526x_get_stats(struct net_device *dev)
890 890
891static void uli526x_set_filter_mode(struct net_device * dev) 891static void uli526x_set_filter_mode(struct net_device * dev)
892{ 892{
893 struct uli526x_board_info *db = dev->priv; 893 struct uli526x_board_info *db = netdev_priv(dev);
894 unsigned long flags; 894 unsigned long flags;
895 895
896 ULI526X_DBUG(0, "uli526x_set_filter_mode()", 0); 896 ULI526X_DBUG(0, "uli526x_set_filter_mode()", 0);
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 876398724ba7..5386d9b73e6a 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -1797,7 +1797,7 @@ static irqreturn_t
1797typhoon_interrupt(int irq, void *dev_instance) 1797typhoon_interrupt(int irq, void *dev_instance)
1798{ 1798{
1799 struct net_device *dev = dev_instance; 1799 struct net_device *dev = dev_instance;
1800 struct typhoon *tp = dev->priv; 1800 struct typhoon *tp = netdev_priv(dev);
1801 void __iomem *ioaddr = tp->ioaddr; 1801 void __iomem *ioaddr = tp->ioaddr;
1802 u32 intr_status; 1802 u32 intr_status;
1803 1803
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index b5143509e8be..bbcc76ae3c9c 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -344,14 +344,14 @@ out:
344static int mcs7830_mdio_read(struct net_device *netdev, int phy_id, 344static int mcs7830_mdio_read(struct net_device *netdev, int phy_id,
345 int location) 345 int location)
346{ 346{
347 struct usbnet *dev = netdev->priv; 347 struct usbnet *dev = netdev_priv(netdev);
348 return mcs7830_read_phy(dev, location); 348 return mcs7830_read_phy(dev, location);
349} 349}
350 350
351static void mcs7830_mdio_write(struct net_device *netdev, int phy_id, 351static void mcs7830_mdio_write(struct net_device *netdev, int phy_id,
352 int location, int val) 352 int location, int val)
353{ 353{
354 struct usbnet *dev = netdev->priv; 354 struct usbnet *dev = netdev_priv(netdev);
355 mcs7830_write_phy(dev, location, val); 355 mcs7830_write_phy(dev, location, val);
356} 356}
357 357
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 68f908a57ac3..ede0a80045b3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -125,7 +125,8 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
125 unsigned int i; 125 unsigned int i;
126 126
127 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) 127 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
128 give_a_page(dev->priv, skb_shinfo(skb)->frags[i].page); 128 give_a_page(netdev_priv(dev),
129 skb_shinfo(skb)->frags[i].page);
129 skb->data_len = 0; 130 skb->data_len = 0;
130 skb_shinfo(skb)->nr_frags = 0; 131 skb_shinfo(skb)->nr_frags = 0;
131 } 132 }
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 5d13832978eb..a297e3efa05d 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -74,7 +74,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,
74 unsigned int hlen; 74 unsigned int hlen;
75 char *dest; 75 char *dest;
76 76
77 dlp = dev->priv; 77 dlp = netdev_priv(dev);
78 78
79 hdr.control = FRAD_I_UI; 79 hdr.control = FRAD_I_UI;
80 switch(type) 80 switch(type)
@@ -110,7 +110,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
110 struct frhdr *hdr; 110 struct frhdr *hdr;
111 int process, header; 111 int process, header;
112 112
113 dlp = dev->priv; 113 dlp = netdev_priv(dev);
114 if (!pskb_may_pull(skb, sizeof(*hdr))) { 114 if (!pskb_may_pull(skb, sizeof(*hdr))) {
115 printk(KERN_NOTICE "%s: invalid data no header\n", 115 printk(KERN_NOTICE "%s: invalid data no header\n",
116 dev->name); 116 dev->name);
@@ -196,7 +196,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
196 if (!skb || !dev) 196 if (!skb || !dev)
197 return(0); 197 return(0);
198 198
199 dlp = dev->priv; 199 dlp = netdev_priv(dev);
200 200
201 netif_stop_queue(dev); 201 netif_stop_queue(dev);
202 202
@@ -234,9 +234,9 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
234 struct frad_local *flp; 234 struct frad_local *flp;
235 int err; 235 int err;
236 236
237 dlp = dev->priv; 237 dlp = netdev_priv(dev);
238 238
239 flp = dlp->slave->priv; 239 flp = netdev_priv(dlp->slave);
240 240
241 if (!get) 241 if (!get)
242 { 242 {
@@ -268,7 +268,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
268 if (!capable(CAP_NET_ADMIN)) 268 if (!capable(CAP_NET_ADMIN))
269 return(-EPERM); 269 return(-EPERM);
270 270
271 dlp = dev->priv; 271 dlp = netdev_priv(dev);
272 272
273 switch(cmd) 273 switch(cmd)
274 { 274 {
@@ -297,7 +297,7 @@ static int dlci_change_mtu(struct net_device *dev, int new_mtu)
297{ 297{
298 struct dlci_local *dlp; 298 struct dlci_local *dlp;
299 299
300 dlp = dev->priv; 300 dlp = netdev_priv(dev);
301 301
302 return((*dlp->slave->change_mtu)(dlp->slave, new_mtu)); 302 return((*dlp->slave->change_mtu)(dlp->slave, new_mtu));
303} 303}
@@ -308,7 +308,7 @@ static int dlci_open(struct net_device *dev)
308 struct frad_local *flp; 308 struct frad_local *flp;
309 int err; 309 int err;
310 310
311 dlp = dev->priv; 311 dlp = netdev_priv(dev);
312 312
313 if (!*(short *)(dev->dev_addr)) 313 if (!*(short *)(dev->dev_addr))
314 return(-EINVAL); 314 return(-EINVAL);
@@ -316,7 +316,7 @@ static int dlci_open(struct net_device *dev)
316 if (!netif_running(dlp->slave)) 316 if (!netif_running(dlp->slave))
317 return(-ENOTCONN); 317 return(-ENOTCONN);
318 318
319 flp = dlp->slave->priv; 319 flp = netdev_priv(dlp->slave);
320 err = (*flp->activate)(dlp->slave, dev); 320 err = (*flp->activate)(dlp->slave, dev);
321 if (err) 321 if (err)
322 return(err); 322 return(err);
@@ -334,9 +334,9 @@ static int dlci_close(struct net_device *dev)
334 334
335 netif_stop_queue(dev); 335 netif_stop_queue(dev);
336 336
337 dlp = dev->priv; 337 dlp = netdev_priv(dev);
338 338
339 flp = dlp->slave->priv; 339 flp = netdev_priv(dlp->slave);
340 err = (*flp->deactivate)(dlp->slave, dev); 340 err = (*flp->deactivate)(dlp->slave, dev);
341 341
342 return 0; 342 return 0;
@@ -346,7 +346,7 @@ static struct net_device_stats *dlci_get_stats(struct net_device *dev)
346{ 346{
347 struct dlci_local *dlp; 347 struct dlci_local *dlp;
348 348
349 dlp = dev->priv; 349 dlp = netdev_priv(dev);
350 350
351 return(&dlp->stats); 351 return(&dlp->stats);
352} 352}
@@ -364,7 +364,7 @@ static int dlci_add(struct dlci_add *dlci)
364 if (!slave) 364 if (!slave)
365 return -ENODEV; 365 return -ENODEV;
366 366
367 if (slave->type != ARPHRD_FRAD || slave->priv == NULL) 367 if (slave->type != ARPHRD_FRAD || netdev_priv(slave) == NULL)
368 goto err1; 368 goto err1;
369 369
370 /* create device name */ 370 /* create device name */
@@ -390,11 +390,11 @@ static int dlci_add(struct dlci_add *dlci)
390 390
391 *(short *)(master->dev_addr) = dlci->dlci; 391 *(short *)(master->dev_addr) = dlci->dlci;
392 392
393 dlp = (struct dlci_local *) master->priv; 393 dlp = netdev_priv(master);
394 dlp->slave = slave; 394 dlp->slave = slave;
395 dlp->master = master; 395 dlp->master = master;
396 396
397 flp = slave->priv; 397 flp = netdev_priv(slave);
398 err = (*flp->assoc)(slave, master); 398 err = (*flp->assoc)(slave, master);
399 if (err < 0) 399 if (err < 0)
400 goto err2; 400 goto err2;
@@ -434,9 +434,9 @@ static int dlci_del(struct dlci_add *dlci)
434 return(-EBUSY); 434 return(-EBUSY);
435 } 435 }
436 436
437 dlp = master->priv; 437 dlp = netdev_priv(master);
438 slave = dlp->slave; 438 slave = dlp->slave;
439 flp = slave->priv; 439 flp = netdev_priv(slave);
440 440
441 rtnl_lock(); 441 rtnl_lock();
442 err = (*flp->deassoc)(slave, master); 442 err = (*flp->deassoc)(slave, master);
@@ -490,7 +490,7 @@ static const struct header_ops dlci_header_ops = {
490 490
491static void dlci_setup(struct net_device *dev) 491static void dlci_setup(struct net_device *dev)
492{ 492{
493 struct dlci_local *dlp = dev->priv; 493 struct dlci_local *dlp = netdev_priv(dev);
494 494
495 dev->flags = 0; 495 dev->flags = 0;
496 dev->open = dlci_open; 496 dev->open = dlci_open;
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 73e2f2780932..6a07ba9371db 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -185,7 +185,7 @@ static void sdla_stop(struct net_device *dev)
185{ 185{
186 struct frad_local *flp; 186 struct frad_local *flp;
187 187
188 flp = dev->priv; 188 flp = netdev_priv(dev);
189 switch(flp->type) 189 switch(flp->type)
190 { 190 {
191 case SDLA_S502A: 191 case SDLA_S502A:
@@ -212,7 +212,7 @@ static void sdla_start(struct net_device *dev)
212{ 212{
213 struct frad_local *flp; 213 struct frad_local *flp;
214 214
215 flp = dev->priv; 215 flp = netdev_priv(dev);
216 switch(flp->type) 216 switch(flp->type)
217 { 217 {
218 case SDLA_S502A: 218 case SDLA_S502A:
@@ -432,7 +432,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags,
432 int ret, waiting, len; 432 int ret, waiting, len;
433 long window; 433 long window;
434 434
435 flp = dev->priv; 435 flp = netdev_priv(dev);
436 window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF; 436 window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF;
437 cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK)); 437 cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK));
438 ret = 0; 438 ret = 0;
@@ -509,7 +509,7 @@ static int sdla_activate(struct net_device *slave, struct net_device *master)
509 struct frad_local *flp; 509 struct frad_local *flp;
510 int i; 510 int i;
511 511
512 flp = slave->priv; 512 flp = netdev_priv(slave);
513 513
514 for(i=0;i<CONFIG_DLCI_MAX;i++) 514 for(i=0;i<CONFIG_DLCI_MAX;i++)
515 if (flp->master[i] == master) 515 if (flp->master[i] == master)
@@ -531,7 +531,7 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master)
531 struct frad_local *flp; 531 struct frad_local *flp;
532 int i; 532 int i;
533 533
534 flp = slave->priv; 534 flp = netdev_priv(slave);
535 535
536 for(i=0;i<CONFIG_DLCI_MAX;i++) 536 for(i=0;i<CONFIG_DLCI_MAX;i++)
537 if (flp->master[i] == master) 537 if (flp->master[i] == master)
@@ -556,7 +556,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
556 if (master->type != ARPHRD_DLCI) 556 if (master->type != ARPHRD_DLCI)
557 return(-EINVAL); 557 return(-EINVAL);
558 558
559 flp = slave->priv; 559 flp = netdev_priv(slave);
560 560
561 for(i=0;i<CONFIG_DLCI_MAX;i++) 561 for(i=0;i<CONFIG_DLCI_MAX;i++)
562 { 562 {
@@ -589,7 +589,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master)
589 struct frad_local *flp; 589 struct frad_local *flp;
590 int i; 590 int i;
591 591
592 flp = slave->priv; 592 flp = netdev_priv(slave);
593 593
594 for(i=0;i<CONFIG_DLCI_MAX;i++) 594 for(i=0;i<CONFIG_DLCI_MAX;i++)
595 if (flp->master[i] == master) 595 if (flp->master[i] == master)
@@ -619,7 +619,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
619 int i; 619 int i;
620 short len, ret; 620 short len, ret;
621 621
622 flp = slave->priv; 622 flp = netdev_priv(slave);
623 623
624 for(i=0;i<CONFIG_DLCI_MAX;i++) 624 for(i=0;i<CONFIG_DLCI_MAX;i++)
625 if (flp->master[i] == master) 625 if (flp->master[i] == master)
@@ -628,7 +628,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
628 if (i == CONFIG_DLCI_MAX) 628 if (i == CONFIG_DLCI_MAX)
629 return(-ENODEV); 629 return(-ENODEV);
630 630
631 dlp = master->priv; 631 dlp = netdev_priv(master);
632 632
633 ret = SDLA_RET_OK; 633 ret = SDLA_RET_OK;
634 len = sizeof(struct dlci_conf); 634 len = sizeof(struct dlci_conf);
@@ -659,7 +659,7 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev)
659 unsigned long flags; 659 unsigned long flags;
660 struct buf_entry *pbuf; 660 struct buf_entry *pbuf;
661 661
662 flp = dev->priv; 662 flp = netdev_priv(dev);
663 ret = 0; 663 ret = 0;
664 accept = 1; 664 accept = 1;
665 665
@@ -755,7 +755,7 @@ static void sdla_receive(struct net_device *dev)
755 int i=0, received, success, addr, buf_base, buf_top; 755 int i=0, received, success, addr, buf_base, buf_top;
756 short dlci, len, len2, split; 756 short dlci, len, len2, split;
757 757
758 flp = dev->priv; 758 flp = netdev_priv(dev);
759 success = 1; 759 success = 1;
760 received = addr = buf_top = buf_base = 0; 760 received = addr = buf_top = buf_base = 0;
761 len = dlci = 0; 761 len = dlci = 0;
@@ -860,7 +860,7 @@ static void sdla_receive(struct net_device *dev)
860 if (success) 860 if (success)
861 { 861 {
862 flp->stats.rx_packets++; 862 flp->stats.rx_packets++;
863 dlp = master->priv; 863 dlp = netdev_priv(master);
864 (*dlp->receive)(skb, master); 864 (*dlp->receive)(skb, master);
865 } 865 }
866 866
@@ -925,7 +925,7 @@ static void sdla_poll(unsigned long device)
925 struct frad_local *flp; 925 struct frad_local *flp;
926 926
927 dev = (struct net_device *) device; 927 dev = (struct net_device *) device;
928 flp = dev->priv; 928 flp = netdev_priv(dev);
929 929
930 if (sdla_byte(dev, SDLA_502_RCV_BUF)) 930 if (sdla_byte(dev, SDLA_502_RCV_BUF))
931 sdla_receive(dev); 931 sdla_receive(dev);
@@ -941,7 +941,7 @@ static int sdla_close(struct net_device *dev)
941 int len, i; 941 int len, i;
942 short dlcis[CONFIG_DLCI_MAX]; 942 short dlcis[CONFIG_DLCI_MAX];
943 943
944 flp = dev->priv; 944 flp = netdev_priv(dev);
945 945
946 len = 0; 946 len = 0;
947 for(i=0;i<CONFIG_DLCI_MAX;i++) 947 for(i=0;i<CONFIG_DLCI_MAX;i++)
@@ -1002,7 +1002,7 @@ static int sdla_open(struct net_device *dev)
1002 int len, i; 1002 int len, i;
1003 char byte; 1003 char byte;
1004 1004
1005 flp = dev->priv; 1005 flp = netdev_priv(dev);
1006 1006
1007 if (!flp->initialized) 1007 if (!flp->initialized)
1008 return(-EPERM); 1008 return(-EPERM);
@@ -1079,7 +1079,7 @@ static int sdla_open(struct net_device *dev)
1079 for(i=0;i<CONFIG_DLCI_MAX;i++) 1079 for(i=0;i<CONFIG_DLCI_MAX;i++)
1080 if (flp->dlci[i]) 1080 if (flp->dlci[i])
1081 { 1081 {
1082 dlp = flp->master[i]->priv; 1082 dlp = netdev_priv(flp->master[i]);
1083 if (dlp->configured) 1083 if (dlp->configured)
1084 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL); 1084 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL);
1085 } 1085 }
@@ -1099,7 +1099,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
1099 if (dev->type == 0xFFFF) 1099 if (dev->type == 0xFFFF)
1100 return(-EUNATCH); 1100 return(-EUNATCH);
1101 1101
1102 flp = dev->priv; 1102 flp = netdev_priv(dev);
1103 1103
1104 if (!get) 1104 if (!get)
1105 { 1105 {
@@ -1230,7 +1230,7 @@ static int sdla_reconfig(struct net_device *dev)
1230 struct conf_data data; 1230 struct conf_data data;
1231 int i, len; 1231 int i, len;
1232 1232
1233 flp = dev->priv; 1233 flp = netdev_priv(dev);
1234 1234
1235 len = 0; 1235 len = 0;
1236 for(i=0;i<CONFIG_DLCI_MAX;i++) 1236 for(i=0;i<CONFIG_DLCI_MAX;i++)
@@ -1255,7 +1255,7 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1255 if(!capable(CAP_NET_ADMIN)) 1255 if(!capable(CAP_NET_ADMIN))
1256 return -EPERM; 1256 return -EPERM;
1257 1257
1258 flp = dev->priv; 1258 flp = netdev_priv(dev);
1259 1259
1260 if (!flp->initialized) 1260 if (!flp->initialized)
1261 return(-EINVAL); 1261 return(-EINVAL);
@@ -1321,7 +1321,7 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu)
1321{ 1321{
1322 struct frad_local *flp; 1322 struct frad_local *flp;
1323 1323
1324 flp = dev->priv; 1324 flp = netdev_priv(dev);
1325 1325
1326 if (netif_running(dev)) 1326 if (netif_running(dev))
1327 return(-EBUSY); 1327 return(-EBUSY);
@@ -1338,7 +1338,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
1338 unsigned base; 1338 unsigned base;
1339 int err = -EINVAL; 1339 int err = -EINVAL;
1340 1340
1341 flp = dev->priv; 1341 flp = netdev_priv(dev);
1342 1342
1343 if (flp->initialized) 1343 if (flp->initialized)
1344 return(-EINVAL); 1344 return(-EINVAL);
@@ -1593,14 +1593,14 @@ fail:
1593static struct net_device_stats *sdla_stats(struct net_device *dev) 1593static struct net_device_stats *sdla_stats(struct net_device *dev)
1594{ 1594{
1595 struct frad_local *flp; 1595 struct frad_local *flp;
1596 flp = dev->priv; 1596 flp = netdev_priv(dev);
1597 1597
1598 return(&flp->stats); 1598 return(&flp->stats);
1599} 1599}
1600 1600
1601static void setup_sdla(struct net_device *dev) 1601static void setup_sdla(struct net_device *dev)
1602{ 1602{
1603 struct frad_local *flp = dev->priv; 1603 struct frad_local *flp = netdev_priv(dev);
1604 1604
1605 netdev_boot_setup_check(dev); 1605 netdev_boot_setup_check(dev);
1606 1606
@@ -1651,7 +1651,7 @@ static int __init init_sdla(void)
1651 1651
1652static void __exit exit_sdla(void) 1652static void __exit exit_sdla(void)
1653{ 1653{
1654 struct frad_local *flp = sdla->priv; 1654 struct frad_local *flp = netdev_priv(sdla);
1655 1655
1656 unregister_netdev(sdla); 1656 unregister_netdev(sdla);
1657 if (flp->initialized) { 1657 if (flp->initialized) {
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 3b7bdfd25148..85d789147300 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void)
64 if (dev == NULL) 64 if (dev == NULL)
65 break; 65 break;
66 66
67 sl = dev->priv; 67 sl = netdev_priv(dev);
68 /* Not in use ? */ 68 /* Not in use ? */
69 if (!test_and_set_bit(SLF_INUSE, &sl->flags)) 69 if (!test_and_set_bit(SLF_INUSE, &sl->flags))
70 return sl; 70 return sl;
@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void)
86 return NULL; 86 return NULL;
87 87
88 /* Initialize channel control data */ 88 /* Initialize channel control data */
89 sl = dev->priv; 89 sl = netdev_priv(dev);
90 dev->base_addr = i; 90 dev->base_addr = i;
91 91
92 /* register device so that it can be ifconfig'ed */ 92 /* register device so that it can be ifconfig'ed */
@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl)
120 120
121static int x25_asy_change_mtu(struct net_device *dev, int newmtu) 121static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
122{ 122{
123 struct x25_asy *sl = dev->priv; 123 struct x25_asy *sl = netdev_priv(dev);
124 unsigned char *xbuff, *rbuff; 124 unsigned char *xbuff, *rbuff;
125 int len = 2 * newmtu; 125 int len = 2 * newmtu;
126 126
@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
279 279
280static void x25_asy_timeout(struct net_device *dev) 280static void x25_asy_timeout(struct net_device *dev)
281{ 281{
282 struct x25_asy *sl = dev->priv; 282 struct x25_asy *sl = netdev_priv(dev);
283 283
284 spin_lock(&sl->lock); 284 spin_lock(&sl->lock);
285 if (netif_queue_stopped(dev)) { 285 if (netif_queue_stopped(dev)) {
@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev)
300 300
301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) 301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev)
302{ 302{
303 struct x25_asy *sl = dev->priv; 303 struct x25_asy *sl = netdev_priv(dev);
304 int err; 304 int err;
305 305
306 if (!netif_running(sl->dev)) { 306 if (!netif_running(sl->dev)) {
@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
371 371
372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) 372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
373{ 373{
374 struct x25_asy *sl = dev->priv; 374 struct x25_asy *sl = netdev_priv(dev);
375 375
376 spin_lock(&sl->lock); 376 spin_lock(&sl->lock);
377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { 377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) {
@@ -396,7 +396,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
396 396
397static void x25_asy_connected(struct net_device *dev, int reason) 397static void x25_asy_connected(struct net_device *dev, int reason)
398{ 398{
399 struct x25_asy *sl = dev->priv; 399 struct x25_asy *sl = netdev_priv(dev);
400 struct sk_buff *skb; 400 struct sk_buff *skb;
401 unsigned char *ptr; 401 unsigned char *ptr;
402 402
@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
415 415
416static void x25_asy_disconnected(struct net_device *dev, int reason) 416static void x25_asy_disconnected(struct net_device *dev, int reason)
417{ 417{
418 struct x25_asy *sl = dev->priv; 418 struct x25_asy *sl = netdev_priv(dev);
419 struct sk_buff *skb; 419 struct sk_buff *skb;
420 unsigned char *ptr; 420 unsigned char *ptr;
421 421
@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = {
446/* Open the low-level part of the X.25 channel. Easy! */ 446/* Open the low-level part of the X.25 channel. Easy! */
447static int x25_asy_open(struct net_device *dev) 447static int x25_asy_open(struct net_device *dev)
448{ 448{
449 struct x25_asy *sl = dev->priv; 449 struct x25_asy *sl = netdev_priv(dev);
450 unsigned long len; 450 unsigned long len;
451 int err; 451 int err;
452 452
@@ -495,7 +495,7 @@ norbuff:
495/* Close the low-level part of the X.25 channel. Easy! */ 495/* Close the low-level part of the X.25 channel. Easy! */
496static int x25_asy_close(struct net_device *dev) 496static int x25_asy_close(struct net_device *dev)
497{ 497{
498 struct x25_asy *sl = dev->priv; 498 struct x25_asy *sl = netdev_priv(dev);
499 int err; 499 int err;
500 500
501 spin_lock(&sl->lock); 501 spin_lock(&sl->lock);
@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)
611 611
612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev) 612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev)
613{ 613{
614 struct x25_asy *sl = dev->priv; 614 struct x25_asy *sl = netdev_priv(dev);
615 return &sl->stats; 615 return &sl->stats;
616} 616}
617 617
@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
713 713
714static int x25_asy_open_dev(struct net_device *dev) 714static int x25_asy_open_dev(struct net_device *dev)
715{ 715{
716 struct x25_asy *sl = dev->priv; 716 struct x25_asy *sl = netdev_priv(dev);
717 if (sl->tty == NULL) 717 if (sl->tty == NULL)
718 return -ENODEV; 718 return -ENODEV;
719 return 0; 719 return 0;
@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev)
722/* Initialise the X.25 driver. Called by the device init code */ 722/* Initialise the X.25 driver. Called by the device init code */
723static void x25_asy_setup(struct net_device *dev) 723static void x25_asy_setup(struct net_device *dev)
724{ 724{
725 struct x25_asy *sl = dev->priv; 725 struct x25_asy *sl = netdev_priv(dev);
726 726
727 sl->magic = X25_ASY_MAGIC; 727 sl->magic = X25_ASY_MAGIC;
728 sl->dev = dev; 728 sl->dev = dev;
@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void)
789 for (i = 0; i < x25_asy_maxdev; i++) { 789 for (i = 0; i < x25_asy_maxdev; i++) {
790 dev = x25_asy_devs[i]; 790 dev = x25_asy_devs[i];
791 if (dev) { 791 if (dev) {
792 struct x25_asy *sl = dev->priv; 792 struct x25_asy *sl = netdev_priv(dev);
793 793
794 spin_lock_bh(&sl->lock); 794 spin_lock_bh(&sl->lock);
795 if (sl->tty) 795 if (sl->tty)
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 688d60de55cb..156f471217bb 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -23,7 +23,7 @@ static const char * mesh_stat_strings[]= {
23static void lbs_ethtool_get_drvinfo(struct net_device *dev, 23static void lbs_ethtool_get_drvinfo(struct net_device *dev,
24 struct ethtool_drvinfo *info) 24 struct ethtool_drvinfo *info)
25{ 25{
26 struct lbs_private *priv = (struct lbs_private *) dev->priv; 26 struct lbs_private *priv = netdev_priv(dev);
27 27
28 snprintf(info->fw_version, 32, "%u.%u.%u.p%u", 28 snprintf(info->fw_version, 32, "%u.%u.%u.p%u",
29 priv->fwrelease >> 24 & 0xff, 29 priv->fwrelease >> 24 & 0xff,
@@ -47,7 +47,7 @@ static int lbs_ethtool_get_eeprom_len(struct net_device *dev)
47static int lbs_ethtool_get_eeprom(struct net_device *dev, 47static int lbs_ethtool_get_eeprom(struct net_device *dev,
48 struct ethtool_eeprom *eeprom, u8 * bytes) 48 struct ethtool_eeprom *eeprom, u8 * bytes)
49{ 49{
50 struct lbs_private *priv = (struct lbs_private *) dev->priv; 50 struct lbs_private *priv = netdev_priv(dev);
51 struct cmd_ds_802_11_eeprom_access cmd; 51 struct cmd_ds_802_11_eeprom_access cmd;
52 int ret; 52 int ret;
53 53
@@ -76,7 +76,7 @@ out:
76static void lbs_ethtool_get_stats(struct net_device *dev, 76static void lbs_ethtool_get_stats(struct net_device *dev,
77 struct ethtool_stats *stats, uint64_t *data) 77 struct ethtool_stats *stats, uint64_t *data)
78{ 78{
79 struct lbs_private *priv = dev->priv; 79 struct lbs_private *priv = netdev_priv(dev);
80 struct cmd_ds_mesh_access mesh_access; 80 struct cmd_ds_mesh_access mesh_access;
81 int ret; 81 int ret;
82 82
@@ -113,7 +113,7 @@ static void lbs_ethtool_get_stats(struct net_device *dev,
113 113
114static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset) 114static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset)
115{ 115{
116 struct lbs_private *priv = dev->priv; 116 struct lbs_private *priv = netdev_priv(dev);
117 117
118 if (sset == ETH_SS_STATS && dev == priv->mesh_dev) 118 if (sset == ETH_SS_STATS && dev == priv->mesh_dev)
119 return MESH_STATS_NUM; 119 return MESH_STATS_NUM;
@@ -143,7 +143,7 @@ static void lbs_ethtool_get_strings(struct net_device *dev,
143static void lbs_ethtool_get_wol(struct net_device *dev, 143static void lbs_ethtool_get_wol(struct net_device *dev,
144 struct ethtool_wolinfo *wol) 144 struct ethtool_wolinfo *wol)
145{ 145{
146 struct lbs_private *priv = dev->priv; 146 struct lbs_private *priv = netdev_priv(dev);
147 147
148 if (priv->wol_criteria == 0xffffffff) { 148 if (priv->wol_criteria == 0xffffffff) {
149 /* Interface driver didn't configure wake */ 149 /* Interface driver didn't configure wake */
@@ -166,7 +166,7 @@ static void lbs_ethtool_get_wol(struct net_device *dev,
166static int lbs_ethtool_set_wol(struct net_device *dev, 166static int lbs_ethtool_set_wol(struct net_device *dev,
167 struct ethtool_wolinfo *wol) 167 struct ethtool_wolinfo *wol)
168{ 168{
169 struct lbs_private *priv = dev->priv; 169 struct lbs_private *priv = netdev_priv(dev);
170 uint32_t criteria = 0; 170 uint32_t criteria = 0;
171 171
172 if (priv->wol_criteria == 0xffffffff && wol->wolopts) 172 if (priv->wol_criteria == 0xffffffff && wol->wolopts)
diff --git a/drivers/net/wireless/libertas/persistcfg.c b/drivers/net/wireless/libertas/persistcfg.c
index 56e2401cc768..d42b7a5a1b3f 100644
--- a/drivers/net/wireless/libertas/persistcfg.c
+++ b/drivers/net/wireless/libertas/persistcfg.c
@@ -18,7 +18,7 @@
18static int mesh_get_default_parameters(struct device *dev, 18static int mesh_get_default_parameters(struct device *dev,
19 struct mrvl_mesh_defaults *defs) 19 struct mrvl_mesh_defaults *defs)
20{ 20{
21 struct lbs_private *priv = to_net_dev(dev)->priv; 21 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
22 struct cmd_ds_mesh_config cmd; 22 struct cmd_ds_mesh_config cmd;
23 int ret; 23 int ret;
24 24
@@ -57,7 +57,7 @@ static ssize_t bootflag_get(struct device *dev,
57static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr, 57static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
58 const char *buf, size_t count) 58 const char *buf, size_t count)
59{ 59{
60 struct lbs_private *priv = to_net_dev(dev)->priv; 60 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
61 struct cmd_ds_mesh_config cmd; 61 struct cmd_ds_mesh_config cmd;
62 uint32_t datum; 62 uint32_t datum;
63 int ret; 63 int ret;
@@ -100,7 +100,7 @@ static ssize_t boottime_get(struct device *dev,
100static ssize_t boottime_set(struct device *dev, 100static ssize_t boottime_set(struct device *dev,
101 struct device_attribute *attr, const char *buf, size_t count) 101 struct device_attribute *attr, const char *buf, size_t count)
102{ 102{
103 struct lbs_private *priv = to_net_dev(dev)->priv; 103 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
104 struct cmd_ds_mesh_config cmd; 104 struct cmd_ds_mesh_config cmd;
105 uint32_t datum; 105 uint32_t datum;
106 int ret; 106 int ret;
@@ -152,7 +152,7 @@ static ssize_t channel_get(struct device *dev,
152static ssize_t channel_set(struct device *dev, struct device_attribute *attr, 152static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
153 const char *buf, size_t count) 153 const char *buf, size_t count)
154{ 154{
155 struct lbs_private *priv = to_net_dev(dev)->priv; 155 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
156 struct cmd_ds_mesh_config cmd; 156 struct cmd_ds_mesh_config cmd;
157 uint32_t datum; 157 uint32_t datum;
158 int ret; 158 int ret;
@@ -210,7 +210,7 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,
210 struct cmd_ds_mesh_config cmd; 210 struct cmd_ds_mesh_config cmd;
211 struct mrvl_mesh_defaults defs; 211 struct mrvl_mesh_defaults defs;
212 struct mrvl_meshie *ie; 212 struct mrvl_meshie *ie;
213 struct lbs_private *priv = to_net_dev(dev)->priv; 213 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
214 int len; 214 int len;
215 int ret; 215 int ret;
216 216
@@ -269,7 +269,7 @@ static ssize_t protocol_id_set(struct device *dev,
269 struct cmd_ds_mesh_config cmd; 269 struct cmd_ds_mesh_config cmd;
270 struct mrvl_mesh_defaults defs; 270 struct mrvl_mesh_defaults defs;
271 struct mrvl_meshie *ie; 271 struct mrvl_meshie *ie;
272 struct lbs_private *priv = to_net_dev(dev)->priv; 272 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
273 uint32_t datum; 273 uint32_t datum;
274 int ret; 274 int ret;
275 275
@@ -323,7 +323,7 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,
323 struct cmd_ds_mesh_config cmd; 323 struct cmd_ds_mesh_config cmd;
324 struct mrvl_mesh_defaults defs; 324 struct mrvl_mesh_defaults defs;
325 struct mrvl_meshie *ie; 325 struct mrvl_meshie *ie;
326 struct lbs_private *priv = to_net_dev(dev)->priv; 326 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
327 uint32_t datum; 327 uint32_t datum;
328 int ret; 328 int ret;
329 329
@@ -377,7 +377,7 @@ static ssize_t capability_set(struct device *dev, struct device_attribute *attr,
377 struct cmd_ds_mesh_config cmd; 377 struct cmd_ds_mesh_config cmd;
378 struct mrvl_mesh_defaults defs; 378 struct mrvl_mesh_defaults defs;
379 struct mrvl_meshie *ie; 379 struct mrvl_meshie *ie;
380 struct lbs_private *priv = to_net_dev(dev)->priv; 380 struct lbs_private *priv = netdev_priv(to_net_dev(dev));
381 uint32_t datum; 381 uint32_t datum;
382 int ret; 382 int ret;
383 383
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 93f74763a010..57f6c12cda20 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -945,7 +945,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
945 union iwreq_data *wrqu, char *extra) 945 union iwreq_data *wrqu, char *extra)
946{ 946{
947 DECLARE_SSID_BUF(ssid); 947 DECLARE_SSID_BUF(ssid);
948 struct lbs_private *priv = dev->priv; 948 struct lbs_private *priv = netdev_priv(dev);
949 int ret = 0; 949 int ret = 0;
950 950
951 lbs_deb_enter(LBS_DEB_WEXT); 951 lbs_deb_enter(LBS_DEB_WEXT);
@@ -1008,7 +1008,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
1008 struct iw_point *dwrq, char *extra) 1008 struct iw_point *dwrq, char *extra)
1009{ 1009{
1010#define SCAN_ITEM_SIZE 128 1010#define SCAN_ITEM_SIZE 128
1011 struct lbs_private *priv = dev->priv; 1011 struct lbs_private *priv = netdev_priv(dev);
1012 int err = 0; 1012 int err = 0;
1013 char *ev = extra; 1013 char *ev = extra;
1014 char *stop = ev + dwrq->length; 1014 char *stop = ev + dwrq->length;
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index a4972fed2941..dac462641170 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -60,7 +60,7 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
60int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) 60int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
61{ 61{
62 unsigned long flags; 62 unsigned long flags;
63 struct lbs_private *priv = dev->priv; 63 struct lbs_private *priv = netdev_priv(dev);
64 struct txpd *txpd; 64 struct txpd *txpd;
65 char *p802x_hdr; 65 char *p802x_hdr;
66 uint16_t pkt_len; 66 uint16_t pkt_len;