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:
zhanghongyu 2025-02-10 11:53:34 +08:00 committed by Alan C. Assis
parent b95cfa1b14
commit 097dd84bba

View file

@ -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;
}