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 <he%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost, pettai%nordu.net@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
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)

 Hi,
 
 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
 address:
 
 bge2: not ethernet? IFM_TYPE(ifm_media) = 0x0
 
 and the expected and reported error on ifconfig:
 
 wilma# ifconfig bge2 inet 130.242.82.186 netmask 0xfffffffc
 ifconfig: SIOCAIFADDR: Invalid argument
 wilma# 
 
 Index: if_bge.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
 retrieving revision 1.152.4.1
 diff -u -p -r1.152.4.1 if_bge.c
 --- if_bge.c   15 Nov 2008 02:39:17 -0000      1.152.4.1
 +++ 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));
                        return(EINVAL);
 +              }
                switch(IFM_SUBTYPE(ifm->ifm_media)) {
                case IFM_AUTO:
                        break;
 @@ -4237,6 +4241,9 @@ bge_ifmedia_upd(struct ifnet *ifp)
                        }
                        break;
                default:
 +                      aprint_error_dev(sc->bge_dev,
 +                              "Unknown media subtype: 0x%x\n",
 +                              IFM_SUBTYPE(ifm->ifm_media));
                        return(EINVAL);
                }
                /* 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.
 
 Regards,
 
 - Havard
 


Home | Main Index | Thread Index | Old Index