lkml.org 
[lkml]   [2004]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[solved] failing to force-claim USB interface
also sprach Martin F Krafft <krafft@ailab.ch> [2004.01.19.1646 +0100]:
> struct usb_device *dev;
> [...]
> sprintf(path, "/proc/bus/usb/%s/%s", dev->bus->dirname, dev->filename);
> int fd = open(path);
> struct usbdevfs_ioctl command = { 0, USBDEVFS_DISCONNECT, 0 };
> ioctl (fd, USBDEVFS_IOCTL, &command) < 0

I was using the wrong fd. The following works:

struct usb_device *dev;
[...]
struct usb_device_handle udev = usb_open(dev);
struct usbdevfs_ioctl command = { 0, USBDEVFS_DISCONNECT, 0 };
ioctl(udev->fd, USBDEVFS_IOCTL, &command)

Now the only thing left to figure out is how the libusb library
expects us to do this, because struct usb_device_handle; is not
implemented in the exported interface.

I guess the solution is to implement the above functionality in
libusb itself.

--
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck

invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!

there are 3 types of guys -- the ones who hate nerds (all nerds, that
is; girls aren't let off the hook); the ones who are scared off by
girls who are slightly more intelligent than average; and the guys who
are also somewhat more intelligent than average, but are so shy that
they can't put 2 words together when they're within 20 feet of a girl.
-- vikki roemer on debian-curiosa
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.031 / U:1.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site