diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2001-02-20 19:10:15 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2001-02-20 19:10:15 +0000 |
commit | 958bc0e1851b0ccf84cd7b3152088db6a9a5f961 (patch) | |
tree | 5df8235eda4b5f878dcffc158e755880d7e4c616 /sys | |
parent | a8326e8aeba4858c41b98da2c7b0d396fa6425a5 (diff) |
Use table driven device list
Add Dlink 530TX+ (thanks to Jarrett Byrnes <jearbear@arrr.net> for testing)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_rl.c | 40 | ||||
-rw-r--r-- | sys/dev/pci/if_rlreg.h | 3 |
2 files changed, 19 insertions, 24 deletions
diff --git a/sys/dev/pci/if_rl.c b/sys/dev/pci/if_rl.c index 58965a0a296..7b0bb6a1007 100644 --- a/sys/dev/pci/if_rl.c +++ b/sys/dev/pci/if_rl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl.c,v 1.24 2001/02/17 07:52:44 jason Exp $ */ +/* $OpenBSD: if_rl.c,v 1.25 2001/02/20 19:10:14 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -181,6 +181,16 @@ void rl_setmulti __P((struct rl_softc *)); void rl_reset __P((struct rl_softc *)); int rl_list_tx_init __P((struct rl_softc *)); +struct rl_type rl_devs[] = { + { PCI_VENDOR_ACCTON, PCI_PRODUCT_ACCTON_5030 }, + { PCI_VENDOR_ADDTRON, PCI_PRODUCT_ADDTRON_8139 }, + { PCI_VENDOR_DELTA, PCI_PRODUCT_DELTA_8139 }, + { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_530TXPLUS }, + { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129 }, + { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139 }, + { 0, 0 } +}; + #define EE_SET(x) \ CSR_WRITE_1(sc, RL_EECMD, \ CSR_READ_1(sc, RL_EECMD) | x) @@ -1224,29 +1234,15 @@ rl_probe(parent, match, aux) void *match; void *aux; { - struct pci_attach_args *pa = (struct pci_attach_args *) aux; - - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ACCTON && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ACCTON_5030) - return (1); - - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ADDTRON && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADDTRON_8139) - return (1); - - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_DELTA && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DELTA_8139) - return (1); - - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK) { - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_REALTEK_RT8129: - case PCI_PRODUCT_REALTEK_RT8139: + struct pci_attach_args *pa = (struct pci_attach_args *)aux; + struct rl_type *t; + + for (t = rl_devs; t->rl_vid != 0; t++) { + if ((PCI_VENDOR(pa->pa_id) == t->rl_vid) && + (PCI_PRODUCT(pa->pa_id) == t->rl_did)) return (1); - } } - - return 0; + return (0); } void diff --git a/sys/dev/pci/if_rlreg.h b/sys/dev/pci/if_rlreg.h index 510ffaf7079..5e7025f99ec 100644 --- a/sys/dev/pci/if_rlreg.h +++ b/sys/dev/pci/if_rlreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rlreg.h,v 1.11 2001/02/03 05:46:17 mickey Exp $ */ +/* $OpenBSD: if_rlreg.h,v 1.12 2001/02/20 19:10:14 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -333,7 +333,6 @@ struct rl_chain_data { struct rl_type { u_int16_t rl_vid; u_int16_t rl_did; - char *rl_name; }; struct rl_mii_frame { |