diff options
author | David Kilroy <kilroyd@googlemail.com> | 2009-06-18 18:21:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:44 -0400 |
commit | a2608362b22ade22ef5472a8c9b82687d86f976f (patch) | |
tree | 116eb83f4bb6afc454dd5b082e8b51384477b3d3 /drivers/net/wireless/orinoco/spectrum_cs.c | |
parent | 44d8dade8f12ffe5c9b7eddd0512c1548c027a4c (diff) |
orinoco: Replace net_device with orinoco_private in driver interfaces
Move away from using net_device as the main structure in orinoco
function calls. Use orinoco_private instead.
This makes more sense when we move to cfg80211, and we get wiphys as
well.
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/spectrum_cs.c')
-rw-r--r-- | drivers/net/wireless/orinoco/spectrum_cs.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index 38e5198e44c7..ce909e40329a 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c | |||
@@ -178,27 +178,25 @@ spectrum_cs_stop_firmware(struct orinoco_private *priv, int idle) | |||
178 | static int | 178 | static int |
179 | spectrum_cs_probe(struct pcmcia_device *link) | 179 | spectrum_cs_probe(struct pcmcia_device *link) |
180 | { | 180 | { |
181 | struct net_device *dev; | ||
182 | struct orinoco_private *priv; | 181 | struct orinoco_private *priv; |
183 | struct orinoco_pccard *card; | 182 | struct orinoco_pccard *card; |
184 | 183 | ||
185 | dev = alloc_orinocodev(sizeof(*card), &handle_to_dev(link), | 184 | priv = alloc_orinocodev(sizeof(*card), &handle_to_dev(link), |
186 | spectrum_cs_hard_reset, | 185 | spectrum_cs_hard_reset, |
187 | spectrum_cs_stop_firmware); | 186 | spectrum_cs_stop_firmware); |
188 | if (!dev) | 187 | if (!priv) |
189 | return -ENOMEM; | 188 | return -ENOMEM; |
190 | priv = netdev_priv(dev); | ||
191 | card = priv->card; | 189 | card = priv->card; |
192 | 190 | ||
193 | /* Link both structures together */ | 191 | /* Link both structures together */ |
194 | card->p_dev = link; | 192 | card->p_dev = link; |
195 | link->priv = dev; | 193 | link->priv = priv; |
196 | 194 | ||
197 | /* Interrupt setup */ | 195 | /* Interrupt setup */ |
198 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; | 196 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; |
199 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | 197 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; |
200 | link->irq.Handler = orinoco_interrupt; | 198 | link->irq.Handler = orinoco_interrupt; |
201 | link->irq.Instance = dev; | 199 | link->irq.Instance = priv; |
202 | 200 | ||
203 | /* General socket configuration defaults can go here. In this | 201 | /* General socket configuration defaults can go here. In this |
204 | * client, we assume very little, and rely on the CIS for | 202 | * client, we assume very little, and rely on the CIS for |
@@ -219,14 +217,14 @@ spectrum_cs_probe(struct pcmcia_device *link) | |||
219 | */ | 217 | */ |
220 | static void spectrum_cs_detach(struct pcmcia_device *link) | 218 | static void spectrum_cs_detach(struct pcmcia_device *link) |
221 | { | 219 | { |
222 | struct net_device *dev = link->priv; | 220 | struct orinoco_private *priv = link->priv; |
223 | 221 | ||
224 | if (link->dev_node) | 222 | if (link->dev_node) |
225 | unregister_netdev(dev); | 223 | unregister_netdev(priv->ndev); |
226 | 224 | ||
227 | spectrum_cs_release(link); | 225 | spectrum_cs_release(link); |
228 | 226 | ||
229 | free_orinocodev(dev); | 227 | free_orinocodev(priv); |
230 | } /* spectrum_cs_detach */ | 228 | } /* spectrum_cs_detach */ |
231 | 229 | ||
232 | /* | 230 | /* |
@@ -306,9 +304,9 @@ next_entry: | |||
306 | static int | 304 | static int |
307 | spectrum_cs_config(struct pcmcia_device *link) | 305 | spectrum_cs_config(struct pcmcia_device *link) |
308 | { | 306 | { |
309 | struct net_device *dev = link->priv; | 307 | struct orinoco_private *priv = link->priv; |
310 | struct orinoco_private *priv = netdev_priv(dev); | ||
311 | struct orinoco_pccard *card = priv->card; | 308 | struct orinoco_pccard *card = priv->card; |
309 | struct net_device *dev = priv->ndev; | ||
312 | hermes_t *hw = &priv->hw; | 310 | hermes_t *hw = &priv->hw; |
313 | int last_fn, last_ret; | 311 | int last_fn, last_ret; |
314 | void __iomem *mem; | 312 | void __iomem *mem; |
@@ -408,8 +406,7 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
408 | static void | 406 | static void |
409 | spectrum_cs_release(struct pcmcia_device *link) | 407 | spectrum_cs_release(struct pcmcia_device *link) |
410 | { | 408 | { |
411 | struct net_device *dev = link->priv; | 409 | struct orinoco_private *priv = link->priv; |
412 | struct orinoco_private *priv = netdev_priv(dev); | ||
413 | unsigned long flags; | 410 | unsigned long flags; |
414 | 411 | ||
415 | /* We're committed to taking the device away now, so mark the | 412 | /* We're committed to taking the device away now, so mark the |
@@ -427,15 +424,15 @@ spectrum_cs_release(struct pcmcia_device *link) | |||
427 | static int | 424 | static int |
428 | spectrum_cs_suspend(struct pcmcia_device *link) | 425 | spectrum_cs_suspend(struct pcmcia_device *link) |
429 | { | 426 | { |
430 | struct net_device *dev = link->priv; | 427 | struct orinoco_private *priv = link->priv; |
431 | struct orinoco_private *priv = netdev_priv(dev); | 428 | struct net_device *dev = priv->ndev; |
432 | unsigned long flags; | 429 | unsigned long flags; |
433 | int err = 0; | 430 | int err = 0; |
434 | 431 | ||
435 | /* Mark the device as stopped, to block IO until later */ | 432 | /* Mark the device as stopped, to block IO until later */ |
436 | spin_lock_irqsave(&priv->lock, flags); | 433 | spin_lock_irqsave(&priv->lock, flags); |
437 | 434 | ||
438 | err = __orinoco_down(dev); | 435 | err = __orinoco_down(priv); |
439 | if (err) | 436 | if (err) |
440 | printk(KERN_WARNING "%s: Error %d downing interface\n", | 437 | printk(KERN_WARNING "%s: Error %d downing interface\n", |
441 | dev->name, err); | 438 | dev->name, err); |
@@ -451,12 +448,12 @@ spectrum_cs_suspend(struct pcmcia_device *link) | |||
451 | static int | 448 | static int |
452 | spectrum_cs_resume(struct pcmcia_device *link) | 449 | spectrum_cs_resume(struct pcmcia_device *link) |
453 | { | 450 | { |
454 | struct net_device *dev = link->priv; | 451 | struct orinoco_private *priv = link->priv; |
455 | struct orinoco_private *priv = netdev_priv(dev); | 452 | struct net_device *dev = priv->ndev; |
456 | unsigned long flags; | 453 | unsigned long flags; |
457 | int err; | 454 | int err; |
458 | 455 | ||
459 | err = orinoco_reinit_firmware(dev); | 456 | err = orinoco_reinit_firmware(priv); |
460 | if (err) { | 457 | if (err) { |
461 | printk(KERN_ERR "%s: Error %d re-initializing firmware\n", | 458 | printk(KERN_ERR "%s: Error %d re-initializing firmware\n", |
462 | dev->name, err); | 459 | dev->name, err); |
@@ -469,7 +466,7 @@ spectrum_cs_resume(struct pcmcia_device *link) | |||
469 | priv->hw_unavailable--; | 466 | priv->hw_unavailable--; |
470 | 467 | ||
471 | if (priv->open && !priv->hw_unavailable) { | 468 | if (priv->open && !priv->hw_unavailable) { |
472 | err = __orinoco_up(dev); | 469 | err = __orinoco_up(priv); |
473 | if (err) | 470 | if (err) |
474 | printk(KERN_ERR "%s: Error %d restarting card\n", | 471 | printk(KERN_ERR "%s: Error %d restarting card\n", |
475 | dev->name, err); | 472 | dev->name, err); |