From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 7453 invoked from network); 21 Apr 2021 05:18:02 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 21 Apr 2021 05:18:02 -0000 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by 1ess; Wed Apr 21 01:12:52 -0400 2021 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8E688D325B for <9front@9front.org>; Wed, 21 Apr 2021 01:12:02 -0400 (EDT) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id:to :subject:date:from:mime-version:content-type :content-transfer-encoding; s=sasl; bh=g9uf+BlzZvyKKLI9eXfSwbn7q Ic=; b=T2WdiCZX6AtCah6kLa/VP/mXzwVL0n6edKqXF+OQ2FDLvgVm3/7TE4Gew o/RXtOpF2vmgRk16h6/Mm0ZGQStJTuUEaBfSsk4O8mY8UevgW+8/1puQaLVmpDhE 4bMkhFnXKa3k0DGjzEIzY1DvkFAuuuR5pg6bjQu/Kh6nI9uQxs= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8839AD325A for <9front@9front.org>; Wed, 21 Apr 2021 01:12:02 -0400 (EDT) (envelope-from unobe@cpan.org) Received: from peregrin (unknown [47.34.135.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id C30D9D3258 for <9front@9front.org>; Wed, 21 Apr 2021 01:12:01 -0400 (EDT) (envelope-from unobe@cpan.org) Message-ID: <83A633950F8461674D72EEFE5A5D02ED@smtp.pobox.com> To: 9front@9front.org Date: Tue, 20 Apr 2021 22:11:59 -0700 From: unobe@cpan.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 1B0C75AA-A260-11EB-9004-D152C8D8090B-09620299!pb-smtp1.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: responsive interface framework-aware engine-aware frontend Subject: [9front] [patch] RNDIS alignment between rndis.c and kernel/userland nusbrc Reply-To: 9front@9front.org Precedence: bulk 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 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; }