9front - general discussion about 9front
 help / color / mirror / Atom feed
From: unobe@cpan.org
To: 9front@9front.org
Subject: [9front] [patch] RNDIS alignment between rndis.c and kernel/userland nusbrc
Date: Tue, 20 Apr 2021 22:11:59 -0700	[thread overview]
Message-ID: <83A633950F8461674D72EEFE5A5D02ED@smtp.pobox.com> (raw)

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;
 	}



                 reply	other threads:[~2021-04-21  5:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83A633950F8461674D72EEFE5A5D02ED@smtp.pobox.com \
    --to=unobe@cpan.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).