diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-12-17 17:43:04 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-12-17 17:43:04 +0000 |
commit | 82b99a89e16ddf4a7c201c5e53c1eb78b421861f (patch) | |
tree | 65cbb6cb4616536bf372c4c024c130f45e4e0fed /sys | |
parent | 4c00552b655095ca82f390fb416eb81f040b58a3 (diff) |
not qualifying a product based on vendor AND product ID just bugs me
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_sk.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index ef5fa715255..b24e284cbc6 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.36 2003/12/17 17:26:20 jason Exp $ */ +/* $OpenBSD: if_sk.c,v 1.37 2003/12/17 17:43:03 jason Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1273,21 +1273,26 @@ skc_attach(struct device *parent, struct device *self, void *aux) */ command = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG); - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_SCHNEIDERKOCH_GE: +#define SK_MK_ID(vnd,prd) \ + (((vnd) << PCI_VENDOR_SHIFT) | ((prd) << PCI_PRODUCT_SHIFT)) + + switch (pa->pa_id) { + case SK_MK_ID(PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_GE): sc->sk_type = SK_GENESIS; break; - case PCI_PRODUCT_SCHNEIDERKOCH_SK9821v2: - case PCI_PRODUCT_3COM_3C940: - case PCI_PRODUCT_DLINK_DGE530T: - case PCI_PRODUCT_LINKSYS_EG1032: - case PCI_PRODUCT_LINKSYS_EG1064: + case SK_MK_ID(PCI_VENDOR_3COM, PCI_PRODUCT_3COM_3C940): + case SK_MK_ID(PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE530T): + case SK_MK_ID(PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1032): + case SK_MK_ID(PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1064): + case SK_MK_ID(PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_SK_V2): + case SK_MK_ID(PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK9821v2): sc->sk_type = SK_YUKON; break; default: printf(": unknown device!\n"); goto fail; } +#undef SK_MK_ID #ifdef SK_USEIOSPACE if (!(command & PCI_COMMAND_IO_ENABLE)) { |