usbdev/cdcncm: fix some issues

1. increase CDCECM_MXDESCLEN to avoid memory overrun when sending
configuration description(mkcfmdesc) information

2. correct the request structure used in the notify phase

3. disable unused configuration options

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2024-06-17 10:43:45 +08:00
committed by Xiang Xiao
parent 7aa3e2ebd6
commit 640b766d2b
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
****************************************************************************/
#define CDCECM_VERSIONNO (0x0100)
#define CDCECM_MXDESCLEN (80)
#define CDCECM_MXDESCLEN (120)
#define CDCECM_MAXSTRLEN (CDCECM_MXDESCLEN - 2)
#define CDCECM_NCONFIGS (1)
#define CDCECM_NINTERFACES (2)
+1 -1
View File
@@ -1400,7 +1400,7 @@ static int ncm_notify(FAR struct cdcncm_driver_s *self)
/* SPEED_CHANGE data is up/down speeds in bits/sec */
data = (FAR uint32_t *)(self->ctrlreq->buf + sizeof(*req));
data = (FAR uint32_t *)(self->notifyreq->buf + sizeof(*req));
data[0] = self->usbdev.speed == USB_SPEED_HIGH ?
CDCECM_HIGH_BITRATE : CDCECM_LOW_BITRATE;
data[1] = data[0];