···5151 handler.5252*/53535454-static void avmcs_config(dev_link_t *link);5555-static void avmcs_release(dev_link_t *link);5454+static void avmcs_config(struct pcmcia_device *link);5555+static void avmcs_release(struct pcmcia_device *link);56565757/*5858 The attach() and detach() entry points are used to create and destroy···6565/*6666 A linked list of "instances" of the skeleton device. Each actual6767 PCMCIA card corresponds to one device instance, and is described6868- by one dev_link_t structure (defined in ds.h).6868+ by one struct pcmcia_device structure (defined in ds.h).69697070 You may not want to use a linked list for this -- for example, the7171- memory card driver uses an array of dev_link_t pointers, where minor7171+ memory card driver uses an array of struct pcmcia_device pointers, where minor7272 device numbers are used to derive the corresponding array index.7373*/7474···7878 example, ethernet cards, modems). In other cases, there may be7979 many actual or logical devices (SCSI adapters, memory cards with8080 multiple partitions). The dev_node_t structures need to be kept8181- in a linked list starting at the 'dev' field of a dev_link_t8181+ in a linked list starting at the 'dev' field of a struct pcmcia_device8282 structure. We allocate them in the card's private data structure,8383 because they generally can't be allocated dynamically.8484*/···145145146146======================================================================*/147147148148-static void avmcs_detach(struct pcmcia_device *p_dev)148148+static void avmcs_detach(struct pcmcia_device *link)149149{150150- dev_link_t *link = dev_to_instance(p_dev);151151-152150 if (link->state & DEV_CONFIG)153151 avmcs_release(link);154152···161163162164======================================================================*/163165164164-static int get_tuple(client_handle_t handle, tuple_t *tuple,166166+static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple,165167 cisparse_t *parse)166168{167169 int i = pcmcia_get_tuple_data(handle, tuple);···169171 return pcmcia_parse_tuple(handle, tuple, parse);170172}171173172172-static int first_tuple(client_handle_t handle, tuple_t *tuple,174174+static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,173175 cisparse_t *parse)174176{175177 int i = pcmcia_get_first_tuple(handle, tuple);···177179 return get_tuple(handle, tuple, parse);178180}179181180180-static int next_tuple(client_handle_t handle, tuple_t *tuple,182182+static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,181183 cisparse_t *parse)182184{183185 int i = pcmcia_get_next_tuple(handle, tuple);···185187 return get_tuple(handle, tuple, parse);186188}187189188188-static void avmcs_config(dev_link_t *link)190190+static void avmcs_config(struct pcmcia_device *link)189191{190190- client_handle_t handle;191192 tuple_t tuple;192193 cisparse_t parse;193194 cistpl_cftable_entry_t *cf = &parse.cftable_entry;···196199 char devname[128];197200 int cardtype;198201 int (*addcard)(unsigned int port, unsigned irq);199199-200200- handle = link->handle;202202+201203 dev = link->priv;202204203205 /*···205209 */206210 do {207211 tuple.DesiredTuple = CISTPL_CONFIG;208208- i = pcmcia_get_first_tuple(handle, &tuple);212212+ i = pcmcia_get_first_tuple(link, &tuple);209213 if (i != CS_SUCCESS) break;210214 tuple.TupleData = buf;211215 tuple.TupleDataMax = 64;212216 tuple.TupleOffset = 0;213213- i = pcmcia_get_tuple_data(handle, &tuple);217217+ i = pcmcia_get_tuple_data(link, &tuple);214218 if (i != CS_SUCCESS) break;215215- i = pcmcia_parse_tuple(handle, &tuple, &parse);219219+ i = pcmcia_parse_tuple(link, &tuple, &parse);216220 if (i != CS_SUCCESS) break;217221 link->conf.ConfigBase = parse.config.base;218222 } while (0);219223 if (i != CS_SUCCESS) {220220- cs_error(link->handle, ParseTuple, i);224224+ cs_error(link, ParseTuple, i);221225 link->state &= ~DEV_CONFIG_PENDING;222226 return;223227 }···234238 tuple.DesiredTuple = CISTPL_VERS_1;235239236240 devname[0] = 0;237237- if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) {241241+ if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) {238242 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], 239243 sizeof(devname));240244 }···245249 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;246250 tuple.Attributes = 0;247251 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;248248- i = first_tuple(handle, &tuple, &parse);252252+ i = first_tuple(link, &tuple, &parse);249253 while (i == CS_SUCCESS) {250254 if (cf->io.nwin > 0) {251255 link->conf.ConfigIndex = cf->index;···255259 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",256260 link->io.BasePort1,257261 link->io.BasePort1+link->io.NumPorts1-1);258258- i = pcmcia_request_io(link->handle, &link->io);262262+ i = pcmcia_request_io(link, &link->io);259263 if (i == CS_SUCCESS) goto found_port;260264 }261261- i = next_tuple(handle, &tuple, &parse);265265+ i = next_tuple(link, &tuple, &parse);262266 }263267264268found_port:265269 if (i != CS_SUCCESS) {266266- cs_error(link->handle, RequestIO, i);270270+ cs_error(link, RequestIO, i);267271 break;268272 }269273270274 /*271275 * allocate an interrupt line272276 */273273- i = pcmcia_request_irq(link->handle, &link->irq);277277+ i = pcmcia_request_irq(link, &link->irq);274278 if (i != CS_SUCCESS) {275275- cs_error(link->handle, RequestIRQ, i);279279+ cs_error(link, RequestIRQ, i);276280 /* undo */277277- pcmcia_disable_device(link->handle);281281+ pcmcia_disable_device(link);278282 break;279283 }280284281285 /*282286 * configure the PCMCIA socket283287 */284284- i = pcmcia_request_configuration(link->handle, &link->conf);288288+ i = pcmcia_request_configuration(link, &link->conf);285289 if (i != CS_SUCCESS) {286286- cs_error(link->handle, RequestConfiguration, i);287287- pcmcia_disable_device(link->handle);290290+ cs_error(link, RequestConfiguration, i);291291+ pcmcia_disable_device(link);288292 break;289293 }290294···347351348352======================================================================*/349353350350-static void avmcs_release(dev_link_t *link)354354+static void avmcs_release(struct pcmcia_device *link)351355{352356 b1pcmcia_delcard(link->io.BasePort1, link->irq.AssignedIRQ);353353- pcmcia_disable_device(link->handle);357357+ pcmcia_disable_device(link);354358} /* avmcs_release */355359356360
+28-32
drivers/isdn/hisax/avma1_cs.c
···6767 handler.6868*/69697070-static void avma1cs_config(dev_link_t *link);7171-static void avma1cs_release(dev_link_t *link);7070+static void avma1cs_config(struct pcmcia_device *link);7171+static void avma1cs_release(struct pcmcia_device *link);72727373/*7474 The attach() and detach() entry points are used to create and destroy···8282/*8383 A linked list of "instances" of the skeleton device. Each actual8484 PCMCIA card corresponds to one device instance, and is described8585- by one dev_link_t structure (defined in ds.h).8585+ by one struct pcmcia_device structure (defined in ds.h).86868787 You may not want to use a linked list for this -- for example, the8888- memory card driver uses an array of dev_link_t pointers, where minor8888+ memory card driver uses an array of struct pcmcia_device pointers, where minor8989 device numbers are used to derive the corresponding array index.9090*/9191···9595 example, ethernet cards, modems). In other cases, there may be9696 many actual or logical devices (SCSI adapters, memory cards with9797 multiple partitions). The dev_node_t structures need to be kept9898- in a linked list starting at the 'dev' field of a dev_link_t9898+ in a linked list starting at the 'dev' field of a struct pcmcia_device9999 structure. We allocate them in the card's private data structure,100100 because they generally can't be allocated dynamically.101101*/···164164165165======================================================================*/166166167167-static void avma1cs_detach(struct pcmcia_device *p_dev)167167+static void avma1cs_detach(struct pcmcia_device *link)168168{169169- dev_link_t *link = dev_to_instance(p_dev);170170-171169 DEBUG(0, "avma1cs_detach(0x%p)\n", link);172170173171 if (link->state & DEV_CONFIG)···182184183185======================================================================*/184186185185-static int get_tuple(client_handle_t handle, tuple_t *tuple,187187+static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple,186188 cisparse_t *parse)187189{188190 int i = pcmcia_get_tuple_data(handle, tuple);···190192 return pcmcia_parse_tuple(handle, tuple, parse);191193}192194193193-static int first_tuple(client_handle_t handle, tuple_t *tuple,195195+static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,194196 cisparse_t *parse)195197{196198 int i = pcmcia_get_first_tuple(handle, tuple);···198200 return get_tuple(handle, tuple, parse);199201}200202201201-static int next_tuple(client_handle_t handle, tuple_t *tuple,203203+static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,202204 cisparse_t *parse)203205{204206 int i = pcmcia_get_next_tuple(handle, tuple);···206208 return get_tuple(handle, tuple, parse);207209}208210209209-static void avma1cs_config(dev_link_t *link)211211+static void avma1cs_config(struct pcmcia_device *link)210212{211211- client_handle_t handle;212213 tuple_t tuple;213214 cisparse_t parse;214215 cistpl_cftable_entry_t *cf = &parse.cftable_entry;···217220 char devname[128];218221 IsdnCard_t icard;219222 int busy = 0;220220-221221- handle = link->handle;223223+222224 dev = link->priv;223225224226 DEBUG(0, "avma1cs_config(0x%p)\n", link);···228232 */229233 do {230234 tuple.DesiredTuple = CISTPL_CONFIG;231231- i = pcmcia_get_first_tuple(handle, &tuple);235235+ i = pcmcia_get_first_tuple(link, &tuple);232236 if (i != CS_SUCCESS) break;233237 tuple.TupleData = buf;234238 tuple.TupleDataMax = 64;235239 tuple.TupleOffset = 0;236236- i = pcmcia_get_tuple_data(handle, &tuple);240240+ i = pcmcia_get_tuple_data(link, &tuple);237241 if (i != CS_SUCCESS) break;238238- i = pcmcia_parse_tuple(handle, &tuple, &parse);242242+ i = pcmcia_parse_tuple(link, &tuple, &parse);239243 if (i != CS_SUCCESS) break;240244 link->conf.ConfigBase = parse.config.base;241245 } while (0);242246 if (i != CS_SUCCESS) {243243- cs_error(link->handle, ParseTuple, i);247247+ cs_error(link, ParseTuple, i);244248 link->state &= ~DEV_CONFIG_PENDING;245249 return;246250 }···257261 tuple.DesiredTuple = CISTPL_VERS_1;258262259263 devname[0] = 0;260260- if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) {264264+ if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) {261265 strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], 262266 sizeof(devname));263267 }···268272 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;269273 tuple.Attributes = 0;270274 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;271271- i = first_tuple(handle, &tuple, &parse);275275+ i = first_tuple(link, &tuple, &parse);272276 while (i == CS_SUCCESS) {273277 if (cf->io.nwin > 0) {274278 link->conf.ConfigIndex = cf->index;···278282 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n",279283 link->io.BasePort1,280284 link->io.BasePort1+link->io.NumPorts1 - 1);281281- i = pcmcia_request_io(link->handle, &link->io);285285+ i = pcmcia_request_io(link, &link->io);282286 if (i == CS_SUCCESS) goto found_port;283287 }284284- i = next_tuple(handle, &tuple, &parse);288288+ i = next_tuple(link, &tuple, &parse);285289 }286290287291found_port:288292 if (i != CS_SUCCESS) {289289- cs_error(link->handle, RequestIO, i);293293+ cs_error(link, RequestIO, i);290294 break;291295 }292296293297 /*294298 * allocate an interrupt line295299 */296296- i = pcmcia_request_irq(link->handle, &link->irq);300300+ i = pcmcia_request_irq(link, &link->irq);297301 if (i != CS_SUCCESS) {298298- cs_error(link->handle, RequestIRQ, i);302302+ cs_error(link, RequestIRQ, i);299303 /* undo */300300- pcmcia_disable_device(link->handle);304304+ pcmcia_disable_device(link);301305 break;302306 }303307304308 /*305309 * configure the PCMCIA socket306310 */307307- i = pcmcia_request_configuration(link->handle, &link->conf);311311+ i = pcmcia_request_configuration(link, &link->conf);308312 if (i != CS_SUCCESS) {309309- cs_error(link->handle, RequestConfiguration, i);310310- pcmcia_disable_device(link->handle);313313+ cs_error(link, RequestConfiguration, i);314314+ pcmcia_disable_device(link);311315 break;312316 }313317···354358355359======================================================================*/356360357357-static void avma1cs_release(dev_link_t *link)361361+static void avma1cs_release(struct pcmcia_device *link)358362{359363 local_info_t *local = link->priv;360364···363367 /* now unregister function with hisax */364368 HiSax_closecard(local->node.minor);365369366366- pcmcia_disable_device(link->handle);370370+ pcmcia_disable_device(link);367371} /* avma1cs_release */368372369373
+22-28
drivers/isdn/hisax/elsa_cs.c
···9494 handler.9595*/96969797-static void elsa_cs_config(dev_link_t *link);9898-static void elsa_cs_release(dev_link_t *link);9797+static void elsa_cs_config(struct pcmcia_device *link);9898+static void elsa_cs_release(struct pcmcia_device *link);9999100100/*101101 The attach() and detach() entry points are used to create and destroy···111111 example, ethernet cards, modems). In other cases, there may be112112 many actual or logical devices (SCSI adapters, memory cards with113113 multiple partitions). The dev_node_t structures need to be kept114114- in a linked list starting at the 'dev' field of a dev_link_t114114+ in a linked list starting at the 'dev' field of a struct pcmcia_device115115 structure. We allocate them in the card's private data structure,116116 because they generally shouldn't be allocated dynamically.117117 In this case, we also provide a flag to indicate if a device is···139139140140======================================================================*/141141142142-static int elsa_cs_attach(struct pcmcia_device *p_dev)142142+static int elsa_cs_attach(struct pcmcia_device *link)143143{144144 local_info_t *local;145145- dev_link_t *link = dev_to_instance(p_dev);146145147146 DEBUG(0, "elsa_cs_attach()\n");148147···150151 if (!local) return -ENOMEM;151152 memset(local, 0, sizeof(local_info_t));152153153153- local->p_dev = p_dev;154154+ local->p_dev = link;154155 link->priv = local;155156156157 local->cardnr = -1;···189190190191======================================================================*/191192192192-static void elsa_cs_detach(struct pcmcia_device *p_dev)193193+static void elsa_cs_detach(struct pcmcia_device *link)193194{194194- dev_link_t *link = dev_to_instance(p_dev);195195 local_info_t *info = link->priv;196196197197 DEBUG(0, "elsa_cs_detach(0x%p)\n", link);···211213 device available to the system.212214213215======================================================================*/214214-static int get_tuple(client_handle_t handle, tuple_t *tuple,216216+static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple,215217 cisparse_t *parse)216218{217219 int i = pcmcia_get_tuple_data(handle, tuple);···219221 return pcmcia_parse_tuple(handle, tuple, parse);220222}221223222222-static int first_tuple(client_handle_t handle, tuple_t *tuple,224224+static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,223225 cisparse_t *parse)224226{225227 int i = pcmcia_get_first_tuple(handle, tuple);···227229 return get_tuple(handle, tuple, parse);228230}229231230230-static int next_tuple(client_handle_t handle, tuple_t *tuple,232232+static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,231233 cisparse_t *parse)232234{233235 int i = pcmcia_get_next_tuple(handle, tuple);···235237 return get_tuple(handle, tuple, parse);236238}237239238238-static void elsa_cs_config(dev_link_t *link)240240+static void elsa_cs_config(struct pcmcia_device *link)239241{240240- client_handle_t handle;241242 tuple_t tuple;242243 cisparse_t parse;243244 local_info_t *dev;···246249 IsdnCard_t icard;247250248251 DEBUG(0, "elsa_config(0x%p)\n", link);249249- handle = link->handle;250252 dev = link->priv;251253252254 /*···257261 tuple.TupleDataMax = 255;258262 tuple.TupleOffset = 0;259263 tuple.Attributes = 0;260260- i = first_tuple(handle, &tuple, &parse);264264+ i = first_tuple(link, &tuple, &parse);261265 if (i != CS_SUCCESS) {262266 last_fn = ParseTuple;263267 goto cs_failed;···272276 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;273277 tuple.Attributes = 0;274278 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;275275- i = first_tuple(handle, &tuple, &parse);279279+ i = first_tuple(link, &tuple, &parse);276280 while (i == CS_SUCCESS) {277281 if ( (cf->io.nwin > 0) && cf->io.win[0].base) {278282 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");279283 link->conf.ConfigIndex = cf->index;280284 link->io.BasePort1 = cf->io.win[0].base;281281- i = pcmcia_request_io(link->handle, &link->io);285285+ i = pcmcia_request_io(link, &link->io);282286 if (i == CS_SUCCESS) break;283287 } else {284288 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");285289 link->conf.ConfigIndex = cf->index;286290 for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) {287291 link->io.BasePort1 = j;288288- i = pcmcia_request_io(link->handle, &link->io);292292+ i = pcmcia_request_io(link, &link->io);289293 if (i == CS_SUCCESS) break;290294 }291295 break;292296 }293293- i = next_tuple(handle, &tuple, &parse);297297+ i = next_tuple(link, &tuple, &parse);294298 }295299296300 if (i != CS_SUCCESS) {···298302 goto cs_failed;299303 }300304301301- i = pcmcia_request_irq(link->handle, &link->irq);305305+ i = pcmcia_request_irq(link, &link->irq);302306 if (i != CS_SUCCESS) {303307 link->irq.AssignedIRQ = 0;304308 last_fn = RequestIRQ;305309 goto cs_failed;306310 }307311308308- i = pcmcia_request_configuration(link->handle, &link->conf);312312+ i = pcmcia_request_configuration(link, &link->conf);309313 if (i != CS_SUCCESS) {310314 last_fn = RequestConfiguration;311315 goto cs_failed;···348352349353 return;350354cs_failed:351351- cs_error(link->handle, last_fn, i);355355+ cs_error(link, last_fn, i);352356 elsa_cs_release(link);353357} /* elsa_cs_config */354358···360364361365======================================================================*/362366363363-static void elsa_cs_release(dev_link_t *link)367367+static void elsa_cs_release(struct pcmcia_device *link)364368{365369 local_info_t *local = link->priv;366370···373377 }374378 }375379376376- pcmcia_disable_device(link->handle);380380+ pcmcia_disable_device(link);377381} /* elsa_cs_release */378382379379-static int elsa_suspend(struct pcmcia_device *p_dev)383383+static int elsa_suspend(struct pcmcia_device *link)380384{381381- dev_link_t *link = dev_to_instance(p_dev);382385 local_info_t *dev = link->priv;383386384387 dev->busy = 1;···385390 return 0;386391}387392388388-static int elsa_resume(struct pcmcia_device *p_dev)393393+static int elsa_resume(struct pcmcia_device *link)389394{390390- dev_link_t *link = dev_to_instance(p_dev);391395 local_info_t *dev = link->priv;392396393397 dev->busy = 0;
+26-32
drivers/isdn/hisax/sedlbauer_cs.c
···9595 event handler. 9696*/97979898-static void sedlbauer_config(dev_link_t *link);9999-static void sedlbauer_release(dev_link_t *link);9898+static void sedlbauer_config(struct pcmcia_device *link);9999+static void sedlbauer_release(struct pcmcia_device *link);100100101101/*102102 The attach() and detach() entry points are used to create and destroy···119119 example, ethernet cards, modems). In other cases, there may be120120 many actual or logical devices (SCSI adapters, memory cards with121121 multiple partitions). The dev_node_t structures need to be kept122122- in a linked list starting at the 'dev' field of a dev_link_t122122+ in a linked list starting at the 'dev' field of a struct pcmcia_device123123 structure. We allocate them in the card's private data structure,124124 because they generally shouldn't be allocated dynamically.125125···148148149149======================================================================*/150150151151-static int sedlbauer_attach(struct pcmcia_device *p_dev)151151+static int sedlbauer_attach(struct pcmcia_device *link)152152{153153 local_info_t *local;154154- dev_link_t *link = dev_to_instance(p_dev);155155-154154+156155 DEBUG(0, "sedlbauer_attach()\n");157156158157 /* Allocate space for private device-specific data */···160161 memset(local, 0, sizeof(local_info_t));161162 local->cardnr = -1;162163163163- local->p_dev = p_dev;164164+ local->p_dev = link;164165 link->priv = local;165166166167 /* Interrupt setup */···201202202203======================================================================*/203204204204-static void sedlbauer_detach(struct pcmcia_device *p_dev)205205+static void sedlbauer_detach(struct pcmcia_device *link)205206{206206- dev_link_t *link = dev_to_instance(p_dev);207207-208207 DEBUG(0, "sedlbauer_detach(0x%p)\n", link);209208210209 if (link->state & DEV_CONFIG) {···224227#define CS_CHECK(fn, ret) \225228do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)226229227227-static void sedlbauer_config(dev_link_t *link)230230+static void sedlbauer_config(struct pcmcia_device *link)228231{229229- client_handle_t handle = link->handle;230232 local_info_t *dev = link->priv;231233 tuple_t tuple;232234 cisparse_t parse;···247251 tuple.TupleData = buf;248252 tuple.TupleDataMax = sizeof(buf);249253 tuple.TupleOffset = 0;250250- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));251251- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));252252- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));254254+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));255255+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));256256+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));253257 link->conf.ConfigBase = parse.config.base;254258 link->conf.Present = parse.config.rmask[0];255259256260 /* Configure card */257261 link->state |= DEV_CONFIG;258262259259- CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));263263+ CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf));260264261265 /*262266 In this loop, we scan the CIS for configuration table entries,···271275 will only use the CIS to fill in implementation-defined details.272276 */273277 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;274274- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));278278+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));275279 while (1) {276280 cistpl_cftable_entry_t dflt = { 0 };277281 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);278278- if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||279279- pcmcia_parse_tuple(handle, &tuple, &parse) != 0)282282+ if (pcmcia_get_tuple_data(link, &tuple) != 0 ||283283+ pcmcia_parse_tuple(link, &tuple, &parse) != 0)280284 goto next_entry;281285282286 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;···330334 link->io.NumPorts2 = io->win[1].len;331335 }332336 /* This reserves IO space but doesn't actually enable it */333333- if (pcmcia_request_io(link->handle, &link->io) != 0)337337+ if (pcmcia_request_io(link, &link->io) != 0)334338 goto next_entry;335339 }336340337341 /*338342 Now set up a common memory window, if needed. There is room339339- in the dev_link_t structure for one memory window handle,343343+ in the struct pcmcia_device structure for one memory window handle,340344 but if the base addresses need to be saved, or if multiple341345 windows are needed, the info should go in the private data342346 structure for this device.···357361 req.Size = 0x1000;358362*/359363 req.AccessSpeed = 0;360360- if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)364364+ if (pcmcia_request_window(&link, &req, &link->win) != 0)361365 goto next_entry;362366 map.Page = 0; map.CardOffset = mem->win[0].card_addr;363367 if (pcmcia_map_mem_page(link->win, &map) != 0)···367371 break;368372369373 next_entry:370370- CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));374374+ CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));371375 }372376373377 /*···376380 irq structure is initialized.377381 */378382 if (link->conf.Attributes & CONF_ENABLE_IRQ)379379- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));383383+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));380384381385 /*382386 This actually configures the PCMCIA socket -- setting up383387 the I/O windows and the interrupt mapping, and putting the384388 card and host interface into "Memory and IO" mode.385389 */386386- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));390390+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));387391388392 /*389393 At this point, the dev_node_t structure(s) need to be···429433 return;430434431435cs_failed:432432- cs_error(link->handle, last_fn, last_ret);436436+ cs_error(link, last_fn, last_ret);433437 sedlbauer_release(link);434438435439} /* sedlbauer_config */···442446443447======================================================================*/444448445445-static void sedlbauer_release(dev_link_t *link)449449+static void sedlbauer_release(struct pcmcia_device *link)446450{447451 local_info_t *local = link->priv;448452 DEBUG(0, "sedlbauer_release(0x%p)\n", link);···454458 }455459 }456460457457- pcmcia_disable_device(link->handle);461461+ pcmcia_disable_device(link);458462} /* sedlbauer_release */459463460460-static int sedlbauer_suspend(struct pcmcia_device *p_dev)464464+static int sedlbauer_suspend(struct pcmcia_device *link)461465{462462- dev_link_t *link = dev_to_instance(p_dev);463466 local_info_t *dev = link->priv;464467465468 dev->stop = 1;···466471 return 0;467472}468473469469-static int sedlbauer_resume(struct pcmcia_device *p_dev)474474+static int sedlbauer_resume(struct pcmcia_device *link)470475{471471- dev_link_t *link = dev_to_instance(p_dev);472476 local_info_t *dev = link->priv;473477474478 dev->stop = 0;
+24-30
drivers/isdn/hisax/teles_cs.c
···7575 handler.7676*/77777878-static void teles_cs_config(dev_link_t *link);7979-static void teles_cs_release(dev_link_t *link);7878+static void teles_cs_config(struct pcmcia_device *link);7979+static void teles_cs_release(struct pcmcia_device *link);80808181/*8282 The attach() and detach() entry points are used to create and destroy···8989/*9090 A linked list of "instances" of the teles_cs device. Each actual9191 PCMCIA card corresponds to one device instance, and is described9292- by one dev_link_t structure (defined in ds.h).9292+ by one struct pcmcia_device structure (defined in ds.h).93939494 You may not want to use a linked list for this -- for example, the9595- memory card driver uses an array of dev_link_t pointers, where minor9595+ memory card driver uses an array of struct pcmcia_device pointers, where minor9696 device numbers are used to derive the corresponding array index.9797*/9898···102102 example, ethernet cards, modems). In other cases, there may be103103 many actual or logical devices (SCSI adapters, memory cards with104104 multiple partitions). The dev_node_t structures need to be kept105105- in a linked list starting at the 'dev' field of a dev_link_t105105+ in a linked list starting at the 'dev' field of a struct pcmcia_device106106 structure. We allocate them in the card's private data structure,107107 because they generally shouldn't be allocated dynamically.108108 In this case, we also provide a flag to indicate if a device is···130130131131======================================================================*/132132133133-static int teles_attach(struct pcmcia_device *p_dev)133133+static int teles_attach(struct pcmcia_device *link)134134{135135 local_info_t *local;136136- dev_link_t *link = dev_to_instance(p_dev);137136138137 DEBUG(0, "teles_attach()\n");139138···142143 memset(local, 0, sizeof(local_info_t));143144 local->cardnr = -1;144145145145- local->p_dev = p_dev;146146+ local->p_dev = link;146147 link->priv = local;147148148149 /* Interrupt setup */···179180180181======================================================================*/181182182182-static void teles_detach(struct pcmcia_device *p_dev)183183+static void teles_detach(struct pcmcia_device *link)183184{184184- dev_link_t *link = dev_to_instance(p_dev);185185 local_info_t *info = link->priv;186186187187 DEBUG(0, "teles_detach(0x%p)\n", link);···201203 device available to the system.202204203205======================================================================*/204204-static int get_tuple(client_handle_t handle, tuple_t *tuple,206206+static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple,205207 cisparse_t *parse)206208{207209 int i = pcmcia_get_tuple_data(handle, tuple);···209211 return pcmcia_parse_tuple(handle, tuple, parse);210212}211213212212-static int first_tuple(client_handle_t handle, tuple_t *tuple,214214+static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,213215 cisparse_t *parse)214216{215217 int i = pcmcia_get_first_tuple(handle, tuple);···217219 return get_tuple(handle, tuple, parse);218220}219221220220-static int next_tuple(client_handle_t handle, tuple_t *tuple,222222+static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,221223 cisparse_t *parse)222224{223225 int i = pcmcia_get_next_tuple(handle, tuple);···225227 return get_tuple(handle, tuple, parse);226228}227229228228-static void teles_cs_config(dev_link_t *link)230230+static void teles_cs_config(struct pcmcia_device *link)229231{230230- client_handle_t handle;231232 tuple_t tuple;232233 cisparse_t parse;233234 local_info_t *dev;···236239 IsdnCard_t icard;237240238241 DEBUG(0, "teles_config(0x%p)\n", link);239239- handle = link->handle;240242 dev = link->priv;241243242244 /*···247251 tuple.TupleDataMax = 255;248252 tuple.TupleOffset = 0;249253 tuple.Attributes = 0;250250- i = first_tuple(handle, &tuple, &parse);254254+ i = first_tuple(link, &tuple, &parse);251255 if (i != CS_SUCCESS) {252256 last_fn = ParseTuple;253257 goto cs_failed;···262266 tuple.TupleOffset = 0; tuple.TupleDataMax = 255;263267 tuple.Attributes = 0;264268 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;265265- i = first_tuple(handle, &tuple, &parse);269269+ i = first_tuple(link, &tuple, &parse);266270 while (i == CS_SUCCESS) {267271 if ( (cf->io.nwin > 0) && cf->io.win[0].base) {268272 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");269273 link->conf.ConfigIndex = cf->index;270274 link->io.BasePort1 = cf->io.win[0].base;271271- i = pcmcia_request_io(link->handle, &link->io);275275+ i = pcmcia_request_io(link, &link->io);272276 if (i == CS_SUCCESS) break;273277 } else {274278 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");275279 link->conf.ConfigIndex = cf->index;276280 for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) {277281 link->io.BasePort1 = j;278278- i = pcmcia_request_io(link->handle, &link->io);282282+ i = pcmcia_request_io(link, &link->io);279283 if (i == CS_SUCCESS) break;280284 }281285 break;282286 }283283- i = next_tuple(handle, &tuple, &parse);287287+ i = next_tuple(link, &tuple, &parse);284288 }285289286290 if (i != CS_SUCCESS) {···288292 goto cs_failed;289293 }290294291291- i = pcmcia_request_irq(link->handle, &link->irq);295295+ i = pcmcia_request_irq(link, &link->irq);292296 if (i != CS_SUCCESS) {293297 link->irq.AssignedIRQ = 0;294298 last_fn = RequestIRQ;295299 goto cs_failed;296300 }297301298298- i = pcmcia_request_configuration(link->handle, &link->conf);302302+ i = pcmcia_request_configuration(link, &link->conf);299303 if (i != CS_SUCCESS) {300304 last_fn = RequestConfiguration;301305 goto cs_failed;···338342339343 return;340344cs_failed:341341- cs_error(link->handle, last_fn, i);345345+ cs_error(link, last_fn, i);342346 teles_cs_release(link);343347} /* teles_cs_config */344348···350354351355======================================================================*/352356353353-static void teles_cs_release(dev_link_t *link)357357+static void teles_cs_release(struct pcmcia_device *link)354358{355359 local_info_t *local = link->priv;356360···363367 }364368 }365369366366- pcmcia_disable_device(link->handle);370370+ pcmcia_disable_device(link);367371} /* teles_cs_release */368372369369-static int teles_suspend(struct pcmcia_device *p_dev)373373+static int teles_suspend(struct pcmcia_device *link)370374{371371- dev_link_t *link = dev_to_instance(p_dev);372375 local_info_t *dev = link->priv;373376374377 dev->busy = 1;···375380 return 0;376381}377382378378-static int teles_resume(struct pcmcia_device *p_dev)383383+static int teles_resume(struct pcmcia_device *link)379384{380380- dev_link_t *link = dev_to_instance(p_dev);381385 local_info_t *dev = link->priv;382386383387 dev->busy = 0;
···279279/*====================================================================*/280280281281static void smc91c92_detach(struct pcmcia_device *p_dev);282282-static void smc91c92_config(dev_link_t *link);283283-static void smc91c92_release(dev_link_t *link);282282+static void smc91c92_config(struct pcmcia_device *link);283283+static void smc91c92_release(struct pcmcia_device *link);284284285285static int smc_open(struct net_device *dev);286286static int smc_close(struct net_device *dev);···309309310310======================================================================*/311311312312-static int smc91c92_attach(struct pcmcia_device *p_dev)312312+static int smc91c92_attach(struct pcmcia_device *link)313313{314314 struct smc_private *smc;315315 struct net_device *dev;316316- dev_link_t *link = dev_to_instance(p_dev);317316318317 DEBUG(0, "smc91c92_attach()\n");319318···321322 if (!dev)322323 return -ENOMEM;323324 smc = netdev_priv(dev);324324- smc->p_dev = p_dev;325325+ smc->p_dev = link;325326 link->priv = dev;326327327328 spin_lock_init(&smc->lock);···371372372373======================================================================*/373374374374-static void smc91c92_detach(struct pcmcia_device *p_dev)375375+static void smc91c92_detach(struct pcmcia_device *link)375376{376376- dev_link_t *link = dev_to_instance(p_dev);377377 struct net_device *dev = link->priv;378378379379 DEBUG(0, "smc91c92_detach(0x%p)\n", link);···409411410412/*====================================================================*/411413412412-static int first_tuple(client_handle_t handle, tuple_t *tuple,414414+static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,413415 cisparse_t *parse)414416{415417 int i;···420422 return pcmcia_parse_tuple(handle, tuple, parse);421423}422424423423-static int next_tuple(client_handle_t handle, tuple_t *tuple,425425+static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,424426 cisparse_t *parse)425427{426428 int i;···442444443445======================================================================*/444446445445-static int mhz_3288_power(dev_link_t *link)447447+static int mhz_3288_power(struct pcmcia_device *link)446448{447449 struct net_device *dev = link->priv;448450 struct smc_private *smc = netdev_priv(dev);···464466 return 0;465467}466468467467-static int mhz_mfc_config(dev_link_t *link)469469+static int mhz_mfc_config(struct pcmcia_device *link)468470{469471 struct net_device *dev = link->priv;470472 struct smc_private *smc = netdev_priv(dev);···499501 tuple->TupleDataMax = 255;500502 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;501503502502- i = first_tuple(link->handle, tuple, parse);504504+ i = first_tuple(link, tuple, parse);503505 /* The Megahertz combo cards have modem-like CIS entries, so504506 we have to explicitly try a bunch of port combinations. */505507 while (i == CS_SUCCESS) {···508510 for (k = 0; k < 0x400; k += 0x10) {509511 if (k & 0x80) continue;510512 link->io.BasePort1 = k ^ 0x300;511511- i = pcmcia_request_io(link->handle, &link->io);513513+ i = pcmcia_request_io(link, &link->io);512514 if (i == CS_SUCCESS) break;513515 }514516 if (i == CS_SUCCESS) break;515515- i = next_tuple(link->handle, tuple, parse);517517+ i = next_tuple(link, tuple, parse);516518 }517519 if (i != CS_SUCCESS)518520 goto free_cfg_mem;···522524 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;523525 req.Base = req.Size = 0;524526 req.AccessSpeed = 0;525525- i = pcmcia_request_window(&link->handle, &req, &link->win);527527+ i = pcmcia_request_window(&link, &req, &link->win);526528 if (i != CS_SUCCESS)527529 goto free_cfg_mem;528530 smc->base = ioremap(req.Base, req.Size);···541543 return i;542544}543545544544-static int mhz_setup(dev_link_t *link)546546+static int mhz_setup(struct pcmcia_device *link)545547{546546- client_handle_t handle = link->handle;547548 struct net_device *dev = link->priv;548549 struct smc_cfg_mem *cfg_mem;549550 tuple_t *tuple;···565568 /* Read the station address from the CIS. It is stored as the last566569 (fourth) string in the Version 1 Version/ID tuple. */567570 tuple->DesiredTuple = CISTPL_VERS_1;568568- if (first_tuple(handle, tuple, parse) != CS_SUCCESS) {571571+ if (first_tuple(link, tuple, parse) != CS_SUCCESS) {569572 rc = -1;570573 goto free_cfg_mem;571574 }572575 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */573573- if (next_tuple(handle, tuple, parse) != CS_SUCCESS)574574- first_tuple(handle, tuple, parse);576576+ if (next_tuple(link, tuple, parse) != CS_SUCCESS)577577+ first_tuple(link, tuple, parse);575578 if (parse->version_1.ns > 3) {576579 station_addr = parse->version_1.str + parse->version_1.ofs[3];577580 if (cvt_ascii_address(dev, station_addr) == 0) {···582585583586 /* Another possibility: for the EM3288, in a special tuple */584587 tuple->DesiredTuple = 0x81;585585- if (pcmcia_get_first_tuple(handle, tuple) != CS_SUCCESS) {588588+ if (pcmcia_get_first_tuple(link, tuple) != CS_SUCCESS) {586589 rc = -1;587590 goto free_cfg_mem;588591 }589589- if (pcmcia_get_tuple_data(handle, tuple) != CS_SUCCESS) {592592+ if (pcmcia_get_tuple_data(link, tuple) != CS_SUCCESS) {590593 rc = -1;591594 goto free_cfg_mem;592595 }···610613611614======================================================================*/612615613613-static void mot_config(dev_link_t *link)616616+static void mot_config(struct pcmcia_device *link)614617{615618 struct net_device *dev = link->priv;616619 struct smc_private *smc = netdev_priv(dev);···631634 mdelay(100);632635}633636634634-static int mot_setup(dev_link_t *link)637637+static int mot_setup(struct pcmcia_device *link)635638{636639 struct net_device *dev = link->priv;637640 kio_addr_t ioaddr = dev->base_addr;···665668666669/*====================================================================*/667670668668-static int smc_config(dev_link_t *link)671671+static int smc_config(struct pcmcia_device *link)669672{670673 struct net_device *dev = link->priv;671674 struct smc_cfg_mem *cfg_mem;···690693 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;691694692695 link->io.NumPorts1 = 16;693693- i = first_tuple(link->handle, tuple, parse);696696+ i = first_tuple(link, tuple, parse);694697 while (i != CS_NO_MORE_ITEMS) {695698 if (i == CS_SUCCESS) {696699 link->conf.ConfigIndex = cf->index;697700 link->io.BasePort1 = cf->io.win[0].base;698701 link->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;699699- i = pcmcia_request_io(link->handle, &link->io);702702+ i = pcmcia_request_io(link, &link->io);700703 if (i == CS_SUCCESS) break;701704 }702702- i = next_tuple(link->handle, tuple, parse);705705+ i = next_tuple(link, tuple, parse);703706 }704707 if (i == CS_SUCCESS)705708 dev->base_addr = link->io.BasePort1;···708711 return i;709712}710713711711-static int smc_setup(dev_link_t *link)714714+static int smc_setup(struct pcmcia_device *link)712715{713713- client_handle_t handle = link->handle;714716 struct net_device *dev = link->priv;715717 struct smc_cfg_mem *cfg_mem;716718 tuple_t *tuple;···732736733737 /* Check for a LAN function extension tuple */734738 tuple->DesiredTuple = CISTPL_FUNCE;735735- i = first_tuple(handle, tuple, parse);739739+ i = first_tuple(link, tuple, parse);736740 while (i == CS_SUCCESS) {737741 if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID)738742 break;739739- i = next_tuple(handle, tuple, parse);743743+ i = next_tuple(link, tuple, parse);740744 }741745 if (i == CS_SUCCESS) {742746 node_id = (cistpl_lan_node_id_t *)parse->funce.data;···749753 }750754 /* Try the third string in the Version 1 Version/ID tuple. */751755 tuple->DesiredTuple = CISTPL_VERS_1;752752- if (first_tuple(handle, tuple, parse) != CS_SUCCESS) {756756+ if (first_tuple(link, tuple, parse) != CS_SUCCESS) {753757 rc = -1;754758 goto free_cfg_mem;755759 }···767771768772/*====================================================================*/769773770770-static int osi_config(dev_link_t *link)774774+static int osi_config(struct pcmcia_device *link)771775{772776 struct net_device *dev = link->priv;773777 static const kio_addr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };···787791788792 for (i = j = 0; j < 4; j++) {789793 link->io.BasePort2 = com[j];790790- i = pcmcia_request_io(link->handle, &link->io);794794+ i = pcmcia_request_io(link, &link->io);791795 if (i == CS_SUCCESS) break;792796 }793797 if (i != CS_SUCCESS) {794798 /* Fallback: turn off hard decode */795799 link->conf.ConfigIndex = 0x03;796800 link->io.NumPorts2 = 0;797797- i = pcmcia_request_io(link->handle, &link->io);801801+ i = pcmcia_request_io(link, &link->io);798802 }799803 dev->base_addr = link->io.BasePort1 + 0x10;800804 return i;801805}802806803803-static int osi_setup(dev_link_t *link, u_short manfid, u_short cardid)807807+static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)804808{805805- client_handle_t handle = link->handle;806809 struct net_device *dev = link->priv;807810 struct smc_cfg_mem *cfg_mem;808811 tuple_t *tuple;···822827823828 /* Read the station address from tuple 0x90, subtuple 0x04 */824829 tuple->DesiredTuple = 0x90;825825- i = pcmcia_get_first_tuple(handle, tuple);830830+ i = pcmcia_get_first_tuple(link, tuple);826831 while (i == CS_SUCCESS) {827827- i = pcmcia_get_tuple_data(handle, tuple);832832+ i = pcmcia_get_tuple_data(link, tuple);828833 if ((i != CS_SUCCESS) || (buf[0] == 0x04))829834 break;830830- i = pcmcia_get_next_tuple(handle, tuple);835835+ i = pcmcia_get_next_tuple(link, tuple);831836 }832837 if (i != CS_SUCCESS) {833838 rc = -1;···860865 return rc;861866}862867863863-static int smc91c92_suspend(struct pcmcia_device *p_dev)868868+static int smc91c92_suspend(struct pcmcia_device *link)864869{865865- dev_link_t *link = dev_to_instance(p_dev);866870 struct net_device *dev = link->priv;867871868872 if ((link->state & DEV_CONFIG) && (link->open))···870876 return 0;871877}872878873873-static int smc91c92_resume(struct pcmcia_device *p_dev)879879+static int smc91c92_resume(struct pcmcia_device *link)874880{875875- dev_link_t *link = dev_to_instance(p_dev);876881 struct net_device *dev = link->priv;877882 struct smc_private *smc = netdev_priv(dev);878883 int i;···915922916923======================================================================*/917924918918-static int check_sig(dev_link_t *link)925925+static int check_sig(struct pcmcia_device *link)919926{920927 struct net_device *dev = link->priv;921928 kio_addr_t ioaddr = dev->base_addr;···953960 };954961 printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");955962956956- smc91c92_suspend(link->handle);957957- pcmcia_modify_configuration(link->handle, &mod);958958- smc91c92_resume(link->handle);963963+ smc91c92_suspend(link);964964+ pcmcia_modify_configuration(link, &mod);965965+ smc91c92_resume(link);959966 return check_sig(link);960967 }961968 return -ENODEV;···970977======================================================================*/971978972979#define CS_EXIT_TEST(ret, svc, label) \973973-if (ret != CS_SUCCESS) { cs_error(link->handle, svc, ret); goto label; }980980+if (ret != CS_SUCCESS) { cs_error(link, svc, ret); goto label; }974981975975-static void smc91c92_config(dev_link_t *link)982982+static void smc91c92_config(struct pcmcia_device *link)976983{977977- client_handle_t handle = link->handle;978984 struct net_device *dev = link->priv;979985 struct smc_private *smc = netdev_priv(dev);980986 struct smc_cfg_mem *cfg_mem;···10001008 tuple->TupleDataMax = 64;1001100910021010 tuple->DesiredTuple = CISTPL_CONFIG;10031003- i = first_tuple(handle, tuple, parse);10111011+ i = first_tuple(link, tuple, parse);10041012 CS_EXIT_TEST(i, ParseTuple, config_failed);10051013 link->conf.ConfigBase = parse->config.base;10061014 link->conf.Present = parse->config.rmask[0];1007101510081016 tuple->DesiredTuple = CISTPL_MANFID;10091017 tuple->Attributes = TUPLE_RETURN_COMMON;10101010- if (first_tuple(handle, tuple, parse) == CS_SUCCESS) {10181018+ if (first_tuple(link, tuple, parse) == CS_SUCCESS) {10111019 smc->manfid = parse->manfid.manf;10121020 smc->cardid = parse->manfid.card;10131021 }···10281036 }10291037 CS_EXIT_TEST(i, RequestIO, config_failed);1030103810311031- i = pcmcia_request_irq(link->handle, &link->irq);10391039+ i = pcmcia_request_irq(link, &link->irq);10321040 CS_EXIT_TEST(i, RequestIRQ, config_failed);10331033- i = pcmcia_request_configuration(link->handle, &link->conf);10411041+ i = pcmcia_request_configuration(link, &link->conf);10341042 CS_EXIT_TEST(i, RequestConfiguration, config_failed);1035104310361044 if (smc->manfid == MANFID_MOTOROLA)···1111111911121120 link->dev_node = &smc->node;11131121 link->state &= ~DEV_CONFIG_PENDING;11141114- SET_NETDEV_DEV(dev, &handle_to_dev(handle));11221122+ SET_NETDEV_DEV(dev, &handle_to_dev(link));1115112311161124 if (register_netdev(dev) != 0) {11171125 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");···1164117211651173======================================================================*/1166117411671167-static void smc91c92_release(dev_link_t *link)11751175+static void smc91c92_release(struct pcmcia_device *link)11681176{11691177 DEBUG(0, "smc91c92_release(0x%p)\n", link);11701178 if (link->win) {···11721180 struct smc_private *smc = netdev_priv(dev);11731181 iounmap(smc->base);11741182 }11751175- pcmcia_disable_device(link->handle);11831183+ pcmcia_disable_device(link);11761184}1177118511781186/*======================================================================···12611269static int smc_open(struct net_device *dev)12621270{12631271 struct smc_private *smc = netdev_priv(dev);12641264- dev_link_t *link = smc->p_dev;12721272+ struct pcmcia_device *link = smc->p_dev;1265127312661274#ifdef PCMCIA_DEBUG12671275 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n",···12981306static int smc_close(struct net_device *dev)12991307{13001308 struct smc_private *smc = netdev_priv(dev);13011301- dev_link_t *link = smc->p_dev;13091309+ struct pcmcia_device *link = smc->p_dev;13021310 kio_addr_t ioaddr = dev->base_addr;1303131113041312 DEBUG(0, "%s: smc_close(), status %4.4x.\n",
+51-57
drivers/net/pcmcia/xirc2ps_cs.c
···289289 * and ejection events. They are invoked from the event handler.290290 */291291292292-static int has_ce2_string(dev_link_t * link);293293-static void xirc2ps_config(dev_link_t * link);294294-static void xirc2ps_release(dev_link_t * link);292292+static int has_ce2_string(struct pcmcia_device * link);293293+static void xirc2ps_config(struct pcmcia_device * link);294294+static void xirc2ps_release(struct pcmcia_device * link);295295296296/****************297297 * The attach() and detach() entry points are used to create and destroy···313313/****************314314 * A linked list of "instances" of the device. Each actual315315 * PCMCIA card corresponds to one device instance, and is described316316- * by one dev_link_t structure (defined in ds.h).316316+ * by one struct pcmcia_device structure (defined in ds.h).317317 *318318 * You may not want to use a linked list for this -- for example, the319319- * memory card driver uses an array of dev_link_t pointers, where minor319319+ * memory card driver uses an array of struct pcmcia_device pointers, where minor320320 * device numbers are used to derive the corresponding array index.321321 */322322···326326 * example, ethernet cards, modems). In other cases, there may be327327 * many actual or logical devices (SCSI adapters, memory cards with328328 * multiple partitions). The dev_node_t structures need to be kept329329- * in a linked list starting at the 'dev' field of a dev_link_t329329+ * in a linked list starting at the 'dev' field of a struct pcmcia_device330330 * structure. We allocate them in the card's private data structure,331331 * because they generally can't be allocated dynamically.332332 */···355355static struct net_device_stats *do_get_stats(struct net_device *dev);356356static void set_addresses(struct net_device *dev);357357static void set_multicast_list(struct net_device *dev);358358-static int set_card_type(dev_link_t *link, const void *s);358358+static int set_card_type(struct pcmcia_device *link, const void *s);359359static int do_config(struct net_device *dev, struct ifmap *map);360360static int do_open(struct net_device *dev);361361static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);···368368369369/*=============== Helper functions =========================*/370370static int371371-first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)371371+first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)372372{373373 int err;374374···379379}380380381381static int382382-next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)382382+next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)383383{384384 int err;385385···553553 */554554555555static int556556-xirc2ps_attach(struct pcmcia_device *p_dev)556556+xirc2ps_attach(struct pcmcia_device *link)557557{558558 struct net_device *dev;559559 local_info_t *local;560560- dev_link_t *link = dev_to_instance(p_dev);561560562561 DEBUG(0, "attach()\n");563562···565566 if (!dev)566567 return -ENOMEM;567568 local = netdev_priv(dev);568568- local->p_dev = p_dev;569569+ local->p_dev = link;569570 link->priv = dev;570571571572 /* General socket configuration */···605606 */606607607608static void608608-xirc2ps_detach(struct pcmcia_device *p_dev)609609+xirc2ps_detach(struct pcmcia_device *link)609610{610610- dev_link_t *link = dev_to_instance(p_dev);611611 struct net_device *dev = link->priv;612612613613 DEBUG(0, "detach(0x%p)\n", link);···639641 *640642 */641643static int642642-set_card_type(dev_link_t *link, const void *s)644644+set_card_type(struct pcmcia_device *link, const void *s)643645{644646 struct net_device *dev = link->priv;645647 local_info_t *local = netdev_priv(dev);···708710 * Returns: true if this is a CE2709711 */710712static int711711-has_ce2_string(dev_link_t * link)713713+has_ce2_string(struct pcmcia_device * link)712714{713713- client_handle_t handle = link->handle;714715 tuple_t tuple;715716 cisparse_t parse;716717 u_char buf[256];···719722 tuple.TupleDataMax = 254;720723 tuple.TupleOffset = 0;721724 tuple.DesiredTuple = CISTPL_VERS_1;722722- if (!first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 2) {725725+ if (!first_tuple(link, &tuple, &parse) && parse.version_1.ns > 2) {723726 if (strstr(parse.version_1.str + parse.version_1.ofs[2], "CE2"))724727 return 1;725728 }···732735 * ethernet device available to the system.733736 */734737static void735735-xirc2ps_config(dev_link_t * link)738738+xirc2ps_config(struct pcmcia_device * link)736739{737737- client_handle_t handle = link->handle;738740 struct net_device *dev = link->priv;739741 local_info_t *local = netdev_priv(dev);740742 tuple_t tuple;···759763760764 /* Is this a valid card */761765 tuple.DesiredTuple = CISTPL_MANFID;762762- if ((err=first_tuple(handle, &tuple, &parse))) {766766+ if ((err=first_tuple(link, &tuple, &parse))) {763767 printk(KNOT_XIRC "manfid not found in CIS\n");764768 goto failure;765769 }···795799796800 /* get configuration stuff */797801 tuple.DesiredTuple = CISTPL_CONFIG;798798- if ((err=first_tuple(handle, &tuple, &parse)))802802+ if ((err=first_tuple(link, &tuple, &parse)))799803 goto cis_error;800804 link->conf.ConfigBase = parse.config.base;801805 link->conf.Present = parse.config.rmask[0];802806803807 /* get the ethernet address from the CIS */804808 tuple.DesiredTuple = CISTPL_FUNCE;805805- for (err = first_tuple(handle, &tuple, &parse); !err;806806- err = next_tuple(handle, &tuple, &parse)) {809809+ for (err = first_tuple(link, &tuple, &parse); !err;810810+ err = next_tuple(link, &tuple, &parse)) {807811 /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries:808812 * the first one with a length of zero the second correct -809813 * so I skip all entries with length 0 */···813817 }814818 if (err) { /* not found: try to get the node-id from tuple 0x89 */815819 tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */816816- if ((err = pcmcia_get_first_tuple(handle, &tuple)) == 0 &&817817- (err = pcmcia_get_tuple_data(handle, &tuple)) == 0) {820820+ if ((err = pcmcia_get_first_tuple(link, &tuple)) == 0 &&821821+ (err = pcmcia_get_tuple_data(link, &tuple)) == 0) {818822 if (tuple.TupleDataLen == 8 && *buf == CISTPL_FUNCE_LAN_NODE_ID)819823 memcpy(&parse, buf, 8);820824 else···823827 }824828 if (err) { /* another try (James Lehmer's CE2 version 4.1)*/825829 tuple.DesiredTuple = CISTPL_FUNCE;826826- for (err = first_tuple(handle, &tuple, &parse); !err;827827- err = next_tuple(handle, &tuple, &parse)) {830830+ for (err = first_tuple(link, &tuple, &parse); !err;831831+ err = next_tuple(link, &tuple, &parse)) {828832 if (parse.funce.type == 0x02 && parse.funce.data[0] == 1829833 && parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) {830834 buf[1] = 4;···867871 * Ethernet port */868872 link->io.NumPorts1 = 16; /* no Mako stuff anymore */869873 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;870870- for (err = first_tuple(handle, &tuple, &parse); !err;871871- err = next_tuple(handle, &tuple, &parse)) {874874+ for (err = first_tuple(link, &tuple, &parse); !err;875875+ err = next_tuple(link, &tuple, &parse)) {872876 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8) {873877 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {874878 link->conf.ConfigIndex = cf->index ;875879 link->io.BasePort2 = cf->io.win[0].base;876880 link->io.BasePort1 = ioaddr;877877- if (!(err=pcmcia_request_io(link->handle, &link->io)))881881+ if (!(err=pcmcia_request_io(link, &link->io)))878882 goto port_found;879883 }880884 }···888892 */889893 for (pass=0; pass < 2; pass++) {890894 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;891891- for (err = first_tuple(handle, &tuple, &parse); !err;892892- err = next_tuple(handle, &tuple, &parse)){895895+ for (err = first_tuple(link, &tuple, &parse); !err;896896+ err = next_tuple(link, &tuple, &parse)){893897 if (cf->io.nwin > 0 && (cf->io.win[0].base & 0xf) == 8){894898 link->conf.ConfigIndex = cf->index ;895899 link->io.BasePort2 = cf->io.win[0].base;896900 link->io.BasePort1 = link->io.BasePort2897901 + (pass ? (cf->index & 0x20 ? -24:8)898902 : (cf->index & 0x20 ? 8:-24));899899- if (!(err=pcmcia_request_io(link->handle, &link->io)))903903+ if (!(err=pcmcia_request_io(link, &link->io)))900904 goto port_found;901905 }902906 }···911915 link->io.NumPorts1 = 16;912916 for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) {913917 link->io.BasePort1 = ioaddr;914914- if (!(err=pcmcia_request_io(link->handle, &link->io)))918918+ if (!(err=pcmcia_request_io(link, &link->io)))915919 goto port_found;916920 }917921 link->io.BasePort1 = 0; /* let CS decide */918918- if ((err=pcmcia_request_io(link->handle, &link->io))) {919919- cs_error(link->handle, RequestIO, err);922922+ if ((err=pcmcia_request_io(link, &link->io))) {923923+ cs_error(link, RequestIO, err);920924 goto config_error;921925 }922926 }···928932 * Now allocate an interrupt line. Note that this does not929933 * actually assign a handler to the interrupt.930934 */931931- if ((err=pcmcia_request_irq(link->handle, &link->irq))) {932932- cs_error(link->handle, RequestIRQ, err);935935+ if ((err=pcmcia_request_irq(link, &link->irq))) {936936+ cs_error(link, RequestIRQ, err);933937 goto config_error;934938 }935939···937941 * This actually configures the PCMCIA socket -- setting up938942 * the I/O windows and the interrupt mapping.939943 */940940- if ((err=pcmcia_request_configuration(link->handle, &link->conf))) {941941- cs_error(link->handle, RequestConfiguration, err);944944+ if ((err=pcmcia_request_configuration(link, &link->conf))) {945945+ cs_error(link, RequestConfiguration, err);942946 goto config_error;943947 }944948···955959 reg.Action = CS_WRITE;956960 reg.Offset = CISREG_IOBASE_0;957961 reg.Value = link->io.BasePort2 & 0xff;958958- if ((err = pcmcia_access_configuration_register(link->handle, ®))) {959959- cs_error(link->handle, AccessConfigurationRegister, err);962962+ if ((err = pcmcia_access_configuration_register(link, ®))) {963963+ cs_error(link, AccessConfigurationRegister, err);960964 goto config_error;961965 }962966 reg.Action = CS_WRITE;963967 reg.Offset = CISREG_IOBASE_1;964968 reg.Value = (link->io.BasePort2 >> 8) & 0xff;965965- if ((err = pcmcia_access_configuration_register(link->handle, ®))) {966966- cs_error(link->handle, AccessConfigurationRegister, err);969969+ if ((err = pcmcia_access_configuration_register(link, ®))) {970970+ cs_error(link, AccessConfigurationRegister, err);967971 goto config_error;968972 }969973···974978 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;975979 req.Base = req.Size = 0;976980 req.AccessSpeed = 0;977977- if ((err = pcmcia_request_window(&link->handle, &req, &link->win))) {978978- cs_error(link->handle, RequestWindow, err);981981+ if ((err = pcmcia_request_window(&link, &req, &link->win))) {982982+ cs_error(link, RequestWindow, err);979983 goto config_error;980984 }981985 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;982986 mem.CardOffset = 0x0;983987 mem.Page = 0;984988 if ((err = pcmcia_map_mem_page(link->win, &mem))) {985985- cs_error(link->handle, MapMemPage, err);989989+ cs_error(link, MapMemPage, err);986990 goto config_error;987991 }988992···1044104810451049 link->dev_node = &local->node;10461050 link->state &= ~DEV_CONFIG_PENDING;10471047- SET_NETDEV_DEV(dev, &handle_to_dev(handle));10511051+ SET_NETDEV_DEV(dev, &handle_to_dev(link));1048105210491053 if ((err=register_netdev(dev))) {10501054 printk(KNOT_XIRC "register_netdev() failed\n");···10801084 * still open, this will be postponed until it is closed.10811085 */10821086static void10831083-xirc2ps_release(dev_link_t *link)10871087+xirc2ps_release(struct pcmcia_device *link)10841088{10851089 DEBUG(0, "release(0x%p)\n", link);10861090···10901094 if (local->dingo)10911095 iounmap(local->dingo_ccr - 0x0800);10921096 }10931093- pcmcia_disable_device(link->handle);10971097+ pcmcia_disable_device(link);10941098} /* xirc2ps_release */1095109910961100/*====================================================================*/109711011098110210991099-static int xirc2ps_suspend(struct pcmcia_device *p_dev)11031103+static int xirc2ps_suspend(struct pcmcia_device *link)11001104{11011101- dev_link_t *link = dev_to_instance(p_dev);11021105 struct net_device *dev = link->priv;1103110611041107 if ((link->state & DEV_CONFIG) && (link->open)) {···11081113 return 0;11091114}1110111511111111-static int xirc2ps_resume(struct pcmcia_device *p_dev)11161116+static int xirc2ps_resume(struct pcmcia_device *link)11121117{11131113- dev_link_t *link = dev_to_instance(p_dev);11141118 struct net_device *dev = link->priv;1115111911161120 if ((link->state & DEV_CONFIG) && (link->open)) {···15281534do_open(struct net_device *dev)15291535{15301536 local_info_t *lp = netdev_priv(dev);15311531- dev_link_t *link = lp->p_dev;15371537+ struct pcmcia_device *link = lp->p_dev;1532153815331539 DEBUG(0, "do_open(%p)\n", dev);15341540···18581864{18591865 kio_addr_t ioaddr = dev->base_addr;18601866 local_info_t *lp = netdev_priv(dev);18611861- dev_link_t *link = lp->p_dev;18671867+ struct pcmcia_device *link = lp->p_dev;1862186818631869 DEBUG(0, "do_stop(%p)\n", dev);18641870
+26-32
drivers/net/wireless/airo_cs.c
···8080 event handler. 8181*/82828383-static void airo_config(dev_link_t *link);8484-static void airo_release(dev_link_t *link);8383+static void airo_config(struct pcmcia_device *link);8484+static void airo_release(struct pcmcia_device *link);85858686/*8787 The attach() and detach() entry points are used to create and destroy···101101/*102102 A linked list of "instances" of the aironet device. Each actual103103 PCMCIA card corresponds to one device instance, and is described104104- by one dev_link_t structure (defined in ds.h).104104+ by one struct pcmcia_device structure (defined in ds.h).105105106106 You may not want to use a linked list for this -- for example, the107107- memory card driver uses an array of dev_link_t pointers, where minor107107+ memory card driver uses an array of struct pcmcia_device pointers, where minor108108 device numbers are used to derive the corresponding array index.109109*/110110···114114 example, ethernet cards, modems). In other cases, there may be115115 many actual or logical devices (SCSI adapters, memory cards with116116 multiple partitions). The dev_node_t structures need to be kept117117- in a linked list starting at the 'dev' field of a dev_link_t117117+ in a linked list starting at the 'dev' field of a struct pcmcia_device118118 structure. We allocate them in the card's private data structure,119119 because they generally shouldn't be allocated dynamically.120120···185185186186 ======================================================================*/187187188188-static void airo_detach(struct pcmcia_device *p_dev)188188+static void airo_detach(struct pcmcia_device *link)189189{190190- dev_link_t *link = dev_to_instance(p_dev);191191-192190 DEBUG(0, "airo_detach(0x%p)\n", link);193191194192 if (link->state & DEV_CONFIG)···211213#define CS_CHECK(fn, ret) \212214do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)213215214214-static void airo_config(dev_link_t *link)216216+static void airo_config(struct pcmcia_device *link)215217{216216- client_handle_t handle;217218 tuple_t tuple;218219 cisparse_t parse;219220 local_info_t *dev;···220223 u_char buf[64];221224 win_req_t req;222225 memreq_t map;223223-224224- handle = link->handle;226226+225227 dev = link->priv;226228227229 DEBUG(0, "airo_config(0x%p)\n", link);···234238 tuple.TupleData = buf;235239 tuple.TupleDataMax = sizeof(buf);236240 tuple.TupleOffset = 0;237237- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));238238- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));239239- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));241241+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));242242+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));243243+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));240244 link->conf.ConfigBase = parse.config.base;241245 link->conf.Present = parse.config.rmask[0];242246···256260 will only use the CIS to fill in implementation-defined details.257261 */258262 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;259259- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));263263+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));260264 while (1) {261265 cistpl_cftable_entry_t dflt = { 0 };262266 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);263263- if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||264264- pcmcia_parse_tuple(handle, &tuple, &parse) != 0)267267+ if (pcmcia_get_tuple_data(link, &tuple) != 0 ||268268+ pcmcia_parse_tuple(link, &tuple, &parse) != 0)265269 goto next_entry;266270267271 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;···306310 }307311308312 /* This reserves IO space but doesn't actually enable it */309309- if (pcmcia_request_io(link->handle, &link->io) != 0)313313+ if (pcmcia_request_io(link, &link->io) != 0)310314 goto next_entry;311315312316 /*313317 Now set up a common memory window, if needed. There is room314314- in the dev_link_t structure for one memory window handle,318318+ in the struct pcmcia_device structure for one memory window handle,315319 but if the base addresses need to be saved, or if multiple316320 windows are needed, the info should go in the private data317321 structure for this device.···327331 req.Base = mem->win[0].host_addr;328332 req.Size = mem->win[0].len;329333 req.AccessSpeed = 0;330330- if (pcmcia_request_window(&link->handle, &req, &link->win) != 0)334334+ if (pcmcia_request_window(&link, &req, &link->win) != 0)331335 goto next_entry;332336 map.Page = 0; map.CardOffset = mem->win[0].card_addr;333337 if (pcmcia_map_mem_page(link->win, &map) != 0)···337341 break;338342339343 next_entry:340340- CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));344344+ CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));341345 }342346343347 /*···346350 irq structure is initialized.347351 */348352 if (link->conf.Attributes & CONF_ENABLE_IRQ)349349- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));353353+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));350354351355 /*352356 This actually configures the PCMCIA socket -- setting up353357 the I/O windows and the interrupt mapping, and putting the354358 card and host interface into "Memory and IO" mode.355359 */356356- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));360360+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));357361 ((local_info_t*)link->priv)->eth_dev = 358362 init_airo_card( link->irq.AssignedIRQ,359359- link->io.BasePort1, 1, &handle_to_dev(handle) );363363+ link->io.BasePort1, 1, &handle_to_dev(link) );360364 if (!((local_info_t*)link->priv)->eth_dev) goto cs_failed;361365362366 /*···389393 return;390394391395 cs_failed:392392- cs_error(link->handle, last_fn, last_ret);396396+ cs_error(link, last_fn, last_ret);393397 airo_release(link);394398395399} /* airo_config */···402406403407 ======================================================================*/404408405405-static void airo_release(dev_link_t *link)409409+static void airo_release(struct pcmcia_device *link)406410{407411 DEBUG(0, "airo_release(0x%p)\n", link);408408- pcmcia_disable_device(link->handle);412412+ pcmcia_disable_device(link);409413}410414411411-static int airo_suspend(struct pcmcia_device *p_dev)415415+static int airo_suspend(struct pcmcia_device *link)412416{413413- dev_link_t *link = dev_to_instance(p_dev);414417 local_info_t *local = link->priv;415418416419 if (link->state & DEV_CONFIG)···418423 return 0;419424}420425421421-static int airo_resume(struct pcmcia_device *p_dev)426426+static int airo_resume(struct pcmcia_device *link)422427{423423- dev_link_t *link = dev_to_instance(p_dev);424428 local_info_t *local = link->priv;425429426430 if ((link->state & DEV_CONFIG) && (link->open)) {
+25-31
drivers/net/wireless/atmel_cs.c
···9191 event handler. 9292*/93939494-static void atmel_config(dev_link_t *link);9595-static void atmel_release(dev_link_t *link);9494+static void atmel_config(struct pcmcia_device *link);9595+static void atmel_release(struct pcmcia_device *link);96969797/*9898 The attach() and detach() entry points are used to create and destroy···112112/*113113 A linked list of "instances" of the atmelnet device. Each actual114114 PCMCIA card corresponds to one device instance, and is described115115- by one dev_link_t structure (defined in ds.h).115115+ by one struct pcmcia_device structure (defined in ds.h).116116117117 You may not want to use a linked list for this -- for example, the118118- memory card driver uses an array of dev_link_t pointers, where minor118118+ memory card driver uses an array of struct pcmcia_device pointers, where minor119119 device numbers are used to derive the corresponding array index.120120*/121121···125125 example, ethernet cards, modems). In other cases, there may be126126 many actual or logical devices (SCSI adapters, memory cards with127127 multiple partitions). The dev_node_t structures need to be kept128128- in a linked list starting at the 'dev' field of a dev_link_t128128+ in a linked list starting at the 'dev' field of a struct pcmcia_device129129 structure. We allocate them in the card's private data structure,130130 because they generally shouldn't be allocated dynamically.131131···196196197197 ======================================================================*/198198199199-static void atmel_detach(struct pcmcia_device *p_dev)199199+static void atmel_detach(struct pcmcia_device *link)200200{201201- dev_link_t *link = dev_to_instance(p_dev);202202-203201 DEBUG(0, "atmel_detach(0x%p)\n", link);204202205203 if (link->state & DEV_CONFIG)···221223 about the current existance of the card */222224static int card_present(void *arg)223225{ 224224- dev_link_t *link = (dev_link_t *)arg;226226+ struct pcmcia_device *link = (struct pcmcia_device *)arg;225227 if (link->state & DEV_SUSPEND)226228 return 0;227229 else if (link->state & DEV_PRESENT)···230232 return 0;231233}232234233233-static void atmel_config(dev_link_t *link)235235+static void atmel_config(struct pcmcia_device *link)234236{235235- client_handle_t handle;236237 tuple_t tuple;237238 cisparse_t parse;238239 local_info_t *dev;···239242 u_char buf[64];240243 struct pcmcia_device_id *did;241244242242- handle = link->handle;243245 dev = link->priv;244244- did = handle_to_dev(handle).driver_data;246246+ did = handle_to_dev(link).driver_data;245247246248 DEBUG(0, "atmel_config(0x%p)\n", link);247249···254258 registers.255259 */256260 tuple.DesiredTuple = CISTPL_CONFIG;257257- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));258258- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));259259- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));261261+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));262262+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));263263+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));260264 link->conf.ConfigBase = parse.config.base;261265 link->conf.Present = parse.config.rmask[0];262266···276280 will only use the CIS to fill in implementation-defined details.277281 */278282 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;279279- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));283283+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));280284 while (1) {281285 cistpl_cftable_entry_t dflt = { 0 };282286 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);283283- if (pcmcia_get_tuple_data(handle, &tuple) != 0 ||284284- pcmcia_parse_tuple(handle, &tuple, &parse) != 0)287287+ if (pcmcia_get_tuple_data(link, &tuple) != 0 ||288288+ pcmcia_parse_tuple(link, &tuple, &parse) != 0)285289 goto next_entry;286290287291 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;···326330 }327331328332 /* This reserves IO space but doesn't actually enable it */329329- if (pcmcia_request_io(link->handle, &link->io) != 0)333333+ if (pcmcia_request_io(link, &link->io) != 0)330334 goto next_entry;331335332336 /* If we got this far, we're cool! */333337 break;334338335339 next_entry:336336- CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));340340+ CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));337341 }338342339343 /*···342346 irq structure is initialized.343347 */344348 if (link->conf.Attributes & CONF_ENABLE_IRQ)345345- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));349349+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));346350347351 /*348352 This actually configures the PCMCIA socket -- setting up349353 the I/O windows and the interrupt mapping, and putting the350354 card and host interface into "Memory and IO" mode.351355 */352352- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));356356+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));353357354358 if (link->irq.AssignedIRQ == 0) {355359 printk(KERN_ALERT ···361365 init_atmel_card(link->irq.AssignedIRQ,362366 link->io.BasePort1,363367 did ? did->driver_info : ATMEL_FW_TYPE_NONE,364364- &handle_to_dev(handle),368368+ &handle_to_dev(link),365369 card_present, 366370 link);367371 if (!((local_info_t*)link->priv)->eth_dev) ···380384 return;381385382386 cs_failed:383383- cs_error(link->handle, last_fn, last_ret);387387+ cs_error(link, last_fn, last_ret);384388 atmel_release(link);385389}386390···392396393397 ======================================================================*/394398395395-static void atmel_release(dev_link_t *link)399399+static void atmel_release(struct pcmcia_device *link)396400{397401 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;398402···402406 stop_atmel_card(dev);403407 ((local_info_t*)link->priv)->eth_dev = NULL;404408405405- pcmcia_disable_device(link->handle);409409+ pcmcia_disable_device(link);406410}407411408408-static int atmel_suspend(struct pcmcia_device *dev)412412+static int atmel_suspend(struct pcmcia_device *link)409413{410410- dev_link_t *link = dev_to_instance(dev);411414 local_info_t *local = link->priv;412415413416 if (link->state & DEV_CONFIG)···415420 return 0;416421}417422418418-static int atmel_resume(struct pcmcia_device *dev)423423+static int atmel_resume(struct pcmcia_device *link)419424{420420- dev_link_t *link = dev_to_instance(dev);421425 local_info_t *local = link->priv;422426423427 if (link->state & DEV_CONFIG) {
+39-43
drivers/net/wireless/hostap/hostap_cs.c
···4242/* struct local_info::hw_priv */4343struct hostap_cs_priv {4444 dev_node_t node;4545- dev_link_t *link;4545+ struct pcmcia_device *link;4646 int sandisk_connectplus;4747};4848···204204205205static void prism2_detach(struct pcmcia_device *p_dev);206206static void prism2_release(u_long arg);207207-static int prism2_config(dev_link_t *link);207207+static int prism2_config(struct pcmcia_device *link);208208209209210210static int prism2_pccard_card_present(local_info_t *local)···237237 reg.Action = CS_WRITE;238238 reg.Offset = 0x10; /* 0x3f0 IO base 1 */239239 reg.Value = hw_priv->link->io.BasePort1 & 0x00ff;240240- res = pcmcia_access_configuration_register(hw_priv->link->handle,240240+ res = pcmcia_access_configuration_register(hw_priv->link,241241 ®);242242 if (res != CS_SUCCESS) {243243 printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -"···249249 reg.Action = CS_WRITE;250250 reg.Offset = 0x12; /* 0x3f2 IO base 2 */251251 reg.Value = (hw_priv->link->io.BasePort1 & 0xff00) >> 8;252252- res = pcmcia_access_configuration_register(hw_priv->link->handle,252252+ res = pcmcia_access_configuration_register(hw_priv->link,253253 ®);254254 if (res != CS_SUCCESS) {255255 printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -"···301301 tuple.TupleData = buf;302302 tuple.TupleDataMax = sizeof(buf);303303 tuple.TupleOffset = 0;304304- if (pcmcia_get_first_tuple(hw_priv->link->handle, &tuple) ||305305- pcmcia_get_tuple_data(hw_priv->link->handle, &tuple) ||306306- pcmcia_parse_tuple(hw_priv->link->handle, &tuple, parse) ||304304+ if (pcmcia_get_first_tuple(hw_priv->link, &tuple) ||305305+ pcmcia_get_tuple_data(hw_priv->link, &tuple) ||306306+ pcmcia_parse_tuple(hw_priv->link, &tuple, parse) ||307307 parse->manfid.manf != 0xd601 || parse->manfid.card != 0x0101) {308308 /* No SanDisk manfid found */309309 ret = -ENODEV;···311311 }312312313313 tuple.DesiredTuple = CISTPL_LONGLINK_MFC;314314- if (pcmcia_get_first_tuple(hw_priv->link->handle, &tuple) ||315315- pcmcia_get_tuple_data(hw_priv->link->handle, &tuple) ||316316- pcmcia_parse_tuple(hw_priv->link->handle, &tuple, parse) ||314314+ if (pcmcia_get_first_tuple(hw_priv->link, &tuple) ||315315+ pcmcia_get_tuple_data(hw_priv->link, &tuple) ||316316+ pcmcia_parse_tuple(hw_priv->link, &tuple, parse) ||317317 parse->longlink_mfc.nfn < 2) {318318 /* No multi-function links found */319319 ret = -ENODEV;···328328 reg.Action = CS_WRITE;329329 reg.Offset = CISREG_COR;330330 reg.Value = COR_SOFT_RESET;331331- res = pcmcia_access_configuration_register(hw_priv->link->handle,331331+ res = pcmcia_access_configuration_register(hw_priv->link,332332 ®);333333 if (res != CS_SUCCESS) {334334 printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n",···345345 * will be enabled during the first cor_sreset call.346346 */347347 reg.Value = COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE | COR_FUNC_ENA;348348- res = pcmcia_access_configuration_register(hw_priv->link->handle,348348+ res = pcmcia_access_configuration_register(hw_priv->link,349349 ®);350350 if (res != CS_SUCCESS) {351351 printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n",···380380 reg.Action = CS_READ;381381 reg.Offset = CISREG_COR;382382 reg.Value = 0;383383- res = pcmcia_access_configuration_register(hw_priv->link->handle,383383+ res = pcmcia_access_configuration_register(hw_priv->link,384384 ®);385385 if (res != CS_SUCCESS) {386386 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n",···392392393393 reg.Action = CS_WRITE;394394 reg.Value |= COR_SOFT_RESET;395395- res = pcmcia_access_configuration_register(hw_priv->link->handle,395395+ res = pcmcia_access_configuration_register(hw_priv->link,396396 ®);397397 if (res != CS_SUCCESS) {398398 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n",···405405 reg.Value &= ~COR_SOFT_RESET;406406 if (hw_priv->sandisk_connectplus)407407 reg.Value |= COR_IREQ_ENA;408408- res = pcmcia_access_configuration_register(hw_priv->link->handle,408408+ res = pcmcia_access_configuration_register(hw_priv->link,409409 ®);410410 if (res != CS_SUCCESS) {411411 printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n",···439439 reg.Action = CS_READ;440440 reg.Offset = CISREG_COR;441441 reg.Value = 0;442442- res = pcmcia_access_configuration_register(hw_priv->link->handle,442442+ res = pcmcia_access_configuration_register(hw_priv->link,443443 ®);444444 if (res != CS_SUCCESS) {445445 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 "···452452453453 reg.Action = CS_WRITE;454454 reg.Value |= COR_SOFT_RESET;455455- res = pcmcia_access_configuration_register(hw_priv->link->handle,455455+ res = pcmcia_access_configuration_register(hw_priv->link,456456 ®);457457 if (res != CS_SUCCESS) {458458 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 "···466466 reg.Action = CS_WRITE;467467 reg.Value = hcr;468468 reg.Offset = CISREG_CCSR;469469- res = pcmcia_access_configuration_register(hw_priv->link->handle,469469+ res = pcmcia_access_configuration_register(hw_priv->link,470470 ®);471471 if (res != CS_SUCCESS) {472472 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 "···478478 reg.Action = CS_WRITE;479479 reg.Offset = CISREG_COR;480480 reg.Value = old_cor & ~COR_SOFT_RESET;481481- res = pcmcia_access_configuration_register(hw_priv->link->handle,481481+ res = pcmcia_access_configuration_register(hw_priv->link,482482 ®);483483 if (res != CS_SUCCESS) {484484 printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 "···514514}515515516516517517-static void prism2_detach(struct pcmcia_device *p_dev)517517+static void prism2_detach(struct pcmcia_device *link)518518{519519- dev_link_t *link = dev_to_instance(p_dev);520520-521519 PDEBUG(DEBUG_FLOW, "prism2_detach\n");522520523521 if (link->state & DEV_CONFIG) {···543545do { int ret = (retf); \544546if (ret != 0) { \545547 PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", ret); \546546- cs_error(link->handle, fn, ret); \548548+ cs_error(link, fn, ret); \547549 goto next_entry; \548550} \549551} while (0)···551553552554/* run after a CARD_INSERTION event is received to configure the PCMCIA553555 * socket and make the device available to the system */554554-static int prism2_config(dev_link_t *link)556556+static int prism2_config(struct pcmcia_device *link)555557{556558 struct net_device *dev;557559 struct hostap_interface *iface;···580582 tuple.TupleData = buf;581583 tuple.TupleDataMax = sizeof(buf);582584 tuple.TupleOffset = 0;583583- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link->handle, &tuple));584584- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link->handle, &tuple));585585- CS_CHECK(ParseTuple, pcmcia_parse_tuple(link->handle, &tuple, parse));585585+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));586586+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));587587+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));586588 link->conf.ConfigBase = parse->config.base;587589 link->conf.Present = parse->config.rmask[0];588590589591 CS_CHECK(GetConfigurationInfo,590590- pcmcia_get_configuration_info(link->handle, &conf));592592+ pcmcia_get_configuration_info(link, &conf));591593592594 /* Look for an appropriate configuration table entry in the CIS */593595 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;594594- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link->handle, &tuple));596596+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));595597 for (;;) {596598 cistpl_cftable_entry_t *cfg = &(parse->cftable_entry);597599 CFG_CHECK2(GetTupleData,598598- pcmcia_get_tuple_data(link->handle, &tuple));600600+ pcmcia_get_tuple_data(link, &tuple));599601 CFG_CHECK2(ParseTuple,600600- pcmcia_parse_tuple(link->handle, &tuple, parse));602602+ pcmcia_parse_tuple(link, &tuple, parse));601603602604 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)603605 dflt = *cfg;···677679678680 /* This reserves IO space but doesn't actually enable it */679681 CFG_CHECK2(RequestIO,680680- pcmcia_request_io(link->handle, &link->io));682682+ pcmcia_request_io(link, &link->io));681683682684 /* This configuration table entry is OK */683685 break;684686685687 next_entry:686688 CS_CHECK(GetNextTuple,687687- pcmcia_get_next_tuple(link->handle, &tuple));689689+ pcmcia_get_next_tuple(link, &tuple));688690 }689691690692 /* Need to allocate net_device before requesting IRQ handler */691693 dev = prism2_init_local_data(&prism2_pccard_funcs, 0,692692- &handle_to_dev(link->handle));694694+ &handle_to_dev(link));693695 if (dev == NULL)694696 goto failed;695697 link->priv = dev;···712714 link->irq.Handler = prism2_interrupt;713715 link->irq.Instance = dev;714716 CS_CHECK(RequestIRQ,715715- pcmcia_request_irq(link->handle, &link->irq));717717+ pcmcia_request_irq(link, &link->irq));716718 }717719718720 /*···721723 * card and host interface into "Memory and IO" mode.722724 */723725 CS_CHECK(RequestConfiguration,724724- pcmcia_request_configuration(link->handle, &link->conf));726726+ pcmcia_request_configuration(link, &link->conf));725727726728 dev->irq = link->irq.AssignedIRQ;727729 dev->base_addr = link->io.BasePort1;···759761 return ret;760762761763 cs_failed:762762- cs_error(link->handle, last_fn, last_ret);764764+ cs_error(link, last_fn, last_ret);763765764766 failed:765767 kfree(parse);···771773772774static void prism2_release(u_long arg)773775{774774- dev_link_t *link = (dev_link_t *)arg;776776+ struct pcmcia_device *link = (struct pcmcia_device *)arg;775777776778 PDEBUG(DEBUG_FLOW, "prism2_release\n");777779···785787 iface->local->shutdown = 1;786788 }787789788788- pcmcia_disable_device(link->handle);790790+ pcmcia_disable_device(link);789791 PDEBUG(DEBUG_FLOW, "release - done\n");790792}791793792792-static int hostap_cs_suspend(struct pcmcia_device *p_dev)794794+static int hostap_cs_suspend(struct pcmcia_device *link)793795{794794- dev_link_t *link = dev_to_instance(p_dev);795796 struct net_device *dev = (struct net_device *) link->priv;796797 int dev_open = 0;797798···810813 return 0;811814}812815813813-static int hostap_cs_resume(struct pcmcia_device *p_dev)816816+static int hostap_cs_resume(struct pcmcia_device *link)814817{815815- dev_link_t *link = dev_to_instance(p_dev);816818 struct net_device *dev = (struct net_device *) link->priv;817819 int dev_open = 0;818820
+28-33
drivers/net/wireless/netwave_cs.c
···190190/*====================================================================*/191191192192/* PCMCIA (Card Services) related functions */193193-static void netwave_release(dev_link_t *link); /* Card removal */194194-static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card 193193+static void netwave_release(struct pcmcia_device *link); /* Card removal */194194+static void netwave_pcmcia_config(struct pcmcia_device *arg); /* Runs after card195195 insertion */196196static void netwave_detach(struct pcmcia_device *p_dev); /* Destroy instance */197197···221221static void set_multicast_list(struct net_device *dev);222222223223/*224224- A dev_link_t structure has fields for most things that are needed224224+ A struct pcmcia_device structure has fields for most things that are needed225225 to keep track of a socket, but there will usually be some device226226 specific information that also needs to be kept track of. The227227- 'priv' pointer in a dev_link_t structure can be used to point to227227+ 'priv' pointer in a struct pcmcia_device structure can be used to point to228228 a device-specific private data structure, like this.229229230230 A driver needs to provide a dev_node_t structure for each device···232232 example, ethernet cards, modems). In other cases, there may be233233 many actual or logical devices (SCSI adapters, memory cards with234234 multiple partitions). The dev_node_t structures need to be kept235235- in a linked list starting at the 'dev' field of a dev_link_t235235+ in a linked list starting at the 'dev' field of a struct pcmcia_device236236 structure. We allocate them in the card's private data structure,237237 because they generally can't be allocated dynamically.238238*/···376376 * configure the card at this point -- we wait until we receive a377377 * card insertion event.378378 */379379-static int netwave_attach(struct pcmcia_device *p_dev)379379+static int netwave_attach(struct pcmcia_device *link)380380{381381 struct net_device *dev;382382 netwave_private *priv;383383- dev_link_t *link = dev_to_instance(p_dev);384383385384 DEBUG(0, "netwave_attach()\n");386385387387- /* Initialize the dev_link_t structure */386386+ /* Initialize the struct pcmcia_device structure */388387 dev = alloc_etherdev(sizeof(netwave_private));389388 if (!dev)390389 return -ENOMEM;391390 priv = netdev_priv(dev);392392- priv->p_dev = p_dev;391391+ priv->p_dev = link;393392 link->priv = dev;394393395394 /* The io structure describes IO port mapping */···442443 * structures are freed. Otherwise, the structures will be freed443444 * when the device is released.444445 */445445-static void netwave_detach(struct pcmcia_device *p_dev)446446+static void netwave_detach(struct pcmcia_device *link)446447{447447- dev_link_t *link = dev_to_instance(p_dev);448448 struct net_device *dev = link->priv;449449450450 DEBUG(0, "netwave_detach(0x%p)\n", link);···737739#define CS_CHECK(fn, ret) \738740do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)739741740740-static void netwave_pcmcia_config(dev_link_t *link) {741741- client_handle_t handle = link->handle;742742+static void netwave_pcmcia_config(struct pcmcia_device *link) {742743 struct net_device *dev = link->priv;743744 netwave_private *priv = netdev_priv(dev);744745 tuple_t tuple;···759762 tuple.TupleDataMax = 64;760763 tuple.TupleOffset = 0;761764 tuple.DesiredTuple = CISTPL_CONFIG;762762- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));763763- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));764764- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));765765+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));766766+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));767767+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));765768 link->conf.ConfigBase = parse.config.base;766769 link->conf.Present = parse.config.rmask[0];767770···775778 */776779 for (i = j = 0x0; j < 0x400; j += 0x20) {777780 link->io.BasePort1 = j ^ 0x300;778778- i = pcmcia_request_io(link->handle, &link->io);781781+ i = pcmcia_request_io(link, &link->io);779782 if (i == CS_SUCCESS) break;780783 }781784 if (i != CS_SUCCESS) {782782- cs_error(link->handle, RequestIO, i);785785+ cs_error(link, RequestIO, i);783786 goto failed;784787 }785788···787790 * Now allocate an interrupt line. Note that this does not788791 * actually assign a handler to the interrupt.789792 */790790- CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));793793+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));791794792795 /*793796 * This actually configures the PCMCIA socket -- setting up794797 * the I/O windows and the interrupt mapping.795798 */796796- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));799799+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));797800798801 /*799799- * Allocate a 32K memory window. Note that the dev_link_t802802+ * Allocate a 32K memory window. Note that the struct pcmcia_device800803 * structure provides space for one window handle -- if your801804 * device needs several windows, you'll need to keep track of802805 * the handles in your private data structure, dev->priv.···806809 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;807810 req.Base = 0; req.Size = 0x8000;808811 req.AccessSpeed = mem_speed;809809- CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));812812+ CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));810813 mem.CardOffset = 0x20000; mem.Page = 0; 811814 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));812815···816819817820 dev->irq = link->irq.AssignedIRQ;818821 dev->base_addr = link->io.BasePort1;819819- SET_NETDEV_DEV(dev, &handle_to_dev(handle));822822+ SET_NETDEV_DEV(dev, &handle_to_dev(link));820823821824 if (register_netdev(dev) != 0) {822825 printk(KERN_DEBUG "netwave_cs: register_netdev() failed\n");···848851 return;849852850853cs_failed:851851- cs_error(link->handle, last_fn, last_ret);854854+ cs_error(link, last_fn, last_ret);852855failed:853856 netwave_release(link);854857} /* netwave_pcmcia_config */···860863 * device, and release the PCMCIA configuration. If the device is861864 * still open, this will be postponed until it is closed.862865 */863863-static void netwave_release(dev_link_t *link)866866+static void netwave_release(struct pcmcia_device *link)864867{865868 struct net_device *dev = link->priv;866869 netwave_private *priv = netdev_priv(dev);867870868871 DEBUG(0, "netwave_release(0x%p)\n", link);869872870870- pcmcia_disable_device(link->handle);873873+ pcmcia_disable_device(link);871874 if (link->win)872875 iounmap(priv->ramBase);873876}874877875875-static int netwave_suspend(struct pcmcia_device *p_dev)878878+static int netwave_suspend(struct pcmcia_device *link)876879{877877- dev_link_t *link = dev_to_instance(p_dev);878880 struct net_device *dev = link->priv;879881880882 if ((link->state & DEV_CONFIG) && (link->open))···882886 return 0;883887}884888885885-static int netwave_resume(struct pcmcia_device *p_dev)889889+static int netwave_resume(struct pcmcia_device *link)886890{887887- dev_link_t *link = dev_to_instance(p_dev);888891 struct net_device *dev = link->priv;889892890893 if ((link->state & DEV_CONFIG) && (link->open)) {···10951100 u_char __iomem *ramBase;10961101 struct net_device *dev = (struct net_device *)dev_id;10971102 struct netwave_private *priv = netdev_priv(dev);10981098- dev_link_t *link = priv->p_dev;11031103+ struct pcmcia_device *link = priv->p_dev;10991104 int i;1100110511011106 if (!netif_device_present(dev))···1349135413501355static int netwave_open(struct net_device *dev) {13511356 netwave_private *priv = netdev_priv(dev);13521352- dev_link_t *link = priv->p_dev;13571357+ struct pcmcia_device *link = priv->p_dev;1353135813541359 DEBUG(1, "netwave_open: starting.\n");13551360···1366137113671372static int netwave_close(struct net_device *dev) {13681373 netwave_private *priv = netdev_priv(dev);13691369- dev_link_t *link = priv->p_dev;13741374+ struct pcmcia_device *link = priv->p_dev;1370137513711376 DEBUG(1, "netwave_close: finishing.\n");13721377
+27-32
drivers/net/wireless/orinoco_cs.c
···6363/* Function prototypes */6464/********************************************************************/65656666-static void orinoco_cs_config(dev_link_t *link);6767-static void orinoco_cs_release(dev_link_t *link);6666+static void orinoco_cs_config(struct pcmcia_device *link);6767+static void orinoco_cs_release(struct pcmcia_device *link);6868static void orinoco_cs_detach(struct pcmcia_device *p_dev);69697070/********************************************************************/···7575orinoco_cs_hard_reset(struct orinoco_private *priv)7676{7777 struct orinoco_pccard *card = priv->card;7878- dev_link_t *link = card->p_dev;7878+ struct pcmcia_device *link = card->p_dev;7979 int err;80808181 /* We need atomic ops here, because we're not holding the lock */8282 set_bit(0, &card->hard_reset_in_progress);83838484- err = pcmcia_reset_card(link->handle, NULL);8484+ err = pcmcia_reset_card(link, NULL);8585 if (err)8686 return err;8787···104104 * configure the card at this point -- we wait until we receive a card105105 * insertion event. */106106static int107107-orinoco_cs_attach(struct pcmcia_device *p_dev)107107+orinoco_cs_attach(struct pcmcia_device *link)108108{109109 struct net_device *dev;110110 struct orinoco_private *priv;111111 struct orinoco_pccard *card;112112- dev_link_t *link = dev_to_instance(p_dev);113112114113 dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);115114 if (! dev)···117118 card = priv->card;118119119120 /* Link both structures together */120120- card->p_dev = p_dev;121121+ card->p_dev = link;121122 link->priv = dev;122123123124 /* Interrupt setup */···146147 * are freed. Otherwise, the structures will be freed when the device147148 * is released.148149 */149149-static void orinoco_cs_detach(struct pcmcia_device *p_dev)150150+static void orinoco_cs_detach(struct pcmcia_device *link)150151{151151- dev_link_t *link = dev_to_instance(p_dev);152152 struct net_device *dev = link->priv;153153154154 if (link->state & DEV_CONFIG)···173175 } while (0)174176175177static void176176-orinoco_cs_config(dev_link_t *link)178178+orinoco_cs_config(struct pcmcia_device *link)177179{178180 struct net_device *dev = link->priv;179179- client_handle_t handle = link->handle;180181 struct orinoco_private *priv = netdev_priv(dev);181182 struct orinoco_pccard *card = priv->card;182183 hermes_t *hw = &priv->hw;···187190 cisparse_t parse;188191 void __iomem *mem;189192190190- CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info));193193+ CS_CHECK(ValidateCIS, pcmcia_validate_cis(link, &info));191194192195 /*193196 * This reads the card's CONFIG tuple to find its···198201 tuple.TupleData = buf;199202 tuple.TupleDataMax = sizeof(buf);200203 tuple.TupleOffset = 0;201201- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));202202- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));203203- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));204204+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));205205+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));206206+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));204207 link->conf.ConfigBase = parse.config.base;205208 link->conf.Present = parse.config.rmask[0];206209···209212210213 /* Look up the current Vcc */211214 CS_CHECK(GetConfigurationInfo,212212- pcmcia_get_configuration_info(link->handle, &conf));215215+ pcmcia_get_configuration_info(link, &conf));213216214217 /*215218 * In this loop, we scan the CIS for configuration table···226229 * implementation-defined details.227230 */228231 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;229229- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));232232+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));230233 while (1) {231234 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);232235 cistpl_cftable_entry_t dflt = { .index = 0 };233236234234- if ( (pcmcia_get_tuple_data(handle, &tuple) != 0)235235- || (pcmcia_parse_tuple(handle, &tuple, &parse) != 0))237237+ if ( (pcmcia_get_tuple_data(link, &tuple) != 0)238238+ || (pcmcia_parse_tuple(link, &tuple, &parse) != 0))236239 goto next_entry;237240238241 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)···297300 }298301299302 /* This reserves IO space but doesn't actually enable it */300300- if (pcmcia_request_io(link->handle, &link->io) != 0)303303+ if (pcmcia_request_io(link, &link->io) != 0)301304 goto next_entry;302305 }303306···307310 break;308311309312 next_entry:310310- pcmcia_disable_device(handle);311311- last_ret = pcmcia_get_next_tuple(handle, &tuple);313313+ pcmcia_disable_device(link);314314+ last_ret = pcmcia_get_next_tuple(link, &tuple);312315 if (last_ret == CS_NO_MORE_ITEMS) {313316 printk(KERN_ERR PFX "GetNextTuple(): No matching "314317 "CIS configuration. Maybe you need the "···322325 * a handler to the interrupt, unless the 'Handler' member of323326 * the irq structure is initialized.324327 */325325- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));328328+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));326329327330 /* We initialize the hermes structure before completing PCMCIA328331 * configuration just in case the interrupt handler gets···339342 * card and host interface into "Memory and IO" mode.340343 */341344 CS_CHECK(RequestConfiguration,342342- pcmcia_request_configuration(link->handle, &link->conf));345345+ pcmcia_request_configuration(link, &link->conf));343346344347 /* Ok, we have the configuration, prepare to register the netdev */345348 dev->base_addr = link->io.BasePort1;···347350 SET_MODULE_OWNER(dev);348351 card->node.major = card->node.minor = 0;349352350350- SET_NETDEV_DEV(dev, &handle_to_dev(handle));353353+ SET_NETDEV_DEV(dev, &handle_to_dev(link));351354 /* Tell the stack we exist */352355 if (register_netdev(dev) != 0) {353356 printk(KERN_ERR PFX "register_netdev() failed\n");···380383 return;381384382385 cs_failed:383383- cs_error(link->handle, last_fn, last_ret);386386+ cs_error(link, last_fn, last_ret);384387385388 failed:386389 orinoco_cs_release(link);···392395 * still open, this will be postponed until it is closed.393396 */394397static void395395-orinoco_cs_release(dev_link_t *link)398398+orinoco_cs_release(struct pcmcia_device *link)396399{397400 struct net_device *dev = link->priv;398401 struct orinoco_private *priv = netdev_priv(dev);···404407 priv->hw_unavailable++;405408 spin_unlock_irqrestore(&priv->lock, flags);406409407407- pcmcia_disable_device(link->handle);410410+ pcmcia_disable_device(link);408411 if (priv->hw.iobase)409412 ioport_unmap(priv->hw.iobase);410413} /* orinoco_cs_release */411414412412-static int orinoco_cs_suspend(struct pcmcia_device *p_dev)415415+static int orinoco_cs_suspend(struct pcmcia_device *link)413416{414414- dev_link_t *link = dev_to_instance(p_dev);415417 struct net_device *dev = link->priv;416418 struct orinoco_private *priv = netdev_priv(dev);417419 struct orinoco_pccard *card = priv->card;···439443 return 0;440444}441445442442-static int orinoco_cs_resume(struct pcmcia_device *p_dev)446446+static int orinoco_cs_resume(struct pcmcia_device *link)443447{444444- dev_link_t *link = dev_to_instance(p_dev);445448 struct net_device *dev = link->priv;446449 struct orinoco_private *priv = netdev_priv(dev);447450 struct orinoco_pccard *card = priv->card;
+44-48
drivers/net/wireless/ray_cs.c
···9090#define DEBUG(n, args...)9191#endif9292/** Prototypes based on PCMCIA skeleton driver *******************************/9393-static void ray_config(dev_link_t *link);9494-static void ray_release(dev_link_t *link);9393+static void ray_config(struct pcmcia_device *link);9494+static void ray_release(struct pcmcia_device *link);9595static void ray_detach(struct pcmcia_device *p_dev);96969797/***** Prototypes indicated by device structure ******************************/···190190static char *phy_addr = NULL;191191192192193193-/* A dev_link_t structure has fields for most things that are needed193193+/* A struct pcmcia_device structure has fields for most things that are needed194194 to keep track of a socket, but there will usually be some device195195 specific information that also needs to be kept track of. The196196- 'priv' pointer in a dev_link_t structure can be used to point to196196+ 'priv' pointer in a struct pcmcia_device structure can be used to point to197197 a device-specific private data structure, like this.198198*/199199static unsigned int ray_mem_speed = 500;···381381 structures are freed. Otherwise, the structures will be freed382382 when the device is released.383383=============================================================================*/384384-static void ray_detach(struct pcmcia_device *p_dev)384384+static void ray_detach(struct pcmcia_device *link)385385{386386- dev_link_t *link = dev_to_instance(p_dev);387386 struct net_device *dev;388387 ray_dev_t *local;389388···412413#define CS_CHECK(fn, ret) \413414do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)414415#define MAX_TUPLE_SIZE 128415415-static void ray_config(dev_link_t *link)416416+static void ray_config(struct pcmcia_device *link)416417{417417- client_handle_t handle = link->handle;418418 tuple_t tuple;419419 cisparse_t parse;420420 int last_fn = 0, last_ret = 0;···428430429431 /* This reads the card's CONFIG tuple to find its configuration regs */430432 tuple.DesiredTuple = CISTPL_CONFIG;431431- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));433433+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));432434 tuple.TupleData = buf;433435 tuple.TupleDataMax = MAX_TUPLE_SIZE;434436 tuple.TupleOffset = 0;435435- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));436436- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));437437+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));438438+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));437439 link->conf.ConfigBase = parse.config.base;438440 link->conf.Present = parse.config.rmask[0];439441440442 /* Determine card type and firmware version */441443 buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0;442444 tuple.DesiredTuple = CISTPL_VERS_1;443443- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));445445+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));444446 tuple.TupleData = buf;445447 tuple.TupleDataMax = MAX_TUPLE_SIZE;446448 tuple.TupleOffset = 2;447447- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));449449+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));448450449451 for (i=0; i<tuple.TupleDataLen - 4; i++) 450452 if (buf[i] == 0) buf[i] = ' ';···456458 /* Now allocate an interrupt line. Note that this does not457459 actually assign a handler to the interrupt.458460 */459459- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));461461+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));460462 dev->irq = link->irq.AssignedIRQ;461463462464 /* This actually configures the PCMCIA socket -- setting up463465 the I/O windows and the interrupt mapping.464466 */465465- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));467467+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));466468467469/*** Set up 32k window for shared memory (transmit and control) ************/468470 req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT;469471 req.Base = 0;470472 req.Size = 0x8000;471473 req.AccessSpeed = ray_mem_speed;472472- CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));474474+ CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));473475 mem.CardOffset = 0x0000; mem.Page = 0;474476 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));475477 local->sram = ioremap(req.Base,req.Size);···479481 req.Base = 0;480482 req.Size = 0x4000;481483 req.AccessSpeed = ray_mem_speed;482482- CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->rmem_handle));484484+ CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->rmem_handle));483485 mem.CardOffset = 0x8000; mem.Page = 0;484486 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem));485487 local->rmem = ioremap(req.Base,req.Size);···489491 req.Base = 0;490492 req.Size = 0x1000;491493 req.AccessSpeed = ray_mem_speed;492492- CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->amem_handle));494494+ CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &local->amem_handle));493495 mem.CardOffset = 0x0000; mem.Page = 0;494496 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem));495497 local->amem = ioremap(req.Base,req.Size);···502504 return;503505 }504506505505- SET_NETDEV_DEV(dev, &handle_to_dev(handle));507507+ SET_NETDEV_DEV(dev, &handle_to_dev(link));506508 i = register_netdev(dev);507509 if (i != 0) {508510 printk("ray_config register_netdev() failed\n");···522524 return;523525524526cs_failed:525525- cs_error(link->handle, last_fn, last_ret);527527+ cs_error(link, last_fn, last_ret);526528527529 ray_release(link);528530} /* ray_config */···551553 UCHAR *p;552554 struct ccs __iomem *pccs;553555 ray_dev_t *local = (ray_dev_t *)dev->priv;554554- dev_link_t *link = local->finder;556556+ struct pcmcia_device *link = local->finder;555557 DEBUG(1, "ray_init(0x%p)\n", dev);556558 if (!(link->state & DEV_PRESENT)) {557559 DEBUG(0,"ray_init - device not present\n");···613615 int ccsindex;614616 ray_dev_t *local = (ray_dev_t *)dev->priv;615617 struct ccs __iomem *pccs;616616- dev_link_t *link = local->finder;618618+ struct pcmcia_device *link = local->finder;617619618620 DEBUG(1,"dl_startup_params entered\n");619621 if (!(link->state & DEV_PRESENT)) {···720722 ray_dev_t *local = (ray_dev_t *)data;721723 struct ccs __iomem *pccs = ccs_base(local) + local->dl_param_ccs;722724 UCHAR status;723723- dev_link_t *link = local->finder;725725+ struct pcmcia_device *link = local->finder;724726725727 if (!(link->state & DEV_PRESENT)) {726728 DEBUG(2,"ray_cs verify_dl_startup - device not present\n");···760762 ray_dev_t *local = (ray_dev_t *)data;761763 struct ccs __iomem *pccs;762764 int ccsindex;763763- dev_link_t *link = local->finder;765765+ struct pcmcia_device *link = local->finder;764766 if (!(link->state & DEV_PRESENT)) {765767 DEBUG(2,"ray_cs start_net - device not present\n");766768 return;···787789788790 struct ccs __iomem *pccs;789791 int ccsindex;790790- dev_link_t *link = local->finder;792792+ struct pcmcia_device *link = local->finder;791793792794 if (!(link->state & DEV_PRESENT)) {793795 DEBUG(2,"ray_cs join_net - device not present\n");···813815 device, and release the PCMCIA configuration. If the device is814816 still open, this will be postponed until it is closed.815817=============================================================================*/816816-static void ray_release(dev_link_t *link)818818+static void ray_release(struct pcmcia_device *link)817819{818820 struct net_device *dev = link->priv; 819821 ray_dev_t *local = dev->priv;···831833 if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->amem) ret = %x\n",i);832834 i = pcmcia_release_window(local->rmem_handle);833835 if ( i != CS_SUCCESS ) DEBUG(0,"ReleaseWindow(local->rmem) ret = %x\n",i);834834- pcmcia_disable_device(link->handle);836836+ pcmcia_disable_device(link);835837836838 DEBUG(2,"ray_release ending\n");837839}838840839839-static int ray_suspend(struct pcmcia_device *p_dev)841841+static int ray_suspend(struct pcmcia_device *link)840842{841841- dev_link_t *link = dev_to_instance(p_dev);842843 struct net_device *dev = link->priv;843844844845 if ((link->state & DEV_CONFIG) && (link->open))···846849 return 0;847850}848851849849-static int ray_resume(struct pcmcia_device *p_dev)852852+static int ray_resume(struct pcmcia_device *link)850853{851851- dev_link_t *link = dev_to_instance(p_dev);852854 struct net_device *dev = link->priv;853855854856 if ((link->state & DEV_CONFIG) && (link->open)) {···865869 int i;866870#endif /* RAY_IMMEDIATE_INIT */867871 ray_dev_t *local = dev->priv;868868- dev_link_t *link = local->finder;872872+ struct pcmcia_device *link = local->finder;869873870874 DEBUG(1,"ray_dev_init(dev=%p)\n",dev);871875 if (!(link->state & DEV_PRESENT)) {···899903static int ray_dev_config(struct net_device *dev, struct ifmap *map)900904{901905 ray_dev_t *local = dev->priv;902902- dev_link_t *link = local->finder;906906+ struct pcmcia_device *link = local->finder;903907 /* Dummy routine to satisfy device structure */904908 DEBUG(1,"ray_dev_config(dev=%p,ifmap=%p)\n",dev,map);905909 if (!(link->state & DEV_PRESENT)) {···913917static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev)914918{915919 ray_dev_t *local = dev->priv;916916- dev_link_t *link = local->finder;920920+ struct pcmcia_device *link = local->finder;917921 short length = skb->len;918922919923 if (!(link->state & DEV_PRESENT)) {···15251529static iw_stats * ray_get_wireless_stats(struct net_device * dev)15261530{15271531 ray_dev_t * local = (ray_dev_t *) dev->priv;15281528- dev_link_t *link = local->finder;15321532+ struct pcmcia_device *link = local->finder;15291533 struct status __iomem *p = local->sram + STATUS_BASE;1530153415311535 if(local == (ray_dev_t *) NULL)···16131617static int ray_open(struct net_device *dev)16141618{16151619 ray_dev_t *local = (ray_dev_t *)dev->priv;16161616- dev_link_t *link;16201620+ struct pcmcia_device *link;16171621 link = local->finder;1618162216191623 DEBUG(1, "ray_open('%s')\n", dev->name);···16471651static int ray_dev_close(struct net_device *dev)16481652{16491653 ray_dev_t *local = (ray_dev_t *)dev->priv;16501650- dev_link_t *link;16541654+ struct pcmcia_device *link;16511655 link = local->finder;1652165616531657 DEBUG(1, "ray_dev_close('%s')\n", dev->name);···16731677static int interrupt_ecf(ray_dev_t *local, int ccs)16741678{16751679 int i = 50;16761676- dev_link_t *link = local->finder;16801680+ struct pcmcia_device *link = local->finder;1677168116781682 if (!(link->state & DEV_PRESENT)) {16791683 DEBUG(2,"ray_cs interrupt_ecf - device not present\n");···17001704{17011705 int i;17021706 struct ccs __iomem *pccs = ccs_base(local);17031703- dev_link_t *link = local->finder;17071707+ struct pcmcia_device *link = local->finder;1704170817051709 if (!(link->state & DEV_PRESENT)) {17061710 DEBUG(2,"ray_cs get_free_tx_ccs - device not present\n");···17311735{17321736 int i;17331737 struct ccs __iomem *pccs = ccs_base(local);17341734- dev_link_t *link = local->finder;17381738+ struct pcmcia_device *link = local->finder;1735173917361740 if (!(link->state & DEV_PRESENT)) {17371741 DEBUG(2,"ray_cs get_free_ccs - device not present\n");···18061810static struct net_device_stats *ray_get_stats(struct net_device *dev)18071811{18081812 ray_dev_t *local = (ray_dev_t *)dev->priv;18091809- dev_link_t *link = local->finder;18131813+ struct pcmcia_device *link = local->finder;18101814 struct status __iomem *p = local->sram + STATUS_BASE;18111815 if (!(link->state & DEV_PRESENT)) {18121816 DEBUG(2,"ray_cs net_device_stats - device not present\n");···18361840static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, int len)18371841{18381842 ray_dev_t *local = (ray_dev_t *)dev->priv;18391839- dev_link_t *link = local->finder;18431843+ struct pcmcia_device *link = local->finder;18401844 int ccsindex;18411845 int i;18421846 struct ccs __iomem *pccs;···18731877 struct ccs __iomem *pccs;18741878 int i = 0;18751879 ray_dev_t *local = (ray_dev_t *)dev->priv;18761876- dev_link_t *link = local->finder;18801880+ struct pcmcia_device *link = local->finder;18771881 void __iomem *p = local->sram + HOST_TO_ECF_BASE;1878188218791883 if (!(link->state & DEV_PRESENT)) {···19531957static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)19541958{19551959 struct net_device *dev = (struct net_device *)dev_id;19561956- dev_link_t *link;19601960+ struct pcmcia_device *link;19571961 ray_dev_t *local;19581962 struct ccs __iomem *pccs;19591963 struct rcs __iomem *prcs;···19681972 DEBUG(4,"ray_cs: interrupt for *dev=%p\n",dev);1969197319701974 local = (ray_dev_t *)dev->priv;19711971- link = (dev_link_t *)local->finder;19751975+ link = (struct pcmcia_device *)local->finder;19721976 if ( ! (link->state & DEV_PRESENT) || link->state & DEV_SUSPEND ) {19731977 DEBUG(2,"ray_cs interrupt from device not present or suspended.\n");19741978 return IRQ_NONE;···24882492/*===========================================================================*/24892493static void authenticate(ray_dev_t *local)24902494{24912491- dev_link_t *link = local->finder;24952495+ struct pcmcia_device *link = local->finder;24922496 DEBUG(0,"ray_cs Starting authentication.\n");24932497 if (!(link->state & DEV_PRESENT)) {24942498 DEBUG(2,"ray_cs authenticate - device not present\n");···25542558static void associate(ray_dev_t *local)25552559{25562560 struct ccs __iomem *pccs;25572557- dev_link_t *link = local->finder;25612561+ struct pcmcia_device *link = local->finder;25582562 struct net_device *dev = link->priv;25592563 int ccsindex;25602564 if (!(link->state & DEV_PRESENT)) {···26372641 * eg ifconfig 26382642 */26392643 int i;26402640- dev_link_t *link;26442644+ struct pcmcia_device *link;26412645 struct net_device *dev;26422646 ray_dev_t *local;26432647 UCHAR *p;
+1-1
drivers/net/wireless/ray_cs.h
···3131 void __iomem *sram; /* pointer to beginning of shared RAM */3232 void __iomem *amem; /* pointer to attribute mem window */3333 void __iomem *rmem; /* pointer to receive buffer window */3434- dev_link_t *finder; /* pointer back to dev_link_t for card */3434+ struct pcmcia_device *finder; /* pointer back to struct pcmcia_device for card */3535 struct timer_list timer;3636 long tx_ccs_lock;3737 long ccs_lock;
+37-43
drivers/net/wireless/spectrum_cs.c
···7171/* Function prototypes */7272/********************************************************************/73737474-static void spectrum_cs_config(dev_link_t *link);7575-static void spectrum_cs_release(dev_link_t *link);7474+static void spectrum_cs_config(struct pcmcia_device *link);7575+static void spectrum_cs_release(struct pcmcia_device *link);76767777/********************************************************************/7878/* Firmware downloader */···238238 * If IDLE is 1, stop the firmware, so that it can be safely rewritten.239239 */240240static int241241-spectrum_reset(dev_link_t *link, int idle)241241+spectrum_reset(struct pcmcia_device *link, int idle)242242{243243 int last_ret, last_fn;244244 conf_reg_t reg;···253253 reg.Action = CS_READ;254254 reg.Offset = CISREG_COR;255255 CS_CHECK(AccessConfigurationRegister,256256- pcmcia_access_configuration_register(link->handle, ®));256256+ pcmcia_access_configuration_register(link, ®));257257 save_cor = reg.Value;258258259259 /* Soft-Reset card */···261261 reg.Offset = CISREG_COR;262262 reg.Value = (save_cor | COR_SOFT_RESET);263263 CS_CHECK(AccessConfigurationRegister,264264- pcmcia_access_configuration_register(link->handle, ®));264264+ pcmcia_access_configuration_register(link, ®));265265 udelay(1000);266266267267 /* Read CCSR */268268 reg.Action = CS_READ;269269 reg.Offset = CISREG_CCSR;270270 CS_CHECK(AccessConfigurationRegister,271271- pcmcia_access_configuration_register(link->handle, ®));271271+ pcmcia_access_configuration_register(link, ®));272272273273 /*274274 * Start or stop the firmware. Memory width bit should be···278278 reg.Offset = CISREG_CCSR;279279 reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16);280280 CS_CHECK(AccessConfigurationRegister,281281- pcmcia_access_configuration_register(link->handle, ®));281281+ pcmcia_access_configuration_register(link, ®));282282 udelay(1000);283283284284 /* Restore original COR configuration index */···286286 reg.Offset = CISREG_COR;287287 reg.Value = (save_cor & ~COR_SOFT_RESET);288288 CS_CHECK(AccessConfigurationRegister,289289- pcmcia_access_configuration_register(link->handle, ®));289289+ pcmcia_access_configuration_register(link, ®));290290 udelay(1000);291291 return 0;292292293293 cs_failed:294294- cs_error(link->handle, last_fn, last_ret);294294+ cs_error(link, last_fn, last_ret);295295 return -ENODEV;296296}297297···441441 * care of the PDA - read it and then write it on top of the firmware.442442 */443443static int444444-spectrum_dl_image(hermes_t *hw, dev_link_t *link,444444+spectrum_dl_image(hermes_t *hw, struct pcmcia_device *link,445445 const unsigned char *image)446446{447447 int ret;···505505 * reset on the card, to make sure it's in a sane state.506506 */507507static int508508-spectrum_dl_firmware(hermes_t *hw, dev_link_t *link)508508+spectrum_dl_firmware(hermes_t *hw, struct pcmcia_device *link)509509{510510 int ret;511511- client_handle_t handle = link->handle;512511 const struct firmware *fw_entry;513512514513 if (request_firmware(&fw_entry, primary_fw_name,515515- &handle_to_dev(handle)) == 0) {514514+ &handle_to_dev(link)) == 0) {516515 primsym = fw_entry->data;517516 } else {518517 printk(KERN_ERR PFX "Cannot find firmware: %s\n",···520521 }521522522523 if (request_firmware(&fw_entry, secondary_fw_name,523523- &handle_to_dev(handle)) == 0) {524524+ &handle_to_dev(link)) == 0) {524525 secsym = fw_entry->data;525526 } else {526527 printk(KERN_ERR PFX "Cannot find firmware: %s\n",···553554spectrum_cs_hard_reset(struct orinoco_private *priv)554555{555556 struct orinoco_pccard *card = priv->card;556556- dev_link_t *link = card->p_dev;557557+ struct pcmcia_device *link = card->p_dev;557558 int err;558559559560 if (!hermes_present(&priv->hw)) {···583584 * configure the card at this point -- we wait until we receive a card584585 * insertion event. */585586static int586586-spectrum_cs_attach(struct pcmcia_device *p_dev)587587+spectrum_cs_attach(struct pcmcia_device *link)587588{588589 struct net_device *dev;589590 struct orinoco_private *priv;590591 struct orinoco_pccard *card;591591- dev_link_t *link = dev_to_instance(p_dev);592592593593 dev = alloc_orinocodev(sizeof(*card), spectrum_cs_hard_reset);594594 if (! dev)···596598 card = priv->card;597599598600 /* Link both structures together */599599- card->p_dev = p_dev;601601+ card->p_dev = link;600602 link->priv = dev;601603602604 /* Interrupt setup */···625627 * are freed. Otherwise, the structures will be freed when the device626628 * is released.627629 */628628-static void spectrum_cs_detach(struct pcmcia_device *p_dev)630630+static void spectrum_cs_detach(struct pcmcia_device *link)629631{630630- dev_link_t *link = dev_to_instance(p_dev);631632 struct net_device *dev = link->priv;632633633634 if (link->state & DEV_CONFIG)···648651 */649652650653static void651651-spectrum_cs_config(dev_link_t *link)654654+spectrum_cs_config(struct pcmcia_device *link)652655{653656 struct net_device *dev = link->priv;654654- client_handle_t handle = link->handle;655657 struct orinoco_private *priv = netdev_priv(dev);656658 struct orinoco_pccard *card = priv->card;657659 hermes_t *hw = &priv->hw;···662666 cisparse_t parse;663667 void __iomem *mem;664668665665- CS_CHECK(ValidateCIS, pcmcia_validate_cis(handle, &info));669669+ CS_CHECK(ValidateCIS, pcmcia_validate_cis(link, &info));666670667671 /*668672 * This reads the card's CONFIG tuple to find its···673677 tuple.TupleData = buf;674678 tuple.TupleDataMax = sizeof(buf);675679 tuple.TupleOffset = 0;676676- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));677677- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));678678- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));680680+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));681681+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));682682+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));679683 link->conf.ConfigBase = parse.config.base;680684 link->conf.Present = parse.config.rmask[0];681685···684688685689 /* Look up the current Vcc */686690 CS_CHECK(GetConfigurationInfo,687687- pcmcia_get_configuration_info(handle, &conf));691691+ pcmcia_get_configuration_info(link, &conf));688692689693 /*690694 * In this loop, we scan the CIS for configuration table···701705 * implementation-defined details.702706 */703707 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;704704- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));708708+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));705709 while (1) {706710 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);707711 cistpl_cftable_entry_t dflt = { .index = 0 };708712709709- if ( (pcmcia_get_tuple_data(handle, &tuple) != 0)710710- || (pcmcia_parse_tuple(handle, &tuple, &parse) != 0))713713+ if ( (pcmcia_get_tuple_data(link, &tuple) != 0)714714+ || (pcmcia_parse_tuple(link, &tuple, &parse) != 0))711715 goto next_entry;712716713717 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)···772776 }773777774778 /* This reserves IO space but doesn't actually enable it */775775- if (pcmcia_request_io(link->handle, &link->io) != 0)779779+ if (pcmcia_request_io(link, &link->io) != 0)776780 goto next_entry;777781 }778782···782786 break;783787784788 next_entry:785785- pcmcia_disable_device(handle);786786- last_ret = pcmcia_get_next_tuple(handle, &tuple);789789+ pcmcia_disable_device(link);790790+ last_ret = pcmcia_get_next_tuple(link, &tuple);787791 if (last_ret == CS_NO_MORE_ITEMS) {788792 printk(KERN_ERR PFX "GetNextTuple(): No matching "789793 "CIS configuration. Maybe you need the "···797801 * a handler to the interrupt, unless the 'Handler' member of798802 * the irq structure is initialized.799803 */800800- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));804804+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));801805802806 /* We initialize the hermes structure before completing PCMCIA803807 * configuration just in case the interrupt handler gets···814818 * card and host interface into "Memory and IO" mode.815819 */816820 CS_CHECK(RequestConfiguration,817817- pcmcia_request_configuration(link->handle, &link->conf));821821+ pcmcia_request_configuration(link, &link->conf));818822819823 /* Ok, we have the configuration, prepare to register the netdev */820824 dev->base_addr = link->io.BasePort1;···827831 goto failed;828832 }829833830830- SET_NETDEV_DEV(dev, &handle_to_dev(handle));834834+ SET_NETDEV_DEV(dev, &handle_to_dev(link));831835 /* Tell the stack we exist */832836 if (register_netdev(dev) != 0) {833837 printk(KERN_ERR PFX "register_netdev() failed\n");···860864 return;861865862866 cs_failed:863863- cs_error(link->handle, last_fn, last_ret);867867+ cs_error(link, last_fn, last_ret);864868865869 failed:866870 spectrum_cs_release(link);···872876 * still open, this will be postponed until it is closed.873877 */874878static void875875-spectrum_cs_release(dev_link_t *link)879879+spectrum_cs_release(struct pcmcia_device *link)876880{877881 struct net_device *dev = link->priv;878882 struct orinoco_private *priv = netdev_priv(dev);···884888 priv->hw_unavailable++;885889 spin_unlock_irqrestore(&priv->lock, flags);886890887887- pcmcia_disable_device(link->handle);891891+ pcmcia_disable_device(link);888892 if (priv->hw.iobase)889893 ioport_unmap(priv->hw.iobase);890894} /* spectrum_cs_release */891895892896893897static int894894-spectrum_cs_suspend(struct pcmcia_device *p_dev)898898+spectrum_cs_suspend(struct pcmcia_device *link)895899{896896- dev_link_t *link = dev_to_instance(p_dev);897900 struct net_device *dev = link->priv;898901 struct orinoco_private *priv = netdev_priv(dev);899902 unsigned long flags;···917922}918923919924static int920920-spectrum_cs_resume(struct pcmcia_device *p_dev)925925+spectrum_cs_resume(struct pcmcia_device *link)921926{922922- dev_link_t *link = dev_to_instance(p_dev);923927 struct net_device *dev = link->priv;924928 struct orinoco_private *priv = netdev_priv(dev);925929
+31-36
drivers/net/wireless/wavelan_cs.c
···10051005wv_82593_reconfig(struct net_device * dev)10061006{10071007 net_local * lp = netdev_priv(dev);10081008- dev_link_t * link = lp->link;10081008+ struct pcmcia_device * link = lp->link;10091009 unsigned long flags;1010101010111011 /* Arm the flag, will be cleard in wv_82593_config() */···37443744{37453745 int i;37463746 conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 };37473747- dev_link_t * link = ((net_local *)netdev_priv(dev))->link;37473747+ struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link;3748374837493749#ifdef DEBUG_CONFIG_TRACE37503750 printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name);37513751#endif3752375237533753- i = pcmcia_access_configuration_register(link->handle, ®);37533753+ i = pcmcia_access_configuration_register(link, ®);37543754 if(i != CS_SUCCESS)37553755 {37563756- cs_error(link->handle, AccessConfigurationRegister, i);37563756+ cs_error(link, AccessConfigurationRegister, i);37573757 return FALSE;37583758 }37593759···3764376437653765 reg.Action = CS_WRITE;37663766 reg.Value = reg.Value | COR_SW_RESET;37673767- i = pcmcia_access_configuration_register(link->handle, ®);37673767+ i = pcmcia_access_configuration_register(link, ®);37683768 if(i != CS_SUCCESS)37693769 {37703770- cs_error(link->handle, AccessConfigurationRegister, i);37703770+ cs_error(link, AccessConfigurationRegister, i);37713771 return FALSE;37723772 }3773377337743774 reg.Action = CS_WRITE;37753775 reg.Value = COR_LEVEL_IRQ | COR_CONFIG;37763776- i = pcmcia_access_configuration_register(link->handle, ®);37763776+ i = pcmcia_access_configuration_register(link, ®);37773777 if(i != CS_SUCCESS)37783778 {37793779- cs_error(link->handle, AccessConfigurationRegister, i);37793779+ cs_error(link, AccessConfigurationRegister, i);37803780 return FALSE;37813781 }37823782···39403940 * (called by wavelan_event())39413941 */39423942static inline int39433943-wv_pcmcia_config(dev_link_t * link)39433943+wv_pcmcia_config(struct pcmcia_device * link)39443944{39453945- client_handle_t handle = link->handle;39463945 tuple_t tuple;39473946 cisparse_t parse;39483947 struct net_device * dev = (struct net_device *) link->priv;···39643965 {39653966 tuple.Attributes = 0;39663967 tuple.DesiredTuple = CISTPL_CONFIG;39673967- i = pcmcia_get_first_tuple(handle, &tuple);39683968+ i = pcmcia_get_first_tuple(link, &tuple);39683969 if(i != CS_SUCCESS)39693970 break;39703971 tuple.TupleData = (cisdata_t *)buf;39713972 tuple.TupleDataMax = 64;39723973 tuple.TupleOffset = 0;39733973- i = pcmcia_get_tuple_data(handle, &tuple);39743974+ i = pcmcia_get_tuple_data(link, &tuple);39743975 if(i != CS_SUCCESS)39753976 break;39763976- i = pcmcia_parse_tuple(handle, &tuple, &parse);39773977+ i = pcmcia_parse_tuple(link, &tuple, &parse);39773978 if(i != CS_SUCCESS)39783979 break;39793980 link->conf.ConfigBase = parse.config.base;···39823983 while(0);39833984 if(i != CS_SUCCESS)39843985 {39853985- cs_error(link->handle, ParseTuple, i);39863986+ cs_error(link, ParseTuple, i);39863987 link->state &= ~DEV_CONFIG_PENDING;39873988 return FALSE;39883989 }···39913992 link->state |= DEV_CONFIG;39923993 do39933994 {39943994- i = pcmcia_request_io(link->handle, &link->io);39953995+ i = pcmcia_request_io(link, &link->io);39953996 if(i != CS_SUCCESS)39963997 {39973997- cs_error(link->handle, RequestIO, i);39983998+ cs_error(link, RequestIO, i);39983999 break;39994000 }40004001···40024003 * Now allocate an interrupt line. Note that this does not40034004 * actually assign a handler to the interrupt.40044005 */40054005- i = pcmcia_request_irq(link->handle, &link->irq);40064006+ i = pcmcia_request_irq(link, &link->irq);40064007 if(i != CS_SUCCESS)40074008 {40084008- cs_error(link->handle, RequestIRQ, i);40094009+ cs_error(link, RequestIRQ, i);40094010 break;40104011 }40114012···40144015 * the I/O windows and the interrupt mapping.40154016 */40164017 link->conf.ConfigIndex = 1;40174017- i = pcmcia_request_configuration(link->handle, &link->conf);40184018+ i = pcmcia_request_configuration(link, &link->conf);40184019 if(i != CS_SUCCESS)40194020 {40204020- cs_error(link->handle, RequestConfiguration, i);40214021+ cs_error(link, RequestConfiguration, i);40214022 break;40224023 }4023402440244025 /*40254025- * Allocate a small memory window. Note that the dev_link_t40264026+ * Allocate a small memory window. Note that the struct pcmcia_device40264027 * structure provides space for one window handle -- if your40274028 * device needs several windows, you'll need to keep track of40284029 * the handles in your private data structure, link->priv.···40304031 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;40314032 req.Base = req.Size = 0;40324033 req.AccessSpeed = mem_speed;40334033- i = pcmcia_request_window(&link->handle, &req, &link->win);40344034+ i = pcmcia_request_window(&link, &req, &link->win);40344035 if(i != CS_SUCCESS)40354036 {40364036- cs_error(link->handle, RequestWindow, i);40374037+ cs_error(link, RequestWindow, i);40374038 break;40384039 }40394040···40454046 i = pcmcia_map_mem_page(link->win, &mem);40464047 if(i != CS_SUCCESS)40474048 {40484048- cs_error(link->handle, MapMemPage, i);40494049+ cs_error(link, MapMemPage, i);40494050 break;40504051 }40514052···40594060 lp->mem, dev->irq, (u_int) dev->base_addr);40604061#endif4061406240624062- SET_NETDEV_DEV(dev, &handle_to_dev(handle));40634063+ SET_NETDEV_DEV(dev, &handle_to_dev(link));40634064 i = register_netdev(dev);40644065 if(i != 0)40654066 {···40954096 * still open, this will be postponed until it is closed.40964097 */40974098static void40984098-wv_pcmcia_release(dev_link_t *link)40994099+wv_pcmcia_release(struct pcmcia_device *link)40994100{41004101 struct net_device * dev = (struct net_device *) link->priv;41014102 net_local * lp = netdev_priv(dev);···41054106#endif4106410741074108 iounmap(lp->mem);41084108- pcmcia_disable_device(link->handle);41094109+ pcmcia_disable_device(link);4109411041104111#ifdef DEBUG_CONFIG_TRACE41114112 printk(KERN_DEBUG "%s: <- wv_pcmcia_release()\n", dev->name);···44724473wavelan_open(struct net_device * dev)44734474{44744475 net_local * lp = netdev_priv(dev);44754475- dev_link_t * link = lp->link;44764476+ struct pcmcia_device * link = lp->link;44764477 kio_addr_t base = dev->base_addr;4477447844784479#ifdef DEBUG_CALLBACK_TRACE···45264527static int45274528wavelan_close(struct net_device * dev)45284529{45294529- dev_link_t * link = ((net_local *)netdev_priv(dev))->link;45304530+ struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link;45304531 kio_addr_t base = dev->base_addr;4531453245324533#ifdef DEBUG_CALLBACK_TRACE···46724673 * is released.46734674 */46744675static void46754675-wavelan_detach(struct pcmcia_device *p_dev)46764676+wavelan_detach(struct pcmcia_device *link)46764677{46774677- dev_link_t *link = dev_to_instance(p_dev);46784678-46794678#ifdef DEBUG_CALLBACK_TRACE46804679 printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link);46814680#endif···47104713#endif47114714}4712471547134713-static int wavelan_suspend(struct pcmcia_device *p_dev)47164716+static int wavelan_suspend(struct pcmcia_device *link)47144717{47154715- dev_link_t *link = dev_to_instance(p_dev);47164718 struct net_device * dev = (struct net_device *) link->priv;4717471947184720 /* NB: wavelan_close will be called, but too late, so we are···47324736 return 0;47334737}4734473847354735-static int wavelan_resume(struct pcmcia_device *p_dev)47394739+static int wavelan_resume(struct pcmcia_device *link)47364740{47374737- dev_link_t *link = dev_to_instance(p_dev);47384741 struct net_device * dev = (struct net_device *) link->priv;4739474247404743 link->state &= ~DEV_SUSPEND;
+3-3
drivers/net/wireless/wavelan_cs.p.h
···602602 dev_node_t node; /* ???? What is this stuff ???? */603603 struct net_device * dev; /* Reverse link... */604604 spinlock_t spinlock; /* Serialize access to the hardware (SMP) */605605- dev_link_t * link; /* pcmcia structure */605605+ struct pcmcia_device * link; /* pcmcia structure */606606 en_stats stats; /* Ethernet interface statistics */607607 int nresets; /* Number of hw resets */608608 u_char configured; /* If it is configured */···733733static inline void734734 wv_hw_reset(struct net_device *); /* Same, + start receiver unit */735735static inline int736736- wv_pcmcia_config(dev_link_t *); /* Configure the pcmcia interface */736736+ wv_pcmcia_config(struct pcmcia_device *); /* Configure the pcmcia interface */737737static void738738- wv_pcmcia_release(dev_link_t *);/* Remove a device */738738+ wv_pcmcia_release(struct pcmcia_device *);/* Remove a device */739739/* ---------------------- INTERRUPT HANDLING ---------------------- */740740static irqreturn_t741741 wavelan_interrupt(int, /* Interrupt handler */
+31-36
drivers/net/wireless/wl3501_cs.c
···103103 * release a socket, in response to card insertion and ejection events. They104104 * are invoked from the wl24 event handler.105105 */106106-static void wl3501_config(dev_link_t *link);107107-static void wl3501_release(dev_link_t *link);106106+static void wl3501_config(struct pcmcia_device *link);107107+static void wl3501_release(struct pcmcia_device *link);108108109109/*110110 * The dev_info variable is the "key" that is used to match up this···12701270 struct wl3501_card *this = dev->priv;12711271 int rc = -ENODEV;12721272 unsigned long flags;12731273- dev_link_t *link;12731273+ struct pcmcia_device *link;12741274 link = this->p_dev;1275127512761276 spin_lock_irqsave(&this->lock, flags);···13831383 int rc = -ENODEV;13841384 struct wl3501_card *this = dev->priv;13851385 unsigned long flags;13861386- dev_link_t *link;13861386+ struct pcmcia_device *link;13871387 link = this->p_dev;1388138813891389 spin_lock_irqsave(&this->lock, flags);···14771477 * Services. If it has been released, all local data structures are freed.14781478 * Otherwise, the structures will be freed when the device is released.14791479 */14801480-static void wl3501_detach(struct pcmcia_device *p_dev)14801480+static void wl3501_detach(struct pcmcia_device *link)14811481{14821482- dev_link_t *link = dev_to_instance(p_dev);14831482 struct net_device *dev = link->priv;1484148314851484 /* If the device is currently configured and active, we won't actually···19241925{19251926 struct net_device *dev;19261927 struct wl3501_card *this;19271927- dev_link_t *link = dev_to_instance(p_dev);1928192819291929 /* The io structure describes IO port mapping */19301930- link->io.NumPorts1 = 16;19311931- link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;19321932- link->io.IOAddrLines = 5;19301930+ p_dev->io.NumPorts1 = 16;19311931+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;19321932+ p_dev->io.IOAddrLines = 5;1933193319341934 /* Interrupt setup */19351935- link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;19361936- link->irq.IRQInfo1 = IRQ_LEVEL_ID;19371937- link->irq.Handler = wl3501_interrupt;19351935+ p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;19361936+ p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;19371937+ p_dev->irq.Handler = wl3501_interrupt;1938193819391939 /* General socket configuration */19401940- link->conf.Attributes = CONF_ENABLE_IRQ;19411941- link->conf.IntType = INT_MEMORY_AND_IO;19421942- link->conf.ConfigIndex = 1;19431943- link->conf.Present = PRESENT_OPTION;19401940+ p_dev->conf.Attributes = CONF_ENABLE_IRQ;19411941+ p_dev->conf.IntType = INT_MEMORY_AND_IO;19421942+ p_dev->conf.ConfigIndex = 1;19431943+ p_dev->conf.Present = PRESENT_OPTION;1944194419451945 dev = alloc_etherdev(sizeof(struct wl3501_card));19461946 if (!dev)···19571959 dev->wireless_handlers = (struct iw_handler_def *)&wl3501_handler_def;19581960 SET_ETHTOOL_OPS(dev, &ops);19591961 netif_stop_queue(dev);19601960- link->priv = link->irq.Instance = dev;19621962+ p_dev->priv = p_dev->irq.Instance = dev;1961196319621962- link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;19641964+ p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;19631965 wl3501_config(p_dev);1964196619651967 return 0;···19781980 * received, to configure the PCMCIA socket, and to make the ethernet device19791981 * available to the system.19801982 */19811981-static void wl3501_config(dev_link_t *link)19831983+static void wl3501_config(struct pcmcia_device *link)19821984{19831985 tuple_t tuple;19841986 cisparse_t parse;19851985- client_handle_t handle = link->handle;19861987 struct net_device *dev = link->priv;19871988 int i = 0, j, last_fn, last_ret;19881989 unsigned char bf[64];···19901993 /* This reads the card's CONFIG tuple to find its config registers. */19911994 tuple.Attributes = 0;19921995 tuple.DesiredTuple = CISTPL_CONFIG;19931993- CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));19961996+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));19941997 tuple.TupleData = bf;19951998 tuple.TupleDataMax = sizeof(bf);19961999 tuple.TupleOffset = 0;19971997- CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));19981998- CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));20002000+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));20012001+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));19992002 link->conf.ConfigBase = parse.config.base;20002003 link->conf.Present = parse.config.rmask[0];20012004···20112014 * 0x200-0x2ff, and so on, because this seems safer */20122015 link->io.BasePort1 = j;20132016 link->io.BasePort2 = link->io.BasePort1 + 0x10;20142014- i = pcmcia_request_io(link->handle, &link->io);20172017+ i = pcmcia_request_io(link, &link->io);20152018 if (i == CS_SUCCESS)20162019 break;20172020 }20182021 if (i != CS_SUCCESS) {20192019- cs_error(link->handle, RequestIO, i);20222022+ cs_error(link, RequestIO, i);20202023 goto failed;20212024 }2022202520232026 /* Now allocate an interrupt line. Note that this does not actually20242027 * assign a handler to the interrupt. */2025202820262026- CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq));20292029+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));2027203020282031 /* This actually configures the PCMCIA socket -- setting up the I/O20292032 * windows and the interrupt mapping. */2030203320312031- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));20342034+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));2032203520332036 dev->irq = link->irq.AssignedIRQ;20342037 dev->base_addr = link->io.BasePort1;20352035- SET_NETDEV_DEV(dev, &handle_to_dev(handle));20382038+ SET_NETDEV_DEV(dev, &handle_to_dev(link));20362039 if (register_netdev(dev)) {20372040 printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n");20382041 goto failed;···20842087 netif_start_queue(dev);20852088 goto out;20862089cs_failed:20872087- cs_error(link->handle, last_fn, last_ret);20902090+ cs_error(link, last_fn, last_ret);20882091failed:20892092 wl3501_release(link);20902093out:···20992102 * and release the PCMCIA configuration. If the device is still open, this21002103 * will be postponed until it is closed.21012104 */21022102-static void wl3501_release(dev_link_t *link)21052105+static void wl3501_release(struct pcmcia_device *link)21032106{21042107 struct net_device *dev = link->priv;21052108···21072110 if (link->dev_node)21082111 unregister_netdev(dev);2109211221102110- pcmcia_disable_device(link->handle);21132113+ pcmcia_disable_device(link);21112114}2112211521132113-static int wl3501_suspend(struct pcmcia_device *p_dev)21162116+static int wl3501_suspend(struct pcmcia_device *link)21142117{21152115- dev_link_t *link = dev_to_instance(p_dev);21162118 struct net_device *dev = link->priv;2117211921182120 wl3501_pwr_mgmt(dev->priv, WL3501_SUSPEND);···21212125 return 0;21222126}2123212721242124-static int wl3501_resume(struct pcmcia_device *p_dev)21282128+static int wl3501_resume(struct pcmcia_device *link)21252129{21262126- dev_link_t *link = dev_to_instance(p_dev);21272130 struct net_device *dev = link->priv;2128213121292132 wl3501_pwr_mgmt(dev->priv, WL3501_RESUME);