drivers/usb: fixed sim usb dev and host build issue

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-02-27 14:52:21 +08:00 committed by Alan Carvalho de Assis
parent 14ba7a7dd1
commit 699c930987
4 changed files with 8 additions and 26 deletions

View File

@ -471,9 +471,6 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv,
DEBUGASSERT(priv != NULL && rdcontainer != NULL);
uinfo("head=%d tail=%d nrdq=%d reqlen=%d\n",
priv->serdev.recv.head, priv->serdev.recv.tail, priv->nrdq, reqlen);
#ifdef CONFIG_CDCACM_IFLOWCONTROL
DEBUGASSERT(priv->rxenabled && !priv->iactive);
#else
@ -486,6 +483,9 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv,
reqbuf = &req->buf[rdcontainer->offset];
reqlen = req->xfrd - rdcontainer->offset;
uinfo("head=%d tail=%d nrdq=%d reqlen=%d\n",
priv->serdev.recv.head, priv->serdev.recv.tail, priv->nrdq, reqlen);
serdev = &priv->serdev;
recv = &serdev->recv;

View File

@ -34,6 +34,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/param.h>
@ -1242,7 +1243,7 @@ static inline int rndis_recvpacket(FAR struct rndis_dev_s *priv,
if (priv->current_rx_datagram_size > (CONFIG_NET_ETH_PKTSIZE + 4) ||
priv->current_rx_datagram_size <= (ETH_HDRLEN + 4))
{
uerr("ERROR: Bad packet size dropped (%d)\n",
uerr("ERROR: Bad packet size dropped (%zu)\n",
priv->current_rx_datagram_size);
NETDEV_RXERRORS(&priv->netdev);
priv->current_rx_datagram_size = 0;

View File

@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
@ -324,7 +325,6 @@ static int usbhost_cfgdesc(FAR struct usbhost_cdcacm_s *priv,
/* (Little Endian) Data helpers */
static inline uint16_t usbhost_getle16(FAR const uint8_t *val);
static inline uint16_t usbhost_getbe16(FAR const uint8_t *val);
static inline void usbhost_putle16(FAR uint8_t *dest, uint16_t val);
#ifdef HAVE_CTRL_INTERFACE
static void usbhost_putle32(FAR uint8_t *dest, uint32_t val);
@ -1626,25 +1626,6 @@ static inline uint16_t usbhost_getle16(FAR const uint8_t *val)
return (uint16_t)val[1] << 8 | (uint16_t)val[0];
}
/****************************************************************************
* Name: usbhost_getbe16
*
* Description:
* Get a (possibly unaligned) 16-bit big endian value.
*
* Input Parameters:
* val - A pointer to the first byte of the big endian value.
*
* Returned Value:
* A uint16_t representing the whole 16-bit integer value
*
****************************************************************************/
static inline uint16_t usbhost_getbe16(FAR const uint8_t *val)
{
return (uint16_t)val[0] << 8 | (uint16_t)val[1];
}
/****************************************************************************
* Name: usbhost_putle16
*
@ -1733,7 +1714,7 @@ static int usbhost_alloc_buffers(FAR struct usbhost_cdcacm_s *priv)
sizeof(struct cdc_linecoding_s));
if (ret < 0)
{
uerr("ERROR: DRVR_IOALLOC of line coding failed: %d (%d bytes)\n",
uerr("ERROR: DRVR_IOALLOC of line coding failed: %d (%zu bytes)\n",
ret, sizeof(struct cdc_linecoding_s));
goto errout;
}

View File

@ -460,7 +460,7 @@ int usbhost_enumerate(FAR struct usbhost_hubport_s *hport,
if (cfglen > maxlen)
{
uerr("ERROR: Configuration doesn't fit in buffer, "
"length=%d, maxlen=%d\n",
"length=%d, maxlen=%zu\n",
cfglen, maxlen);
ret = -E2BIG;
goto errout;