diff options
author | Romano <unobe@cpan.org> | 2021-04-01 12:54:08 +0200 |
---|---|---|
committer | Romano <unobe@cpan.org> | 2021-04-01 12:54:08 +0200 |
commit | a398a097831f619fbebf064134b8931cb24ca051 (patch) | |
tree | d4a6fa871798077575e518fa4cacfcba7699598e | |
parent | fcc93463a3e2fec9738330b1d82a11b077c96315 (diff) | |
download | plan9front-a398a097831f619fbebf064134b8931cb24ca051.tar.xz |
[9front] [patch] nusb/ether -t rndis
-rw-r--r-- | sys/man/4/nusb | 5 | ||||
-rwxr-xr-x | sys/src/9/boot/nusbrc | 7 | ||||
-rw-r--r-- | sys/src/cmd/nusb/ether/rndis.c | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/sys/man/4/nusb b/sys/man/4/nusb index 6fe89b401..e7be812e6 100644 --- a/sys/man/4/nusb +++ b/sys/man/4/nusb @@ -60,7 +60,7 @@ upon attachment of the device to the bus. All drivers except .I usbd take the decimal usb .I devid -of the device they should handle as ther last argument. A +of the device they should handle as their last argument. A driver's instance handles only one device at a time. .PP Drivers that provide file systems make them available as shares under @@ -181,6 +181,9 @@ explicit such as .BR rndis , .BR smsc , +.BR url , +.BR lan78xx , +.BR aue , .BR a88772 or .BR a88178 diff --git a/sys/src/9/boot/nusbrc b/sys/src/9/boot/nusbrc index bf3c311e0..43ce0a6e1 100755 --- a/sys/src/9/boot/nusbrc +++ b/sys/src/9/boot/nusbrc @@ -34,8 +34,11 @@ if(! nusb/usbd) case *03 nusb/kb $id case *02 - # CDC ethernet - nusb/ether $etherargs $id + # RNDIS, otherwise CDC ethernet + if(~ $4 ff0202) + nusb/ether -t rndis $etherargs $id + if not + nusb/ether $etherargs $id case *08 if(nusb/disk $id) @{ rfork ne diff --git a/sys/src/cmd/nusb/ether/rndis.c b/sys/src/cmd/nusb/ether/rndis.c index 68985a3e9..71640f7c7 100644 --- a/sys/src/cmd/nusb/ether/rndis.c +++ b/sys/src/cmd/nusb/ether/rndis.c @@ -118,7 +118,8 @@ rndisinit(Dev *d) for(i = 0; i < nelem(d->usb->ep); i++){ if((ep = d->usb->ep[i]) == nil) continue; - if(ep->iface->csp == 0x000301e0) + // ff0202 is canonical CSP per Linux kernel; 301e0 used by Nexus 5 + if(ep->iface->csp == 0xff0202 || ep->iface->csp == 0x000301e0) r = 1; } if(!r){ |