diff options
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 25 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 19 | ||||
-rw-r--r-- | drivers/net/pcmcia/axnet_cs.c | 6 | ||||
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 13 | ||||
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 40 | ||||
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 12 | ||||
-rw-r--r-- | drivers/net/pcmcia/pcnet_cs.c | 30 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 59 | ||||
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 28 |
10 files changed, 43 insertions, 201 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) | |||
249 | static int com20020_config(struct pcmcia_device *link) | 249 | static 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 | ||
1140 | config_undo: | 1102 | config_undo: |
1141 | unregister_netdev(dev); | 1103 | unregister_netdev(dev); |
1142 | config_failed: /* CS_EXIT_TEST() calls jump to here... */ | 1104 | config_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 | */ |
711 | static int | 711 | static int |
712 | has_ce2_string(struct pcmcia_device * link) | 712 | has_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 */ |