mirror of
https://github.com/apache/nuttx.git
synced 2026-09-26 01:46:57 +08:00
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>
This commit is contained in:
committed by
Alan C. Assis
parent
b95cfa1b14
commit
097dd84bba
@@ -1047,6 +1047,7 @@ error:
|
||||
static int cdcecm_setinterface(FAR struct cdcecm_driver_s *self,
|
||||
uint16_t interface, uint16_t altsetting)
|
||||
{
|
||||
netdev_carrier_on(&self->dev);
|
||||
uinfo("interface: %hu, altsetting: %hu\n", interface, altsetting);
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user