Received: by mail.netbsd.org (Postfix, from userid 605) id 089FE84D6B; Mon, 22 May 2023 02:12:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 2B53784D55 for ; Mon, 22 May 2023 02:12:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id nNVE4JMsagLZ for ; Mon, 22 May 2023 02:12:13 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id AA46984CD7 for ; Mon, 22 May 2023 02:12:13 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9A601FA87; Mon, 22 May 2023 02:12:13 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Mon, 22 May 2023 02:12:13 +0000 From: "SAITOH Masanobu" Subject: CVS commit: src/sys/dev/mii To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20230522021213.9A601FA87@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "SAITOH Masanobu" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: msaitoh Date: Mon May 22 02:12:13 UTC 2023 Modified Files: src/sys/dev/mii: mii_physubr.c Log Message: Fix a bug when a media is changed to IFM_AUTO. Fix a bug that ifconfig ifN media auto doesn't change the setting when the previous media setting used autonego. When the mii_phy_setmedia() function is called to change the media to IFM_AUTO, the BMCR_AUTOEN bit was used to check if the previous setting was IFM_AUTO. It's not correct. IFM_1000_T also uses autonego. So if a previous setting is IFM_1000_T and the next setting is IFM_AUTO, mii_phy_auto() is not called if neither MIIF_FORCEANEG nor MIIF_DOPAUSE are set. As a result, after changing IFM_AUTO, neither 10Mbps nor 100Mbps are not advertised. Note that almost all drivers uses MIIF_DOPAUSE flags. TODO: cleanup ciphy.c and rgephy.c. Those have #ifdef foo. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/dev/mii/mii_physubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.