Skip to content

Commit 097dd84

Browse files
zhhyu7acassis
authored andcommitted
drivers/usbdev/cdcecm.c: fix cdcecm netdev can not enter running state
When the setinterface interface is called, it indicates that the underlying USB link has been successfully established. At this point, the status of the network card needs to be updated to RUNNING by calling the netdev_carrier_on interface. It is similar to the logic after a Wi-Fi network card is connected to a hotspot. Otherwise, an incorrect network card status may cause packets to fail to be successfully sent. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
1 parent b95cfa1 commit 097dd84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usbdev/cdcecm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,7 @@ static int cdcecm_setconfig(FAR struct cdcecm_driver_s *self, uint8_t config)
10471047
static int cdcecm_setinterface(FAR struct cdcecm_driver_s *self,
10481048
uint16_t interface, uint16_t altsetting)
10491049
{
1050+
netdev_carrier_on(&self->dev);
10501051
uinfo("interface: %hu, altsetting: %hu\n", interface, altsetting);
10511052
return OK;
10521053
}

0 commit comments

Comments
 (0)