linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Greg KH" <gregkh@linuxfoundation.org>
Cc: "Alice Ryhl" <aliceryhl@google.com>, <rafael@kernel.org>,
	<ojeda@kernel.org>, <alex.gaynor@gmail.com>,
	<boqun.feng@gmail.com>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <tmgross@umich.edu>,
	<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] device: rust: expand documentation for Device
Date: Mon, 21 Jul 2025 15:41:34 +0200	[thread overview]
Message-ID: <DBHRYM3JB4NK.1QLZ4RA7NVI25@kernel.org> (raw)
In-Reply-To: <2025072110-buddhism-accompany-0682@gregkh>

On Mon Jul 21, 2025 at 3:17 PM CEST, Greg KH wrote:
> On Mon, Jul 21, 2025 at 02:13:14PM +0200, Danilo Krummrich wrote:
>> On Mon Jul 21, 2025 at 2:07 PM CEST, Alice Ryhl wrote:
>> > The connection is that to request an irq you must have a &Device<Bound>,
>> > so if you can only obtain a &Device<Bound> to a bus device, then that
>> > means that you can never request an irq for a class device.
>> 
>> As mentioned in my other reply, a class device never owns resources of a "real"
>> device such as an IRQ.
>> 
>> A USB device, which represents a real device on a bus, is a bus device, in your
>> example the class device is the input device.
>>
>
> Just to confuse things a bit more (sorry), there are also "USB class
> devices" that represent USB devices that use the "generic" USB interface
> to userspace api.  You can find these by searching for
> usb_register_dev().

In this case the struct usb_interface represents a bus device, that can become
associated with e.g. a class device of the usbmisc class. :)

So, yeah, there are multiple USB devices, some of them are bus devices, some of
them are class devices.

I'm not sure about the exact topology, but AFAIK USB has different bus device
types representing the hierarchy, i.e. a device structure for the entire "real"
USB device and another one for its interfaces.

> Note, this is different from the drivers/usb/class/ drivers, which
> represent various "USB class protocol" that the USB.org group defines,
> and those talk to userspace through the various common class apis
> depending on the specific device type (input, network, etc.) and are USB
> bus drivers.
>
> Naming is hard, wait until you learn about "usb gadget" a word we had to
> invent to describe the thing :)
>
> thanks,
>
> greg k-h


  reply	other threads:[~2025-07-21 13:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 22:45 [PATCH 0/3] Documentation for Device / Driver infrastructure Danilo Krummrich
2025-07-17 22:45 ` [PATCH 1/3] device: rust: documentation for DeviceContext Danilo Krummrich
2025-07-18 12:32   ` Alexandre Courbot
2025-07-18 13:14     ` Danilo Krummrich
2025-07-21 13:48       ` Benno Lossin
2025-07-18 13:09   ` Daniel Almeida
2025-07-18 14:16     ` Danilo Krummrich
2025-07-20 15:45       ` Daniel Almeida
2025-07-17 22:45 ` [PATCH 2/3] device: rust: expand documentation for Device Danilo Krummrich
2025-07-20 15:56   ` Daniel Almeida
2025-07-21 11:26   ` Alice Ryhl
2025-07-21 11:42     ` Greg KH
2025-07-21 12:07       ` Alice Ryhl
2025-07-21 12:13         ` Danilo Krummrich
2025-07-21 13:17           ` Greg KH
2025-07-21 13:41             ` Danilo Krummrich [this message]
2025-07-21 12:07     ` Danilo Krummrich
2025-07-17 22:45 ` [PATCH 3/3] driver: rust: expand documentation for driver infrastructure Danilo Krummrich
2025-07-20 15:57   ` Daniel Almeida
2025-07-19  7:56 ` [PATCH 0/3] Documentation for Device / Driver infrastructure Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBHRYM3JB4NK.1QLZ4RA7NVI25@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).