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);
......
This diff is collapsed.
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