FreeBSD/sys/dev/usb/misc/udbp.c
/*
 * This is called once we've already connected a new hook to the other node.
 * It gives us a chance to balk at the last minute.
 */
This is called once we've already connected a new hook to the other node.
It gives us a chance to balk at the last minute.
This is called once we ' ve already connected a new hook to the other node . It gives us a chance to balk at the last minute .
static int
ng_udbp_connect(hook_p hook)
{
	struct udbp_softc *sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
	NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
	mtx_lock(&sc->sc_mtx);
	sc->sc_flags |= (UDBP_FLAG_READ_STALL |
	    UDBP_FLAG_WRITE_STALL);
	usbd_transfer_start(sc->sc_xfer[UDBP_T_RD]);
	usbd_transfer_start(sc->sc_xfer[UDBP_T_WR]);
	mtx_unlock(&sc->sc_mtx);
	return (0);
}
static int ng_udbp_connect ( hook_p hook ) { struct udbp_softc * sc = NG_NODE_PRIVATE ( NG_HOOK_NODE ( hook ) ) ; NG_HOOK_FORCE_QUEUE ( NG_HOOK_PEER ( hook ) ) ; mtx_lock ( & sc -> sc_mtx ) ; sc -> sc_flags |= ( UDBP_FLAG_READ_STALL | UDBP_FLAG_WRITE_STALL ) ; usbd_transfer_start ( sc -> sc_xfer [ UDBP_T_RD ] ) ; usbd_transfer_start ( sc -> sc_xfer [ UDBP_T_WR ] ) ; mtx_unlock ( & sc -> sc_mtx ) ; return ( 0 ) ; }
This is called once we've already connected a new hook to the other node.
This is called once we ' ve already connected a new hook to the other node .
/* probably not at splnet, force outward queueing */ /* start bulk-in transfer */ /* start bulk-out transfer */