diff options
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r-- | drivers/net/pcmcia/fmvj18x_cs.c | 40 |
1 files changed, 9 insertions, 31 deletions
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 { |