All of lore.kernel.org
 help / color / mirror / Atom feed
From: DervishD <lkml@dervishd.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>,
	Linux-kernel <linux-kernel@vger.kernel.org>,
	linux-usb-users@lists.sourceforge.net
Subject: Re: [Linux-usb-users] Re: USB API, ioctl's and libusb
Date: Thu, 27 Jan 2005 00:57:37 +0100	[thread overview]
Message-ID: <20050126235737.GA305@DervishD> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0501261711150.639-100000@ida.rowland.org>

    Hi Alan :)
 * Alan Stern <stern@rowland.harvard.edu> dixit:
> >     BTW, and judging from the program I've read, there are lots of
> > operations that must be done using 'usb_control_msg', and libusb
> > implements that function with exactly the same interface as the
> > kernel. The only difference is that libusb uses ioctl and the kernel
> > implements the function using URB's. IMHO libusb doesn't provide a
> > cleaner API, the only advantage of libusb is portability. Anyway,
> > I've not used it enough to judge, I'm more concerned about kernel USB
> > interface, not libusb one.
> You don't seem to understand the difference between a kernel API and a
> user API.  Only code that is part of the kernel can use a kernel API, so
> only kernel drivers can use the "URB" interface.  By contrast, a user API
> can be used by regular programs, not part of the kernel.  libusb provides
> a user API.

    I thought that <linux/usb.h> provided a user API, not a kernel
one. In fact I thought that the functions provided throught that
header were syscalls. They are not, I've checked ;)

> So there's really no choice.  Unless you're writing a kernel module, your 
> program can't use URBs.  You can use libusb, or if you don't care about 
> portability you can use ioctl calls directly.  But you can't use URBs.

    OK, that's right. I really thought that there were syscalls
providing USB API for user space programs. That sounded less weird
when I first thought of it ;)) Thanks for the help :)))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...

      reply	other threads:[~2005-01-27  0:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 12:20 USB API, ioctl's and libusb DervishD
2005-01-26 13:40 ` Oliver Neukum
2005-01-26 16:38   ` DervishD
2005-01-26 21:24     ` Johannes Erdfelt
2005-01-27 11:02       ` DervishD
2005-01-27 22:08         ` Johannes Erdfelt
2005-01-28 10:22           ` DervishD
2005-01-26 22:15     ` [Linux-usb-users] " Alan Stern
2005-01-26 23:57       ` DervishD [this message]

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=20050126235737.GA305@DervishD \
    --to=lkml@dervishd.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-users@lists.sourceforge.net \
    --cc=oliver@neukum.org \
    --cc=stern@rowland.harvard.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 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.