kopia lustrzana https://gitlab.com/sane-project/backends
Fix for Pixma MP730 in pixma backend and sanei_usb
Updated following files for Pixma MP730 support: - backend/pixma_mp730.c: Add width scan area fitting Fix end scan sequence protocol - sanei/sanei_usb.c: In sanei_usb_open(), changed the "seek for endpoints" loop so that it first looks for those interfaces (in config 0) that have been detected as potential scanners in sanei_usb_init()merge-requests/1/head
rodzic
56c2ed861b
commit
5b69fa8c6d
|
@ -411,6 +411,7 @@ mp730_close (pixma_t * s)
|
|||
|
||||
mp730_finish_scan (s);
|
||||
free (mp->cb.buf);
|
||||
free (mp->buf);
|
||||
free (mp);
|
||||
s->subdriver = NULL;
|
||||
}
|
||||
|
@ -433,6 +434,7 @@ mp730_check_param (pixma_t * s, pixma_scan_param_t * sp)
|
|||
UNUSED (s);
|
||||
|
||||
sp->depth = 8; /* FIXME: Does MP730 supports other depth? */
|
||||
sp->w = calc_raw_width (sp);
|
||||
sp->line_size = calc_raw_width (sp) * sp->channels;
|
||||
return 0;
|
||||
}
|
||||
|
@ -496,12 +498,8 @@ mp730_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib)
|
|||
{
|
||||
if (s->cancel)
|
||||
return PIXMA_ECANCELED;
|
||||
if (mp->last_block)
|
||||
{
|
||||
/* end of image */
|
||||
mp->state = state_finished;
|
||||
if (mp->last_block) /* end of image */
|
||||
return 0;
|
||||
}
|
||||
|
||||
error = read_image_block (s, header, mp->imgbuf + mp->imgbuf_len);
|
||||
if (error < 0)
|
||||
|
@ -510,6 +508,10 @@ mp730_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib)
|
|||
bytes_received = error;
|
||||
block_size = pixma_get_be16 (header + 4);
|
||||
mp->last_block = ((header[2] & 0x28) == 0x28);
|
||||
if (mp->last_block)
|
||||
{ /* end of image */
|
||||
mp->state = state_finished;
|
||||
}
|
||||
if ((header[2] & ~0x38) != 0)
|
||||
{
|
||||
PDBG (pixma_dbg (1, "WARNING: Unexpected result header\n"));
|
||||
|
@ -522,7 +524,7 @@ mp730_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib)
|
|||
/* no image data at this moment. */
|
||||
/*pixma_sleep(100000); *//* FIXME: too short, too long? */
|
||||
handle_interrupt (s, 100);
|
||||
/*XXX*/}
|
||||
}
|
||||
}
|
||||
while (block_size == 0);
|
||||
|
||||
|
@ -577,7 +579,6 @@ mp730_finish_scan (pixma_t * s)
|
|||
query_status (s);
|
||||
query_status (s);
|
||||
activate (s, 0);
|
||||
free (mp->buf);
|
||||
mp->buf = mp->lbuf = mp->imgbuf = NULL;
|
||||
mp->state = state_idle;
|
||||
/* fall through */
|
||||
|
|
|
@ -1236,6 +1236,9 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
|
|||
/* Loop through all of the alternate settings */
|
||||
for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++)
|
||||
{
|
||||
/* Start by interfaces found in sanei_usb_init */
|
||||
if (c == 0 && i != devices[devcount].interface_nr)
|
||||
continue;
|
||||
|
||||
DBG (5, "sanei_usb_open: configuration nr: %d\n", c);
|
||||
DBG (5, "sanei_usb_open: interface nr: %d\n", i);
|
||||
|
@ -1540,6 +1543,10 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
|
|||
/* Loop through all of the alternate settings */
|
||||
for (a = 0; a < config->interface[i].num_altsetting; a++)
|
||||
{
|
||||
/* Start by interfaces found in sanei_usb_init */
|
||||
if (c == 0 && i != devices[devcount].interface_nr)
|
||||
continue;
|
||||
|
||||
const struct libusb_interface_descriptor *interface;
|
||||
|
||||
DBG (5, "sanei_usb_open: configuration nr: %d\n", c);
|
||||
|
|
Ładowanie…
Reference in New Issue