Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325873
b: refs/heads/master
c: 60326ce
h: refs/heads/master
i:
  325871: f60d7fd
v: v3
  • Loading branch information
Chao Xie authored and Felipe Balbi committed Aug 23, 2012
1 parent 1388a80 commit b216140
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 583a7263c7ed05c9a625d50950551ba5749c9379
refs/heads/master: 60326ce377090541db9ba1a05a041316ab5b46ec
21 changes: 13 additions & 8 deletions trunk/drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,24 @@ static int queue_dtd(struct mv_ep *ep, struct mv_req *req)
return retval;
}


static struct mv_dtd *build_dtd(struct mv_req *req, unsigned *length,
dma_addr_t *dma, int *is_last)
{
u32 temp;
struct mv_dtd *dtd;
struct mv_udc *udc;
struct mv_dqh *dqh;
u32 temp, mult = 0;

/* how big will this transfer be? */
*length = min(req->req.length - req->req.actual,
(unsigned)EP_MAX_LENGTH_TRANSFER);
if (usb_endpoint_xfer_isoc(req->ep->ep.desc)) {
dqh = req->ep->dqh;
mult = (dqh->max_packet_length >> EP_QUEUE_HEAD_MULT_POS)
& 0x3;
*length = min(req->req.length - req->req.actual,
(unsigned)(mult * req->ep->ep.maxpacket));
} else
*length = min(req->req.length - req->req.actual,
(unsigned)EP_MAX_LENGTH_TRANSFER);

udc = req->ep->udc;

Expand Down Expand Up @@ -407,6 +414,8 @@ static struct mv_dtd *build_dtd(struct mv_req *req, unsigned *length,
if (*is_last && !req->req.no_interrupt)
temp |= DTD_IOC;

temp |= mult << 10;

dtd->size_ioc_sts = temp;

mb();
Expand Down Expand Up @@ -718,10 +727,6 @@ mv_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
dev_err(&udc->dev->dev, "%s, bad ep", __func__);
return -EINVAL;
}
if (ep->ep.desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
if (req->req.length > ep->ep.maxpacket)
return -EMSGSIZE;
}

udc = ep->udc;
if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN)
Expand Down

0 comments on commit b216140

Please sign in to comment.