nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

drivers/usbdev/cdcecm.c: fix cdcecm netdev can not enter running state

Open zhhyu7 opened this issue 4 weeks ago • 2 comments

Summary

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.

Impact

Fixed the issue where the network card status did not enter "running" after the CDCECM usb connection was established.

Testing

sim:usbdev Establish a cdcecm network card connection with HOST Linux and send/receive packets.

zhhyu7 avatar Dec 05 '25 10:12 zhhyu7

@zhhyu7 please include more details in the commit log message what is the problem and calling the netdev_carrier_on() fixes the issue. This way someone reading your commit in the future will be a better understating about the issue

Done.

zhhyu7 avatar Dec 08 '25 01:12 zhhyu7

Can you provide any logs from your testing? And fill out the impact section (something like "bug fix for CDCECM in scenario where ....")

linguini1 avatar Dec 08 '25 17:12 linguini1

Can you provide any logs from your testing? And fill out the impact section (something like "bug fix for CDCECM in scenario where ....")

@linguini1 I added the ping test log based on the CDCECM in the sim environment.

zhhyu7 avatar Dec 15 '25 12:12 zhhyu7

@linguini1 I added the ping test log based on the CDCECM in the sim environment.

Looks good! I assume the first NuttX test case that failed was before your change? Can you indicate that?

linguini1 avatar Dec 15 '25 14:12 linguini1