Lines Matching refs:port

128 	int err, phy, port;
131 port = err = 0;
138 sc->phyport[phy] = port;
139 sc->portphy[port] = phy;
140 sc->ifp[port] = if_alloc(IFT_ETHER);
141 sc->ifp[port]->if_softc = sc;
142 sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
144 sc->ifname[port] = malloc(strlen(name)+1, M_IP17X, M_WAITOK);
145 bcopy(name, sc->ifname[port], strlen(name)+1);
146 if_initname(sc->ifp[port], sc->ifname[port], port);
147 sc->miibus[port] = malloc(sizeof(device_t), M_IP17X,
149 err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
153 device_get_nameunit(*sc->miibus[port]),
154 sc->ifp[port]->if_xname);
161 sc->info.es_nports = port + 1;
162 if (++port >= sc->numports)
200 /* Always attach the cpu port. */
225 * Set the switch to port based vlans or disabled (if not supported
247 int i, port;
255 port = sc->phyport[i];
256 if (sc->miibus[port] != NULL)
257 device_delete_child(dev, (*sc->miibus[port]));
258 if (sc->ifp[port] != NULL)
259 if_free(sc->ifp[port]);
260 free(sc->ifname[port], M_IP17X);
261 free(sc->miibus[port], M_IP17X);
280 ip17x_miiforport(struct ip17x_softc *sc, int port)
283 if (port < 0 || port > sc->numports)
285 return (device_get_softc(*sc->miibus[port]));
289 ip17x_ifpforport(struct ip17x_softc *sc, int port)
292 if (port < 0 || port > sc->numports)
294 return (sc->ifp[port]);
305 int i, port;
312 port = sc->phyport[i];
313 if ((*sc->miibus[port]) == NULL)
315 mii = device_get_softc(*sc->miibus[port]);
398 /* fill in fixed values for CPU port */
453 /* Reset the settings for this port. */
468 /* Do not allow media changes on CPU port. */