Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/etherswitch/rtl8366/rtl8366rb.c
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | rtl8366rb_attach(device_t dev) | ||||
else | else | ||||
sprintf(sc->info.es_name, "Realtek RTL8366SR"); | sprintf(sc->info.es_name, "Realtek RTL8366SR"); | ||||
/* attach miibus and phys */ | /* attach miibus and phys */ | ||||
/* PHYs need an interface, so we generate a dummy one */ | /* PHYs need an interface, so we generate a dummy one */ | ||||
for (i = 0; i < sc->numphys; i++) { | for (i = 0; i < sc->numphys; i++) { | ||||
sc->ifp[i] = if_alloc(IFT_ETHER); | sc->ifp[i] = if_alloc(IFT_ETHER); | ||||
if (sc->ifp[i] == NULL) { | if (sc->ifp[i] == NULL) { | ||||
device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); | device_printf(sc->dev, "couldn't allocate ifnet structure\n"); | ||||
err = ENOMEM; | err = ENOMEM; | ||||
break; | break; | ||||
} | } | ||||
sc->ifp[i]->if_softc = sc; | sc->ifp[i]->if_softc = sc; | ||||
sc->ifp[i]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | sc->ifp[i]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | ||||
| IFF_SIMPLEX; | | IFF_SIMPLEX; | ||||
snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(dev)); | snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(dev)); | ||||
▲ Show 20 Lines • Show All 717 Lines • Show Last 20 Lines |