From: Greg KH <greg@kroah.com>
To: mgross <640e9920@gmail.com>
Cc: Paulo Marques <pmarques@grupopie.com>,
Xiaofan Chen <xiaofanc@gmail.com>,
Alan Stern <stern@rowland.harvard.edu>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [RFC] libusb / in-kernel usb driver criteria
Date: Fri, 11 Jan 2008 09:10:06 -0800 [thread overview]
Message-ID: <20080111171006.GA6718@kroah.com> (raw)
In-Reply-To: <20080103230855.GA5892@mgross-t43>
On Thu, Jan 03, 2008 at 03:08:55PM -0800, mgross wrote:
> On Wed, Jan 02, 2008 at 07:59:15PM +0000, Paulo Marques wrote:
> > Xiaofan Chen wrote:
> >> On Dec 30, 2007 11:53 AM, mgross <640e9920@gmail.com> wrote:
> >>> [...]
> >>> What is the linux-usb policies on new drivers that could be
> >>> implemented in user space? When does a kernel driver make sense over
> >>> a libusb one?
Good question.
> >> That would be interesting to know.
> >
> > I myself have been faced with this question before, and I think we should
> > try to clarify this by adding a document with some guidelines to
> > Documentation/usb.
> >
> > So, to get the ball rolling, here are some factors that IMHO help decide in
> > which side to implement a driver:
> >
> > - if the driver ties a hardware device to an existing in-kernel interface
> > (network, block, serial, bluetooth, video4linux, etc.), it should probably
> > be implemented in-kernel.
>
> Agreed, I think this is clear.
Yes, this the primary decision point, everything after this depends on
lots of variables :)
> > - on the other hand, if the driver doesn't use an existing kernel
> > interface and creates a new user-visible interface that is going to be used
> > by a single userspace application, it should probably be done in userspace.
> >
>
> To me this is still grey, and comes down to opinions of style. I
> happen to like the way code looks when things are split up into
> drivers (that know a lot about the hardware and protects it from data
> that will turn it into a brick) and application code that talks to the
> interface defined by the driver.
>
> The libusb based applications I've seen tend to be quite convoluted
> and do a poor job of separating the USB protocol from the application
> protocol for talking to the device.
>
> I don't think there is a clear way to define when to do a kernel
> driver vrs just use a libusb thing, other than if no one does a kernel
> driver for a device then users are stuck with the libusb applications.
>
> If someone steps up and does one and is willing to support it, then to
> me its like, "whatever" add the driver.
Agreed. It all depends on the situation, we have kernel drivers for
devices that can be done in userspace, but not as cleanly or nicely, and
so, they stay as kernel drivers.
In the end, it comes down to individual cases, so let's handle them at
that level, it's easier that way.
thanks,
greg k-h
next prev parent reply other threads:[~2008-01-11 17:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-29 19:34 [RFC] USB driver for talking to the Microchip PIC18 boot loader mgross
2007-12-29 22:15 ` Alan Stern
2007-12-30 2:40 ` Xiaofan Chen
2007-12-30 4:29 ` mgross
2007-12-30 4:46 ` Xiaofan Chen
2007-12-31 1:15 ` Xiaofan Chen
2007-12-30 3:53 ` mgross
2007-12-30 4:52 ` Xiaofan Chen
2008-01-02 19:59 ` [RFC] libusb / in-kernel usb driver criteria (was: USB driver for talking to the Microchip PIC18 boot loader) Paulo Marques
2008-01-03 23:08 ` mgross
2008-01-11 17:10 ` Greg KH [this message]
2008-01-11 21:38 ` [RFC] libusb / in-kernel usb driver criteria David Brownell
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=20080111171006.GA6718@kroah.com \
--to=greg@kroah.com \
--cc=640e9920@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pmarques@grupopie.com \
--cc=stern@rowland.harvard.edu \
--cc=xiaofanc@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).