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:
parent
7aa3e2ebd6
commit
640b766d2b
|
@ -35,7 +35,6 @@ CONFIG_DEBUG_USB_WARN=y
|
||||||
CONFIG_EXAMPLES_DHCPD=y
|
CONFIG_EXAMPLES_DHCPD=y
|
||||||
CONFIG_FS_PROCFS=y
|
CONFIG_FS_PROCFS=y
|
||||||
CONFIG_FS_TMPFS=y
|
CONFIG_FS_TMPFS=y
|
||||||
CONFIG_HAVE_CXX=y
|
|
||||||
CONFIG_ICMPv6_AUTOCONF_RDNSS=y
|
CONFIG_ICMPv6_AUTOCONF_RDNSS=y
|
||||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||||
CONFIG_IOB_NBUFFERS=512
|
CONFIG_IOB_NBUFFERS=512
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define CDCECM_VERSIONNO (0x0100)
|
#define CDCECM_VERSIONNO (0x0100)
|
||||||
#define CDCECM_MXDESCLEN (80)
|
#define CDCECM_MXDESCLEN (120)
|
||||||
#define CDCECM_MAXSTRLEN (CDCECM_MXDESCLEN - 2)
|
#define CDCECM_MAXSTRLEN (CDCECM_MXDESCLEN - 2)
|
||||||
#define CDCECM_NCONFIGS (1)
|
#define CDCECM_NCONFIGS (1)
|
||||||
#define CDCECM_NINTERFACES (2)
|
#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 */
|
/* 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 ?
|
data[0] = self->usbdev.speed == USB_SPEED_HIGH ?
|
||||||
CDCECM_HIGH_BITRATE : CDCECM_LOW_BITRATE;
|
CDCECM_HIGH_BITRATE : CDCECM_LOW_BITRATE;
|
||||||
data[1] = data[0];
|
data[1] = data[0];
|
||||||
|
|
Loading…
Reference in New Issue