PTD_GET_TOGGLE(ptd) ^ 1); 
PTD_GET_TOGGLE(ptd)); urb->actual_length += PTD_GET_COUNT(ptd); 
static void postproc_atl_queue(struct isp116x *isp116x){	struct isp116x_ep *ep;	struct urb *urb;	struct usb_device *udev;	struct ptd *ptd;	int short_not_ok;	u8 cc;	for (ep = isp116x->atl_active; ep; ep = ep->active) {		BUG_ON(list_empty(&ep->hep->urb_list));		urb =		    container_of(ep->hep->urb_list.next, struct urb, urb_list);		udev = urb->dev;		ptd = &ep->ptd;		cc = PTD_GET_CC(ptd);		spin_lock(&urb->lock);		short_not_ok = 1;		/* Data underrun is special. For allowed underrun		   we clear the error and continue as normal. For		   forbidden underrun we finish the DATA stage		   immediately while for control transfer,		   we do a STATUS stage. */		if (cc == TD_DATAUNDERRUN) {			if (!(urb->transfer_flags & URB_SHORT_NOT_OK)) {				DBG("Allowed data underrun\n");				cc = TD_CC_NOERROR;				short_not_ok = 0;			} else {				ep->error_count = 1;				if (usb_pipecontrol(urb->pipe))					ep->nextpid = USB_PID_ACK;				else					usb_settoggle(udev, ep->epnum,						      ep->nextpid ==						      USB_PID_OUT,						      PTD_GET_TOGGLE(ptd) ^ 1);				urb->status = cc_to_error[TD_DATAUNDERRUN];				spin_unlock(&urb->lock);				continue;			}		}		/* Keep underrun error through the STATUS stage */		if (urb->status == cc_to_error[TD_DATAUNDERRUN])			cc = TD_DATAUNDERRUN;		if (cc != TD_CC_NOERROR && cc != TD_NOTACCESSED		    && (++ep->error_count >= 3 || cc == TD_CC_STALL			|| cc == TD_DATAOVERRUN)) {			if (urb->status == -EINPROGRESS)				urb->status = cc_to_error[cc];			if (ep->nextpid == USB_PID_ACK)				ep->nextpid = 0;			spin_unlock(&urb->lock);			continue;		}		/* According to usb spec, zero-length Int transfer signals		   finishing of the urb. Hey, does this apply only		   for IN endpoints? */		if (usb_pipeint(urb->pipe) && !PTD_GET_LEN(ptd)) {			if (urb->status == -EINPROGRESS)				urb->status = 0;			spin_unlock(&urb->lock);			continue;		}		/* Relax after previously failed, but later succeeded		   or correctly NAK'ed retransmission attempt */		if (ep->error_count		    && (cc == TD_CC_NOERROR || cc == TD_NOTACCESSED))			ep->error_count = 0;		/* Take into account idiosyncracies of the isp116x chip		   regarding toggle bit for failed transfers */		if (ep->nextpid == USB_PID_OUT)			usb_settoggle(udev, ep->epnum, 1, PTD_GET_TOGGLE(ptd)				      ^ (ep->error_count > 0));		else if (ep->nextpid == USB_PID_IN)			usb_settoggle(udev, ep->epnum, 0, PTD_GET_TOGGLE(ptd)				      ^ (ep->error_count > 0));		switch (ep->nextpid) {		case USB_PID_IN:		case USB_PID_OUT:			urb->actual_length += PTD_GET_COUNT(ptd);			if (PTD_GET_ACTIVE(ptd)			    || (cc != TD_CC_NOERROR && cc < 0x0E))				break;			if (urb->transfer_buffer_length != urb->actual_length) {				if (short_not_ok)					break;			} else {				if (urb->transfer_flags & URB_ZERO_PACKET				    && ep->nextpid == USB_PID_OUT				    && !(PTD_GET_COUNT(ptd) % ep->maxpacket)) {					DBG("Zero packet requested\n");					break;				}			}			/* All data for this URB is transferred, let's finish */			if (usb_pipecontrol(urb->pipe))				ep->nextpid = USB_PID_ACK;			else if (urb->status == -EINPROGRESS)				urb->status = 0;			break;		case USB_PID_SETUP:			if (PTD_GET_ACTIVE(ptd)			    || (cc != TD_CC_NOERROR && cc < 0x0E))				break;			if (urb->transfer_buffer_length == urb->actual_length)				ep->nextpid = USB_PID_ACK;			else if (usb_pipeout(urb->pipe)) {				usb_settoggle(udev, 0, 1, 1);				ep->nextpid = USB_PID_OUT;			} else {				usb_settoggle(udev, 0, 0, 1);				ep->nextpid = USB_PID_IN;			}			break;		case USB_PID_ACK:			if (PTD_GET_ACTIVE(ptd)			    || (cc != TD_CC_NOERROR && cc < 0x0E))				break;			if (urb->status == -EINPROGRESS)				urb->status = 0;			ep->nextpid = 0;			break;		default:			BUG_ON(1);		}		spin_unlock(&urb->lock);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e9b765decfb49ddc105d303d491e1bee9769436f/isp116x-hcd.c/buggy/drivers/usb/host/isp116x-hcd.c