This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 097dd84bba0 drivers/usbdev/cdcecm.c: fix cdcecm netdev can not enter 
running state
097dd84bba0 is described below

commit 097dd84bba046ea5a400bdd2d1b82698f60fc7bd
Author: zhanghongyu <[email protected]>
AuthorDate: Mon Feb 10 11:53:34 2025 +0800

    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 <[email protected]>
---
 drivers/usbdev/cdcecm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usbdev/cdcecm.c b/drivers/usbdev/cdcecm.c
index 17f3da76140..06a89ade2ef 100644
--- a/drivers/usbdev/cdcecm.c
+++ b/drivers/usbdev/cdcecm.c
@@ -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;
 }

Reply via email to