Commit 8f15ea42 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

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: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4cf1653a
...@@ -656,7 +656,7 @@ static void timeout(struct net_device *dev) ...@@ -656,7 +656,7 @@ static void timeout(struct net_device *dev)
static void sgiseeq_set_multicast(struct net_device *dev) static void sgiseeq_set_multicast(struct net_device *dev)
{ {
struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv; struct sgiseeq_private *sp = netdev_priv(dev);
unsigned char oldmode = sp->mode; unsigned char oldmode = sp->mode;
if(dev->flags & IFF_PROMISC) if(dev->flags & IFF_PROMISC)
......
...@@ -436,7 +436,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, ...@@ -436,7 +436,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
if (ret) if (ret)
goto err_out; goto err_out;
sis_priv = net_dev->priv; sis_priv = netdev_priv(net_dev);
net_dev->base_addr = ioaddr; net_dev->base_addr = ioaddr;
net_dev->irq = pci_dev->irq; net_dev->irq = pci_dev->irq;
sis_priv->pci_dev = pci_dev; sis_priv->pci_dev = pci_dev;
...@@ -569,7 +569,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, ...@@ -569,7 +569,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
static int __devinit sis900_mii_probe(struct net_device * net_dev) static int __devinit sis900_mii_probe(struct net_device * net_dev)
{ {
struct sis900_private * sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
const char *dev_name = pci_name(sis_priv->pci_dev); const char *dev_name = pci_name(sis_priv->pci_dev);
u16 poll_bit = MII_STAT_LINK, status = 0; u16 poll_bit = MII_STAT_LINK, status = 0;
unsigned long timeout = jiffies + 5 * HZ; unsigned long timeout = jiffies + 5 * HZ;
...@@ -697,7 +697,7 @@ static int __devinit sis900_mii_probe(struct net_device * net_dev) ...@@ -697,7 +697,7 @@ static int __devinit sis900_mii_probe(struct net_device * net_dev)
static u16 sis900_default_phy(struct net_device * net_dev) static u16 sis900_default_phy(struct net_device * net_dev)
{ {
struct sis900_private * sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct mii_phy *phy = NULL, *phy_home = NULL, struct mii_phy *phy = NULL, *phy_home = NULL,
*default_phy = NULL, *phy_lan = NULL; *default_phy = NULL, *phy_lan = NULL;
u16 status; u16 status;
...@@ -998,7 +998,7 @@ static void sis900_poll(struct net_device *dev) ...@@ -998,7 +998,7 @@ static void sis900_poll(struct net_device *dev)
static int static int
sis900_open(struct net_device *net_dev) sis900_open(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
int ret; int ret;
...@@ -1054,7 +1054,7 @@ sis900_open(struct net_device *net_dev) ...@@ -1054,7 +1054,7 @@ sis900_open(struct net_device *net_dev)
static void static void
sis900_init_rxfilter (struct net_device * net_dev) sis900_init_rxfilter (struct net_device * net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
u32 rfcrSave; u32 rfcrSave;
u32 i; u32 i;
...@@ -1092,7 +1092,7 @@ sis900_init_rxfilter (struct net_device * net_dev) ...@@ -1092,7 +1092,7 @@ sis900_init_rxfilter (struct net_device * net_dev)
static void static void
sis900_init_tx_ring(struct net_device *net_dev) sis900_init_tx_ring(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
int i; int i;
...@@ -1126,7 +1126,7 @@ sis900_init_tx_ring(struct net_device *net_dev) ...@@ -1126,7 +1126,7 @@ sis900_init_tx_ring(struct net_device *net_dev)
static void static void
sis900_init_rx_ring(struct net_device *net_dev) sis900_init_rx_ring(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
int i; int i;
...@@ -1197,7 +1197,7 @@ sis900_init_rx_ring(struct net_device *net_dev) ...@@ -1197,7 +1197,7 @@ sis900_init_rx_ring(struct net_device *net_dev)
static void sis630_set_eq(struct net_device *net_dev, u8 revision) static void sis630_set_eq(struct net_device *net_dev, u8 revision)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
u16 reg14h, eq_value=0, max_value=0, min_value=0; u16 reg14h, eq_value=0, max_value=0, min_value=0;
int i, maxcount=10; int i, maxcount=10;
...@@ -1270,7 +1270,7 @@ static void sis630_set_eq(struct net_device *net_dev, u8 revision) ...@@ -1270,7 +1270,7 @@ static void sis630_set_eq(struct net_device *net_dev, u8 revision)
static void sis900_timer(unsigned long data) static void sis900_timer(unsigned long data)
{ {
struct net_device *net_dev = (struct net_device *)data; struct net_device *net_dev = (struct net_device *)data;
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct mii_phy *mii_phy = sis_priv->mii; struct mii_phy *mii_phy = sis_priv->mii;
static const int next_tick = 5*HZ; static const int next_tick = 5*HZ;
u16 status; u16 status;
...@@ -1340,7 +1340,7 @@ static void sis900_timer(unsigned long data) ...@@ -1340,7 +1340,7 @@ static void sis900_timer(unsigned long data)
static void sis900_check_mode(struct net_device *net_dev, struct mii_phy *mii_phy) static void sis900_check_mode(struct net_device *net_dev, struct mii_phy *mii_phy)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
int speed, duplex; int speed, duplex;
...@@ -1419,7 +1419,7 @@ static void sis900_set_mode (long ioaddr, int speed, int duplex) ...@@ -1419,7 +1419,7 @@ static void sis900_set_mode (long ioaddr, int speed, int duplex)
static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr) static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
int i = 0; int i = 0;
u32 status; u32 status;
...@@ -1454,7 +1454,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr) ...@@ -1454,7 +1454,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr)
static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex) static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct mii_phy *phy = sis_priv->mii; struct mii_phy *phy = sis_priv->mii;
int phy_addr = sis_priv->cur_phy; int phy_addr = sis_priv->cur_phy;
u32 status; u32 status;
...@@ -1509,7 +1509,7 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex ...@@ -1509,7 +1509,7 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex
static void sis900_tx_timeout(struct net_device *net_dev) static void sis900_tx_timeout(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
unsigned long flags; unsigned long flags;
int i; int i;
...@@ -1568,7 +1568,7 @@ static void sis900_tx_timeout(struct net_device *net_dev) ...@@ -1568,7 +1568,7 @@ static void sis900_tx_timeout(struct net_device *net_dev)
static int static int
sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
unsigned int entry; unsigned int entry;
unsigned long flags; unsigned long flags;
...@@ -1638,7 +1638,7 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev) ...@@ -1638,7 +1638,7 @@ sis900_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
static irqreturn_t sis900_interrupt(int irq, void *dev_instance) static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
{ {
struct net_device *net_dev = dev_instance; struct net_device *net_dev = dev_instance;
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
int boguscnt = max_interrupt_work; int boguscnt = max_interrupt_work;
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
u32 status; u32 status;
...@@ -1700,7 +1700,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance) ...@@ -1700,7 +1700,7 @@ static irqreturn_t sis900_interrupt(int irq, void *dev_instance)
static int sis900_rx(struct net_device *net_dev) static int sis900_rx(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC;
u32 rx_status = sis_priv->rx_ring[entry].cmdsts; u32 rx_status = sis_priv->rx_ring[entry].cmdsts;
...@@ -1849,7 +1849,7 @@ static int sis900_rx(struct net_device *net_dev) ...@@ -1849,7 +1849,7 @@ static int sis900_rx(struct net_device *net_dev)
static void sis900_finish_xmit (struct net_device *net_dev) static void sis900_finish_xmit (struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) { for (; sis_priv->dirty_tx != sis_priv->cur_tx; sis_priv->dirty_tx++) {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1918,7 +1918,7 @@ static void sis900_finish_xmit (struct net_device *net_dev) ...@@ -1918,7 +1918,7 @@ static void sis900_finish_xmit (struct net_device *net_dev)
static int sis900_close(struct net_device *net_dev) static int sis900_close(struct net_device *net_dev)
{ {
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct sk_buff *skb; struct sk_buff *skb;
int i; int i;
...@@ -1973,7 +1973,7 @@ static int sis900_close(struct net_device *net_dev) ...@@ -1973,7 +1973,7 @@ static int sis900_close(struct net_device *net_dev)
static void sis900_get_drvinfo(struct net_device *net_dev, static void sis900_get_drvinfo(struct net_device *net_dev,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
strcpy (info->driver, SIS900_MODULE_NAME); strcpy (info->driver, SIS900_MODULE_NAME);
strcpy (info->version, SIS900_DRV_VERSION); strcpy (info->version, SIS900_DRV_VERSION);
...@@ -1982,26 +1982,26 @@ static void sis900_get_drvinfo(struct net_device *net_dev, ...@@ -1982,26 +1982,26 @@ static void sis900_get_drvinfo(struct net_device *net_dev,
static u32 sis900_get_msglevel(struct net_device *net_dev) static u32 sis900_get_msglevel(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
return sis_priv->msg_enable; return sis_priv->msg_enable;
} }
static void sis900_set_msglevel(struct net_device *net_dev, u32 value) static void sis900_set_msglevel(struct net_device *net_dev, u32 value)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
sis_priv->msg_enable = value; sis_priv->msg_enable = value;
} }
static u32 sis900_get_link(struct net_device *net_dev) static u32 sis900_get_link(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
return mii_link_ok(&sis_priv->mii_info); return mii_link_ok(&sis_priv->mii_info);
} }
static int sis900_get_settings(struct net_device *net_dev, static int sis900_get_settings(struct net_device *net_dev,
struct ethtool_cmd *cmd) struct ethtool_cmd *cmd)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
spin_lock_irq(&sis_priv->lock); spin_lock_irq(&sis_priv->lock);
mii_ethtool_gset(&sis_priv->mii_info, cmd); mii_ethtool_gset(&sis_priv->mii_info, cmd);
spin_unlock_irq(&sis_priv->lock); spin_unlock_irq(&sis_priv->lock);
...@@ -2011,7 +2011,7 @@ static int sis900_get_settings(struct net_device *net_dev, ...@@ -2011,7 +2011,7 @@ static int sis900_get_settings(struct net_device *net_dev,
static int sis900_set_settings(struct net_device *net_dev, static int sis900_set_settings(struct net_device *net_dev,
struct ethtool_cmd *cmd) struct ethtool_cmd *cmd)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
int rt; int rt;
spin_lock_irq(&sis_priv->lock); spin_lock_irq(&sis_priv->lock);
rt = mii_ethtool_sset(&sis_priv->mii_info, cmd); rt = mii_ethtool_sset(&sis_priv->mii_info, cmd);
...@@ -2021,7 +2021,7 @@ static int sis900_set_settings(struct net_device *net_dev, ...@@ -2021,7 +2021,7 @@ static int sis900_set_settings(struct net_device *net_dev,
static int sis900_nway_reset(struct net_device *net_dev) static int sis900_nway_reset(struct net_device *net_dev)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
return mii_nway_restart(&sis_priv->mii_info); return mii_nway_restart(&sis_priv->mii_info);
} }
...@@ -2038,7 +2038,7 @@ static int sis900_nway_reset(struct net_device *net_dev) ...@@ -2038,7 +2038,7 @@ static int sis900_nway_reset(struct net_device *net_dev)
static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol) static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wol)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long pmctrl_addr = net_dev->base_addr + pmctrl; long pmctrl_addr = net_dev->base_addr + pmctrl;
u32 cfgpmcsr = 0, pmctrl_bits = 0; u32 cfgpmcsr = 0, pmctrl_bits = 0;
...@@ -2109,7 +2109,7 @@ static const struct ethtool_ops sis900_ethtool_ops = { ...@@ -2109,7 +2109,7 @@ static const struct ethtool_ops sis900_ethtool_ops = {
static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd) static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
{ {
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct mii_ioctl_data *data = if_mii(rq); struct mii_ioctl_data *data = if_mii(rq);
switch(cmd) { switch(cmd) {
...@@ -2143,7 +2143,7 @@ static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd) ...@@ -2143,7 +2143,7 @@ static int mii_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd)
static int sis900_set_config(struct net_device *dev, struct ifmap *map) static int sis900_set_config(struct net_device *dev, struct ifmap *map)
{ {
struct sis900_private *sis_priv = dev->priv; struct sis900_private *sis_priv = netdev_priv(dev);
struct mii_phy *mii_phy = sis_priv->mii; struct mii_phy *mii_phy = sis_priv->mii;
u16 status; u16 status;
...@@ -2266,7 +2266,7 @@ static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision) ...@@ -2266,7 +2266,7 @@ static inline u16 sis900_mcast_bitnr(u8 *addr, u8 revision)
static void set_rx_mode(struct net_device *net_dev) static void set_rx_mode(struct net_device *net_dev)
{ {
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
struct sis900_private * sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */ u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
int i, table_entries; int i, table_entries;
u32 rx_mode; u32 rx_mode;
...@@ -2341,7 +2341,7 @@ static void set_rx_mode(struct net_device *net_dev) ...@@ -2341,7 +2341,7 @@ static void set_rx_mode(struct net_device *net_dev)
static void sis900_reset(struct net_device *net_dev) static void sis900_reset(struct net_device *net_dev)
{ {
struct sis900_private * sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
int i = 0; int i = 0;
u32 status = TxRCMP | RxRCMP; u32 status = TxRCMP | RxRCMP;
...@@ -2374,7 +2374,7 @@ static void sis900_reset(struct net_device *net_dev) ...@@ -2374,7 +2374,7 @@ static void sis900_reset(struct net_device *net_dev)
static void __devexit sis900_remove(struct pci_dev *pci_dev) static void __devexit sis900_remove(struct pci_dev *pci_dev)
{ {
struct net_device *net_dev = pci_get_drvdata(pci_dev); struct net_device *net_dev = pci_get_drvdata(pci_dev);
struct sis900_private * sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
struct mii_phy *phy = NULL; struct mii_phy *phy = NULL;
while (sis_priv->first_mii) { while (sis_priv->first_mii) {
...@@ -2418,7 +2418,7 @@ static int sis900_suspend(struct pci_dev *pci_dev, pm_message_t state) ...@@ -2418,7 +2418,7 @@ static int sis900_suspend(struct pci_dev *pci_dev, pm_message_t state)
static int sis900_resume(struct pci_dev *pci_dev) static int sis900_resume(struct pci_dev *pci_dev)
{ {
struct net_device *net_dev = pci_get_drvdata(pci_dev); struct net_device *net_dev = pci_get_drvdata(pci_dev);
struct sis900_private *sis_priv = net_dev->priv; struct sis900_private *sis_priv = netdev_priv(net_dev);
long ioaddr = net_dev->base_addr; long ioaddr = net_dev->base_addr;
if(!netif_running(net_dev)) if(!netif_running(net_dev))
......
...@@ -1034,7 +1034,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr) ...@@ -1034,7 +1034,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
printk("ADDR: %pM\n", dev->dev_addr); printk("ADDR: %pM\n", dev->dev_addr);
/* set the private data to zero by default */ /* set the private data to zero by default */
memset(dev->priv, 0, sizeof(struct smc_local)); memset(netdev_priv(dev), 0, sizeof(struct smc_local));
/* Grab the IRQ */ /* Grab the IRQ */
retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev); retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev);
...@@ -1108,7 +1108,7 @@ static int smc_open(struct net_device *dev) ...@@ -1108,7 +1108,7 @@ static int smc_open(struct net_device *dev)
int i; /* used to set hw ethernet address */ int i; /* used to set hw ethernet address */
/* clear out all the junk that was put here before... */ /* clear out all the junk that was put here before... */
memset(dev->priv, 0, sizeof(struct smc_local)); memset(netdev_priv(dev), 0, sizeof(struct smc_local));
/* reset the hardware */ /* reset the hardware */
...@@ -1164,7 +1164,7 @@ static void smc_timeout(struct net_device *dev) ...@@ -1164,7 +1164,7 @@ static void smc_timeout(struct net_device *dev)
smc_enable( dev->base_addr ); smc_enable( dev->base_addr );
dev->trans_start = jiffies; dev->trans_start = jiffies;
/* clear anything saved */ /* clear anything saved */
((struct smc_local *)dev->priv)->saved_skb = NULL; ((struct smc_local *)netdev_priv(dev))->saved_skb = NULL;
netif_wake_queue(dev); netif_wake_queue(dev);
} }
......
...@@ -371,7 +371,7 @@ static inline __u16 sonic_buf_get(void* base, int bitmode, ...@@ -371,7 +371,7 @@ static inline __u16 sonic_buf_get(void* base, int bitmode,
static inline void sonic_cda_put(struct net_device* dev, int entry, static inline void sonic_cda_put(struct net_device* dev, int entry,
int offset, __u16 val) int offset, __u16 val)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
sonic_buf_put(lp->cda, lp->dma_bitmode, sonic_buf_put(lp->cda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_CD) + offset, val); (entry * SIZEOF_SONIC_CD) + offset, val);
} }
...@@ -379,27 +379,27 @@ static inline void sonic_cda_put(struct net_device* dev, int entry, ...@@ -379,27 +379,27 @@ static inline void sonic_cda_put(struct net_device* dev, int entry,
static inline __u16 sonic_cda_get(struct net_device* dev, int entry, static inline __u16 sonic_cda_get(struct net_device* dev, int entry,
int offset) int offset)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
return sonic_buf_get(lp->cda, lp->dma_bitmode, return sonic_buf_get(lp->cda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_CD) + offset); (entry * SIZEOF_SONIC_CD) + offset);
} }
static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val) static inline void sonic_set_cam_enable(struct net_device* dev, __u16 val)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val); sonic_buf_put(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE, val);
} }
static inline __u16 sonic_get_cam_enable(struct net_device* dev) static inline __u16 sonic_get_cam_enable(struct net_device* dev)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE); return sonic_buf_get(lp->cda, lp->dma_bitmode, SONIC_CDA_CAM_ENABLE);
} }
static inline void sonic_tda_put(struct net_device* dev, int entry, static inline void sonic_tda_put(struct net_device* dev, int entry,
int offset, __u16 val) int offset, __u16 val)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
sonic_buf_put(lp->tda, lp->dma_bitmode, sonic_buf_put(lp->tda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_TD) + offset, val); (entry * SIZEOF_SONIC_TD) + offset, val);
} }
...@@ -407,7 +407,7 @@ static inline void sonic_tda_put(struct net_device* dev, int entry, ...@@ -407,7 +407,7 @@ static inline void sonic_tda_put(struct net_device* dev, int entry,
static inline __u16 sonic_tda_get(struct net_device* dev, int entry, static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
int offset) int offset)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
return sonic_buf_get(lp->tda, lp->dma_bitmode, return sonic_buf_get(lp->tda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_TD) + offset); (entry * SIZEOF_SONIC_TD) + offset);
} }
...@@ -415,7 +415,7 @@ static inline __u16 sonic_tda_get(struct net_device* dev, int entry, ...@@ -415,7 +415,7 @@ static inline __u16 sonic_tda_get(struct net_device* dev, int entry,
static inline void sonic_rda_put(struct net_device* dev, int entry, static inline void sonic_rda_put(struct net_device* dev, int entry,
int offset, __u16 val) int offset, __u16 val)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
sonic_buf_put(lp->rda, lp->dma_bitmode, sonic_buf_put(lp->rda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_RD) + offset, val); (entry * SIZEOF_SONIC_RD) + offset, val);
} }
...@@ -423,7 +423,7 @@ static inline void sonic_rda_put(struct net_device* dev, int entry, ...@@ -423,7 +423,7 @@ static inline void sonic_rda_put(struct net_device* dev, int entry,
static inline __u16 sonic_rda_get(struct net_device* dev, int entry, static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
int offset) int offset)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
return sonic_buf_get(lp->rda, lp->dma_bitmode, return sonic_buf_get(lp->rda, lp->dma_bitmode,
(entry * SIZEOF_SONIC_RD) + offset); (entry * SIZEOF_SONIC_RD) + offset);
} }
...@@ -431,7 +431,7 @@ static inline __u16 sonic_rda_get(struct net_device* dev, int entry, ...@@ -431,7 +431,7 @@ static inline __u16 sonic_rda_get(struct net_device* dev, int entry,
static inline void sonic_rra_put(struct net_device* dev, int entry, static inline void sonic_rra_put(struct net_device* dev, int entry,
int offset, __u16 val) int offset, __u16 val)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
sonic_buf_put(lp->rra, lp->dma_bitmode, sonic_buf_put(lp->rra, lp->dma_bitmode,
(entry * SIZEOF_SONIC_RR) + offset, val); (entry * SIZEOF_SONIC_RR) + offset, val);
} }
...@@ -439,7 +439,7 @@ static inline void sonic_rra_put(struct net_device* dev, int entry, ...@@ -439,7 +439,7 @@ static inline void sonic_rra_put(struct net_device* dev, int entry,
static inline __u16 sonic_rra_get(struct net_device* dev, int entry, static inline __u16 sonic_rra_get(struct net_device* dev, int entry,
int offset) int offset)
{ {
struct sonic_local* lp = (struct sonic_local *) dev->priv; struct sonic_local *lp = netdev_priv(dev);
return sonic_buf_get(lp->rra, lp->dma_bitmode, return sonic_buf_get(lp->rra, lp->dma_bitmode,
(entry * SIZEOF_SONIC_RR) + offset); (entry * SIZEOF_SONIC_RR) + offset);
} }
......
...@@ -118,7 +118,7 @@ spider_net_ethtool_nway_reset(struct net_device *netdev) ...@@ -118,7 +118,7 @@ spider_net_ethtool_nway_reset(struct net_device *netdev)
static u32 static u32
spider_net_ethtool_get_rx_csum(struct net_device *netdev) spider_net_ethtool_get_rx_csum(struct net_device *netdev)
{ {
struct spider_net_card *card = netdev->priv; struct spider_net_card *card = netdev_priv(netdev);
return card->options.rx_csum; return card->options.rx_csum;
} }
...@@ -126,7 +126,7 @@ spider_net_ethtool_get_rx_csum(struct net_device *netdev) ...@@ -126,7 +126,7 @@ spider_net_ethtool_get_rx_csum(struct net_device *netdev)
static int static int
spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n) spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n)
{ {
struct spider_net_card *card = netdev->priv; struct spider_net_card *card = netdev_priv(netdev);
card->options.rx_csum = n; card->options.rx_csum = n;
return 0; return 0;
...@@ -137,7 +137,7 @@ static void ...@@ -137,7 +137,7 @@ static void
spider_net_ethtool_get_ringparam(struct net_device *netdev, spider_net_ethtool_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ering) struct ethtool_ringparam *ering)
{ {
struct spider_net_card *card = netdev->priv; struct spider_net_card *card = netdev_priv(netdev);
ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX; ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX;
ering->tx_pending = card->tx_chain.num_desc; 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) ...@@ -158,7 +158,7 @@ static int spider_net_get_sset_count(struct net_device *netdev, int sset)
static void spider_net_get_ethtool_stats(struct net_device *netdev, static void spider_net_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data) struct ethtool_stats *stats, u64 *data)
{ {
struct spider_net_card *card = netdev->priv; struct spider_net_card *card = netdev_priv(netdev);
data[0] = netdev->stats.tx_packets; data[0] = netdev->stats.tx_packets;
data[1] = netdev->stats.tx_bytes; data[1] = netdev->stats.tx_bytes;
......
...@@ -247,7 +247,7 @@ static int check586(struct net_device *dev,char *where,unsigned size) ...@@ -247,7 +247,7 @@ static int check586(struct net_device *dev,char *where,unsigned size)
*/ */
static void alloc586(struct net_device *dev) static void alloc586(struct net_device *dev)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
sun3_reset586(); sun3_reset586();
DELAY(1); DELAY(1);
...@@ -363,17 +363,21 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr) ...@@ -363,17 +363,21 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
goto out; goto out;
} }
((struct priv *) (dev->priv))->memtop = (char *)dvma_btov(dev->mem_start); ((struct priv *)netdev_priv(dev))->memtop =
((struct priv *) (dev->priv))->base = (unsigned long) dvma_btov(0); (char *)dvma_btov(dev->mem_start);
((struct priv *)netdev_priv(dev))->base = (unsigned long) dvma_btov(0);
alloc586(dev); alloc586(dev);
/* set number of receive-buffs according to memsize */ /* set number of receive-buffs according to memsize */
if(size == 0x2000) if(size == 0x2000)
((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_8; ((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_8;
else if(size == 0x4000) else if(size == 0x4000)
((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_16; ((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_16;
else else
((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_32; ((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_32;
printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq); printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
...@@ -397,7 +401,7 @@ static int init586(struct net_device *dev) ...@@ -397,7 +401,7 @@ static int init586(struct net_device *dev)
{ {
void *ptr; void *ptr;
int i,result=0; int i,result=0;
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
volatile struct configure_cmd_struct *cfg_cmd; volatile struct configure_cmd_struct *cfg_cmd;
volatile struct iasetup_cmd_struct *ias_cmd; volatile struct iasetup_cmd_struct *ias_cmd;
volatile struct tdr_cmd_struct *tdr_cmd; volatile struct tdr_cmd_struct *tdr_cmd;
...@@ -631,7 +635,7 @@ static void *alloc_rfa(struct net_device *dev,void *ptr) ...@@ -631,7 +635,7 @@ static void *alloc_rfa(struct net_device *dev,void *ptr)
volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr; volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr;
volatile struct rbd_struct *rbd; volatile struct rbd_struct *rbd;
int i; int i;
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd)); memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd));
p->rfd_first = rfd; p->rfd_first = rfd;
...@@ -683,7 +687,7 @@ static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id) ...@@ -683,7 +687,7 @@ static irqreturn_t sun3_82586_interrupt(int irq,void *dev_id)
printk ("sun3_82586-interrupt: irq %d for unknown device.\n",irq); printk ("sun3_82586-interrupt: irq %d for unknown device.\n",irq);
return IRQ_NONE; return IRQ_NONE;
} }
p = (struct priv *) dev->priv; p = netdev_priv(dev);
if(debuglevel > 1) if(debuglevel > 1)
printk("I"); printk("I");
...@@ -753,7 +757,7 @@ static void sun3_82586_rcv_int(struct net_device *dev) ...@@ -753,7 +757,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)
unsigned short totlen; unsigned short totlen;
struct sk_buff *skb; struct sk_buff *skb;
struct rbd_struct *rbd; struct rbd_struct *rbd;
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
if(debuglevel > 0) if(debuglevel > 0)
printk("R"); printk("R");
...@@ -871,7 +875,7 @@ static void sun3_82586_rcv_int(struct net_device *dev) ...@@ -871,7 +875,7 @@ static void sun3_82586_rcv_int(struct net_device *dev)
static void sun3_82586_rnr_int(struct net_device *dev) static void sun3_82586_rnr_int(struct net_device *dev)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
p->stats.rx_errors++; p->stats.rx_errors++;
...@@ -895,7 +899,7 @@ static void sun3_82586_rnr_int(struct net_device *dev) ...@@ -895,7 +899,7 @@ static void sun3_82586_rnr_int(struct net_device *dev)
static void sun3_82586_xmt_int(struct net_device *dev) static void sun3_82586_xmt_int(struct net_device *dev)
{ {
int status; int status;
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
if(debuglevel > 0) if(debuglevel > 0)
printk("X"); printk("X");
...@@ -945,7 +949,7 @@ static void sun3_82586_xmt_int(struct net_device *dev) ...@@ -945,7 +949,7 @@ static void sun3_82586_xmt_int(struct net_device *dev)
static void startrecv586(struct net_device *dev) static void startrecv586(struct net_device *dev)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
WAIT_4_SCB_CMD(); WAIT_4_SCB_CMD();
WAIT_4_SCB_CMD_RUC(); WAIT_4_SCB_CMD_RUC();
...@@ -957,7 +961,7 @@ static void startrecv586(struct net_device *dev) ...@@ -957,7 +961,7 @@ static void startrecv586(struct net_device *dev)
static void sun3_82586_timeout(struct net_device *dev) static void sun3_82586_timeout(struct net_device *dev)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
#ifndef NO_NOPCOMMANDS #ifndef NO_NOPCOMMANDS
if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */ if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */
{ {
...@@ -999,7 +1003,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -999,7 +1003,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
#ifndef NO_NOPCOMMANDS #ifndef NO_NOPCOMMANDS
int next_nop; int next_nop;
#endif #endif
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
if(skb->len > XMIT_BUFF_SIZE) if(skb->len > XMIT_BUFF_SIZE)
{ {
...@@ -1108,7 +1112,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -1108,7 +1112,7 @@ static int sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev) static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
unsigned short crc,aln,rsc,ovrn; unsigned short crc,aln,rsc,ovrn;
crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */ crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */
...@@ -1171,7 +1175,7 @@ void cleanup_module(void) ...@@ -1171,7 +1175,7 @@ void cleanup_module(void)
*/ */
void sun3_82586_dump(struct net_device *dev,void *ptr) void sun3_82586_dump(struct net_device *dev,void *ptr)
{ {
struct priv *p = (struct priv *) dev->priv; struct priv *p = netdev_priv(dev);
struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr; struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr;
int i; int i;
......
...@@ -916,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id) ...@@ -916,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id)
static int bigmac_open(struct net_device *dev) static int bigmac_open(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
int ret; int ret;
ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp); 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,7 +933,7 @@ static int bigmac_open(struct net_device *dev)
static int bigmac_close(struct net_device *dev) static int bigmac_close(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
del_timer(&bp->bigmac_timer); del_timer(&bp->bigmac_timer);
bp->timer_state = asleep; bp->timer_state = asleep;
...@@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev) ...@@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev)
static void bigmac_tx_timeout(struct net_device *dev) static void bigmac_tx_timeout(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
bigmac_init_hw(bp, 0); bigmac_init_hw(bp, 0);
netif_wake_queue(dev); netif_wake_queue(dev);
...@@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev) ...@@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev)
/* Put a packet on the wire. */ /* Put a packet on the wire. */
static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
int len, entry; int len, entry;
u32 mapping; u32 mapping;
...@@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *bigmac_get_stats(struct net_device *dev) static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
bigmac_get_counters(bp, bp->bregs); bigmac_get_counters(bp, bp->bregs);
return &bp->enet_stats; return &bp->enet_stats;
...@@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev) ...@@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
static void bigmac_set_multicast(struct net_device *dev) static void bigmac_set_multicast(struct net_device *dev)
{ {
struct bigmac *bp = (struct bigmac *) dev->priv; struct bigmac *bp = netdev_priv(dev);
void __iomem *bregs = bp->bregs; void __iomem *bregs = bp->bregs;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addrs; char *addrs;
...@@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i ...@@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i
static u32 bigmac_get_link(struct net_device *dev) static u32 bigmac_get_link(struct net_device *dev)
{ {
struct bigmac *bp = dev->priv; struct bigmac *bp = netdev_priv(dev);
spin_lock_irq(&bp->lock); spin_lock_irq(&bp->lock);
bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR); bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR);
......
...@@ -164,7 +164,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg) ...@@ -164,7 +164,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg)
static inline int _phy_read(struct net_device *dev, int mii_id, int reg) static inline int _phy_read(struct net_device *dev, int mii_id, int reg)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
return __phy_read(gp, mii_id, reg); return __phy_read(gp, mii_id, reg);
} }
...@@ -197,7 +197,7 @@ static void __phy_write(struct gem *gp, int phy_addr, int reg, u16 val) ...@@ -197,7 +197,7 @@ static void __phy_write(struct gem *gp, int phy_addr, int reg, u16 val)
static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val) static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
__phy_write(gp, mii_id, reg, val & 0xffff); __phy_write(gp, mii_id, reg, val & 0xffff);
} }
...@@ -932,7 +932,7 @@ static int gem_poll(struct napi_struct *napi, int budget) ...@@ -932,7 +932,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
static irqreturn_t gem_interrupt(int irq, void *dev_id) static irqreturn_t gem_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
/* Swallow interrupts when shutting the chip down, though /* Swallow interrupts when shutting the chip down, though
...@@ -978,7 +978,7 @@ static void gem_poll_controller(struct net_device *dev) ...@@ -978,7 +978,7 @@ static void gem_poll_controller(struct net_device *dev)
static void gem_tx_timeout(struct net_device *dev) static void gem_tx_timeout(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name); printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
if (!gp->running) { if (!gp->running) {
...@@ -1017,7 +1017,7 @@ static __inline__ int gem_intme(int entry) ...@@ -1017,7 +1017,7 @@ static __inline__ int gem_intme(int entry)
static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev) static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
int entry; int entry;
u64 ctrl; u64 ctrl;
unsigned long flags; unsigned long flags;
...@@ -2190,7 +2190,7 @@ static void gem_stop_phy(struct gem *gp, int wol) ...@@ -2190,7 +2190,7 @@ static void gem_stop_phy(struct gem *gp, int wol)
static int gem_do_start(struct net_device *dev) static int gem_do_start(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&gp->lock, flags); spin_lock_irqsave(&gp->lock, flags);
...@@ -2237,7 +2237,7 @@ static int gem_do_start(struct net_device *dev) ...@@ -2237,7 +2237,7 @@ static int gem_do_start(struct net_device *dev)
static void gem_do_stop(struct net_device *dev, int wol) static void gem_do_stop(struct net_device *dev, int wol)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&gp->lock, flags); spin_lock_irqsave(&gp->lock, flags);
...@@ -2312,7 +2312,7 @@ static void gem_reset_task(struct work_struct *work) ...@@ -2312,7 +2312,7 @@ static void gem_reset_task(struct work_struct *work)
static int gem_open(struct net_device *dev) static int gem_open(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
int rc = 0; int rc = 0;
mutex_lock(&gp->pm_mutex); mutex_lock(&gp->pm_mutex);
...@@ -2331,7 +2331,7 @@ static int gem_open(struct net_device *dev) ...@@ -2331,7 +2331,7 @@ static int gem_open(struct net_device *dev)
static int gem_close(struct net_device *dev) static int gem_close(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
mutex_lock(&gp->pm_mutex); mutex_lock(&gp->pm_mutex);
...@@ -2350,7 +2350,7 @@ static int gem_close(struct net_device *dev) ...@@ -2350,7 +2350,7 @@ static int gem_close(struct net_device *dev)
static int gem_suspend(struct pci_dev *pdev, pm_message_t state) static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
mutex_lock(&gp->pm_mutex); mutex_lock(&gp->pm_mutex);
...@@ -2414,7 +2414,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -2414,7 +2414,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
static int gem_resume(struct pci_dev *pdev) static int gem_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
printk(KERN_INFO "%s: resuming\n", dev->name); printk(KERN_INFO "%s: resuming\n", dev->name);
...@@ -2488,7 +2488,7 @@ static int gem_resume(struct pci_dev *pdev) ...@@ -2488,7 +2488,7 @@ static int gem_resume(struct pci_dev *pdev)
static struct net_device_stats *gem_get_stats(struct net_device *dev) static struct net_device_stats *gem_get_stats(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
struct net_device_stats *stats = &gp->net_stats; struct net_device_stats *stats = &gp->net_stats;
spin_lock_irq(&gp->lock); spin_lock_irq(&gp->lock);
...@@ -2524,7 +2524,7 @@ static struct net_device_stats *gem_get_stats(struct net_device *dev) ...@@ -2524,7 +2524,7 @@ static struct net_device_stats *gem_get_stats(struct net_device *dev)
static int gem_set_mac_address(struct net_device *dev, void *addr) static int gem_set_mac_address(struct net_device *dev, void *addr)
{ {
struct sockaddr *macaddr = (struct sockaddr *) addr; struct sockaddr *macaddr = (struct sockaddr *) addr;
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unsigned char *e = &dev->dev_addr[0]; unsigned char *e = &dev->dev_addr[0];
if (!is_valid_ether_addr(macaddr->sa_data)) 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,7 +2552,7 @@ static int gem_set_mac_address(struct net_device *dev, void *addr)
static void gem_set_multicast(struct net_device *dev) static void gem_set_multicast(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
u32 rxcfg, rxcfg_new; u32 rxcfg, rxcfg_new;
int limit = 10000; int limit = 10000;
...@@ -2601,7 +2601,7 @@ static void gem_set_multicast(struct net_device *dev) ...@@ -2601,7 +2601,7 @@ static void gem_set_multicast(struct net_device *dev)
static int gem_change_mtu(struct net_device *dev, int new_mtu) static int gem_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU) if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU)
return -EINVAL; return -EINVAL;
...@@ -2632,7 +2632,7 @@ static int gem_change_mtu(struct net_device *dev, int new_mtu) ...@@ -2632,7 +2632,7 @@ static int gem_change_mtu(struct net_device *dev, int new_mtu)
static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
strcpy(info->driver, DRV_NAME); strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION); strcpy(info->version, DRV_VERSION);
...@@ -2641,7 +2641,7 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info ...@@ -2641,7 +2641,7 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
if (gp->phy_type == phy_mii_mdio0 || if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1) { gp->phy_type == phy_mii_mdio1) {
...@@ -2687,7 +2687,7 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -2687,7 +2687,7 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
/* Verify the settings we care about. */ /* Verify the settings we care about. */
if (cmd->autoneg != AUTONEG_ENABLE && if (cmd->autoneg != AUTONEG_ENABLE &&
...@@ -2718,7 +2718,7 @@ static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -2718,7 +2718,7 @@ static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int gem_nway_reset(struct net_device *dev) static int gem_nway_reset(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
if (!gp->want_autoneg) if (!gp->want_autoneg)
return -EINVAL; return -EINVAL;
...@@ -2735,13 +2735,13 @@ static int gem_nway_reset(struct net_device *dev) ...@@ -2735,13 +2735,13 @@ static int gem_nway_reset(struct net_device *dev)
static u32 gem_get_msglevel(struct net_device *dev) static u32 gem_get_msglevel(struct net_device *dev)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
return gp->msg_enable; return gp->msg_enable;
} }
static void gem_set_msglevel(struct net_device *dev, u32 value) static void gem_set_msglevel(struct net_device *dev, u32 value)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
gp->msg_enable = value; gp->msg_enable = value;
} }
...@@ -2753,7 +2753,7 @@ static void gem_set_msglevel(struct net_device *dev, u32 value) ...@@ -2753,7 +2753,7 @@ static void gem_set_msglevel(struct net_device *dev, u32 value)
static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
/* Add more when I understand how to program the chip */ /* Add more when I understand how to program the chip */
if (gp->has_wol) { if (gp->has_wol) {
...@@ -2767,7 +2767,7 @@ static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) ...@@ -2767,7 +2767,7 @@ static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
if (!gp->has_wol) if (!gp->has_wol)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -2789,7 +2789,7 @@ static const struct ethtool_ops gem_ethtool_ops = { ...@@ -2789,7 +2789,7 @@ static const struct ethtool_ops gem_ethtool_ops = {
static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
struct mii_ioctl_data *data = if_mii(ifr); struct mii_ioctl_data *data = if_mii(ifr);
int rc = -EOPNOTSUPP; int rc = -EOPNOTSUPP;
unsigned long flags; unsigned long flags;
...@@ -2921,7 +2921,7 @@ static void gem_remove_one(struct pci_dev *pdev) ...@@ -2921,7 +2921,7 @@ static void gem_remove_one(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
if (dev) { if (dev) {
struct gem *gp = dev->priv; struct gem *gp = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
...@@ -3024,7 +3024,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev, ...@@ -3024,7 +3024,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
} }
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
gp = dev->priv; gp = netdev_priv(dev);
err = pci_request_regions(pdev, DRV_NAME); err = pci_request_regions(pdev, DRV_NAME);
if (err) { if (err) {
......
...@@ -2130,7 +2130,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) ...@@ -2130,7 +2130,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
struct net_device *dev = qp->happy_meals[i]; struct net_device *dev = qp->happy_meals[i];
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
HMD(("quattro_interrupt: status=%08x ", happy_status)); HMD(("quattro_interrupt: status=%08x ", happy_status));
...@@ -2175,7 +2175,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) ...@@ -2175,7 +2175,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
static int happy_meal_open(struct net_device *dev) static int happy_meal_open(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
int res; int res;
HMD(("happy_meal_open: ")); HMD(("happy_meal_open: "));
...@@ -2207,7 +2207,7 @@ static int happy_meal_open(struct net_device *dev) ...@@ -2207,7 +2207,7 @@ static int happy_meal_open(struct net_device *dev)
static int happy_meal_close(struct net_device *dev) static int happy_meal_close(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
happy_meal_stop(hp, hp->gregs); happy_meal_stop(hp, hp->gregs);
...@@ -2236,7 +2236,7 @@ static int happy_meal_close(struct net_device *dev) ...@@ -2236,7 +2236,7 @@ static int happy_meal_close(struct net_device *dev)
static void happy_meal_tx_timeout(struct net_device *dev) static void happy_meal_tx_timeout(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
tx_dump_log(); tx_dump_log();
...@@ -2254,7 +2254,7 @@ static void happy_meal_tx_timeout(struct net_device *dev) ...@@ -2254,7 +2254,7 @@ static void happy_meal_tx_timeout(struct net_device *dev)
static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev) static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
int entry; int entry;
u32 tx_flags; u32 tx_flags;
...@@ -2343,7 +2343,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2343,7 +2343,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *happy_meal_get_stats(struct net_device *dev) static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
happy_meal_get_counters(hp, hp->bigmacregs); 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,7 +2354,7 @@ static struct net_device_stats *happy_meal_get_stats(struct net_device *dev)
static void happy_meal_set_multicast(struct net_device *dev) static void happy_meal_set_multicast(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
void __iomem *bregs = hp->bigmacregs; void __iomem *bregs = hp->bigmacregs;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addrs; char *addrs;
...@@ -2400,7 +2400,7 @@ static void happy_meal_set_multicast(struct net_device *dev) ...@@ -2400,7 +2400,7 @@ static void happy_meal_set_multicast(struct net_device *dev)
/* Ethtool support... */ /* Ethtool support... */
static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
cmd->supported = cmd->supported =
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
...@@ -2445,7 +2445,7 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -2445,7 +2445,7 @@ static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
/* Verify the settings we care about. */ /* Verify the settings we care about. */
if (cmd->autoneg != AUTONEG_ENABLE && if (cmd->autoneg != AUTONEG_ENABLE &&
...@@ -2469,7 +2469,7 @@ static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -2469,7 +2469,7 @@ static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
strcpy(info->driver, "sunhme"); strcpy(info->driver, "sunhme");
strcpy(info->version, "2.02"); strcpy(info->version, "2.02");
...@@ -2491,7 +2491,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info ...@@ -2491,7 +2491,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
static u32 hme_get_link(struct net_device *dev) static u32 hme_get_link(struct net_device *dev)
{ {
struct happy_meal *hp = dev->priv; struct happy_meal *hp = netdev_priv(dev);
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); 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,7 +2970,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
dev->base_addr = (long) pdev; dev->base_addr = (long) pdev;
hp = (struct happy_meal *)dev->priv; hp = netdev_priv(dev);
memset(hp, 0, sizeof(*hp)); memset(hp, 0, sizeof(*hp));
hp->happy_dev = pdev; hp->happy_dev = pdev;
......
...@@ -512,7 +512,7 @@ static irqreturn_t qec_interrupt(int irq, void *dev_id) ...@@ -512,7 +512,7 @@ static irqreturn_t qec_interrupt(int irq, void *dev_id)
static int qe_open(struct net_device *dev) static int qe_open(struct net_device *dev)
{ {
struct sunqe *qep = (struct sunqe *) dev->priv; struct sunqe *qep = netdev_priv(dev);
qep->mconfig = (MREGS_MCONFIG_TXENAB | qep->mconfig = (MREGS_MCONFIG_TXENAB |
MREGS_MCONFIG_RXENAB | MREGS_MCONFIG_RXENAB |
...@@ -522,7 +522,7 @@ static int qe_open(struct net_device *dev) ...@@ -522,7 +522,7 @@ static int qe_open(struct net_device *dev)
static int qe_close(struct net_device *dev) static int qe_close(struct net_device *dev)
{ {
struct sunqe *qep = (struct sunqe *) dev->priv; struct sunqe *qep = netdev_priv(dev);
qe_stop(qep); qe_stop(qep);
return 0; return 0;
...@@ -548,7 +548,7 @@ static void qe_tx_reclaim(struct sunqe *qep) ...@@ -548,7 +548,7 @@ static void qe_tx_reclaim(struct sunqe *qep)
static void qe_tx_timeout(struct net_device *dev) static void qe_tx_timeout(struct net_device *dev)
{ {
struct sunqe *qep = (struct sunqe *) dev->priv; struct sunqe *qep = netdev_priv(dev);
int tx_full; int tx_full;
spin_lock_irq(&qep->lock); spin_lock_irq(&qep->lock);
...@@ -574,7 +574,7 @@ static void qe_tx_timeout(struct net_device *dev) ...@@ -574,7 +574,7 @@ static void qe_tx_timeout(struct net_device *dev)
/* Get a packet queued to go onto the wire. */ /* Get a packet queued to go onto the wire. */
static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct sunqe *qep = (struct sunqe *) dev->priv; struct sunqe *qep = netdev_priv(dev);
struct sunqe_buffers *qbufs = qep->buffers; struct sunqe_buffers *qbufs = qep->buffers;
__u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma; __u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma;
unsigned char *txbuf; unsigned char *txbuf;
...@@ -626,7 +626,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -626,7 +626,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
static void qe_set_multicast(struct net_device *dev) static void qe_set_multicast(struct net_device *dev)
{ {
struct sunqe *qep = (struct sunqe *) dev->priv; struct sunqe *qep = netdev_priv(dev);
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
u8 new_mconfig = qep->mconfig; u8 new_mconfig = qep->mconfig;
char *addrs; char *addrs;
...@@ -692,7 +692,7 @@ static void qe_set_multicast(struct net_device *dev) ...@@ -692,7 +692,7 @@ static void qe_set_multicast(struct net_device *dev)
static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{ {
const struct linux_prom_registers *regs; const struct linux_prom_registers *regs;
struct sunqe *qep = dev->priv; struct sunqe *qep = netdev_priv(dev);
struct of_device *op; struct of_device *op;
strcpy(info->driver, "sunqe"); strcpy(info->driver, "sunqe");
...@@ -707,7 +707,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ...@@ -707,7 +707,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
static u32 qe_get_link(struct net_device *dev) static u32 qe_get_link(struct net_device *dev)
{ {
struct sunqe *qep = dev->priv; struct sunqe *qep = netdev_priv(dev);
void __iomem *mregs = qep->mregs; void __iomem *mregs = qep->mregs;
u8 phyconfig; u8 phyconfig;
......
...@@ -251,7 +251,7 @@ static void bdx_isr_extra(struct bdx_priv *priv, u32 isr) ...@@ -251,7 +251,7 @@ static void bdx_isr_extra(struct bdx_priv *priv, u32 isr)
static irqreturn_t bdx_isr_napi(int irq, void *dev) static irqreturn_t bdx_isr_napi(int irq, void *dev)
{ {
struct net_device *ndev = dev; struct net_device *ndev = dev;
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
u32 isr; u32 isr;
ENTER; ENTER;
...@@ -559,7 +559,7 @@ static int bdx_close(struct net_device *ndev) ...@@ -559,7 +559,7 @@ static int bdx_close(struct net_device *ndev)
struct bdx_priv *priv = NULL; struct bdx_priv *priv = NULL;
ENTER; ENTER;
priv = ndev->priv; priv = netdev_priv(ndev);
napi_disable(&priv->napi); napi_disable(&priv->napi);
...@@ -588,7 +588,7 @@ static int bdx_open(struct net_device *ndev) ...@@ -588,7 +588,7 @@ static int bdx_open(struct net_device *ndev)
int rc; int rc;
ENTER; ENTER;
priv = ndev->priv; priv = netdev_priv(ndev);
bdx_reset(priv); bdx_reset(priv);
if (netif_running(ndev)) if (netif_running(ndev))
netif_stop_queue(priv->ndev); netif_stop_queue(priv->ndev);
...@@ -633,7 +633,7 @@ static int bdx_range_check(struct bdx_priv *priv, u32 offset) ...@@ -633,7 +633,7 @@ static int bdx_range_check(struct bdx_priv *priv, u32 offset)
static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
u32 data[3]; u32 data[3];
int error; int error;
...@@ -698,7 +698,7 @@ static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) ...@@ -698,7 +698,7 @@ static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
*/ */
static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable) static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
u32 reg, bit, val; u32 reg, bit, val;
ENTER; ENTER;
...@@ -748,7 +748,7 @@ static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) ...@@ -748,7 +748,7 @@ static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)
static void static void
bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp) bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
ENTER; ENTER;
DBG("device='%s', group='%p'\n", ndev->name, grp); 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,7 +787,7 @@ static int bdx_change_mtu(struct net_device *ndev, int new_mtu)
static void bdx_setmulti(struct net_device *ndev) static void bdx_setmulti(struct net_device *ndev)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
u32 rxf_val = u32 rxf_val =
GMAC_RX_FILTER_AM | GMAC_RX_FILTER_AB | GMAC_RX_FILTER_OSEN; 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,7 +847,7 @@ static void bdx_setmulti(struct net_device *ndev)
static int bdx_set_mac(struct net_device *ndev, void *p) static int bdx_set_mac(struct net_device *ndev, void *p)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
ENTER; ENTER;
...@@ -929,7 +929,7 @@ static void bdx_update_stats(struct bdx_priv *priv) ...@@ -929,7 +929,7 @@ static void bdx_update_stats(struct bdx_priv *priv)
static struct net_device_stats *bdx_get_stats(struct net_device *ndev) static struct net_device_stats *bdx_get_stats(struct net_device *ndev)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
struct net_device_stats *net_stat = &priv->net_stats; struct net_device_stats *net_stat = &priv->net_stats;
return net_stat; return net_stat;
} }
...@@ -1623,7 +1623,7 @@ static inline int bdx_tx_space(struct bdx_priv *priv) ...@@ -1623,7 +1623,7 @@ static inline int bdx_tx_space(struct bdx_priv *priv)
*/ */
static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev) static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev)
{ {
struct bdx_priv *priv = ndev->priv; struct bdx_priv *priv = netdev_priv(ndev);
struct txd_fifo *f = &priv->txd_fifo0; struct txd_fifo *f = &priv->txd_fifo0;
int txd_checksum = 7; /* full checksum */ int txd_checksum = 7; /* full checksum */
int txd_lgsnd = 0; int txd_lgsnd = 0;
...@@ -2026,7 +2026,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2026,7 +2026,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ndev->features |= NETIF_F_HIGHDMA; ndev->features |= NETIF_F_HIGHDMA;
/************** priv ****************/ /************** priv ****************/
priv = nic->priv[port] = ndev->priv; priv = nic->priv[port] = netdev_priv(ndev);
memset(priv, 0, sizeof(struct bdx_priv)); memset(priv, 0, sizeof(struct bdx_priv));
priv->pBdxRegs = nic->regs + port * 0x8000; priv->pBdxRegs = nic->regs + port * 0x8000;
...@@ -2149,7 +2149,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -2149,7 +2149,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{ {
u32 rdintcm; u32 rdintcm;
u32 tdintcm; u32 tdintcm;
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
rdintcm = priv->rdintcm; rdintcm = priv->rdintcm;
tdintcm = priv->tdintcm; tdintcm = priv->tdintcm;
...@@ -2180,7 +2180,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -2180,7 +2180,7 @@ static int bdx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
static void static void
bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
{ {
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver)); strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version)); 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,7 +2222,7 @@ bdx_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal)
{ {
u32 rdintcm; u32 rdintcm;
u32 tdintcm; u32 tdintcm;
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
rdintcm = priv->rdintcm; rdintcm = priv->rdintcm;
tdintcm = priv->tdintcm; tdintcm = priv->tdintcm;
...@@ -2251,7 +2251,7 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal) ...@@ -2251,7 +2251,7 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal)
{ {
u32 rdintcm; u32 rdintcm;
u32 tdintcm; u32 tdintcm;
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
int rx_coal; int rx_coal;
int tx_coal; int tx_coal;
int rx_max_coal; int rx_max_coal;
...@@ -2309,7 +2309,7 @@ static inline int bdx_tx_fifo_size_to_packets(int tx_size) ...@@ -2309,7 +2309,7 @@ static inline int bdx_tx_fifo_size_to_packets(int tx_size)
static void static void
bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
{ {
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
/*max_pending - the maximum-sized FIFO we allow */ /*max_pending - the maximum-sized FIFO we allow */
ring->rx_max_pending = bdx_rx_fifo_size_to_packets(3); 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) ...@@ -2326,7 +2326,7 @@ bdx_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
static int static int
bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
{ {
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
int rx_size = 0; int rx_size = 0;
int tx_size = 0; int tx_size = 0;
...@@ -2387,7 +2387,7 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data) ...@@ -2387,7 +2387,7 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
*/ */
static int bdx_get_stats_count(struct net_device *netdev) static int bdx_get_stats_count(struct net_device *netdev)
{ {
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
BDX_ASSERT(ARRAY_SIZE(bdx_stat_names) BDX_ASSERT(ARRAY_SIZE(bdx_stat_names)
!= sizeof(struct bdx_stats) / sizeof(u64)); != sizeof(struct bdx_stats) / sizeof(u64));
return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0); return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
...@@ -2402,7 +2402,7 @@ static int bdx_get_stats_count(struct net_device *netdev) ...@@ -2402,7 +2402,7 @@ static int bdx_get_stats_count(struct net_device *netdev)
static void bdx_get_ethtool_stats(struct net_device *netdev, static void bdx_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, u64 *data) struct ethtool_stats *stats, u64 *data)
{ {
struct bdx_priv *priv = netdev->priv; struct bdx_priv *priv = netdev_priv(netdev);
if (priv->stats_flag) { if (priv->stats_flag) {
......
...@@ -180,10 +180,14 @@ void tms380tr_wait(unsigned long time); ...@@ -180,10 +180,14 @@ void tms380tr_wait(unsigned long time);
static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status); static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status);
static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status); static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status);
#define SIFREADB(reg) (((struct net_local *)dev->priv)->sifreadb(dev, reg)) #define SIFREADB(reg) \
#define SIFWRITEB(val, reg) (((struct net_local *)dev->priv)->sifwriteb(dev, val, reg)) (((struct net_local *)netdev_priv(dev))->sifreadb(dev, reg))
#define SIFREADW(reg) (((struct net_local *)dev->priv)->sifreadw(dev, reg)) #define SIFWRITEB(val, reg) \
#define SIFWRITEW(val, reg) (((struct net_local *)dev->priv)->sifwritew(dev, val, reg)) (((struct net_local *)netdev_priv(dev))->sifwriteb(dev, val, reg))
#define SIFREADW(reg) \
(((struct net_local *)netdev_priv(dev))->sifreadw(dev, reg))
#define SIFWRITEW(val, reg) \
(((struct net_local *)netdev_priv(dev))->sifwritew(dev, val, reg))
...@@ -2330,7 +2334,7 @@ int tmsdev_init(struct net_device *dev, struct device *pdev) ...@@ -2330,7 +2334,7 @@ int tmsdev_init(struct net_device *dev, struct device *pdev)
{ {
struct net_local *tms_local; struct net_local *tms_local;
memset(dev->priv, 0, sizeof(struct net_local)); memset(netdev_priv(dev), 0, sizeof(struct net_local));
tms_local = netdev_priv(dev); tms_local = netdev_priv(dev);
init_waitqueue_head(&tms_local->wait_for_tok_int); init_waitqueue_head(&tms_local->wait_for_tok_int);
if (pdev->dma_mask) if (pdev->dma_mask)
......
...@@ -483,7 +483,7 @@ static void de_rx (struct de_private *de) ...@@ -483,7 +483,7 @@ static void de_rx (struct de_private *de)
static irqreturn_t de_interrupt (int irq, void *dev_instance) static irqreturn_t de_interrupt (int irq, void *dev_instance)
{ {
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
u32 status; u32 status;
status = dr32(MacStatus); status = dr32(MacStatus);
...@@ -589,7 +589,7 @@ static void de_tx (struct de_private *de) ...@@ -589,7 +589,7 @@ static void de_tx (struct de_private *de)
static int de_start_xmit (struct sk_buff *skb, struct net_device *dev) static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
unsigned int entry, tx_free; unsigned int entry, tx_free;
u32 mapping, len, flags = FirstFrag | LastFrag; u32 mapping, len, flags = FirstFrag | LastFrag;
struct de_desc *txd; struct de_desc *txd;
...@@ -652,7 +652,7 @@ static int de_start_xmit (struct sk_buff *skb, struct net_device *dev) ...@@ -652,7 +652,7 @@ static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
u16 hash_table[32]; u16 hash_table[32];
struct dev_mc_list *mclist; struct dev_mc_list *mclist;
int i; int i;
...@@ -683,7 +683,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) ...@@ -683,7 +683,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
struct dev_mc_list *mclist; struct dev_mc_list *mclist;
int i; int i;
u16 *eaddrs; u16 *eaddrs;
...@@ -711,7 +711,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) ...@@ -711,7 +711,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
static void __de_set_rx_mode (struct net_device *dev) static void __de_set_rx_mode (struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
u32 macmode; u32 macmode;
unsigned int entry; unsigned int entry;
u32 mapping; u32 mapping;
...@@ -796,7 +796,7 @@ static void __de_set_rx_mode (struct net_device *dev) ...@@ -796,7 +796,7 @@ static void __de_set_rx_mode (struct net_device *dev)
static void de_set_rx_mode (struct net_device *dev) static void de_set_rx_mode (struct net_device *dev)
{ {
unsigned long flags; unsigned long flags;
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
spin_lock_irqsave (&de->lock, flags); spin_lock_irqsave (&de->lock, flags);
__de_set_rx_mode(dev); __de_set_rx_mode(dev);
...@@ -820,7 +820,7 @@ static void __de_get_stats(struct de_private *de) ...@@ -820,7 +820,7 @@ static void __de_get_stats(struct de_private *de)
static struct net_device_stats *de_get_stats(struct net_device *dev) static struct net_device_stats *de_get_stats(struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
/* The chip only need report frame silently dropped. */ /* The chip only need report frame silently dropped. */
spin_lock_irq(&de->lock); spin_lock_irq(&de->lock);
...@@ -1354,7 +1354,7 @@ static void de_free_rings (struct de_private *de) ...@@ -1354,7 +1354,7 @@ static void de_free_rings (struct de_private *de)
static int de_open (struct net_device *dev) static int de_open (struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
int rc; int rc;
if (netif_msg_ifup(de)) if (netif_msg_ifup(de))
...@@ -1399,7 +1399,7 @@ static int de_open (struct net_device *dev) ...@@ -1399,7 +1399,7 @@ static int de_open (struct net_device *dev)
static int de_close (struct net_device *dev) static int de_close (struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
unsigned long flags; unsigned long flags;
if (netif_msg_ifdown(de)) if (netif_msg_ifdown(de))
...@@ -1422,7 +1422,7 @@ static int de_close (struct net_device *dev) ...@@ -1422,7 +1422,7 @@ static int de_close (struct net_device *dev)
static void de_tx_timeout (struct net_device *dev) static void de_tx_timeout (struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
printk(KERN_DEBUG "%s: NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", printk(KERN_DEBUG "%s: NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
dev->name, dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), 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,7 +1573,7 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
static void de_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info) static void de_get_drvinfo (struct net_device *dev,struct ethtool_drvinfo *info)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
strcpy (info->driver, DRV_NAME); strcpy (info->driver, DRV_NAME);
strcpy (info->version, DRV_VERSION); strcpy (info->version, DRV_VERSION);
...@@ -1588,7 +1588,7 @@ static int de_get_regs_len(struct net_device *dev) ...@@ -1588,7 +1588,7 @@ static int de_get_regs_len(struct net_device *dev)
static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
int rc; int rc;
spin_lock_irq(&de->lock); spin_lock_irq(&de->lock);
...@@ -1600,7 +1600,7 @@ static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) ...@@ -1600,7 +1600,7 @@ static int de_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
int rc; int rc;
spin_lock_irq(&de->lock); spin_lock_irq(&de->lock);
...@@ -1612,14 +1612,14 @@ static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) ...@@ -1612,14 +1612,14 @@ static int de_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
static u32 de_get_msglevel(struct net_device *dev) static u32 de_get_msglevel(struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
return de->msg_enable; return de->msg_enable;
} }
static void de_set_msglevel(struct net_device *dev, u32 msglvl) static void de_set_msglevel(struct net_device *dev, u32 msglvl)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
de->msg_enable = msglvl; de->msg_enable = msglvl;
} }
...@@ -1627,7 +1627,7 @@ static void de_set_msglevel(struct net_device *dev, u32 msglvl) ...@@ -1627,7 +1627,7 @@ static void de_set_msglevel(struct net_device *dev, u32 msglvl)
static int de_get_eeprom(struct net_device *dev, static int de_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 *data) struct ethtool_eeprom *eeprom, u8 *data)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
if (!de->ee_data) if (!de->ee_data)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -1641,7 +1641,7 @@ static int de_get_eeprom(struct net_device *dev, ...@@ -1641,7 +1641,7 @@ static int de_get_eeprom(struct net_device *dev,
static int de_nway_reset(struct net_device *dev) static int de_nway_reset(struct net_device *dev)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
u32 status; u32 status;
if (de->media_type != DE_MEDIA_TP_AUTO) if (de->media_type != DE_MEDIA_TP_AUTO)
...@@ -1660,7 +1660,7 @@ static int de_nway_reset(struct net_device *dev) ...@@ -1660,7 +1660,7 @@ static int de_nway_reset(struct net_device *dev)
static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs, static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *data) void *data)
{ {
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
regs->version = (DE_REGS_VER << 2) | de->de21040; regs->version = (DE_REGS_VER << 2) | de->de21040;
...@@ -1954,7 +1954,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, ...@@ -1954,7 +1954,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
dev->tx_timeout = de_tx_timeout; dev->tx_timeout = de_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
de = dev->priv; de = netdev_priv(dev);
de->de21040 = ent->driver_data == 0 ? 1 : 0; de->de21040 = ent->driver_data == 0 ? 1 : 0;
de->pdev = pdev; de->pdev = pdev;
de->dev = dev; de->dev = dev;
...@@ -2076,7 +2076,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, ...@@ -2076,7 +2076,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
static void __devexit de_remove_one (struct pci_dev *pdev) static void __devexit de_remove_one (struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
BUG_ON(!dev); BUG_ON(!dev);
unregister_netdev(dev); unregister_netdev(dev);
...@@ -2093,7 +2093,7 @@ static void __devexit de_remove_one (struct pci_dev *pdev) ...@@ -2093,7 +2093,7 @@ static void __devexit de_remove_one (struct pci_dev *pdev)
static int de_suspend (struct pci_dev *pdev, pm_message_t state) static int de_suspend (struct pci_dev *pdev, pm_message_t state)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
rtnl_lock(); rtnl_lock();
if (netif_running (dev)) { if (netif_running (dev)) {
...@@ -2128,7 +2128,7 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -2128,7 +2128,7 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
static int de_resume (struct pci_dev *pdev) static int de_resume (struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct de_private *de = dev->priv; struct de_private *de = netdev_priv(dev);
int retval = 0; int retval = 0;
rtnl_lock(); rtnl_lock();
......
...@@ -337,7 +337,7 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l ...@@ -337,7 +337,7 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l
{ {
int i; int i;
unsigned retval = 0; unsigned retval = 0;
struct tulip_private *tp = dev->priv; struct tulip_private *tp = netdev_priv(dev);
void __iomem *ee_addr = tp->base_addr + CSR9; void __iomem *ee_addr = tp->base_addr + CSR9;
int read_cmd = location | (EE_READ_CMD << addr_len); int read_cmd = location | (EE_READ_CMD << addr_len);
......
...@@ -890,7 +890,7 @@ static struct net_device_stats * uli526x_get_stats(struct net_device *dev) ...@@ -890,7 +890,7 @@ static struct net_device_stats * uli526x_get_stats(struct net_device *dev)
static void uli526x_set_filter_mode(struct net_device * dev) static void uli526x_set_filter_mode(struct net_device * dev)
{ {
struct uli526x_board_info *db = dev->priv; struct uli526x_board_info *db = netdev_priv(dev);
unsigned long flags; unsigned long flags;
ULI526X_DBUG(0, "uli526x_set_filter_mode()", 0); ULI526X_DBUG(0, "uli526x_set_filter_mode()", 0);
......
...@@ -1797,7 +1797,7 @@ static irqreturn_t ...@@ -1797,7 +1797,7 @@ static irqreturn_t
typhoon_interrupt(int irq, void *dev_instance) typhoon_interrupt(int irq, void *dev_instance)
{ {
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct typhoon *tp = dev->priv; struct typhoon *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->ioaddr; void __iomem *ioaddr = tp->ioaddr;
u32 intr_status; u32 intr_status;
......
...@@ -344,14 +344,14 @@ static int mcs7830_init_dev(struct usbnet *dev) ...@@ -344,14 +344,14 @@ static int mcs7830_init_dev(struct usbnet *dev)
static int mcs7830_mdio_read(struct net_device *netdev, int phy_id, static int mcs7830_mdio_read(struct net_device *netdev, int phy_id,
int location) int location)
{ {
struct usbnet *dev = netdev->priv; struct usbnet *dev = netdev_priv(netdev);
return mcs7830_read_phy(dev, location); return mcs7830_read_phy(dev, location);
} }
static void mcs7830_mdio_write(struct net_device *netdev, int phy_id, static void mcs7830_mdio_write(struct net_device *netdev, int phy_id,
int location, int val) int location, int val)
{ {
struct usbnet *dev = netdev->priv; struct usbnet *dev = netdev_priv(netdev);
mcs7830_write_phy(dev, location, val); mcs7830_write_phy(dev, location, val);
} }
......
...@@ -125,7 +125,8 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, ...@@ -125,7 +125,8 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
unsigned int i; unsigned int i;
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
give_a_page(dev->priv, skb_shinfo(skb)->frags[i].page); give_a_page(netdev_priv(dev),
skb_shinfo(skb)->frags[i].page);
skb->data_len = 0; skb->data_len = 0;
skb_shinfo(skb)->nr_frags = 0; skb_shinfo(skb)->nr_frags = 0;
} }
......
...@@ -74,7 +74,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev, ...@@ -74,7 +74,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,
unsigned int hlen; unsigned int hlen;
char *dest; char *dest;
dlp = dev->priv; dlp = netdev_priv(dev);
hdr.control = FRAD_I_UI; hdr.control = FRAD_I_UI;
switch(type) switch(type)
...@@ -110,7 +110,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) ...@@ -110,7 +110,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
struct frhdr *hdr; struct frhdr *hdr;
int process, header; int process, header;
dlp = dev->priv; dlp = netdev_priv(dev);
if (!pskb_may_pull(skb, sizeof(*hdr))) { if (!pskb_may_pull(skb, sizeof(*hdr))) {
printk(KERN_NOTICE "%s: invalid data no header\n", printk(KERN_NOTICE "%s: invalid data no header\n",
dev->name); dev->name);
...@@ -196,7 +196,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) ...@@ -196,7 +196,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
if (!skb || !dev) if (!skb || !dev)
return(0); return(0);
dlp = dev->priv; dlp = netdev_priv(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -234,9 +234,9 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in ...@@ -234,9 +234,9 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
struct frad_local *flp; struct frad_local *flp;
int err; int err;
dlp = dev->priv; dlp = netdev_priv(dev);
flp = dlp->slave->priv; flp = netdev_priv(dlp->slave);
if (!get) if (!get)
{ {
...@@ -268,7 +268,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -268,7 +268,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return(-EPERM); return(-EPERM);
dlp = dev->priv; dlp = netdev_priv(dev);
switch(cmd) switch(cmd)
{ {
...@@ -297,7 +297,7 @@ static int dlci_change_mtu(struct net_device *dev, int new_mtu) ...@@ -297,7 +297,7 @@ static int dlci_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct dlci_local *dlp; struct dlci_local *dlp;
dlp = dev->priv; dlp = netdev_priv(dev);
return((*dlp->slave->change_mtu)(dlp->slave, new_mtu)); return((*dlp->slave->change_mtu)(dlp->slave, new_mtu));
} }
...@@ -308,7 +308,7 @@ static int dlci_open(struct net_device *dev) ...@@ -308,7 +308,7 @@ static int dlci_open(struct net_device *dev)
struct frad_local *flp; struct frad_local *flp;
int err; int err;
dlp = dev->priv; dlp = netdev_priv(dev);
if (!*(short *)(dev->dev_addr)) if (!*(short *)(dev->dev_addr))
return(-EINVAL); return(-EINVAL);
...@@ -316,7 +316,7 @@ static int dlci_open(struct net_device *dev) ...@@ -316,7 +316,7 @@ static int dlci_open(struct net_device *dev)
if (!netif_running(dlp->slave)) if (!netif_running(dlp->slave))
return(-ENOTCONN); return(-ENOTCONN);
flp = dlp->slave->priv; flp = netdev_priv(dlp->slave);
err = (*flp->activate)(dlp->slave, dev); err = (*flp->activate)(dlp->slave, dev);
if (err) if (err)
return(err); return(err);
...@@ -334,9 +334,9 @@ static int dlci_close(struct net_device *dev) ...@@ -334,9 +334,9 @@ static int dlci_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
dlp = dev->priv; dlp = netdev_priv(dev);
flp = dlp->slave->priv; flp = netdev_priv(dlp->slave);
err = (*flp->deactivate)(dlp->slave, dev); err = (*flp->deactivate)(dlp->slave, dev);
return 0; return 0;
...@@ -346,7 +346,7 @@ static struct net_device_stats *dlci_get_stats(struct net_device *dev) ...@@ -346,7 +346,7 @@ static struct net_device_stats *dlci_get_stats(struct net_device *dev)
{ {
struct dlci_local *dlp; struct dlci_local *dlp;
dlp = dev->priv; dlp = netdev_priv(dev);
return(&dlp->stats); return(&dlp->stats);
} }
...@@ -364,7 +364,7 @@ static int dlci_add(struct dlci_add *dlci) ...@@ -364,7 +364,7 @@ static int dlci_add(struct dlci_add *dlci)
if (!slave) if (!slave)
return -ENODEV; return -ENODEV;
if (slave->type != ARPHRD_FRAD || slave->priv == NULL) if (slave->type != ARPHRD_FRAD || netdev_priv(slave) == NULL)
goto err1; goto err1;
/* create device name */ /* create device name */
...@@ -390,11 +390,11 @@ static int dlci_add(struct dlci_add *dlci) ...@@ -390,11 +390,11 @@ static int dlci_add(struct dlci_add *dlci)
*(short *)(master->dev_addr) = dlci->dlci; *(short *)(master->dev_addr) = dlci->dlci;
dlp = (struct dlci_local *) master->priv; dlp = netdev_priv(master);
dlp->slave = slave; dlp->slave = slave;
dlp->master = master; dlp->master = master;
flp = slave->priv; flp = netdev_priv(slave);
err = (*flp->assoc)(slave, master); err = (*flp->assoc)(slave, master);
if (err < 0) if (err < 0)
goto err2; goto err2;
...@@ -434,9 +434,9 @@ static int dlci_del(struct dlci_add *dlci) ...@@ -434,9 +434,9 @@ static int dlci_del(struct dlci_add *dlci)
return(-EBUSY); return(-EBUSY);
} }
dlp = master->priv; dlp = netdev_priv(master);
slave = dlp->slave; slave = dlp->slave;
flp = slave->priv; flp = netdev_priv(slave);
rtnl_lock(); rtnl_lock();
err = (*flp->deassoc)(slave, master); err = (*flp->deassoc)(slave, master);
...@@ -490,7 +490,7 @@ static const struct header_ops dlci_header_ops = { ...@@ -490,7 +490,7 @@ static const struct header_ops dlci_header_ops = {
static void dlci_setup(struct net_device *dev) static void dlci_setup(struct net_device *dev)
{ {
struct dlci_local *dlp = dev->priv; struct dlci_local *dlp = netdev_priv(dev);
dev->flags = 0; dev->flags = 0;
dev->open = dlci_open; dev->open = dlci_open;
......
...@@ -185,7 +185,7 @@ static void sdla_stop(struct net_device *dev) ...@@ -185,7 +185,7 @@ static void sdla_stop(struct net_device *dev)
{ {
struct frad_local *flp; struct frad_local *flp;
flp = dev->priv; flp = netdev_priv(dev);
switch(flp->type) switch(flp->type)
{ {
case SDLA_S502A: case SDLA_S502A:
...@@ -212,7 +212,7 @@ static void sdla_start(struct net_device *dev) ...@@ -212,7 +212,7 @@ static void sdla_start(struct net_device *dev)
{ {
struct frad_local *flp; struct frad_local *flp;
flp = dev->priv; flp = netdev_priv(dev);
switch(flp->type) switch(flp->type)
{ {
case SDLA_S502A: case SDLA_S502A:
...@@ -432,7 +432,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags, ...@@ -432,7 +432,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags,
int ret, waiting, len; int ret, waiting, len;
long window; long window;
flp = dev->priv; flp = netdev_priv(dev);
window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF; window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF;
cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK)); cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK));
ret = 0; ret = 0;
...@@ -509,7 +509,7 @@ static int sdla_activate(struct net_device *slave, struct net_device *master) ...@@ -509,7 +509,7 @@ static int sdla_activate(struct net_device *slave, struct net_device *master)
struct frad_local *flp; struct frad_local *flp;
int i; int i;
flp = slave->priv; flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master) if (flp->master[i] == master)
...@@ -531,7 +531,7 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master) ...@@ -531,7 +531,7 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master)
struct frad_local *flp; struct frad_local *flp;
int i; int i;
flp = slave->priv; flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master) if (flp->master[i] == master)
...@@ -556,7 +556,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master) ...@@ -556,7 +556,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
if (master->type != ARPHRD_DLCI) if (master->type != ARPHRD_DLCI)
return(-EINVAL); return(-EINVAL);
flp = slave->priv; flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
{ {
...@@ -589,7 +589,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master) ...@@ -589,7 +589,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master)
struct frad_local *flp; struct frad_local *flp;
int i; int i;
flp = slave->priv; flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master) if (flp->master[i] == master)
...@@ -619,7 +619,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i ...@@ -619,7 +619,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
int i; int i;
short len, ret; short len, ret;
flp = slave->priv; flp = netdev_priv(slave);
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->master[i] == master) if (flp->master[i] == master)
...@@ -628,7 +628,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i ...@@ -628,7 +628,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
if (i == CONFIG_DLCI_MAX) if (i == CONFIG_DLCI_MAX)
return(-ENODEV); return(-ENODEV);
dlp = master->priv; dlp = netdev_priv(master);
ret = SDLA_RET_OK; ret = SDLA_RET_OK;
len = sizeof(struct dlci_conf); len = sizeof(struct dlci_conf);
...@@ -659,7 +659,7 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev) ...@@ -659,7 +659,7 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev)
unsigned long flags; unsigned long flags;
struct buf_entry *pbuf; struct buf_entry *pbuf;
flp = dev->priv; flp = netdev_priv(dev);
ret = 0; ret = 0;
accept = 1; accept = 1;
...@@ -755,7 +755,7 @@ static void sdla_receive(struct net_device *dev) ...@@ -755,7 +755,7 @@ static void sdla_receive(struct net_device *dev)
int i=0, received, success, addr, buf_base, buf_top; int i=0, received, success, addr, buf_base, buf_top;
short dlci, len, len2, split; short dlci, len, len2, split;
flp = dev->priv; flp = netdev_priv(dev);
success = 1; success = 1;
received = addr = buf_top = buf_base = 0; received = addr = buf_top = buf_base = 0;
len = dlci = 0; len = dlci = 0;
...@@ -860,7 +860,7 @@ static void sdla_receive(struct net_device *dev) ...@@ -860,7 +860,7 @@ static void sdla_receive(struct net_device *dev)
if (success) if (success)
{ {
flp->stats.rx_packets++; flp->stats.rx_packets++;
dlp = master->priv; dlp = netdev_priv(master);
(*dlp->receive)(skb, master); (*dlp->receive)(skb, master);
} }
...@@ -925,7 +925,7 @@ static void sdla_poll(unsigned long device) ...@@ -925,7 +925,7 @@ static void sdla_poll(unsigned long device)
struct frad_local *flp; struct frad_local *flp;
dev = (struct net_device *) device; dev = (struct net_device *) device;
flp = dev->priv; flp = netdev_priv(dev);
if (sdla_byte(dev, SDLA_502_RCV_BUF)) if (sdla_byte(dev, SDLA_502_RCV_BUF))
sdla_receive(dev); sdla_receive(dev);
...@@ -941,7 +941,7 @@ static int sdla_close(struct net_device *dev) ...@@ -941,7 +941,7 @@ static int sdla_close(struct net_device *dev)
int len, i; int len, i;
short dlcis[CONFIG_DLCI_MAX]; short dlcis[CONFIG_DLCI_MAX];
flp = dev->priv; flp = netdev_priv(dev);
len = 0; len = 0;
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
...@@ -1002,7 +1002,7 @@ static int sdla_open(struct net_device *dev) ...@@ -1002,7 +1002,7 @@ static int sdla_open(struct net_device *dev)
int len, i; int len, i;
char byte; char byte;
flp = dev->priv; flp = netdev_priv(dev);
if (!flp->initialized) if (!flp->initialized)
return(-EPERM); return(-EPERM);
...@@ -1079,7 +1079,7 @@ static int sdla_open(struct net_device *dev) ...@@ -1079,7 +1079,7 @@ static int sdla_open(struct net_device *dev)
for(i=0;i<CONFIG_DLCI_MAX;i++) for(i=0;i<CONFIG_DLCI_MAX;i++)
if (flp->dlci[i]) if (flp->dlci[i])
{ {
dlp = flp->master[i]->priv; dlp = netdev_priv(flp->master[i]);
if (dlp->configured) if (dlp->configured)
sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL); sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL);
} }
...@@ -1099,7 +1099,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in ...@@ -1099,7 +1099,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
if (dev->type == 0xFFFF) if (dev->type == 0xFFFF)
return(-EUNATCH); return(-EUNATCH);
flp = dev->priv; flp = netdev_priv(dev);
if (!get) if (!get)
{ {
...@@ -1230,7 +1230,7 @@ static int sdla_reconfig(struct net_device *dev) ...@@ -1230,7 +1230,7 @@ static int sdla_reconfig(struct net_device *dev)
struct conf_data data; struct conf_data data;
int i, len; int i, len;
flp = dev->priv; flp = netdev_priv(dev);
len = 0; len = 0;
for(i=0;i<CONFIG_DLCI_MAX;i++) 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,7 +1255,7 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if(!capable(CAP_NET_ADMIN)) if(!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
flp = dev->priv; flp = netdev_priv(dev);
if (!flp->initialized) if (!flp->initialized)
return(-EINVAL); return(-EINVAL);
...@@ -1321,7 +1321,7 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1321,7 +1321,7 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct frad_local *flp; struct frad_local *flp;
flp = dev->priv; flp = netdev_priv(dev);
if (netif_running(dev)) if (netif_running(dev))
return(-EBUSY); return(-EBUSY);
...@@ -1338,7 +1338,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map) ...@@ -1338,7 +1338,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
unsigned base; unsigned base;
int err = -EINVAL; int err = -EINVAL;
flp = dev->priv; flp = netdev_priv(dev);
if (flp->initialized) if (flp->initialized)
return(-EINVAL); return(-EINVAL);
...@@ -1593,14 +1593,14 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map) ...@@ -1593,14 +1593,14 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
static struct net_device_stats *sdla_stats(struct net_device *dev) static struct net_device_stats *sdla_stats(struct net_device *dev)
{ {
struct frad_local *flp; struct frad_local *flp;
flp = dev->priv; flp = netdev_priv(dev);
return(&flp->stats); return(&flp->stats);
} }
static void setup_sdla(struct net_device *dev) static void setup_sdla(struct net_device *dev)
{ {
struct frad_local *flp = dev->priv; struct frad_local *flp = netdev_priv(dev);
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);
...@@ -1651,7 +1651,7 @@ static int __init init_sdla(void) ...@@ -1651,7 +1651,7 @@ static int __init init_sdla(void)
static void __exit exit_sdla(void) static void __exit exit_sdla(void)
{ {
struct frad_local *flp = sdla->priv; struct frad_local *flp = netdev_priv(sdla);
unregister_netdev(sdla); unregister_netdev(sdla);
if (flp->initialized) { if (flp->initialized) {
......
...@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void) ...@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void)
if (dev == NULL) if (dev == NULL)
break; break;
sl = dev->priv; sl = netdev_priv(dev);
/* Not in use ? */ /* Not in use ? */
if (!test_and_set_bit(SLF_INUSE, &sl->flags)) if (!test_and_set_bit(SLF_INUSE, &sl->flags))
return sl; return sl;
...@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void) ...@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void)
return NULL; return NULL;
/* Initialize channel control data */ /* Initialize channel control data */
sl = dev->priv; sl = netdev_priv(dev);
dev->base_addr = i; dev->base_addr = i;
/* register device so that it can be ifconfig'ed */ /* register device so that it can be ifconfig'ed */
...@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl) ...@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl)
static int x25_asy_change_mtu(struct net_device *dev, int newmtu) static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
unsigned char *xbuff, *rbuff; unsigned char *xbuff, *rbuff;
int len = 2 * newmtu; int len = 2 * newmtu;
...@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty) ...@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
static void x25_asy_timeout(struct net_device *dev) static void x25_asy_timeout(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
spin_lock(&sl->lock); spin_lock(&sl->lock);
if (netif_queue_stopped(dev)) { if (netif_queue_stopped(dev)) {
...@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev) ...@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev)
static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
int err; int err;
if (!netif_running(sl->dev)) { if (!netif_running(sl->dev)) {
...@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb) ...@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
spin_lock(&sl->lock); spin_lock(&sl->lock);
if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { 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,7 +396,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
static void x25_asy_connected(struct net_device *dev, int reason) static void x25_asy_connected(struct net_device *dev, int reason)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
struct sk_buff *skb; struct sk_buff *skb;
unsigned char *ptr; unsigned char *ptr;
...@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason) ...@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
static void x25_asy_disconnected(struct net_device *dev, int reason) static void x25_asy_disconnected(struct net_device *dev, int reason)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
struct sk_buff *skb; struct sk_buff *skb;
unsigned char *ptr; unsigned char *ptr;
...@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = { ...@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = {
/* Open the low-level part of the X.25 channel. Easy! */ /* Open the low-level part of the X.25 channel. Easy! */
static int x25_asy_open(struct net_device *dev) static int x25_asy_open(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
unsigned long len; unsigned long len;
int err; int err;
...@@ -495,7 +495,7 @@ static int x25_asy_open(struct net_device *dev) ...@@ -495,7 +495,7 @@ static int x25_asy_open(struct net_device *dev)
/* Close the low-level part of the X.25 channel. Easy! */ /* Close the low-level part of the X.25 channel. Easy! */
static int x25_asy_close(struct net_device *dev) static int x25_asy_close(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
int err; int err;
spin_lock(&sl->lock); spin_lock(&sl->lock);
...@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty) ...@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)
static struct net_device_stats *x25_asy_get_stats(struct net_device *dev) static struct net_device_stats *x25_asy_get_stats(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
return &sl->stats; return &sl->stats;
} }
...@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, ...@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
static int x25_asy_open_dev(struct net_device *dev) static int x25_asy_open_dev(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
if (sl->tty == NULL) if (sl->tty == NULL)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev) ...@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev)
/* Initialise the X.25 driver. Called by the device init code */ /* Initialise the X.25 driver. Called by the device init code */
static void x25_asy_setup(struct net_device *dev) static void x25_asy_setup(struct net_device *dev)
{ {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
sl->magic = X25_ASY_MAGIC; sl->magic = X25_ASY_MAGIC;
sl->dev = dev; sl->dev = dev;
...@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void) ...@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void)
for (i = 0; i < x25_asy_maxdev; i++) { for (i = 0; i < x25_asy_maxdev; i++) {
dev = x25_asy_devs[i]; dev = x25_asy_devs[i];
if (dev) { if (dev) {
struct x25_asy *sl = dev->priv; struct x25_asy *sl = netdev_priv(dev);
spin_lock_bh(&sl->lock); spin_lock_bh(&sl->lock);
if (sl->tty) if (sl->tty)
......
...@@ -23,7 +23,7 @@ static const char * mesh_stat_strings[]= { ...@@ -23,7 +23,7 @@ static const char * mesh_stat_strings[]= {
static void lbs_ethtool_get_drvinfo(struct net_device *dev, static void lbs_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
struct lbs_private *priv = (struct lbs_private *) dev->priv; struct lbs_private *priv = netdev_priv(dev);
snprintf(info->fw_version, 32, "%u.%u.%u.p%u", snprintf(info->fw_version, 32, "%u.%u.%u.p%u",
priv->fwrelease >> 24 & 0xff, priv->fwrelease >> 24 & 0xff,
...@@ -47,7 +47,7 @@ static int lbs_ethtool_get_eeprom_len(struct net_device *dev) ...@@ -47,7 +47,7 @@ static int lbs_ethtool_get_eeprom_len(struct net_device *dev)
static int lbs_ethtool_get_eeprom(struct net_device *dev, static int lbs_ethtool_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 * bytes) struct ethtool_eeprom *eeprom, u8 * bytes)
{ {
struct lbs_private *priv = (struct lbs_private *) dev->priv; struct lbs_private *priv = netdev_priv(dev);
struct cmd_ds_802_11_eeprom_access cmd; struct cmd_ds_802_11_eeprom_access cmd;
int ret; int ret;
...@@ -76,7 +76,7 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev, ...@@ -76,7 +76,7 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev,
static void lbs_ethtool_get_stats(struct net_device *dev, static void lbs_ethtool_get_stats(struct net_device *dev,
struct ethtool_stats *stats, uint64_t *data) struct ethtool_stats *stats, uint64_t *data)
{ {
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
struct cmd_ds_mesh_access mesh_access; struct cmd_ds_mesh_access mesh_access;
int ret; int ret;
...@@ -113,7 +113,7 @@ static void lbs_ethtool_get_stats(struct net_device *dev, ...@@ -113,7 +113,7 @@ static void lbs_ethtool_get_stats(struct net_device *dev,
static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset) static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset)
{ {
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
if (sset == ETH_SS_STATS && dev == priv->mesh_dev) if (sset == ETH_SS_STATS && dev == priv->mesh_dev)
return MESH_STATS_NUM; return MESH_STATS_NUM;
...@@ -143,7 +143,7 @@ static void lbs_ethtool_get_strings(struct net_device *dev, ...@@ -143,7 +143,7 @@ static void lbs_ethtool_get_strings(struct net_device *dev,
static void lbs_ethtool_get_wol(struct net_device *dev, static void lbs_ethtool_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wol) struct ethtool_wolinfo *wol)
{ {
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
if (priv->wol_criteria == 0xffffffff) { if (priv->wol_criteria == 0xffffffff) {
/* Interface driver didn't configure wake */ /* Interface driver didn't configure wake */
...@@ -166,7 +166,7 @@ static void lbs_ethtool_get_wol(struct net_device *dev, ...@@ -166,7 +166,7 @@ static void lbs_ethtool_get_wol(struct net_device *dev,
static int lbs_ethtool_set_wol(struct net_device *dev, static int lbs_ethtool_set_wol(struct net_device *dev,
struct ethtool_wolinfo *wol) struct ethtool_wolinfo *wol)
{ {
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
uint32_t criteria = 0; uint32_t criteria = 0;
if (priv->wol_criteria == 0xffffffff && wol->wolopts) if (priv->wol_criteria == 0xffffffff && wol->wolopts)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static int mesh_get_default_parameters(struct device *dev, static int mesh_get_default_parameters(struct device *dev,
struct mrvl_mesh_defaults *defs) struct mrvl_mesh_defaults *defs)
{ {
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
int ret; int ret;
...@@ -57,7 +57,7 @@ static ssize_t bootflag_get(struct device *dev, ...@@ -57,7 +57,7 @@ static ssize_t bootflag_get(struct device *dev,
static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr, static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
uint32_t datum; uint32_t datum;
int ret; int ret;
...@@ -100,7 +100,7 @@ static ssize_t boottime_get(struct device *dev, ...@@ -100,7 +100,7 @@ static ssize_t boottime_get(struct device *dev,
static ssize_t boottime_set(struct device *dev, static ssize_t boottime_set(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
uint32_t datum; uint32_t datum;
int ret; int ret;
...@@ -152,7 +152,7 @@ static ssize_t channel_get(struct device *dev, ...@@ -152,7 +152,7 @@ static ssize_t channel_get(struct device *dev,
static ssize_t channel_set(struct device *dev, struct device_attribute *attr, static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
uint32_t datum; uint32_t datum;
int ret; int ret;
...@@ -210,7 +210,7 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr, ...@@ -210,7 +210,7 @@ static ssize_t mesh_id_set(struct device *dev, struct device_attribute *attr,
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
struct mrvl_mesh_defaults defs; struct mrvl_mesh_defaults defs;
struct mrvl_meshie *ie; struct mrvl_meshie *ie;
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
int len; int len;
int ret; int ret;
...@@ -269,7 +269,7 @@ static ssize_t protocol_id_set(struct device *dev, ...@@ -269,7 +269,7 @@ static ssize_t protocol_id_set(struct device *dev,
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
struct mrvl_mesh_defaults defs; struct mrvl_mesh_defaults defs;
struct mrvl_meshie *ie; struct mrvl_meshie *ie;
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
uint32_t datum; uint32_t datum;
int ret; int ret;
...@@ -323,7 +323,7 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr, ...@@ -323,7 +323,7 @@ static ssize_t metric_id_set(struct device *dev, struct device_attribute *attr,
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
struct mrvl_mesh_defaults defs; struct mrvl_mesh_defaults defs;
struct mrvl_meshie *ie; struct mrvl_meshie *ie;
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
uint32_t datum; uint32_t datum;
int ret; int ret;
...@@ -377,7 +377,7 @@ static ssize_t capability_set(struct device *dev, struct device_attribute *attr, ...@@ -377,7 +377,7 @@ static ssize_t capability_set(struct device *dev, struct device_attribute *attr,
struct cmd_ds_mesh_config cmd; struct cmd_ds_mesh_config cmd;
struct mrvl_mesh_defaults defs; struct mrvl_mesh_defaults defs;
struct mrvl_meshie *ie; struct mrvl_meshie *ie;
struct lbs_private *priv = to_net_dev(dev)->priv; struct lbs_private *priv = netdev_priv(to_net_dev(dev));
uint32_t datum; uint32_t datum;
int ret; int ret;
......
...@@ -945,7 +945,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -945,7 +945,7 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
DECLARE_SSID_BUF(ssid); DECLARE_SSID_BUF(ssid);
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_WEXT); lbs_deb_enter(LBS_DEB_WEXT);
...@@ -1008,7 +1008,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info, ...@@ -1008,7 +1008,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra) struct iw_point *dwrq, char *extra)
{ {
#define SCAN_ITEM_SIZE 128 #define SCAN_ITEM_SIZE 128
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
int err = 0; int err = 0;
char *ev = extra; char *ev = extra;
char *stop = ev + dwrq->length; char *stop = ev + dwrq->length;
......
...@@ -60,7 +60,7 @@ static u32 convert_radiotap_rate_to_mv(u8 rate) ...@@ -60,7 +60,7 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
unsigned long flags; unsigned long flags;
struct lbs_private *priv = dev->priv; struct lbs_private *priv = netdev_priv(dev);
struct txpd *txpd; struct txpd *txpd;
char *p802x_hdr; char *p802x_hdr;
uint16_t pkt_len; uint16_t pkt_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment