Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unbreak USB printing on OpenBSD #4525

Closed
michaelrsweet opened this issue Nov 16, 2014 · 2 comments
Closed

unbreak USB printing on OpenBSD #4525

michaelrsweet opened this issue Nov 16, 2014 · 2 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0.1
CUPS.org User: ajacoutot

Hi.

On OpenBSD, the libusb_kernel_* functions return LIBUSB_ERROR_NOT_SUPPORTED because there is no implementation for it (also "usblp" is a Linux thing).

The following patch adds a check to open_device() that catches LIBUSB_ERROR_NOT_SUPPORTED and continues with a warning assuming that the kernel hasn't attached the device so that libusb is used.
This allows my USB printers to work on at least OpenBSD.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"backend_usb-libusb_c.patch":

--- backend/usb-libusb.c.orig Fri Feb 14 21:09:01 2014
+++ backend/usb-libusb.c Fri Oct 3 15:35:39 2014
@@ -1451,9 +1451,14 @@ open_device(usb_printer_t printer, / I - Printer */
else
{
printer->usblp_attached = 0;

  • fprintf(stderr, "DEBUG: Failed to check whether %04x:%04x has the "usblp" kernel module attached\n",
  •     devdesc.idVendor, devdesc.idProduct);
    
  • goto error;
  • if (errcode != LIBUSB_ERROR_NOT_SUPPORTED)
  • {
  •  fprintf(stderr,
    
  •          "DEBUG: Failed to check whether %04x:%04x has the \"usblp\" "
    
  •          "kernel module attached\n", devdesc.idVendor, devdesc.idProduct);
    
  •  goto error;
    
  • }
    }

/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant