Lines Matching refs:port
164 int err, phy, port;
167 port = err = 0;
174 sc->phyport[phy] = port;
175 sc->portphy[port] = phy;
176 sc->ifp[port] = if_alloc(IFT_ETHER);
177 if (sc->ifp[port] == NULL) {
183 sc->ifp[port]->if_softc = sc;
184 sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
186 if_initname(sc->ifp[port], name, port);
187 sc->miibus[port] = malloc(sizeof(device_t), M_IP17X,
189 err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
193 device_get_nameunit(*sc->miibus[port]),
194 sc->ifp[port]->if_xname);
201 sc->info.es_nports = port + 1;
202 if (++port >= sc->numports)
240 /* Always attach the cpu port. */
263 * Set the switch to port based vlans or disabled (if not supported
287 int i, port;
296 port = sc->phyport[i];
297 if (sc->miibus[port] != NULL)
298 device_delete_child(dev, (*sc->miibus[port]));
299 if (sc->ifp[port] != NULL)
300 if_free(sc->ifp[port]);
301 free(sc->miibus[port], M_IP17X);
319 ip17x_miiforport(struct ip17x_softc *sc, int port)
322 if (port < 0 || port > sc->numports)
324 return (device_get_softc(*sc->miibus[port]));
328 ip17x_ifpforport(struct ip17x_softc *sc, int port)
331 if (port < 0 || port > sc->numports)
333 return (sc->ifp[port]);
344 int i, port;
351 port = sc->phyport[i];
352 if ((*sc->miibus[port]) == NULL)
354 mii = device_get_softc(*sc->miibus[port]);
437 /* fill in fixed values for CPU port */
492 /* Reset the settings for this port. */
507 /* Do not allow media changes on CPU port. */