aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-10-25 21:28:53 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2006-12-04 20:09:20 -0500
commitefd50585e2ff9bd60e044fda7764d323010a7fe4 (patch)
treef43f8f10a3cfe6ceb1b5cede6581f79134ca0e63 /drivers/net
parent44e5e33e99e1b955ac6f0bb26abd9380629b48a9 (diff)
[PATCH] pcmcia: remove manf_id and card_id indirection
As we read out the manufactor and card_id from the PCMCIA device in the PCMCIA core, and device drivers can access those reliably in struct pcmcia_device's fields manf_id and card_id, remove additional (and partly broken) manf_id and card_id detection logic from PCMCIA device drivers. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/pcmcia/3c589_cs.c12
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c26
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c22
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c8
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c7
5 files changed, 23 insertions, 52 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 231fa2c9ec6c..eb5783294489 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -272,17 +272,13 @@ static int tc589_config(struct pcmcia_device *link)
272 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 272 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
273 link->conf.ConfigBase = parse.config.base; 273 link->conf.ConfigBase = parse.config.base;
274 link->conf.Present = parse.config.rmask[0]; 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; 275 tuple.Attributes = TUPLE_RETURN_COMMON;
279 if ((pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) && 276
280 (pcmcia_get_tuple_data(link, &tuple) == CS_SUCCESS)) { 277 /* Is this a 3c562? */
281 if (le16_to_cpu(buf[0]) != MANFID_3COM) 278 if (link->manf_id != MANFID_3COM)
282 printk(KERN_INFO "3c589_cs: hmmm, is this really a " 279 printk(KERN_INFO "3c589_cs: hmmm, is this really a "
283 "3Com card??\n"); 280 "3Com card??\n");
284 multi = (le16_to_cpu(buf[1]) == PRODID_3COM_3C562); 281 multi = (link->card_id == PRODID_3COM_3C562);
285 }
286 282
287 /* For the 3c562, the base address must be xx00-xx7f */ 283 /* For the 3c562, the base address must be xx00-xx7f */
288 link->io.IOAddrLines = 16; 284 link->io.IOAddrLines = 16;
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 65f6fdf43725..e3731fd15606 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -374,17 +374,12 @@ static int fmvj18x_config(struct pcmcia_device *link)
374 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 374 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
375 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); 375 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
376 link->conf.ConfigIndex = parse.cftable_entry.index; 376 link->conf.ConfigIndex = parse.cftable_entry.index;
377 tuple.DesiredTuple = CISTPL_MANFID; 377 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: 378 case MANFID_TDK:
384 cardtype = TDK; 379 cardtype = TDK;
385 if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410 380 if (link->card_id == PRODID_TDK_GN3410
386 || le16_to_cpu(buf[1]) == PRODID_TDK_NP9610 381 || link->card_id == PRODID_TDK_NP9610
387 || le16_to_cpu(buf[1]) == PRODID_TDK_MN3200) { 382 || link->card_id == PRODID_TDK_MN3200) {
388 /* MultiFunction Card */ 383 /* MultiFunction Card */
389 link->conf.ConfigBase = 0x800; 384 link->conf.ConfigBase = 0x800;
390 link->conf.ConfigIndex = 0x47; 385 link->conf.ConfigIndex = 0x47;
@@ -395,11 +390,11 @@ static int fmvj18x_config(struct pcmcia_device *link)
395 cardtype = CONTEC; 390 cardtype = CONTEC;
396 break; 391 break;
397 case MANFID_FUJITSU: 392 case MANFID_FUJITSU:
398 if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10302) 393 if (link->card_id == PRODID_FUJITSU_MBH10302)
399 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302), 394 /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
400 but these are MBH10304 based card. */ 395 but these are MBH10304 based card. */
401 cardtype = MBH10304; 396 cardtype = MBH10304;
402 else if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) 397 else if (link->card_id == PRODID_FUJITSU_MBH10304)
403 cardtype = MBH10304; 398 cardtype = MBH10304;
404 else 399 else
405 cardtype = LA501; 400 cardtype = LA501;
@@ -409,14 +404,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
409 } 404 }
410 } else { 405 } else {
411 /* old type card */ 406 /* old type card */
412 tuple.DesiredTuple = CISTPL_MANFID; 407 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: 408 case MANFID_FUJITSU:
419 if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304) { 409 if (link->card_id == PRODID_FUJITSU_MBH10304) {
420 cardtype = XXX10304; /* MBH10304 with buggy CIS */ 410 cardtype = XXX10304; /* MBH10304 with buggy CIS */
421 link->conf.ConfigIndex = 0x20; 411 link->conf.ConfigIndex = 0x20;
422 } else { 412 } else {
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index c51cc5d8789a..430a41e7b686 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -519,7 +519,7 @@ 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
@@ -536,14 +536,6 @@ static int pcnet_config(struct pcmcia_device *link)
536 link->conf.ConfigBase = parse.config.base; 536 link->conf.ConfigBase = parse.config.base;
537 link->conf.Present = parse.config.rmask[0]; 537 link->conf.Present = parse.config.rmask[0];
538 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; 539 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
548 tuple.Attributes = 0; 540 tuple.Attributes = 0;
549 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 541 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -589,8 +581,8 @@ static int pcnet_config(struct pcmcia_device *link)
589 link->conf.Attributes |= CONF_ENABLE_SPKR; 581 link->conf.Attributes |= CONF_ENABLE_SPKR;
590 link->conf.Status = CCSR_AUDIO_ENA; 582 link->conf.Status = CCSR_AUDIO_ENA;
591 } 583 }
592 if ((manfid == MANFID_IBM) && 584 if ((link->manf_id == MANFID_IBM) &&
593 (prodid == PRODID_IBM_HOME_AND_AWAY)) 585 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
594 link->conf.ConfigIndex |= 0x10; 586 link->conf.ConfigIndex |= 0x10;
595 587
596 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 588 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
@@ -624,10 +616,10 @@ static int pcnet_config(struct pcmcia_device *link)
624 info->flags = hw_info->flags; 616 info->flags = hw_info->flags;
625 /* Check for user overrides */ 617 /* Check for user overrides */
626 info->flags |= (delay_output) ? DELAY_OUTPUT : 0; 618 info->flags |= (delay_output) ? DELAY_OUTPUT : 0;
627 if ((manfid == MANFID_SOCKET) && 619 if ((link->manf_id == MANFID_SOCKET) &&
628 ((prodid == PRODID_SOCKET_LPE) || 620 ((link->card_id == PRODID_SOCKET_LPE) ||
629 (prodid == PRODID_SOCKET_LPE_CF) || 621 (link->card_id == PRODID_SOCKET_LPE_CF) ||
630 (prodid == PRODID_SOCKET_EIO))) 622 (link->card_id == PRODID_SOCKET_EIO)))
631 info->flags &= ~USE_BIG_BUF; 623 info->flags &= ~USE_BIG_BUF;
632 if (!use_big_buf) 624 if (!use_big_buf)
633 info->flags &= ~USE_BIG_BUF; 625 info->flags &= ~USE_BIG_BUF;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 20fcc3576202..ae024bfc1ae4 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -999,12 +999,8 @@ static int smc91c92_config(struct pcmcia_device *link)
999 link->conf.ConfigBase = parse->config.base; 999 link->conf.ConfigBase = parse->config.base;
1000 link->conf.Present = parse->config.rmask[0]; 1000 link->conf.Present = parse->config.rmask[0];
1001 1001
1002 tuple->DesiredTuple = CISTPL_MANFID; 1002 smc->manfid = link->manf_id;
1003 tuple->Attributes = TUPLE_RETURN_COMMON; 1003 smc->cardid = link->card_id;
1004 if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
1005 smc->manfid = parse->manfid.manf;
1006 smc->cardid = parse->manfid.card;
1007 }
1008 1004
1009 if ((smc->manfid == MANFID_OSITECH) && 1005 if ((smc->manfid == MANFID_OSITECH) &&
1010 (smc->cardid != PRODID_OSITECH_SEVEN)) { 1006 (smc->cardid != PRODID_OSITECH_SEVEN)) {
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index f63909e4bc32..8a7984bc8afc 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;