--- - branch: MAIN date: Mon May 22 02:12:13 UTC 2023 files: - new: '1.103' old: '1.102' path: src/sys/dev/mii/mii_physubr.c pathrev: src/sys/dev/mii/mii_physubr.c@1.103 type: modified id: 20230522T021213Z.6c7ce7dbc5b437fbf5dfb7cea6dbedeb7a0d28a7 log: | 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. module: src subject: 'CVS commit: src/sys/dev/mii' unixtime: '1684721533' user: msaitoh