aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/orinoco_cs.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 18:21:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:44 -0400
commita2608362b22ade22ef5472a8c9b82687d86f976f (patch)
tree116eb83f4bb6afc454dd5b082e8b51384477b3d3 /drivers/net/wireless/orinoco/orinoco_cs.c
parent44d8dade8f12ffe5c9b7eddd0512c1548c027a4c (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/orinoco_cs.c')
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index b381aed24d73..fa8fe5be58c9 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -106,26 +106,24 @@ orinoco_cs_hard_reset(struct orinoco_private *priv)
106static int 106static int
107orinoco_cs_probe(struct pcmcia_device *link) 107orinoco_cs_probe(struct pcmcia_device *link)
108{ 108{
109 struct net_device *dev;
110 struct orinoco_private *priv; 109 struct orinoco_private *priv;
111 struct orinoco_pccard *card; 110 struct orinoco_pccard *card;
112 111
113 dev = alloc_orinocodev(sizeof(*card), &handle_to_dev(link), 112 priv = alloc_orinocodev(sizeof(*card), &handle_to_dev(link),
114 orinoco_cs_hard_reset, NULL); 113 orinoco_cs_hard_reset, NULL);
115 if (!dev) 114 if (!priv)
116 return -ENOMEM; 115 return -ENOMEM;
117 priv = netdev_priv(dev);
118 card = priv->card; 116 card = priv->card;
119 117
120 /* Link both structures together */ 118 /* Link both structures together */
121 card->p_dev = link; 119 card->p_dev = link;
122 link->priv = dev; 120 link->priv = priv;
123 121
124 /* Interrupt setup */ 122 /* Interrupt setup */
125 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 123 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
126 link->irq.IRQInfo1 = IRQ_LEVEL_ID; 124 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
127 link->irq.Handler = orinoco_interrupt; 125 link->irq.Handler = orinoco_interrupt;
128 link->irq.Instance = dev; 126 link->irq.Instance = priv;
129 127
130 /* General socket configuration defaults can go here. In this 128 /* General socket configuration defaults can go here. In this
131 * client, we assume very little, and rely on the CIS for 129 * client, we assume very little, and rely on the CIS for
@@ -146,14 +144,14 @@ orinoco_cs_probe(struct pcmcia_device *link)
146 */ 144 */
147static void orinoco_cs_detach(struct pcmcia_device *link) 145static void orinoco_cs_detach(struct pcmcia_device *link)
148{ 146{
149 struct net_device *dev = link->priv; 147 struct orinoco_private *priv = link->priv;
150 148
151 if (link->dev_node) 149 if (link->dev_node)
152 unregister_netdev(dev); 150 unregister_netdev(priv->ndev);
153 151
154 orinoco_cs_release(link); 152 orinoco_cs_release(link);
155 153
156 free_orinocodev(dev); 154 free_orinocodev(priv);
157} /* orinoco_cs_detach */ 155} /* orinoco_cs_detach */
158 156
159/* 157/*
@@ -239,9 +237,9 @@ next_entry:
239static int 237static int
240orinoco_cs_config(struct pcmcia_device *link) 238orinoco_cs_config(struct pcmcia_device *link)
241{ 239{
242 struct net_device *dev = link->priv; 240 struct orinoco_private *priv = link->priv;
243 struct orinoco_private *priv = netdev_priv(dev);
244 struct orinoco_pccard *card = priv->card; 241 struct orinoco_pccard *card = priv->card;
242 struct net_device *dev = priv->ndev;
245 hermes_t *hw = &priv->hw; 243 hermes_t *hw = &priv->hw;
246 int last_fn, last_ret; 244 int last_fn, last_ret;
247 void __iomem *mem; 245 void __iomem *mem;
@@ -336,8 +334,7 @@ orinoco_cs_config(struct pcmcia_device *link)
336static void 334static void
337orinoco_cs_release(struct pcmcia_device *link) 335orinoco_cs_release(struct pcmcia_device *link)
338{ 336{
339 struct net_device *dev = link->priv; 337 struct orinoco_private *priv = link->priv;
340 struct orinoco_private *priv = netdev_priv(dev);
341 unsigned long flags; 338 unsigned long flags;
342 339
343 /* We're committed to taking the device away now, so mark the 340 /* We're committed to taking the device away now, so mark the
@@ -353,9 +350,9 @@ orinoco_cs_release(struct pcmcia_device *link)
353 350
354static int orinoco_cs_suspend(struct pcmcia_device *link) 351static int orinoco_cs_suspend(struct pcmcia_device *link)
355{ 352{
356 struct net_device *dev = link->priv; 353 struct orinoco_private *priv = link->priv;
357 struct orinoco_private *priv = netdev_priv(dev);
358 struct orinoco_pccard *card = priv->card; 354 struct orinoco_pccard *card = priv->card;
355 struct net_device *dev = priv->ndev;
359 int err = 0; 356 int err = 0;
360 unsigned long flags; 357 unsigned long flags;
361 358
@@ -365,7 +362,7 @@ static int orinoco_cs_suspend(struct pcmcia_device *link)
365 if (!test_bit(0, &card->hard_reset_in_progress)) { 362 if (!test_bit(0, &card->hard_reset_in_progress)) {
366 spin_lock_irqsave(&priv->lock, flags); 363 spin_lock_irqsave(&priv->lock, flags);
367 364
368 err = __orinoco_down(dev); 365 err = __orinoco_down(priv);
369 if (err) 366 if (err)
370 printk(KERN_WARNING "%s: Error %d downing interface\n", 367 printk(KERN_WARNING "%s: Error %d downing interface\n",
371 dev->name, err); 368 dev->name, err);
@@ -381,14 +378,14 @@ static int orinoco_cs_suspend(struct pcmcia_device *link)
381 378
382static int orinoco_cs_resume(struct pcmcia_device *link) 379static int orinoco_cs_resume(struct pcmcia_device *link)
383{ 380{
384 struct net_device *dev = link->priv; 381 struct orinoco_private *priv = link->priv;
385 struct orinoco_private *priv = netdev_priv(dev);
386 struct orinoco_pccard *card = priv->card; 382 struct orinoco_pccard *card = priv->card;
383 struct net_device *dev = priv->ndev;
387 int err = 0; 384 int err = 0;
388 unsigned long flags; 385 unsigned long flags;
389 386
390 if (!test_bit(0, &card->hard_reset_in_progress)) { 387 if (!test_bit(0, &card->hard_reset_in_progress)) {
391 err = orinoco_reinit_firmware(dev); 388 err = orinoco_reinit_firmware(priv);
392 if (err) { 389 if (err) {
393 printk(KERN_ERR "%s: Error %d re-initializing firmware\n", 390 printk(KERN_ERR "%s: Error %d re-initializing firmware\n",
394 dev->name, err); 391 dev->name, err);
@@ -401,7 +398,7 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
401 priv->hw_unavailable--; 398 priv->hw_unavailable--;
402 399
403 if (priv->open && !priv->hw_unavailable) { 400 if (priv->open && !priv->hw_unavailable) {
404 err = __orinoco_up(dev); 401 err = __orinoco_up(priv);
405 if (err) 402 if (err)
406 printk(KERN_ERR "%s: Error %d restarting card\n", 403 printk(KERN_ERR "%s: Error %d restarting card\n",
407 dev->name, err); 404 dev->name, err);