"\20\3MISSEDMICRO\4XACT\5BABBLE\6BABBLE" "\7HALTED", sbuf, sizeof(sbuf));
"\20\7HALTED\6BUFERR\5BABBLE\4XACTERR" "\3MISSED", sbuf, sizeof(sbuf));
ehci_idone(struct ehci_xfer *ex){	usbd_xfer_handle xfer = &ex->xfer;	struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->pipe;	ehci_soft_qtd_t *sqtd;	u_int32_t status = 0, nstatus;	int actlen;	DPRINTFN(/*12*/2, ("ehci_idone: ex=%p\n", ex));#ifdef DIAGNOSTIC	{		int s = splhigh();		if (ex->isdone) {			splx(s);#ifdef EHCI_DEBUG			printf("ehci_idone: ex is done!\n   ");			ehci_dump_exfer(ex);#else			printf("ehci_idone: ex=%p is done!\n", ex);#endif			return;		}		ex->isdone = 1;		splx(s);	}#endif	if (xfer->status == USBD_CANCELLED ||	    xfer->status == USBD_TIMEOUT) {		DPRINTF(("ehci_idone: aborted xfer=%p\n", xfer));		return;	}#ifdef EHCI_DEBUG	DPRINTFN(/*10*/2, ("ehci_idone: xfer=%p, pipe=%p ready\n", xfer, epipe));	if (ehcidebug > 10)		ehci_dump_sqtds(ex->sqtdstart);#endif	/* The transfer is done, compute actual length and status. */	actlen = 0;	for (sqtd = ex->sqtdstart; sqtd != NULL; sqtd = sqtd->nextqtd) {		nstatus = le32toh(sqtd->qtd.qtd_status);		if (nstatus & EHCI_QTD_ACTIVE)			break;		status = nstatus;		/* halt is ok if descriptor is last, and complete */		if (sqtd->qtd.qtd_next == EHCI_NULL &&		    EHCI_QTD_GET_BYTES(status) == 0)			status &= ~EHCI_QTD_HALTED;		if (EHCI_QTD_GET_PID(status) !=	EHCI_QTD_PID_SETUP)			actlen += sqtd->len - EHCI_QTD_GET_BYTES(status);	}	/* If there are left over TDs we need to update the toggle. */	if (sqtd != NULL) {		if (!(xfer->rqflags & URQ_REQUEST))			printf("ehci_idone: need toggle update\n");		epipe->nexttoggle = EHCI_QTD_GET_TOGGLE(status);	}	status &= EHCI_QTD_STATERRS;	DPRINTFN(/*10*/2, ("ehci_idone: len=%d, actlen=%d, status=0x%x\n",			   xfer->length, actlen, status));	xfer->actlen = actlen;	if (status != 0) {#ifdef EHCI_DEBUG		char sbuf[128];		bitmask_snprintf((u_int32_t)status,				 "\20\3MISSEDMICRO\4XACT\5BABBLE\6BABBLE"				 "\7HALTED",				 sbuf, sizeof(sbuf));		DPRINTFN((status == EHCI_QTD_HALTED)*/*10*/2,			 ("ehci_idone: error, addr=%d, endpt=0x%02x, "			  "status 0x%s\n",			  xfer->pipe->device->address,			  xfer->pipe->endpoint->edesc->bEndpointAddress,			  sbuf));		if (ehcidebug > 2) {			ehci_dump_sqh(epipe->sqh);			ehci_dump_sqtds(ex->sqtdstart);		}#endif		if (status == EHCI_QTD_HALTED)			xfer->status = USBD_STALLED;		else			xfer->status = USBD_IOERROR; /* more info XXX */	} else {		xfer->status = USBD_NORMAL_COMPLETION;	}	usb_transfer_complete(xfer);	DPRINTFN(/*12*/2, ("ehci_idone: ex=%p done\n", ex));}