]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: xilinxps_udc: Fixed USB halt endpoint support.
authorNaveen Mamindlapalli <naveen.mamindlapalli@xilinx.com>
Fri, 8 Mar 2013 14:46:17 +0000 (20:16 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 11 Mar 2013 13:28:19 +0000 (14:28 +0100)
Fixed USB halt endpoint support as part of compliance testing
using Windows USBCV tool. The halt endpoint test is
working with g_mass_storage and g_ether gadget. It fails with
g_zero because of g_zero queuing some BULK requests and DCD is
checking whether endpoint request queue is empty before halting.

Signed-off-by: Naveen Mamindlapalli <naveenm@xilinx.com>
drivers/usb/gadget/xilinx_usbps_udc.c

index 88d0d344841fe84a1a8df1a7f6596070e1808634..595d18f31b711801ac073f990fdfff664f9bf3a1 100644 (file)
@@ -1767,6 +1767,10 @@ static int ep0_prime_status(struct xusbps_udc *udc, int direction)
        req->req.actual = 0;
        req->req.complete = NULL;
        req->dtd_count = 0;
+       req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
+                               req->req.buf, req->req.length,
+                               ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+       req->mapped = 1;
 
        if (xusbps_req_to_dtd(req) == 0)
                xusbps_queue_td(ep, req);
@@ -1837,6 +1841,10 @@ static void ch9getstatus(struct xusbps_udc *udc, u8 request_type, u16 value,
        req->req.actual = 0;
        req->req.complete = NULL;
        req->dtd_count = 0;
+       req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
+                               req->req.buf, req->req.length,
+                               ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+       req->mapped = 1;
 
        /* prime the data phase */
        if ((xusbps_req_to_dtd(req) == 0))
@@ -2698,7 +2706,6 @@ static int __devinit struct_udc_setup(struct xusbps_udc *udc,
                        struct xusbps_req, req);
        /* allocate a small amount of memory to get valid address */
        udc->status_req->req.buf = kmalloc(8, GFP_KERNEL);
-       udc->status_req->req.dma = virt_to_phys(udc->status_req->req.buf);
 
        udc->resume_state = USB_STATE_NOTATTACHED;
        udc->usb_state = USB_STATE_POWERED;