diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2009-05-12 17:43:17 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2009-05-12 17:43:17 +0000 |
commit | 050a5ae65e5676a9c2f3f581c6887b30334a9735 (patch) | |
tree | f783562f98e54fae4ab10cb1467df6bb43b3a95a /sys | |
parent | 7459f43e97c1a4714402177d5284862b927923c1 (diff) |
fix EDIMAX attachment.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/cardbus/if_ral_cardbus.c | 60 | ||||
-rw-r--r-- | sys/dev/pci/if_ral_pci.c | 37 |
2 files changed, 55 insertions, 42 deletions
diff --git a/sys/dev/cardbus/if_ral_cardbus.c b/sys/dev/cardbus/if_ral_cardbus.c index e7b4bb78d79..b2e6e2ec710 100644 --- a/sys/dev/cardbus/if_ral_cardbus.c +++ b/sys/dev/cardbus/if_ral_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral_cardbus.c,v 1.13 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: if_ral_cardbus.c,v 1.14 2009/05/12 17:43:16 damien Exp $ */ /*- * Copyright (c) 2005-2007 @@ -106,15 +106,22 @@ struct cfattach ral_cardbus_ca = { }; static const struct cardbus_matchid ral_cardbus_devices[] = { - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2560 }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2561 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2560 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2561 }, { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2561S }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2661 }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2860 }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2890 }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2760 }, - { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2790 }, - { PCI_VENDOR_AWT, PCI_PRODUCT_AWT_RT2890 } + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2661 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2860 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2890 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2760 }, + { PCI_VENDOR_RALINK, PCI_PRODUCT_RALINK_RT2790 }, + { PCI_VENDOR_AWT, PCI_PRODUCT_AWT_RT2890 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_1 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_2 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_3 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_4 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_5 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_6 }, + { PCI_VENDOR_EDIMAX, PCI_PRODUCT_EDIMAX_RT2860_7 } }; int ral_cardbus_enable(struct rt2560_softc *); @@ -139,24 +146,27 @@ ral_cardbus_attach(struct device *parent, struct device *self, void *aux) bus_addr_t base; int error; - switch (CARDBUS_PRODUCT(ca->ca_id)) { - case PCI_PRODUCT_RALINK_RT2560: - csc->sc_opns = &ral_rt2560_opns; - break; - case PCI_PRODUCT_RALINK_RT2561: - case PCI_PRODUCT_RALINK_RT2561S: - case PCI_PRODUCT_RALINK_RT2661: - csc->sc_opns = &ral_rt2661_opns; - break; - case PCI_PRODUCT_RALINK_RT2860: - case PCI_PRODUCT_RALINK_RT2890: - case PCI_PRODUCT_RALINK_RT2760: - case PCI_PRODUCT_RALINK_RT2790: - case PCI_PRODUCT_AWT_RT2890: + if (CARDBUS_VENDOR(ca->ca_id) == PCI_VENDOR_RALINK) { + switch (CARDBUS_PRODUCT(ca->ca_id)) { + case PCI_PRODUCT_RALINK_RT2560: + csc->sc_opns = &ral_rt2560_opns; + break; + case PCI_PRODUCT_RALINK_RT2561: + case PCI_PRODUCT_RALINK_RT2561S: + case PCI_PRODUCT_RALINK_RT2661: + csc->sc_opns = &ral_rt2661_opns; + break; + case PCI_PRODUCT_RALINK_RT2860: + case PCI_PRODUCT_RALINK_RT2890: + case PCI_PRODUCT_RALINK_RT2760: + case PCI_PRODUCT_RALINK_RT2790: + csc->sc_opns = &ral_rt2860_opns; + break; + } + } else { + /* all other vendors are RT2860 only */ csc->sc_opns = &ral_rt2860_opns; - break; } - sc->sc_dmat = ca->ca_dmat; csc->sc_ct = ct; csc->sc_tag = ca->ca_tag; diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c index 3c5943e2da3..561e924697f 100644 --- a/sys/dev/pci/if_ral_pci.c +++ b/sys/dev/pci/if_ral_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral_pci.c,v 1.16 2009/05/11 19:49:14 damien Exp $ */ +/* $OpenBSD: if_ral_pci.c,v 1.17 2009/05/12 17:43:16 damien Exp $ */ /*- * Copyright (c) 2005-2007 @@ -140,24 +140,27 @@ ral_pci_attach(struct device *parent, struct device *self, void *aux) pcireg_t memtype; int error; - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_RALINK_RT2560: - psc->sc_opns = &ral_rt2560_opns; - break; - case PCI_PRODUCT_RALINK_RT2561: - case PCI_PRODUCT_RALINK_RT2561S: - case PCI_PRODUCT_RALINK_RT2661: - psc->sc_opns = &ral_rt2661_opns; - break; - case PCI_PRODUCT_RALINK_RT2860: - case PCI_PRODUCT_RALINK_RT2890: - case PCI_PRODUCT_RALINK_RT2760: - case PCI_PRODUCT_RALINK_RT2790: - case PCI_PRODUCT_AWT_RT2890: + if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_RALINK) { + switch (PCI_PRODUCT(pa->pa_id)) { + case PCI_PRODUCT_RALINK_RT2560: + psc->sc_opns = &ral_rt2560_opns; + break; + case PCI_PRODUCT_RALINK_RT2561: + case PCI_PRODUCT_RALINK_RT2561S: + case PCI_PRODUCT_RALINK_RT2661: + psc->sc_opns = &ral_rt2661_opns; + break; + case PCI_PRODUCT_RALINK_RT2860: + case PCI_PRODUCT_RALINK_RT2890: + case PCI_PRODUCT_RALINK_RT2760: + case PCI_PRODUCT_RALINK_RT2790: + psc->sc_opns = &ral_rt2860_opns; + break; + } + } else { + /* all other vendors are RT2860 only */ psc->sc_opns = &ral_rt2860_opns; - break; } - sc->sc_dmat = pa->pa_dmat; psc->sc_pc = pa->pa_pc; |