• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/etherswitch/mtkswitch/

Lines Matching defs:phy

71 static inline int mtkswitch_portforphy(int phy);
113 int phy, err = 0;
118 for (phy = 0; phy < sc->numphys; phy++) {
119 if ((sc->phymap & (1u << phy)) == 0) {
120 sc->ifp[phy] = NULL;
121 sc->ifname[phy] = NULL;
122 sc->miibus[phy] = NULL;
125 sc->ifp[phy] = if_alloc(IFT_ETHER);
126 if (sc->ifp[phy] == NULL) {
132 sc->ifp[phy]->if_softc = sc;
133 sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST |
135 sc->ifname[phy] = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK);
136 bcopy(name, sc->ifname[phy], strlen(name) + 1);
137 if_initname(sc->ifp[phy], sc->ifname[phy],
138 mtkswitch_portforphy(phy));
139 err = mii_attach(sc->sc_dev, &sc->miibus[phy], sc->ifp[phy],
141 BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
145 phy);
148 "%s\n", device_get_nameunit(sc->miibus[phy]),
149 sc->ifp[phy]->if_xname);
262 int phy;
266 for (phy = 0; phy < MTKSWITCH_MAX_PHYS; phy++) {
267 if (sc->miibus[phy] != NULL)
268 device_delete_child(dev, sc->miibus[phy]);
269 if (sc->ifp[phy] != NULL)
270 if_free(sc->ifp[phy]);
271 free(sc->ifname[phy], M_DEVBUF);
282 mtkswitch_portforphy(int phy)
285 return (phy);
298 int phy = mtkswitch_phyforport(port);
300 if (phy < 0 || phy >= MTKSWITCH_MAX_PHYS || sc->miibus[phy] == NULL)
303 return (device_get_softc(sc->miibus[phy]));
309 int phy = mtkswitch_phyforport(port);
311 if (phy < 0 || phy >= MTKSWITCH_MAX_PHYS)
314 return (sc->ifp[phy]);
597 mtkswitch_readphy(device_t dev, int phy, int reg)
601 return (sc->hal.mtkswitch_phy_read(dev, phy, reg));
605 mtkswitch_writephy(device_t dev, int phy, int reg, int val)
609 return (sc->hal.mtkswitch_phy_write(dev, phy, reg, val));