failing to force-claim USB interface

From: Martin F Krafft
Date: Mon Jan 19 2004 - 10:47:38 EST


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@xxxxxxxx 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: signature.asc
Description: Digital signature