From 3004d32e68a13cf1a0ebc805c19652a660a6ffbc Mon Sep 17 00:00:00 2001 From: Vasiliy Olekhov Date: Mon, 9 Jan 2012 19:53:49 +0400 Subject: [PATCH] MF4410 support --- backend/pixma_imageclass.c | 15 ++++++++++++--- mkinstalldirs | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/backend/pixma_imageclass.c b/backend/pixma_imageclass.c index bf47fc2..f26aa6a 100644 --- a/backend/pixma_imageclass.c +++ b/backend/pixma_imageclass.c @@ -83,6 +83,7 @@ #define MF8100_PID 0x2659 #define MF8030_PID 0x2707 +#define MF4410_PID 0x2737 enum iclass_state_t { @@ -99,7 +100,8 @@ enum iclass_cmd_t cmd_scan_param = 0xde20, cmd_status = 0xf320, cmd_abort_session = 0xef20, - cmd_read_image = 0xd420, + cmd_read_image = 0xd420, + cmd_read_image2 = 0xd460, /* New multifunctionals, such as MF4410 */ cmd_error_info = 0xff20, cmd_activate = 0xcf60 @@ -264,10 +266,11 @@ request_image_block (pixma_t * s, unsigned flag, uint8_t * info, const int hlen = 2 + 6; memset (mf->cb.buf, 0, 11); - pixma_set_be16 (cmd_read_image, mf->cb.buf); + pixma_set_be16 ( s->cfg->pid == MF4410_PID? cmd_read_image2:cmd_read_image, mf->cb.buf); mf->cb.buf[8] = flag; mf->cb.buf[10] = 0x06; expected_len = (s->cfg->pid == MF4600_PID || + s->cfg->pid == MF4410_PID || s->cfg->pid == MF6500_PID || s->cfg->pid == MF8030_PID) ? 512 : hlen; mf->cb.reslen = pixma_cmd_transaction (s, mf->cb.buf, 11, mf->cb.buf, expected_len); @@ -278,6 +281,7 @@ request_image_block (pixma_t * s, unsigned flag, uint8_t * info, error = 0; if (s->cfg->pid == MF4600_PID || + s->cfg->pid == MF4410_PID || s->cfg->pid == MF6500_PID || s->cfg->pid == MF8030_PID) { /* 32bit size */ @@ -300,6 +304,7 @@ read_image_block (pixma_t * s, uint8_t * data, unsigned size) unsigned maxchunksize, chunksize, count = 0; maxchunksize = MAX_CHUNK_SIZE * ((s->cfg->pid == MF4600_PID || + s->cfg->pid == MF4410_PID || s->cfg->pid == MF6500_PID || s->cfg->pid == MF8030_PID) ? 4 : 1); while (size) @@ -516,6 +521,8 @@ iclass_scan (pixma_t * s) error = send_scan_param (s); if (error >= 0) error = request_image_block (s, 0, &ignore, &ignore2, &ignore, &ignore2); + + if (error < 0) { iclass_finish_scan (s); @@ -596,6 +603,7 @@ iclass_fill_buffer (pixma_t * s, pixma_imagebuf_t * ib) { if (s->param->channels != 1 && s->cfg->pid != MF4600_PID && + s->cfg->pid != MF4410_PID && s->cfg->pid != MF6500_PID && s->cfg->pid != MF8030_PID) { @@ -643,7 +651,7 @@ iclass_finish_scan (pixma_t * s) query_status (s); activate (s, 0); query_status (s); - if (mf->last_block == 0x28) + if (mf->last_block == 0x28 || (s->cfg->pid==MF4410_PID && mf->last_block==0x38)) { abort_session (s); } @@ -714,5 +722,6 @@ const pixma_config_t pixma_iclass_devices[] = { DEV ("Canon laserBase MF5650", "MF5650", MF5650_PID, 600, 640, 877, PIXMA_CAP_ADF), DEV ("Canon imageCLASS MF8170c", "MF8170c", MF8100_PID, 600, 640, 877, PIXMA_CAP_ADF), DEV ("Canon imageClass MF8030", "MF8030", MF8030_PID, 600, 640, 877, PIXMA_CAP_ADF), + DEV ("Canon imageCLASS MF4410", "MF4410", MF4410_PID, 600, 640, 877, 0), DEV (NULL, NULL, 0, 0, 0, 0, 0) };