Lines Matching +full:t +full:- +full:phy
1 /*-
2 * SPDX-License-Identifier: BSD-4-Clause
18 * 4. Neither the name of the author nor the names of any co-contributors
85 * RealTek internal PHYs don't have vendor/device ID registers;
125 * The RealTek PHY can never be isolated. in rlphy_attach()
146 * The RealTek PHY's autonegotiation doesn't need to be in rlphy_service()
161 rlphy_status(struct mii_softc *phy) in rlphy_status() argument
163 struct mii_data *mii = phy->mii_pdata; in rlphy_status()
164 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; in rlphy_status()
167 mii->mii_media_status = IFM_AVALID; in rlphy_status()
168 mii->mii_media_active = IFM_ETHER; in rlphy_status()
170 bmsr = PHY_READ(phy, MII_BMSR) | PHY_READ(phy, MII_BMSR); in rlphy_status()
172 mii->mii_media_status |= IFM_ACTIVE; in rlphy_status()
174 bmcr = PHY_READ(phy, MII_BMCR); in rlphy_status()
176 mii->mii_media_active |= IFM_NONE; in rlphy_status()
177 mii->mii_media_status = 0; in rlphy_status()
182 mii->mii_media_active |= IFM_LOOP; in rlphy_status()
186 * NWay autonegotiation takes the highest-order common in rlphy_status()
192 mii->mii_media_active |= IFM_NONE; in rlphy_status()
196 if ((anlpar = PHY_READ(phy, MII_ANAR) & in rlphy_status()
197 PHY_READ(phy, MII_ANLPAR))) { in rlphy_status()
199 mii->mii_media_active |= IFM_100_TX|IFM_FDX; in rlphy_status()
201 mii->mii_media_active |= IFM_100_T4|IFM_HDX; in rlphy_status()
203 mii->mii_media_active |= IFM_100_TX|IFM_HDX; in rlphy_status()
205 mii->mii_media_active |= IFM_10_T|IFM_FDX; in rlphy_status()
207 mii->mii_media_active |= IFM_10_T|IFM_HDX; in rlphy_status()
209 mii->mii_media_active |= IFM_NONE; in rlphy_status()
210 if ((mii->mii_media_active & IFM_FDX) != 0) in rlphy_status()
211 mii->mii_media_active |= in rlphy_status()
212 mii_phy_flowstatus(phy); in rlphy_status()
216 * If the other side doesn't support NWAY, then the in rlphy_status()
225 * The RealTek PHY supports non-NWAY link speed in rlphy_status()
228 * (What? RealTek doesn't do things the way everyone in rlphy_status()
233 * - If this is a standalone RealTek RTL8201(L) or in rlphy_status()
234 * workalike PHY, we can determine the link speed by in rlphy_status()
235 * testing bit 0 in the magic, vendor-specific register in rlphy_status()
238 * - If this is a RealTek MAC with integrated PHY, we in rlphy_status()
242 if (!(phy->mii_mpd_model == 0 && phy->mii_mpd_rev == 0)) { in rlphy_status()
243 if (PHY_READ(phy, 0x0019) & 0x01) in rlphy_status()
244 mii->mii_media_active |= IFM_100_TX; in rlphy_status()
246 mii->mii_media_active |= IFM_10_T; in rlphy_status()
248 if (PHY_READ(phy, RL_MEDIASTAT) & in rlphy_status()
250 mii->mii_media_active |= IFM_10_T; in rlphy_status()
252 mii->mii_media_active |= IFM_100_TX; in rlphy_status()
254 mii->mii_media_active |= IFM_HDX; in rlphy_status()
256 mii->mii_media_active = ife->ifm_media; in rlphy_status()