kopia lustrzana https://gitlab.com/sane-project/backends
use mf->generation instead of s->cfg->pid for generation 2 scanners
rodzic
d5baddf003
commit
82f92ec004
|
@ -281,16 +281,10 @@ request_image_block (pixma_t * s, unsigned flag, uint8_t * info,
|
||||||
const int hlen = 2 + 6;
|
const int hlen = 2 + 6;
|
||||||
|
|
||||||
memset (mf->cb.buf, 0, 11);
|
memset (mf->cb.buf, 0, 11);
|
||||||
pixma_set_be16 (((s->cfg->pid == MF3010_PID ||
|
pixma_set_be16 (((mf->generation >= 2) ? cmd_read_image2 : cmd_read_image), mf->cb.buf);
|
||||||
s->cfg->pid == MF4410_PID ||
|
|
||||||
s->cfg->pid == MF4770_PID ||
|
|
||||||
s->cfg->pid == MF4550_PID) ? cmd_read_image2 : cmd_read_image), mf->cb.buf);
|
|
||||||
mf->cb.buf[8] = flag;
|
mf->cb.buf[8] = flag;
|
||||||
mf->cb.buf[10] = 0x06;
|
mf->cb.buf[10] = 0x06;
|
||||||
expected_len = (s->cfg->pid == MF3010_PID ||
|
expected_len = (mf->generation >= 2 ||
|
||||||
s->cfg->pid == MF4410_PID ||
|
|
||||||
s->cfg->pid == MF4770_PID ||
|
|
||||||
s->cfg->pid == MF4550_PID ||
|
|
||||||
s->cfg->pid == MF4600_PID ||
|
s->cfg->pid == MF4600_PID ||
|
||||||
s->cfg->pid == MF6500_PID ||
|
s->cfg->pid == MF6500_PID ||
|
||||||
s->cfg->pid == MF8030_PID) ? 512 : hlen;
|
s->cfg->pid == MF8030_PID) ? 512 : hlen;
|
||||||
|
@ -301,10 +295,7 @@ request_image_block (pixma_t * s, unsigned flag, uint8_t * info,
|
||||||
*size = pixma_get_be16 (mf->cb.buf + 6); /* 16bit size */
|
*size = pixma_get_be16 (mf->cb.buf + 6); /* 16bit size */
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
if (s->cfg->pid == MF3010_PID ||
|
if (mf->generation >= 2 ||
|
||||||
s->cfg->pid == MF4410_PID ||
|
|
||||||
s->cfg->pid == MF4770_PID ||
|
|
||||||
s->cfg->pid == MF4550_PID ||
|
|
||||||
s->cfg->pid == MF4600_PID ||
|
s->cfg->pid == MF4600_PID ||
|
||||||
s->cfg->pid == MF6500_PID ||
|
s->cfg->pid == MF6500_PID ||
|
||||||
s->cfg->pid == MF8030_PID)
|
s->cfg->pid == MF8030_PID)
|
||||||
|
@ -324,13 +315,11 @@ request_image_block (pixma_t * s, unsigned flag, uint8_t * info,
|
||||||
static int
|
static int
|
||||||
read_image_block (pixma_t * s, uint8_t * data, unsigned size)
|
read_image_block (pixma_t * s, uint8_t * data, unsigned size)
|
||||||
{
|
{
|
||||||
|
iclass_t *mf = (iclass_t *) s->subdriver;
|
||||||
int error;
|
int error;
|
||||||
unsigned maxchunksize, chunksize, count = 0;
|
unsigned maxchunksize, chunksize, count = 0;
|
||||||
|
|
||||||
maxchunksize = MAX_CHUNK_SIZE * ((s->cfg->pid == MF3010_PID ||
|
maxchunksize = MAX_CHUNK_SIZE * ((mf->generation >= 2 ||
|
||||||
s->cfg->pid == MF4410_PID ||
|
|
||||||
s->cfg->pid == MF4770_PID ||
|
|
||||||
s->cfg->pid == MF4550_PID ||
|
|
||||||
s->cfg->pid == MF4600_PID ||
|
s->cfg->pid == MF4600_PID ||
|
||||||
s->cfg->pid == MF6500_PID ||
|
s->cfg->pid == MF6500_PID ||
|
||||||
s->cfg->pid == MF8030_PID) ? 4 : 1);
|
s->cfg->pid == MF8030_PID) ? 4 : 1);
|
||||||
|
@ -652,10 +641,7 @@ iclass_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib)
|
||||||
if (n != 0)
|
if (n != 0)
|
||||||
{
|
{
|
||||||
if (s->param->channels != 1 &&
|
if (s->param->channels != 1 &&
|
||||||
s->cfg->pid != MF3010_PID &&
|
mf->generation == 1 &&
|
||||||
s->cfg->pid != MF4410_PID &&
|
|
||||||
s->cfg->pid != MF4770_PID &&
|
|
||||||
s->cfg->pid != MF4550_PID &&
|
|
||||||
s->cfg->pid != MF4600_PID &&
|
s->cfg->pid != MF4600_PID &&
|
||||||
s->cfg->pid != MF6500_PID &&
|
s->cfg->pid != MF6500_PID &&
|
||||||
s->cfg->pid != MF8030_PID)
|
s->cfg->pid != MF8030_PID)
|
||||||
|
|
Ładowanie…
Reference in New Issue