> Would it be possible (or reasonable) to add an ioctl to usbdevfs which
> can ask for this information via the /proc/bus/usb/###/### interface? Or
> should the printer.o module execute a user-space helper app to do this
> configuration itself?
IMHO, either of those would be reasonable 2.4 solutions. I'd likely
want to see the ioctl, since scenarios have wanted this feature before.
But that wouldn't work with non-USB printers; "printer hotplug" should
IMHO happen at some point, too.
That is, perhaps adding something like this to <linux/usbdevice_fs.h>
struct usbdevfs_driver_devinfo {
int type; /* S_IFCHR or S_IFBLK from <sys/stat.h> */
dev_t dev; /* major/minor */
}
#define USBDEVFS_DRIVER_DEVINFO \
_IOR('U',22, struct usbdevfs_driver_devinfo)
and the driver (printer.c) would get updated
static int printer_ioctl (
struct usb_device *dev,
unsigned int ioctl_code,
void *user_data
) {
switch (ioctl_code) {
case USBDEVFS_DRIVER_DEVINFO:
... user_data is a struct usbdevfs_driver_devinfo
... fill it out and return
default:
return -ENOSYS;
}
}
static struct usb_driver
...
ioctl: printer_ioctl;
}
Then userspace would call it using the USBDEVFS_IOCTL mechanism.
Printer would be the first to start reporting useful info with it.
- Dave
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel