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 | |
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')
-rw-r--r-- | drivers/net/wireless/orinoco/airport.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/main.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_cs.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_nortel.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_pci.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_pci.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_plx.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_tmd.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/spectrum_cs.c | 41 |
10 files changed, 132 insertions, 139 deletions
diff --git a/drivers/net/wireless/orinoco/airport.c b/drivers/net/wireless/orinoco/airport.c index 8c4065f1b0d0..6559aee09e3b 100644 --- a/drivers/net/wireless/orinoco/airport.c +++ b/drivers/net/wireless/orinoco/airport.c | |||
@@ -34,8 +34,8 @@ struct airport { | |||
34 | static int | 34 | static int |
35 | airport_suspend(struct macio_dev *mdev, pm_message_t state) | 35 | airport_suspend(struct macio_dev *mdev, pm_message_t state) |
36 | { | 36 | { |
37 | struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); | 37 | struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); |
38 | struct orinoco_private *priv = netdev_priv(dev); | 38 | struct net_device *dev = priv->ndev; |
39 | unsigned long flags; | 39 | unsigned long flags; |
40 | int err; | 40 | int err; |
41 | 41 | ||
@@ -48,7 +48,7 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state) | |||
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | err = __orinoco_down(dev); | 51 | err = __orinoco_down(priv); |
52 | if (err) | 52 | if (err) |
53 | printk(KERN_WARNING "%s: PBOOK_SLEEP_NOW: Error %d downing interface\n", | 53 | printk(KERN_WARNING "%s: PBOOK_SLEEP_NOW: Error %d downing interface\n", |
54 | dev->name, err); | 54 | dev->name, err); |
@@ -69,8 +69,8 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state) | |||
69 | static int | 69 | static int |
70 | airport_resume(struct macio_dev *mdev) | 70 | airport_resume(struct macio_dev *mdev) |
71 | { | 71 | { |
72 | struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); | 72 | struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); |
73 | struct orinoco_private *priv = netdev_priv(dev); | 73 | struct net_device *dev = priv->ndev; |
74 | unsigned long flags; | 74 | unsigned long flags; |
75 | int err; | 75 | int err; |
76 | 76 | ||
@@ -82,7 +82,7 @@ airport_resume(struct macio_dev *mdev) | |||
82 | 82 | ||
83 | enable_irq(dev->irq); | 83 | enable_irq(dev->irq); |
84 | 84 | ||
85 | err = orinoco_reinit_firmware(dev); | 85 | err = orinoco_reinit_firmware(priv); |
86 | if (err) { | 86 | if (err) { |
87 | printk(KERN_ERR "%s: Error %d re-initializing firmware on PBOOK_WAKE\n", | 87 | printk(KERN_ERR "%s: Error %d re-initializing firmware on PBOOK_WAKE\n", |
88 | dev->name, err); | 88 | dev->name, err); |
@@ -96,7 +96,7 @@ airport_resume(struct macio_dev *mdev) | |||
96 | priv->hw_unavailable--; | 96 | priv->hw_unavailable--; |
97 | 97 | ||
98 | if (priv->open && (!priv->hw_unavailable)) { | 98 | if (priv->open && (!priv->hw_unavailable)) { |
99 | err = __orinoco_up(dev); | 99 | err = __orinoco_up(priv); |
100 | if (err) | 100 | if (err) |
101 | printk(KERN_ERR "%s: Error %d restarting card on PBOOK_WAKE\n", | 101 | printk(KERN_ERR "%s: Error %d restarting card on PBOOK_WAKE\n", |
102 | dev->name, err); | 102 | dev->name, err); |
@@ -111,8 +111,8 @@ airport_resume(struct macio_dev *mdev) | |||
111 | static int | 111 | static int |
112 | airport_detach(struct macio_dev *mdev) | 112 | airport_detach(struct macio_dev *mdev) |
113 | { | 113 | { |
114 | struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev); | 114 | struct orinoco_private *priv = dev_get_drvdata(&mdev->ofdev.dev); |
115 | struct orinoco_private *priv = netdev_priv(dev); | 115 | struct net_device *dev = priv->ndev; |
116 | struct airport *card = priv->card; | 116 | struct airport *card = priv->card; |
117 | 117 | ||
118 | if (card->ndev_registered) | 118 | if (card->ndev_registered) |
@@ -120,7 +120,7 @@ airport_detach(struct macio_dev *mdev) | |||
120 | card->ndev_registered = 0; | 120 | card->ndev_registered = 0; |
121 | 121 | ||
122 | if (card->irq_requested) | 122 | if (card->irq_requested) |
123 | free_irq(dev->irq, dev); | 123 | free_irq(dev->irq, priv); |
124 | card->irq_requested = 0; | 124 | card->irq_requested = 0; |
125 | 125 | ||
126 | if (card->vaddr) | 126 | if (card->vaddr) |
@@ -134,7 +134,7 @@ airport_detach(struct macio_dev *mdev) | |||
134 | ssleep(1); | 134 | ssleep(1); |
135 | 135 | ||
136 | macio_set_drvdata(mdev, NULL); | 136 | macio_set_drvdata(mdev, NULL); |
137 | free_orinocodev(dev); | 137 | free_orinocodev(priv); |
138 | 138 | ||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
@@ -185,13 +185,13 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /* Allocate space for private device-specific data */ | 187 | /* Allocate space for private device-specific data */ |
188 | dev = alloc_orinocodev(sizeof(*card), &mdev->ofdev.dev, | 188 | priv = alloc_orinocodev(sizeof(*card), &mdev->ofdev.dev, |
189 | airport_hard_reset, NULL); | 189 | airport_hard_reset, NULL); |
190 | if (!dev) { | 190 | if (!priv) { |
191 | printk(KERN_ERR PFX "Cannot allocate network device\n"); | 191 | printk(KERN_ERR PFX "Cannot allocate network device\n"); |
192 | return -ENODEV; | 192 | return -ENODEV; |
193 | } | 193 | } |
194 | priv = netdev_priv(dev); | 194 | dev = priv->ndev; |
195 | card = priv->card; | 195 | card = priv->card; |
196 | 196 | ||
197 | hw = &priv->hw; | 197 | hw = &priv->hw; |
@@ -199,13 +199,13 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
199 | 199 | ||
200 | if (macio_request_resource(mdev, 0, "airport")) { | 200 | if (macio_request_resource(mdev, 0, "airport")) { |
201 | printk(KERN_ERR PFX "can't request IO resource !\n"); | 201 | printk(KERN_ERR PFX "can't request IO resource !\n"); |
202 | free_orinocodev(dev); | 202 | free_orinocodev(priv); |
203 | return -EBUSY; | 203 | return -EBUSY; |
204 | } | 204 | } |
205 | 205 | ||
206 | SET_NETDEV_DEV(dev, &mdev->ofdev.dev); | 206 | SET_NETDEV_DEV(dev, &mdev->ofdev.dev); |
207 | 207 | ||
208 | macio_set_drvdata(mdev, dev); | 208 | macio_set_drvdata(mdev, priv); |
209 | 209 | ||
210 | /* Setup interrupts & base address */ | 210 | /* Setup interrupts & base address */ |
211 | dev->irq = macio_irq(mdev, 0); | 211 | dev->irq = macio_irq(mdev, 0); |
@@ -228,7 +228,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
228 | /* Reset it before we get the interrupt */ | 228 | /* Reset it before we get the interrupt */ |
229 | hermes_init(hw); | 229 | hermes_init(hw); |
230 | 230 | ||
231 | if (request_irq(dev->irq, orinoco_interrupt, 0, dev->name, dev)) { | 231 | if (request_irq(dev->irq, orinoco_interrupt, 0, dev->name, priv)) { |
232 | printk(KERN_ERR PFX "Couldn't get IRQ %d\n", dev->irq); | 232 | printk(KERN_ERR PFX "Couldn't get IRQ %d\n", dev->irq); |
233 | goto failed; | 233 | goto failed; |
234 | } | 234 | } |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index 58a48db692e3..4fa8264a400f 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -252,7 +252,7 @@ static int orinoco_open(struct net_device *dev) | |||
252 | if (orinoco_lock(priv, &flags) != 0) | 252 | if (orinoco_lock(priv, &flags) != 0) |
253 | return -EBUSY; | 253 | return -EBUSY; |
254 | 254 | ||
255 | err = __orinoco_up(dev); | 255 | err = __orinoco_up(priv); |
256 | 256 | ||
257 | if (!err) | 257 | if (!err) |
258 | priv->open = 1; | 258 | priv->open = 1; |
@@ -274,7 +274,7 @@ static int orinoco_stop(struct net_device *dev) | |||
274 | 274 | ||
275 | priv->open = 0; | 275 | priv->open = 0; |
276 | 276 | ||
277 | err = __orinoco_down(dev); | 277 | err = __orinoco_down(priv); |
278 | 278 | ||
279 | spin_unlock_irq(&priv->lock); | 279 | spin_unlock_irq(&priv->lock); |
280 | 280 | ||
@@ -1511,9 +1511,9 @@ static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw) | |||
1511 | /* Internal hardware control routines */ | 1511 | /* Internal hardware control routines */ |
1512 | /********************************************************************/ | 1512 | /********************************************************************/ |
1513 | 1513 | ||
1514 | int __orinoco_up(struct net_device *dev) | 1514 | int __orinoco_up(struct orinoco_private *priv) |
1515 | { | 1515 | { |
1516 | struct orinoco_private *priv = netdev_priv(dev); | 1516 | struct net_device *dev = priv->ndev; |
1517 | struct hermes *hw = &priv->hw; | 1517 | struct hermes *hw = &priv->hw; |
1518 | int err; | 1518 | int err; |
1519 | 1519 | ||
@@ -1541,9 +1541,9 @@ int __orinoco_up(struct net_device *dev) | |||
1541 | } | 1541 | } |
1542 | EXPORT_SYMBOL(__orinoco_up); | 1542 | EXPORT_SYMBOL(__orinoco_up); |
1543 | 1543 | ||
1544 | int __orinoco_down(struct net_device *dev) | 1544 | int __orinoco_down(struct orinoco_private *priv) |
1545 | { | 1545 | { |
1546 | struct orinoco_private *priv = netdev_priv(dev); | 1546 | struct net_device *dev = priv->ndev; |
1547 | struct hermes *hw = &priv->hw; | 1547 | struct hermes *hw = &priv->hw; |
1548 | int err; | 1548 | int err; |
1549 | 1549 | ||
@@ -1573,9 +1573,8 @@ int __orinoco_down(struct net_device *dev) | |||
1573 | } | 1573 | } |
1574 | EXPORT_SYMBOL(__orinoco_down); | 1574 | EXPORT_SYMBOL(__orinoco_down); |
1575 | 1575 | ||
1576 | int orinoco_reinit_firmware(struct net_device *dev) | 1576 | int orinoco_reinit_firmware(struct orinoco_private *priv) |
1577 | { | 1577 | { |
1578 | struct orinoco_private *priv = netdev_priv(dev); | ||
1579 | struct hermes *hw = &priv->hw; | 1578 | struct hermes *hw = &priv->hw; |
1580 | int err; | 1579 | int err; |
1581 | 1580 | ||
@@ -1887,7 +1886,7 @@ void orinoco_reset(struct work_struct *work) | |||
1887 | } | 1886 | } |
1888 | } | 1887 | } |
1889 | 1888 | ||
1890 | err = orinoco_reinit_firmware(dev); | 1889 | err = orinoco_reinit_firmware(priv); |
1891 | if (err) { | 1890 | if (err) { |
1892 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", | 1891 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", |
1893 | dev->name, err); | 1892 | dev->name, err); |
@@ -1902,7 +1901,7 @@ void orinoco_reset(struct work_struct *work) | |||
1902 | /* priv->open or priv->hw_unavailable might have changed while | 1901 | /* priv->open or priv->hw_unavailable might have changed while |
1903 | * we dropped the lock */ | 1902 | * we dropped the lock */ |
1904 | if (priv->open && (!priv->hw_unavailable)) { | 1903 | if (priv->open && (!priv->hw_unavailable)) { |
1905 | err = __orinoco_up(dev); | 1904 | err = __orinoco_up(priv); |
1906 | if (err) { | 1905 | if (err) { |
1907 | printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n", | 1906 | printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n", |
1908 | dev->name, err); | 1907 | dev->name, err); |
@@ -1938,8 +1937,8 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw) | |||
1938 | 1937 | ||
1939 | irqreturn_t orinoco_interrupt(int irq, void *dev_id) | 1938 | irqreturn_t orinoco_interrupt(int irq, void *dev_id) |
1940 | { | 1939 | { |
1941 | struct net_device *dev = dev_id; | 1940 | struct orinoco_private *priv = dev_id; |
1942 | struct orinoco_private *priv = netdev_priv(dev); | 1941 | struct net_device *dev = priv->ndev; |
1943 | hermes_t *hw = &priv->hw; | 1942 | hermes_t *hw = &priv->hw; |
1944 | int count = MAX_IRQLOOPS_PER_IRQ; | 1943 | int count = MAX_IRQLOOPS_PER_IRQ; |
1945 | u16 evstat, events; | 1944 | u16 evstat, events; |
@@ -2192,7 +2191,7 @@ static const struct net_device_ops orinoco_netdev_ops = { | |||
2192 | .ndo_get_stats = orinoco_get_stats, | 2191 | .ndo_get_stats = orinoco_get_stats, |
2193 | }; | 2192 | }; |
2194 | 2193 | ||
2195 | struct net_device | 2194 | struct orinoco_private |
2196 | *alloc_orinocodev(int sizeof_card, | 2195 | *alloc_orinocodev(int sizeof_card, |
2197 | struct device *device, | 2196 | struct device *device, |
2198 | int (*hard_reset)(struct orinoco_private *), | 2197 | int (*hard_reset)(struct orinoco_private *), |
@@ -2255,13 +2254,13 @@ struct net_device | |||
2255 | /* Register PM notifiers */ | 2254 | /* Register PM notifiers */ |
2256 | orinoco_register_pm_notifier(priv); | 2255 | orinoco_register_pm_notifier(priv); |
2257 | 2256 | ||
2258 | return dev; | 2257 | return priv; |
2259 | } | 2258 | } |
2260 | EXPORT_SYMBOL(alloc_orinocodev); | 2259 | EXPORT_SYMBOL(alloc_orinocodev); |
2261 | 2260 | ||
2262 | void free_orinocodev(struct net_device *dev) | 2261 | void free_orinocodev(struct orinoco_private *priv) |
2263 | { | 2262 | { |
2264 | struct orinoco_private *priv = netdev_priv(dev); | 2263 | struct net_device *dev = priv->ndev; |
2265 | struct orinoco_rx_data *rx_data, *temp; | 2264 | struct orinoco_rx_data *rx_data, *temp; |
2266 | 2265 | ||
2267 | /* If the tasklet is scheduled when we call tasklet_kill it | 2266 | /* If the tasklet is scheduled when we call tasklet_kill it |
diff --git a/drivers/net/wireless/orinoco/orinoco.h b/drivers/net/wireless/orinoco/orinoco.h index 8e5a72cc297f..b93e86cf0049 100644 --- a/drivers/net/wireless/orinoco/orinoco.h +++ b/drivers/net/wireless/orinoco/orinoco.h | |||
@@ -182,14 +182,14 @@ extern int orinoco_debug; | |||
182 | /* Exported prototypes */ | 182 | /* Exported prototypes */ |
183 | /********************************************************************/ | 183 | /********************************************************************/ |
184 | 184 | ||
185 | extern struct net_device *alloc_orinocodev( | 185 | extern struct orinoco_private *alloc_orinocodev( |
186 | int sizeof_card, struct device *device, | 186 | int sizeof_card, struct device *device, |
187 | int (*hard_reset)(struct orinoco_private *), | 187 | int (*hard_reset)(struct orinoco_private *), |
188 | int (*stop_fw)(struct orinoco_private *, int)); | 188 | int (*stop_fw)(struct orinoco_private *, int)); |
189 | extern void free_orinocodev(struct net_device *dev); | 189 | extern void free_orinocodev(struct orinoco_private *priv); |
190 | extern int __orinoco_up(struct net_device *dev); | 190 | extern int __orinoco_up(struct orinoco_private *priv); |
191 | extern int __orinoco_down(struct net_device *dev); | 191 | extern int __orinoco_down(struct orinoco_private *priv); |
192 | extern int orinoco_reinit_firmware(struct net_device *dev); | 192 | extern int orinoco_reinit_firmware(struct orinoco_private *priv); |
193 | extern irqreturn_t orinoco_interrupt(int irq, void *dev_id); | 193 | extern irqreturn_t orinoco_interrupt(int irq, void *dev_id); |
194 | 194 | ||
195 | /********************************************************************/ | 195 | /********************************************************************/ |
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) | |||
106 | static int | 106 | static int |
107 | orinoco_cs_probe(struct pcmcia_device *link) | 107 | orinoco_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 | */ |
147 | static void orinoco_cs_detach(struct pcmcia_device *link) | 145 | static 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: | |||
239 | static int | 237 | static int |
240 | orinoco_cs_config(struct pcmcia_device *link) | 238 | orinoco_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) | |||
336 | static void | 334 | static void |
337 | orinoco_cs_release(struct pcmcia_device *link) | 335 | orinoco_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 | ||
354 | static int orinoco_cs_suspend(struct pcmcia_device *link) | 351 | static 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 | ||
382 | static int orinoco_cs_resume(struct pcmcia_device *link) | 379 | static 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); |
diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c index b01726255c6f..4efd5a0d33bd 100644 --- a/drivers/net/wireless/orinoco/orinoco_nortel.c +++ b/drivers/net/wireless/orinoco/orinoco_nortel.c | |||
@@ -181,15 +181,15 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
181 | } | 181 | } |
182 | 182 | ||
183 | /* Allocate network device */ | 183 | /* Allocate network device */ |
184 | dev = alloc_orinocodev(sizeof(*card), &pdev->dev, | 184 | priv = alloc_orinocodev(sizeof(*card), &pdev->dev, |
185 | orinoco_nortel_cor_reset, NULL); | 185 | orinoco_nortel_cor_reset, NULL); |
186 | if (!dev) { | 186 | if (!priv) { |
187 | printk(KERN_ERR PFX "Cannot allocate network device\n"); | 187 | printk(KERN_ERR PFX "Cannot allocate network device\n"); |
188 | err = -ENOMEM; | 188 | err = -ENOMEM; |
189 | goto fail_alloc; | 189 | goto fail_alloc; |
190 | } | 190 | } |
191 | 191 | ||
192 | priv = netdev_priv(dev); | 192 | dev = priv->ndev; |
193 | card = priv->card; | 193 | card = priv->card; |
194 | card->bridge_io = bridge_io; | 194 | card->bridge_io = bridge_io; |
195 | card->attr_io = attr_io; | 195 | card->attr_io = attr_io; |
@@ -198,7 +198,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
198 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); | 198 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); |
199 | 199 | ||
200 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 200 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
201 | dev->name, dev); | 201 | dev->name, priv); |
202 | if (err) { | 202 | if (err) { |
203 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); | 203 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); |
204 | err = -EBUSY; | 204 | err = -EBUSY; |
@@ -223,18 +223,18 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
223 | goto fail; | 223 | goto fail; |
224 | } | 224 | } |
225 | 225 | ||
226 | pci_set_drvdata(pdev, dev); | 226 | pci_set_drvdata(pdev, priv); |
227 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | 227 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, |
228 | pci_name(pdev)); | 228 | pci_name(pdev)); |
229 | 229 | ||
230 | return 0; | 230 | return 0; |
231 | 231 | ||
232 | fail: | 232 | fail: |
233 | free_irq(pdev->irq, dev); | 233 | free_irq(pdev->irq, priv); |
234 | 234 | ||
235 | fail_irq: | 235 | fail_irq: |
236 | pci_set_drvdata(pdev, NULL); | 236 | pci_set_drvdata(pdev, NULL); |
237 | free_orinocodev(dev); | 237 | free_orinocodev(priv); |
238 | 238 | ||
239 | fail_alloc: | 239 | fail_alloc: |
240 | pci_iounmap(pdev, hermes_io); | 240 | pci_iounmap(pdev, hermes_io); |
@@ -256,17 +256,17 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev, | |||
256 | 256 | ||
257 | static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev) | 257 | static void __devexit orinoco_nortel_remove_one(struct pci_dev *pdev) |
258 | { | 258 | { |
259 | struct net_device *dev = pci_get_drvdata(pdev); | 259 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
260 | struct orinoco_private *priv = netdev_priv(dev); | 260 | struct net_device *dev = priv->ndev; |
261 | struct orinoco_pci_card *card = priv->card; | 261 | struct orinoco_pci_card *card = priv->card; |
262 | 262 | ||
263 | /* Clear LEDs */ | 263 | /* Clear LEDs */ |
264 | iowrite16(0, card->bridge_io + 10); | 264 | iowrite16(0, card->bridge_io + 10); |
265 | 265 | ||
266 | unregister_netdev(dev); | 266 | unregister_netdev(dev); |
267 | free_irq(pdev->irq, dev); | 267 | free_irq(pdev->irq, priv); |
268 | pci_set_drvdata(pdev, NULL); | 268 | pci_set_drvdata(pdev, NULL); |
269 | free_orinocodev(dev); | 269 | free_orinocodev(priv); |
270 | pci_iounmap(pdev, priv->hw.iobase); | 270 | pci_iounmap(pdev, priv->hw.iobase); |
271 | pci_iounmap(pdev, card->attr_io); | 271 | pci_iounmap(pdev, card->attr_io); |
272 | pci_iounmap(pdev, card->bridge_io); | 272 | pci_iounmap(pdev, card->bridge_io); |
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c index 78cafff1fb2e..12b9c6a1bbec 100644 --- a/drivers/net/wireless/orinoco/orinoco_pci.c +++ b/drivers/net/wireless/orinoco/orinoco_pci.c | |||
@@ -139,22 +139,22 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
139 | } | 139 | } |
140 | 140 | ||
141 | /* Allocate network device */ | 141 | /* Allocate network device */ |
142 | dev = alloc_orinocodev(sizeof(*card), &pdev->dev, | 142 | priv = alloc_orinocodev(sizeof(*card), &pdev->dev, |
143 | orinoco_pci_cor_reset, NULL); | 143 | orinoco_pci_cor_reset, NULL); |
144 | if (!dev) { | 144 | if (!priv) { |
145 | printk(KERN_ERR PFX "Cannot allocate network device\n"); | 145 | printk(KERN_ERR PFX "Cannot allocate network device\n"); |
146 | err = -ENOMEM; | 146 | err = -ENOMEM; |
147 | goto fail_alloc; | 147 | goto fail_alloc; |
148 | } | 148 | } |
149 | 149 | ||
150 | priv = netdev_priv(dev); | 150 | dev = priv->ndev; |
151 | card = priv->card; | 151 | card = priv->card; |
152 | SET_NETDEV_DEV(dev, &pdev->dev); | 152 | SET_NETDEV_DEV(dev, &pdev->dev); |
153 | 153 | ||
154 | hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING); | 154 | hermes_struct_init(&priv->hw, hermes_io, HERMES_32BIT_REGSPACING); |
155 | 155 | ||
156 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 156 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
157 | dev->name, dev); | 157 | dev->name, priv); |
158 | if (err) { | 158 | if (err) { |
159 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); | 159 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); |
160 | err = -EBUSY; | 160 | err = -EBUSY; |
@@ -173,18 +173,18 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
173 | goto fail; | 173 | goto fail; |
174 | } | 174 | } |
175 | 175 | ||
176 | pci_set_drvdata(pdev, dev); | 176 | pci_set_drvdata(pdev, priv); |
177 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | 177 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, |
178 | pci_name(pdev)); | 178 | pci_name(pdev)); |
179 | 179 | ||
180 | return 0; | 180 | return 0; |
181 | 181 | ||
182 | fail: | 182 | fail: |
183 | free_irq(pdev->irq, dev); | 183 | free_irq(pdev->irq, priv); |
184 | 184 | ||
185 | fail_irq: | 185 | fail_irq: |
186 | pci_set_drvdata(pdev, NULL); | 186 | pci_set_drvdata(pdev, NULL); |
187 | free_orinocodev(dev); | 187 | free_orinocodev(priv); |
188 | 188 | ||
189 | fail_alloc: | 189 | fail_alloc: |
190 | pci_iounmap(pdev, hermes_io); | 190 | pci_iounmap(pdev, hermes_io); |
@@ -200,13 +200,13 @@ static int orinoco_pci_init_one(struct pci_dev *pdev, | |||
200 | 200 | ||
201 | static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) | 201 | static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev) |
202 | { | 202 | { |
203 | struct net_device *dev = pci_get_drvdata(pdev); | 203 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
204 | struct orinoco_private *priv = netdev_priv(dev); | 204 | struct net_device *dev = priv->ndev; |
205 | 205 | ||
206 | unregister_netdev(dev); | 206 | unregister_netdev(dev); |
207 | free_irq(pdev->irq, dev); | 207 | free_irq(pdev->irq, priv); |
208 | pci_set_drvdata(pdev, NULL); | 208 | pci_set_drvdata(pdev, NULL); |
209 | free_orinocodev(dev); | 209 | free_orinocodev(priv); |
210 | pci_iounmap(pdev, priv->hw.iobase); | 210 | pci_iounmap(pdev, priv->hw.iobase); |
211 | pci_release_regions(pdev); | 211 | pci_release_regions(pdev); |
212 | pci_disable_device(pdev); | 212 | pci_disable_device(pdev); |
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.h b/drivers/net/wireless/orinoco/orinoco_pci.h index c655b4a3de16..22aa630027e0 100644 --- a/drivers/net/wireless/orinoco/orinoco_pci.h +++ b/drivers/net/wireless/orinoco/orinoco_pci.h | |||
@@ -21,8 +21,8 @@ struct orinoco_pci_card { | |||
21 | #ifdef CONFIG_PM | 21 | #ifdef CONFIG_PM |
22 | static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 22 | static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
23 | { | 23 | { |
24 | struct net_device *dev = pci_get_drvdata(pdev); | 24 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
25 | struct orinoco_private *priv = netdev_priv(dev); | 25 | struct net_device *dev = priv->ndev; |
26 | unsigned long flags; | 26 | unsigned long flags; |
27 | int err; | 27 | int err; |
28 | 28 | ||
@@ -33,7 +33,7 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
33 | return err; | 33 | return err; |
34 | } | 34 | } |
35 | 35 | ||
36 | err = __orinoco_down(dev); | 36 | err = __orinoco_down(priv); |
37 | if (err) | 37 | if (err) |
38 | printk(KERN_WARNING "%s: error %d bringing interface down " | 38 | printk(KERN_WARNING "%s: error %d bringing interface down " |
39 | "for suspend\n", dev->name, err); | 39 | "for suspend\n", dev->name, err); |
@@ -44,7 +44,7 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
44 | 44 | ||
45 | orinoco_unlock(priv, &flags); | 45 | orinoco_unlock(priv, &flags); |
46 | 46 | ||
47 | free_irq(pdev->irq, dev); | 47 | free_irq(pdev->irq, priv); |
48 | pci_save_state(pdev); | 48 | pci_save_state(pdev); |
49 | pci_disable_device(pdev); | 49 | pci_disable_device(pdev); |
50 | pci_set_power_state(pdev, PCI_D3hot); | 50 | pci_set_power_state(pdev, PCI_D3hot); |
@@ -54,8 +54,8 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
54 | 54 | ||
55 | static int orinoco_pci_resume(struct pci_dev *pdev) | 55 | static int orinoco_pci_resume(struct pci_dev *pdev) |
56 | { | 56 | { |
57 | struct net_device *dev = pci_get_drvdata(pdev); | 57 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
58 | struct orinoco_private *priv = netdev_priv(dev); | 58 | struct net_device *dev = priv->ndev; |
59 | unsigned long flags; | 59 | unsigned long flags; |
60 | int err; | 60 | int err; |
61 | 61 | ||
@@ -69,7 +69,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev) | |||
69 | pci_restore_state(pdev); | 69 | pci_restore_state(pdev); |
70 | 70 | ||
71 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 71 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
72 | dev->name, dev); | 72 | dev->name, priv); |
73 | if (err) { | 73 | if (err) { |
74 | printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n", | 74 | printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n", |
75 | dev->name); | 75 | dev->name); |
@@ -77,7 +77,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev) | |||
77 | return -EBUSY; | 77 | return -EBUSY; |
78 | } | 78 | } |
79 | 79 | ||
80 | err = orinoco_reinit_firmware(dev); | 80 | err = orinoco_reinit_firmware(priv); |
81 | if (err) { | 81 | if (err) { |
82 | printk(KERN_ERR "%s: error %d re-initializing firmware " | 82 | printk(KERN_ERR "%s: error %d re-initializing firmware " |
83 | "on resume\n", dev->name, err); | 83 | "on resume\n", dev->name, err); |
@@ -91,7 +91,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev) | |||
91 | priv->hw_unavailable--; | 91 | priv->hw_unavailable--; |
92 | 92 | ||
93 | if (priv->open && (!priv->hw_unavailable)) { | 93 | if (priv->open && (!priv->hw_unavailable)) { |
94 | err = __orinoco_up(dev); | 94 | err = __orinoco_up(priv); |
95 | if (err) | 95 | if (err) |
96 | printk(KERN_ERR "%s: Error %d restarting card on resume\n", | 96 | printk(KERN_ERR "%s: Error %d restarting card on resume\n", |
97 | dev->name, err); | 97 | dev->name, err); |
diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c index a2a4471c0337..77d5668a9e43 100644 --- a/drivers/net/wireless/orinoco/orinoco_plx.c +++ b/drivers/net/wireless/orinoco/orinoco_plx.c | |||
@@ -220,15 +220,15 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | /* Allocate network device */ | 222 | /* Allocate network device */ |
223 | dev = alloc_orinocodev(sizeof(*card), &pdev->dev, | 223 | priv = alloc_orinocodev(sizeof(*card), &pdev->dev, |
224 | orinoco_plx_cor_reset, NULL); | 224 | orinoco_plx_cor_reset, NULL); |
225 | if (!dev) { | 225 | if (!priv) { |
226 | printk(KERN_ERR PFX "Cannot allocate network device\n"); | 226 | printk(KERN_ERR PFX "Cannot allocate network device\n"); |
227 | err = -ENOMEM; | 227 | err = -ENOMEM; |
228 | goto fail_alloc; | 228 | goto fail_alloc; |
229 | } | 229 | } |
230 | 230 | ||
231 | priv = netdev_priv(dev); | 231 | dev = priv->ndev; |
232 | card = priv->card; | 232 | card = priv->card; |
233 | card->bridge_io = bridge_io; | 233 | card->bridge_io = bridge_io; |
234 | card->attr_io = attr_io; | 234 | card->attr_io = attr_io; |
@@ -237,7 +237,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
237 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); | 237 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); |
238 | 238 | ||
239 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 239 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
240 | dev->name, dev); | 240 | dev->name, priv); |
241 | if (err) { | 241 | if (err) { |
242 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); | 242 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); |
243 | err = -EBUSY; | 243 | err = -EBUSY; |
@@ -262,18 +262,18 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
262 | goto fail; | 262 | goto fail; |
263 | } | 263 | } |
264 | 264 | ||
265 | pci_set_drvdata(pdev, dev); | 265 | pci_set_drvdata(pdev, priv); |
266 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | 266 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, |
267 | pci_name(pdev)); | 267 | pci_name(pdev)); |
268 | 268 | ||
269 | return 0; | 269 | return 0; |
270 | 270 | ||
271 | fail: | 271 | fail: |
272 | free_irq(pdev->irq, dev); | 272 | free_irq(pdev->irq, priv); |
273 | 273 | ||
274 | fail_irq: | 274 | fail_irq: |
275 | pci_set_drvdata(pdev, NULL); | 275 | pci_set_drvdata(pdev, NULL); |
276 | free_orinocodev(dev); | 276 | free_orinocodev(priv); |
277 | 277 | ||
278 | fail_alloc: | 278 | fail_alloc: |
279 | pci_iounmap(pdev, hermes_io); | 279 | pci_iounmap(pdev, hermes_io); |
@@ -295,14 +295,14 @@ static int orinoco_plx_init_one(struct pci_dev *pdev, | |||
295 | 295 | ||
296 | static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) | 296 | static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev) |
297 | { | 297 | { |
298 | struct net_device *dev = pci_get_drvdata(pdev); | 298 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
299 | struct orinoco_private *priv = netdev_priv(dev); | 299 | struct net_device *dev = priv->ndev; |
300 | struct orinoco_pci_card *card = priv->card; | 300 | struct orinoco_pci_card *card = priv->card; |
301 | 301 | ||
302 | unregister_netdev(dev); | 302 | unregister_netdev(dev); |
303 | free_irq(pdev->irq, dev); | 303 | free_irq(pdev->irq, priv); |
304 | pci_set_drvdata(pdev, NULL); | 304 | pci_set_drvdata(pdev, NULL); |
305 | free_orinocodev(dev); | 305 | free_orinocodev(priv); |
306 | pci_iounmap(pdev, priv->hw.iobase); | 306 | pci_iounmap(pdev, priv->hw.iobase); |
307 | pci_iounmap(pdev, card->attr_io); | 307 | pci_iounmap(pdev, card->attr_io); |
308 | pci_iounmap(pdev, card->bridge_io); | 308 | pci_iounmap(pdev, card->bridge_io); |
diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c index cda0e6e4d7a1..5f24c0332de9 100644 --- a/drivers/net/wireless/orinoco/orinoco_tmd.c +++ b/drivers/net/wireless/orinoco/orinoco_tmd.c | |||
@@ -124,15 +124,15 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
124 | } | 124 | } |
125 | 125 | ||
126 | /* Allocate network device */ | 126 | /* Allocate network device */ |
127 | dev = alloc_orinocodev(sizeof(*card), &pdev->dev, | 127 | priv = alloc_orinocodev(sizeof(*card), &pdev->dev, |
128 | orinoco_tmd_cor_reset, NULL); | 128 | orinoco_tmd_cor_reset, NULL); |
129 | if (!dev) { | 129 | if (!priv) { |
130 | printk(KERN_ERR PFX "Cannot allocate network device\n"); | 130 | printk(KERN_ERR PFX "Cannot allocate network device\n"); |
131 | err = -ENOMEM; | 131 | err = -ENOMEM; |
132 | goto fail_alloc; | 132 | goto fail_alloc; |
133 | } | 133 | } |
134 | 134 | ||
135 | priv = netdev_priv(dev); | 135 | dev = priv->ndev; |
136 | card = priv->card; | 136 | card = priv->card; |
137 | card->bridge_io = bridge_io; | 137 | card->bridge_io = bridge_io; |
138 | SET_NETDEV_DEV(dev, &pdev->dev); | 138 | SET_NETDEV_DEV(dev, &pdev->dev); |
@@ -140,7 +140,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
140 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); | 140 | hermes_struct_init(&priv->hw, hermes_io, HERMES_16BIT_REGSPACING); |
141 | 141 | ||
142 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, | 142 | err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, |
143 | dev->name, dev); | 143 | dev->name, priv); |
144 | if (err) { | 144 | if (err) { |
145 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); | 145 | printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); |
146 | err = -EBUSY; | 146 | err = -EBUSY; |
@@ -159,18 +159,18 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
159 | goto fail; | 159 | goto fail; |
160 | } | 160 | } |
161 | 161 | ||
162 | pci_set_drvdata(pdev, dev); | 162 | pci_set_drvdata(pdev, priv); |
163 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, | 163 | printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s\n", dev->name, |
164 | pci_name(pdev)); | 164 | pci_name(pdev)); |
165 | 165 | ||
166 | return 0; | 166 | return 0; |
167 | 167 | ||
168 | fail: | 168 | fail: |
169 | free_irq(pdev->irq, dev); | 169 | free_irq(pdev->irq, priv); |
170 | 170 | ||
171 | fail_irq: | 171 | fail_irq: |
172 | pci_set_drvdata(pdev, NULL); | 172 | pci_set_drvdata(pdev, NULL); |
173 | free_orinocodev(dev); | 173 | free_orinocodev(priv); |
174 | 174 | ||
175 | fail_alloc: | 175 | fail_alloc: |
176 | pci_iounmap(pdev, hermes_io); | 176 | pci_iounmap(pdev, hermes_io); |
@@ -189,14 +189,14 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev, | |||
189 | 189 | ||
190 | static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev) | 190 | static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev) |
191 | { | 191 | { |
192 | struct net_device *dev = pci_get_drvdata(pdev); | 192 | struct orinoco_private *priv = pci_get_drvdata(pdev); |
193 | struct orinoco_private *priv = netdev_priv(dev); | 193 | struct net_device *dev = priv->ndev; |
194 | struct orinoco_pci_card *card = priv->card; | 194 | struct orinoco_pci_card *card = priv->card; |
195 | 195 | ||
196 | unregister_netdev(dev); | 196 | unregister_netdev(dev); |
197 | free_irq(pdev->irq, dev); | 197 | free_irq(pdev->irq, priv); |
198 | pci_set_drvdata(pdev, NULL); | 198 | pci_set_drvdata(pdev, NULL); |
199 | free_orinocodev(dev); | 199 | free_orinocodev(priv); |
200 | pci_iounmap(pdev, priv->hw.iobase); | 200 | pci_iounmap(pdev, priv->hw.iobase); |
201 | pci_iounmap(pdev, card->bridge_io); | 201 | pci_iounmap(pdev, card->bridge_io); |
202 | pci_release_regions(pdev); | 202 | pci_release_regions(pdev); |
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); |