From owner-freebsd-net Fri Aug 16 16: 0:11 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 85A0937B400 for ; Fri, 16 Aug 2002 16:00:04 -0700 (PDT) Received: from ambrisko.com (adsl-64-174-51-42.dsl.snfc21.pacbell.net [64.174.51.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id E24D643E72 for ; Fri, 16 Aug 2002 16:00:03 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.11.6/8.11.6) id g7GMxYp99777; Fri, 16 Aug 2002 15:59:34 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200208162259.g7GMxYp99777@ambrisko.com> Subject: Re: cvs commit: src/sys/dev/mii mii.c In-Reply-To: <200208162217.g7GMHSei074716@vashon.polstra.com> To: John Polstra Date: Fri, 16 Aug 2002 15:59:33 -0700 (PDT) Cc: net@freebsd.org X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 John Polstra writes: | In article <200208162027.g7GKRjE95057@ambrisko.com>, | Doug Ambrisko wrote: | > John Polstra writes: | > | 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. | > | > Although I don't disagree that you have a potential solution. I question | > whether there isn't a technical issue if you have multiple PHY's | > attached to a NIC. In the current stuff how would you ifconfig the | > other PHYs? If you can't access the other PHYs then why attach them. | | I think Matthew Dodd's answer is right, that the code assumes only | one of the PHYs supports any given media type. Just about all of | the MII code (e.g., mii_mediachg()) communicates with every PHY when | a significant event happens. If the media is changed to something | that the currently active PHY can't handle, it should disable itself | appropriately so it stays out of the way. Okay how about this patch to revert the mii change and only probe the first PHY. I tested it on -stable and I'm now testing it on -current. Thanks, Index: pci/if_ste.c =================================================================== RCS file: /home/ncvs/src/sys/pci/if_ste.c,v retrieving revision 1.14.2.6 diff -u -r1.14.2.6 if_ste.c --- pci/if_ste.c 14 Aug 2002 15:03:16 -0000 1.14.2.6 +++ pci/if_ste.c 16 Aug 2002 22:48:34 -0000 @@ -383,6 +383,9 @@ sc = device_get_softc(dev); + if (phy != 0) + return (0); + bzero((char *)&frame, sizeof(frame)); frame.mii_phyaddr = phy; Index: dev/mii/mii.c =================================================================== RCS file: /home/ncvs/src/sys/dev/mii/mii.c,v retrieving revision 1.6.2.1 diff -u -r1.6.2.1 mii.c --- dev/mii/mii.c 14 Aug 2002 14:59:16 -0000 1.6.2.1 +++ dev/mii/mii.c 16 Aug 2002 22:48:34 -0000 @@ -106,17 +106,14 @@ { struct mii_attach_args ma, *args; struct mii_data *mii; - device_t child = NULL, parent, *children; - int bmsr, capmask = 0xFFFFFFFF, nchildren; + device_t child = NULL, parent; + int bmsr, capmask = 0xFFFFFFFF; mii = device_get_softc(dev); parent = device_get_parent(dev); LIST_INIT(&mii->mii_phys); for (ma.mii_phyno = 0; ma.mii_phyno < MII_NPHY; ma.mii_phyno++) { - device_get_children(dev, &children, &nchildren); - if (nchildren) - break; /* * Check to see if there is a PHY at this address. Note, * many braindead PHYs report 0/0 in their ID registers, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message