aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/pcnet_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/pcnet_cs.c')
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 5a7e58af0b3b..8ed6a410ea10 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -214,7 +214,7 @@ static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
214static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII }; 214static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
215 215
216typedef struct pcnet_dev_t { 216typedef struct pcnet_dev_t {
217 dev_link_t link; 217 struct pcmcia_device *p_dev;
218 dev_node_t node; 218 dev_node_t node;
219 u_int flags; 219 u_int flags;
220 void __iomem *base; 220 void __iomem *base;
@@ -243,8 +243,8 @@ static inline pcnet_dev_t *PRIV(struct net_device *dev)
243static int pcnet_probe(struct pcmcia_device *p_dev) 243static int pcnet_probe(struct pcmcia_device *p_dev)
244{ 244{
245 pcnet_dev_t *info; 245 pcnet_dev_t *info;
246 dev_link_t *link;
247 struct net_device *dev; 246 struct net_device *dev;
247 dev_link_t *link = dev_to_instance(p_dev);
248 248
249 DEBUG(0, "pcnet_attach()\n"); 249 DEBUG(0, "pcnet_attach()\n");
250 250
@@ -252,7 +252,7 @@ static int pcnet_probe(struct pcmcia_device *p_dev)
252 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t)); 252 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
253 if (!dev) return -ENOMEM; 253 if (!dev) return -ENOMEM;
254 info = PRIV(dev); 254 info = PRIV(dev);
255 link = &info->link; 255 info->p_dev = p_dev;
256 link->priv = dev; 256 link->priv = dev;
257 257
258 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 258 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
@@ -265,9 +265,6 @@ static int pcnet_probe(struct pcmcia_device *p_dev)
265 dev->stop = &pcnet_close; 265 dev->stop = &pcnet_close;
266 dev->set_config = &set_config; 266 dev->set_config = &set_config;
267 267
268 link->handle = p_dev;
269 p_dev->instance = link;
270
271 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 268 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
272 pcnet_config(link); 269 pcnet_config(link);
273 270
@@ -290,7 +287,7 @@ static void pcnet_detach(struct pcmcia_device *p_dev)
290 287
291 DEBUG(0, "pcnet_detach(0x%p)\n", link); 288 DEBUG(0, "pcnet_detach(0x%p)\n", link);
292 289
293 if (link->dev) 290 if (link->dev_node)
294 unregister_netdev(dev); 291 unregister_netdev(dev);
295 292
296 if (link->state & DEV_CONFIG) 293 if (link->state & DEV_CONFIG)
@@ -674,7 +671,7 @@ static void pcnet_config(dev_link_t *link)
674 info->eth_phy = 0; 671 info->eth_phy = 0;
675 } 672 }
676 673
677 link->dev = &info->node; 674 link->dev_node = &info->node;
678 link->state &= ~DEV_CONFIG_PENDING; 675 link->state &= ~DEV_CONFIG_PENDING;
679 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 676 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
680 677
@@ -684,7 +681,7 @@ static void pcnet_config(dev_link_t *link)
684 681
685 if (register_netdev(dev) != 0) { 682 if (register_netdev(dev) != 0) {
686 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); 683 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
687 link->dev = NULL; 684 link->dev_node = NULL;
688 goto failed; 685 goto failed;
689 } 686 }
690 687
@@ -1005,8 +1002,8 @@ static void mii_phy_probe(struct net_device *dev)
1005static int pcnet_open(struct net_device *dev) 1002static int pcnet_open(struct net_device *dev)
1006{ 1003{
1007 pcnet_dev_t *info = PRIV(dev); 1004 pcnet_dev_t *info = PRIV(dev);
1008 dev_link_t *link = &info->link; 1005 dev_link_t *link = info->p_dev;
1009 1006
1010 DEBUG(2, "pcnet_open('%s')\n", dev->name); 1007 DEBUG(2, "pcnet_open('%s')\n", dev->name);
1011 1008
1012 if (!DEV_OK(link)) 1009 if (!DEV_OK(link))
@@ -1033,7 +1030,7 @@ static int pcnet_open(struct net_device *dev)
1033static int pcnet_close(struct net_device *dev) 1030static int pcnet_close(struct net_device *dev)
1034{ 1031{
1035 pcnet_dev_t *info = PRIV(dev); 1032 pcnet_dev_t *info = PRIV(dev);
1036 dev_link_t *link = &info->link; 1033 dev_link_t *link = info->p_dev;
1037 1034
1038 DEBUG(2, "pcnet_close('%s')\n", dev->name); 1035 DEBUG(2, "pcnet_close('%s')\n", dev->name);
1039 1036