From d93d282620353e0a31e1180454b3c671ad580438 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 28 Aug 2001 00:40:18 +0000 Subject: [PATCH] Add support for the 3c656B cardbus adapter. This is one half of a dual function card. It needs pretty much the same flags as the 656C, except that it seems to need both the INVERT_MII_PWR and INVERT_LED_PWR flags set. Tested with cardbus in -current as of today. Also added support for the 3c656, which looks to be the same as the 656B, except it doesn't need the EEPROM_8BIT flag. I think. This one is untested, but the added support should not break any of the other cards. --- sys/pci/if_xl.c | 25 ++++++++++++++++++++----- sys/pci/if_xlreg.h | 4 +++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 76fdc2f2737a..dca74ee14fcc 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -60,7 +60,9 @@ * 3Com 3c575TX 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) * 3Com 3c575B 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) * 3Com 3c575C 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) - * 3Com 3cxfem656c 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) + * 3Com 3cxfem656 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) + * 3Com 3cxfem656b 10/100Mbps/RJ-45 (Cardbus, Hurricane ASIC) + * 3Com 3cxfem656c 10/100Mbps/RJ-45 (Cardbus, Tornado ASIC) * Dell Optiplex GX1 on-board 3c918 10/100Mbps/RJ-45 * Dell on-board 3c920 10/100Mbps/RJ-45 * Dell Precision on-board 3c905B 10/100Mbps/RJ-45 @@ -201,7 +203,11 @@ static struct xl_type xl_devs[] = { "3Com 3c575B Fast Etherlink XL" }, { TC_VENDORID, TC_DEVICEID_HURRICANE_575C, "3Com 3c575C Fast Etherlink XL" }, - { TC_VENDORID, TC_DEVICEID_HURRICANE_656C, + { TC_VENDORID, TC_DEVICEID_HURRICANE_656, + "3Com 3c656 Fast Etherlink XL" }, + { TC_VENDORID, TC_DEVICEID_HURRICANE_656B, + "3Com 3c656B Fast Etherlink XL" }, + { TC_VENDORID, TC_DEVICEID_TORNADO_656C, "3Com 3c656C Fast Etherlink XL" }, { 0, 0, NULL } }; @@ -1184,7 +1190,9 @@ static void xl_choose_xcvr(sc, verbose) case TC_DEVICEID_HURRICANE_575A: /* 3c575TX */ case TC_DEVICEID_HURRICANE_575B: /* 3c575B */ case TC_DEVICEID_HURRICANE_575C: /* 3c575C */ - case TC_DEVICEID_HURRICANE_656C: /* 3c565C */ + case TC_DEVICEID_HURRICANE_656: /* 3c656 */ + case TC_DEVICEID_HURRICANE_656B: /* 3c656B */ + case TC_DEVICEID_TORNADO_656C: /* 3c656C */ sc->xl_media = XL_MEDIAOPT_MII; sc->xl_xcvr = XL_XCVR_MII; if (verbose) @@ -1257,15 +1265,22 @@ static int xl_attach(dev) if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_575A || pci_get_device(dev) == TC_DEVICEID_HURRICANE_575B || pci_get_device(dev) == TC_DEVICEID_HURRICANE_575C || - pci_get_device(dev) == TC_DEVICEID_HURRICANE_656C) + pci_get_device(dev) == TC_DEVICEID_HURRICANE_656B || + pci_get_device(dev) == TC_DEVICEID_TORNADO_656C) sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK | XL_FLAG_EEPROM_OFFSET_30 | XL_FLAG_8BITROM; + if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_656) + sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK; if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_575B) sc->xl_flags |= XL_FLAG_INVERT_LED_PWR; if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_575C) sc->xl_flags |= XL_FLAG_INVERT_MII_PWR; - if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_656C) + if (pci_get_device(dev) == TC_DEVICEID_TORNADO_656C) sc->xl_flags |= XL_FLAG_INVERT_MII_PWR; + if (pci_get_device(dev) == TC_DEVICEID_HURRICANE_656 || + pci_get_device(dev) == TC_DEVICEID_HURRICANE_656B) + sc->xl_flags |= XL_FLAG_INVERT_MII_PWR | + XL_FLAG_INVERT_LED_PWR; /* * If this is a 3c905B, we have to check one extra thing. diff --git a/sys/pci/if_xlreg.h b/sys/pci/if_xlreg.h index bd4ca77d4abc..8a06e43f8bb7 100644 --- a/sys/pci/if_xlreg.h +++ b/sys/pci/if_xlreg.h @@ -667,7 +667,9 @@ struct xl_stats { #define TC_DEVICEID_HURRICANE_575A 0x5057 #define TC_DEVICEID_HURRICANE_575B 0x5157 #define TC_DEVICEID_HURRICANE_575C 0x5257 -#define TC_DEVICEID_HURRICANE_656C 0x6564 +#define TC_DEVICEID_HURRICANE_656 0x6560 +#define TC_DEVICEID_HURRICANE_656B 0x6562 +#define TC_DEVICEID_TORNADO_656C 0x6564 /* * PCI low memory base and low I/O base register, and