Lines Matching refs:port
65 int media; /* cpu port media */
113 int phy, port = 0, err = 0;
121 sc->ifpport[phy] = port;
122 sc->portphy[port] = phy;
123 sc->ifp[port] = if_alloc(IFT_ETHER);
124 sc->ifp[port]->if_softc = sc;
125 sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
127 sc->ifname[port] = malloc(strlen(name)+1, M_UKSWITCH, M_WAITOK);
128 bcopy(name, sc->ifname[port], strlen(name)+1);
129 if_initname(sc->ifp[port], sc->ifname[port], port);
130 sc->miibus[port] = malloc(sizeof(device_t), M_UKSWITCH,
132 err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
136 device_get_nameunit(*sc->miibus[port]),
137 sc->ifp[port]->if_xname);
144 sc->info.es_nports = port + 1;
145 if (++port >= sc->numports)
184 /* Always attach the cpu port. */
223 int i, port;
230 port = ukswitch_portforphy(sc, i);
231 if (sc->miibus[port] != NULL)
232 device_delete_child(dev, (*sc->miibus[port]));
233 if (sc->ifp[port] != NULL)
234 if_free(sc->ifp[port]);
235 free(sc->ifname[port], M_UKSWITCH);
236 free(sc->miibus[port], M_UKSWITCH);
251 * Convert PHY number to port number.
261 ukswitch_miiforport(struct ukswitch_softc *sc, int port)
264 if (port < 0 || port > sc->numports)
266 return (device_get_softc(*sc->miibus[port]));
270 ukswitch_ifpforport(struct ukswitch_softc *sc, int port)
273 if (port < 0 || port > sc->numports)
275 return (sc->ifp[port]);
284 int i, port;
293 port = ukswitch_portforphy(sc, i);
294 if ((*sc->miibus[port]) == NULL)
296 mii = device_get_softc(*sc->miibus[port]);
357 /* fill in fixed values for CPU port */