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 28057 invoked from network); 7 Apr 2021 07:57:46 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2021 07:57:46 -0000 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by 1ess; Wed Apr 7 03:50:46 -0400 2021 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id F2F68BD994 for <9front@9front.org>; Wed, 7 Apr 2021 03:50:36 -0400 (EDT) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :from:to:subject:date:mime-version:content-type; s=sasl; bh=SCvh JnC+CmtwuAH6ozhGN2YvEUE=; b=yfrhCMycF6bRa4hFShpNxuk1G0AkiJ73hjjI 0cypxczpTgSsorZtH1gaAm5cRQHJglO9XgSRVsIo4UunM0sEanoHwofmL2dqAB5j SYnpW2FgCY7YQHEnqjn1CvoQDavbyonPQb0SlRdWt2XhDJnyV1aZiFJYyWsTo0VG Gvtcd08= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DB9B4BD992 for <9front@9front.org>; Wed, 7 Apr 2021 03:50:36 -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-smtp1.pobox.com (Postfix) with ESMTPSA id 0F4EBBD990 for <9front@9front.org>; Wed, 7 Apr 2021 03:50:35 -0400 (EDT) (envelope-from unobe@cpan.org) Message-ID: From: Romano To: 9front@9front.org Date: Wed, 07 Apr 2021 00:50:34 -0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-szdxbpmbiqnopcjokigpoufxfm" X-Pobox-Relay-ID: F030E504-9775-11EB-845D-D152C8D8090B-09620299!pb-smtp1.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: strategy self-signing framework module Subject: [9front] [patch] nusb/serial: rndis handled by nusbrc Reply-To: 9front@9front.org Precedence: bulk This is a multi-part message in MIME format. --upas-szdxbpmbiqnopcjokigpoufxfm Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit See attached. These changes keep nusb/serial from attempting to use an RNDIS endpoint. Without this patch, nusb/serial will generate an error like: nusb/serial: getdev: '/dev/usb/ep17.0/data' device or object already in use when an RNDIS endpoint has already been found (e.g., a pinephone usb tether). I had unfortunately overlooked this part when I submitting my previous patch for nusb/ether. Additionally, if there is no ethernet on boot, don't attempt to look for an address. The last bit is just updating a comment to match the code. --upas-szdxbpmbiqnopcjokigpoufxfm Content-Disposition: attachment; filename=nusb.patch Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff -r 18e1e1c3aaf1 rc/bin/cpurc --- a/rc/bin/cpurc Tue Apr 06 14:43:38 2021 +0200 +++ b/rc/bin/cpurc Wed Apr 07 00:39:55 2021 -0700 @@ -59,7 +59,8 @@ addrs=`{ndb/query -a sys $sysname ether} if(! ~ $#addrs 0){ for(ether in /net/ether*){ - addr=`{cat $ether/addr} + if (test -d $ether) + addr=`{cat $ether/addr} switch($addr){ case $addrs # try /lib/ndb first, then do dhcp/slaac diff -r 18e1e1c3aaf1 rc/bin/nusbrc --- a/rc/bin/nusbrc Tue Apr 06 14:43:38 2021 +0200 +++ b/rc/bin/nusbrc Wed Apr 07 00:39:55 2021 -0700 @@ -14,8 +14,9 @@ case *01 nusb/audio $id case *02 - # serial and ethernet - nusb/serial $id + # serial and ethernet: 0xff0202 is RNDIS, handled by nusbrc + if (! ~ $4 ff0202) + nusb/serial $id # handled /sys/src/9/boot/nusbrc # nusb/ether $id case *03 diff -r 18e1e1c3aaf1 sys/src/cmd/nusb/ether/ether.c --- a/sys/src/cmd/nusb/ether/ether.c Tue Apr 06 14:43:38 2021 +0200 +++ b/sys/src/cmd/nusb/ether/ether.c Wed Apr 07 00:39:55 2021 -0700 @@ -849,7 +849,7 @@ nerr = 0; for(;;){ - /* receive allocates buffer and calls etheriq(b, 1); */ + /* receive allocates buffer and calls etheriq(b); */ if((*epreceive)(epin) < 0){ rerrstr(err, sizeof(err)); if(strstr(err, "interrupted") || strstr(err, "timed out")) --upas-szdxbpmbiqnopcjokigpoufxfm--