Getting rid of RNDIS
So... this nice patch for Linux was posted a few days ago, essentially completely disabling RNDIS in Linux: https://lore.kernel.org/lkml/20221123124620.1387499-1-gregkh@linuxfoundation.org/t/
As you might know, we use rndis for USB networking for many devices so both client and host side will be broken if this gets applied as-is (and people update the kernel to a version containing this).
But even if it doesn't get applied as-is (which I imagine given some of the comments in the thread, but who knows) I think we should stop using rndis since we have no good reason to do so - compared to other networking protocols that can be used with usb gadget.
From what I can tell, there's basically 4 networking protocols that can be used in such a way: RNDIS (currently used), EEM, ECM & NCM.
The question is just which one to use. In the short list is EEM and NCM. Based on https://usblan.belcarra.com/2011/02/cdc-eem-vs-cdc-ecm-protocols.html EEM has significantly better performance compared to ECM, and NCM is essentially a better version of ECM and similar performance.
This comment from a Google engineer is in the linked email thread:
New devices (ie. phones) moving to newer kernels should simply be switching to the NCM gadget drivers.
The problem with NCM seems to be platform support, Windows 10 (and lower) don't support NCM, based on https://www.reddit.com/r/embedded/comments/aeqxbl/which_usbethernet_standard_should_i_implement/ and https://github.com/microsoft/NCM-Driver-for-Windows/issues/8#issuecomment-872347442 . Windows 11 apparently does. I know that we don't like Windows but I'm sure there's people using WSL or a VM on Windows, but still using e.g. putty on Windows to connect to the phone (not passing the USB device through to the VM and using it there). macOS probably supports them all, and of course Linux does as well.
I've looked into how we can get rid of rndis and it seems to be rather simple switching out rndis with ncm in the initramfs, as long as the config is enabled in the kernel it should just work, but still want to get your input and thoughts. I think as first step it should be simple adding the kconfig option to community kconfig check and therefore force all these devices to use e.g. ncm while not affecting mostly downstream devices (because who knows what works or doesn't work there). I guess with e.g. EEM it would be the same situation.