Re: New multi-use device

Pete Zaitcev <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
On Fri, 26 Oct 2007 13:39:39 -0400, "Stephens, Peter A." <[email protected]> wrote:

>  I was not able to get USBMon working (failure),

Don't waste your time on the old USBMon, it's not worth the trouble.
Fedora ships with in-kernel usbmon, which does everything you need
for debugging.

> I would like to have each mode be a different configuration (some of the
> modes are mutually exclusive anyway and won't work together on the PIC).

>     1) It looks like there are three main ways to accomplish this (USB
> kernel module driver, 
>        libusb, and gadget kernel module driver).  I gather that the
> gadget stuff is a subset
>        of the USB kernel driver type.  Should I have been using this?  I
> really wanted to learn
>        about making modules and raw USB stuff so I don't want to use the
> libusb approach.

Forget gadget, it's not applicable to you. The gadget is something
you run on a device side, for example, in a cellphone.

Everything you want to do can be done with usbfs (and perhaps libusb;
libusb uses usbfs). The in-kernel drivers are needed when you want
to present a conventional API to applications, such as kermit.

If you manage to drive all functions that you need through libusb,
use that. Doing so does not save you code or effort over usbfs, but
the result can be portable to Windows, Solars, OSX (at least in theory).

>     2) I wanted to be able to switch configurations via an IOCTL call so
> I started to add the
>        code for this into the device_ioctl routine and after browsing
> the code for 
>        "usb_set_configuration()" found out by reading the comments in
> the code that this is 
>        not really the best way to do it, but then what is the best way
> to do this? []

I suspect Alan is the only one who knows the intent behind the
current code.

-- Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.