diff options
author | 2006-09-17 23:31:07 +0000 | |
---|---|---|
committer | 2006-09-17 23:31:07 +0000 | |
commit | d9bcc27d1ffe7aa0a5e29611a7f0ee8fcd96bf52 (patch) | |
tree | 20df9608ed4a958ecef8228e6e09e4fffef9e50b | |
parent | No need to check for both cd_devs != NULL && cd_ndevs != 0, since the latter (diff) | |
download | wireguard-openbsd-d9bcc27d1ffe7aa0a5e29611a7f0ee8fcd96bf52.tar.xz wireguard-openbsd-d9bcc27d1ffe7aa0a5e29611a7f0ee8fcd96bf52.zip |
add a flag to indicate which boards are only capable of 10/100 modes of
operation.
-rw-r--r-- | sys/dev/pci/if_bge.c | 19 | ||||
-rw-r--r-- | sys/dev/pci/if_bgereg.h | 4 |
2 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index f0c579d546c..baf152c492d 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.179 2006/09/17 22:19:37 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.180 2006/09/17 23:31:07 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1655,6 +1655,7 @@ bge_attach(struct device *parent, struct device *self, void *aux) int rseg, gotenaddr = 0; u_int32_t hwcfg = 0; u_int32_t mac_addr = 0; + u_int32_t misccfg; struct ifnet *ifp; caddr_t kva; #ifdef __sparc64__ @@ -1771,6 +1772,22 @@ bge_attach(struct device *parent, struct device *self, void *aux) PCI_VENDOR(subid) == DELL_VENDORID) sc->bge_no_3_led = 1; + misccfg = CSR_READ_4(sc, BGE_MISC_CFG); + misccfg &= BGE_MISCCFG_BOARD_ID_MASK; + + sc->bge_10_100_only = 0; + if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703 && + (misccfg == 0x4000 || misccfg == 0x8000)) || + (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 && + PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM && + (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5901 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5901A2 || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5705F)) || + (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROADCOM && + (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5751F || + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROADCOM_BCM5753F))) + sc->bge_10_100_only = 1; + /* Try to reset the chip. */ DPRINTFN(5, ("bge_reset\n")); bge_reset(sc); diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h index fcf0be367b4..f164a77e484 100644 --- a/sys/dev/pci/if_bgereg.h +++ b/sys/dev/pci/if_bgereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bgereg.h,v 1.59 2006/09/17 22:19:38 brad Exp $ */ +/* $OpenBSD: if_bgereg.h,v 1.60 2006/09/17 23:31:07 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1728,6 +1728,7 @@ #define BGE_MISCCFG_RESET_CORE_CLOCKS 0x00000001 #define BGE_MISCCFG_TIMER_PRESCALER 0x000000FE #define BGE_MISCCFG_KEEP_GPHY_POWER 0x04000000 +#define BGE_MISCCFG_BOARD_ID_MASK 0x0001e000 #define BGE_32BITTIME_66MHZ (0x41 << 1) @@ -2363,6 +2364,7 @@ struct bge_softc { u_int8_t bge_asf_mode; u_int8_t bge_pcie; u_int8_t bge_pcix; + u_int8_t bge_10_100_only; struct bge_ring_data *bge_rdata; /* rings */ struct bge_chain_data bge_cdata; /* mbufs */ bus_dmamap_t bge_ring_map; |