NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/40120: NetBSD 5.0 BETA bge(4) driver not working correctly for some (fiber) interface cards

The following reply was made to PR kern/40120; it has been noted by GNATS.

From: Havard Eidnes <>
Subject: Re: kern/40120: NetBSD 5.0 BETA bge(4) driver not working
 correctly for some (fiber) interface cards
Date: Thu, 29 Jan 2009 16:24:26 +0100 (CET)

 one might suspect that the EINVAL comes from the driver, and
 there are precious few entries where EINVAL is returned in the
 if_bge.c driver.  With the patch below in place, I got this on
 the console when I tried to ifconfig the interface with an
 bge2: not ethernet? IFM_TYPE(ifm_media) = 0x0
 and the expected and reported error on ifconfig:
 wilma# ifconfig bge2 inet netmask 0xfffffffc
 ifconfig: SIOCAIFADDR: Invalid argument
 Index: if_bge.c
 RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
 retrieving revision
 diff -u -p -r1.152.4.1 if_bge.c
 --- if_bge.c   15 Nov 2008 02:39:17 -0000
 +++ if_bge.c   29 Jan 2009 15:15:50 -0000
 @@ -4222,8 +4222,12 @@ bge_ifmedia_upd(struct ifnet *ifp)
        /* If this is a 1000baseX NIC, enable the TBI port. */
        if (sc->bge_tbi) {
 -              if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
 +              if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) {
 +                      aprint_error_dev(sc->bge_dev, 
 +                              "not ethernet? IFM_TYPE(ifm_media) = 0x%x\n",
 +                              IFM_TYPE(ifm->ifm_media));
 +              }
                switch(IFM_SUBTYPE(ifm->ifm_media)) {
                case IFM_AUTO:
 @@ -4237,6 +4241,9 @@ bge_ifmedia_upd(struct ifnet *ifp)
 +                      aprint_error_dev(sc->bge_dev,
 +                              "Unknown media subtype: 0x%x\n",
 +                              IFM_SUBTYPE(ifm->ifm_media));
                /* XXX 802.3x flow control for 1000BASE-SX */
 So... The plot thickens.
 There's apparently something strange or wrong with the way the
 media interface is hooked up or initialized for the fibre cards.
 However, that code is unchanged since the initial import of the
 driver.  Perhaps that is the problem -- I see the "else" branch
 testing for sc->bge_tbi in bge_attach() does an mii_attach(),
 while we don't do it for the bge_tbi interfaces.  I'll need to
 get someone more familiar with the network driver infrastructure
 and MII handling specifically to take a closer look.
 - Havard

Home | Main Index | Thread Index | Old Index