-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Less of an issue and more of a currently documented fact - after enabling the RNDIS gadget, Windows will not automatically install the correct RNDIS driver and enable the interface - you have to manually set the driver per instructions here: https://wiki.sipeed.com/hardware/en/lichee/RV_Nano/5_peripheral.html#USB-RNDIS-Network-Port
However if I change the compatible class/subclass/protocol to E0/01/03 respectively then this "just works" on windows - no need to explicitly override the driver, Windows auto-detects and installs the driver by itself.
I was able to make this change by adding the three additional lines to run_usb.sh immediately after Label/data is set:
https://github.com/sipeed/LicheeRV-Nano-Build/blob/main/ramdisk/rootfs/common_uclibc/etc/run_usb.sh#L146
....
echo "XYZ Device" >$CVI_FUNC/rndis.usb$FUNC_NUM/os_desc/interface.rndis/Label/data
echo "E0" >$CVI_FUNC/rndis.usb$FUNC_NUM/class
echo "01" >$CVI_FUNC/rndis.usb$FUNC_NUM/subclass
echo "03" >$CVI_FUNC/rndis.usb$FUNC_NUM/protocol
I have tested this change on Windows 11 24H2 and Ubuntu 22.04 and the gadget registers correctly.
I have not tested this on macOS or other linux and windows versions, but I have reasonable belief that it should work everywhere.
So open questions:
- Is there a reason this wasn't done before?
- The source repo has four different copies of run_usb.sh common_uclibc and three different overlay versions - which one ultimately makes it into the image, and would it make sense to patch all of them?