aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c15
-rw-r--r--drivers/net/pcmcia/3c589_cs.c16
-rw-r--r--drivers/net/pcmcia/axnet_cs.c21
-rw-r--r--drivers/net/pcmcia/com20020_cs.c29
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c18
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c16
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c14
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c16
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c17
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c36
-rw-r--r--drivers/net/wireless/airo_cs.c72
-rw-r--r--drivers/net/wireless/atmel_cs.c70
-rw-r--r--drivers/net/wireless/b43/pcmcia.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c38
-rw-r--r--drivers/net/wireless/libertas/if_cs.c21
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c27
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c27
-rw-r--r--drivers/net/wireless/ray_cs.c15
-rw-r--r--drivers/net/wireless/ray_cs.h1
-rw-r--r--drivers/net/wireless/wl3501.h1
-rw-r--r--drivers/net/wireless/wl3501_cs.c23
21 files changed, 82 insertions, 416 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 757f87bb1db..30b7cf70fbe 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -93,7 +93,6 @@ earlier 3Com products.
93#include <pcmcia/cisreg.h> 93#include <pcmcia/cisreg.h>
94#include <pcmcia/ciscode.h> 94#include <pcmcia/ciscode.h>
95#include <pcmcia/ds.h> 95#include <pcmcia/ds.h>
96#include <pcmcia/mem_op.h>
97 96
98#include <asm/uaccess.h> 97#include <asm/uaccess.h>
99#include <asm/io.h> 98#include <asm/io.h>
@@ -200,7 +199,6 @@ enum Window4 { /* Window 4: Xcvr/media bits. */
200 199
201struct el3_private { 200struct el3_private {
202 struct pcmcia_device *p_dev; 201 struct pcmcia_device *p_dev;
203 dev_node_t node;
204 u16 advertising, partner; /* NWay media advertisement */ 202 u16 advertising, partner; /* NWay media advertisement */
205 unsigned char phys; /* MII device address */ 203 unsigned char phys; /* MII device address */
206 unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ 204 unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */
@@ -283,8 +281,6 @@ static int tc574_probe(struct pcmcia_device *link)
283 spin_lock_init(&lp->window_lock); 281 spin_lock_init(&lp->window_lock);
284 link->io.NumPorts1 = 32; 282 link->io.NumPorts1 = 32;
285 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 283 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
286 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
287 link->irq.Handler = &el3_interrupt;
288 link->conf.Attributes = CONF_ENABLE_IRQ; 284 link->conf.Attributes = CONF_ENABLE_IRQ;
289 link->conf.IntType = INT_MEMORY_AND_IO; 285 link->conf.IntType = INT_MEMORY_AND_IO;
290 link->conf.ConfigIndex = 1; 286 link->conf.ConfigIndex = 1;
@@ -311,8 +307,7 @@ static void tc574_detach(struct pcmcia_device *link)
311 307
312 dev_dbg(&link->dev, "3c574_detach()\n"); 308 dev_dbg(&link->dev, "3c574_detach()\n");
313 309
314 if (link->dev_node) 310 unregister_netdev(dev);
315 unregister_netdev(dev);
316 311
317 tc574_release(link); 312 tc574_release(link);
318 313
@@ -353,7 +348,7 @@ static int tc574_config(struct pcmcia_device *link)
353 if (i != 0) 348 if (i != 0)
354 goto failed; 349 goto failed;
355 350
356 ret = pcmcia_request_irq(link, &link->irq); 351 ret = pcmcia_request_irq(link, el3_interrupt);
357 if (ret) 352 if (ret)
358 goto failed; 353 goto failed;
359 354
@@ -361,7 +356,7 @@ static int tc574_config(struct pcmcia_device *link)
361 if (ret) 356 if (ret)
362 goto failed; 357 goto failed;
363 358
364 dev->irq = link->irq.AssignedIRQ; 359 dev->irq = link->irq;
365 dev->base_addr = link->io.BasePort1; 360 dev->base_addr = link->io.BasePort1;
366 361
367 ioaddr = dev->base_addr; 362 ioaddr = dev->base_addr;
@@ -446,17 +441,13 @@ static int tc574_config(struct pcmcia_device *link)
446 } 441 }
447 } 442 }
448 443
449 link->dev_node = &lp->node;
450 SET_NETDEV_DEV(dev, &link->dev); 444 SET_NETDEV_DEV(dev, &link->dev);
451 445
452 if (register_netdev(dev) != 0) { 446 if (register_netdev(dev) != 0) {
453 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); 447 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n");
454 link->dev_node = NULL;
455 goto failed; 448 goto failed;
456 } 449 }
457 450
458 strcpy(lp->node.dev_name, dev->name);
459
460 printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " 451 printk(KERN_INFO "%s: %s at io %#3lx, irq %d, "
461 "hw_addr %pM.\n", 452 "hw_addr %pM.\n",
462 dev->name, cardname, dev->base_addr, dev->irq, 453 dev->name, cardname, dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 091e0b00043..5ab589d3b38 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -106,7 +106,6 @@ enum RxFilter {
106 106
107struct el3_private { 107struct el3_private {
108 struct pcmcia_device *p_dev; 108 struct pcmcia_device *p_dev;
109 dev_node_t node;
110 /* For transceiver monitoring */ 109 /* For transceiver monitoring */
111 struct timer_list media; 110 struct timer_list media;
112 u16 media_status; 111 u16 media_status;
@@ -194,8 +193,7 @@ static int tc589_probe(struct pcmcia_device *link)
194 spin_lock_init(&lp->lock); 193 spin_lock_init(&lp->lock);
195 link->io.NumPorts1 = 16; 194 link->io.NumPorts1 = 16;
196 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 195 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 196
198 link->irq.Handler = &el3_interrupt;
199 link->conf.Attributes = CONF_ENABLE_IRQ; 197 link->conf.Attributes = CONF_ENABLE_IRQ;
200 link->conf.IntType = INT_MEMORY_AND_IO; 198 link->conf.IntType = INT_MEMORY_AND_IO;
201 link->conf.ConfigIndex = 1; 199 link->conf.ConfigIndex = 1;
@@ -223,8 +221,7 @@ static void tc589_detach(struct pcmcia_device *link)
223 221
224 dev_dbg(&link->dev, "3c589_detach\n"); 222 dev_dbg(&link->dev, "3c589_detach\n");
225 223
226 if (link->dev_node) 224 unregister_netdev(dev);
227 unregister_netdev(dev);
228 225
229 tc589_release(link); 226 tc589_release(link);
230 227
@@ -242,7 +239,6 @@ static void tc589_detach(struct pcmcia_device *link)
242static int tc589_config(struct pcmcia_device *link) 239static int tc589_config(struct pcmcia_device *link)
243{ 240{
244 struct net_device *dev = link->priv; 241 struct net_device *dev = link->priv;
245 struct el3_private *lp = netdev_priv(dev);
246 __be16 *phys_addr; 242 __be16 *phys_addr;
247 int ret, i, j, multi = 0, fifo; 243 int ret, i, j, multi = 0, fifo;
248 unsigned int ioaddr; 244 unsigned int ioaddr;
@@ -271,7 +267,7 @@ static int tc589_config(struct pcmcia_device *link)
271 if (i != 0) 267 if (i != 0)
272 goto failed; 268 goto failed;
273 269
274 ret = pcmcia_request_irq(link, &link->irq); 270 ret = pcmcia_request_irq(link, el3_interrupt);
275 if (ret) 271 if (ret)
276 goto failed; 272 goto failed;
277 273
@@ -279,7 +275,7 @@ static int tc589_config(struct pcmcia_device *link)
279 if (ret) 275 if (ret)
280 goto failed; 276 goto failed;
281 277
282 dev->irq = link->irq.AssignedIRQ; 278 dev->irq = link->irq;
283 dev->base_addr = link->io.BasePort1; 279 dev->base_addr = link->io.BasePort1;
284 ioaddr = dev->base_addr; 280 ioaddr = dev->base_addr;
285 EL3WINDOW(0); 281 EL3WINDOW(0);
@@ -313,17 +309,13 @@ static int tc589_config(struct pcmcia_device *link)
313 else 309 else
314 printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); 310 printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
315 311
316 link->dev_node = &lp->node;
317 SET_NETDEV_DEV(dev, &link->dev); 312 SET_NETDEV_DEV(dev, &link->dev);
318 313
319 if (register_netdev(dev) != 0) { 314 if (register_netdev(dev) != 0) {
320 printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); 315 printk(KERN_ERR "3c589_cs: register_netdev() failed\n");
321 link->dev_node = NULL;
322 goto failed; 316 goto failed;
323 } 317 }
324 318
325 strcpy(lp->node.dev_name, dev->name);
326
327 printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " 319 printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, "
328 "hw_addr %pM\n", 320 "hw_addr %pM\n",
329 dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, 321 dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 9f3d593f14e..59f6fa3c9dd 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -113,7 +113,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id);
113 113
114typedef struct axnet_dev_t { 114typedef struct axnet_dev_t {
115 struct pcmcia_device *p_dev; 115 struct pcmcia_device *p_dev;
116 dev_node_t node;
117 caddr_t base; 116 caddr_t base;
118 struct timer_list watchdog; 117 struct timer_list watchdog;
119 int stale, fast_poll; 118 int stale, fast_poll;
@@ -168,7 +167,6 @@ static int axnet_probe(struct pcmcia_device *link)
168 info = PRIV(dev); 167 info = PRIV(dev);
169 info->p_dev = link; 168 info->p_dev = link;
170 link->priv = dev; 169 link->priv = dev;
171 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
172 link->conf.Attributes = CONF_ENABLE_IRQ; 170 link->conf.Attributes = CONF_ENABLE_IRQ;
173 link->conf.IntType = INT_MEMORY_AND_IO; 171 link->conf.IntType = INT_MEMORY_AND_IO;
174 172
@@ -195,8 +193,7 @@ static void axnet_detach(struct pcmcia_device *link)
195 193
196 dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link); 194 dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link);
197 195
198 if (link->dev_node) 196 unregister_netdev(dev);
199 unregister_netdev(dev);
200 197
201 axnet_release(link); 198 axnet_release(link);
202 199
@@ -265,12 +262,9 @@ static int try_io_port(struct pcmcia_device *link)
265 int j, ret; 262 int j, ret;
266 if (link->io.NumPorts1 == 32) { 263 if (link->io.NumPorts1 == 32) {
267 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 264 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
268 if (link->io.NumPorts2 > 0) { 265 /* for master/slave multifunction cards */
269 /* for master/slave multifunction cards */ 266 if (link->io.NumPorts2 > 0)
270 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 267 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
271 link->irq.Attributes =
272 IRQ_TYPE_DYNAMIC_SHARING;
273 }
274 } else { 268 } else {
275 /* This should be two 16-port windows */ 269 /* This should be two 16-port windows */
276 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 270 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -336,8 +330,7 @@ static int axnet_config(struct pcmcia_device *link)
336 if (ret != 0) 330 if (ret != 0)
337 goto failed; 331 goto failed;
338 332
339 ret = pcmcia_request_irq(link, &link->irq); 333 if (!link->irq)
340 if (ret)
341 goto failed; 334 goto failed;
342 335
343 if (link->io.NumPorts2 == 8) { 336 if (link->io.NumPorts2 == 8) {
@@ -349,7 +342,7 @@ static int axnet_config(struct pcmcia_device *link)
349 if (ret) 342 if (ret)
350 goto failed; 343 goto failed;
351 344
352 dev->irq = link->irq.AssignedIRQ; 345 dev->irq = link->irq;
353 dev->base_addr = link->io.BasePort1; 346 dev->base_addr = link->io.BasePort1;
354 347
355 if (!get_prom(link)) { 348 if (!get_prom(link)) {
@@ -397,17 +390,13 @@ static int axnet_config(struct pcmcia_device *link)
397 } 390 }
398 391
399 info->phy_id = (i < 32) ? i : -1; 392 info->phy_id = (i < 32) ? i : -1;
400 link->dev_node = &info->node;
401 SET_NETDEV_DEV(dev, &link->dev); 393 SET_NETDEV_DEV(dev, &link->dev);
402 394
403 if (register_netdev(dev) != 0) { 395 if (register_netdev(dev) != 0) {
404 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); 396 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
405 link->dev_node = NULL;
406 goto failed; 397 goto failed;
407 } 398 }
408 399
409 strcpy(info->node.dev_name, dev->name);
410
411 printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " 400 printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, "
412 "hw_addr %pM\n", 401 "hw_addr %pM\n",
413 dev->name, ((info->flags & IS_AX88790) ? 7 : 1), 402 dev->name, ((info->flags & IS_AX88790) ? 7 : 1),
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 21d9c9d815d..5643f94541b 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -122,7 +122,6 @@ static void com20020_detach(struct pcmcia_device *p_dev);
122 122
123typedef struct com20020_dev_t { 123typedef struct com20020_dev_t {
124 struct net_device *dev; 124 struct net_device *dev;
125 dev_node_t node;
126} com20020_dev_t; 125} com20020_dev_t;
127 126
128/*====================================================================== 127/*======================================================================
@@ -163,7 +162,6 @@ static int com20020_probe(struct pcmcia_device *p_dev)
163 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 162 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
164 p_dev->io.NumPorts1 = 16; 163 p_dev->io.NumPorts1 = 16;
165 p_dev->io.IOAddrLines = 16; 164 p_dev->io.IOAddrLines = 16;
166 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
167 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 165 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
168 p_dev->conf.IntType = INT_MEMORY_AND_IO; 166 p_dev->conf.IntType = INT_MEMORY_AND_IO;
169 167
@@ -196,18 +194,16 @@ static void com20020_detach(struct pcmcia_device *link)
196 194
197 dev_dbg(&link->dev, "com20020_detach\n"); 195 dev_dbg(&link->dev, "com20020_detach\n");
198 196
199 if (link->dev_node) { 197 dev_dbg(&link->dev, "unregister...\n");
200 dev_dbg(&link->dev, "unregister...\n");
201 198
202 unregister_netdev(dev); 199 unregister_netdev(dev);
203 200
204 /* 201 /*
205 * this is necessary because we register our IRQ separately 202 * this is necessary because we register our IRQ separately
206 * from card services. 203 * from card services.
207 */ 204 */
208 if (dev->irq) 205 if (dev->irq)
209 free_irq(dev->irq, dev); 206 free_irq(dev->irq, dev);
210 }
211 207
212 com20020_release(link); 208 com20020_release(link);
213 209
@@ -275,15 +271,14 @@ static int com20020_config(struct pcmcia_device *link)
275 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); 271 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr);
276 272
277 dev_dbg(&link->dev, "request IRQ %d\n", 273 dev_dbg(&link->dev, "request IRQ %d\n",
278 link->irq.AssignedIRQ); 274 link->irq);
279 i = pcmcia_request_irq(link, &link->irq); 275 if (!link->irq)
280 if (i != 0)
281 { 276 {
282 dev_dbg(&link->dev, "requestIRQ failed totally!\n"); 277 dev_dbg(&link->dev, "requestIRQ failed totally!\n");
283 goto failed; 278 goto failed;
284 } 279 }
285 280
286 dev->irq = link->irq.AssignedIRQ; 281 dev->irq = link->irq;
287 282
288 ret = pcmcia_request_configuration(link, &link->conf); 283 ret = pcmcia_request_configuration(link, &link->conf);
289 if (ret) 284 if (ret)
@@ -299,7 +294,6 @@ static int com20020_config(struct pcmcia_device *link)
299 lp->card_name = "PCMCIA COM20020"; 294 lp->card_name = "PCMCIA COM20020";
300 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ 295 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
301 296
302 link->dev_node = &info->node;
303 SET_NETDEV_DEV(dev, &link->dev); 297 SET_NETDEV_DEV(dev, &link->dev);
304 298
305 i = com20020_found(dev, 0); /* calls register_netdev */ 299 i = com20020_found(dev, 0); /* calls register_netdev */
@@ -307,12 +301,9 @@ static int com20020_config(struct pcmcia_device *link)
307 if (i != 0) { 301 if (i != 0) {
308 dev_printk(KERN_NOTICE, &link->dev, 302 dev_printk(KERN_NOTICE, &link->dev,
309 "com20020_cs: com20020_found() failed\n"); 303 "com20020_cs: com20020_found() failed\n");
310 link->dev_node = NULL;
311 goto failed; 304 goto failed;
312 } 305 }
313 306
314 strcpy(info->node.dev_name, dev->name);
315
316 dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", 307 dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n",
317 dev->name, dev->base_addr, dev->irq); 308 dev->name, dev->base_addr, dev->irq);
318 return 0; 309 return 0;
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index b9dc80b9d04..6580d78397d 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -110,7 +110,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN,
110*/ 110*/
111typedef struct local_info_t { 111typedef struct local_info_t {
112 struct pcmcia_device *p_dev; 112 struct pcmcia_device *p_dev;
113 dev_node_t node;
114 long open_time; 113 long open_time;
115 uint tx_started:1; 114 uint tx_started:1;
116 uint tx_queue; 115 uint tx_queue;
@@ -254,10 +253,6 @@ static int fmvj18x_probe(struct pcmcia_device *link)
254 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 253 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
255 link->io.IOAddrLines = 5; 254 link->io.IOAddrLines = 5;
256 255
257 /* Interrupt setup */
258 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
259 link->irq.Handler = fjn_interrupt;
260
261 /* General socket configuration */ 256 /* General socket configuration */
262 link->conf.Attributes = CONF_ENABLE_IRQ; 257 link->conf.Attributes = CONF_ENABLE_IRQ;
263 link->conf.IntType = INT_MEMORY_AND_IO; 258 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -278,8 +273,7 @@ static void fmvj18x_detach(struct pcmcia_device *link)
278 273
279 dev_dbg(&link->dev, "fmvj18x_detach\n"); 274 dev_dbg(&link->dev, "fmvj18x_detach\n");
280 275
281 if (link->dev_node) 276 unregister_netdev(dev);
282 unregister_netdev(dev);
283 277
284 fmvj18x_release(link); 278 fmvj18x_release(link);
285 279
@@ -425,8 +419,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
425 } 419 }
426 420
427 if (link->io.NumPorts2 != 0) { 421 if (link->io.NumPorts2 != 0) {
428 link->irq.Attributes =
429 IRQ_TYPE_DYNAMIC_SHARING;
430 ret = mfc_try_io_port(link); 422 ret = mfc_try_io_port(link);
431 if (ret != 0) goto failed; 423 if (ret != 0) goto failed;
432 } else if (cardtype == UNGERMANN) { 424 } else if (cardtype == UNGERMANN) {
@@ -437,14 +429,14 @@ static int fmvj18x_config(struct pcmcia_device *link)
437 if (ret) 429 if (ret)
438 goto failed; 430 goto failed;
439 } 431 }
440 ret = pcmcia_request_irq(link, &link->irq); 432 ret = pcmcia_request_irq(link, fjn_interrupt);
441 if (ret) 433 if (ret)
442 goto failed; 434 goto failed;
443 ret = pcmcia_request_configuration(link, &link->conf); 435 ret = pcmcia_request_configuration(link, &link->conf);
444 if (ret) 436 if (ret)
445 goto failed; 437 goto failed;
446 438
447 dev->irq = link->irq.AssignedIRQ; 439 dev->irq = link->irq;
448 dev->base_addr = link->io.BasePort1; 440 dev->base_addr = link->io.BasePort1;
449 441
450 if (link->io.BasePort2 != 0) { 442 if (link->io.BasePort2 != 0) {
@@ -529,17 +521,13 @@ static int fmvj18x_config(struct pcmcia_device *link)
529 } 521 }
530 522
531 lp->cardtype = cardtype; 523 lp->cardtype = cardtype;
532 link->dev_node = &lp->node;
533 SET_NETDEV_DEV(dev, &link->dev); 524 SET_NETDEV_DEV(dev, &link->dev);
534 525
535 if (register_netdev(dev) != 0) { 526 if (register_netdev(dev) != 0) {
536 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); 527 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
537 link->dev_node = NULL;
538 goto failed; 528 goto failed;
539 } 529 }
540 530
541 strcpy(lp->node.dev_name, dev->name);
542
543 /* print current configuration */ 531 /* print current configuration */
544 printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " 532 printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, "
545 "hw_addr %pM\n", 533 "hw_addr %pM\n",
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 37f4a6fdc3e..2e42d80f8ca 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -104,7 +104,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev);
104typedef struct ibmtr_dev_t { 104typedef struct ibmtr_dev_t {
105 struct pcmcia_device *p_dev; 105 struct pcmcia_device *p_dev;
106 struct net_device *dev; 106 struct net_device *dev;
107 dev_node_t node;
108 window_handle_t sram_win_handle; 107 window_handle_t sram_win_handle;
109 struct tok_info *ti; 108 struct tok_info *ti;
110} ibmtr_dev_t; 109} ibmtr_dev_t;
@@ -156,8 +155,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
156 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 155 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
157 link->io.NumPorts1 = 4; 156 link->io.NumPorts1 = 4;
158 link->io.IOAddrLines = 16; 157 link->io.IOAddrLines = 16;
159 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
160 link->irq.Handler = ibmtr_interrupt;
161 link->conf.Attributes = CONF_ENABLE_IRQ; 158 link->conf.Attributes = CONF_ENABLE_IRQ;
162 link->conf.IntType = INT_MEMORY_AND_IO; 159 link->conf.IntType = INT_MEMORY_AND_IO;
163 link->conf.Present = PRESENT_OPTION; 160 link->conf.Present = PRESENT_OPTION;
@@ -192,8 +189,7 @@ static void ibmtr_detach(struct pcmcia_device *link)
192 */ 189 */
193 ti->sram_phys |= 1; 190 ti->sram_phys |= 1;
194 191
195 if (link->dev_node) 192 unregister_netdev(dev);
196 unregister_netdev(dev);
197 193
198 del_timer_sync(&(ti->tr_timer)); 194 del_timer_sync(&(ti->tr_timer));
199 195
@@ -238,11 +234,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
238 } 234 }
239 dev->base_addr = link->io.BasePort1; 235 dev->base_addr = link->io.BasePort1;
240 236
241 ret = pcmcia_request_irq(link, &link->irq); 237 ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt);
242 if (ret) 238 if (ret)
243 goto failed; 239 goto failed;
244 dev->irq = link->irq.AssignedIRQ; 240 dev->irq = link->irq;
245 ti->irq = link->irq.AssignedIRQ; 241 ti->irq = link->irq;
246 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); 242 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
247 243
248 /* Allocate the MMIO memory window */ 244 /* Allocate the MMIO memory window */
@@ -291,18 +287,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
291 Adapters Technical Reference" SC30-3585 for this info. */ 287 Adapters Technical Reference" SC30-3585 for this info. */
292 ibmtr_hw_setup(dev, mmiobase); 288 ibmtr_hw_setup(dev, mmiobase);
293 289
294 link->dev_node = &info->node;
295 SET_NETDEV_DEV(dev, &link->dev); 290 SET_NETDEV_DEV(dev, &link->dev);
296 291
297 i = ibmtr_probe_card(dev); 292 i = ibmtr_probe_card(dev);
298 if (i != 0) { 293 if (i != 0) {
299 printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); 294 printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n");
300 link->dev_node = NULL;
301 goto failed; 295 goto failed;
302 } 296 }
303 297
304 strcpy(info->node.dev_name, dev->name);
305
306 printk(KERN_INFO 298 printk(KERN_INFO
307 "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", 299 "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
308 dev->name, dev->base_addr, dev->irq, 300 dev->name, dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index c717b143f11..d8a3b3cf246 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -363,7 +363,6 @@ typedef struct _mace_statistics {
363 363
364typedef struct _mace_private { 364typedef struct _mace_private {
365 struct pcmcia_device *p_dev; 365 struct pcmcia_device *p_dev;
366 dev_node_t node;
367 struct net_device_stats linux_stats; /* Linux statistics counters */ 366 struct net_device_stats linux_stats; /* Linux statistics counters */
368 mace_statistics mace_stats; /* MACE chip statistics counters */ 367 mace_statistics mace_stats; /* MACE chip statistics counters */
369 368
@@ -463,8 +462,6 @@ static int nmclan_probe(struct pcmcia_device *link)
463 link->io.NumPorts1 = 32; 462 link->io.NumPorts1 = 32;
464 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 463 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
465 link->io.IOAddrLines = 5; 464 link->io.IOAddrLines = 5;
466 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
467 link->irq.Handler = mace_interrupt;
468 link->conf.Attributes = CONF_ENABLE_IRQ; 465 link->conf.Attributes = CONF_ENABLE_IRQ;
469 link->conf.IntType = INT_MEMORY_AND_IO; 466 link->conf.IntType = INT_MEMORY_AND_IO;
470 link->conf.ConfigIndex = 1; 467 link->conf.ConfigIndex = 1;
@@ -493,8 +490,7 @@ static void nmclan_detach(struct pcmcia_device *link)
493 490
494 dev_dbg(&link->dev, "nmclan_detach\n"); 491 dev_dbg(&link->dev, "nmclan_detach\n");
495 492
496 if (link->dev_node) 493 unregister_netdev(dev);
497 unregister_netdev(dev);
498 494
499 nmclan_release(link); 495 nmclan_release(link);
500 496
@@ -652,14 +648,14 @@ static int nmclan_config(struct pcmcia_device *link)
652 ret = pcmcia_request_io(link, &link->io); 648 ret = pcmcia_request_io(link, &link->io);
653 if (ret) 649 if (ret)
654 goto failed; 650 goto failed;
655 ret = pcmcia_request_irq(link, &link->irq); 651 ret = pcmcia_request_exclusive_irq(link, mace_interrupt);
656 if (ret) 652 if (ret)
657 goto failed; 653 goto failed;
658 ret = pcmcia_request_configuration(link, &link->conf); 654 ret = pcmcia_request_configuration(link, &link->conf);
659 if (ret) 655 if (ret)
660 goto failed; 656 goto failed;
661 657
662 dev->irq = link->irq.AssignedIRQ; 658 dev->irq = link->irq;
663 dev->base_addr = link->io.BasePort1; 659 dev->base_addr = link->io.BasePort1;
664 660
665 ioaddr = dev->base_addr; 661 ioaddr = dev->base_addr;
@@ -698,18 +694,14 @@ static int nmclan_config(struct pcmcia_device *link)
698 else 694 else
699 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); 695 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n");
700 696
701 link->dev_node = &lp->node;
702 SET_NETDEV_DEV(dev, &link->dev); 697 SET_NETDEV_DEV(dev, &link->dev);
703 698
704 i = register_netdev(dev); 699 i = register_netdev(dev);
705 if (i != 0) { 700 if (i != 0) {
706 printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); 701 printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n");
707 link->dev_node = NULL;
708 goto failed; 702 goto failed;
709 } 703 }
710 704
711 strcpy(lp->node.dev_name, dev->name);
712
713 printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," 705 printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port,"
714 " hw_addr %pM\n", 706 " hw_addr %pM\n",
715 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], 707 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port],
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 4c0368de181..6f77a768ba8 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -208,7 +208,6 @@ static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
208 208
209typedef struct pcnet_dev_t { 209typedef struct pcnet_dev_t {
210 struct pcmcia_device *p_dev; 210 struct pcmcia_device *p_dev;
211 dev_node_t node;
212 u_int flags; 211 u_int flags;
213 void __iomem *base; 212 void __iomem *base;
214 struct timer_list watchdog; 213 struct timer_list watchdog;
@@ -264,7 +263,6 @@ static int pcnet_probe(struct pcmcia_device *link)
264 info->p_dev = link; 263 info->p_dev = link;
265 link->priv = dev; 264 link->priv = dev;
266 265
267 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
268 link->conf.Attributes = CONF_ENABLE_IRQ; 266 link->conf.Attributes = CONF_ENABLE_IRQ;
269 link->conf.IntType = INT_MEMORY_AND_IO; 267 link->conf.IntType = INT_MEMORY_AND_IO;
270 268
@@ -288,8 +286,7 @@ static void pcnet_detach(struct pcmcia_device *link)
288 286
289 dev_dbg(&link->dev, "pcnet_detach\n"); 287 dev_dbg(&link->dev, "pcnet_detach\n");
290 288
291 if (link->dev_node) 289 unregister_netdev(dev);
292 unregister_netdev(dev);
293 290
294 pcnet_release(link); 291 pcnet_release(link);
295 292
@@ -488,8 +485,6 @@ static int try_io_port(struct pcmcia_device *link)
488 if (link->io.NumPorts2 > 0) { 485 if (link->io.NumPorts2 > 0) {
489 /* for master/slave multifunction cards */ 486 /* for master/slave multifunction cards */
490 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 487 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
491 link->irq.Attributes =
492 IRQ_TYPE_DYNAMIC_SHARING;
493 } 488 }
494 } else { 489 } else {
495 /* This should be two 16-port windows */ 490 /* This should be two 16-port windows */
@@ -559,8 +554,7 @@ static int pcnet_config(struct pcmcia_device *link)
559 if (ret) 554 if (ret)
560 goto failed; 555 goto failed;
561 556
562 ret = pcmcia_request_irq(link, &link->irq); 557 if (!link->irq)
563 if (ret)
564 goto failed; 558 goto failed;
565 559
566 if (link->io.NumPorts2 == 8) { 560 if (link->io.NumPorts2 == 8) {
@@ -574,7 +568,7 @@ static int pcnet_config(struct pcmcia_device *link)
574 ret = pcmcia_request_configuration(link, &link->conf); 568 ret = pcmcia_request_configuration(link, &link->conf);
575 if (ret) 569 if (ret)
576 goto failed; 570 goto failed;
577 dev->irq = link->irq.AssignedIRQ; 571 dev->irq = link->irq;
578 dev->base_addr = link->io.BasePort1; 572 dev->base_addr = link->io.BasePort1;
579 if (info->flags & HAS_MISC_REG) { 573 if (info->flags & HAS_MISC_REG) {
580 if ((if_port == 1) || (if_port == 2)) 574 if ((if_port == 1) || (if_port == 2))
@@ -643,17 +637,13 @@ static int pcnet_config(struct pcmcia_device *link)
643 if (info->flags & (IS_DL10019|IS_DL10022)) 637 if (info->flags & (IS_DL10019|IS_DL10022))
644 mii_phy_probe(dev); 638 mii_phy_probe(dev);
645 639
646 link->dev_node = &info->node;
647 SET_NETDEV_DEV(dev, &link->dev); 640 SET_NETDEV_DEV(dev, &link->dev);
648 641
649 if (register_netdev(dev) != 0) { 642 if (register_netdev(dev) != 0) {
650 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); 643 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
651 link->dev_node = NULL;
652 goto failed; 644 goto failed;
653 } 645 }
654 646
655 strcpy(info->node.dev_name, dev->name);
656
657 if (info->flags & (IS_DL10019|IS_DL10022)) { 647 if (info->flags & (IS_DL10019|IS_DL10022)) {
658 u_char id = inb(dev->base_addr + 0x1a); 648 u_char id = inb(dev->base_addr + 0x1a);
659 printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", 649 printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ",
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index ccc553782a0..59796e7d09c 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -103,7 +103,6 @@ struct smc_private {
103 u_short manfid; 103 u_short manfid;
104 u_short cardid; 104 u_short cardid;
105 105
106 dev_node_t node;
107 struct sk_buff *saved_skb; 106 struct sk_buff *saved_skb;
108 int packets_waiting; 107 int packets_waiting;
109 void __iomem *base; 108 void __iomem *base;
@@ -323,14 +322,11 @@ static int smc91c92_probe(struct pcmcia_device *link)
323 return -ENOMEM; 322 return -ENOMEM;
324 smc = netdev_priv(dev); 323 smc = netdev_priv(dev);
325 smc->p_dev = link; 324 smc->p_dev = link;
326 link->priv = dev;
327 325
328 spin_lock_init(&smc->lock); 326 spin_lock_init(&smc->lock);
329 link->io.NumPorts1 = 16; 327 link->io.NumPorts1 = 16;
330 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 328 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
331 link->io.IOAddrLines = 4; 329 link->io.IOAddrLines = 4;
332 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
333 link->irq.Handler = &smc_interrupt;
334 link->conf.Attributes = CONF_ENABLE_IRQ; 330 link->conf.Attributes = CONF_ENABLE_IRQ;
335 link->conf.IntType = INT_MEMORY_AND_IO; 331 link->conf.IntType = INT_MEMORY_AND_IO;
336 332
@@ -363,8 +359,7 @@ static void smc91c92_detach(struct pcmcia_device *link)
363 359
364 dev_dbg(&link->dev, "smc91c92_detach\n"); 360 dev_dbg(&link->dev, "smc91c92_detach\n");
365 361
366 if (link->dev_node) 362 unregister_netdev(dev);
367 unregister_netdev(dev);
368 363
369 smc91c92_release(link); 364 smc91c92_release(link);
370 365
@@ -453,7 +448,6 @@ static int mhz_mfc_config(struct pcmcia_device *link)
453 448
454 link->conf.Attributes |= CONF_ENABLE_SPKR; 449 link->conf.Attributes |= CONF_ENABLE_SPKR;
455 link->conf.Status = CCSR_AUDIO_ENA; 450 link->conf.Status = CCSR_AUDIO_ENA;
456 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
457 link->io.IOAddrLines = 16; 451 link->io.IOAddrLines = 16;
458 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 452 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
459 link->io.NumPorts2 = 8; 453 link->io.NumPorts2 = 8;
@@ -652,7 +646,6 @@ static int osi_config(struct pcmcia_device *link)
652 646
653 link->conf.Attributes |= CONF_ENABLE_SPKR; 647 link->conf.Attributes |= CONF_ENABLE_SPKR;
654 link->conf.Status = CCSR_AUDIO_ENA; 648 link->conf.Status = CCSR_AUDIO_ENA;
655 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
656 link->io.NumPorts1 = 64; 649 link->io.NumPorts1 = 64;
657 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 650 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
658 link->io.NumPorts2 = 8; 651 link->io.NumPorts2 = 8;
@@ -877,7 +870,7 @@ static int smc91c92_config(struct pcmcia_device *link)
877 if (i) 870 if (i)
878 goto config_failed; 871 goto config_failed;
879 872
880 i = pcmcia_request_irq(link, &link->irq); 873 i = pcmcia_request_irq(link, smc_interrupt);
881 if (i) 874 if (i)
882 goto config_failed; 875 goto config_failed;
883 i = pcmcia_request_configuration(link, &link->conf); 876 i = pcmcia_request_configuration(link, &link->conf);
@@ -887,7 +880,7 @@ static int smc91c92_config(struct pcmcia_device *link)
887 if (smc->manfid == MANFID_MOTOROLA) 880 if (smc->manfid == MANFID_MOTOROLA)
888 mot_config(link); 881 mot_config(link);
889 882
890 dev->irq = link->irq.AssignedIRQ; 883 dev->irq = link->irq;
891 884
892 if ((if_port >= 0) && (if_port <= 2)) 885 if ((if_port >= 0) && (if_port <= 2))
893 dev->if_port = if_port; 886 dev->if_port = if_port;
@@ -960,17 +953,13 @@ static int smc91c92_config(struct pcmcia_device *link)
960 SMC_SELECT_BANK(0); 953 SMC_SELECT_BANK(0);
961 } 954 }
962 955
963 link->dev_node = &smc->node;
964 SET_NETDEV_DEV(dev, &link->dev); 956 SET_NETDEV_DEV(dev, &link->dev);
965 957
966 if (register_netdev(dev) != 0) { 958 if (register_netdev(dev) != 0) {
967 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); 959 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
968 link->dev_node = NULL;
969 goto config_undo; 960 goto config_undo;
970 } 961 }
971 962
972 strcpy(smc->node.dev_name, dev->name);
973
974 printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " 963 printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, "
975 "hw_addr %pM\n", 964 "hw_addr %pM\n",
976 dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, 965 dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq,
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 4d1802e457b..5e6b62ba888 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -297,31 +297,9 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev);
297 297
298static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); 298static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);
299 299
300/****************
301 * A linked list of "instances" of the device. Each actual
302 * PCMCIA card corresponds to one device instance, and is described
303 * by one struct pcmcia_device structure (defined in ds.h).
304 *
305 * You may not want to use a linked list for this -- for example, the
306 * memory card driver uses an array of struct pcmcia_device pointers, where minor
307 * device numbers are used to derive the corresponding array index.
308 */
309
310/****************
311 * A driver needs to provide a dev_node_t structure for each device
312 * on a card. In some cases, there is only one device per card (for
313 * example, ethernet cards, modems). In other cases, there may be
314 * many actual or logical devices (SCSI adapters, memory cards with
315 * multiple partitions). The dev_node_t structures need to be kept
316 * in a linked list starting at the 'dev' field of a struct pcmcia_device
317 * structure. We allocate them in the card's private data structure,
318 * because they generally can't be allocated dynamically.
319 */
320
321typedef struct local_info_t { 300typedef struct local_info_t {
322 struct net_device *dev; 301 struct net_device *dev;
323 struct pcmcia_device *p_dev; 302 struct pcmcia_device *p_dev;
324 dev_node_t node;
325 303
326 int card_type; 304 int card_type;
327 int probe_port; 305 int probe_port;
@@ -555,7 +533,6 @@ xirc2ps_probe(struct pcmcia_device *link)
555 link->conf.Attributes = CONF_ENABLE_IRQ; 533 link->conf.Attributes = CONF_ENABLE_IRQ;
556 link->conf.IntType = INT_MEMORY_AND_IO; 534 link->conf.IntType = INT_MEMORY_AND_IO;
557 link->conf.ConfigIndex = 1; 535 link->conf.ConfigIndex = 1;
558 link->irq.Handler = xirc2ps_interrupt;
559 536
560 /* Fill in card specific entries */ 537 /* Fill in card specific entries */
561 dev->netdev_ops = &netdev_ops; 538 dev->netdev_ops = &netdev_ops;
@@ -580,8 +557,7 @@ xirc2ps_detach(struct pcmcia_device *link)
580 557
581 dev_dbg(&link->dev, "detach\n"); 558 dev_dbg(&link->dev, "detach\n");
582 559
583 if (link->dev_node) 560 unregister_netdev(dev);
584 unregister_netdev(dev);
585 561
586 xirc2ps_release(link); 562 xirc2ps_release(link);
587 563
@@ -841,7 +817,6 @@ xirc2ps_config(struct pcmcia_device * link)
841 link->conf.Attributes |= CONF_ENABLE_SPKR; 817 link->conf.Attributes |= CONF_ENABLE_SPKR;
842 link->conf.Status |= CCSR_AUDIO_ENA; 818 link->conf.Status |= CCSR_AUDIO_ENA;
843 } 819 }
844 link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
845 link->io.NumPorts2 = 8; 820 link->io.NumPorts2 = 8;
846 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 821 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
847 if (local->dingo) { 822 if (local->dingo) {
@@ -866,7 +841,6 @@ xirc2ps_config(struct pcmcia_device * link)
866 } 841 }
867 printk(KNOT_XIRC "no ports available\n"); 842 printk(KNOT_XIRC "no ports available\n");
868 } else { 843 } else {
869 link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
870 link->io.NumPorts1 = 16; 844 link->io.NumPorts1 = 16;
871 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { 845 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {
872 link->io.BasePort1 = ioaddr; 846 link->io.BasePort1 = ioaddr;
@@ -885,7 +859,7 @@ xirc2ps_config(struct pcmcia_device * link)
885 * Now allocate an interrupt line. Note that this does not 859 * Now allocate an interrupt line. Note that this does not
886 * actually assign a handler to the interrupt. 860 * actually assign a handler to the interrupt.
887 */ 861 */
888 if ((err=pcmcia_request_irq(link, &link->irq))) 862 if ((err=pcmcia_request_irq(link, xirc2ps_interrupt)))
889 goto config_error; 863 goto config_error;
890 864
891 /**************** 865 /****************
@@ -982,23 +956,19 @@ xirc2ps_config(struct pcmcia_device * link)
982 printk(KNOT_XIRC "invalid if_port requested\n"); 956 printk(KNOT_XIRC "invalid if_port requested\n");
983 957
984 /* we can now register the device with the net subsystem */ 958 /* we can now register the device with the net subsystem */
985 dev->irq = link->irq.AssignedIRQ; 959 dev->irq = link->irq;
986 dev->base_addr = link->io.BasePort1; 960 dev->base_addr = link->io.BasePort1;
987 961
988 if (local->dingo) 962 if (local->dingo)
989 do_reset(dev, 1); /* a kludge to make the cem56 work */ 963 do_reset(dev, 1); /* a kludge to make the cem56 work */
990 964
991 link->dev_node = &local->node;
992 SET_NETDEV_DEV(dev, &link->dev); 965 SET_NETDEV_DEV(dev, &link->dev);
993 966
994 if ((err=register_netdev(dev))) { 967 if ((err=register_netdev(dev))) {
995 printk(KNOT_XIRC "register_netdev() failed\n"); 968 printk(KNOT_XIRC "register_netdev() failed\n");
996 link->dev_node = NULL;
997 goto config_error; 969 goto config_error;
998 } 970 }
999 971
1000 strcpy(local->node.dev_name, dev->name);
1001
1002 /* give some infos about the hardware */ 972 /* give some infos about the hardware */
1003 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", 973 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n",
1004 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, 974 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq,
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index f6036fb4231..33bdc6a84e8 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -75,42 +75,7 @@ static void airo_release(struct pcmcia_device *link);
75 75
76static void airo_detach(struct pcmcia_device *p_dev); 76static void airo_detach(struct pcmcia_device *p_dev);
77 77
78/*
79 You'll also need to prototype all the functions that will actually
80 be used to talk to your device. See 'pcmem_cs' for a good example
81 of a fully self-sufficient driver; the other drivers rely more or
82 less on other parts of the kernel.
83*/
84
85/*
86 A linked list of "instances" of the aironet device. Each actual
87 PCMCIA card corresponds to one device instance, and is described
88 by one struct pcmcia_device structure (defined in ds.h).
89
90 You may not want to use a linked list for this -- for example, the
91 memory card driver uses an array of struct pcmcia_device pointers,
92 where minor device numbers are used to derive the corresponding
93 array index.
94*/
95
96/*
97 A driver needs to provide a dev_node_t structure for each device
98 on a card. In some cases, there is only one device per card (for
99 example, ethernet cards, modems). In other cases, there may be
100 many actual or logical devices (SCSI adapters, memory cards with
101 multiple partitions). The dev_node_t structures need to be kept
102 in a linked list starting at the 'dev' field of a struct pcmcia_device
103 structure. We allocate them in the card's private data structure,
104 because they generally shouldn't be allocated dynamically.
105
106 In this case, we also provide a flag to indicate if a device is
107 "stopped" due to a power management event, or card ejection. The
108 device IO routines can use a flag like this to throttle IO to a
109 card that is not ready to accept it.
110*/
111
112typedef struct local_info_t { 78typedef struct local_info_t {
113 dev_node_t node;
114 struct net_device *eth_dev; 79 struct net_device *eth_dev;
115} local_info_t; 80} local_info_t;
116 81
@@ -132,10 +97,6 @@ static int airo_probe(struct pcmcia_device *p_dev)
132 97
133 dev_dbg(&p_dev->dev, "airo_attach()\n"); 98 dev_dbg(&p_dev->dev, "airo_attach()\n");
134 99
135 /* Interrupt setup */
136 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
137 p_dev->irq.Handler = NULL;
138
139 /* 100 /*
140 General socket configuration defaults can go here. In this 101 General socket configuration defaults can go here. In this
141 client, we assume very little, and rely on the CIS for almost 102 client, we assume very little, and rely on the CIS for almost
@@ -212,9 +173,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
212 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 173 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
213 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 174 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
214 175
215 /* Do we need to allocate an interrupt? */ 176 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
216 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
217 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
218 177
219 /* IO window settings */ 178 /* IO window settings */
220 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 179 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -300,16 +259,8 @@ static int airo_config(struct pcmcia_device *link)
300 if (ret) 259 if (ret)
301 goto failed; 260 goto failed;
302 261
303 /* 262 if (!link->irq)
304 Allocate an interrupt line. Note that this does not assign a 263 goto failed;
305 handler to the interrupt, unless the 'Handler' member of the
306 irq structure is initialized.
307 */
308 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
309 ret = pcmcia_request_irq(link, &link->irq);
310 if (ret)
311 goto failed;
312 }
313 264
314 /* 265 /*
315 This actually configures the PCMCIA socket -- setting up 266 This actually configures the PCMCIA socket -- setting up
@@ -320,26 +271,17 @@ static int airo_config(struct pcmcia_device *link)
320 if (ret) 271 if (ret)
321 goto failed; 272 goto failed;
322 ((local_info_t *)link->priv)->eth_dev = 273 ((local_info_t *)link->priv)->eth_dev =
323 init_airo_card(link->irq.AssignedIRQ, 274 init_airo_card(link->irq,
324 link->io.BasePort1, 1, &link->dev); 275 link->io.BasePort1, 1, &link->dev);
325 if (!((local_info_t *)link->priv)->eth_dev) 276 if (!((local_info_t *)link->priv)->eth_dev)
326 goto failed; 277 goto failed;
327 278
328 /*
329 At this point, the dev_node_t structure(s) need to be
330 initialized and arranged in a linked list at link->dev_node.
331 */
332 strcpy(dev->node.dev_name, ((local_info_t *)link->priv)->eth_dev->name);
333 dev->node.major = dev->node.minor = 0;
334 link->dev_node = &dev->node;
335
336 /* Finally, report what we've done */ 279 /* Finally, report what we've done */
337 printk(KERN_INFO "%s: index 0x%02x: ", 280 dev_info(&link->dev, "index 0x%02x: ",
338 dev->node.dev_name, link->conf.ConfigIndex); 281 link->conf.ConfigIndex);
339 if (link->conf.Vpp) 282 if (link->conf.Vpp)
340 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); 283 printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
341 if (link->conf.Attributes & CONF_ENABLE_IRQ) 284 printk(", irq %d", link->irq);
342 printk(", irq %d", link->irq.AssignedIRQ);
343 if (link->io.NumPorts1) 285 if (link->io.NumPorts1)
344 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 286 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
345 link->io.BasePort1+link->io.NumPorts1-1); 287 link->io.BasePort1+link->io.NumPorts1-1);
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 32407911842..c2746fc7f2b 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -85,41 +85,7 @@ static void atmel_release(struct pcmcia_device *link);
85 85
86static void atmel_detach(struct pcmcia_device *p_dev); 86static void atmel_detach(struct pcmcia_device *p_dev);
87 87
88/*
89 You'll also need to prototype all the functions that will actually
90 be used to talk to your device. See 'pcmem_cs' for a good example
91 of a fully self-sufficient driver; the other drivers rely more or
92 less on other parts of the kernel.
93*/
94
95/*
96 A linked list of "instances" of the atmelnet device. Each actual
97 PCMCIA card corresponds to one device instance, and is described
98 by one struct pcmcia_device structure (defined in ds.h).
99
100 You may not want to use a linked list for this -- for example, the
101 memory card driver uses an array of struct pcmcia_device pointers, where minor
102 device numbers are used to derive the corresponding array index.
103*/
104
105/*
106 A driver needs to provide a dev_node_t structure for each device
107 on a card. In some cases, there is only one device per card (for
108 example, ethernet cards, modems). In other cases, there may be
109 many actual or logical devices (SCSI adapters, memory cards with
110 multiple partitions). The dev_node_t structures need to be kept
111 in a linked list starting at the 'dev' field of a struct pcmcia_device
112 structure. We allocate them in the card's private data structure,
113 because they generally shouldn't be allocated dynamically.
114
115 In this case, we also provide a flag to indicate if a device is
116 "stopped" due to a power management event, or card ejection. The
117 device IO routines can use a flag like this to throttle IO to a
118 card that is not ready to accept it.
119*/
120
121typedef struct local_info_t { 88typedef struct local_info_t {
122 dev_node_t node;
123 struct net_device *eth_dev; 89 struct net_device *eth_dev;
124} local_info_t; 90} local_info_t;
125 91
@@ -141,10 +107,6 @@ static int atmel_probe(struct pcmcia_device *p_dev)
141 107
142 dev_dbg(&p_dev->dev, "atmel_attach()\n"); 108 dev_dbg(&p_dev->dev, "atmel_attach()\n");
143 109
144 /* Interrupt setup */
145 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
146 p_dev->irq.Handler = NULL;
147
148 /* 110 /*
149 General socket configuration defaults can go here. In this 111 General socket configuration defaults can go here. In this
150 client, we assume very little, and rely on the CIS for almost 112 client, we assume very little, and rely on the CIS for almost
@@ -226,9 +188,7 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
226 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 188 else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM))
227 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 189 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000;
228 190
229 /* Do we need to allocate an interrupt? */ 191 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
230 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
231 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
232 192
233 /* IO window settings */ 193 /* IO window settings */
234 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 194 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
@@ -278,15 +238,9 @@ static int atmel_config(struct pcmcia_device *link)
278 if (pcmcia_loop_config(link, atmel_config_check, NULL)) 238 if (pcmcia_loop_config(link, atmel_config_check, NULL))
279 goto failed; 239 goto failed;
280 240
281 /* 241 if (!link->irq) {
282 Allocate an interrupt line. Note that this does not assign a 242 dev_err(&link->dev, "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
283 handler to the interrupt, unless the 'Handler' member of the 243 goto failed;
284 irq structure is initialized.
285 */
286 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
287 ret = pcmcia_request_irq(link, &link->irq);
288 if (ret)
289 goto failed;
290 } 244 }
291 245
292 /* 246 /*
@@ -298,14 +252,8 @@ static int atmel_config(struct pcmcia_device *link)
298 if (ret) 252 if (ret)
299 goto failed; 253 goto failed;
300 254
301 if (link->irq.AssignedIRQ == 0) {
302 printk(KERN_ALERT
303 "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
304 goto failed;
305 }
306
307 ((local_info_t*)link->priv)->eth_dev = 255 ((local_info_t*)link->priv)->eth_dev =
308 init_atmel_card(link->irq.AssignedIRQ, 256 init_atmel_card(link->irq,
309 link->io.BasePort1, 257 link->io.BasePort1,
310 did ? did->driver_info : ATMEL_FW_TYPE_NONE, 258 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
311 &link->dev, 259 &link->dev,
@@ -315,14 +263,6 @@ static int atmel_config(struct pcmcia_device *link)
315 goto failed; 263 goto failed;
316 264
317 265
318 /*
319 At this point, the dev_node_t structure(s) need to be
320 initialized and arranged in a linked list at link->dev_node.
321 */
322 strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name );
323 dev->node.major = dev->node.minor = 0;
324 link->dev_node = &dev->node;
325
326 return 0; 266 return 0;
327 267
328 failed: 268 failed:
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 609e7051e01..0e99b634267 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -98,10 +98,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
98 if (res != 0) 98 if (res != 0)
99 goto err_disable; 99 goto err_disable;
100 100
101 dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 101 if (!dev->irq)
102 dev->irq.Handler = NULL; /* The handler is registered later. */
103 res = pcmcia_request_irq(dev, &dev->irq);
104 if (res != 0)
105 goto err_disable; 102 goto err_disable;
106 103
107 res = pcmcia_request_configuration(dev, &dev->conf); 104 res = pcmcia_request_configuration(dev, &dev->conf);
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index a36501dbbe0..db72461c486 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -39,7 +39,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry");
39 39
40/* struct local_info::hw_priv */ 40/* struct local_info::hw_priv */
41struct hostap_cs_priv { 41struct hostap_cs_priv {
42 dev_node_t node;
43 struct pcmcia_device *link; 42 struct pcmcia_device *link;
44 int sandisk_connectplus; 43 int sandisk_connectplus;
45}; 44};
@@ -556,15 +555,7 @@ static int prism2_config_check(struct pcmcia_device *p_dev,
556 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 555 p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
557 556
558 /* Do we need to allocate an interrupt? */ 557 /* Do we need to allocate an interrupt? */
559 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) 558 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
560 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
561 else if (!(p_dev->conf.Attributes & CONF_ENABLE_IRQ)) {
562 /* At least Compaq WL200 does not have IRQInfo1 set,
563 * but it does not work without interrupts.. */
564 printk(KERN_WARNING "Config has no IRQ info, but trying to "
565 "enable IRQ anyway..\n");
566 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
567 }
568 559
569 /* IO window settings */ 560 /* IO window settings */
570 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " 561 PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d "
@@ -633,21 +624,10 @@ static int prism2_config(struct pcmcia_device *link)
633 local = iface->local; 624 local = iface->local;
634 local->hw_priv = hw_priv; 625 local->hw_priv = hw_priv;
635 hw_priv->link = link; 626 hw_priv->link = link;
636 strcpy(hw_priv->node.dev_name, dev->name);
637 link->dev_node = &hw_priv->node;
638 627
639 /* 628 ret = pcmcia_request_irq(link, prism2_interrupt);
640 * Allocate an interrupt line. Note that this does not assign a 629 if (ret)
641 * handler to the interrupt, unless the 'Handler' member of the 630 goto failed;
642 * irq structure is initialized.
643 */
644 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
645 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
646 link->irq.Handler = prism2_interrupt;
647 ret = pcmcia_request_irq(link, &link->irq);
648 if (ret)
649 goto failed;
650 }
651 631
652 /* 632 /*
653 * This actually configures the PCMCIA socket -- setting up 633 * This actually configures the PCMCIA socket -- setting up
@@ -658,7 +638,7 @@ static int prism2_config(struct pcmcia_device *link)
658 if (ret) 638 if (ret)
659 goto failed; 639 goto failed;
660 640
661 dev->irq = link->irq.AssignedIRQ; 641 dev->irq = link->irq;
662 dev->base_addr = link->io.BasePort1; 642 dev->base_addr = link->io.BasePort1;
663 643
664 /* Finally, report what we've done */ 644 /* Finally, report what we've done */
@@ -668,7 +648,7 @@ static int prism2_config(struct pcmcia_device *link)
668 printk(", Vpp %d.%d", link->conf.Vpp / 10, 648 printk(", Vpp %d.%d", link->conf.Vpp / 10,
669 link->conf.Vpp % 10); 649 link->conf.Vpp % 10);
670 if (link->conf.Attributes & CONF_ENABLE_IRQ) 650 if (link->conf.Attributes & CONF_ENABLE_IRQ)
671 printk(", irq %d", link->irq.AssignedIRQ); 651 printk(", irq %d", link->irq);
672 if (link->io.NumPorts1) 652 if (link->io.NumPorts1)
673 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 653 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
674 link->io.BasePort1+link->io.NumPorts1-1); 654 link->io.BasePort1+link->io.NumPorts1-1);
@@ -682,11 +662,9 @@ static int prism2_config(struct pcmcia_device *link)
682 sandisk_enable_wireless(dev); 662 sandisk_enable_wireless(dev);
683 663
684 ret = prism2_hw_config(dev, 1); 664 ret = prism2_hw_config(dev, 1);
685 if (!ret) { 665 if (!ret)
686 ret = hostap_hw_ready(dev); 666 ret = hostap_hw_ready(dev);
687 if (ret == 0 && local->ddev) 667
688 strcpy(hw_priv->node.dev_name, local->ddev->name);
689 }
690 return ret; 668 return ret;
691 669
692 failed: 670 failed:
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 6d55439a7b9..08e4e390800 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -777,7 +777,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
777 777
778 lbs_deb_enter(LBS_DEB_CS); 778 lbs_deb_enter(LBS_DEB_CS);
779 779
780 free_irq(p_dev->irq.AssignedIRQ, card); 780 free_irq(p_dev->irq, card);
781 pcmcia_disable_device(p_dev); 781 pcmcia_disable_device(p_dev);
782 if (card->iobase) 782 if (card->iobase)
783 ioport_unmap(card->iobase); 783 ioport_unmap(card->iobase);
@@ -807,8 +807,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
807 p_dev->io.NumPorts1 = cfg->io.win[0].len; 807 p_dev->io.NumPorts1 = cfg->io.win[0].len;
808 808
809 /* Do we need to allocate an interrupt? */ 809 /* Do we need to allocate an interrupt? */
810 if (cfg->irq.IRQInfo1) 810 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
811 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
812 811
813 /* IO window settings */ 812 /* IO window settings */
814 if (cfg->io.nwin != 1) { 813 if (cfg->io.nwin != 1) {
@@ -837,9 +836,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
837 card->p_dev = p_dev; 836 card->p_dev = p_dev;
838 p_dev->priv = card; 837 p_dev->priv = card;
839 838
840 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
841 p_dev->irq.Handler = NULL;
842
843 p_dev->conf.Attributes = 0; 839 p_dev->conf.Attributes = 0;
844 p_dev->conf.IntType = INT_MEMORY_AND_IO; 840 p_dev->conf.IntType = INT_MEMORY_AND_IO;
845 841
@@ -854,13 +850,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
854 * a handler to the interrupt, unless the 'Handler' member of 850 * a handler to the interrupt, unless the 'Handler' member of
855 * the irq structure is initialized. 851 * the irq structure is initialized.
856 */ 852 */
857 if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) { 853 if (!p_dev->irq)
858 ret = pcmcia_request_irq(p_dev, &p_dev->irq); 854 goto out1;
859 if (ret) {
860 lbs_pr_err("error in pcmcia_request_irq\n");
861 goto out1;
862 }
863 }
864 855
865 /* Initialize io access */ 856 /* Initialize io access */
866 card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); 857 card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1);
@@ -883,7 +874,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
883 874
884 /* Finally, report what we've done */ 875 /* Finally, report what we've done */
885 lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", 876 lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n",
886 p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, 877 p_dev->irq, p_dev->io.BasePort1,
887 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); 878 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
888 879
889 /* 880 /*
@@ -940,7 +931,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
940 priv->fw_ready = 1; 931 priv->fw_ready = 1;
941 932
942 /* Now actually get the IRQ */ 933 /* Now actually get the IRQ */
943 ret = request_irq(p_dev->irq.AssignedIRQ, if_cs_interrupt, 934 ret = request_irq(p_dev->irq, if_cs_interrupt,
944 IRQF_SHARED, DRV_NAME, card); 935 IRQF_SHARED, DRV_NAME, card);
945 if (ret) { 936 if (ret) {
946 lbs_pr_err("error in request_irq\n"); 937 lbs_pr_err("error in request_irq\n");
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 1d4ada188ed..03056ab7303 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -50,7 +50,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
50 * struct orinoco_private */ 50 * struct orinoco_private */
51struct orinoco_pccard { 51struct orinoco_pccard {
52 struct pcmcia_device *p_dev; 52 struct pcmcia_device *p_dev;
53 dev_node_t node;
54 53
55 /* Used to handle hard reset */ 54 /* Used to handle hard reset */
56 /* yuck, we need this hack to work around the insanity of the 55 /* yuck, we need this hack to work around the insanity of the
@@ -119,10 +118,6 @@ orinoco_cs_probe(struct pcmcia_device *link)
119 card->p_dev = link; 118 card->p_dev = link;
120 link->priv = priv; 119 link->priv = priv;
121 120
122 /* Interrupt setup */
123 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
124 link->irq.Handler = orinoco_interrupt;
125
126 /* General socket configuration defaults can go here. In this 121 /* General socket configuration defaults can go here. In this
127 * client, we assume very little, and rely on the CIS for 122 * client, we assume very little, and rely on the CIS for
128 * almost everything. In most clients, many details (i.e., 123 * almost everything. In most clients, many details (i.e.,
@@ -144,8 +139,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
144{ 139{
145 struct orinoco_private *priv = link->priv; 140 struct orinoco_private *priv = link->priv;
146 141
147 if (link->dev_node) 142 orinoco_if_del(priv);
148 orinoco_if_del(priv);
149 143
150 orinoco_cs_release(link); 144 orinoco_cs_release(link);
151 145
@@ -230,7 +224,6 @@ static int
230orinoco_cs_config(struct pcmcia_device *link) 224orinoco_cs_config(struct pcmcia_device *link)
231{ 225{
232 struct orinoco_private *priv = link->priv; 226 struct orinoco_private *priv = link->priv;
233 struct orinoco_pccard *card = priv->card;
234 hermes_t *hw = &priv->hw; 227 hermes_t *hw = &priv->hw;
235 int ret; 228 int ret;
236 void __iomem *mem; 229 void __iomem *mem;
@@ -258,12 +251,7 @@ orinoco_cs_config(struct pcmcia_device *link)
258 goto failed; 251 goto failed;
259 } 252 }
260 253
261 /* 254 ret = pcmcia_request_irq(link, orinoco_interrupt);
262 * Allocate an interrupt line. Note that this does not assign
263 * a handler to the interrupt, unless the 'Handler' member of
264 * the irq structure is initialized.
265 */
266 ret = pcmcia_request_irq(link, &link->irq);
267 if (ret) 255 if (ret)
268 goto failed; 256 goto failed;
269 257
@@ -285,9 +273,6 @@ orinoco_cs_config(struct pcmcia_device *link)
285 if (ret) 273 if (ret)
286 goto failed; 274 goto failed;
287 275
288 /* Ok, we have the configuration, prepare to register the netdev */
289 card->node.major = card->node.minor = 0;
290
291 /* Initialise the main driver */ 276 /* Initialise the main driver */
292 if (orinoco_init(priv) != 0) { 277 if (orinoco_init(priv) != 0) {
293 printk(KERN_ERR PFX "orinoco_init() failed\n"); 278 printk(KERN_ERR PFX "orinoco_init() failed\n");
@@ -296,17 +281,11 @@ orinoco_cs_config(struct pcmcia_device *link)
296 281
297 /* Register an interface with the stack */ 282 /* Register an interface with the stack */
298 if (orinoco_if_add(priv, link->io.BasePort1, 283 if (orinoco_if_add(priv, link->io.BasePort1,
299 link->irq.AssignedIRQ) != 0) { 284 link->irq) != 0) {
300 printk(KERN_ERR PFX "orinoco_if_add() failed\n"); 285 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
301 goto failed; 286 goto failed;
302 } 287 }
303 288
304 /* At this point, the dev_node_t structure(s) needs to be
305 * initialized and arranged in a linked list at link->dev_node. */
306 strcpy(card->node.dev_name, priv->ndev->name);
307 link->dev_node = &card->node; /* link->dev_node being non-NULL is also
308 * used to indicate that the
309 * net_device has been registered */
310 return 0; 289 return 0;
311 290
312 failed: 291 failed:
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 59bda240fdc..41b9ce42585 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -57,7 +57,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket
57 * struct orinoco_private */ 57 * struct orinoco_private */
58struct orinoco_pccard { 58struct orinoco_pccard {
59 struct pcmcia_device *p_dev; 59 struct pcmcia_device *p_dev;
60 dev_node_t node;
61}; 60};
62 61
63/********************************************************************/ 62/********************************************************************/
@@ -193,10 +192,6 @@ spectrum_cs_probe(struct pcmcia_device *link)
193 card->p_dev = link; 192 card->p_dev = link;
194 link->priv = priv; 193 link->priv = priv;
195 194
196 /* Interrupt setup */
197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
198 link->irq.Handler = orinoco_interrupt;
199
200 /* General socket configuration defaults can go here. In this 195 /* General socket configuration defaults can go here. In this
201 * client, we assume very little, and rely on the CIS for 196 * client, we assume very little, and rely on the CIS for
202 * almost everything. In most clients, many details (i.e., 197 * almost everything. In most clients, many details (i.e.,
@@ -218,8 +213,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
218{ 213{
219 struct orinoco_private *priv = link->priv; 214 struct orinoco_private *priv = link->priv;
220 215
221 if (link->dev_node) 216 orinoco_if_del(priv);
222 orinoco_if_del(priv);
223 217
224 spectrum_cs_release(link); 218 spectrum_cs_release(link);
225 219
@@ -304,7 +298,6 @@ static int
304spectrum_cs_config(struct pcmcia_device *link) 298spectrum_cs_config(struct pcmcia_device *link)
305{ 299{
306 struct orinoco_private *priv = link->priv; 300 struct orinoco_private *priv = link->priv;
307 struct orinoco_pccard *card = priv->card;
308 hermes_t *hw = &priv->hw; 301 hermes_t *hw = &priv->hw;
309 int ret; 302 int ret;
310 void __iomem *mem; 303 void __iomem *mem;
@@ -332,12 +325,7 @@ spectrum_cs_config(struct pcmcia_device *link)
332 goto failed; 325 goto failed;
333 } 326 }
334 327
335 /* 328 ret = pcmcia_request_irq(link, orinoco_interrupt);
336 * Allocate an interrupt line. Note that this does not assign
337 * a handler to the interrupt, unless the 'Handler' member of
338 * the irq structure is initialized.
339 */
340 ret = pcmcia_request_irq(link, &link->irq);
341 if (ret) 329 if (ret)
342 goto failed; 330 goto failed;
343 331
@@ -359,9 +347,6 @@ spectrum_cs_config(struct pcmcia_device *link)
359 if (ret) 347 if (ret)
360 goto failed; 348 goto failed;
361 349
362 /* Ok, we have the configuration, prepare to register the netdev */
363 card->node.major = card->node.minor = 0;
364
365 /* Reset card */ 350 /* Reset card */
366 if (spectrum_cs_hard_reset(priv) != 0) 351 if (spectrum_cs_hard_reset(priv) != 0)
367 goto failed; 352 goto failed;
@@ -374,17 +359,11 @@ spectrum_cs_config(struct pcmcia_device *link)
374 359
375 /* Register an interface with the stack */ 360 /* Register an interface with the stack */
376 if (orinoco_if_add(priv, link->io.BasePort1, 361 if (orinoco_if_add(priv, link->io.BasePort1,
377 link->irq.AssignedIRQ) != 0) { 362 link->irq) != 0) {
378 printk(KERN_ERR PFX "orinoco_if_add() failed\n"); 363 printk(KERN_ERR PFX "orinoco_if_add() failed\n");
379 goto failed; 364 goto failed;
380 } 365 }
381 366
382 /* At this point, the dev_node_t structure(s) needs to be
383 * initialized and arranged in a linked list at link->dev_node. */
384 strcpy(card->node.dev_name, priv->ndev->name);
385 link->dev_node = &card->node; /* link->dev_node being non-NULL is also
386 * used to indicate that the
387 * net_device has been registered */
388 return 0; 367 return 0;
389 368
390 failed: 369 failed:
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 11865ea2187..f7d2a34ca53 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -51,7 +51,6 @@
51#include <pcmcia/cistpl.h> 51#include <pcmcia/cistpl.h>
52#include <pcmcia/cisreg.h> 52#include <pcmcia/cisreg.h>
53#include <pcmcia/ds.h> 53#include <pcmcia/ds.h>
54#include <pcmcia/mem_op.h>
55 54
56#include <linux/wireless.h> 55#include <linux/wireless.h>
57#include <net/iw_handler.h> 56#include <net/iw_handler.h>
@@ -321,10 +320,6 @@ static int ray_probe(struct pcmcia_device *p_dev)
321 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 320 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
322 p_dev->io.IOAddrLines = 5; 321 p_dev->io.IOAddrLines = 5;
323 322
324 /* Interrupt setup. For PCMCIA, driver takes what's given */
325 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
326 p_dev->irq.Handler = &ray_interrupt;
327
328 /* General socket configuration */ 323 /* General socket configuration */
329 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 324 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
330 p_dev->conf.IntType = INT_MEMORY_AND_IO; 325 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -383,8 +378,7 @@ static void ray_detach(struct pcmcia_device *link)
383 del_timer(&local->timer); 378 del_timer(&local->timer);
384 379
385 if (link->priv) { 380 if (link->priv) {
386 if (link->dev_node) 381 unregister_netdev(dev);
387 unregister_netdev(dev);
388 free_netdev(dev); 382 free_netdev(dev);
389 } 383 }
390 dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); 384 dev_dbg(&link->dev, "ray_cs ray_detach ending\n");
@@ -417,10 +411,10 @@ static int ray_config(struct pcmcia_device *link)
417 /* Now allocate an interrupt line. Note that this does not 411 /* Now allocate an interrupt line. Note that this does not
418 actually assign a handler to the interrupt. 412 actually assign a handler to the interrupt.
419 */ 413 */
420 ret = pcmcia_request_irq(link, &link->irq); 414 ret = pcmcia_request_irq(link, ray_interrupt);
421 if (ret) 415 if (ret)
422 goto failed; 416 goto failed;
423 dev->irq = link->irq.AssignedIRQ; 417 dev->irq = link->irq;
424 418
425 /* This actually configures the PCMCIA socket -- setting up 419 /* This actually configures the PCMCIA socket -- setting up
426 the I/O windows and the interrupt mapping. 420 the I/O windows and the interrupt mapping.
@@ -493,9 +487,6 @@ static int ray_config(struct pcmcia_device *link)
493 return i; 487 return i;
494 } 488 }
495 489
496 strcpy(local->node.dev_name, dev->name);
497 link->dev_node = &local->node;
498
499 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n", 490 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n",
500 dev->name, dev->irq, dev->dev_addr); 491 dev->name, dev->irq, dev->dev_addr);
501 492
diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h
index 1e23b7f4cca..9f01ddb1974 100644
--- a/drivers/net/wireless/ray_cs.h
+++ b/drivers/net/wireless/ray_cs.h
@@ -25,7 +25,6 @@ struct beacon_rx {
25typedef struct ray_dev_t { 25typedef struct ray_dev_t {
26 int card_status; 26 int card_status;
27 int authentication_state; 27 int authentication_state;
28 dev_node_t node;
29 window_handle_t amem_handle; /* handle to window for attribute memory */ 28 window_handle_t amem_handle; /* handle to window for attribute memory */
30 window_handle_t rmem_handle; /* handle to window for rx buffer on card */ 29 window_handle_t rmem_handle; /* handle to window for rx buffer on card */
31 void __iomem *sram; /* pointer to beginning of shared RAM */ 30 void __iomem *sram; /* pointer to beginning of shared RAM */
diff --git a/drivers/net/wireless/wl3501.h b/drivers/net/wireless/wl3501.h
index 8bce1a550a2..8816e371fd0 100644
--- a/drivers/net/wireless/wl3501.h
+++ b/drivers/net/wireless/wl3501.h
@@ -610,7 +610,6 @@ struct wl3501_card {
610 struct iw_statistics wstats; 610 struct iw_statistics wstats;
611 struct iw_spy_data spy_data; 611 struct iw_spy_data spy_data;
612 struct iw_public_data wireless_data; 612 struct iw_public_data wireless_data;
613 struct dev_node_t node;
614 struct pcmcia_device *p_dev; 613 struct pcmcia_device *p_dev;
615}; 614};
616#endif 615#endif
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 7b9621de239..5e5d24c1ce2 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1451,6 +1451,8 @@ static void wl3501_detach(struct pcmcia_device *link)
1451 netif_device_detach(dev); 1451 netif_device_detach(dev);
1452 wl3501_release(link); 1452 wl3501_release(link);
1453 1453
1454 unregister_netdev(dev);
1455
1454 if (link->priv) 1456 if (link->priv)
1455 free_netdev(link->priv); 1457 free_netdev(link->priv);
1456 1458
@@ -1897,10 +1899,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1897 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 1899 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1898 p_dev->io.IOAddrLines = 5; 1900 p_dev->io.IOAddrLines = 5;
1899 1901
1900 /* Interrupt setup */
1901 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
1902 p_dev->irq.Handler = wl3501_interrupt;
1903
1904 /* General socket configuration */ 1902 /* General socket configuration */
1905 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1903 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
1906 p_dev->conf.IntType = INT_MEMORY_AND_IO; 1904 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -1961,7 +1959,7 @@ static int wl3501_config(struct pcmcia_device *link)
1961 /* Now allocate an interrupt line. Note that this does not actually 1959 /* Now allocate an interrupt line. Note that this does not actually
1962 * assign a handler to the interrupt. */ 1960 * assign a handler to the interrupt. */
1963 1961
1964 ret = pcmcia_request_irq(link, &link->irq); 1962 ret = pcmcia_request_irq(link, wl3501_interrupt);
1965 if (ret) 1963 if (ret)
1966 goto failed; 1964 goto failed;
1967 1965
@@ -1972,7 +1970,7 @@ static int wl3501_config(struct pcmcia_device *link)
1972 if (ret) 1970 if (ret)
1973 goto failed; 1971 goto failed;
1974 1972
1975 dev->irq = link->irq.AssignedIRQ; 1973 dev->irq = link->irq;
1976 dev->base_addr = link->io.BasePort1; 1974 dev->base_addr = link->io.BasePort1;
1977 SET_NETDEV_DEV(dev, &link->dev); 1975 SET_NETDEV_DEV(dev, &link->dev);
1978 if (register_netdev(dev)) { 1976 if (register_netdev(dev)) {
@@ -1981,20 +1979,15 @@ static int wl3501_config(struct pcmcia_device *link)
1981 } 1979 }
1982 1980
1983 this = netdev_priv(dev); 1981 this = netdev_priv(dev);
1984 /*
1985 * At this point, the dev_node_t structure(s) should be initialized and
1986 * arranged in a linked list at link->dev_node.
1987 */
1988 link->dev_node = &this->node;
1989 1982
1990 this->base_addr = dev->base_addr; 1983 this->base_addr = dev->base_addr;
1991 1984
1992 if (!wl3501_get_flash_mac_addr(this)) { 1985 if (!wl3501_get_flash_mac_addr(this)) {
1993 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", 1986 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n",
1994 dev->name); 1987 dev->name);
1988 unregister_netdev(dev);
1995 goto failed; 1989 goto failed;
1996 } 1990 }
1997 strcpy(this->node.dev_name, dev->name);
1998 1991
1999 for (i = 0; i < 6; i++) 1992 for (i = 0; i < 6; i++)
2000 dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; 1993 dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
@@ -2038,12 +2031,6 @@ failed:
2038 */ 2031 */
2039static void wl3501_release(struct pcmcia_device *link) 2032static void wl3501_release(struct pcmcia_device *link)
2040{ 2033{
2041 struct net_device *dev = link->priv;
2042
2043 /* Unlink the device chain */
2044 if (link->dev_node)
2045 unregister_netdev(dev);
2046
2047 pcmcia_disable_device(link); 2034 pcmcia_disable_device(link);
2048} 2035}
2049 2036