/*
- * "$Id: usb-unix.c 5099 2006-02-13 02:46:10Z mike $"
+ * "$Id$"
*
* USB port backend for the Common UNIX Printing System (CUPS).
*
const char *resource, /* I - Resource/modelname */
const char *options, /* I - Device options/serial number */
int fp, /* I - File descriptor to print */
- int copies) /* I - Copies to print */
+ int copies, /* I - Copies to print */
+ int argc, /* I - Number of command-line arguments (6 or 7) */
+ char *argv[]) /* I - Command-line arguments */
{
+ int usebc; /* Use backchannel path? */
int fd; /* USB device */
int rbytes; /* Number of bytes read */
int wbytes; /* Number of bytes written */
unsigned int status; /* Port status (off-line, out-of-paper, etc.) */
#endif /* __linux */
+ (void)argc;
+ (void)argv;
+
+ /*
+ * Disable backchannel data when printing to Canon USB printers - apparently
+ * Canon printers will return the IEEE-1284 device ID over and over and over
+ * when they get a read request...
+ */
+
+ usebc = strcasecmp(hostname, "Canon") != 0;
/*
* Open the USB port device...
*/
+ fputs("STATE: +connecting-to-device\n", stderr);
+
do
{
if ((fd = open_device(uri)) == -1)
}
while (fd < 0);
+ fputs("STATE: -connecting-to-device\n", stderr);
+
/*
* Set any options provided...
*/
do
{
FD_ZERO(&input);
- FD_SET(fd, &input);
+ if (usebc)
+ FD_SET(fd, &input);
+
FD_ZERO(&output);
FD_SET(fd, &output);
}
device_id[1024], /* Device ID string */
device_uri[1024], /* Device URI string */
make_model[1024]; /* Make and model */
- struct ecpp_device_id did; /* Device ID buffer */
/*
}
#elif defined(__hpux)
#elif defined(__osf)
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
int i; /* Looping var */
char device[255]; /* Device filename */
device_id[1024], /* Device ID string */
make_model[1024], /* Make and model */
device_uri[1024]; /* Device URI string */
- struct ecpp_device_id did; /* Device ID buffer */
/*
/*
- * End of "$Id: usb-unix.c 5099 2006-02-13 02:46:10Z mike $".
+ * End of "$Id$".
*/