summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-01-17 06:54:48 +0000
committerimp <imp@FreeBSD.org>2005-01-17 06:54:48 +0000
commita4904eeb90300f98813b6ffbe307dde50c97a5f2 (patch)
tree130d8d1ac589fe59ebb73913a76f16700a22bac4
parent890aec8eb01427661b532a4654faebf0d2881fe6 (diff)
downloadFreeBSD-src-a4904eeb90300f98813b6ffbe307dde50c97a5f2.zip
FreeBSD-src-a4904eeb90300f98813b6ffbe307dde50c97a5f2.tar.gz
Go ahead and match on CIS3 and CIS4 strings as well. These are NULL
for the vast majority of our cards. However, they are critically needed to distinguish different fe based PC Cards (the FMV-182 from the 182A) which need to be treated differently (the ethernet address is loaded not from the standard CIS-based ethernet tuples, but from differing locations in attribute space based on the version string in CIS3. This should have no impact for other users of this function.
-rw-r--r--sys/dev/pccard/pccard.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 020f894..0b5ce61 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -340,6 +340,8 @@ pccard_do_product_lookup(device_t bus, device_t dev,
u_int32_t prod;
const char *vendorstr;
const char *prodstr;
+ const char *cis3str;
+ const char *cis4str;
#ifdef DIAGNOSTIC
if (sizeof *ent > ent_size)
@@ -356,6 +358,10 @@ pccard_do_product_lookup(device_t bus, device_t dev,
return (NULL);
if (pccard_get_product_str(dev, &prodstr))
return (NULL);
+ if (pccard_get_cis3_str(dev, &cis3str))
+ return (NULL);
+ if (pccard_get_cis4_str(dev, &cis4str))
+ return (NULL);
for (ent = tab; ent->pp_vendor != 0; ent =
(const struct pccard_product *) ((const char *) ent + ent_size)) {
matches = 1;
@@ -385,7 +391,14 @@ pccard_do_product_lookup(device_t bus, device_t dev,
(prodstr == NULL ||
strcmp(ent->pp_cis[1], prodstr) != 0))
matches = 0;
- /* XXX need to match cis[2] and cis[3] also XXX */
+ if (matches && ent->pp_cis[2] &&
+ (cis3str == NULL ||
+ strcmp(ent->pp_cis[2], cis3str) != 0))
+ matches = 0;
+ if (matches && ent->pp_cis[3] &&
+ (cis4str == NULL ||
+ strcmp(ent->pp_cis[3], cis4str) != 0))
+ matches = 0;
if (matchfn != NULL)
matches = (*matchfn)(dev, ent, matches);
if (matches)
OpenPOWER on IntegriCloud