aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c25
-rw-r--r--drivers/net/pcmcia/3c589_cs.c19
-rw-r--r--drivers/net/pcmcia/axnet_cs.c6
-rw-r--r--drivers/net/pcmcia/com20020_cs.c13
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c40
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c12
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c12
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c30
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c59
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c28
-rw-r--r--drivers/net/wireless/airo_cs.c19
-rw-r--r--drivers/net/wireless/atmel_cs.c11
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c13
-rw-r--r--drivers/net/wireless/netwave_cs.c18
-rw-r--r--drivers/net/wireless/orinoco_cs.c19
-rw-r--r--drivers/net/wireless/ray_cs.c30
-rw-r--r--drivers/net/wireless/spectrum_cs.c19
-rw-r--r--drivers/net/wireless/wavelan_cs.c33
-rw-r--r--drivers/net/wireless/wl3501_cs.c15
19 files changed, 62 insertions, 359 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 046009928526..794cc61819dd 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -338,7 +338,6 @@ static int tc574_config(struct pcmcia_device *link)
338 struct net_device *dev = link->priv; 338 struct net_device *dev = link->priv;
339 struct el3_private *lp = netdev_priv(dev); 339 struct el3_private *lp = netdev_priv(dev);
340 tuple_t tuple; 340 tuple_t tuple;
341 cisparse_t parse;
342 unsigned short buf[32]; 341 unsigned short buf[32];
343 int last_fn, last_ret, i, j; 342 int last_fn, last_ret, i, j;
344 kio_addr_t ioaddr; 343 kio_addr_t ioaddr;
@@ -350,17 +349,6 @@ static int tc574_config(struct pcmcia_device *link)
350 349
351 DEBUG(0, "3c574_config(0x%p)\n", link); 350 DEBUG(0, "3c574_config(0x%p)\n", link);
352 351
353 tuple.Attributes = 0;
354 tuple.DesiredTuple = CISTPL_CONFIG;
355 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
356 tuple.TupleData = (cisdata_t *)buf;
357 tuple.TupleDataMax = 64;
358 tuple.TupleOffset = 0;
359 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
360 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
361 link->conf.ConfigBase = parse.config.base;
362 link->conf.Present = parse.config.rmask[0];
363
364 link->io.IOAddrLines = 16; 352 link->io.IOAddrLines = 16;
365 for (i = j = 0; j < 0x400; j += 0x20) { 353 for (i = j = 0; j < 0x400; j += 0x20) {
366 link->io.BasePort1 = j ^ 0x300; 354 link->io.BasePort1 = j ^ 0x300;
@@ -382,6 +370,10 @@ static int tc574_config(struct pcmcia_device *link)
382 /* The 3c574 normally uses an EEPROM for configuration info, including 370 /* The 3c574 normally uses an EEPROM for configuration info, including
383 the hardware address. The future products may include a modem chip 371 the hardware address. The future products may include a modem chip
384 and put the address in the CIS. */ 372 and put the address in the CIS. */
373 tuple.Attributes = 0;
374 tuple.TupleData = (cisdata_t *)buf;
375 tuple.TupleDataMax = 64;
376 tuple.TupleOffset = 0;
385 tuple.DesiredTuple = 0x88; 377 tuple.DesiredTuple = 0x88;
386 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 378 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) {
387 pcmcia_get_tuple_data(link, &tuple); 379 pcmcia_get_tuple_data(link, &tuple);
@@ -397,12 +389,9 @@ static int tc574_config(struct pcmcia_device *link)
397 goto failed; 389 goto failed;
398 } 390 }
399 } 391 }
400 tuple.DesiredTuple = CISTPL_VERS_1; 392 if (link->prod_id[1])
401 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS && 393 cardname = link->prod_id[1];
402 pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS && 394 else
403 pcmcia_parse_tuple(link, &tuple, &parse) == CS_SUCCESS) {
404 cardname = parse.version_1.str + parse.version_1.ofs[1];
405 } else
406 cardname = "3Com 3c574"; 395 cardname = "3Com 3c574";
407 396
408 { 397 {
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 231fa2c9ec6c..1e73ff7d5d8e 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -253,7 +253,6 @@ static int tc589_config(struct pcmcia_device *link)
253 struct net_device *dev = link->priv; 253 struct net_device *dev = link->priv;
254 struct el3_private *lp = netdev_priv(dev); 254 struct el3_private *lp = netdev_priv(dev);
255 tuple_t tuple; 255 tuple_t tuple;
256 cisparse_t parse;
257 u16 buf[32], *phys_addr; 256 u16 buf[32], *phys_addr;
258 int last_fn, last_ret, i, j, multi = 0, fifo; 257 int last_fn, last_ret, i, j, multi = 0, fifo;
259 kio_addr_t ioaddr; 258 kio_addr_t ioaddr;
@@ -263,26 +262,16 @@ static int tc589_config(struct pcmcia_device *link)
263 262
264 phys_addr = (u16 *)dev->dev_addr; 263 phys_addr = (u16 *)dev->dev_addr;
265 tuple.Attributes = 0; 264 tuple.Attributes = 0;
266 tuple.DesiredTuple = CISTPL_CONFIG;
267 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
268 tuple.TupleData = (cisdata_t *)buf; 265 tuple.TupleData = (cisdata_t *)buf;
269 tuple.TupleDataMax = sizeof(buf); 266 tuple.TupleDataMax = sizeof(buf);
270 tuple.TupleOffset = 0; 267 tuple.TupleOffset = 0;
271 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
272 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
273 link->conf.ConfigBase = parse.config.base;
274 link->conf.Present = parse.config.rmask[0];
275
276 /* Is this a 3c562? */
277 tuple.DesiredTuple = CISTPL_MANFID;
278 tuple.Attributes = TUPLE_RETURN_COMMON; 268 tuple.Attributes = TUPLE_RETURN_COMMON;
279 if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && 269
280 (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) { 270 /* Is this a 3c562? */
281 if (le16_to_cpu(buf[0]) != MANFID_3COM) 271 if (link->manf_id != MANFID_3COM)
282 printk(KERN_INFO "3c589_cs: hmmm, is this really a " 272 printk(KERN_INFO "3c589_cs: hmmm, is this really a "
283 "3Com card??\n"); 273 "3Com card??\n");
284 multi = (le16_to_cpu(buf[1]) == PRODID_3COM_3C562); 274 multi = (link->card_id == PRODID_3COM_3C562);
285 }
286 275
287 /* For the 3c562, the base address must be xx00-xx7f */ 276 /* For the 3c562, the base address must be xx00-xx7f */
288 link->io.IOAddrLines = 16; 277 link->io.IOAddrLines = 16;
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 5ddd5742f779..6139048f8117 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -299,11 +299,7 @@ static int axnet_config(struct pcmcia_device *link)
299 tuple.TupleData = (cisdata_t *)buf; 299 tuple.TupleData = (cisdata_t *)buf;
300 tuple.TupleDataMax = sizeof(buf); 300 tuple.TupleDataMax = sizeof(buf);
301 tuple.TupleOffset = 0; 301 tuple.TupleOffset = 0;
302 tuple.DesiredTuple = CISTPL_CONFIG; 302
303 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
304 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
305 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
306 link->conf.ConfigBase = parse.config.base;
307 /* don't trust the CIS on this; Linksys got it wrong */ 303 /* don't trust the CIS on this; Linksys got it wrong */
308 link->conf.Present = 0x63; 304 link->conf.Present = 0x63;
309 305
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 48434d7924eb..91f65e91cd5f 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -249,12 +249,9 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
249static int com20020_config(struct pcmcia_device *link) 249static int com20020_config(struct pcmcia_device *link)
250{ 250{
251 struct arcnet_local *lp; 251 struct arcnet_local *lp;
252 tuple_t tuple;
253 cisparse_t parse;
254 com20020_dev_t *info; 252 com20020_dev_t *info;
255 struct net_device *dev; 253 struct net_device *dev;
256 int i, last_ret, last_fn; 254 int i, last_ret, last_fn;
257 u_char buf[64];
258 int ioaddr; 255 int ioaddr;
259 256
260 info = link->priv; 257 info = link->priv;
@@ -264,16 +261,6 @@ static int com20020_config(struct pcmcia_device *link)
264 261
265 DEBUG(0, "com20020_config(0x%p)\n", link); 262 DEBUG(0, "com20020_config(0x%p)\n", link);
266 263
267 tuple.Attributes = 0;
268 tuple.TupleData = buf;
269 tuple.TupleDataMax = 64;
270 tuple.TupleOffset = 0;
271 tuple.DesiredTuple = CISTPL_CONFIG;
272 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
273 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
274 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
275 link->conf.ConfigBase = parse.config.base;
276
277 DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); 264 DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1);
278 i = !CS_SUCCESS; 265 i = !CS_SUCCESS;
279 if (!link->io.BasePort1) 266 if (!link->io.BasePort1)
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 65f6fdf43725..0d7de617e535 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -342,7 +342,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
342 tuple_t tuple; 342 tuple_t tuple;
343 cisparse_t parse; 343 cisparse_t parse;
344 u_short buf[32]; 344 u_short buf[32];
345 int i, last_fn, last_ret, ret; 345 int i, last_fn = 0, last_ret = 0, ret;
346 kio_addr_t ioaddr; 346 kio_addr_t ioaddr;
347 cardtype_t cardtype; 347 cardtype_t cardtype;
348 char *card_name = "unknown"; 348 char *card_name = "unknown";
@@ -350,21 +350,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
350 350
351 DEBUG(0, "fmvj18x_config(0x%p)\n", link); 351 DEBUG(0, "fmvj18x_config(0x%p)\n", link);
352 352
353 /*
354 This reads the card's CONFIG tuple to find its configuration
355 registers.
356 */
357 tuple.DesiredTuple = CISTPL_CONFIG;
358 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
359 tuple.TupleData = (u_char *)buf; 353 tuple.TupleData = (u_char *)buf;
360 tuple.TupleDataMax = 64; 354 tuple.TupleDataMax = 64;
361 tuple.TupleOffset = 0; 355 tuple.TupleOffset = 0;
362 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
363 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
364
365 link->conf.ConfigBase = parse.config.base;
366 link->conf.Present = parse.config.rmask[0];
367
368 tuple.DesiredTuple = CISTPL_FUNCE; 356 tuple.DesiredTuple = CISTPL_FUNCE;
369 tuple.TupleOffset = 0; 357 tuple.TupleOffset = 0;
370 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) { 358 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) {
@@ -374,17 +362,12 @@ static int fmvj18x_config(struct pcmcia_device *link)
374 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 362 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
375 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 363 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
376 link->conf.ConfigIndex = parse.cftable_entry.index; 364 link->conf.ConfigIndex = parse.cftable_entry.index;
377 tuple.DesiredTuple = CISTPL_MANFID; 365 switch (link->manf_id) {
378 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS)
379 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
380 else
381 buf[0] = 0xffff;
382 switch (le16_to_cpu(buf[0])) {
383 case MANFID_TDK: 366 case MANFID_TDK:
384 cardtype = TDK; 367 cardtype = TDK;
385 if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410 368 if (link->card_id == PRODID_TDK_GN3410
386 || le16_to_cpu(buf[1]) == PRODID_TDK_NP9610 369 || link->card_id == PRODID_TDK_NP9610
387 || le16_to_cpu(buf[1]) == PRODID_TDK_MN3200) { 370 || link->card_id == PRODID_TDK_MN3200) {
388 /* MultiFunction Card */ 371 /* MultiFunction Card */
389 link->conf.ConfigBase = 0x800; 372 link->conf.ConfigBase = 0x800;
390 link->conf.ConfigIndex = 0x47; 373 link->conf.ConfigIndex = 0x47;
@@ -395,11 +378,11 @@ static int fmvj18x_config(struct pcmcia_device *link)
395 cardtype = CONTEC; 378 cardtype = CONTEC;
396 break; 379 break;
397 case MANFID_FUJITSU: 380 case MANFID_FUJITSU:
398 if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10302) 381 if (link->card_id == PRODID_FUJITSU_MBH10302)
399 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302), 382 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
400 but these are MBH10304 based card. */ 383 but these are MBH10304 based card. */
401 cardtype = MBH10304; 384 cardtype = MBH10304;
402 else if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) 385 else if (link->card_id == PRODID_FUJITSU_MBH10304)
403 cardtype = MBH10304; 386 cardtype = MBH10304;
404 else 387 else
405 cardtype = LA501; 388 cardtype = LA501;
@@ -409,14 +392,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
409 } 392 }
410 } else { 393 } else {
411 /* old type card */ 394 /* old type card */
412 tuple.DesiredTuple = CISTPL_MANFID; 395 switch (link->manf_id) {
413 if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS)
414 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
415 else
416 buf[0] = 0xffff;
417 switch (le16_to_cpu(buf[0])) {
418 case MANFID_FUJITSU: 396 case MANFID_FUJITSU:
419 if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) { 397 if (link->card_id == PRODID_FUJITSU_MBH10304) {
420 cardtype = XXX10304; /* MBH10304 with buggy CIS */ 398 cardtype = XXX10304; /* MBH10304 with buggy CIS */
421 link->conf.ConfigIndex = 0x20; 399 link->conf.ConfigIndex = 0x20;
422 } else { 400 } else {
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index bc0ca41a0542..a956a51d284f 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -222,24 +222,12 @@ static int ibmtr_config(struct pcmcia_device *link)
222 ibmtr_dev_t *info = link->priv; 222 ibmtr_dev_t *info = link->priv;
223 struct net_device *dev = info->dev; 223 struct net_device *dev = info->dev;
224 struct tok_info *ti = netdev_priv(dev); 224 struct tok_info *ti = netdev_priv(dev);
225 tuple_t tuple;
226 cisparse_t parse;
227 win_req_t req; 225 win_req_t req;
228 memreq_t mem; 226 memreq_t mem;
229 int i, last_ret, last_fn; 227 int i, last_ret, last_fn;
230 u_char buf[64];
231 228
232 DEBUG(0, "ibmtr_config(0x%p)\n", link); 229 DEBUG(0, "ibmtr_config(0x%p)\n", link);
233 230
234 tuple.Attributes = 0;
235 tuple.TupleData = buf;
236 tuple.TupleDataMax = 64;
237 tuple.TupleOffset = 0;
238 tuple.DesiredTuple = CISTPL_CONFIG;
239 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
240 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
241 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
242 link->conf.ConfigBase = parse.config.base;
243 link->conf.ConfigIndex = 0x61; 231 link->conf.ConfigIndex = 0x61;
244 232
245 /* Determine if this is PRIMARY or ALTERNATE. */ 233 /* Determine if this is PRIMARY or ALTERNATE. */
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index e77110e4c288..3b707747a811 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -656,23 +656,12 @@ static int nmclan_config(struct pcmcia_device *link)
656 struct net_device *dev = link->priv; 656 struct net_device *dev = link->priv;
657 mace_private *lp = netdev_priv(dev); 657 mace_private *lp = netdev_priv(dev);
658 tuple_t tuple; 658 tuple_t tuple;
659 cisparse_t parse;
660 u_char buf[64]; 659 u_char buf[64];
661 int i, last_ret, last_fn; 660 int i, last_ret, last_fn;
662 kio_addr_t ioaddr; 661 kio_addr_t ioaddr;
663 662
664 DEBUG(0, "nmclan_config(0x%p)\n", link); 663 DEBUG(0, "nmclan_config(0x%p)\n", link);
665 664
666 tuple.Attributes = 0;
667 tuple.TupleData = buf;
668 tuple.TupleDataMax = 64;
669 tuple.TupleOffset = 0;
670 tuple.DesiredTuple = CISTPL_CONFIG;
671 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
672 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
673 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
674 link->conf.ConfigBase = parse.config.base;
675
676 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 665 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
677 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 666 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
678 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 667 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
@@ -686,6 +675,7 @@ static int nmclan_config(struct pcmcia_device *link)
686 tuple.TupleData = buf; 675 tuple.TupleData = buf;
687 tuple.TupleDataMax = 64; 676 tuple.TupleDataMax = 64;
688 tuple.TupleOffset = 0; 677 tuple.TupleOffset = 0;
678 tuple.Attributes = 0;
689 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 679 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
690 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 680 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
691 memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN); 681 memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index c51cc5d8789a..2b1238e2dbdb 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -519,31 +519,15 @@ static int pcnet_config(struct pcmcia_device *link)
519 tuple_t tuple; 519 tuple_t tuple;
520 cisparse_t parse; 520 cisparse_t parse;
521 int i, last_ret, last_fn, start_pg, stop_pg, cm_offset; 521 int i, last_ret, last_fn, start_pg, stop_pg, cm_offset;
522 int manfid = 0, prodid = 0, has_shmem = 0; 522 int has_shmem = 0;
523 u_short buf[64]; 523 u_short buf[64];
524 hw_info_t *hw_info; 524 hw_info_t *hw_info;
525 525
526 DEBUG(0, "pcnet_config(0x%p)\n", link); 526 DEBUG(0, "pcnet_config(0x%p)\n", link);
527 527
528 tuple.Attributes = 0;
529 tuple.TupleData = (cisdata_t *)buf; 528 tuple.TupleData = (cisdata_t *)buf;
530 tuple.TupleDataMax = sizeof(buf); 529 tuple.TupleDataMax = sizeof(buf);
531 tuple.TupleOffset = 0; 530 tuple.TupleOffset = 0;
532 tuple.DesiredTuple = CISTPL_CONFIG;
533 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
534 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
535 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
536 link->conf.ConfigBase = parse.config.base;
537 link->conf.Present = parse.config.rmask[0];
538
539 tuple.DesiredTuple = CISTPL_MANFID;
540 tuple.Attributes = TUPLE_RETURN_COMMON;
541 if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) &&
542 (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) {
543 manfid = le16_to_cpu(buf[0]);
544 prodid = le16_to_cpu(buf[1]);
545 }
546
547 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 531 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
548 tuple.Attributes = 0; 532 tuple.Attributes = 0;
549 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 533 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -589,8 +573,8 @@ static int pcnet_config(struct pcmcia_device *link)
589 link->conf.Attributes |= CONF_ENABLE_SPKR; 573 link->conf.Attributes |= CONF_ENABLE_SPKR;
590 link->conf.Status = CCSR_AUDIO_ENA; 574 link->conf.Status = CCSR_AUDIO_ENA;
591 } 575 }
592 if ((manfid == MANFID_IBM) && 576 if ((link->manf_id == MANFID_IBM) &&
593 (prodid == PRODID_IBM_HOME_AND_AWAY)) 577 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
594 link->conf.ConfigIndex |= 0x10; 578 link->conf.ConfigIndex |= 0x10;
595 579
596 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 580 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
@@ -624,10 +608,10 @@ static int pcnet_config(struct pcmcia_device *link)
624 info->flags = hw_info->flags; 608 info->flags = hw_info->flags;
625 /* Check for user overrides */ 609 /* Check for user overrides */
626 info->flags |= (delay_output) ? DELAY_OUTPUT : 0; 610 info->flags |= (delay_output) ? DELAY_OUTPUT : 0;
627 if ((manfid == MANFID_SOCKET) && 611 if ((link->manf_id == MANFID_SOCKET) &&
628 ((prodid == PRODID_SOCKET_LPE) || 612 ((link->card_id == PRODID_SOCKET_LPE) ||
629 (prodid == PRODID_SOCKET_LPE_CF) || 613 (link->card_id == PRODID_SOCKET_LPE_CF) ||
630 (prodid == PRODID_SOCKET_EIO))) 614 (link->card_id == PRODID_SOCKET_EIO)))
631 info->flags &= ~USE_BIG_BUF; 615 info->flags &= ~USE_BIG_BUF;
632 if (!use_big_buf) 616 if (!use_big_buf)
633 info->flags &= ~USE_BIG_BUF; 617 info->flags &= ~USE_BIG_BUF;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 20fcc3576202..530df8883fe5 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -560,16 +560,8 @@ static int mhz_setup(struct pcmcia_device *link)
560 560
561 /* Read the station address from the CIS. It is stored as the last 561 /* Read the station address from the CIS. It is stored as the last
562 (fourth) string in the Version 1 Version/ID tuple. */ 562 (fourth) string in the Version 1 Version/ID tuple. */
563 tuple->DesiredTuple = CISTPL_VERS_1; 563 if (link->prod_id[3]) {
564 if (first_tuple(link, tuple, parse) != CS_SUCCESS) { 564 station_addr = link->prod_id[3];
565 rc = -1;
566 goto free_cfg_mem;
567 }
568 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */
569 if (next_tuple(link, tuple, parse) != CS_SUCCESS)
570 first_tuple(link, tuple, parse);
571 if (parse->version_1.ns > 3) {
572 station_addr = parse->version_1.str + parse->version_1.ofs[3];
573 if (cvt_ascii_address(dev, station_addr) == 0) { 565 if (cvt_ascii_address(dev, station_addr) == 0) {
574 rc = 0; 566 rc = 0;
575 goto free_cfg_mem; 567 goto free_cfg_mem;
@@ -744,15 +736,12 @@ static int smc_setup(struct pcmcia_device *link)
744 } 736 }
745 } 737 }
746 /* Try the third string in the Version 1 Version/ID tuple. */ 738 /* Try the third string in the Version 1 Version/ID tuple. */
747 tuple->DesiredTuple = CISTPL_VERS_1; 739 if (link->prod_id[2]) {
748 if (first_tuple(link, tuple, parse) != CS_SUCCESS) { 740 station_addr = link->prod_id[2];
749 rc = -1; 741 if (cvt_ascii_address(dev, station_addr) == 0) {
750 goto free_cfg_mem; 742 rc = 0;
751 } 743 goto free_cfg_mem;
752 station_addr = parse->version_1.str + parse->version_1.ofs[2]; 744 }
753 if (cvt_ascii_address(dev, station_addr) == 0) {
754 rc = 0;
755 goto free_cfg_mem;
756 } 745 }
757 746
758 rc = -1; 747 rc = -1;
@@ -970,10 +959,6 @@ static int smc91c92_config(struct pcmcia_device *link)
970{ 959{
971 struct net_device *dev = link->priv; 960 struct net_device *dev = link->priv;
972 struct smc_private *smc = netdev_priv(dev); 961 struct smc_private *smc = netdev_priv(dev);
973 struct smc_cfg_mem *cfg_mem;
974 tuple_t *tuple;
975 cisparse_t *parse;
976 u_char *buf;
977 char *name; 962 char *name;
978 int i, j, rev; 963 int i, j, rev;
979 kio_addr_t ioaddr; 964 kio_addr_t ioaddr;
@@ -981,30 +966,8 @@ static int smc91c92_config(struct pcmcia_device *link)
981 966
982 DEBUG(0, "smc91c92_config(0x%p)\n", link); 967 DEBUG(0, "smc91c92_config(0x%p)\n", link);
983 968
984 cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); 969 smc->manfid = link->manf_id;
985 if (!cfg_mem) 970 smc->cardid = link->card_id;
986 goto config_failed;
987
988 tuple = &cfg_mem->tuple;
989 parse = &cfg_mem->parse;
990 buf = cfg_mem->buf;
991
992 tuple->Attributes = tuple->TupleOffset = 0;
993 tuple->TupleData = (cisdata_t *)buf;
994 tuple->TupleDataMax = 64;
995
996 tuple->DesiredTuple = CISTPL_CONFIG;
997 i = first_tuple(link, tuple, parse);
998 CS_EXIT_TEST(i, ParseTuple, config_failed);
999 link->conf.ConfigBase = parse->config.base;
1000 link->conf.Present = parse->config.rmask[0];
1001
1002 tuple->DesiredTuple = CISTPL_MANFID;
1003 tuple->Attributes = TUPLE_RETURN_COMMON;
1004 if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
1005 smc->manfid = parse->manfid.manf;
1006 smc->cardid = parse->manfid.card;
1007 }
1008 971
1009 if ((smc->manfid == MANFID_OSITECH) && 972 if ((smc->manfid == MANFID_OSITECH) &&
1010 (smc->cardid != PRODID_OSITECH_SEVEN)) { 973 (smc->cardid != PRODID_OSITECH_SEVEN)) {
@@ -1134,14 +1097,12 @@ static int smc91c92_config(struct pcmcia_device *link)
1134 printk(KERN_NOTICE " No MII transceivers found!\n"); 1097 printk(KERN_NOTICE " No MII transceivers found!\n");
1135 } 1098 }
1136 } 1099 }
1137 kfree(cfg_mem);
1138 return 0; 1100 return 0;
1139 1101
1140config_undo: 1102config_undo:
1141 unregister_netdev(dev); 1103 unregister_netdev(dev);
1142config_failed: /* CS_EXIT_TEST() calls jump to here... */ 1104config_failed: /* CS_EXIT_TEST() calls jump to here... */
1143 smc91c92_release(link); 1105 smc91c92_release(link);
1144 kfree(cfg_mem);
1145 return -ENODEV; 1106 return -ENODEV;
1146} /* smc91c92_config */ 1107} /* smc91c92_config */
1147 1108
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 5de8850f2323..8478dca3d8d1 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -709,22 +709,11 @@ set_card_type(struct pcmcia_device *link, const void *s)
709 * Returns: true if this is a CE2 709 * Returns: true if this is a CE2
710 */ 710 */
711static int 711static int
712has_ce2_string(struct pcmcia_device * link) 712has_ce2_string(struct pcmcia_device * p_dev)
713{ 713{
714 tuple_t tuple; 714 if (p_dev->prod_id[2] && strstr(p_dev->prod_id[2], "CE2"))
715 cisparse_t parse; 715 return 1;
716 u_char buf[256]; 716 return 0;
717
718 tuple.Attributes = 0;
719 tuple.TupleData = buf;
720 tuple.TupleDataMax = 254;
721 tuple.TupleOffset = 0;
722 tuple.DesiredTuple = CISTPL_VERS_1;
723 if (!first_tuple(link, &tuple, &parse) && parse.version_1.ns > 2) {
724 if (strstr(parse.version_1.str + parse.version_1.ofs[2], "CE2"))
725 return 1;
726 }
727 return 0;
728} 717}
729 718
730/**************** 719/****************
@@ -794,13 +783,6 @@ xirc2ps_config(struct pcmcia_device * link)
794 goto failure; 783 goto failure;
795 } 784 }
796 785
797 /* get configuration stuff */
798 tuple.DesiredTuple = CISTPL_CONFIG;
799 if ((err=first_tuple(link, &tuple, &parse)))
800 goto cis_error;
801 link->conf.ConfigBase = parse.config.base;
802 link->conf.Present = parse.config.rmask[0];
803
804 /* get the ethernet address from the CIS */ 786 /* get the ethernet address from the CIS */
805 tuple.DesiredTuple = CISTPL_FUNCE; 787 tuple.DesiredTuple = CISTPL_FUNCE;
806 for (err = first_tuple(link, &tuple, &parse); !err; 788 for (err = first_tuple(link, &tuple, &parse); !err;
@@ -1064,8 +1046,6 @@ xirc2ps_config(struct pcmcia_device * link)
1064 xirc2ps_release(link); 1046 xirc2ps_release(link);
1065 return -ENODEV; 1047 return -ENODEV;
1066 1048
1067 cis_error:
1068 printk(KNOT_XIRC "unable to parse CIS\n");
1069 failure: 1049 failure:
1070 return -ENODEV; 1050 return -ENODEV;
1071} /* xirc2ps_config */ 1051} /* xirc2ps_config */
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index ac9437d497f0..f12355398fe7 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -219,21 +219,6 @@ static int airo_config(struct pcmcia_device *link)
219 dev = link->priv; 219 dev = link->priv;
220 220
221 DEBUG(0, "airo_config(0x%p)\n", link); 221 DEBUG(0, "airo_config(0x%p)\n", link);
222
223 /*
224 This reads the card's CONFIG tuple to find its configuration
225 registers.
226 */
227 tuple.DesiredTuple = CISTPL_CONFIG;
228 tuple.Attributes = 0;
229 tuple.TupleData = buf;
230 tuple.TupleDataMax = sizeof(buf);
231 tuple.TupleOffset = 0;
232 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
233 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
234 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
235 link->conf.ConfigBase = parse.config.base;
236 link->conf.Present = parse.config.rmask[0];
237 222
238 /* 223 /*
239 In this loop, we scan the CIS for configuration table entries, 224 In this loop, we scan the CIS for configuration table entries,
@@ -247,6 +232,10 @@ static int airo_config(struct pcmcia_device *link)
247 these things without consulting the CIS, and most client drivers 232 these things without consulting the CIS, and most client drivers
248 will only use the CIS to fill in implementation-defined details. 233 will only use the CIS to fill in implementation-defined details.
249 */ 234 */
235 tuple.Attributes = 0;
236 tuple.TupleData = buf;
237 tuple.TupleDataMax = sizeof(buf);
238 tuple.TupleOffset = 0;
250 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 239 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
251 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 240 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
252 while (1) { 241 while (1) {
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 5c410989c4d7..12617cd0b78e 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -244,17 +244,6 @@ static int atmel_config(struct pcmcia_device *link)
244 tuple.TupleOffset = 0; 244 tuple.TupleOffset = 0;
245 245
246 /* 246 /*
247 This reads the card's CONFIG tuple to find its configuration
248 registers.
249 */
250 tuple.DesiredTuple = CISTPL_CONFIG;
251 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
252 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
253 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
254 link->conf.ConfigBase = parse.config.base;
255 link->conf.Present = parse.config.rmask[0];
256
257 /*
258 In this loop, we scan the CIS for configuration table entries, 247 In this loop, we scan the CIS for configuration table entries,
259 each of which describes a valid card configuration, including 248 each of which describes a valid card configuration, including
260 voltage, IO window, memory window, and interrupt settings. 249 voltage, IO window, memory window, and interrupt settings.
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index f63909e4bc32..ee542ec6d6a8 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -293,15 +293,12 @@ static int sandisk_enable_wireless(struct net_device *dev)
293 goto done; 293 goto done;
294 } 294 }
295 295
296 tuple.DesiredTuple = CISTPL_MANFID;
297 tuple.Attributes = TUPLE_RETURN_COMMON; 296 tuple.Attributes = TUPLE_RETURN_COMMON;
298 tuple.TupleData = buf; 297 tuple.TupleData = buf;
299 tuple.TupleDataMax = sizeof(buf); 298 tuple.TupleDataMax = sizeof(buf);
300 tuple.TupleOffset = 0; 299 tuple.TupleOffset = 0;
301 if (pcmcia_get_first_tuple(hw_priv->link, &tuple) || 300
302 pcmcia_get_tuple_data(hw_priv->link, &tuple) || 301 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) {
303 pcmcia_parse_tuple(hw_priv->link, &tuple, parse) ||
304 parse->manfid.manf != 0xd601 || parse->manfid.card != 0x0101) {
305 /* No SanDisk manfid found */ 302 /* No SanDisk manfid found */
306 ret = -ENODEV; 303 ret = -ENODEV;
307 goto done; 304 goto done;
@@ -573,16 +570,10 @@ static int prism2_config(struct pcmcia_device *link)
573 } 570 }
574 memset(hw_priv, 0, sizeof(*hw_priv)); 571 memset(hw_priv, 0, sizeof(*hw_priv));
575 572
576 tuple.DesiredTuple = CISTPL_CONFIG;
577 tuple.Attributes = 0; 573 tuple.Attributes = 0;
578 tuple.TupleData = buf; 574 tuple.TupleData = buf;
579 tuple.TupleDataMax = sizeof(buf); 575 tuple.TupleDataMax = sizeof(buf);
580 tuple.TupleOffset = 0; 576 tuple.TupleOffset = 0;
581 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
582 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
583 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, parse));
584 link->conf.ConfigBase = parse->config.base;
585 link->conf.Present = parse->config.rmask[0];
586 577
587 CS_CHECK(GetConfigurationInfo, 578 CS_CHECK(GetConfigurationInfo,
588 pcmcia_get_configuration_info(link, &conf)); 579 pcmcia_get_configuration_info(link, &conf));
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 6714e0dfa8d6..644b4741ef74 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -735,10 +735,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
735static int netwave_pcmcia_config(struct pcmcia_device *link) { 735static int netwave_pcmcia_config(struct pcmcia_device *link) {
736 struct net_device *dev = link->priv; 736 struct net_device *dev = link->priv;
737 netwave_private *priv = netdev_priv(dev); 737 netwave_private *priv = netdev_priv(dev);
738 tuple_t tuple;
739 cisparse_t parse;
740 int i, j, last_ret, last_fn; 738 int i, j, last_ret, last_fn;
741 u_char buf[64];
742 win_req_t req; 739 win_req_t req;
743 memreq_t mem; 740 memreq_t mem;
744 u_char __iomem *ramBase = NULL; 741 u_char __iomem *ramBase = NULL;
@@ -746,21 +743,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
746 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); 743 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link);
747 744
748 /* 745 /*
749 This reads the card's CONFIG tuple to find its configuration
750 registers.
751 */
752 tuple.Attributes = 0;
753 tuple.TupleData = (cisdata_t *) buf;
754 tuple.TupleDataMax = 64;
755 tuple.TupleOffset = 0;
756 tuple.DesiredTuple = CISTPL_CONFIG;
757 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
758 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
759 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
760 link->conf.ConfigBase = parse.config.base;
761 link->conf.Present = parse.config.rmask[0];
762
763 /*
764 * Try allocating IO ports. This tries a few fixed addresses. 746 * Try allocating IO ports. This tries a few fixed addresses.
765 * If you want, you can also read the card's config table to 747 * If you want, you can also read the card's config table to
766 * pick addresses -- see the serial driver for an example. 748 * pick addresses -- see the serial driver for an example.
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index bc14689cbf24..d08ae8d2726c 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -178,21 +178,6 @@ orinoco_cs_config(struct pcmcia_device *link)
178 cisparse_t parse; 178 cisparse_t parse;
179 void __iomem *mem; 179 void __iomem *mem;
180 180
181 /*
182 * This reads the card's CONFIG tuple to find its
183 * configuration registers.
184 */
185 tuple.DesiredTuple = CISTPL_CONFIG;
186 tuple.Attributes = 0;
187 tuple.TupleData = buf;
188 tuple.TupleDataMax = sizeof(buf);
189 tuple.TupleOffset = 0;
190 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
191 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
192 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
193 link->conf.ConfigBase = parse.config.base;
194 link->conf.Present = parse.config.rmask[0];
195
196 /* Look up the current Vcc */ 181 /* Look up the current Vcc */
197 CS_CHECK(GetConfigurationInfo, 182 CS_CHECK(GetConfigurationInfo,
198 pcmcia_get_configuration_info(link, &conf)); 183 pcmcia_get_configuration_info(link, &conf));
@@ -211,6 +196,10 @@ orinoco_cs_config(struct pcmcia_device *link)
211 * and most client drivers will only use the CIS to fill in 196 * and most client drivers will only use the CIS to fill in
212 * implementation-defined details. 197 * implementation-defined details.
213 */ 198 */
199 tuple.Attributes = 0;
200 tuple.TupleData = buf;
201 tuple.TupleDataMax = sizeof(buf);
202 tuple.TupleOffset = 0;
214 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 203 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
215 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 204 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
216 while (1) { 205 while (1) {
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 7fbfc9e41d07..88e10c9bc4ac 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -408,11 +408,8 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
408#define MAX_TUPLE_SIZE 128 408#define MAX_TUPLE_SIZE 128
409static int ray_config(struct pcmcia_device *link) 409static int ray_config(struct pcmcia_device *link)
410{ 410{
411 tuple_t tuple;
412 cisparse_t parse;
413 int last_fn = 0, last_ret = 0; 411 int last_fn = 0, last_ret = 0;
414 int i; 412 int i;
415 u_char buf[MAX_TUPLE_SIZE];
416 win_req_t req; 413 win_req_t req;
417 memreq_t mem; 414 memreq_t mem;
418 struct net_device *dev = (struct net_device *)link->priv; 415 struct net_device *dev = (struct net_device *)link->priv;
@@ -420,29 +417,12 @@ static int ray_config(struct pcmcia_device *link)
420 417
421 DEBUG(1, "ray_config(0x%p)\n", link); 418 DEBUG(1, "ray_config(0x%p)\n", link);
422 419
423 /* This reads the card's CONFIG tuple to find its configuration regs */
424 tuple.DesiredTuple = CISTPL_CONFIG;
425 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
426 tuple.TupleData = buf;
427 tuple.TupleDataMax = MAX_TUPLE_SIZE;
428 tuple.TupleOffset = 0;
429 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
430 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
431 link->conf.ConfigBase = parse.config.base;
432 link->conf.Present = parse.config.rmask[0];
433
434 /* Determine card type and firmware version */ 420 /* Determine card type and firmware version */
435 buf[0] = buf[MAX_TUPLE_SIZE - 1] = 0; 421 printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n",
436 tuple.DesiredTuple = CISTPL_VERS_1; 422 link->prod_id[0] ? link->prod_id[0] : " ",
437 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 423 link->prod_id[1] ? link->prod_id[1] : " ",
438 tuple.TupleData = buf; 424 link->prod_id[2] ? link->prod_id[2] : " ",
439 tuple.TupleDataMax = MAX_TUPLE_SIZE; 425 link->prod_id[3] ? link->prod_id[3] : " ");
440 tuple.TupleOffset = 2;
441 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
442
443 for (i=0; i<tuple.TupleDataLen - 4; i++)
444 if (buf[i] == 0) buf[i] = ' ';
445 printk(KERN_INFO "ray_cs Detected: %s\n",buf);
446 426
447 /* Now allocate an interrupt line. Note that this does not 427 /* Now allocate an interrupt line. Note that this does not
448 actually assign a handler to the interrupt. 428 actually assign a handler to the interrupt.
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index bcc7038130f6..cf2d1486b01d 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -647,21 +647,6 @@ spectrum_cs_config(struct pcmcia_device *link)
647 cisparse_t parse; 647 cisparse_t parse;
648 void __iomem *mem; 648 void __iomem *mem;
649 649
650 /*
651 * This reads the card's CONFIG tuple to find its
652 * configuration registers.
653 */
654 tuple.DesiredTuple = CISTPL_CONFIG;
655 tuple.Attributes = 0;
656 tuple.TupleData = buf;
657 tuple.TupleDataMax = sizeof(buf);
658 tuple.TupleOffset = 0;
659 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
660 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
661 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
662 link->conf.ConfigBase = parse.config.base;
663 link->conf.Present = parse.config.rmask[0];
664
665 /* Look up the current Vcc */ 650 /* Look up the current Vcc */
666 CS_CHECK(GetConfigurationInfo, 651 CS_CHECK(GetConfigurationInfo,
667 pcmcia_get_configuration_info(link, &conf)); 652 pcmcia_get_configuration_info(link, &conf));
@@ -681,6 +666,10 @@ spectrum_cs_config(struct pcmcia_device *link)
681 * implementation-defined details. 666 * implementation-defined details.
682 */ 667 */
683 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 668 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
669 tuple.Attributes = 0;
670 tuple.TupleData = buf;
671 tuple.TupleDataMax = sizeof(buf);
672 tuple.TupleOffset = 0;
684 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 673 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
685 while (1) { 674 while (1) {
686 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 675 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index aafb301041b1..233d906c08f0 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -3939,11 +3939,8 @@ wv_hw_reset(struct net_device * dev)
3939static inline int 3939static inline int
3940wv_pcmcia_config(struct pcmcia_device * link) 3940wv_pcmcia_config(struct pcmcia_device * link)
3941{ 3941{
3942 tuple_t tuple;
3943 cisparse_t parse;
3944 struct net_device * dev = (struct net_device *) link->priv; 3942 struct net_device * dev = (struct net_device *) link->priv;
3945 int i; 3943 int i;
3946 u_char buf[64];
3947 win_req_t req; 3944 win_req_t req;
3948 memreq_t mem; 3945 memreq_t mem;
3949 net_local * lp = netdev_priv(dev); 3946 net_local * lp = netdev_priv(dev);
@@ -3953,36 +3950,6 @@ wv_pcmcia_config(struct pcmcia_device * link)
3953 printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link); 3950 printk(KERN_DEBUG "->wv_pcmcia_config(0x%p)\n", link);
3954#endif 3951#endif
3955 3952
3956 /*
3957 * This reads the card's CONFIG tuple to find its configuration
3958 * registers.
3959 */
3960 do
3961 {
3962 tuple.Attributes = 0;
3963 tuple.DesiredTuple = CISTPL_CONFIG;
3964 i = pcmcia_get_first_tuple(link, &tuple);
3965 if(i != CS_SUCCESS)
3966 break;
3967 tuple.TupleData = (cisdata_t *)buf;
3968 tuple.TupleDataMax = 64;
3969 tuple.TupleOffset = 0;
3970 i = pcmcia_get_tuple_data(link, &tuple);
3971 if(i != CS_SUCCESS)
3972 break;
3973 i = pcmcia_parse_tuple(link, &tuple, &parse);
3974 if(i != CS_SUCCESS)
3975 break;
3976 link->conf.ConfigBase = parse.config.base;
3977 link->conf.Present = parse.config.rmask[0];
3978 }
3979 while(0);
3980 if(i != CS_SUCCESS)
3981 {
3982 cs_error(link, ParseTuple, i);
3983 return FALSE;
3984 }
3985
3986 do 3953 do
3987 { 3954 {
3988 i = pcmcia_request_io(link, &link->io); 3955 i = pcmcia_request_io(link, &link->io);
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 5b98a7876982..583e0d655a98 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1966,25 +1966,10 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
1966 */ 1966 */
1967static int wl3501_config(struct pcmcia_device *link) 1967static int wl3501_config(struct pcmcia_device *link)
1968{ 1968{
1969 tuple_t tuple;
1970 cisparse_t parse;
1971 struct net_device *dev = link->priv; 1969 struct net_device *dev = link->priv;
1972 int i = 0, j, last_fn, last_ret; 1970 int i = 0, j, last_fn, last_ret;
1973 unsigned char bf[64];
1974 struct wl3501_card *this; 1971 struct wl3501_card *this;
1975 1972
1976 /* This reads the card's CONFIG tuple to find its config registers. */
1977 tuple.Attributes = 0;
1978 tuple.DesiredTuple = CISTPL_CONFIG;
1979 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
1980 tuple.TupleData = bf;
1981 tuple.TupleDataMax = sizeof(bf);
1982 tuple.TupleOffset = 0;
1983 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
1984 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
1985 link->conf.ConfigBase = parse.config.base;
1986 link->conf.Present = parse.config.rmask[0];
1987
1988 /* Try allocating IO ports. This tries a few fixed addresses. If you 1973 /* Try allocating IO ports. This tries a few fixed addresses. If you
1989 * want, you can also read the card's config table to pick addresses -- 1974 * want, you can also read the card's config table to pick addresses --
1990 * see the serial driver for an example. */ 1975 * see the serial driver for an example. */