From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pb-smtp20.pobox.com ([173.228.157.52]) by ewsd; Fri Nov 20 16:43:16 -0500 2020 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 31807F0068 for <9front@9front.org>; Fri, 20 Nov 2020 16:43:09 -0500 (EST) (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=13EJ k/WqMHVm3v5e3MJ05sJn184=; b=kO9eZzlctqU+t/4EhTivauKybbrz3mc+UDR6 vYb+yDGY5JzaBbOgba1eU7+rjvPwXja2iaN3dlJdd8NxpV+TSzhmJ1tMbEXeYBvD Z629D4wYOhlccra6VgurFbigD0LBWudpYHYxwFgcEuqMhbVh2oHmopibfhlFtwZ8 kPr1ELE= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 2A3F4F0067 for <9front@9front.org>; Fri, 20 Nov 2020 16:43:09 -0500 (EST) (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-smtp20.pobox.com (Postfix) with ESMTPSA id 63304F0064 for <9front@9front.org>; Fri, 20 Nov 2020 16:43:06 -0500 (EST) (envelope-from unobe@cpan.org) Message-ID: <26C61BE088AB556C851A08493C15610F@smtp.pobox.com> From: Romano To: 9front@9front.org Subject: Re: [9front] bug: nusb fails to set report protocol with a stall error Date: Fri, 20 Nov 2020 13:43:04 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-lefnhhovifxswivmwjbilzxumg" X-Pobox-Relay-ID: 5FE21544-2B79-11EB-AD10-E43E2BB96649-09620299!pb-smtp20.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: decentralized TOR storage browser-scale framework This is a multi-part message in MIME format. --upas-lefnhhovifxswivmwjbilzxumg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit The patch to kb.c compiled fine, but the patch for joy.c didn't compile for me: cpu% mk 7c -I../lib -FTVw joy.c joy.c:228 name not declared: iface mk: 7c -I../lib -FTVw joy.c : exit status=rc 2880351: 7c 2880353: error Just to see if it would compile I replaced "iface" with "f->dev->usb->ep[eid]->iface" and it did. Did you have iface referring to something else? --upas-lefnhhovifxswivmwjbilzxumg Content-Type: message/rfc822 Content-Disposition: inline Received: from pb-mx23.pobox.com (pb-mx23.pobox.com [10.110.30.39]) by ms-dispatch4.pobox.com (Postfix) with ESMTP id 6552F33AD5 for <09620299@mailstore.pobox.com>; Fri, 20 Nov 2020 07:59:20 -0500 (EST) (envelope-from SRS0=WjcE=E2=ewsd.inri.net=9front-bounces@bounce2.pobox.com) Received: from pb-mx23.sea.icgroup.com (localhost.local [127.0.0.1]) by pb-mx23.pobox.com (Postfix) with ESMTP id 1F52130773 for <09620299@mailstore.pobox.com>; Fri, 20 Nov 2020 07:59:20 -0500 (EST) (envelope-from SRS0=WjcE=E2=ewsd.inri.net=9front-bounces@bounce2.pobox.com) X-Pobox-Loop-ID: 711e34c8db9eb0bbfaea486c9541cf39eda14fc2 Delivered-To: dromano@pobox.com X-Pobox-Delivery-ID: E285A2-AF99730772-1605877160-09620299!pb-mx23.pobox.com Received: from pb-mx23.sea.icgroup.com (localhost.local [127.0.0.1]) by pb-mx23.pobox.com (Postfix) with ESMTP id AF99730772 for ; Fri, 20 Nov 2020 07:59:19 -0500 (EST) (envelope-from SRS0=WjcE=E2=ewsd.inri.net=9front-bounces@bounce2.pobox.com) X-Pobox-Loop-ID: afb0d911f200b44eb9a4a0476d4ed80f2edca2c6 Delivered-To: unobe@cpan.org X-Pobox-Delivery-ID: E285A3-756E6F6265406370616E2E6F7267-0C8033076B-1605877159-61099943!pb-mx23.pobox.com Received: from pb-mx23.pobox.com (localhost.local [127.0.0.1]) by pb-mx23.pobox.com (Postfix) with ESMTP id 0C8033076B for ; Fri, 20 Nov 2020 07:59:19 -0500 (EST) (envelope-from 9front-bounces@ewsd.inri.net) Received: from pb-mx23.pobox.com (localhost [127.0.0.1]) by pb-mx23.pobox.com (Authentication Milter) with ESMTP id 081C4AEE4D9; Fri, 20 Nov 2020 07:59:19 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=pobox.com; s=arcseal; t= 1605877159; b=AOPq0KvTFMTabOzepkdJDGLU5HvJpXDfHIolIhHC9UZYiRHDQj qsdfJLBbItfX7oSQtDIxSLpJEREYRFqOx7SdQOHXdjiK65kDGv35rnkwlrYpHjvJ 29kGY3VyzOBVLQextiPJYTXebun0+oXhB6ief53OBThuZMXMDOi2VpBSFdWgyWiR XhZInkel/waP3mFT/wCGmrz8rNaCtqwHscUeREPGIDgU200v0/katGqt01a9dHco GUIQxek0yB8s40j+08G3cnmJhCcBsZqz8ZChZkDwc9Al0FRvU68EisOruYtZrE8o xT81FwguEQzMuzSbar8zWkPNNveZzcvGZJoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= pobox.com; h=date:from:to:message-id:mime-version:content-type :list-id:list-help:subject:reply-to; s=arcseal; t=1605877159; bh=8r/8u57r778sVmAuu9tiWJ2Orim73fUnATf95NoYvu0=; b=LALV6uohmtap UBEFWqp4Z4v0cHaPWxRVq7QvHDAniXIQ8H/R0aMd7YggaUXVwTxSvSKJL1ja97AJ GBirwuarxP5I1sIMO+HJsKoxdY+Wq5z+OPfY92Tj1zOJ5WHNLoU3ew6sT/YTp/i/ /gKagNUFh8TtVLWd+O6eJRWxbpTh2S40/oGM3OVnVYBz+eXhZcx2QioSHUP+m3ew y9LtB66GXTi9DsVyYzjXe0klvxhzOjwijVC3VLv05maicBxZp7/GtWrMrlBEgKZP omH21ItarvDdofDX2TrFdoZaY954qa9CdhCpkRb4ImaVoUrkfZiZxuFwbwNyHn7n pCH/3h9NBA== ARC-Authentication-Results: i=1; pb-mx23.pobox.com; arc=none (no signatures found); bimi=skipped (DMARC none); dkim=fail (message has been altered, 2048-bit rsa key sha256) header.d=offblast-org.20150623.gappssmtp.com header.i=@offblast-org.20150623.gappssmtp.com header.b=GCxDWJvv header.a=rsa-sha256 header.s=20150623 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,has-list-id=yes,d=none,d.eval=none) policy.policy-from=p header.from=offblast.org; iprev=pass smtp.remote-ip=107.191.116.128 (ewsd.inri.net); spf=pass smtp.mailfrom=9front-bounces@ewsd.inri.net smtp.helo=ewsd.inri.net; x-aligned-from=fail; x-google-dkim=fail (message has been altered, 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=s3sHitHN; x-ptr=pass smtp.helo=ewsd.inri.net policy.ptr=ewsd.inri.net; x-return-mx=pass header.domain=offblast.org policy.is_org=yes (MX Records found: aspmx.l.google.com,aspmx4.googlemail.com,alt2.aspmx.l.google.com,alt1.aspmx.l.google.com,aspmx3.googlemail.com,aspmx2.googlemail.com); x-return-mx=pass smtp.domain=ewsd.inri.net policy.org_domain=inri.net policy.is_org=no (MX Records found: ewsd.inri.net); x-vs=clean score=0 state=0 Authentication-Results: pb-mx23.pobox.com; arc=none (no signatures found); bimi=skipped (DMARC none); dkim=fail (message has been altered, 2048-bit rsa key sha256) header.d=offblast-org.20150623.gappssmtp.com header.i=@offblast-org.20150623.gappssmtp.com header.b=GCxDWJvv header.a=rsa-sha256 header.s=20150623 x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,has-list-id=yes,d=none,d.eval=none) policy.policy-from=p header.from=offblast.org; iprev=pass smtp.remote-ip=107.191.116.128 (ewsd.inri.net); spf=pass smtp.mailfrom=9front-bounces@ewsd.inri.net smtp.helo=ewsd.inri.net; x-aligned-from=fail; x-google-dkim=fail (message has been altered, 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=s3sHitHN; x-ptr=pass smtp.helo=ewsd.inri.net policy.ptr=ewsd.inri.net; x-return-mx=pass header.domain=offblast.org policy.is_org=yes (MX Records found: aspmx.l.google.com,aspmx4.googlemail.com,alt2.aspmx.l.google.com,alt1.aspmx.l.google.com,aspmx3.googlemail.com,aspmx2.googlemail.com); x-return-mx=pass smtp.domain=ewsd.inri.net policy.org_domain=inri.net policy.is_org=no (MX Records found: ewsd.inri.net); x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedujedrudegtddggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvkf ggtggufgejfefurhhpsehttdertddtredvnecuhfhrohhmpefpihgtkhcuqfifvghnshcu oehmihhstghhihgvfhesohhffhgslhgrshhtrdhorhhgqeenucggtffrrghtthgvrhhnpe euudefffdttddtudehffelveetveeigfefjeevuedthfektdetvefhteelleejhfenucfk phepuddtjedrudeluddrudduiedruddvkedpvdeitddumeeigeeimedutddtmeektggsme dvtgeiugemfheffhhfmehfvgefvdemrgeifedvnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehinhgvthepuddtjedrudeluddrudduiedruddvkedphhgvlhhopegvfi hsugdrihhnrhhirdhnvghtpdhmrghilhhfrhhomhepoeelfhhrohhnthdqsghouhhntggv shesvgifshgurdhinhhrihdrnhgvtheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (ewsd.inri.net: 107.191.116.128 is authorized to use '9front-bounces@ewsd.inri.net' in 'mfrom' identity (mechanism 'mx' matched)) receiver=pb-mx23.pobox.com; identity=mailfrom; envelope-from="9front-bounces@ewsd.inri.net"; helo=ewsd.inri.net; client-ip=107.191.116.128 Received: from ewsd.inri.net (ewsd.inri.net [107.191.116.128]) by pb-mx23.pobox.com (Postfix) with ESMTP for ; Fri, 20 Nov 2020 07:59:17 -0500 (EST) (envelope-from 9front-bounces@ewsd.inri.net) Received: from mail-pl1-f172.google.com ([209.85.214.172]) by ewsd; Fri Nov 20 07:58:35 -0500 2020 Received: by mail-pl1-f172.google.com with SMTP id b3so4803882pls.11 for <9front@9front.org>; Fri, 20 Nov 2020 04:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=offblast-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=8r/8u57r778sVmAuu9tiWJ2Orim73fUnATf95NoYvu0=; b=GCxDWJvvvDJbQWTyeWGxOAsDS8NYysAQVhZIltliq8JePnG0NPbgtJSJfK1QGMZ4Cm PmWrvjFgbVDzp6D937b0G9P5gmwKBdtEZDaPrnGynZr9Bm45AwXpfRJZruYO7QU+TtQ2 ZYv2D9/WfasHQRjmypqWoTB6AQ1Ugr6d7hbns40aGL35GWgzgoZyQR+uA2l7Ff6xDJHo 20ikWY6vb0SzPwpsYPX6QGGeNX3D1VFiG56xaVP9KEvjGiviEb9qxsB7U04QRQbQPf1x 29X0v5sbHxfHFjoAZitrn9iOSvTotgGT1etdr9tVLyTG89OvpuB2YA947XqSGU3j3Cvz 34Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=8r/8u57r778sVmAuu9tiWJ2Orim73fUnATf95NoYvu0=; b=s3sHitHNzk8qpOVYRvYcv3J8OkEdXaQEHGyzQWcuIA3ApFapRXLK4/xcelUxVZoaWP GObxfz2yccLoNI8rzjsXJ5gBmRfOo6l1lvcAHJzEbru2/V/++zLJcoFoWzgzNp1v5KMZ zS5Hz+S+vCBPbzC/P+cjpIbeUi2NE44R9Cqw6ruaG7tAgQAoKtKLez8tEifAUi8K9QLv D01GoC6/OixWO4giH9Jp74d5Tjgliz7JTrOwcVnShedLN3kx28nbEqDnjnTGgIHr0EZ7 DuEsF7GtZN3rQu1m+5u3Q6T421UqAyp7DuTcSr82FkvYXWaTluqZwvnU1JKOrKCmRJzd xCaA== X-Gm-Message-State: AOAM533pXW1mvUDfJ8TEUlIi4ujpqyTIxIaw7KYMjH0Ro8fuvhONK2XT 0zj9SGstmTe/xVu8gTd62odPlO7k5zgcJm5P X-Google-Smtp-Source: ABdhPJxr9ieE4FQEYzFlcwRu7sQ1fz5jfqNvZjSC3aqxogDdPJ0X0pga8uy1kbwHhdhKeJpkRkLdNQ== X-Received: by 2002:a17:902:8a90:b029:d8:e34d:2700 with SMTP id p16-20020a1709028a90b02900d8e34d2700mr13552031plo.3.1605877107914; Fri, 20 Nov 2020 04:58:27 -0800 (PST) Received: from wololo.home.arpa ([2601:646:100:8cb:2c6d:f3ff:fe32:a632]) by smtp.gmail.com with ESMTPSA id y19sm3803214pfp.160.2020.11.20.04.58.26 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 04:58:27 -0800 (PST) Date: Fri, 20 Nov 2020 04:58:24 -0800 From: Nick Owens To: 9front@9front.org Message-ID: <20201120125824.typpmodrlnro2wnc@wololo.home.arpa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: ISO-certified callback-based XMPP over ActivityPub high-performance extension Subject: [9front] bug: nusb fails to set report protocol with a stall error Reply-To: 9front@9front.org Precedence: bulk X-Pobox-Client-Address: 107.191.116.128 X-Pobox-Client-Name: ewsd.inri.net X-Pobox-Client-HELO: ewsd.inri.net X-Pobox-Original-Sender: SRS0=WjcE=E2=ewsd.inri.net=9front-bounces@bounce2.pobox.com X-ICG-Account-ID: 09620299 on my desktop with usb3, i see 'setproto: Stall Error' with certain devices. when using nusb/kb with my tex shinobi, i see a stall error, but only for the builtin trackpoint. when using nusb/joy i see a stall error with my ps4 controller. with a short test, i just removed the command to set the interface protocol, and now both devices work. after looking at the HID 1.11 spec, it seems like if a HID interface descriptor has an interface subclass of 0, support for set protocol is optional. here is a patch which avoids setproto for devices which might not support it, and it works for both my tex shinobi and ps4 controller. thoughts? diff --git a/sys/src/cmd/nusb/joy/joy.c b/sys/src/cmd/nusb/joy/joy.c --- a/sys/src/cmd/nusb/joy/joy.c +++ b/sys/src/cmd/nusb/joy/joy.c @@ -222,6 +222,12 @@ setproto(KDev *f, int eid) proto = Reportproto; }else kbfatal(f, "no report"); + + // if a HID's subclass code is 0, it may not support setproto, + // and is always initialized in report mode. + if(((iface->csp>>8)&0xFF) == 0) + return 0; + return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0); } diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c --- a/sys/src/cmd/nusb/kb/kb.c +++ b/sys/src/cmd/nusb/kb/kb.c @@ -368,6 +368,12 @@ setproto(Hiddev *f, int eid) } proto = Bootproto; } + + // if a HID's subclass code is 0, it may not support setproto, + // and is always initialized in report mode. + if(((iface->csp>>8)&0xFF) == 0) + return 0; + return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, iface->id, nil, 0); } --upas-lefnhhovifxswivmwjbilzxumg--