mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00: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:
parent
b95cfa1b14
commit
097dd84bba
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue