aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/axnet_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/axnet_cs.c')
-rw-r--r--drivers/net/pcmcia/axnet_cs.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 5ca0d5718583..58dc7c3835f4 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -117,7 +117,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id, struct pt_regs *regs);
117/*====================================================================*/ 117/*====================================================================*/
118 118
119typedef struct axnet_dev_t { 119typedef struct axnet_dev_t {
120 dev_link_t link; 120 struct pcmcia_device *p_dev;
121 dev_node_t node; 121 dev_node_t node;
122 caddr_t base; 122 caddr_t base;
123 struct timer_list watchdog; 123 struct timer_list watchdog;
@@ -145,8 +145,8 @@ static inline axnet_dev_t *PRIV(struct net_device *dev)
145static int axnet_attach(struct pcmcia_device *p_dev) 145static int axnet_attach(struct pcmcia_device *p_dev)
146{ 146{
147 axnet_dev_t *info; 147 axnet_dev_t *info;
148 dev_link_t *link;
149 struct net_device *dev; 148 struct net_device *dev;
149 dev_link_t *link = dev_to_instance(p_dev);
150 150
151 DEBUG(0, "axnet_attach()\n"); 151 DEBUG(0, "axnet_attach()\n");
152 152
@@ -157,7 +157,7 @@ static int axnet_attach(struct pcmcia_device *p_dev)
157 return -ENOMEM; 157 return -ENOMEM;
158 158
159 info = PRIV(dev); 159 info = PRIV(dev);
160 link = &info->link; 160 info->p_dev = p_dev;
161 link->priv = dev; 161 link->priv = dev;
162 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 162 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
163 link->irq.IRQInfo1 = IRQ_LEVEL_ID; 163 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
@@ -169,9 +169,6 @@ static int axnet_attach(struct pcmcia_device *p_dev)
169 dev->do_ioctl = &axnet_ioctl; 169 dev->do_ioctl = &axnet_ioctl;
170 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 170 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
171 171
172 link->handle = p_dev;
173 p_dev->instance = link;
174
175 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 172 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
176 axnet_config(link); 173 axnet_config(link);
177 174
@@ -194,7 +191,7 @@ static void axnet_detach(struct pcmcia_device *p_dev)
194 191
195 DEBUG(0, "axnet_detach(0x%p)\n", link); 192 DEBUG(0, "axnet_detach(0x%p)\n", link);
196 193
197 if (link->dev) 194 if (link->dev_node)
198 unregister_netdev(dev); 195 unregister_netdev(dev);
199 196
200 if (link->state & DEV_CONFIG) 197 if (link->state & DEV_CONFIG)
@@ -409,13 +406,13 @@ static void axnet_config(dev_link_t *link)
409 } 406 }
410 407
411 info->phy_id = (i < 32) ? i : -1; 408 info->phy_id = (i < 32) ? i : -1;
412 link->dev = &info->node; 409 link->dev_node = &info->node;
413 link->state &= ~DEV_CONFIG_PENDING; 410 link->state &= ~DEV_CONFIG_PENDING;
414 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 411 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
415 412
416 if (register_netdev(dev) != 0) { 413 if (register_netdev(dev) != 0) {
417 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); 414 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
418 link->dev = NULL; 415 link->dev_node = NULL;
419 goto failed; 416 goto failed;
420 } 417 }
421 418
@@ -543,7 +540,7 @@ static void mdio_write(kio_addr_t addr, int phy_id, int loc, int value)
543static int axnet_open(struct net_device *dev) 540static int axnet_open(struct net_device *dev)
544{ 541{
545 axnet_dev_t *info = PRIV(dev); 542 axnet_dev_t *info = PRIV(dev);
546 dev_link_t *link = &info->link; 543 dev_link_t *link = info->p_dev;
547 544
548 DEBUG(2, "axnet_open('%s')\n", dev->name); 545 DEBUG(2, "axnet_open('%s')\n", dev->name);
549 546
@@ -569,7 +566,7 @@ static int axnet_open(struct net_device *dev)
569static int axnet_close(struct net_device *dev) 566static int axnet_close(struct net_device *dev)
570{ 567{
571 axnet_dev_t *info = PRIV(dev); 568 axnet_dev_t *info = PRIV(dev);
572 dev_link_t *link = &info->link; 569 dev_link_t *link = info->p_dev;
573 570
574 DEBUG(2, "axnet_close('%s')\n", dev->name); 571 DEBUG(2, "axnet_close('%s')\n", dev->name);
575 572