aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/netwave_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/netwave_cs.c')
-rw-r--r--drivers/net/wireless/netwave_cs.c56
1 files changed, 12 insertions, 44 deletions
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 1770677d9e10..af9a32d8d22d 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -228,17 +228,6 @@ static struct iw_statistics* netwave_get_wireless_stats(struct net_device *dev);
228static void set_multicast_list(struct net_device *dev); 228static void set_multicast_list(struct net_device *dev);
229 229
230/* 230/*
231 A linked list of "instances" of the skeleton device. Each actual
232 PCMCIA card corresponds to one device instance, and is described
233 by one dev_link_t structure (defined in ds.h).
234
235 You may not want to use a linked list for this -- for example, the
236 memory card driver uses an array of dev_link_t pointers, where minor
237 device numbers are used to derive the corresponding array index.
238*/
239static dev_link_t *dev_list;
240
241/*
242 A dev_link_t structure has fields for most things that are needed 231 A dev_link_t structure has fields for most things that are needed
243 to keep track of a socket, but there will usually be some device 232 to keep track of a socket, but there will usually be some device
244 specific information that also needs to be kept track of. The 233 specific information that also needs to be kept track of. The
@@ -451,8 +440,7 @@ static dev_link_t *netwave_attach(void)
451 link->irq.Instance = dev; 440 link->irq.Instance = dev;
452 441
453 /* Register with Card Services */ 442 /* Register with Card Services */
454 link->next = dev_list; 443 link->next = NULL;
455 dev_list = link;
456 client_reg.dev_info = &dev_info; 444 client_reg.dev_info = &dev_info;
457 client_reg.Version = 0x0210; 445 client_reg.Version = 0x0210;
458 client_reg.event_callback_args.client_data = link; 446 client_reg.event_callback_args.client_data = link;
@@ -476,37 +464,18 @@ static dev_link_t *netwave_attach(void)
476 */ 464 */
477static void netwave_detach(struct pcmcia_device *p_dev) 465static void netwave_detach(struct pcmcia_device *p_dev)
478{ 466{
479 dev_link_t *link = dev_to_instance(p_dev); 467 dev_link_t *link = dev_to_instance(p_dev);
480 struct net_device *dev = link->priv; 468 struct net_device *dev = link->priv;
481 dev_link_t **linkp;
482 469
483 DEBUG(0, "netwave_detach(0x%p)\n", link); 470 DEBUG(0, "netwave_detach(0x%p)\n", link);
484 471
485 /* 472 if (link->state & DEV_CONFIG)
486 If the device is currently configured and active, we won't 473 netwave_release(link);
487 actually delete it yet. Instead, it is marked so that when 474
488 the release() function is called, that will trigger a proper 475 if (link->dev)
489 detach(). 476 unregister_netdev(dev);
490 */ 477
491 if (link->state & DEV_CONFIG) 478 free_netdev(dev);
492 netwave_release(link);
493
494 /* Locate device structure */
495 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
496 if (*linkp == link) break;
497 if (*linkp == NULL)
498 {
499 DEBUG(1, "netwave_cs: detach fail, '%s' not in list\n",
500 link->dev->dev_name);
501 return;
502 }
503
504 /* Unlink device structure, free pieces */
505 *linkp = link->next;
506 if (link->dev)
507 unregister_netdev(dev);
508 free_netdev(dev);
509
510} /* netwave_detach */ 479} /* netwave_detach */
511 480
512/* 481/*
@@ -1503,7 +1472,6 @@ static int __init init_netwave_cs(void)
1503static void __exit exit_netwave_cs(void) 1472static void __exit exit_netwave_cs(void)
1504{ 1473{
1505 pcmcia_unregister_driver(&netwave_driver); 1474 pcmcia_unregister_driver(&netwave_driver);
1506 BUG_ON(dev_list != NULL);
1507} 1475}
1508 1476
1509module_init(init_netwave_cs); 1477module_init(init_netwave_cs);