Date: Fri, 16 Aug 2002 09:19:47 -0700 (PDT) From: John Polstra <jdp@polstra.com> To: ambrisko@FreeBSD.org Cc: net@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mii mii.c Message-ID: <200208161619.g7GGJl2x074161@vashon.polstra.com> In-Reply-To: <200208072218.g77MIXPA082326@freefall.freebsd.org> References: <200208072218.g77MIXPA082326@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <200208072218.g77MIXPA082326@freefall.freebsd.org>,
Doug Ambrisko <ambrisko@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208161619.g7GGJl2x074161>
