Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/if_ic.c
Show First 20 Lines • Show All 365 Lines • ▼ Show 20 Lines | icoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, | ||||
int len, sent; | int len, sent; | ||||
struct mbuf *mm; | struct mbuf *mm; | ||||
u_char *cp; | u_char *cp; | ||||
u_int32_t hdr; | u_int32_t hdr; | ||||
/* BPF writes need to be handled specially. */ | /* BPF writes need to be handled specially. */ | ||||
if (dst->sa_family == AF_UNSPEC) | if (dst->sa_family == AF_UNSPEC) | ||||
bcopy(dst->sa_data, &hdr, sizeof(hdr)); | bcopy(dst->sa_data, &hdr, sizeof(hdr)); | ||||
else if (ro != NULL && ro->ro_flags & RT_HAS_GW) | |||||
melifaro: worth having as a macro?
something like `hdr = RO_GET_FAMILY(ro, dst)` | |||||
hdr = ro->ro_dst.sa_family; | |||||
else | else | ||||
hdr = dst->sa_family; | hdr = dst->sa_family; | ||||
mtx_lock(&sc->ic_lock); | mtx_lock(&sc->ic_lock); | ||||
ifp->if_drv_flags |= IFF_DRV_RUNNING; | ifp->if_drv_flags |= IFF_DRV_RUNNING; | ||||
/* already sending? */ | /* already sending? */ | ||||
if (sc->ic_flags & IC_SENDING) { | if (sc->ic_flags & IC_SENDING) { | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
worth having as a macro?
something like hdr = RO_GET_FAMILY(ro, dst)