aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco_cs.c')
-rw-r--r--drivers/net/wireless/orinoco_cs.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 75981d88a1e..f10d97bc45f 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -49,7 +49,7 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
49/* PCMCIA specific device information (goes in the card field of 49/* PCMCIA specific device information (goes in the card field of
50 * struct orinoco_private */ 50 * struct orinoco_private */
51struct orinoco_pccard { 51struct orinoco_pccard {
52 dev_link_t link; 52 struct pcmcia_device *p_dev;
53 dev_node_t node; 53 dev_node_t node;
54 54
55 /* Used to handle hard reset */ 55 /* Used to handle hard reset */
@@ -75,7 +75,7 @@ static int
75orinoco_cs_hard_reset(struct orinoco_private *priv) 75orinoco_cs_hard_reset(struct orinoco_private *priv)
76{ 76{
77 struct orinoco_pccard *card = priv->card; 77 struct orinoco_pccard *card = priv->card;
78 dev_link_t *link = &card->link; 78 dev_link_t *link = card->p_dev;
79 int err; 79 int err;
80 80
81 /* We need atomic ops here, because we're not holding the lock */ 81 /* We need atomic ops here, because we're not holding the lock */
@@ -109,7 +109,7 @@ orinoco_cs_attach(struct pcmcia_device *p_dev)
109 struct net_device *dev; 109 struct net_device *dev;
110 struct orinoco_private *priv; 110 struct orinoco_private *priv;
111 struct orinoco_pccard *card; 111 struct orinoco_pccard *card;
112 dev_link_t *link; 112 dev_link_t *link = dev_to_instance(p_dev);
113 113
114 dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset); 114 dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);
115 if (! dev) 115 if (! dev)
@@ -118,7 +118,7 @@ orinoco_cs_attach(struct pcmcia_device *p_dev)
118 card = priv->card; 118 card = priv->card;
119 119
120 /* Link both structures together */ 120 /* Link both structures together */
121 link = &card->link; 121 card->p_dev = p_dev;
122 link->priv = dev; 122 link->priv = dev;
123 123
124 /* Interrupt setup */ 124 /* Interrupt setup */
@@ -135,12 +135,6 @@ orinoco_cs_attach(struct pcmcia_device *p_dev)
135 link->conf.Attributes = 0; 135 link->conf.Attributes = 0;
136 link->conf.IntType = INT_MEMORY_AND_IO; 136 link->conf.IntType = INT_MEMORY_AND_IO;
137 137
138 /* Register with Card Services */
139 link->next = NULL;
140
141 link->handle = p_dev;
142 p_dev->instance = link;
143
144 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 138 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
145 orinoco_cs_config(link); 139 orinoco_cs_config(link);
146 140
@@ -161,8 +155,8 @@ static void orinoco_cs_detach(struct pcmcia_device *p_dev)
161 if (link->state & DEV_CONFIG) 155 if (link->state & DEV_CONFIG)
162 orinoco_cs_release(link); 156 orinoco_cs_release(link);
163 157
164 DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev); 158 DEBUG(0, PFX "detach: link=%p link->dev_node=%p\n", link, link->dev_node);
165 if (link->dev) { 159 if (link->dev_node) {
166 DEBUG(0, PFX "About to unregister net device %p\n", 160 DEBUG(0, PFX "About to unregister net device %p\n",
167 dev); 161 dev);
168 unregister_netdev(dev); 162 unregister_netdev(dev);
@@ -364,9 +358,9 @@ orinoco_cs_config(dev_link_t *link)
364 } 358 }
365 359
366 /* At this point, the dev_node_t structure(s) needs to be 360 /* At this point, the dev_node_t structure(s) needs to be
367 * initialized and arranged in a linked list at link->dev. */ 361 * initialized and arranged in a linked list at link->dev_node. */
368 strcpy(card->node.dev_name, dev->name); 362 strcpy(card->node.dev_name, dev->name);
369 link->dev = &card->node; /* link->dev being non-NULL is also 363 link->dev_node = &card->node; /* link->dev_node being non-NULL is also
370 used to indicate that the 364 used to indicate that the
371 net_device has been registered */ 365 net_device has been registered */
372 link->state &= ~DEV_CONFIG_PENDING; 366 link->state &= ~DEV_CONFIG_PENDING;