"Adam J. Richter" wrote:
>
> Argh! I forgot to include the URL in my announcement of
> my little usb-printer-id program. You can download it from
> ftp://ftp.yggdrasil.com/pub/dist/device_control/usb-printer-id-1.1.tar.gz.
Adam,
Questions and observations:
1. usage(): (a) program name mismatch; (b) should be /proc/bus/usb,
not /proc/usb/usb (I know all about the possible combos of the 3
letters s, u, b {sub}J).
2. Why open with O_RDWR? Is that a requirement of usbdevfs?
Since the permissions are rw-r--r-- (root.root), opening as
read-only would let non-root users use this program.
3. As root, I keep getting "ioctl: Device or resource busy".
Is this likely to be just a problem with using the incorrect
values for config, interface, etc.? I tried several combos
of them. (I tried several combos because I've seen some
irregularities in which ones a certain printer actually
replies to.)
4. I've spent some time this week adding DEVICE_ID string support
to the USB printer driver (printer.c). I was about to post the
patch this morning (and I still will) and then I saw your little
program and thought that I would check it out first.
It seems to me that it's a cute program for demonstrating usage
of usbdevfs and for getting to some data that is useful to
printer apps/spoolers/filters that they cannot otherwise get
currently. This can be useful to them because it so happens that
some vendor's printers use the same vendor:product ID codes for
different models of printers, and they say to read the DEVICE_ID
string to tell them apart. This is somewhat "approved" by the USB
printer spec IMO.
So I've added a simple ioctl to printer.c so that a printing program
can
determine what printer it is talking to.
Until shown otherwise, I'm going to claim that this is a good
solution
for printer apps/spoolers/filters because they will have the file
(like /dev/usb/lp0) open but they won't know or care about
/proc/bus/usb/001/003
or --interface, --config, etc.
I considered adding the DEVICE_ID string to /proc/bus/usb/devices,
but
I don't think this is the right place for it. If I were to add it
to /proc,
it would be in a more printer-specific location.
~Randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]