9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [patch] RNDIS alignment between rndis.c and kernel/userland nusbrc
@ 2021-04-21  5:11 unobe
  0 siblings, 0 replies; only message in thread
From: unobe @ 2021-04-21  5:11 UTC (permalink / raw)
  To: 9front

Sigrid merged code for /sys/src/9/boot/nusbrc that wasn't as far
reaching as my proposed patch, being more sensible about how RNDIS was
used (that is, only over ethernet).  The code for the Nexus 5 in the
existing code comment is one actually given @
http://www.usb.org/defined-class-codes . /rc/bin/nusbrc and
/sys/src/9/boot/nusbrc should be aligned with the standard codes as
accepted by rndis.c, and not require a per-device-id configuration.
This patch doesn't change what nusb/ether accepts, just makes nusbrc
(both for the kernel and after boot) recognize the standard codes.

changeset:   8442:e5532d6dc58b
branch:      mbp-2011
tag:         tip
user:        Romano <unobe@cpan.org>
date:        Tue Apr 20 22:02:44 2021 -0700
files:       rc/bin/nusbrc sys/src/9/boot/nusbrc sys/src/cmd/nusb/ether/rndis.c
description:
Align CSP found in rndis.c with both boot/nusbrc and nusbrc using
only RNDIS over ethernet codes found in linux kernel (and used by
PinePhone) and in https://www.usb.org/defined-class-codes


diff -r 0b9fe31cb121 -r e5532d6dc58b rc/bin/nusbrc
--- a/rc/bin/nusbrc	Tue Apr 20 21:56:03 2021 -0700
+++ b/rc/bin/nusbrc	Tue Apr 20 22:02:44 2021 -0700
@@ -13,7 +13,7 @@
 		switch($4){
 		case *01
 			nusb/audio $id
-		case ff0202
+		case ff0202 0301e0 0104ef
 			# RNDIS; handled by /sys/src/9/boot/nusbrc
 		case *02
 			# handled /sys/src/9/boot/nusbrc
diff -r 0b9fe31cb121 -r e5532d6dc58b sys/src/9/boot/nusbrc
--- a/sys/src/9/boot/nusbrc	Tue Apr 20 21:56:03 2021 -0700
+++ b/sys/src/9/boot/nusbrc	Tue Apr 20 22:02:44 2021 -0700
@@ -33,7 +33,7 @@
 			switch($4){
 			case *03
 				nusb/kb $id
-			case ff0202 0104ef
+			case ff0202 0301e0 0104ef
 				nusb/ether -t rndis $etherargs $id
 			case *02
 				# CDC ethernet
diff -r 0b9fe31cb121 -r e5532d6dc58b sys/src/cmd/nusb/ether/rndis.c
--- a/sys/src/cmd/nusb/ether/rndis.c	Tue Apr 20 21:56:03 2021 -0700
+++ b/sys/src/cmd/nusb/ether/rndis.c	Tue Apr 20 22:02:44 2021 -0700
@@ -120,7 +120,8 @@
 		if((ep = d->usb->ep[i]) == nil)
 			continue;
 		csp = ep->iface->csp;
-		// ff0202 is canonical CSP per Linux kernel; 301e0 used by Nexus 5
+		// ff0202 is canonical CSP per Linux kernel; 0x0301e0 and 0x0104ef
+		// are defined class codes for RNDIS found on usb.org.
 		if(csp == 0xff0202 || csp == 0x0301e0 || csp == 0x0104ef)
 			r = 1;
 	}



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-21  5:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  5:11 [9front] [patch] RNDIS alignment between rndis.c and kernel/userland nusbrc unobe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).