>> = Adam Richter
>  = Randy Dunlap

>>         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.

[...]

>1.  usage():  (a) program name mismatch; (b) should be /proc/bus/usb,
>    not /proc/usb/usb [...]
>    letters s, u, b {sub}J).

        Thanks.  I have fixed it and put a new version in
ftp://ftp.yggdrasil.com/pub/dist/device_control/.

>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.

        I will not be near a computer where I can check this for the
next few hours, but I sure hope that users without write access (i.e.,
non-root users) are not allowed by the kernel to send arbitrary USB
control messages to arbitrary USB devices!

>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.)

        It might be that you cannot do this once the usb printer
modules has "claimed" the interface.

>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.

        I don't understand why the USB printer driver does not interface
through the standard Linux parport driver, which I believe already provides
some mechanism through /proc for this, and I believe it included some provision
for things like daisy chaining multiple parallel devices on the same cable (such
as a ZIP drive and a printer).  However, if we really do need to have a
separate device for USB printers, then an ioctl would be a fine approach,
although I wish we could be consistent with regular parallel port access.

>    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.

        The vendor ID and product ID are associated with the printer dongle
and will not change when you plug the dongle into different parallel printers
or when the dongle is not plugged into anything.  So, of course, you should
not be able to tell what printer is connected by looking at the vendor
and product ID's of the dongle.

>    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.

        Yes, I agree.

>    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.

        That is fine, although I wish:
                (a) that the usb printers just used the standard parport
                    interface, and
                (b) that the module would be named something with "usb" in
                    it, like parport_usb.

        Thanks for taking the time to examine my program.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[EMAIL PROTECTED]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to