From: Greg KH <greg@kroah.com>
To: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Where to find the information how to write a state of the art USB driver?
Date: Thu, 13 Jan 2022 16:33:50 +0100 [thread overview]
Message-ID: <YeBGXkjhM4v1K0YE@kroah.com> (raw)
In-Reply-To: <fd95f5b6-902e-417f-c896-f34f88b13798@gmail.com>
On Thu, Jan 13, 2022 at 07:39:38AM +0100, Philipp Hortmann wrote:
> On 1/12/22 10:54 AM, Greg KH wrote:
> > That driver tried to be an example for an unknown device, doing multiple
> > different things that no single driver/device would probably ever need.
> > Also it can almost always just be replaced with a simple userspace
> > program using libusb, as I bet your driver could be replaced with as
> > well, right?
> Yes it can be replaced by a userspace program but even this is not required.
It is an issue if you are trying to write a new driver. We do not take
new drivers into the kernel tree if they can be in the kernel instead.
> For the USB LCD a userspace program is available from vendor.
Great!
> For the USB to serial Adapter the driver exists in the kernel ch341.c.
> It appears as a ttyUSB0 device.
For devices that need to show up to userspace as a common device type
(like a serial port), we need to have a kernel driver, so this is to be
expected.
> I think what happens to very custom drivers that could be userspace programs
> can be seen in the file /drivers/usb/misc/usblcd.c
> - It is written in 2005 and is only supporting one device from one vendor.
> - I cannot find/buy a suitable device.
> - I have tried two times to contact the author of the driver but:
> The response from the remote server was:
> 550 5.1.1 <g.toth@e-biz.lu>: Recipient address rejected: User unknown
> - The idVendor = 0x10D2 does also not help because RayComposer - R. Adams
> does not response and does not seam to offer such products.
What is the problem with this driver? If it is not hurting anyone, and
still builds, it's not causing any problems.
> To me it is unused code but how to verify? When it is unused what does the
> kernel do with it? Putting it to the staging area?
Why do you want to delete it?
We can remove old drivers that no one uses, we do that all the time.
But usually that is because the maintance burden on them get too high
and we determine that no one actually uses the thing. This driver
doesn't seem to be causing any problems that I can see, so why delete
it?
That being said, if you do think it should be removed, great, let's do
so and if someone later shows up that uses it, we can trivially add it
back. Just submit a patch to do so.
But this doesn't have much to do with your original question, so I'm
confused as to what usblcd.c has to do with writing a new USB driver?
thanks,
greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2022-01-13 15:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 21:31 Where to find the information how to write a state of the art USB driver? Philipp Hortmann
2022-01-11 8:51 ` Greg KH
2022-01-11 20:09 ` Philipp Hortmann
2022-01-12 9:54 ` Greg KH
2022-01-13 6:39 ` Philipp Hortmann
2022-01-13 15:33 ` Greg KH [this message]
2022-01-13 15:37 ` Greg KH
2022-01-13 18:54 ` Philipp Hortmann
2022-01-13 19:01 ` Greg KH
2022-01-13 19:07 ` Greg KH
2022-01-16 13:45 ` Pavel Skripkin
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=YeBGXkjhM4v1K0YE@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=philipp.g.hortmann@gmail.com \
/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).