*/
static int open_device(const char *uri, int *use_bc);
-static void side_cb(int print_fd, int device_fd, int use_bc);
+static void side_cb(int print_fd, int device_fd, int snmp_fd,
+ http_addr_t *addr, int use_bc);
/*
use_bc = strcasecmp(hostname, "Brother") &&
strcasecmp(hostname, "Canon") &&
- strcasecmp(hostname, "Konica Minolta") &&
- strcasecmp(hostname, "Minolta");
+ strncasecmp(hostname, "Konica", 6) &&
+ strncasecmp(hostname, "Minolta", 7);
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
if ((device_fd = open_device(uri, &use_bc)) == -1)
lseek(print_fd, 0, SEEK_SET);
}
- tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb);
+ tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb);
if (print_fd != 0 && tbytes >= 0)
_cupsLangPrintf(stderr,
* Find the correct USB device...
*/
- do
+ for (;;)
{
for (busy = 0, i = 0; i < 16; i ++)
{
sleep(5);
}
}
- while (busy);
-
- /*
- * Couldn't find the printer, return "no such device or address"...
- */
-
- errno = ENODEV;
-
- return (-1);
}
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
{
}
#else
{
- if (use_bc)
+ if (*use_bc)
fd = open(uri + 4, O_RDWR | O_EXCL);
else
fd = -1;
*/
static void
-side_cb(int print_fd, /* I - Print file */
- int device_fd, /* I - Device file */
- int use_bc) /* I - Using back-channel? */
+side_cb(int print_fd, /* I - Print file */
+ int device_fd, /* I - Device file */
+ int snmp_fd, /* I - SNMP socket (unused) */
+ http_addr_t *addr, /* I - Device address (unused) */
+ int use_bc) /* I - Using back-channel? */
{
cups_sc_command_t command; /* Request command */
cups_sc_status_t status; /* Request/response status */
int datalen; /* Request/response data size */
+ (void)snmp_fd;
+ (void)addr;
+
datalen = sizeof(data);
if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0))