mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
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:
@@ -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)
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user