From: Johannes Erdfelt <johannes@erdfelt.com>
To: Oliver Neukum <oliver@neukum.org>,
Linux-kernel <linux-kernel@vger.kernel.org>,
linux-usb-users@lists.sourceforge.net
Subject: Re: USB API, ioctl's and libusb
Date: Wed, 26 Jan 2005 13:24:11 -0800 [thread overview]
Message-ID: <20050126212411.GB21204@sventech.com> (raw)
In-Reply-To: <20050126163811.GA259@DervishD>
On Wed, Jan 26, 2005, DervishD <lkml@dervishd.net> wrote:
> * Oliver Neukum <oliver@neukum.org> dixit:
> > Am Mittwoch, 26. Januar 2005 13:20 schrieb DervishD:
> > > ? ? My question is: which interface should be used by user space
> > > applications, <linux/usb.h> or ioctl's? Is the ioctl interface
> > > deprecated in any way? In the "Programming guide for Linux USB Device
> > > Drivers", located in http://usb.in.tum.de/usbdoc/, I can't find ioctl
> > > interface references :?
> > You are supposed to use libusb.
>
> That's irrelevant, the program I was trying to fix uses libusb.
> My question is about the preferred kernel interface, 'cause I don't
> know if it's the ioctl one or the URB one (well, I'm calling 'URB'
> interface the API that is implemented using URB's inside the kernel).
ioctl() calls are for userspace only.
It just so happens there is an ioctl() call that provides an URB like
interface and an ioctl() call that provides a synchronous call to do
a control message.
> 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.
I think you're looking at this incorrectly. You use the kernel API for
kernel modules. You can use either the ioctl() API or libusb for
userspace applications.
JE
next prev parent reply other threads:[~2005-01-27 1:14 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 [this message]
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
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=20050126212411.GB21204@sventech.com \
--to=johannes@erdfelt.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-users@lists.sourceforge.net \
--cc=oliver@neukum.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