From owner-freebsd-hackers Wed Jan 30 15:52:30 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from imo-r05.mx.aol.com (imo-r05.mx.aol.com [152.163.225.101]) by hub.freebsd.org (Postfix) with ESMTP id D0AD937B416 for ; Wed, 30 Jan 2002 15:52:26 -0800 (PST) Received: from TD790@aol.com by imo-r05.mx.aol.com (mail_out_v31_r1.26.) id n.10d.c9ea21f (4330) for ; Wed, 30 Jan 2002 18:52:18 -0500 (EST) From: TD790@aol.com Message-ID: <10d.c9ea21f.2989e132@aol.com> Date: Wed, 30 Jan 2002 18:52:18 EST Subject: if_rl.c autoneg fix To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: AOL 5.0 for Windows sub 139 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The problem I was having with the if_rl driver not working properly when connected to a 10Mb hub (ie no link partner capabilities) can be fixed by removing a line with a cryptic comment about broken autonegotiation. in the file /sys/dev/mii/rlphy.c: void rlphy_reset(sc) struct mii_softc *sc; { mii_phy_reset(sc); /* * XXX RealTek PHY doesn't set the BMCR properly after * XXX reset, which breaks autonegotiation. */ /* PHY_WRITE(sc, MII_BMCR, BMCR_S100|BMCR_AUTOEN|BMCR_FDX); */ } taking out the PHY_WRITE repairs autonegotiation in all modes tested. The line sets the BMCR_AUTOEN flag, which causes the phy_mediachg() call in rl_reset to have no effect (in that the driver thinks its already doing autoneg). Taking the line out causes mii_phy_auto() to be called correctly. ifconfig still reports (none), but the port works properly without a manual media setting. Does anyone know the reasoning being the line being added originally? Perhaps a conditional is required if it was required for older controllers for some reason. Dennis To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message