int gfp_flags) 
unsigned gfp_flags) 
static int lh7a40x_queue(struct usb_ep *_ep, struct usb_request *_req,			 int gfp_flags){	struct lh7a40x_request *req;	struct lh7a40x_ep *ep;	struct lh7a40x_udc *dev;	unsigned long flags;	DEBUG("\n\n\n%s, %p\n", __FUNCTION__, _ep);	req = container_of(_req, struct lh7a40x_request, req);	if (unlikely	    (!_req || !_req->complete || !_req->buf	     || !list_empty(&req->queue))) {		DEBUG("%s, bad params\n", __FUNCTION__);		return -EINVAL;	}	ep = container_of(_ep, struct lh7a40x_ep, ep);	if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) {		DEBUG("%s, bad ep\n", __FUNCTION__);		return -EINVAL;	}	dev = ep->dev;	if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) {		DEBUG("%s, bogus device state %p\n", __FUNCTION__, dev->driver);		return -ESHUTDOWN;	}	DEBUG("%s queue req %p, len %d buf %p\n", _ep->name, _req, _req->length,	      _req->buf);	spin_lock_irqsave(&dev->lock, flags);	_req->status = -EINPROGRESS;	_req->actual = 0;	/* kickstart this i/o queue? */	DEBUG("Add to %d Q %d %d\n", ep_index(ep), list_empty(&ep->queue),	      ep->stopped);	if (list_empty(&ep->queue) && likely(!ep->stopped)) {		u32 csr;		if (unlikely(ep_index(ep) == 0)) {			/* EP0 */			list_add_tail(&req->queue, &ep->queue);			lh7a40x_ep0_kick(dev, ep);			req = 0;		} else if (ep_is_in(ep)) {			/* EP1 & EP3 */			usb_set_index(ep_index(ep));			csr = usb_read(ep->csr1);			pio_irq_enable(ep_index(ep));			if ((csr & USB_IN_CSR1_FIFO_NOT_EMPTY) == 0) {				if (write_fifo(ep, req) == 1)					req = 0;			}		} else {			/* EP2 */			usb_set_index(ep_index(ep));			csr = usb_read(ep->csr1);			pio_irq_enable(ep_index(ep));			if (!(csr & USB_OUT_CSR1_FIFO_FULL)) {				if (read_fifo(ep, req) == 1)					req = 0;			}		}	}	/* pio or dma irq handler advances the queue. */	if (likely(req != 0))		list_add_tail(&req->queue, &ep->queue);	spin_unlock_irqrestore(&dev->lock, flags);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5db539e49fc7471e23bf3c94ca304f008cb7b7f3/lh7a40x_udc.c/buggy/drivers/usb/gadget/lh7a40x_udc.c