Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sbni/if_sbni.c
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | sbni_attach(struct sbni_softc *sc, int unit, struct sbni_flags flags) | ||||
ifp->if_ioctl = sbni_ioctl; | ifp->if_ioctl = sbni_ioctl; | ||||
IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); | IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); | ||||
/* report real baud rate */ | /* report real baud rate */ | ||||
csr0 = sbni_inb(sc, CSR0); | csr0 = sbni_inb(sc, CSR0); | ||||
ifp->if_baudrate = | ifp->if_baudrate = | ||||
(csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate); | (csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate); | ||||
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | | ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; | ||||
IFF_NEEDSEPOCH; | |||||
mtx_init(&sc->lock, ifp->if_xname, MTX_NETWORK_LOCK, MTX_DEF); | mtx_init(&sc->lock, ifp->if_xname, MTX_NETWORK_LOCK, MTX_DEF); | ||||
callout_init_mtx(&sc->wch, &sc->lock, 0); | callout_init_mtx(&sc->wch, &sc->lock, 0); | ||||
ether_ifattach(ifp, sc->enaddr); | ether_ifattach(ifp, sc->enaddr); | ||||
/* device attach does transition from UNCONFIGURED to IDLE state */ | /* device attach does transition from UNCONFIGURED to IDLE state */ | ||||
if_printf(ifp, "speed %ju, rxl ", (uintmax_t)ifp->if_baudrate); | if_printf(ifp, "speed %ju, rxl ", (uintmax_t)ifp->if_baudrate); | ||||
if (sc->delta_rxl) | if (sc->delta_rxl) | ||||
▲ Show 20 Lines • Show All 1,023 Lines • Show Last 20 Lines |