Skip to content

Commit 9f9075c

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
usbdev/cdcncm: fix ndpsign mismatch after NCM_SET_NTB_FORMAT
Otherwise, the NCM_SET_NTB_FORMAT message from the host may cause subsequent parsing exceptions. Signed-off-by: zhanghongyu <[email protected]>
1 parent 418b692 commit 9f9075c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usbdev/cdcncm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,11 +2609,15 @@ static int cdcncm_setup(FAR struct usbdevclass_driver_s *driver,
26092609
{
26102610
case 0x0000:
26112611
self->parseropts = &g_ndp16_opts;
2612+
self->ndpsign = self->isncm ? self->parseropts->ndpsign :
2613+
CDC_MBIM_NDP16_NOCRC_SIGN;
26122614
uinfo("NCM16 selected\n");
26132615
ret = 0;
26142616
break;
26152617
case 0x0001:
26162618
self->parseropts = &g_ndp32_opts;
2619+
self->ndpsign = self->isncm ? self->parseropts->ndpsign :
2620+
CDC_MBIM_NDP32_NOCRC_SIGN;
26172621
uinfo("NCM32 selected\n");
26182622
ret = 0;
26192623
break;

0 commit comments

Comments
 (0)