From: Richard <richard_siegfried@systemli.org>
To: Greg KH <greg@kroah.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: ktypes vs. devices classes (struct class)
Date: Sun, 1 Oct 2023 23:22:46 +0200 [thread overview]
Message-ID: <09047692-ef9f-315b-d7e0-9b673815a010@systemli.org> (raw)
In-Reply-To: <2023100159-tapered-fragment-7f9d@gregkh>
>>
>>> Is it possible that one device belongs to several classes?
>>
>> No.
>
> Oops, well yes. Depends on what you are thinking is a "device" here.
>
> In the kernel, yes, a 'struct device' on a bus can then register itself
> with multiple subsystems that handle different classes, and then
> individual 'struct device' are created for those classes that have a
> parent of the original 'struct device' on the bus.
>
> But within a 'struct class', there can only be one "struct device" for
> that class for that specific class type (we used to call them "struct
> class_device" but that got removed a long time ago as the objects really
> all did the same thing.)
Oki, thanks for explaining
>
> It's a bit confusing, yes, sorry, but creating a unified object model of
> all devices in the system turns out to be complex due to the huge range
> of devices that an operating system needs to manage, which is probably
> why most other operating systems have never attempted to do such a
> thing.
From what I've heard Windows has tried the same with WDF but it's so
abstract and elegant it only plays with the "nice" devices so only
around 50%, for all other devices you still need the old device model.
So in the end every driver developer has to learn both models :D
>
> When Pat and I created it, we were young and naive and thought "this
> should be simple!" Famous last words...
:D
>
> thanks,
>
> greg k-h
Thank you!,
Richard
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2023-10-01 21:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-30 0:12 ktypes vs. devices classes (struct class) Richard
2023-09-30 6:30 ` Greg KH
2023-09-30 18:17 ` Richard
2023-10-01 9:50 ` Greg KH
2023-10-01 10:28 ` Greg KH
2023-10-01 21:22 ` Richard [this message]
2023-10-01 21:15 ` Richard
2023-10-02 9:00 ` 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=09047692-ef9f-315b-d7e0-9b673815a010@systemli.org \
--to=richard_siegfried@systemli.org \
--cc=greg@kroah.com \
--cc=kernelnewbies@kernelnewbies.org \
/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