• Home
  • Raw
  • Download

Lines Matching +full:data +full:- +full:uri +full:- +full:to +full:- +full:buffer

4  * Copyright 2007-2020 by Apple Inc.
15 #include <cups/cups-private.h>
16 #include <cups/ppd-private.h>
28 * the printer after we've finished sending all the data
41 typedef struct usb_printer_s /**** USB Printer Data ****/
50 protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
52 reset_after_job;/* Set to 1 by print_device() */
54 struct libusb_device_handle *handle; /* Open handle to device */
73 int print_fd; /* File descriptor to print */
89 * The quirks table used to be compiled into the backend but is now loaded from
93 #define USB_QUIRK_BLACKLIST 0x0001 /* Does not conform to the spec */
94 #define USB_QUIRK_NO_REATTACH 0x0002 /* After printing we cannot re-attach
97 for clean-up */
100 #define USB_QUIRK_VENDOR_CLASS 0x0020 /* Descriptor uses vendor-specific
131 static usb_printer_t *find_device(usb_cb_t cb, const void *data);
133 static int get_device_id(usb_printer_t *printer, char *buffer,
136 const char *device_id, const void *data);
140 char *uri, size_t uri_size);
143 const char *device_id, const void *data);
151 * 'list_devices()' - List the available printers.
165 * 'print_device()' - Print a file to a USB device.
168 int /* O - Exit status */
169 print_device(const char *uri, /* I - Device URI */ in print_device() argument
170 const char *hostname, /* I - Hostname/manufacturer */ in print_device()
171 const char *resource, /* I - Resource/modelname */ in print_device()
172 char *options, /* I - Device options/serial number */ in print_device()
173 int print_fd, /* I - File descriptor to print */ in print_device()
174 int copies, /* I - Copies to print */ in print_device()
175 int argc, /* I - Number of command-line arguments (6 or 7) */ in print_device()
176 char *argv[]) /* I - Command-line arguments */ in print_device()
185 sidechannel_thread_id; /* Side-channel thread */ in print_device()
186 int have_sidechannel = 0, /* Was the side-channel thread started? */ in print_device()
188 struct stat sidechannel_info; /* Side-channel file descriptor info */ in print_device()
189 unsigned char print_buffer[8192], /* Print data buffer */ in print_device()
190 *print_ptr; /* Pointer into print data buffer */ in print_device()
204 * See if the side-channel descriptor is valid... in print_device()
213 * Connect to the printer... in print_device()
216 fprintf(stderr, "DEBUG: Printing on printer with URI: %s\n", uri); in print_device()
217 while ((g.printer = find_device(print_cb, uri)) == NULL) in print_device()
220 _("Waiting for printer to become available.")); in print_device()
230 g.printer->reset_after_job = (g.printer->quirks & USB_QUIRK_SOFT_RESET ? 1 : 0); in print_device()
233 * If we are printing data from a print driver on stdin, ignore SIGTERM in print_device()
234 * so that the driver can finish out any page data, e.g. to eject the in print_device()
236 * is no way to cancel a raw print job... in print_device()
269 fputs("DEBUG: Couldn't create side-channel thread.\n", stderr); in print_device()
276 * Debug mode: If option "usb-unidir" is given, always deactivate in print_device()
281 val = cupsGetOption("usb-unidir", num_opts, opts); in print_device()
285 g.printer->read_endp = -1; in print_device()
286 fprintf(stderr, "DEBUG: Forced uni-directional communication " in print_device()
287 "via \"usb-unidir\" option.\n"); in print_device()
291 * Debug mode: If option "usb-no-reattach" is given, do not re-attach in print_device()
295 val = cupsGetOption("usb-no-reattach", num_opts, opts); in print_device()
299 g.printer->usblp_attached = 0; in print_device()
300 fprintf(stderr, "DEBUG: Forced not re-attaching the usblp kernel module " in print_device()
301 "after the job via \"usb-no-reattach\" option.\n"); in print_device()
308 if (g.printer->read_endp != -1) in print_device()
329 fprintf(stderr, "DEBUG: Uni-directional device/mode, back channel " in print_device()
341 while (status == CUPS_BACKEND_OK && copies-- > 0) in print_device()
343 _cupsLangPrintFilter(stderr, "INFO", _("Sending data to printer.")); in print_device()
360 * If we have data waiting to send timeout is 100ms. in print_device()
413 _("Unable to read print data.")); in print_device()
432 * Check if we have print data ready... in print_device()
442 * Read error - bail if we don't see EAGAIN or EINTR... in print_device()
448 _("Unable to read print data.")); in print_device()
467 fprintf(stderr, "DEBUG: Read %d bytes of print data...\n", in print_device()
473 iostatus = libusb_bulk_transfer(g.printer->handle, in print_device()
474 g.printer->write_endp, in print_device()
478 * Ignore timeout errors, but retain the number of bytes written to in print_device()
479 * avoid sending duplicate data... in print_device()
496 iostatus = libusb_bulk_transfer(g.printer->handle, in print_device()
497 g.printer->write_endp, in print_device()
511 iostatus = libusb_bulk_transfer(g.printer->handle, in print_device()
512 g.printer->write_endp, in print_device()
520 * Write error - bail if we don't see an error we can retry... in print_device()
524 _("Unable to send data to printer.")); in print_device()
533 fprintf(stderr, "DEBUG: Wrote %d bytes of print data...\n", in print_device()
536 g.print_bytes -= bytes; in print_device()
552 * Signal the side channel thread to exit... in print_device()
585 * Signal the read thread to exit then wait 7 seconds for it to complete... in print_device()
596 fputs("DEBUG: Waiting for read thread to exit...\n", stderr); in print_device()
641 if (g.printer->quirks & USB_QUIRK_DELAY_CLOSE) in print_device()
658 * 'close_device()' - Close the connection to the USB printer.
661 static int /* I - 0 on success, -1 on failure */
662 close_device(usb_printer_t *printer) /* I - Printer */ in close_device()
667 /* Pointer to current configuration */ in close_device()
670 if (printer->handle) in close_device()
673 * Release interfaces before closing so that we know all data is written in close_device()
674 * to the device... in close_device()
682 libusb_get_config_descriptor(printer->device, printer->conf, &confptr); in close_device()
685 number1 = confptr->interface[printer->iface]. in close_device()
686 altsetting[printer->altset].bInterfaceNumber; in close_device()
687 libusb_release_interface(printer->handle, number1); in close_device()
689 number2 = confptr->bConfigurationValue; in close_device()
695 * to another, restore the old one in close_device()
697 if (printer->origconf > 0 && printer->origconf != number2) in close_device()
699 fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n", in close_device()
700 number2, printer->origconf); in close_device()
701 if ((errcode = libusb_set_configuration(printer->handle, in close_device()
702 printer->origconf)) < 0) in close_device()
707 libusb_get_device_descriptor (printer->device, &devdesc); in close_device()
710 "DEBUG: Failed to set configuration %d\n", in close_device()
711 printer->origconf); in close_device()
714 "DEBUG: Failed to set configuration %d for %04x:%04x\n", in close_device()
715 printer->origconf, devdesc.idVendor, devdesc.idProduct); in close_device()
721 * Re-attach "usblp" kernel module if it was attached before using this in close_device()
724 if (printer->usblp_attached == 1) in close_device()
725 if (libusb_attach_kernel_driver(printer->handle, number1) < 0) in close_device()
727 errcode = libusb_get_device_descriptor (printer->device, &devdesc); in close_device()
730 "DEBUG: Failed to re-attach \"usblp\" kernel module\n"); in close_device()
733 "DEBUG: Failed to re-attach \"usblp\" kernel module to " in close_device()
739 "DEBUG: Failed to get configuration descriptor %d\n", in close_device()
740 printer->conf); in close_device()
743 * Reset the device to clean up after the job in close_device()
746 if (printer->reset_after_job == 1) in close_device()
748 if ((errcode = libusb_reset_device(printer->handle)) < 0) in close_device()
761 libusb_close(printer->handle); in close_device()
762 printer->handle = NULL; in close_device()
770 * 'compare_quirks()' - Compare two quirks entries.
773 static int /* O - Result of comparison */
774 compare_quirks(usb_quirk_t *a, /* I - First quirk entry */ in compare_quirks()
775 usb_quirk_t *b) /* I - Second quirk entry */ in compare_quirks()
779 if ((result = b->vendor_id - a->vendor_id) == 0) in compare_quirks()
780 result = b->product_id - a->product_id; in compare_quirks()
787 * 'find_device()' - Find or enumerate USB printers.
790 static usb_printer_t * /* O - Found printer */
791 find_device(usb_cb_t cb, /* I - Callback function */ in find_device()
792 const void *data) /* I - User data for callback */ in find_device() argument
799 /* Pointer to current configuration */ in find_device()
801 /* Pointer to current interface */ in find_device()
803 /* Pointer to current alternate setting */ in find_device()
805 /* Pointer to current endpoint */ in find_device()
816 char device_id[1024],/* IEEE-1284 device ID */ in find_device()
818 /* Device URI */ in find_device()
829 …fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)… in find_device()
846 * Ignore devices with no configuration data and anything that is not in find_device()
870 for (iface = 0, ifaceptr = confptr->interface; in find_device()
871 iface < confptr->bNumInterfaces; in find_device()
880 for (altset = 0, altptr = ifaceptr->altsetting; in find_device()
881 altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type] in find_device()
890 if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER || in find_device()
891 altptr->bInterfaceSubClass != 1) && in find_device()
893 (altptr->bInterfaceProtocol != 1 && /* Unidirectional */ in find_device()
894 altptr->bInterfaceProtocol != 2) || /* Bidirectional */ in find_device()
895 altptr->bInterfaceProtocol < protocol) in find_device()
905 for (endp = 0, endpptr = altptr->endpoint; in find_device()
906 endp < altptr->bNumEndpoints; in find_device()
908 if ((endpptr->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == in find_device()
911 if (endpptr->bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK) in find_device()
923 protocol = altptr->bInterfaceProtocol; in find_device()
929 printer.read_endp = -1; in find_device()
941 if (!open_device(&printer, data != NULL)) in find_device()
948 "Device URI: %s\n", in find_device()
951 if ((*cb)(&printer, device_uri, device_id, data)) in find_device()
957 printer.read_endp = -1; in find_device()
958 fprintf(stderr, "DEBUG: Printer reports bi-di support " in find_device()
959 "but in reality works only uni-directionally\n"); in find_device()
961 if (printer.read_endp != -1) in find_device()
963 printer.read_endp = confptr->interface[printer.iface]. in find_device()
969 fprintf(stderr, "DEBUG: Uni-directional USB communication " in find_device()
971 printer.write_endp = confptr->interface[printer.iface]. in find_device()
979 "kernel module to be re-attached after job\n"); in find_device()
995 * to print to... in find_device()
1011 * 'find_quirks()' - Find the quirks for the given printer, if any.
1016 static unsigned /* O - Quirks flags */
1017 find_quirks(int vendor_id, /* I - Vendor ID */ in find_quirks()
1018 int product_id) /* I - Product ID */ in find_quirks()
1028 return (match->quirks); in find_quirks()
1033 return (match->quirks); in find_quirks()
1040 * 'get_device_id()' - Get the IEEE-1284 device ID for the printer.
1043 static int /* O - 0 on success, -1 on error */
1044 get_device_id(usb_printer_t *printer, /* I - Printer */ in get_device_id()
1045 char *buffer, /* I - String buffer */ in get_device_id() argument
1046 size_t bufsize) /* I - Number of bytes in buffer */ in get_device_id()
1051 if (libusb_control_transfer(printer->handle, in get_device_id()
1054 0, printer->conf, in get_device_id()
1055 (printer->iface << 8) | printer->altset, in get_device_id()
1056 (unsigned char *)buffer, bufsize, 5000) < 0) in get_device_id()
1058 *buffer = '\0'; in get_device_id()
1059 return (-1); in get_device_id()
1067 length = (int)((((unsigned)buffer[0] & 255) << 8) | ((unsigned)buffer[1] & 255)); in get_device_id()
1070 * Check to see if the length is larger than our buffer or less than 14 bytes in get_device_id()
1073 * If the length is out-of-range, assume that the vendor incorrectly in get_device_id()
1074 * implemented the 1284 spec and re-read the length as LSB first,.. in get_device_id()
1078 length = (int)((((unsigned)buffer[1] & 255) << 8) | ((unsigned)buffer[0] & 255)); in get_device_id()
1089 *buffer = '\0'; in get_device_id()
1090 return (-1); in get_device_id()
1093 length -= 2; in get_device_id()
1096 * Copy the device ID text to the beginning of the buffer and in get_device_id()
1097 * nul-terminate. in get_device_id()
1100 memmove(buffer, buffer + 2, (size_t)length); in get_device_id()
1101 buffer[length] = '\0'; in get_device_id()
1108 * 'list_cb()' - List USB printers for discovery.
1111 static int /* O - 0 to continue, 1 to stop */
1112 list_cb(usb_printer_t *printer, /* I - Printer */ in list_cb()
1113 const char *device_uri, /* I - Device URI */ in list_cb()
1114 const char *device_id, /* I - IEEE-1284 device ID */ in list_cb()
1115 const void *data) /* I - User data (not used) */ in list_cb() argument
1121 * Get the device URI and make/model strings... in list_cb()
1143 * 'load_quirks()' - Load all quirks files in the /usr/share/cups/usb directory.
1174 if (!S_ISREG(dent->fileinfo.st_mode)) in load_quirks()
1177 snprintf(filename, sizeof(filename), "%s/usb/%s", datadir, dent->filename); in load_quirks()
1199 perror("DEBUG: Unable to allocate memory for quirk"); in load_quirks()
1203 if (sscanf(line, "%x%x", &quirk->vendor_id, &quirk->product_id) < 1) in load_quirks()
1211 quirk->quirks |= USB_QUIRK_BLACKLIST; in load_quirks()
1213 if (strstr(line, " delay-close")) in load_quirks()
1214 quirk->quirks |= USB_QUIRK_DELAY_CLOSE; in load_quirks()
1216 if (strstr(line, " no-reattach")) in load_quirks()
1217 quirk->quirks |= USB_QUIRK_NO_REATTACH; in load_quirks()
1219 if (strstr(line, " soft-reset")) in load_quirks()
1220 quirk->quirks |= USB_QUIRK_SOFT_RESET; in load_quirks()
1223 quirk->quirks |= USB_QUIRK_UNIDIR; in load_quirks()
1225 if (strstr(line, " usb-init")) in load_quirks()
1226 quirk->quirks |= USB_QUIRK_USB_INIT; in load_quirks()
1228 if (strstr(line, " vendor-class")) in load_quirks()
1229 quirk->quirks |= USB_QUIRK_VENDOR_CLASS; in load_quirks()
1244 * 'make_device_uri()' - Create a device URI for a USB printer.
1247 static char * /* O - Device URI */
1249 usb_printer_t *printer, /* I - Printer */ in make_device_uri()
1250 const char *device_id, /* I - IEEE-1284 device ID */ in make_device_uri()
1251 char *uri, /* I - Device URI buffer */ in make_device_uri() argument
1252 size_t uri_size) /* I - Size of device URI buffer */ in make_device_uri()
1256 char options[1024]; /* Device URI options */ in make_device_uri()
1278 ((libusb_get_device_descriptor(printer->device, &devdesc) >= 0) && in make_device_uri()
1286 libusb_get_string_descriptor_ascii(printer->handle, in make_device_uri()
1289 sizeof(tempsern) - 1); in make_device_uri()
1304 * To maintain compatibility with the original character device backend on in make_device_uri()
1310 if (!_cups_strcasecmp(mfg, "Hewlett-Packard")) in make_device_uri()
1359 * Generate the device URI from the manufacturer, model, serial number, in make_device_uri()
1365 if (printer->iface > 0) in make_device_uri()
1367 printer->iface); in make_device_uri()
1371 else if (printer->iface > 0) in make_device_uri()
1372 snprintf(options, sizeof(options), "?interface=%d", printer->iface); in make_device_uri()
1376 httpAssembleURIf(HTTP_URI_CODING_ALL, uri, uri_size, "usb", NULL, mfg, 0, in make_device_uri()
1381 return (uri); in make_device_uri()
1386 * 'open_device()' - Open a connection to the USB printer.
1389 static int /* O - 0 on success, -1 on error */
1390 open_device(usb_printer_t *printer, /* I - Printer */ in open_device()
1391 int verbose) /* I - Update connecting-to-device state? */ in open_device()
1396 /* Pointer to current configuration */ in open_device()
1397 int number1 = -1, /* Configuration/interface/altset */ in open_device()
1398 number2 = -1, /* numbers */ in open_device()
1407 if (printer->handle) in open_device()
1414 if ((errcode = libusb_open(printer->device, &printer->handle)) < 0) in open_device()
1416 fprintf(stderr, "DEBUG: Failed to open device, code: %d\n", in open_device()
1418 return (-1); in open_device()
1421 printer->usblp_attached = 0; in open_device()
1422 printer->reset_after_job = 0; in open_device()
1425 fputs("STATE: +connecting-to-device\n", stderr); in open_device()
1427 if ((errcode = libusb_get_device_descriptor(printer->device, &devdesc)) < 0) in open_device()
1429 fprintf(stderr, "DEBUG: Failed to get device descriptor, code: %d\n", in open_device()
1439 errcode = libusb_kernel_driver_active(printer->handle, printer->iface); in open_device()
1441 printer->usblp_attached = 0; in open_device()
1444 printer->usblp_attached = 1; in open_device()
1446 libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0) in open_device()
1448 fprintf(stderr, "DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n", in open_device()
1455 printer->usblp_attached = 0; in open_device()
1460 "DEBUG: Failed to check whether %04x:%04x has the \"usblp\" " in open_device()
1473 if (libusb_control_transfer(printer->handle, in open_device()
1480 printer->origconf = current; in open_device()
1483 libusb_get_config_descriptor (printer->device, printer->conf, &confptr)) in open_device()
1486 fprintf(stderr, "DEBUG: Failed to get config descriptor for %04x:%04x\n", in open_device()
1490 number1 = confptr->bConfigurationValue; in open_device()
1494 fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n", in open_device()
1496 if ((errcode = libusb_set_configuration(printer->handle, number1)) < 0) in open_device()
1500 * single configuration. Technically these printers don't conform to in open_device()
1505 fprintf(stderr, "DEBUG: Failed to set configuration %d for %04x:%04x\n", in open_device()
1514 number1 = confptr->interface[printer->iface]. in open_device()
1515 altsetting[printer->altset].bInterfaceNumber; in open_device()
1517 while ((errcode = libusb_claim_interface(printer->handle, number1)) < 0) in open_device()
1522 "DEBUG: Failed to claim interface %d for %04x:%04x: %s\n", in open_device()
1527 else if ((errcode = libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0) in open_device()
1530 "DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n", in open_device()
1544 if (confptr->interface[printer->iface].num_altsetting > 1) in open_device()
1546 number1 = confptr->interface[printer->iface]. in open_device()
1547 altsetting[printer->altset].bInterfaceNumber; in open_device()
1548 number2 = confptr->interface[printer->iface]. in open_device()
1549 altsetting[printer->altset].bAlternateSetting; in open_device()
1552 libusb_set_interface_alt_setting(printer->handle, number1, number2)) in open_device()
1558 "DEBUG: Failed to set alternate interface %d for %04x:%04x: " in open_device()
1570 fputs("STATE: -connecting-to-device\n", stderr); in open_device()
1581 fputs("STATE: -connecting-to-device\n", stderr); in open_device()
1583 libusb_close(printer->handle); in open_device()
1584 printer->handle = NULL; in open_device()
1586 return (-1); in open_device()
1591 * 'print_cb()' - Find a USB printer for printing.
1594 static int /* O - 0 to continue, 1 to stop (found) */
1595 print_cb(usb_printer_t *printer, /* I - Printer */ in print_cb()
1596 const char *device_uri, /* I - Device URI */ in print_cb()
1597 const char *device_id, /* I - IEEE-1284 device ID */ in print_cb()
1598 const void *data) /* I - User data (make, model, S/N) */ in print_cb() argument
1600 char requested_uri[1024], /* Requested URI */ in print_cb()
1601 *requested_ptr, /* Pointer into requested URI */ in print_cb()
1602 detected_uri[1024], /* Detected URI */ in print_cb()
1603 *detected_ptr; /* Pointer into detected URI */ in print_cb()
1610 if (!strcmp((char *)data, device_uri)) in print_cb()
1617 strlcpy(requested_uri, (char *)data, sizeof(requested_uri)); in print_cb()
1621 * libusb-discovered URIs can have an "interface" specification and this in print_cb()
1622 * never happens for usblp-discovered URIs, so remove the "interface" in print_cb()
1623 * specification from the URI which we are checking currently. This way a in print_cb()
1624 * queue for a usblp-discovered printer can now be accessed via libusb. in print_cb()
1685 * 'read_thread()' - Thread to read the backchannel data on.
1724 readstatus = libusb_bulk_transfer(g.printer->handle, in read_thread()
1725 g.printer->read_endp, in read_thread()
1730 fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n", in read_thread()
1770 * 'sidechannel_thread()' - Handle side-channel requests.
1778 char data[2048]; /* Request/response data */ in sidechannel_thread() local
1779 int datalen; /* Request/response data size */ in sidechannel_thread()
1786 datalen = sizeof(data); in sidechannel_thread()
1788 if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) in sidechannel_thread()
1819 data[0] = (g.printer->protocol >= 2 ? 1 : 0); in sidechannel_thread()
1820 cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0); in sidechannel_thread()
1824 data[0]); in sidechannel_thread()
1827 case CUPS_SC_CMD_GET_DEVICE_ID: /* Return IEEE-1284 device ID */ in sidechannel_thread()
1831 datalen = sizeof(data); in sidechannel_thread()
1832 if (get_device_id(g.printer, data, sizeof(data))) in sidechannel_thread()
1840 datalen = strlen(data); in sidechannel_thread()
1842 cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, datalen, 1.0); in sidechannel_thread()
1844 if (datalen < sizeof(data)) in sidechannel_thread()
1845 data[datalen] = '\0'; in sidechannel_thread()
1847 data[sizeof(data) - 1] = '\0'; in sidechannel_thread()
1851 datalen, data); in sidechannel_thread()
1858 data[0] = CUPS_SC_STATE_ONLINE; in sidechannel_thread()
1859 cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0); in sidechannel_thread()
1863 data[0]); in sidechannel_thread()
1871 data[0] = (g.printer->handle ? 1 : 0); in sidechannel_thread()
1872 cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0); in sidechannel_thread()
1876 data[0]); in sidechannel_thread()
1880 fprintf(stderr, "DEBUG: Unknown side-channel command (%d) received " in sidechannel_thread()
1903 * 'soft_reset()' - Send a soft reset to the device.
1911 char buffer[2048]; /* Buffer */ in soft_reset() local
1952 if (read(g.print_fd, buffer, sizeof(buffer)) <= 0) in soft_reset()
1973 * 'soft_reset_printer()' - Do the soft reset request specific to printers
1975 * This soft reset is specific to the printer device class and is much less
1979 * pipes get reset to their default states. This clears all stall conditions.
1983 static int /* O - 0 on success, < 0 on error */
1985 usb_printer_t *printer) /* I - Printer */ in soft_reset_printer()
1988 /* Pointer to current configuration */ in soft_reset_printer()
1989 int interface, /* Interface to reset */ in soft_reset_printer()
1993 if (libusb_get_config_descriptor(printer->device, printer->conf, in soft_reset_printer()
1995 interface = printer->iface; in soft_reset_printer()
1997 interface = confptr->interface[printer->iface]. in soft_reset_printer()
1998 altsetting[printer->altset].bInterfaceNumber; in soft_reset_printer()
2002 if ((errcode = libusb_control_transfer(printer->handle, in soft_reset_printer()
2007 errcode = libusb_control_transfer(printer->handle, in soft_reset_printer()