NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/47750: if_dge does not recognize Intel PRO/10GbE SR adapter
>Number: 47750
>Category: kern
>Synopsis: if_dge does not recognize Intel PRO/10GbE SR adapter
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Apr 20 03:35:01 +0000 2013
>Originator: MASUDA Hideo
>Release: NetBSD/i386 6.0
>Organization:
>Environment:
NetBSD pe2600-1.dsm.cis.kit.ac.jp 6.0 NetBSD 6.0 (GENERIC) i386
>Description:
if_dge does not recognize Intel PRO/10GbE SR adapter.
% pcictl /dev/pci0 list
005:05:0: Intel product 0x1a48 (ethernet network, revision 0x02)
% dmesg
vendor 0x8086 product 0x1a48 (ethernet network, revision 0x02) at pci5 dev 5
function 0 not configured
>How-To-Repeat:
Install Intel PRO/10GbE SR adapter and boot NetBSD.
>Fix:
The following patch works well on my machine.
% dmesg | grep dge0
dge0 at pci5 dev 5 function 0: Intel i82597EX 10GbE-SR Ethernet (rev. 0x02)
dge0: interrupting at ioapic2 pin 4
dge0: 64-bit 100MHz PCIX bus
dge0: Ethernet address 00:0e:0c:5a:94:22
Index: if_dge.c
===================================================================
RCS file: /cvs/cvsroot/src/sys/dev/pci/if_dge.c,v
retrieving revision 1.34
diff -u -r1.34 if_dge.c
--- if_dge.c 2 Feb 2012 19:43:05 -0000 1.34
+++ if_dge.c 20 Apr 2013 02:58:19 -0000
@@ -256,6 +256,7 @@
int sc_bus_speed; /* PCI/PCIX bus speed */
int sc_pcix_offset; /* PCIX capability register offset */
+ const struct dge_product *sc_dgep; /* Pointer to the dge_product entry */
pci_chipset_tag_t sc_pc;
pcitag_t sc_pt;
int sc_mmrbc; /* Max PCIX memory read byte count */
@@ -455,6 +456,30 @@
} while (/*CONSTCOND*/0)
#endif
+/*
+ * Devices supported by this driver.
+ */
+static const struct dge_product {
+ pci_vendor_id_t dgep_vendor;
+ pci_product_id_t dgep_product;
+ const char *dgep_name;
+ int dgep_flags;
+#define DGEP_F_10G_LR 0x01
+#define DGEP_F_10G_SR 0x02
+} dge_products[] = {
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82597EX,
+ "Intel i82597EX 10GbE-LR Ethernet",
+ DGEP_F_10G_LR },
+
+ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82597EX_SR,
+ "Intel i82597EX 10GbE-SR Ethernet",
+ DGEP_F_10G_SR },
+
+ { 0, 0,
+ NULL,
+ 0 },
+};
+
#ifdef DGE_OFFBYONE_RXBUG
/*
* Allocation constants. Much memory may be used for this.
@@ -644,14 +669,26 @@
static char (*dge_txseg_evcnt_names)[DGE_NTXSEGS][8 /* "txseg00" + \0 */];
#endif /* DGE_EVENT_COUNTERS */
+static const struct dge_product *
+dge_lookup(const struct pci_attach_args *pa)
+{
+ const struct dge_product *dgep;
+
+ for (dgep = dge_products; dgep->dgep_name != NULL; dgep++) {
+ if (PCI_VENDOR(pa->pa_id) == dgep->dgep_vendor &&
+ PCI_PRODUCT(pa->pa_id) == dgep->dgep_product)
+ return dgep;
+ }
+ return NULL;
+}
+
static int
dge_match(device_t parent, cfdata_t cf, void *aux)
{
struct pci_attach_args *pa = aux;
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INTEL &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INTEL_82597EX)
- return (1);
+ if (dge_lookup(pa) != NULL)
+ return 1;
return (0);
}
@@ -670,13 +707,20 @@
uint8_t enaddr[ETHER_ADDR_LEN];
pcireg_t preg, memtype;
uint32_t reg;
+ const struct dge_product *dgep;
+
+ sc->sc_dgep = dgep = dge_lookup(pa);
+ if (dgep == NULL) {
+ printf("\n");
+ panic("dge_attach: impossible");
+ }
sc->sc_dmat = pa->pa_dmat;
sc->sc_pc = pa->pa_pc;
sc->sc_pt = pa->pa_tag;
pci_aprint_devinfo_fancy(pa, "Ethernet controller",
- "Intel i82597EX 10GbE-LR Ethernet", 1);
+ dgep->dgep_name, 1);
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, DGE_PCI_BAR);
if (pci_mapreg_map(pa, DGE_PCI_BAR, memtype, 0,
@@ -862,8 +906,13 @@
*/
ifmedia_init(&sc->sc_media, IFM_IMASK, dge_xgmii_mediachange,
dge_xgmii_mediastatus);
- ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_10G_LR, 0, NULL);
- ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_10G_LR);
+ if (dgep->dgep_flags & DGEP_F_10G_SR) {
+ ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_10G_SR, 0, NULL);
+ ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_10G_SR);
+ } else { /* XXX default is LR */
+ ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_10G_LR, 0, NULL);
+ ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_10G_LR);
+ }
ifp = &sc->sc_ethercom.ec_if;
strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ);
@@ -2357,7 +2406,11 @@
struct dge_softc *sc = ifp->if_softc;
ifmr->ifm_status = IFM_AVALID;
- ifmr->ifm_active = IFM_ETHER|IFM_10G_LR;
+ if (sc->sc_dgep->dgep_flags & DGEP_F_10G_SR ) {
+ ifmr->ifm_active = IFM_ETHER|IFM_10G_SR;
+ } else {
+ ifmr->ifm_active = IFM_ETHER|IFM_10G_LR;
+ }
if (CSR_READ(sc, DGE_STATUS) & STATUS_LINKUP)
ifmr->ifm_status |= IFM_ACTIVE;
Index: pcidevs
===================================================================
RCS file: /cvs/cvsroot/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1102.2.11
diff -u -r1.1102.2.11 pcidevs
--- pcidevs 22 Nov 2012 17:46:09 -0000 1.1102.2.11
+++ pcidevs 20 Apr 2013 02:58:27 -0000
@@ -2501,6 +2501,7 @@
product INTEL PRO_100_VE_4 0x103d PRO/100 VE (MOB) Network Controller
product INTEL PRO_100_VM_5 0x103e PRO/100 VM (MOB) Network Controller
product INTEL PRO_WL_2100 0x1043 PRO/Wireless LAN 2100 3B Mini-PCI Adapter
+product INTEL 82597EX_SR 0x1a48 PRO/10GbE SR Server Adapter
product INTEL 82597EX 0x1048 PRO/10GbE LR Server Adapter
product INTEL 82801H_M_AMT 0x1049 i82801H (M_AMT) LAN Controller
product INTEL 82801H_AMT 0x104a i82801H (AMT) LAN Controller
Home |
Main Index |
Thread Index |
Old Index