From 351b7328520c16730ceb46e5acae16038c42185e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 16 Feb 2021 18:24:19 +0100 Subject: New upstream version 1.0.32 --- backend/pixma/pixma_mp800.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'backend/pixma/pixma_mp800.c') diff --git a/backend/pixma/pixma_mp800.c b/backend/pixma/pixma_mp800.c index 905c246..fba7553 100644 --- a/backend/pixma/pixma_mp800.c +++ b/backend/pixma/pixma_mp800.c @@ -17,9 +17,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + along with this program. If not, see . As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. @@ -152,6 +150,10 @@ 00000001\ " +#if !defined(HAVE_LIBXML2) +#define XML_OK "OK" +#endif + enum mp810_state_t { state_idle, @@ -291,7 +293,11 @@ static int send_xml_dialog (pixma_t * s, const char * xml_message) PDBG(pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message)); PDBG(pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf)); +#if defined(HAVE_LIBXML2) return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK; +#else + return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL); +#endif } static void new_cmd_tpu_msg (pixma_t *s, pixma_cmdbuf_t * cb, uint16_t cmd) @@ -401,6 +407,10 @@ static int select_source (pixma_t * s) data[0] = 4; data[1] = 2; break; + + case PIXMA_SOURCE_NONE: + /* this source can not be selected */ + break; } return pixma_exec (s, &mp->cb); } @@ -483,7 +493,7 @@ static unsigned calc_raw_width (const mp810_t * mp, const pixma_scan_param_t * param) { unsigned raw_width; - /* NOTE: Actually, we can send arbitary width to MP810. Lines returned + /* NOTE: Actually, we can send arbitrary width to MP810. Lines returned are always padded to multiple of 4 or 12 pixels. Is this valid for other models, too? */ if (mp->generation >= 2) @@ -929,8 +939,7 @@ static int send_scan_param (pixma_t * s) data[0x02] = 0x03; data[0x03] = 0x03; } - if (s->cfg->pid != MG8200_PID) - data[0x05] = 0x01; /* This one also seen at 0. Don't know yet what's used for */ + data[0x05] = pixma_calc_calibrate (s); /* the scanner controls the scan */ /* no software control needed */ pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x08); -- cgit v1.2.3