* failing to force-claim USB interface @ 2004-01-19 15:46 ` Martin F Krafft 2004-01-19 17:58 ` [solved] " martin f krafft 0 siblings, 1 reply; 2+ messages in thread From: Martin F Krafft @ 2004-01-19 15:46 UTC (permalink / raw) To: linux kernel mailing list [-- Attachment #1: Type: text/plain, Size: 1095 bytes --] I am trying to make use of the usbfs USBDEVFS_DISCONNECT ioctl, and I am failing. Here is the code: 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 However, the ioctl always fails. I am not sure whether I am using the right values for the file descriptor passed to ioctl(), or what the interface number (first parameter of usbdevfs_ioctl) is. Maybe someone could offer me some advice or tell me to RTFM (but please specify TM to FR). Thanks, -- Martin F. Krafft Artificial Intelligence Laboratory Ph.D. Student Department of Information Technology Email: krafft@ailab.ch University of Zurich Tel: +41.(0)1.63-54323 Andreasstrasse 15, Office 2.20 http://ailab.ch/people/krafft CH-8050 Zurich, Switzerland Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver! click the start menu and select 'shut down.' [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
* [solved] failing to force-claim USB interface 2004-01-19 15:46 ` failing to force-claim USB interface Martin F Krafft @ 2004-01-19 17:58 ` martin f krafft 0 siblings, 0 replies; 2+ messages in thread From: martin f krafft @ 2004-01-19 17:58 UTC (permalink / raw) To: linux kernel mailing list, linux-usb-users [-- Attachment #1: Type: text/plain, Size: 1457 bytes --] 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 [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-19 17:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20040119164627.GA29146@piper.madduck.net>
2004-01-19 15:46 ` failing to force-claim USB interface Martin F Krafft
2004-01-19 17:58 ` [solved] " martin f krafft
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®