Changeset View
Changeset View
Standalone View
Standalone View
stable/10/sys/net/if_lagg.c
Show First 20 Lines • Show All 1,052 Lines • ▼ Show 20 Lines | case SIOCSLAGG: | ||||
} | } | ||||
if (proto->ti_proto == LAGG_PROTO_NONE) { | if (proto->ti_proto == LAGG_PROTO_NONE) { | ||||
error = EPROTONOSUPPORT; | error = EPROTONOSUPPORT; | ||||
break; | break; | ||||
} | } | ||||
/* Set to LAGG_PROTO_NONE during the attach. */ | /* Set to LAGG_PROTO_NONE during the attach. */ | ||||
LAGG_WLOCK(sc); | LAGG_WLOCK(sc); | ||||
if (sc->sc_proto != LAGG_PROTO_NONE) { | if (sc->sc_proto != LAGG_PROTO_NONE) { | ||||
int (*sc_detach)(struct lagg_softc *sc); | |||||
/* Reset protocol and pointers */ | |||||
sc->sc_proto = LAGG_PROTO_NONE; | sc->sc_proto = LAGG_PROTO_NONE; | ||||
if (sc->sc_detach != NULL) | sc_detach = sc->sc_detach; | ||||
sc->sc_detach(sc); | sc->sc_detach = NULL; | ||||
sc->sc_start = NULL; | |||||
sc->sc_input = NULL; | |||||
sc->sc_port_create = NULL; | |||||
sc->sc_port_destroy = NULL; | |||||
sc->sc_linkstate = NULL; | |||||
sc->sc_init = NULL; | |||||
sc->sc_stop = NULL; | |||||
sc->sc_lladdr = NULL; | |||||
sc->sc_req = NULL; | |||||
sc->sc_portreq = NULL; | |||||
if (sc_detach != NULL) | |||||
sc_detach(sc); | |||||
else | else | ||||
LAGG_WUNLOCK(sc); | LAGG_WUNLOCK(sc); | ||||
} else | } else | ||||
LAGG_WUNLOCK(sc); | LAGG_WUNLOCK(sc); | ||||
proto->ti_attach(sc); | proto->ti_attach(sc); | ||||
LAGG_WLOCK(sc); | LAGG_WLOCK(sc); | ||||
sc->sc_proto = proto->ti_proto; | sc->sc_proto = proto->ti_proto; | ||||
LAGG_WUNLOCK(sc); | LAGG_WUNLOCK(sc); | ||||
▲ Show 20 Lines • Show All 1,052 Lines • Show Last 20 Lines |