OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
  • Task Type Bug Report
  • Category Kernel
  • Assigned To
    Piotr Dymacz
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Kuan-Yi Li - 09.05.2020
Last edited by Piotr Dymacz - 31.05.2021

FS#3085 - RNDIS USB Guest Breaks When Switched to Kernel 5.4

Device problem occurs on

Raspberry Pi 4 Model B

Software versions of OpenWrt release, packages, etc.

OpenWrt version: master branch
Packages installed: kmod-usb-dwc2, kmod-usb-gadget-eth (g_ether)

Problem description

USB-C port of Pi 4 is capable of running in device/guest mode (USB OTG) just like Pi Zero.

Raspberry Pi Zero W Headless setup – Windows 10 RNDIS Driver issue resolved - FactoryForward

It used to work with OpenWrt and Linux kernel 4.19, but it breaks when switched to 5.4.

In dmesg, you get errors like

[ 1759.419106] g_ether gadget: high-speed config #1: CDC Ethernet (ECM)
[ 1770.559826] g_ether gadget: high-speed config #2: RNDIS
[ 1783.798053] rndis_msg_parser: unknown RNDIS message 0x00520328 len 4456526
[ 1783.804934] RNDIS command error -524, 24/24
[ 2259.991384] rndis_msg_parser: unknown RNDIS message 0x00520328 len 4456526
[ 2259.998275] RNDIS command error -524, 24/24

Steps to reproduce

  1. Modify KERNEL_PATCHVER=5.4 in target/linux/bcm27xx/Makefile to KERNEL_PATCHVER=4.19
  2. Append dtoverlay=dwc2 to target/linux/bcm27xx/image/config.txt
  3. Build the image with kernel module package kmod-usb-dwc2 and kmod-usb-gadget-eth selected
  4. Flash the image to SD card for Pi
  5. Connect Pi’s USB-C to a Windows computer (or VM)
  6. Connect to Pi’s console through Ethernet or UART
  7. Run following commands
    modprobe g_ether
    uci set network.lan.ifname='eth0 usb0'
    uci commit network
    /etc/init.d/network restart
  8. Install RNDIS driver provided in headless Pi Zero tutorial
  9. You should now have a working USB Pi network adapter
  10. Now revert the change from step 1 and run the whole thing again, instead of a working network adapter, Windows will report error initializing the interface.


g_ether will run CDC-ECM when connected to Linux/macOS, not RNDIS.

Closed by  Piotr Dymacz
31.05.2021 06:14
Reason for closing:  Fixed
Additional comments about closing:  

Should be fixed in kernel 5.4.120 and 5.10.38


Available keyboard shortcuts


Task Details

Task Editing