FreeBSD/sys/dev/usb/controller/at91dci.c
/*------------------------------------------------------------------------*
 *	at91dci_device_done
 *
 * NOTE: this function can be called more than one time on the
 * same USB transfer!
 *------------------------------------------------------------------------*/
at91dci_device_done
NOTE: this function can be called more than one time on the
same USB transfer!
at91dci_device_done NOTE : this function can be called more than one time on the same USB transfer!
static void
at91dci_device_done(struct usb_xfer *xfer, usb_error_t error)
{
	struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
	uint8_t ep_no;
	USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
	DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n",
	    xfer, xfer->endpoint, error);
	USB_BUS_SPIN_LOCK(&sc->sc_bus);
	if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) {
		ep_no = (xfer->endpointno & UE_ADDR);
		AT91_UDP_WRITE_4(sc, AT91_UDP_IDR, AT91_UDP_INT_EP(ep_no));
		DPRINTFN(15, "disable interrupts on endpoint %d\n", ep_no);
	}
	usbd_transfer_done(xfer, error);
	USB_BUS_SPIN_UNLOCK(&sc->sc_bus);
}
static void at91dci_device_done ( struct usb_xfer * xfer , usb_error_t error ) { struct at91dci_softc * sc = AT9100_DCI_BUS2SC ( xfer -> xroot -> bus ) ; uint8_t ep_no ; USB_BUS_LOCK_ASSERT ( & sc -> sc_bus , MA_OWNED ) ; DPRINTFN ( 2 , " \n " , xfer , xfer -> endpoint , error ) ; USB_BUS_SPIN_LOCK ( & sc -> sc_bus ) ; if ( xfer -> flags_int . usb_mode == USB_MODE_DEVICE ) { ep_no = ( xfer -> endpointno & UE_ADDR ) ; AT91_UDP_WRITE_4 ( sc , AT91_UDP_IDR , AT91_UDP_INT_EP ( ep_no ) ) ; DPRINTFN ( 15 , " \n " , ep_no ) ; } usbd_transfer_done ( xfer , error ) ; USB_BUS_SPIN_UNLOCK ( & sc -> sc_bus ) ; }
at91dci_device_done
 NOTE: this function can be called more than one time on the
 same USB transfer!
at91dci_device_done NOTE : this function can be called more than one time on the same USB transfer!
/* disable endpoint interrupt */ /* dequeue transfer and start next transfer */