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.
This commit is contained in:
Warner Losh 2005-01-17 06:54:48 +00:00
parent 5e93f2e558
commit ddd8ec50b0

View File

@ -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)