Same as last check-in, just implemented more sanely
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1880 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
2d9e8251ca
commit
bb2fb9e065
@ -1078,7 +1078,7 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep)
|
||||
|
||||
/* Send the largest number of bytes that we can in this packet */
|
||||
|
||||
buf = (ubyte*)privreq->req.buf + privreq->req.xfrd;
|
||||
buf = privreq->req.buf + privreq->req.xfrd;
|
||||
lpc214x_epwrite(privep->epphy, buf, nbytes);
|
||||
|
||||
/* Update for the next time through the loop */
|
||||
@ -1139,7 +1139,7 @@ static int lpc214x_rdrequest(struct lpc214x_ep_s *privep)
|
||||
|
||||
/* Receive the next packet */
|
||||
|
||||
buf = (ubyte*)privreq->req.buf + privreq->req.xfrd;
|
||||
buf = privreq->req.buf + privreq->req.xfrd;
|
||||
nbytesread = lpc214x_epread(privep->epphy, buf, privep->ep.maxpacket);
|
||||
if (nbytesread < 0)
|
||||
{
|
||||
|
@ -1665,12 +1665,12 @@ static int usbstrg_cmdparsestate(FAR struct usbstrg_dev_s *priv)
|
||||
return -ENOMEM;
|
||||
}
|
||||
DEBUGASSERT(privreq->req && privreq->req->buf);
|
||||
buf = (ubyte*)privreq->req->buf;
|
||||
buf = privreq->req->buf;
|
||||
|
||||
/* Assume that no errors will be encountered */
|
||||
|
||||
priv->phaseerror = 0;
|
||||
priv->shortpacket = 0;
|
||||
priv->phaseerror = 0;
|
||||
priv->shortpacket = 0;
|
||||
|
||||
/* No data is buffered */
|
||||
|
||||
@ -2018,7 +2018,7 @@ static int usbstrg_cmdreadstate(FAR struct usbstrg_dev_s *priv)
|
||||
*/
|
||||
|
||||
src = &priv->iobuffer[lun->sectorsize - priv->nsectbytes];
|
||||
dest = (ubyte*)&req->buf[priv->nreqbytes];
|
||||
dest = &req->buf[priv->nreqbytes];
|
||||
|
||||
nbytes = min(CONFIG_USBSTRG_BULKINREQLEN - priv->nreqbytes, priv->nsectbytes);
|
||||
|
||||
@ -2150,7 +2150,7 @@ static int usbstrg_cmdwritestate(FAR struct usbstrg_dev_s *priv)
|
||||
{
|
||||
/* Copy the data received in the read request into the sector I/O buffer */
|
||||
|
||||
src = (ubyte*)&req->buf[xfrd - priv->nreqbytes];
|
||||
src = &req->buf[xfrd - priv->nreqbytes];
|
||||
dest = &priv->iobuffer[priv->nsectbytes];
|
||||
|
||||
nbytes = min(lun->sectorsize - priv->nsectbytes, priv->nreqbytes);
|
||||
|
@ -800,9 +800,9 @@ static int usbstrg_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s *c
|
||||
case USB_DESC_TYPE_CONFIG:
|
||||
{
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
ret = usbstrg_mkcfgdesc((ubyte*)ctrlreq->buf, dev->speed, len);
|
||||
ret = usbstrg_mkcfgdesc(ctrlreq->buf, dev->speed, len);
|
||||
#else
|
||||
ret = usbstrg_mkcfgdesc((ubyte*)ctrlreq->buf);
|
||||
ret = usbstrg_mkcfgdesc(ctrlreq->buf);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
@ -190,7 +190,7 @@
|
||||
struct usbdev_ep_s;
|
||||
struct usbdev_req_s
|
||||
{
|
||||
char *buf; /* Call: Buffer used for data; Return: Unchanged */
|
||||
ubyte *buf; /* Call: Buffer used for data; Return: Unchanged */
|
||||
ubyte flags; /* See USBDEV_REQFLAGS_* definitions */
|
||||
uint16 len; /* Call: Total length of data in buf; Return: Unchanged */
|
||||
uint16 xfrd; /* Call: zero; Return: Bytes transferred so far */
|
||||
|
Loading…
x
Reference in New Issue
Block a user