From: Hans de G. <hde...@re...> - 2013-06-30 19:36:16
|
Hi Alan et al, On 06/28/2013 05:15 PM, Alan Stern wrote: > On Fri, 28 Jun 2013, Kumar, Sanjay wrote: > >> Hello Hans, >> >> After all the analysis from our side we believe that, it will be good if fix is provided in kernel (always allow the get_device_id printer request). >> >> Below are the calls for which we need this fix in the kernel. >> >> 1. Used for getting device ID >> rlen = libusb_control_transfer(hd, >> LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE, /* bmRequestType */ >> LIBUSB_REQUEST_GET_STATUS, /* bRequest */ >> config, /* wValue */ >> interface, /* wIndex */ >> buffer, maxSize, LIBUSB_CONTROL_REQ_TIMEOUT); >> >> 2. Used for getting device status for some printers. >> len = libusb_control_transfer(hd, >> LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE, /* bmRequestType */ >> LIBUSB_REQUEST_CLEAR_FEATURE, /* bRequest */ >> 0, /* wValue */ >> interface, /* wIndex */ >> &byte, 1, LIBUSB_CONTROL_REQ_TIMEOUT); >> >> And regarding the older kernels HPLIP users will see issues only when libusb version is > 1.0.9. I think that is fine for us as we can provide a hot fix to users falling in this category. But this fix will ensure that all future Distros have this fix present in the kernel . Please let us know your thoughts on this. Also please provide the kernel patch whenever available, so that we can test it here. Thanks again for all the help. > > The kernel does not allow more than one program or driver to use an > interface at any time. This means that while the HPLIP program uses > the printer interface, other programs cannot use it. I was hoping that we could make life easier for the hplip people (and possible other printer related userspac), by simply always allowing REQUEST_GET_STATUS on printer-class interfaces. We already have special handling for this request in check_ctrlrecip, changing this to always allow is trivial, and it is a read-only request. I was not aware they were going to need LIBUSB_REQUEST_CLEAR_FEATURE too. Sanjay, if you need REQUEST_CLEAR_FEATURE to work too, you will need to do what Alan says and have some sort of daemon talking to / owning the interface, and have all apps which need access to the interface talk to the daemon. Regards, Hans |