Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 323931
Collapse All | Expand All

(-)cups-1.4.3~/backend/Makefile (-1 / +1 lines)
Lines 267-273 Link Here
267
	echo Linking $@...
267
	echo Linking $@...
268
	$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
268
	$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
269
		$(BACKLIBS) $(LIBS)
269
		$(BACKLIBS) $(LIBS)
270
usb.o:	usb.c usb-darwin.c usb-libusb.c usb-unix.c
270
usb.o:	usb.c usb-darwin.c usb-hybrid.c usb-libusb.c usb-unix.c
271
271
272
272
273
#
273
#
(-)cups-1.4.3~/backend/ieee1284.c (-2 / +13 lines)
Lines 255-260 Link Here
255
    cups_option_t	*values;	/* Keys and values in device ID */
255
    cups_option_t	*values;	/* Keys and values in device ID */
256
    const char		*mfg,		/* Manufacturer */
256
    const char		*mfg,		/* Manufacturer */
257
			*mdl,		/* Model */
257
			*mdl,		/* Model */
258
			*des,		/* Description */
258
			*sern;		/* Serial number */
259
			*sern;		/* Serial number */
259
    char		temp[256],	/* Temporary manufacturer string */
260
    char		temp[256],	/* Temporary manufacturer string */
260
			*tempptr;	/* Pointer into temp string */
261
			*tempptr;	/* Pointer into temp string */
Lines 285-294 Link Here
285
    }
286
    }
286
    else
287
    else
287
    {
288
    {
288
      strlcpy(temp, make_model, sizeof(temp));
289
      /*
290
       * No manufacturer?  Use the model string or description...
291
       */
292
293
      if (mdl)
294
	_ppdNormalizeMakeAndModel(mdl, temp, sizeof(temp));
295
      else if ((des = cupsGetOption("DESCRIPTION", num_values, values)) != NULL ||
296
	       (des = cupsGetOption("DES", num_values, values)) != NULL)
297
	_ppdNormalizeMakeAndModel(des, temp, sizeof(temp));
298
      else
299
	strlcpy(temp, "Unknown", sizeof(temp));
289
300
290
      if ((tempptr = strchr(temp, ' ')) != NULL)
301
      if ((tempptr = strchr(temp, ' ')) != NULL)
291
        *tempptr = '\0';
302
	*tempptr = '\0';
292
303
293
      mfg = temp;
304
      mfg = temp;
294
    }
305
    }
(-)cups-1.4.3~/backend/usb-hybrid.c (+87 lines)
Line 0 Link Here
1
/*
2
 * "$Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike $"
3
 *
4
 *   USB port backend for the Common UNIX Printing System (CUPS).
5
 *
6
 *   This file is included from "usb.c" when compiled on Linux.
7
 *
8
 *   Copyright 2007-2008 by Apple Inc.
9
 *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
10
 *
11
 *   These coded instructions, statements, and computer programs are the
12
 *   property of Apple Inc. and are protected by Federal copyright
13
 *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
14
 *   "LICENSE" which should have been included with this file.  If this
15
 *   file is missing or damaged, see the license at "http://www.cups.org/".
16
 *
17
 *   This file is subject to the Apple OS-Developed Software exception.
18
 *
19
 * Contents:
20
 *
21
 *   print_device() - Print a file to a USB device.
22
 *   list_devices() - List all USB devices.
23
 */
24
25
/*
26
 * Include necessary headers.
27
 */
28
29
#include <sys/select.h>
30
31
/*
32
 * Include the two USB implementations used under Linux ...
33
 */
34
35
#include "usb-libusb.c"
36
#include "usb-unix.c"
37
38
/*
39
 * 'print_device()' - Print a file to a USB device.
40
 */
41
42
int					/* O - Exit status */
43
print_device(const char *uri,		/* I - Device URI */
44
             const char *hostname,	/* I - Hostname/manufacturer */
45
             const char *resource,	/* I - Resource/modelname */
46
	     char       *options,	/* I - Device options/serial number */
47
	     int        print_fd,	/* I - File descriptor to print */
48
	     int        copies,		/* I - Copies to print */
49
	     int	argc,		/* I - Number of command-line arguments (6 or 7) */
50
	     char	*argv[])	/* I - Command-line arguments */
51
{
52
  int result;
53
  for(;;)
54
  {
55
    result = print_device_unix(uri, hostname, resource, options, print_fd,
56
			       copies, argc, argv);
57
    if (result == -1)
58
    {
59
      result = print_device_libusb(uri, hostname, resource, options, print_fd,
60
				   copies, argc, argv);
61
      if (result == -1)
62
	sleep(5);
63
      else
64
	return(result);
65
    }
66
    else
67
      return(result);
68
  }
69
}
70
71
/*
72
 * 'list_devices()' - List all USB devices.
73
 */
74
75
void
76
list_devices(void)
77
{
78
  /* Try both discovery methods, each device will appear only under one
79
     of them */
80
  list_devices_libusb();
81
  list_devices_unix();
82
}
83
84
85
/*
86
 * End of "$Id: usb-hybrid.c 8807 2009-08-31 18:45:43Z mike $".
87
 */
(-)cups-1.4.3~/backend/usb-libusb.c (-20 / +89 lines)
Lines 13-28 Link Here
13
 *
13
 *
14
 * Contents:
14
 * Contents:
15
 *
15
 *
16
 *   list_devices()    - List the available printers.
16
 *   list_devices_libusb()    - List the available printers.
17
 *   print_device()    - Print a file to a USB device.
17
 *   print_device_libusb()    - Print a file to a USB device.
18
 *   close_device()    - Close the connection to the USB printer.
18
 *   close_device()    - Close the connection to the USB printer.
19
 *   find_device()     - Find or enumerate USB printers.
19
 *   find_device()     - Find or enumerate USB printers.
20
 *   get_device_id()   - Get the IEEE-1284 device ID for the printer.
20
 *   get_device_id()   - Get the IEEE-1284 device ID for the printer.
21
 *   list_cb()         - List USB printers for discovery.
21
 *   list_cb()         - List USB printers for discovery.
22
 *   make_device_uri() - Create a device URI for a USB printer.
22
 *   make_device_uri() - Create a device URI for a USB printer.
23
 *   open_device()     - Open a connection to the USB printer.
23
 *   open_device_libusb()     - Open a connection to the USB printer.
24
 *   print_cb()        - Find a USB printer for printing.
24
 *   print_cb()        - Find a USB printer for printing.
25
 *   side_cb()         - Handle side-channel requests.
25
 *   side_cb_libusb()         - Handle side-channel requests.
26
 */
26
 */
27
27
28
/*
28
/*
Lines 65-94 Link Here
65
static char		*make_device_uri(usb_printer_t *printer,
65
static char		*make_device_uri(usb_printer_t *printer,
66
			                 const char *device_id,
66
			                 const char *device_id,
67
					 char *uri, size_t uri_size);
67
					 char *uri, size_t uri_size);
68
static int		open_device(usb_printer_t *printer, int verbose);
68
static int		open_device_libusb(usb_printer_t *printer, int verbose);
69
static int		print_cb(usb_printer_t *printer, const char *device_uri,
69
static int		print_cb(usb_printer_t *printer, const char *device_uri,
70
			         const char *device_id, const void *data);
70
			         const char *device_id, const void *data);
71
static ssize_t		side_cb(usb_printer_t *printer, int print_fd);
71
static ssize_t		side_cb_libusb(usb_printer_t *printer, int print_fd);
72
72
73
73
74
/*
74
/*
75
 * 'list_devices()' - List the available printers.
75
 * 'list_devices_libusb()' - List the available printers.
76
 */
76
 */
77
77
78
void
78
void
79
list_devices(void)
79
list_devices_libusb(void)
80
{
80
{
81
  fputs("DEBUG: list_devices\n", stderr);
81
  fputs("DEBUG: list_devices_libusb\n", stderr);
82
  find_device(list_cb, NULL);
82
  find_device(list_cb, NULL);
83
}
83
}
84
84
85
85
86
/*
86
/*
87
 * 'print_device()' - Print a file to a USB device.
87
 * 'print_device_libusb()' - Print a file to a USB device.
88
 */
88
 */
89
89
90
int					/* O - Exit status */
90
int					/* O - Exit status */
91
print_device(const char *uri,		/* I - Device URI */
91
print_device_libusb(const char *uri,		/* I - Device URI */
92
             const char *hostname,	/* I - Hostname/manufacturer */
92
             const char *hostname,	/* I - Hostname/manufacturer */
93
             const char *resource,	/* I - Resource/modelname */
93
             const char *resource,	/* I - Resource/modelname */
94
	     char       *options,	/* I - Device options/serial number */
94
	     char       *options,	/* I - Device options/serial number */
Lines 105-123 Link Here
105
  struct pollfd	pfds[2];		/* Poll descriptors */
105
  struct pollfd	pfds[2];		/* Poll descriptors */
106
106
107
107
108
  fputs("DEBUG: print_device\n", stderr);
108
  fputs("DEBUG: print_device_libusb\n", stderr);
109
109
110
 /*
110
 /*
111
  * Connect to the printer...
111
  * Connect to the printer...
112
  */
112
  */
113
113
114
#if defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
115
  if ((printer = find_device(print_cb, uri)) == NULL)
116
    return(-1);
117
#else
114
  while ((printer = find_device(print_cb, uri)) == NULL)
118
  while ((printer = find_device(print_cb, uri)) == NULL)
115
  {
119
  {
116
    _cupsLangPuts(stderr,
120
    _cupsLangPuts(stderr,
117
		  _("INFO: Waiting for printer to become available...\n"));
121
		  _("INFO: Waiting for printer to become available...\n"));
118
    sleep(5);
122
    sleep(5);
119
  }
123
  }
120
124
#endif
121
125
122
 /*
126
 /*
123
  * If we are printing data from a print driver on stdin, ignore SIGTERM
127
  * If we are printing data from a print driver on stdin, ignore SIGTERM
Lines 189-195 Link Here
189
193
190
      if (pfds[1].revents & (POLLIN | POLLHUP))
194
      if (pfds[1].revents & (POLLIN | POLLHUP))
191
      {
195
      {
192
        if ((bytes = side_cb(printer, print_fd)) < 0)
196
        if ((bytes = side_cb_libusb(printer, print_fd)) < 0)
193
	  pfds[1].events = 0;		/* Filter has gone away... */
197
	  pfds[1].events = 0;		/* Filter has gone away... */
194
	else
198
	else
195
          tbytes += bytes;
199
          tbytes += bytes;
Lines 359-365 Link Here
359
	    printer.iface  = iface;
363
	    printer.iface  = iface;
360
	    printer.handle = NULL;
364
	    printer.handle = NULL;
361
365
362
            if (!open_device(&printer, data != NULL))
366
            if (!open_device_libusb(&printer, data != NULL))
363
	    {
367
	    {
364
	      if (!get_device_id(&printer, device_id, sizeof(device_id)))
368
	      if (!get_device_id(&printer, device_id, sizeof(device_id)))
365
	      {
369
	      {
Lines 583-588 Link Here
583
    mfg = tempmfg;
587
    mfg = tempmfg;
584
  }
588
  }
585
589
590
  if (!strncasecmp(mdl, mfg, strlen(mfg)))
591
  {
592
    mdl += strlen(mfg);
593
594
    while (isspace(*mdl & 255))
595
      mdl ++;
596
    }
597
586
 /*
598
 /*
587
  * Generate the device URI from the manufacturer, model, serial number,
599
  * Generate the device URI from the manufacturer, model, serial number,
588
  * and interface number...
600
  * and interface number...
Lines 611-621 Link Here
611
623
612
624
613
/*
625
/*
614
 * 'open_device()' - Open a connection to the USB printer.
626
 * 'open_device_libusb()' - Open a connection to the USB printer.
615
 */
627
 */
616
628
617
static int				/* O - 0 on success, -1 on error */
629
static int				/* O - 0 on success, -1 on error */
618
open_device(usb_printer_t *printer,	/* I - Printer */
630
open_device_libusb(usb_printer_t *printer,	/* I - Printer */
619
            int           verbose)	/* I - Update connecting-to-device state? */
631
            int           verbose)	/* I - Update connecting-to-device state? */
620
{
632
{
621
  int	number;				/* Configuration/interface/altset numbers */
633
  int	number;				/* Configuration/interface/altset numbers */
Lines 733-748 Link Here
733
         const char    *device_id,	/* I - IEEE-1284 device ID */
745
         const char    *device_id,	/* I - IEEE-1284 device ID */
734
         const void    *data)		/* I - User data (make, model, S/N) */
746
         const void    *data)		/* I - User data (make, model, S/N) */
735
{
747
{
736
  return (!strcmp((char *)data, device_uri));
748
  char *uri = (char *)data,
749
       *str1,
750
       *str2,
751
       buf[255],
752
       requested_uri[1024];
753
754
  /* Work on a copy of uri */
755
  strncpy(requested_uri, uri, sizeof(requested_uri));
756
  requested_uri[sizeof(requested_uri) - 1] = '\0';
757
758
  /*
759
   * libusb-discovered URIs can have an "interface" specification and this
760
   * never happens for usblp-discovered URIs, so remove the "interface"
761
   * specification from the URI which we are checking currently. This way a
762
   * queue for a usblp-discovered printer can now be accessed via libusb
763
   */
764
  if (((str1 = strstr(requested_uri, "interface=")) == NULL) &&
765
      ((str2 = strstr(device_uri, "interface=")) != NULL))
766
  {
767
    *(str2 - 1) = '\0';
768
  }
769
770
  /*
771
   * Old URI with "serial=?". Cut this part off and consider this as
772
   * an URI without serial number
773
   */
774
  if ((str1 = strstr(requested_uri, "serial=?")) != NULL)
775
   *(str1 - 1) = '\0';
776
777
  /*
778
   * Old URI without serial number. Match it also with URIs with serial
779
   * number
780
   */
781
  if (((str1 = strstr(requested_uri, "serial=")) == NULL) &&
782
      ((str2 = strstr(device_uri, "serial=")) != NULL))
783
    *(str2 - 1) = '\0';
784
785
  /*
786
   * libusb-discovered URIs can have a "serial" specification when the
787
   * usblp-discovered URI for the same printer does not have one, as
788
   * with libusb we can discover serial numbers also with other methods
789
   * than only via the device ID. Therefore we accept also a
790
   * usblp-discovered printer without serial number as a match. This we
791
   * do by removing the serial number from the queue's (libusb-discovered)
792
   * URI before comparing. Also warn the user because of the incapability
793
   * of the usblp-based access to distinguish printers by the serial
794
   * number.
795
   */
796
  if (((str1 = strstr(requested_uri, "serial=")) == NULL) &&
797
      ((str2 = strstr(device_uri, "serial=")) != NULL))
798
  {
799
    *(str2 - 1) = '\0';
800
    if (backendGetMakeModel(device_id, buf, sizeof(buf)) == 0)
801
      fprintf(stderr, "WARNING: If you have more than one %s printer connected to this machine, please make sure that the \"usblp\" kernel module is always unloaded (and blacklisted) and re-create the queues for these printers. Otherwise CUPS will not be able to distinguish them.\n",
802
	    buf);
803
  }
804
805
  return (!strcmp(requested_uri, device_uri));
737
}
806
}
738
807
739
808
740
/*
809
/*
741
 * 'side_cb()' - Handle side-channel requests.
810
 * 'side_cb_libusb()' - Handle side-channel requests.
742
 */
811
 */
743
812
744
static ssize_t				/* O - Number of bytes written */
813
static ssize_t				/* O - Number of bytes written */
745
side_cb(usb_printer_t *printer,		/* I - Printer */
814
side_cb_libusb(usb_printer_t *printer,		/* I - Printer */
746
        int           print_fd)		/* I - File to print */
815
        int           print_fd)		/* I - File to print */
747
{
816
{
748
  ssize_t		bytes,		/* Bytes read/written */
817
  ssize_t		bytes,		/* Bytes read/written */
(-)cups-1.4.3~/backend/usb-unix.c (-20 / +80 lines)
Lines 18-27 Link Here
18
 *
18
 *
19
 * Contents:
19
 * Contents:
20
 *
20
 *
21
 *   print_device() - Print a file to a USB device.
21
 *   print_device_unix() - Print a file to a USB device.
22
 *   list_devices() - List all USB devices.
22
 *   list_devices_unix() - List all USB devices.
23
 *   open_device()  - Open a USB device...
23
 *   open_device_unix()  - Open a USB device...
24
 *   side_cb()      - Handle side-channel requests...
24
 *   side_cb_unix()      - Handle side-channel requests...
25
 */
25
 */
26
26
27
/*
27
/*
Lines 35-51 Link Here
35
 * Local functions...
35
 * Local functions...
36
 */
36
 */
37
37
38
static int	open_device(const char *uri, int *use_bc);
38
static int	open_device_unix(const char *uri, int *use_bc);
39
static int	side_cb(int print_fd, int device_fd, int snmp_fd,
39
static int	side_cb_unix(int print_fd, int device_fd, int snmp_fd,
40
		        http_addr_t *addr, int use_bc);
40
		        http_addr_t *addr, int use_bc);
41
41
42
42
43
/*
43
/*
44
 * 'print_device()' - Print a file to a USB device.
44
 * 'print_device_unix()' - Print a file to a USB device.
45
 */
45
 */
46
46
47
int					/* O - Exit status */
47
int					/* O - Exit status */
48
print_device(const char *uri,		/* I - Device URI */
48
print_device_unix(const char *uri,		/* I - Device URI */
49
             const char *hostname,	/* I - Hostname/manufacturer */
49
             const char *hostname,	/* I - Hostname/manufacturer */
50
             const char *resource,	/* I - Resource/modelname */
50
             const char *resource,	/* I - Resource/modelname */
51
	     char       *options,	/* I - Device options/serial number */
51
	     char       *options,	/* I - Device options/serial number */
Lines 102-108 Link Here
102
             strncasecmp(hostname, "Minolta", 7);
102
             strncasecmp(hostname, "Minolta", 7);
103
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
103
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
104
104
105
    if ((device_fd = open_device(uri, &use_bc)) == -1)
105
    if ((device_fd = open_device_unix(uri, &use_bc)) == -1)
106
    {
106
    {
107
      if (getenv("CLASS") != NULL)
107
      if (getenv("CLASS") != NULL)
108
      {
108
      {
Lines 132-137 Link Here
132
	              _("INFO: Printer busy; will retry in 10 seconds...\n"));
132
	              _("INFO: Printer busy; will retry in 10 seconds...\n"));
133
	sleep(10);
133
	sleep(10);
134
      }
134
      }
135
#ifdef HAVE_USB_H
136
      else
137
	return (-1);
138
#else
135
      else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
139
      else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
136
               errno == ENODEV)
140
               errno == ENODEV)
137
      {
141
      {
Lines 147-152 Link Here
147
			resource, strerror(errno));
151
			resource, strerror(errno));
148
	return (CUPS_BACKEND_FAILED);
152
	return (CUPS_BACKEND_FAILED);
149
      }
153
      }
154
#endif
150
    }
155
    }
151
  }
156
  }
152
  while (device_fd < 0);
157
  while (device_fd < 0);
Lines 190-196 Link Here
190
    tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, NULL);
195
    tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, NULL);
191
196
192
#else
197
#else
193
    tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
198
    tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb_unix);
194
#endif /* __sun */
199
#endif /* __sun */
195
200
196
    if (print_fd != 0 && tbytes >= 0)
201
    if (print_fd != 0 && tbytes >= 0)
Lines 214-224 Link Here
214
219
215
220
216
/*
221
/*
217
 * 'list_devices()' - List all USB devices.
222
 * 'list_devices_unix()' - List all USB devices.
218
 */
223
 */
219
224
220
void
225
void
221
list_devices(void)
226
list_devices_unix(void)
222
{
227
{
223
#ifdef __linux
228
#ifdef __linux
224
  int	i;				/* Looping var */
229
  int	i;				/* Looping var */
Lines 320-330 Link Here
320
325
321
326
322
/*
327
/*
323
 * 'open_device()' - Open a USB device...
328
 * 'open_device_unix()' - Open a USB device...
324
 */
329
 */
325
330
326
static int				/* O - File descriptor or -1 on error */
331
static int				/* O - File descriptor or -1 on error */
327
open_device(const char *uri,		/* I - Device URI */
332
open_device_unix(const char *uri,		/* I - Device URI */
328
            int        *use_bc)		/* O - Set to 0 for unidirectional */
333
            int        *use_bc)		/* O - Set to 0 for unidirectional */
329
{
334
{
330
  int	fd;				/* File descriptor */
335
  int	fd;				/* File descriptor */
Lines 357-365 Link Here
357
    char	device[255],		/* Device filename */
362
    char	device[255],		/* Device filename */
358
		device_id[1024],	/* Device ID string */
363
		device_id[1024],	/* Device ID string */
359
		make_model[1024],	/* Make and model */
364
		make_model[1024],	/* Make and model */
360
		device_uri[1024];	/* Device URI string */
365
		device_uri[1024],	/* Device URI string */
361
366
		requested_uri[1024],	/* Device URI string */
367
		*str1,
368
		*str2;
362
369
370
    
363
   /*
371
   /*
364
    * Find the correct USB device...
372
    * Find the correct USB device...
365
    */
373
    */
Lines 407-413 Link Here
407
	  device_uri[0] = '\0';
415
	  device_uri[0] = '\0';
408
        }
416
        }
409
417
410
        if (!strcmp(uri, device_uri))
418
	/* Work on a copy of uri */
419
	strncpy(requested_uri, uri, sizeof(requested_uri));
420
	requested_uri[sizeof(requested_uri) - 1] = '\0';
421
422
	/*
423
	 * libusb-discovered URIs can have an "interface" specification and this
424
	 * never happens for usblp-discovered URIs, so remove the "interface"
425
	 * specification from the URI of the print queue. This way a queue for
426
	 * a libusb-discovered printer can now be accessed via the usblip kernel
427
	 * module
428
	 */
429
	if ((str1 = strstr(requested_uri, "interface=")) != NULL)
430
	  *(str1 - 1) = '\0';
431
432
	/*
433
	 * Old URI with "serial=?". Cut this part off and consider this as
434
	 * an URI without serial number
435
	 */
436
	if ((str1 = strstr(requested_uri, "serial=?")) != NULL)
437
	 *(str1 - 1) = '\0';
438
439
	/*
440
	 * Old URI without serial number. Match it also with URIs with serial
441
	 * number
442
	 */
443
	if (((str1 = strstr(requested_uri, "serial=")) == NULL) &&
444
	    ((str2 = strstr(device_uri, "serial=")) != NULL))
445
	    *(str2 - 1) = '\0';
446
447
	/*
448
	 * libusb-discovered URIs can have a "serial" specification when the
449
	 * usblp-discovered URI for the same printer does not have one, as
450
	 * with libusb we can discover serial numbers also with other methods
451
	 * than only via the device ID. Therefore we accept also a
452
	 * usblp-discovered printer without serial number as a match. This we
453
	 * do by removing the serial number from the queue's (libusb-discovered)
454
	 * URI before comparing. Also warn the user because of the incapability
455
	 * of the usblp-based access to distinguish printers by the serial
456
	 * number.
457
	 */
458
	if (((str1 = strstr(requested_uri, "serial=")) != NULL) &&
459
	    ((str2 = strstr(device_uri, "serial=")) == NULL))
460
	{
461
	  *(str1 - 1) = '\0';
462
	  fprintf(stderr, "WARNING: If you have more than one %s printer connected to this machine, please unload (and blacklist) the \"usblp\" kernel module as otherwise CUPS will not be able to distinguish your printers.\n",
463
		  make_model);
464
	}
465
466
        if (!strcmp(requested_uri, device_uri))
411
	{
467
	{
412
	 /*
468
	 /*
413
	  * Yes, return this file descriptor...
469
	  * Yes, return this file descriptor...
Lines 433-442 Link Here
433
      */
489
      */
434
490
435
      if (busy)
491
      if (busy)
492
      {
436
	_cupsLangPuts(stderr,
493
	_cupsLangPuts(stderr,
437
	              _("INFO: Printer busy; will retry in 5 seconds...\n"));
494
	              _("INFO: Printer busy; will retry in 5 seconds...\n"));
438
495
439
      sleep(5);
496
	sleep(5);
497
      }
498
      else
499
	return -1;
440
    }
500
    }
441
  }
501
  }
442
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
502
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
Lines 557-567 Link Here
557
617
558
618
559
/*
619
/*
560
 * 'side_cb()' - Handle side-channel requests...
620
 * 'side_cb_unix()' - Handle side-channel requests...
561
 */
621
 */
562
622
563
static int				/* O - 0 on success, -1 on error */
623
static int				/* O - 0 on success, -1 on error */
564
side_cb(int         print_fd,		/* I - Print file */
624
side_cb_unix(int         print_fd,		/* I - Print file */
565
        int         device_fd,		/* I - Device file */
625
        int         device_fd,		/* I - Device file */
566
        int         snmp_fd,		/* I - SNMP socket (unused) */
626
        int         snmp_fd,		/* I - SNMP socket (unused) */
567
	http_addr_t *addr,		/* I - Device address (unused) */
627
	http_addr_t *addr,		/* I - Device address (unused) */
(-)cups-1.4.3~/backend/usb.c (-1 / +1 lines)
Lines 56-62 Link Here
56
 */
56
 */
57
57
58
#ifdef HAVE_USB_H
58
#ifdef HAVE_USB_H
59
#  include "usb-libusb.c"
59
#  include "usb-hybrid.c"
60
#elif defined(__APPLE__)
60
#elif defined(__APPLE__)
61
#  include "usb-darwin.c"
61
#  include "usb-darwin.c"
62
#elif defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
62
#elif defined(__linux) || defined(__sun) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)

Return to bug 323931