You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/01/10 10:24:46 UTC
[incubator-nuttx] 06/07: drivers: usbdev: usbmsc full speed not
available
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr70
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 3896830cfd8345b9a0da425309ddb57b888ec3ea
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Jan 8 17:03:13 2020 +0900
drivers: usbdev: usbmsc full speed not available
Change transfer size to be based on maxpacket size.
---
drivers/usbdev/usbmsc_scsi.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usbdev/usbmsc_scsi.c b/drivers/usbdev/usbmsc_scsi.c
index ce311e5..4a8b99d 100644
--- a/drivers/usbdev/usbmsc_scsi.c
+++ b/drivers/usbdev/usbmsc_scsi.c
@@ -1750,7 +1750,7 @@ static int usbmsc_idlestate(FAR struct usbmsc_dev_s *priv)
/* Return the read request to the bulk out endpoint for re-filling */
req = privreq->req;
- req->len = CONFIG_USBMSC_BULKOUTREQLEN;
+ req->len = priv->epbulkout->maxpacket;
req->priv = privreq;
req->callback = usbmsc_rdcomplete;
@@ -2177,7 +2177,7 @@ static int usbmsc_cmdreadstate(FAR struct usbmsc_dev_s *priv)
src = &priv->iobuffer[lun->sectorsize - priv->nsectbytes];
dest = &req->buf[priv->nreqbytes];
- nbytes = MIN(CONFIG_USBMSC_BULKINREQLEN - priv->nreqbytes, priv->nsectbytes);
+ nbytes = MIN(priv->epbulkin->maxpacket - priv->nreqbytes, priv->nsectbytes);
/* Copy the data from the sector buffer to the USB request and update counts */
@@ -2189,7 +2189,7 @@ static int usbmsc_cmdreadstate(FAR struct usbmsc_dev_s *priv)
* then submit the request
*/
- if (priv->nreqbytes >= CONFIG_USBMSC_BULKINREQLEN ||
+ if (priv->nreqbytes >= priv->epbulkin->maxpacket ||
(priv->u.xfrlen <= 0 && priv->nsectbytes <= 0))
{
/* Remove the request that we just filled from wrreqlist (we've already checked
@@ -2347,7 +2347,7 @@ static int usbmsc_cmdwritestate(FAR struct usbmsc_dev_s *priv)
* to get the next read request.
*/
- req->len = CONFIG_USBMSC_BULKOUTREQLEN;
+ req->len = priv->epbulkout->maxpacket;
req->priv = privreq;
req->callback = usbmsc_rdcomplete;
@@ -2359,7 +2359,7 @@ static int usbmsc_cmdwritestate(FAR struct usbmsc_dev_s *priv)
/* Did the host decide to stop early? */
- if (xfrd != CONFIG_USBMSC_BULKOUTREQLEN)
+ if (xfrd != priv->epbulkout->maxpacket)
{
priv->shortpacket = 1;
goto errout;