Bug 488949

Summary: Use libusb in the usb backend
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jpopelka, twaugh
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-04 12:40:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tim Waugh 2009-03-06 13:00:46 UTC
In CUPS 1.4 the usb backend is capable of using libusb.  We should do that, and make sure that permissions on the USB device nodes are set correctly.  We'll also need to rebuild hal-cups-utils to match.

Comment 1 Bug Zapper 2009-06-09 11:56:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Tim Waugh 2009-07-23 13:10:19 UTC
Care required: we may lose media-empty-error (paper-out) notifications by doing this.

Comment 3 Tim Waugh 2010-10-25 10:45:03 UTC
The relevant code from the kernel driver:

#define LP_PERRORP      0x08  /* unchanged input, active low */
#define LP_POUTPA       0x20  /* unchanged input, active high */
#define LP_PSELECD      0x10  /* unchanged input, active high */

#define USBLP_REQ_GET_STATUS                    0x01
#define usblp_read_status(usblp, status)\
        usblp_ctrl_msg(usblp, USBLP_REQ_GET_STATUS, USB_TYPE_CLASS, USB_DIR_IN,
USB_RECIP_INTERFACE, 0, status, 1)

static const char *usblp_messages[] = { "ok", "out of paper", "off-line", "on
fire" };

... usblp_read_status(usblp, usblp->statusbuf) ...
... status = *usblp->statusbuf; ...

        if (~status & LP_PERRORP)
                newerr = 3;
        if (status & LP_POUTPA)
                newerr = 1;
        if (~status & LP_PSELECD)
                newerr = 2;
...
        if (newerr != err) {
                printk(KERN_INFO "usblp%d: %s\n",
                   usblp->minor, usblp_messages[newerr]);

Comment 4 Jiri Popelka 2013-03-04 12:40:07 UTC
CUPS usb backend has been using libusb1 since 1.5.3 (http://www.cups.org/articles.php?L673)