All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Marques <pmarques@grupopie.com>
To: Xiaofan Chen <xiaofanc@gmail.com>
Cc: mgross <640e9920@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 (was: USB driver for talking to the Microchip PIC18 boot loader)
Date: Wed, 02 Jan 2008 19:59:15 +0000	[thread overview]
Message-ID: <477BED13.4060403@grupopie.com> (raw)
In-Reply-To: <a276da400712292052h5808c33apd5269e773edfb592@mail.gmail.com>

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?
> 
> 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.

  - 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.

  - if it is going to be used by several applications it could still be 
implemented as a library, but it starts moving into the gray area.

  - performance might be a reason to move to kernel space, but I don't 
think it matters for transfer rates below 10Mbytes/sec or so.

Anyway, this is just MHO, so feel free to discuss this further. I'm 
simply volunteering to sum up this thread into a patch to add a 
Documentation/usb/userspace_drivers.txt (or something like that), so 
that we can help future developers decide where to write their drivers.

-- 
Paulo Marques - www.grupopie.com

"Very funny Scotty. Now beam up my clothes."

  reply	other threads:[~2008-01-02 19:59 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       ` Paulo Marques [this message]
2008-01-03 23:08         ` [RFC] libusb / in-kernel usb driver criteria (was: USB driver for talking to the Microchip PIC18 boot loader) mgross
2008-01-11 17:10           ` [RFC] libusb / in-kernel usb driver criteria Greg KH
2008-01-11 21:38             ` 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=477BED13.4060403@grupopie.com \
    --to=pmarques@grupopie.com \
    --cc=640e9920@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.