···8383 device numbers are used to derive the corresponding array index.8484*/85858686-static dev_link_t *dev_list = NULL;8787-8886/*8989- A dev_link_t structure has fields for most things that are needed9090- to keep track of a socket, but there will usually be some device9191- specific information that also needs to be kept track of. The9292- 'priv' pointer in a dev_link_t structure can be used to point to9393- a device-specific private data structure, like this.9494-9587 A driver needs to provide a dev_node_t structure for each device9688 on a card. In some cases, there is only one device per card (for9789 example, ethernet cards, modems). In other cases, there may be···149157 link->priv = local;150158151159 /* Register with Card Services */152152- link->next = dev_list;153153- dev_list = link;160160+ link->next = NULL;154161 client_reg.dev_info = &dev_info;155162 client_reg.Version = 0x0210;156163 client_reg.event_callback_args.client_data = link;···179188static void avmcs_detach(struct pcmcia_device *p_dev)180189{181190 dev_link_t *link = dev_to_instance(p_dev);182182- dev_link_t **linkp;183183-184184- /* Locate device structure */185185- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)186186- if (*linkp == link) break;187187- if (*linkp == NULL)188188- return;189191190192 if (link->state & DEV_CONFIG)191193 avmcs_release(link);192194193193- /* Unlink device structure, free pieces */194194- *linkp = link->next;195195 kfree(link->priv);196196 kfree(link);197197} /* avmcs_detach */···476494static void __exit avmcs_exit(void)477495{478496 pcmcia_unregister_driver(&avmcs_driver);479479- BUG_ON(dev_list != NULL);480497}481498482499module_init(avmcs_init);
+1-20
drivers/isdn/hisax/avma1_cs.c
···9999 device numbers are used to derive the corresponding array index.100100*/101101102102-static dev_link_t *dev_list = NULL;103103-104102/*105105- A dev_link_t structure has fields for most things that are needed106106- to keep track of a socket, but there will usually be some device107107- specific information that also needs to be kept track of. The108108- 'priv' pointer in a dev_link_t structure can be used to point to109109- a device-specific private data structure, like this.110110-111103 A driver needs to provide a dev_node_t structure for each device112104 on a card. In some cases, there is only one device per card (for113105 example, ethernet cards, modems). In other cases, there may be···171179 link->conf.Present = PRESENT_OPTION;172180173181 /* Register with Card Services */174174- link->next = dev_list;175175- dev_list = link;182182+ link->next = NULL;176183 client_reg.dev_info = &dev_info;177184 client_reg.Version = 0x0210;178185 client_reg.event_callback_args.client_data = link;···197206static void avma1cs_detach(struct pcmcia_device *p_dev)198207{199208 dev_link_t *link = dev_to_instance(p_dev);200200- dev_link_t **linkp;201209202210 DEBUG(0, "avma1cs_detach(0x%p)\n", link);203203-204204- /* Locate device structure */205205- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)206206- if (*linkp == link) break;207207- if (*linkp == NULL)208208- return;209211210212 if (link->state & DEV_CONFIG)211213 avma1cs_release(link);212214213213- /* Unlink device structure, free pieces */214214- *linkp = link->next;215215 kfree(link->priv);216216 kfree(link);217217} /* avma1cs_detach */···490508static void __exit exit_avma1_cs(void)491509{492510 pcmcia_unregister_driver(&avma1cs_driver);493493- BUG_ON(dev_list != NULL);494511}495512496513module_init(init_avma1_cs);
+3-25
drivers/isdn/hisax/elsa_cs.c
···126126 device numbers are used to derive the corresponding array index.127127*/128128129129-static dev_link_t *dev_list = NULL;130130-131129/*132132- A dev_link_t structure has fields for most things that are needed133133- to keep track of a socket, but there will usually be some device134134- specific information that also needs to be kept track of. The135135- 'priv' pointer in a dev_link_t structure can be used to point to136136- a device-specific private data structure, like this.137137-138138- To simplify the data structure handling, we actually include the139139- dev_link_t structure in the device's private data structure.140140-141130 A driver needs to provide a dev_node_t structure for each device142131 on a card. In some cases, there is only one device per card (for143132 example, ethernet cards, modems). In other cases, there may be···197208 link->conf.IntType = INT_MEMORY_AND_IO;198209199210 /* Register with Card Services */200200- link->next = dev_list;201201- dev_list = link;211211+ link->next = NULL;202212 client_reg.dev_info = &dev_info;203213 client_reg.Version = 0x0210;204214 client_reg.event_callback_args.client_data = link;···223235static void elsa_cs_detach(struct pcmcia_device *p_dev)224236{225237 dev_link_t *link = dev_to_instance(p_dev);226226- dev_link_t **linkp;227238 local_info_t *info = link->priv;228239229240 DEBUG(0, "elsa_cs_detach(0x%p)\n", link);230241231231- /* Locate device structure */232232- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)233233- if (*linkp == link) break;234234- if (*linkp == NULL)235235- return;236236-237242 if (link->state & DEV_CONFIG) {238238- ((local_info_t*)link->priv)->busy = 1;239239- elsa_cs_release(link);243243+ info->busy = 1;244244+ elsa_cs_release(link);240245 }241246242242- /* Unlink device structure and free it */243243- *linkp = link->next;244247 kfree(info);245248246249} /* elsa_cs_detach */···505526static void __exit exit_elsa_cs(void)506527{507528 pcmcia_unregister_driver(&elsa_cs_driver);508508- BUG_ON(dev_list != NULL);509529}510530511531module_init(init_elsa_cs);
+3-25
drivers/isdn/hisax/sedlbauer_cs.c
···134134 device numbers are used to derive the corresponding array index.135135*/136136137137-static dev_link_t *dev_list = NULL;138138-139137/*140140- A dev_link_t structure has fields for most things that are needed141141- to keep track of a socket, but there will usually be some device142142- specific information that also needs to be kept track of. The143143- 'priv' pointer in a dev_link_t structure can be used to point to144144- a device-specific private data structure, like this.145145-146146- To simplify the data structure handling, we actually include the147147- dev_link_t structure in the device's private data structure.148148-149138 A driver needs to provide a dev_node_t structure for each device150139 on a card. In some cases, there is only one device per card (for151140 example, ethernet cards, modems). In other cases, there may be···211222 link->conf.IntType = INT_MEMORY_AND_IO;212223213224 /* Register with Card Services */214214- link->next = dev_list;215215- dev_list = link;225225+ link->next = NULL;216226 client_reg.dev_info = &dev_info;217227 client_reg.Version = 0x0210;218228 client_reg.event_callback_args.client_data = link;···237249static void sedlbauer_detach(struct pcmcia_device *p_dev)238250{239251 dev_link_t *link = dev_to_instance(p_dev);240240- dev_link_t **linkp;241252242253 DEBUG(0, "sedlbauer_detach(0x%p)\n", link);243243-244244- /* Locate device structure */245245- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)246246- if (*linkp == link) break;247247- if (*linkp == NULL)248248- return;249254250255 if (link->state & DEV_CONFIG) {251251- ((local_info_t *)link->priv)->stop = 1;252252- sedlbauer_release(link);256256+ ((local_info_t *)link->priv)->stop = 1;257257+ sedlbauer_release(link);253258 }254259255255- /* Unlink device structure, and free it */256256- *linkp = link->next;257260 /* This points to the parent local_info_t struct */258261 kfree(link->priv);259262} /* sedlbauer_detach */···602623static void __exit exit_sedlbauer_cs(void)603624{604625 pcmcia_unregister_driver(&sedlbauer_driver);605605- BUG_ON(dev_list != NULL);606626}607627608628module_init(init_sedlbauer_cs);
+3-25
drivers/isdn/hisax/teles_cs.c
···107107 device numbers are used to derive the corresponding array index.108108*/109109110110-static dev_link_t *dev_list = NULL;111111-112110/*113113- A dev_link_t structure has fields for most things that are needed114114- to keep track of a socket, but there will usually be some device115115- specific information that also needs to be kept track of. The116116- 'priv' pointer in a dev_link_t structure can be used to point to117117- a device-specific private data structure, like this.118118-119119- To simplify the data structure handling, we actually include the120120- dev_link_t structure in the device's private data structure.121121-122111 A driver needs to provide a dev_node_t structure for each device123112 on a card. In some cases, there is only one device per card (for124113 example, ethernet cards, modems). In other cases, there may be···178189 link->conf.IntType = INT_MEMORY_AND_IO;179190180191 /* Register with Card Services */181181- link->next = dev_list;182182- dev_list = link;192192+ link->next = NULL;183193 client_reg.dev_info = &dev_info;184194 client_reg.Version = 0x0210;185195 client_reg.event_callback_args.client_data = link;···204216static void teles_detach(struct pcmcia_device *p_dev)205217{206218 dev_link_t *link = dev_to_instance(p_dev);207207- dev_link_t **linkp;208219 local_info_t *info = link->priv;209220210221 DEBUG(0, "teles_detach(0x%p)\n", link);211222212212- /* Locate device structure */213213- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)214214- if (*linkp == link) break;215215- if (*linkp == NULL)216216- return;217217-218223 if (link->state & DEV_CONFIG) {219219- info->busy = 1;220220- teles_cs_release(link);224224+ info->busy = 1;225225+ teles_cs_release(link);221226 }222227223223- /* Unlink device structure and free it */224224- *linkp = link->next;225228 kfree(info);226229227230} /* teles_detach */···485506static void __exit exit_teles_cs(void)486507{487508 pcmcia_unregister_driver(&teles_cs_driver);488488- BUG_ON(dev_list != NULL);489509}490510491511module_init(init_teles_cs);
···331331 * device numbers are used to derive the corresponding array index.332332 */333333334334-static dev_link_t *dev_list;335335-336334/****************337337- * A dev_link_t structure has fields for most things that are needed338338- * to keep track of a socket, but there will usually be some device339339- * specific information that also needs to be kept track of. The340340- * 'priv' pointer in a dev_link_t structure can be used to point to341341- * a device-specific private data structure, like this.342342- *343335 * A driver needs to provide a dev_node_t structure for each device344336 * on a card. In some cases, there is only one device per card (for345337 * example, ethernet cards, modems). In other cases, there may be···607615#endif608616609617 /* Register with Card Services */610610- link->next = dev_list;611611- dev_list = link;618618+ link->next = NULL;612619 client_reg.dev_info = &dev_info;613620 client_reg.Version = 0x0210;614621 client_reg.event_callback_args.client_data = link;···632641{633642 dev_link_t *link = dev_to_instance(p_dev);634643 struct net_device *dev = link->priv;635635- dev_link_t **linkp;636644637645 DEBUG(0, "detach(0x%p)\n", link);638638-639639- /* Locate device structure */640640- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)641641- if (*linkp == link)642642- break;643643- if (!*linkp) {644644- DEBUG(0, "detach(0x%p): dev_link lost\n", link);645645- return;646646- }647646648647 if (link->dev)649648 unregister_netdev(dev);···641660 if (link->state & DEV_CONFIG)642661 xirc2ps_release(link);643662644644- /* Unlink device structure, free it */645645- *linkp = link->next;646663 free_netdev(dev);647664} /* xirc2ps_detach */648665···19992020exit_xirc2ps_cs(void)20002021{20012022 pcmcia_unregister_driver(&xirc2ps_cs_driver);20022002- BUG_ON(dev_list != NULL);20032023}2004202420052025module_init(init_xirc2ps_cs);
+4-24
drivers/net/wireless/airo_cs.c
···119119 device numbers are used to derive the corresponding array index.120120*/121121122122-static dev_link_t *dev_list = NULL;123123-124122/*125125- A dev_link_t structure has fields for most things that are needed126126- to keep track of a socket, but there will usually be some device127127- specific information that also needs to be kept track of. The128128- 'priv' pointer in a dev_link_t structure can be used to point to129129- a device-specific private data structure, like this.130130-131123 A driver needs to provide a dev_node_t structure for each device132124 on a card. In some cases, there is only one device per card (for133125 example, ethernet cards, modems). In other cases, there may be···194202 link->priv = local;195203196204 /* Register with Card Services */197197- link->next = dev_list;198198- dev_list = link;205205+ link->next = NULL;199206 client_reg.dev_info = &dev_info;200207 client_reg.Version = 0x0210;201208 client_reg.event_callback_args.client_data = link;···220229static void airo_detach(struct pcmcia_device *p_dev)221230{222231 dev_link_t *link = dev_to_instance(p_dev);223223- dev_link_t **linkp;224224-232232+225233 DEBUG(0, "airo_detach(0x%p)\n", link);226226-227227- /* Locate device structure */228228- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)229229- if (*linkp == link) break;230230- if (*linkp == NULL)231231- return;232232-234234+233235 if (link->state & DEV_CONFIG)234236 airo_release(link);235235-237237+236238 if ( ((local_info_t*)link->priv)->eth_dev ) {237239 stop_airo_card( ((local_info_t*)link->priv)->eth_dev, 0 );238240 }239241 ((local_info_t*)link->priv)->eth_dev = NULL;240242241241- /* Unlink device structure, free pieces */242242- *linkp = link->next;243243 kfree(link->priv);244244 kfree(link);245245-246245} /* airo_detach */247246248247/*======================================================================···555574static void airo_cs_cleanup(void)556575{557576 pcmcia_unregister_driver(&airo_driver);558558- BUG_ON(dev_list != NULL);559577}560578561579/*
+3-22
drivers/net/wireless/atmel_cs.c
···130130 device numbers are used to derive the corresponding array index.131131*/132132133133-static dev_link_t *dev_list = NULL;134134-135133/*136136- A dev_link_t structure has fields for most things that are needed137137- to keep track of a socket, but there will usually be some device138138- specific information that also needs to be kept track of. The139139- 'priv' pointer in a dev_link_t structure can be used to point to140140- a device-specific private data structure, like this.141141-142134 A driver needs to provide a dev_node_t structure for each device143135 on a card. In some cases, there is only one device per card (for144136 example, ethernet cards, modems). In other cases, there may be···205213 link->priv = local;206214207215 /* Register with Card Services */208208- link->next = dev_list;209209- dev_list = link;216216+ link->next = NULL;210217 client_reg.dev_info = &dev_info;211218 client_reg.Version = 0x0210;212219 client_reg.event_callback_args.client_data = link;···231240static void atmel_detach(struct pcmcia_device *p_dev)232241{233242 dev_link_t *link = dev_to_instance(p_dev);234234- dev_link_t **linkp;235235-243243+236244 DEBUG(0, "atmel_detach(0x%p)\n", link);237237-238238- /* Locate device structure */239239- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)240240- if (*linkp == link) break;241241- if (*linkp == NULL)242242- return;243245244246 if (link->state & DEV_CONFIG)245247 atmel_release(link);246246-247247- /* Unlink device structure, free pieces */248248- *linkp = link->next;248248+249249 kfree(link->priv);250250 kfree(link);251251}···578596static void atmel_cs_cleanup(void)579597{580598 pcmcia_unregister_driver(&atmel_driver);581581- BUG_ON(dev_list != NULL);582599}583600584601/*
···228228static void set_multicast_list(struct net_device *dev);229229230230/*231231- A linked list of "instances" of the skeleton device. Each actual232232- PCMCIA card corresponds to one device instance, and is described233233- by one dev_link_t structure (defined in ds.h).234234-235235- You may not want to use a linked list for this -- for example, the236236- memory card driver uses an array of dev_link_t pointers, where minor237237- device numbers are used to derive the corresponding array index.238238-*/239239-static dev_link_t *dev_list;240240-241241-/*242231 A dev_link_t structure has fields for most things that are needed243232 to keep track of a socket, but there will usually be some device244233 specific information that also needs to be kept track of. The···440451 link->irq.Instance = dev;441452442453 /* Register with Card Services */443443- link->next = dev_list;444444- dev_list = link;454454+ link->next = NULL;445455 client_reg.dev_info = &dev_info;446456 client_reg.Version = 0x0210;447457 client_reg.event_callback_args.client_data = link;···464476 */465477static void netwave_detach(struct pcmcia_device *p_dev)466478{467467- dev_link_t *link = dev_to_instance(p_dev);468468- struct net_device *dev = link->priv;469469- dev_link_t **linkp;479479+ dev_link_t *link = dev_to_instance(p_dev);480480+ struct net_device *dev = link->priv;470481471471- DEBUG(0, "netwave_detach(0x%p)\n", link);472472-473473- /*474474- If the device is currently configured and active, we won't475475- actually delete it yet. Instead, it is marked so that when476476- the release() function is called, that will trigger a proper477477- detach().478478- */479479- if (link->state & DEV_CONFIG)480480- netwave_release(link);482482+ DEBUG(0, "netwave_detach(0x%p)\n", link);481483482482- /* Locate device structure */483483- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)484484- if (*linkp == link) break;485485- if (*linkp == NULL)486486- {487487- DEBUG(1, "netwave_cs: detach fail, '%s' not in list\n",488488- link->dev->dev_name);489489- return;490490- }484484+ if (link->state & DEV_CONFIG)485485+ netwave_release(link);491486492492- /* Unlink device structure, free pieces */493493- *linkp = link->next;494494- if (link->dev) 495495- unregister_netdev(dev);496496- free_netdev(dev);497497-487487+ if (link->dev)488488+ unregister_netdev(dev);489489+490490+ free_netdev(dev);498491} /* netwave_detach */499492500493/*···14721503static void __exit exit_netwave_cs(void)14731504{14741505 pcmcia_unregister_driver(&netwave_driver);14751475- BUG_ON(dev_list != NULL);14761506}1477150714781508module_init(init_netwave_cs);
+1-20
drivers/net/wireless/orinoco_cs.c
···6969 unsigned long hard_reset_in_progress; 7070};71717272-/*7373- * A linked list of "instances" of the device. Each actual PCMCIA7474- * card corresponds to one device instance, and is described by one7575- * dev_link_t structure (defined in ds.h).7676- */7777-static dev_link_t *dev_list; /* = NULL */78727973/********************************************************************/8074/* Function prototypes */···148154 link->conf.IntType = INT_MEMORY_AND_IO;149155150156 /* Register with Card Services */151151- /* FIXME: need a lock? */152152- link->next = dev_list;153153- dev_list = link;157157+ link->next = NULL;154158155159 client_reg.dev_info = &dev_info;156160 client_reg.Version = 0x0210; /* FIXME: what does this mean? */···173181static void orinoco_cs_detach(struct pcmcia_device *p_dev)174182{175183 dev_link_t *link = dev_to_instance(p_dev);176176- dev_link_t **linkp;177184 struct net_device *dev = link->priv;178178-179179- /* Locate device structure */180180- for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)181181- if (*linkp == link)182182- break;183183-184184- BUG_ON(*linkp == NULL);185185186186 if (link->state & DEV_CONFIG)187187 orinoco_cs_release(link);188188189189- /* Unlink device structure, and free it */190190- *linkp = link->next;191189 DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev);192190 if (link->dev) {193191 DEBUG(0, PFX "About to unregister net device %p\n",···660678exit_orinoco_cs(void)661679{662680 pcmcia_unregister_driver(&orinoco_driver);663663- BUG_ON(dev_list != NULL);664681}665682666683module_init(init_orinoco_cs);
+1-10
drivers/net/wireless/spectrum_cs.c
···7878 dev_node_t node;7979};80808181-/*8282- * A linked list of "instances" of the device. Each actual PCMCIA8383- * card corresponds to one device instance, and is described by one8484- * dev_link_t structure (defined in ds.h).8585- */8686-static dev_link_t *dev_list; /* = NULL */8787-8881/********************************************************************/8982/* Function prototypes */9083/********************************************************************/···630637631638 /* Register with Card Services */632639 /* FIXME: need a lock? */633633- link->next = dev_list;634634- dev_list = link;640640+ link->next = NULL; /* not needed */635641636642 client_reg.dev_info = &dev_info;637643 client_reg.Version = 0x0210; /* FIXME: what does this mean? */···10411049exit_spectrum_cs(void)10421050{10431051 pcmcia_unregister_driver(&orinoco_driver);10441044- BUG_ON(dev_list != NULL);10451052}1046105310471054module_init(init_spectrum_cs);
+1-23
drivers/net/wireless/wavelan_cs.c
···46274627 link->conf.IntType = INT_MEMORY_AND_IO;4628462846294629 /* Chain drivers */46304630- link->next = dev_list;46314631- dev_list = link;46304630+ link->next = NULL;4632463146334632 /* Allocate the generic data structure */46344633 dev = alloc_etherdev(sizeof(net_local));···47284729 {47294730 /* Some others haven't done their job : give them another chance */47304731 wv_pcmcia_release(link);47314731- }47324732-47334733- /* Remove the interface data from the linked list */47344734- if(dev_list == link)47354735- dev_list = link->next;47364736- else47374737- {47384738- dev_link_t * prev = dev_list;47394739-47404740- while((prev != (dev_link_t *) NULL) && (prev->next != link))47414741- prev = prev->next;47424742-47434743- if(prev == (dev_link_t *) NULL)47444744- {47454745-#ifdef DEBUG_CONFIG_ERRORS47464746- printk(KERN_WARNING "wavelan_detach : Attempting to remove a nonexistent device.\n");47474747-#endif47484748- return;47494749- }47504750-47514751- prev->next = link->next;47524732 }4753473347544734 /* Free pieces */
-1
drivers/net/wireless/wavelan_cs.p.h
···766766/**************************** VARIABLES ****************************/767767768768static dev_info_t dev_info = "wavelan_cs";769769-static dev_link_t *dev_list = NULL; /* Linked list of devices */770769771770/*772771 * Parameters that can be set with 'insmod'