From owner-freebsd-net Fri Aug 16 9:19:52 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B72537B400; Fri, 16 Aug 2002 09:19:49 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F31743E65; Fri, 16 Aug 2002 09:19:48 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g7GGJlf74392; Fri, 16 Aug 2002 09:19:47 -0700 (PDT) (envelope-from jdp@vashon.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.12.4/8.12.4/Submit) id g7GGJl2x074161; Fri, 16 Aug 2002 09:19:47 -0700 (PDT) (envelope-from jdp) Date: Fri, 16 Aug 2002 09:19:47 -0700 (PDT) Message-Id: <200208161619.g7GGJl2x074161@vashon.polstra.com> To: ambrisko@FreeBSD.org From: John Polstra Cc: net@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mii mii.c In-Reply-To: <200208072218.g77MIXPA082326@freefall.freebsd.org> References: <200208072218.g77MIXPA082326@freefall.freebsd.org> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article <200208072218.g77MIXPA082326@freefall.freebsd.org>, Doug Ambrisko wrote: > ambrisko 2002/08/07 15:18:33 PDT > > Modified files: > sys/dev/mii mii.c > Log: > Only attach one PHY device to a controller. NetBSD has similar code. > The D-Link DFE-580 card will otherwise show 2 miibuses for each controller > and therefore 2 ukphy's. [cc to -net] This change seems wrong to me. Since the MII bus is a bus and since phys have addresses on the bus, I've always assumed that the intent was to be able to have more than one phy on an MII bus. While I don't know of any NICs that actually use that feature, I hate to see it get disabled without careful consideration. If a particular NIC has a problem with this, I think the fix should be in the driver for that NIC, not in the generic MII code. See, for example, bge_miibus_readreg() in sys/dev/bge/if_bge.c. On the BCM5701 chips the phy address is not decoded, so 32 phys probe as present. The real phy is at address 1, and the driver works around the lack of decoding like this: static int bge_miibus_readreg(dev, phy, reg) device_t dev; int phy, reg; { struct bge_softc *sc; struct ifnet *ifp; u_int32_t val; int i; sc = device_get_softc(dev); ifp = &sc->arpcom.ac_if; if (sc->bge_asicrev == BGE_ASICREV_BCM5701_B5 && phy != 1) return(0); [...] Can't a similar NIC-specific hack be put into the DFE-580 driver? John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message