summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-09-26 18:27:13 +0000
committerimp <imp@FreeBSD.org>2005-09-26 18:27:13 +0000
commite687ce442085a3d7ae4ecabe2ed57cbbaaaa6e4c (patch)
tree1198145ad350f8447812cd98a2a562983cbef933 /sys/dev/ed
parent45711c9160386e88567584e664ea79706fa3d273 (diff)
downloadFreeBSD-src-e687ce442085a3d7ae4ecabe2ed57cbbaaaa6e4c.zip
FreeBSD-src-e687ce442085a3d7ae4ecabe2ed57cbbaaaa6e4c.tar.gz
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.
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed_pccard.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 0284828..9c3cd9a 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -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);
OpenPOWER on IntegriCloud