Commit 35c49f89 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[netdrvr] netdev_priv for ewrk3, xircom_tulip_cb, wavelan_cs

parent 0f65172c
...@@ -532,7 +532,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase) ...@@ -532,7 +532,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
printk(" is in I/O only mode"); printk(" is in I/O only mode");
} }
lp = (struct ewrk3_private *) dev->priv; lp = netdev_priv(dev);
lp->shmem_base = mem_start; lp->shmem_base = mem_start;
lp->shmem_length = shmem_length; lp->shmem_length = shmem_length;
lp->lemac = lemac; lp->lemac = lemac;
...@@ -621,7 +621,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase) ...@@ -621,7 +621,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
static int ewrk3_open(struct net_device *dev) static int ewrk3_open(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i, status = 0; int i, status = 0;
u_char icr, csr; u_char icr, csr;
...@@ -684,7 +684,7 @@ static int ewrk3_open(struct net_device *dev) ...@@ -684,7 +684,7 @@ static int ewrk3_open(struct net_device *dev)
*/ */
static void ewrk3_init(struct net_device *dev) static void ewrk3_init(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_char csr, page; u_char csr, page;
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i; int i;
...@@ -725,7 +725,7 @@ static void ewrk3_init(struct net_device *dev) ...@@ -725,7 +725,7 @@ static void ewrk3_init(struct net_device *dev)
static void ewrk3_timeout(struct net_device *dev) static void ewrk3_timeout(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_char icr, csr; u_char icr, csr;
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
...@@ -761,7 +761,7 @@ static void ewrk3_timeout(struct net_device *dev) ...@@ -761,7 +761,7 @@ static void ewrk3_timeout(struct net_device *dev)
*/ */
static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev) static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
u_long buf = 0; u_long buf = 0;
u_char icr; u_char icr;
...@@ -883,7 +883,7 @@ static irqreturn_t ewrk3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -883,7 +883,7 @@ static irqreturn_t ewrk3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
u_long iobase; u_long iobase;
u_char icr, cr, csr; u_char icr, cr, csr;
lp = (struct ewrk3_private *) dev->priv; lp = netdev_priv(dev);
iobase = dev->base_addr; iobase = dev->base_addr;
/* get the interrupt information */ /* get the interrupt information */
...@@ -931,7 +931,7 @@ static irqreturn_t ewrk3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -931,7 +931,7 @@ static irqreturn_t ewrk3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* Called with lp->hw_lock held */ /* Called with lp->hw_lock held */
static int ewrk3_rx(struct net_device *dev) static int ewrk3_rx(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i, status = 0; int i, status = 0;
u_char page; u_char page;
...@@ -1059,7 +1059,7 @@ static int ewrk3_rx(struct net_device *dev) ...@@ -1059,7 +1059,7 @@ static int ewrk3_rx(struct net_device *dev)
*/ */
static int ewrk3_tx(struct net_device *dev) static int ewrk3_tx(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
u_char tx_status; u_char tx_status;
...@@ -1095,7 +1095,7 @@ static int ewrk3_tx(struct net_device *dev) ...@@ -1095,7 +1095,7 @@ static int ewrk3_tx(struct net_device *dev)
static int ewrk3_close(struct net_device *dev) static int ewrk3_close(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
u_char icr, csr; u_char icr, csr;
...@@ -1130,7 +1130,7 @@ static int ewrk3_close(struct net_device *dev) ...@@ -1130,7 +1130,7 @@ static int ewrk3_close(struct net_device *dev)
static struct net_device_stats *ewrk3_get_stats(struct net_device *dev) static struct net_device_stats *ewrk3_get_stats(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
/* Null body since there is no framing error counter */ /* Null body since there is no framing error counter */
return &lp->stats; return &lp->stats;
...@@ -1141,7 +1141,7 @@ static struct net_device_stats *ewrk3_get_stats(struct net_device *dev) ...@@ -1141,7 +1141,7 @@ static struct net_device_stats *ewrk3_get_stats(struct net_device *dev)
*/ */
static void set_multicast_list(struct net_device *dev) static void set_multicast_list(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
u_char csr; u_char csr;
...@@ -1174,7 +1174,7 @@ static void set_multicast_list(struct net_device *dev) ...@@ -1174,7 +1174,7 @@ static void set_multicast_list(struct net_device *dev)
*/ */
static void SetMulticastFilter(struct net_device *dev) static void SetMulticastFilter(struct net_device *dev)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i; int i;
...@@ -1522,7 +1522,7 @@ static int __init EISA_signature(char *name, s32 eisa_id) ...@@ -1522,7 +1522,7 @@ static int __init EISA_signature(char *name, s32 eisa_id)
static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr) static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
u32 ethcmd; u32 ethcmd;
...@@ -1708,7 +1708,7 @@ static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr) ...@@ -1708,7 +1708,7 @@ static int ewrk3_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
*/ */
static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv; struct ewrk3_private *lp = netdev_priv(dev);
struct ewrk3_ioctl *ioc = (struct ewrk3_ioctl *) &rq->ifr_ifru; struct ewrk3_ioctl *ioc = (struct ewrk3_ioctl *) &rq->ifr_ifru;
u_long iobase = dev->base_addr; u_long iobase = dev->base_addr;
int i, j, status = 0; int i, j, status = 0;
......
...@@ -450,7 +450,7 @@ static void __devinit read_mac_address(struct net_device *dev) ...@@ -450,7 +450,7 @@ static void __devinit read_mac_address(struct net_device *dev)
*/ */
static void find_mii_transceivers(struct net_device *dev) static void find_mii_transceivers(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
int phy, phy_idx; int phy, phy_idx;
if (media_cap[tp->default_port] & MediaIsMII) { if (media_cap[tp->default_port] & MediaIsMII) {
...@@ -505,7 +505,7 @@ static void find_mii_transceivers(struct net_device *dev) ...@@ -505,7 +505,7 @@ static void find_mii_transceivers(struct net_device *dev)
*/ */
static void transceiver_voodoo(struct net_device *dev) static void transceiver_voodoo(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
/* Reset the chip, holding bit 0 set at least 50 PCI cycles. */ /* Reset the chip, holding bit 0 set at least 50 PCI cycles. */
...@@ -584,7 +584,7 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi ...@@ -584,7 +584,7 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi
/* Clear the missed-packet counter. */ /* Clear the missed-packet counter. */
(volatile int)inl(ioaddr + CSR8); (volatile int)inl(ioaddr + CSR8);
tp = dev->priv; tp = netdev_priv(dev);
tp->lock = SPIN_LOCK_UNLOCKED; tp->lock = SPIN_LOCK_UNLOCKED;
tp->pdev = pdev; tp->pdev = pdev;
...@@ -749,7 +749,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val ...@@ -749,7 +749,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
static void static void
xircom_up(struct net_device *dev) xircom_up(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int i; int i;
...@@ -804,7 +804,7 @@ xircom_up(struct net_device *dev) ...@@ -804,7 +804,7 @@ xircom_up(struct net_device *dev)
static int static int
xircom_open(struct net_device *dev) xircom_open(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev)) if (request_irq(dev->irq, &xircom_interrupt, SA_SHIRQ, dev->name, dev))
return -EAGAIN; return -EAGAIN;
...@@ -818,7 +818,7 @@ xircom_open(struct net_device *dev) ...@@ -818,7 +818,7 @@ xircom_open(struct net_device *dev)
static void xircom_tx_timeout(struct net_device *dev) static void xircom_tx_timeout(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
if (media_cap[dev->if_port] & MediaIsMII) { if (media_cap[dev->if_port] & MediaIsMII) {
...@@ -870,7 +870,7 @@ static void xircom_tx_timeout(struct net_device *dev) ...@@ -870,7 +870,7 @@ static void xircom_tx_timeout(struct net_device *dev)
/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
static void xircom_init_ring(struct net_device *dev) static void xircom_init_ring(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
int i; int i;
tp->tx_full = 0; tp->tx_full = 0;
...@@ -919,7 +919,7 @@ static void xircom_init_ring(struct net_device *dev) ...@@ -919,7 +919,7 @@ static void xircom_init_ring(struct net_device *dev)
static int static int
xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
int entry; int entry;
u32 flag; u32 flag;
...@@ -971,7 +971,7 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -971,7 +971,7 @@ xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
static void xircom_media_change(struct net_device *dev) static void xircom_media_change(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
u16 reg0, reg1, reg4, reg5; u16 reg0, reg1, reg4, reg5;
u32 csr6 = inl(ioaddr + CSR6), newcsr6; u32 csr6 = inl(ioaddr + CSR6), newcsr6;
...@@ -1032,7 +1032,7 @@ static void xircom_media_change(struct net_device *dev) ...@@ -1032,7 +1032,7 @@ static void xircom_media_change(struct net_device *dev)
static void check_duplex(struct net_device *dev) static void check_duplex(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
u16 reg0; u16 reg0;
mdio_write(dev, tp->phys[0], MII_BMCR, BMCR_RESET); mdio_write(dev, tp->phys[0], MII_BMCR, BMCR_RESET);
...@@ -1065,7 +1065,7 @@ static void check_duplex(struct net_device *dev) ...@@ -1065,7 +1065,7 @@ static void check_duplex(struct net_device *dev)
static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs) static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{ {
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int csr5, work_budget = max_interrupt_work; int csr5, work_budget = max_interrupt_work;
int handled = 0; int handled = 0;
...@@ -1203,7 +1203,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs ...@@ -1203,7 +1203,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs
static int static int
xircom_rx(struct net_device *dev) xircom_rx(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
int entry = tp->cur_rx % RX_RING_SIZE; int entry = tp->cur_rx % RX_RING_SIZE;
int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx; int rx_work_limit = tp->dirty_rx + RX_RING_SIZE - tp->cur_rx;
int work_done = 0; int work_done = 0;
...@@ -1303,7 +1303,7 @@ static void ...@@ -1303,7 +1303,7 @@ static void
xircom_down(struct net_device *dev) xircom_down(struct net_device *dev)
{ {
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
/* Disable interrupts by clearing the interrupt mask. */ /* Disable interrupts by clearing the interrupt mask. */
outl(0, ioaddr + CSR7); outl(0, ioaddr + CSR7);
...@@ -1321,7 +1321,7 @@ static int ...@@ -1321,7 +1321,7 @@ static int
xircom_close(struct net_device *dev) xircom_close(struct net_device *dev)
{ {
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
int i; int i;
if (xircom_debug > 1) if (xircom_debug > 1)
...@@ -1359,7 +1359,7 @@ xircom_close(struct net_device *dev) ...@@ -1359,7 +1359,7 @@ xircom_close(struct net_device *dev)
static struct net_device_stats *xircom_get_stats(struct net_device *dev) static struct net_device_stats *xircom_get_stats(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
if (netif_device_present(dev)) if (netif_device_present(dev))
...@@ -1372,7 +1372,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev) ...@@ -1372,7 +1372,7 @@ static struct net_device_stats *xircom_get_stats(struct net_device *dev)
static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr) static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
{ {
struct ethtool_cmd ecmd; struct ethtool_cmd ecmd;
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) if (copy_from_user(&ecmd, useraddr, sizeof(ecmd)))
return -EFAULT; return -EFAULT;
...@@ -1470,7 +1470,7 @@ static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr) ...@@ -1470,7 +1470,7 @@ static int xircom_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
/* Provide ioctl() calls to examine the MII xcvr state. */ /* Provide ioctl() calls to examine the MII xcvr state. */
static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
u16 *data = (u16 *)&rq->ifr_ifru; u16 *data = (u16 *)&rq->ifr_ifru;
int phy = tp->phys[0] & 0x1f; int phy = tp->phys[0] & 0x1f;
unsigned long flags; unsigned long flags;
...@@ -1531,7 +1531,7 @@ static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1531,7 +1531,7 @@ static int xircom_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
when re-entered but still correct. */ when re-entered but still correct. */
static void set_rx_mode(struct net_device *dev) static void set_rx_mode(struct net_device *dev)
{ {
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
struct dev_mc_list *mclist; struct dev_mc_list *mclist;
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int csr6 = inl(ioaddr + CSR6); int csr6 = inl(ioaddr + CSR6);
...@@ -1672,7 +1672,7 @@ MODULE_DEVICE_TABLE(pci, xircom_pci_table); ...@@ -1672,7 +1672,7 @@ MODULE_DEVICE_TABLE(pci, xircom_pci_table);
static int xircom_suspend(struct pci_dev *pdev, u32 state) static int xircom_suspend(struct pci_dev *pdev, u32 state)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
printk(KERN_INFO "xircom_suspend(%s)\n", dev->name); printk(KERN_INFO "xircom_suspend(%s)\n", dev->name);
if (tp->open) if (tp->open)
xircom_down(dev); xircom_down(dev);
...@@ -1688,7 +1688,7 @@ static int xircom_suspend(struct pci_dev *pdev, u32 state) ...@@ -1688,7 +1688,7 @@ static int xircom_suspend(struct pci_dev *pdev, u32 state)
static int xircom_resume(struct pci_dev *pdev) static int xircom_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct xircom_private *tp = dev->priv; struct xircom_private *tp = netdev_priv(dev);
printk(KERN_INFO "xircom_resume(%s)\n", dev->name); printk(KERN_INFO "xircom_resume(%s)\n", dev->name);
pci_set_power_state(pdev,0); pci_set_power_state(pdev,0);
......
...@@ -502,7 +502,7 @@ unsigned char WAVELAN_BEACON_ADDRESS[]= {0x09,0x00,0x0e,0x20,0x03,0x00}; ...@@ -502,7 +502,7 @@ unsigned char WAVELAN_BEACON_ADDRESS[]= {0x09,0x00,0x0e,0x20,0x03,0x00};
void wv_roam_init(struct net_device *dev) void wv_roam_init(struct net_device *dev)
{ {
net_local *lp= (net_local *)dev->priv; net_local *lp= netdev_priv(dev);
/* Do not remove this unless you have a good reason */ /* Do not remove this unless you have a good reason */
printk(KERN_NOTICE "%s: Warning, you have enabled roaming on" printk(KERN_NOTICE "%s: Warning, you have enabled roaming on"
...@@ -532,7 +532,7 @@ void wv_roam_init(struct net_device *dev) ...@@ -532,7 +532,7 @@ void wv_roam_init(struct net_device *dev)
void wv_roam_cleanup(struct net_device *dev) void wv_roam_cleanup(struct net_device *dev)
{ {
wavepoint_history *ptr,*old_ptr; wavepoint_history *ptr,*old_ptr;
net_local *lp= (net_local *)dev->priv; net_local *lp= netdev_priv(dev);
printk(KERN_DEBUG "WaveLAN: Roaming Disabled on device %s\n",dev->name); printk(KERN_DEBUG "WaveLAN: Roaming Disabled on device %s\n",dev->name);
...@@ -762,7 +762,7 @@ static inline void wl_roam_gather(struct net_device * dev, ...@@ -762,7 +762,7 @@ static inline void wl_roam_gather(struct net_device * dev,
unsigned short nwid=ntohs(beacon->nwid); unsigned short nwid=ntohs(beacon->nwid);
unsigned short sigqual=stats[2] & MMR_SGNL_QUAL; /* SNR of beacon */ unsigned short sigqual=stats[2] & MMR_SGNL_QUAL; /* SNR of beacon */
wavepoint_history *wavepoint=NULL; /* WavePoint table entry */ wavepoint_history *wavepoint=NULL; /* WavePoint table entry */
net_local *lp=(net_local *)dev->priv; /* Device info */ net_local *lp = netdev_priv(dev); /* Device info */
#ifdef I_NEED_THIS_FEATURE #ifdef I_NEED_THIS_FEATURE
/* Some people don't need this, some other may need it */ /* Some people don't need this, some other may need it */
...@@ -1006,7 +1006,7 @@ read_ringbuf(struct net_device * dev, ...@@ -1006,7 +1006,7 @@ read_ringbuf(struct net_device * dev,
static inline void static inline void
wv_82593_reconfig(struct net_device * dev) wv_82593_reconfig(struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = netdev_priv(dev);
dev_link_t * link = lp->link; dev_link_t * link = lp->link;
unsigned long flags; unsigned long flags;
...@@ -1135,7 +1135,7 @@ static void ...@@ -1135,7 +1135,7 @@ static void
wv_mmc_show(struct net_device * dev) wv_mmc_show(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *)dev->priv; net_local * lp = netdev_priv(dev);
mmr_t m; mmr_t m;
/* Basic check */ /* Basic check */
...@@ -1224,7 +1224,7 @@ wv_mmc_show(struct net_device * dev) ...@@ -1224,7 +1224,7 @@ wv_mmc_show(struct net_device * dev)
static void static void
wv_ru_show(struct net_device * dev) wv_ru_show(struct net_device * dev)
{ {
net_local *lp = (net_local *) dev->priv; net_local *lp = netdev_priv(dev);
printk(KERN_DEBUG "##### wavelan i82593 receiver status: #####\n"); printk(KERN_DEBUG "##### wavelan i82593 receiver status: #####\n");
printk(KERN_DEBUG "ru: rfp %d stop %d", lp->rfp, lp->stop); printk(KERN_DEBUG "ru: rfp %d stop %d", lp->rfp, lp->stop);
...@@ -1258,9 +1258,7 @@ wv_dev_show(struct net_device * dev) ...@@ -1258,9 +1258,7 @@ wv_dev_show(struct net_device * dev)
static void static void
wv_local_show(struct net_device * dev) wv_local_show(struct net_device * dev)
{ {
net_local *lp; net_local *lp = netdev_priv(dev);
lp = (net_local *)dev->priv;
printk(KERN_DEBUG "local:"); printk(KERN_DEBUG "local:");
/* /*
...@@ -1418,7 +1416,7 @@ wavelan_get_stats(struct net_device * dev) ...@@ -1418,7 +1416,7 @@ wavelan_get_stats(struct net_device * dev)
printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name); printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);
#endif #endif
return(&((net_local *) dev->priv)->stats); return(&((net_local *)netdev_priv(dev))->stats);
} }
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
...@@ -1433,7 +1431,7 @@ wavelan_get_stats(struct net_device * dev) ...@@ -1433,7 +1431,7 @@ wavelan_get_stats(struct net_device * dev)
static void static void
wavelan_set_multicast_list(struct net_device * dev) wavelan_set_multicast_list(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
#ifdef DEBUG_IOCTL_TRACE #ifdef DEBUG_IOCTL_TRACE
printk(KERN_DEBUG "%s: ->wavelan_set_multicast_list()\n", dev->name); printk(KERN_DEBUG "%s: ->wavelan_set_multicast_list()\n", dev->name);
...@@ -1826,7 +1824,7 @@ static inline void ...@@ -1826,7 +1824,7 @@ static inline void
wl_his_gather(struct net_device * dev, wl_his_gather(struct net_device * dev,
u_char * stats) /* Statistics to gather */ u_char * stats) /* Statistics to gather */
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
u_char level = stats[0] & MMR_SIGNAL_LVL; u_char level = stats[0] & MMR_SIGNAL_LVL;
int i; int i;
...@@ -1885,7 +1883,7 @@ static int wavelan_set_nwid(struct net_device *dev, ...@@ -1885,7 +1883,7 @@ static int wavelan_set_nwid(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
mm_t m; mm_t m;
unsigned long flags; unsigned long flags;
...@@ -1943,7 +1941,7 @@ static int wavelan_get_nwid(struct net_device *dev, ...@@ -1943,7 +1941,7 @@ static int wavelan_get_nwid(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -1975,7 +1973,7 @@ static int wavelan_set_freq(struct net_device *dev, ...@@ -1975,7 +1973,7 @@ static int wavelan_set_freq(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int ret; int ret;
...@@ -2005,7 +2003,7 @@ static int wavelan_get_freq(struct net_device *dev, ...@@ -2005,7 +2003,7 @@ static int wavelan_get_freq(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2051,7 +2049,7 @@ static int wavelan_set_sens(struct net_device *dev, ...@@ -2051,7 +2049,7 @@ static int wavelan_set_sens(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2086,7 +2084,7 @@ static int wavelan_get_sens(struct net_device *dev, ...@@ -2086,7 +2084,7 @@ static int wavelan_get_sens(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2117,7 +2115,7 @@ static int wavelan_set_encode(struct net_device *dev, ...@@ -2117,7 +2115,7 @@ static int wavelan_set_encode(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
psa_t psa; psa_t psa;
int ret = 0; int ret = 0;
...@@ -2187,7 +2185,7 @@ static int wavelan_get_encode(struct net_device *dev, ...@@ -2187,7 +2185,7 @@ static int wavelan_get_encode(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2234,7 +2232,7 @@ static int wavelan_set_essid(struct net_device *dev, ...@@ -2234,7 +2232,7 @@ static int wavelan_set_essid(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2282,7 +2280,7 @@ static int wavelan_get_essid(struct net_device *dev, ...@@ -2282,7 +2280,7 @@ static int wavelan_get_essid(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
/* Is the domain ID active ? */ /* Is the domain ID active ? */
wrqu->data.flags = lp->filter_domains; wrqu->data.flags = lp->filter_domains;
...@@ -2347,7 +2345,7 @@ static int wavelan_set_mode(struct net_device *dev, ...@@ -2347,7 +2345,7 @@ static int wavelan_set_mode(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2406,7 +2404,7 @@ static int wavelan_get_range(struct net_device *dev, ...@@ -2406,7 +2404,7 @@ static int wavelan_get_range(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
struct iw_range *range = (struct iw_range *) extra; struct iw_range *range = (struct iw_range *) extra;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -2476,7 +2474,7 @@ static int wavelan_set_qthr(struct net_device *dev, ...@@ -2476,7 +2474,7 @@ static int wavelan_set_qthr(struct net_device *dev,
char *extra) char *extra)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
...@@ -2507,7 +2505,7 @@ static int wavelan_get_qthr(struct net_device *dev, ...@@ -2507,7 +2505,7 @@ static int wavelan_get_qthr(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
psa_t psa; psa_t psa;
unsigned long flags; unsigned long flags;
...@@ -2535,7 +2533,7 @@ static int wavelan_set_roam(struct net_device *dev, ...@@ -2535,7 +2533,7 @@ static int wavelan_set_roam(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
/* Disable interrupts and save flags. */ /* Disable interrupts and save flags. */
...@@ -2580,7 +2578,7 @@ static int wavelan_set_histo(struct net_device *dev, ...@@ -2580,7 +2578,7 @@ static int wavelan_set_histo(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
/* Check the number of intervals. */ /* Check the number of intervals. */
if (wrqu->data.length > 16) { if (wrqu->data.length > 16) {
...@@ -2623,7 +2621,7 @@ static int wavelan_get_histo(struct net_device *dev, ...@@ -2623,7 +2621,7 @@ static int wavelan_get_histo(struct net_device *dev,
union iwreq_data *wrqu, union iwreq_data *wrqu,
char *extra) char *extra)
{ {
net_local *lp = (net_local *) dev->priv; /* lp is not unused */ net_local *lp = netdev_priv(dev);
/* Set the number of intervals. */ /* Set the number of intervals. */
wrqu->data.length = lp->his_number; wrqu->data.length = lp->his_number;
...@@ -2788,7 +2786,7 @@ static iw_stats * ...@@ -2788,7 +2786,7 @@ static iw_stats *
wavelan_get_wireless_stats(struct net_device * dev) wavelan_get_wireless_stats(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
mmr_t m; mmr_t m;
iw_stats * wstats; iw_stats * wstats;
unsigned long flags; unsigned long flags;
...@@ -2913,7 +2911,7 @@ wv_packet_read(struct net_device * dev, ...@@ -2913,7 +2911,7 @@ wv_packet_read(struct net_device * dev,
int fd_p, int fd_p,
int sksize) int sksize)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
struct sk_buff * skb; struct sk_buff * skb;
#ifdef DEBUG_RX_TRACE #ifdef DEBUG_RX_TRACE
...@@ -3015,7 +3013,7 @@ static inline void ...@@ -3015,7 +3013,7 @@ static inline void
wv_packet_rcv(struct net_device * dev) wv_packet_rcv(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
int newrfp; int newrfp;
int rp; int rp;
int len; int len;
...@@ -3150,7 +3148,7 @@ wv_packet_write(struct net_device * dev, ...@@ -3150,7 +3148,7 @@ wv_packet_write(struct net_device * dev,
void * buf, void * buf,
short length) short length)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
unsigned long flags; unsigned long flags;
int clen = length; int clen = length;
...@@ -3211,7 +3209,7 @@ static int ...@@ -3211,7 +3209,7 @@ static int
wavelan_packet_xmit(struct sk_buff * skb, wavelan_packet_xmit(struct sk_buff * skb,
struct net_device * dev) struct net_device * dev)
{ {
net_local * lp = (net_local *)dev->priv; net_local * lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
#ifdef DEBUG_TX_TRACE #ifdef DEBUG_TX_TRACE
...@@ -3470,7 +3468,7 @@ static int ...@@ -3470,7 +3468,7 @@ static int
wv_ru_stop(struct net_device * dev) wv_ru_stop(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int status; int status;
int spin; int spin;
...@@ -3533,7 +3531,7 @@ static int ...@@ -3533,7 +3531,7 @@ static int
wv_ru_start(struct net_device * dev) wv_ru_start(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
...@@ -3621,7 +3619,7 @@ static int ...@@ -3621,7 +3619,7 @@ static int
wv_82593_config(struct net_device * dev) wv_82593_config(struct net_device * dev)
{ {
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
struct i82593_conf_block cfblk; struct i82593_conf_block cfblk;
int ret = TRUE; int ret = TRUE;
...@@ -3796,7 +3794,7 @@ wv_pcmcia_reset(struct net_device * dev) ...@@ -3796,7 +3794,7 @@ wv_pcmcia_reset(struct net_device * dev)
{ {
int i; int i;
conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 }; conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 };
dev_link_t * link = ((net_local *) dev->priv)->link; dev_link_t * link = ((net_local *)netdev_priv(dev))->link;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name); printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name);
...@@ -3856,7 +3854,7 @@ wv_pcmcia_reset(struct net_device * dev) ...@@ -3856,7 +3854,7 @@ wv_pcmcia_reset(struct net_device * dev)
static int static int
wv_hw_config(struct net_device * dev) wv_hw_config(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
unsigned long flags; unsigned long flags;
int ret = FALSE; int ret = FALSE;
...@@ -3963,7 +3961,7 @@ wv_hw_config(struct net_device * dev) ...@@ -3963,7 +3961,7 @@ wv_hw_config(struct net_device * dev)
static inline void static inline void
wv_hw_reset(struct net_device * dev) wv_hw_reset(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "%s: ->wv_hw_reset()\n", dev->name); printk(KERN_DEBUG "%s: ->wv_hw_reset()\n", dev->name);
...@@ -4131,8 +4129,8 @@ wv_pcmcia_config(dev_link_t * link) ...@@ -4131,8 +4129,8 @@ wv_pcmcia_config(dev_link_t * link)
return FALSE; return FALSE;
} }
strcpy(((net_local *) dev->priv)->node.dev_name, dev->name); strcpy(((net_local *) netdev_priv(dev))->node.dev_name, dev->name);
link->dev = &((net_local *) dev->priv)->node; link->dev = &((net_local *) netdev_priv(dev))->node;
#ifdef DEBUG_CONFIG_TRACE #ifdef DEBUG_CONFIG_TRACE
printk(KERN_DEBUG "<-wv_pcmcia_config()\n"); printk(KERN_DEBUG "<-wv_pcmcia_config()\n");
...@@ -4203,7 +4201,7 @@ wavelan_interrupt(int irq, ...@@ -4203,7 +4201,7 @@ wavelan_interrupt(int irq,
printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
#endif #endif
lp = (net_local *) dev->priv; lp = netdev_priv(dev);
base = dev->base_addr; base = dev->base_addr;
#ifdef DEBUG_INTERRUPT_INFO #ifdef DEBUG_INTERRUPT_INFO
...@@ -4453,7 +4451,7 @@ wavelan_interrupt(int irq, ...@@ -4453,7 +4451,7 @@ wavelan_interrupt(int irq,
static void static void
wavelan_watchdog(struct net_device * dev) wavelan_watchdog(struct net_device * dev)
{ {
net_local * lp = (net_local *) dev->priv; net_local * lp = netdev_priv(dev);
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
unsigned long flags; unsigned long flags;
int aborted = FALSE; int aborted = FALSE;
...@@ -4528,8 +4526,8 @@ wavelan_watchdog(struct net_device * dev) ...@@ -4528,8 +4526,8 @@ wavelan_watchdog(struct net_device * dev)
static int static int
wavelan_open(struct net_device * dev) wavelan_open(struct net_device * dev)
{ {
dev_link_t * link = ((net_local *) dev->priv)->link; net_local * lp = netdev_priv(dev);
net_local * lp = (net_local *)dev->priv; dev_link_t * link = lp->link;
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
#ifdef DEBUG_CALLBACK_TRACE #ifdef DEBUG_CALLBACK_TRACE
...@@ -4583,7 +4581,7 @@ wavelan_open(struct net_device * dev) ...@@ -4583,7 +4581,7 @@ wavelan_open(struct net_device * dev)
static int static int
wavelan_close(struct net_device * dev) wavelan_close(struct net_device * dev)
{ {
dev_link_t * link = ((net_local *) dev->priv)->link; dev_link_t * link = ((net_local *)netdev_priv(dev))->link;
ioaddr_t base = dev->base_addr; ioaddr_t base = dev->base_addr;
#ifdef DEBUG_CALLBACK_TRACE #ifdef DEBUG_CALLBACK_TRACE
...@@ -4686,7 +4684,7 @@ wavelan_attach(void) ...@@ -4686,7 +4684,7 @@ wavelan_attach(void)
} }
link->priv = link->irq.Instance = dev; link->priv = link->irq.Instance = dev;
lp = dev->priv; lp = netdev_priv(dev);
/* Init specific data */ /* Init specific data */
lp->configured = 0; lp->configured = 0;
...@@ -4820,8 +4818,8 @@ wavelan_detach(dev_link_t * link) ...@@ -4820,8 +4818,8 @@ wavelan_detach(dev_link_t * link)
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
link->dev = NULL; link->dev = NULL;
((net_local *) dev->priv)->link = NULL; ((net_local *)netdev_priv(dev))->link = NULL;
((net_local *) dev->priv)->dev = NULL; ((net_local *)netdev_priv(dev))->dev = NULL;
free_netdev(dev); free_netdev(dev);
} }
kfree(link); kfree(link);
......
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