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 6195 invoked from network); 1 Apr 2021 10:53:56 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 1 Apr 2021 10:53:56 -0000 Received: from pb-smtp2.pobox.com ([64.147.108.71]) by 1ess; Thu Apr 1 06:49:19 -0400 2021 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 6F793ADA1A for <9front@9front.org>; Thu, 1 Apr 2021 06:46:27 -0400 (EDT) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :from:subject:to:date:mime-version:content-type; s=sasl; bh=7NmX 1sH67gKfbDAdeXqD0OHc+gQ=; b=YUXneUAn1v16h42Np+fDEQO7O0Ns0hOntHds CYKULX0QJX5hdi/WrISJG4ifM50baNzpUDJzKwynIOq9eQRHxf+ArnFMxJccgvth YQThVYoYLi1nFx3htOSo7WWib1eiYleBNkAsCeTA/c0LrhfoZtgPvkC2tlwVXJpv DoUsNQg= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 678B5ADA18 for <9front@9front.org>; Thu, 1 Apr 2021 06:46:27 -0400 (EDT) (envelope-from unobe@cpan.org) Received: from samwise (unknown [47.34.135.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id C4BDAADA15 for <9front@9front.org>; Thu, 1 Apr 2021 06:46:26 -0400 (EDT) (envelope-from unobe@cpan.org) Message-ID: <062010C4AA52C2737498BB5D886EFB3D@smtp.pobox.com> From: Romano To: 9front@9front.org Date: Thu, 01 Apr 2021 03:46:25 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-wkujmitkzazutjiujjqytbsxeq" X-Pobox-Relay-ID: 82763ACA-92D7-11EB-9D41-74DE23BA3BAF-09620299!pb-smtp2.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: WEB2.0 over ACPI realtime storage framework Subject: [9front] [patch] nusb/ether -t rndis Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-wkujmitkzazutjiujjqytbsxeq Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit The attached patch fixes ethernet tethering to work with a PinePhone. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=64e049102d3de3e61409cb6019403a9e689dfda6 mentions that the typical RNDIS is a variant of CDC ACM with CSP 0xff0202, so I added that and also noted that the existing value works with Nexus 5 (as mentioned in the original commit). I also updated the man page for nusb to fix a typo and to enumerate the current list of supported types, and updated sys/src/9/boot/nusbrc to automatically detect when an RNDIS device is connected. --upas-wkujmitkzazutjiujjqytbsxeq Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff -r a62bc34fa4fa sys/man/4/nusb --- a/sys/man/4/nusb Wed Mar 31 17:50:25 2021 +0200 +++ b/sys/man/4/nusb Thu Apr 01 10:14:27 2021 -0700 @@ -60,7 +60,7 @@ .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 @@ such as .BR rndis , .BR smsc , +.BR url , +.BR lan78xx , +.BR aue , .BR a88772 or .BR a88178 diff -r a62bc34fa4fa sys/src/9/boot/nusbrc --- a/sys/src/9/boot/nusbrc Wed Mar 31 17:50:25 2021 +0200 +++ b/sys/src/9/boot/nusbrc Thu Apr 01 10:14:27 2021 -0700 @@ -34,8 +34,11 @@ 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 -r a62bc34fa4fa sys/src/cmd/nusb/ether/rndis.c --- a/sys/src/cmd/nusb/ether/rndis.c Wed Mar 31 17:50:25 2021 +0200 +++ b/sys/src/cmd/nusb/ether/rndis.c Thu Apr 01 10:14:27 2021 -0700 @@ -118,7 +118,8 @@ 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){ --upas-wkujmitkzazutjiujjqytbsxeq--