From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22596C433EF for ; Wed, 18 May 2022 22:04:49 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nrRmL-0000RK-3R; Wed, 18 May 2022 18:04:25 -0400 Received: from mail-4318.protonmail.ch ([185.70.43.18]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nrRmI-0000R8-0R for kernelnewbies@kernelnewbies.org; Wed, 18 May 2022 18:04:22 -0400 Date: Wed, 18 May 2022 22:04:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1652911458; x=1653170658; bh=6bBjcGWTse4KfEeDBZXup/gIPvvHGKOzawJ2r0GEFfk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=QZrGc2K/8avvkpgJk1USehFMvvT8l3GYuJFh0yiLQwRB4VQssZIyDdEMwUFMq5F1Q UbmzKaAtdkG6ctx73quuBpf2sYOYl7NVol395J0Kf8jBbvPrXKbV5fuQwCUyWkKntL GxTn61jruJU6c/VzLZlpnJxfvvwZpe28jj55a++5kE3VS3AecEwvUnxFOUK/sBdZ5S WCHklT7s5wH8vZcIKSbNlu4/fKQxbxvwsIEErUUgLb6r2mwTQjij0u2Wi+Bi3kw82l OrXmWV08zc9QpNjVbUjP9mfZO5ltE7eVvd7jrIGbio/rlFEbgq82ouPjWONUtWXoM4 z/6mc6q6Y/sNQ== To: Greg KH From: Matt Silva Subject: Re: Supporting a USB HID device interface that is missing a interrupt input endpoint Message-ID: In-Reply-To: References: <1sT3lu7QxRdv6jrZycSEE8VsfPtAXiJNL5BBDBp-cMiTG3DbEau-NDI_mo8leikQo5u6KBwPS-mb_6sz0aja8idAVM5hMwg2oQ6dRzjJrXo=@protonmail.com> Feedback-ID: 48178043:user:proton MIME-Version: 1.0 Cc: "kernelnewbies@kernelnewbies.org" X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Matt Silva Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi, Greg. Thanks for the response, I really appreciate it! Awesome to get a reply from the man himself. Probably wasn't the best from me to refer to the Windows software as a driver. As far as I can tell it is just a userspace application using the Windows interface to communicate, as you described below. >From my understanding, the device intends to operate as a HID device (unless your comment below about all devices claiming to be HID when they're not on Windows applies here), it even provides a HID descriptor with usages to Windows. It's also my understanding that for certain devices with "quirks" that don't operate normally, the Linux kernel has quirks that allow these edge case devices to operate as intended. So while your feedback about using libusb for OpenRGB in userspace definitely doable, I was curious if this device would benifit from having support for its quirk added to the kernel so that it can be exposed in userspace as it intends, rather than just solving my specific problem for OpenRGB. As far as I can tell, the interface never communicated to directly through its single OUT endpoint. The communication is through the control endpoint via a SET REPORT request. I did some reading and you are correct, HID class interfaces require a interrupt in endpoint. But like I said, the fact that it only communicates via the control endpoint made me think that maybe this requirement may not be necessary for the interface to function as intended. Please let me know if I'm off the mark at all on this (I feel there is a solid chance I am haha). I really appreciate the response. Thanks. ------- Original Message ------- On Tuesday, May 17th, 2022 at 2:18 AM, Greg KH wrote: > On Mon, May 16, 2022 at 11:40:09PM +0000, Matt Silva wrote: > > > Hi, first time emailing here, so if there are any issues with my question, let me know and I'll fix it. > > > > Basically, I'm working with a USB HID microphone that also supports RGB features. I'm working to reverse engineer the RGB features provided by a proprietary Windows driver and add support to OpenRGB. > > > If this is a custom windows kernel driver, perhaps you don't need to > talk HID to the device at all? > > Or is this just a device that is using the userspace Windows HID > interface to talk to the device directly without any kernel code needed > (that used to be the only way userspace programs could talk to USB > devices on Windows for vendor-specific devices, so they all claim to be > HID when they really are not.) > > > The issue is that the interface that handles the RGB packets only has an OUT interrupt endpoint (rather than an IN interrupt) and as such doesn't get picked up by the usbhid driver (and therefore can't be picked up by the HIDAPI library that OpenRGB uses). However, on Windows this interface is detected as a HID device. I've narrowed down where this happens to "drivers/hid/usbhid/hid-core.c:1350", and making some testing changes there to check when the device idVendor, idProd, and interface number match and then only check for endpoint being interrupt rather than input interrupt, I can get the kernel to properly associate the interface with the usbhid driver. > > > A USB HID device has to have an interrupt IN endpoint to be HID > compliant from what I remember in the specification, so the kernel is > correct here. But you should double check this with the specification > to be sure (they are free to download from usb.org). > > > My main question is regarding how this change should be implemented. > > > Why not just talk directly to the device using libusb from userspace? > I don't know how openrgb works, but odds are there are other devices > that do not register as HID devices that it supports? > > Hope this helps, > > greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies