Skip to content
Commit 58f78dbf authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam
Browse files

usb: gadget: Add support for different rndis usbif class codes

RNDIS (Remote NDIS) is supported using many combinations of class,
subclass and protocol. Enhance the current implementation to allow
dynamically choosing one of the combinations. Currently, Windows7/
Windows10 automatically loads RNDIS drivers for class drivers which
represents MISC_ACTIVE_SYNC, MISC_RNDIS_OVER_ETHERNET and
WIRELESS_CONTROLLER_REMOTE_NDIS. All the codes listed below are from
http://www.usb.org/developers/defined_class

 and its unknown why windows
loads rndis class driver for some of them.  Note that, Windows loads
NDIS6 stack automatically for MISC_RNDIS_OVER_ETHERNET. Windows loads
NDIS5 stack for MISC_ACTIVE_SYNC and WIRELESS_CONTROLLER_REMOTE_NDIS.
For other class codes, NDIS stack can be installed using customized INF
file but that defeats the purpose as its expected to load drivers
automatically for known class drivers published by usbif.  Linux rndis
host driver supports MISC_ACTIVE_SYNC and WIRELESS_CONTROLLER_REMOTE_NDIS
as of now.

rndis_class_id - usb class/subclass/protocol
 1	- 	WIRELESS_CONTROLLER_REMOTE_NDIS (0xE0/0x1/0x3)
 2	-	MISC_ACTIVE_SYNC(0xEF/0x1/0x1)
 3	-	MISC_RNDIS_OVER_ETHERNET(0xEF/0x4/0x1)
 4	-	MISC_RNDIS_OVER_WIFI(0xEF/0x4/0x2)
 5	-	MISC_RNDIS_OVER_WIMAX(0xEF/0x4/0x3)
 6	-	MISC_RNDIS_OVER_WWAN(0xEF/0x4/0x4)
 7	-	MISC_RNDIS_FOR_IPV4(0xEF/0x4/0x5)
 8	-	MISC_RNDIS_FOR_IPV6(0xEF/0x4/0x6)
 9	-	MISC_RNDIS_FOR_GPRS(0xEF/0x4/0x7)

Example: to select MISC_RNDIS_OVER_ETHERNET use following command:

echo 3 > /config/usb_gadget/g1/functions/gsi.rndis/rndis_class_id

Change-Id: Ic650867b3038556d055c4449372103564ae95a11
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent d91ef6f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment