Emit a warning when a card matches multiple entries in our table. A
number of cards have been discovered to be matching on the strings of the cis rather than manufacturer/product id for cards we already had a prod id for. This is a result of getting the list from the NetBSD driver which also includes the OID for the cards where such a distinction mattered (since it was tested against the MAC address we got from the card). Since we do not try to match OIDs, we do not need the extra entries and they just waste space. I'm guessing that some of the dlink entires (DE-660, DE-660+) and many of the corega cards may fall into this boat and can safely be removed.
This commit is contained in:
parent
33521176c6
commit
e51bf22777
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150581
@ -238,11 +238,27 @@ static void ed_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
static int ed_pccard_ax88x90(device_t dev, const struct ed_product *);
|
||||
|
||||
static void
|
||||
ed_pccard_print_entry(const struct ed_product *pp)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf("Product entry: ");
|
||||
if (pp->prod.pp_name)
|
||||
printf("name='%s',", pp->prod.pp_name);
|
||||
printf("vendor=%#x,product=%#x", pp->prod.pp_vendor,
|
||||
pp->prod.pp_product);
|
||||
for (i = 0; i < 4; i++)
|
||||
if (pp->prod.pp_cis[i])
|
||||
printf(",CIS%d='%s'", i, pp->prod.pp_cis[i]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static int
|
||||
ed_pccard_probe(device_t dev)
|
||||
{
|
||||
const struct ed_product *pp;
|
||||
int error;
|
||||
const struct ed_product *pp, *pp2;
|
||||
int error, first = 1;
|
||||
uint32_t fcn = PCCARD_FUNCTION_UNSPEC;
|
||||
|
||||
/* Make sure we're a network function */
|
||||
@ -262,6 +278,23 @@ ed_pccard_probe(device_t dev)
|
||||
if (!(pp->flags & NE2000DVF_ANYFUNC) &&
|
||||
fcn != PCCARD_FUNCTION_NETWORK)
|
||||
return (ENXIO);
|
||||
/*
|
||||
* Some devices match multiple entries. Report that
|
||||
* as a warning to help cull the table
|
||||
*/
|
||||
pp2 = pp;
|
||||
while ((pp2 = (const struct ed_product *)pccard_product_lookup(
|
||||
dev, (const struct pccard_product *)(pp2 + 1),
|
||||
sizeof(ed_pccard_products[0]), NULL)) != NULL) {
|
||||
if (first) {
|
||||
device_printf(dev,
|
||||
"Warning: card matches multiple entries. Report to imp@freebsd.org\n");
|
||||
ed_pccard_print_entry(pp);
|
||||
first = 0;
|
||||
}
|
||||
ed_pccard_print_entry(pp2);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
return (ENXIO);
|
||||
|
Loading…
Reference in New Issue
Block a user