kopia lustrzana https://gitlab.com/sane-project/backends
backend/umax: bugfix for sense_handler and do_calibration
rodzic
e2b72e6b57
commit
75018e1ad0
|
@ -1,3 +1,6 @@
|
||||||
|
2004-03-15 Oliver Rauch <oliver.rauch@rauch-domain.de>
|
||||||
|
* backend/umax: bugfix for sense_handler and do_calibration
|
||||||
|
|
||||||
2004-03-15 Stéphane Voltz <svoltz@wanadoo.fr>
|
2004-03-15 Stéphane Voltz <svoltz@wanadoo.fr>
|
||||||
|
|
||||||
* backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c
|
* backend/umax_pp_low.c backend/umax_pp_low.h backend/umax_pp_mid.c
|
||||||
|
|
|
@ -933,7 +933,7 @@ static scsiblk request_sense = { request_senseC, sizeof(request_senseC) };
|
||||||
|
|
||||||
#define get_RS_scanner_error_code(b) b[0x15]
|
#define get_RS_scanner_error_code(b) b[0x15]
|
||||||
#define get_RS_SCC_condition_code(b) b[0x17]
|
#define get_RS_SCC_condition_code(b) b[0x17]
|
||||||
#define get_RS_SCC_calibration_width(b) getnbyte(b+0x18, 4)
|
#define get_RS_SCC_calibration_bytesperline(b) getnbyte(b+0x18, 4)
|
||||||
#define get_RS_SCC_calibration_lines(b) getnbyte(b+0x1c, 2)
|
#define get_RS_SCC_calibration_lines(b) getnbyte(b+0x1c, 2)
|
||||||
#define get_RS_SCC_calibration_bytespp(b) b[0x1e]
|
#define get_RS_SCC_calibration_bytespp(b) b[0x1e]
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#define BUILD 43
|
#define BUILD 44
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -888,6 +888,11 @@ static SANE_Status sense_handler(int scsi_fd, unsigned char *result, void *arg)
|
||||||
|
|
||||||
DBG(DBG_sense, "check condition sense: %s\n", sense_str[sensekey]);
|
DBG(DBG_sense, "check condition sense: %s\n", sense_str[sensekey]);
|
||||||
|
|
||||||
|
/* when we reach here then we have no valid data in buffer[0] */
|
||||||
|
/* but it may be helpful to have the result data in buffer[0] */
|
||||||
|
memset(dev->buffer[0], 0, rs_return_block_size); /* clear sense data buffer */
|
||||||
|
memcpy(dev->buffer[0], result, len+1); /* copy sense data to buffer */
|
||||||
|
|
||||||
if (len > 0x15)
|
if (len > 0x15)
|
||||||
{
|
{
|
||||||
int scanner_error = get_RS_scanner_error_code(result);
|
int scanner_error = get_RS_scanner_error_code(result);
|
||||||
|
@ -2455,11 +2460,11 @@ static SANE_Status umax_do_calibration(Umax_Device *dev)
|
||||||
|
|
||||||
DBG(DBG_info,"driver is doing calibration\n");
|
DBG(DBG_info,"driver is doing calibration\n");
|
||||||
|
|
||||||
memset(dev->buffer[0], 0, rs_return_block_size); /* clear sense data buffer */
|
|
||||||
|
|
||||||
if (umax_execute_request_sense)
|
if (umax_execute_request_sense)
|
||||||
{
|
{
|
||||||
DBG(DBG_info,"request sense call is enabled\n");
|
DBG(DBG_info,"request sense call is enabled\n");
|
||||||
|
memset(dev->buffer[0], 0, rs_return_block_size); /* clear sense data buffer */
|
||||||
umax_do_request_sense(dev); /* new request-sense call to get all data */
|
umax_do_request_sense(dev); /* new request-sense call to get all data */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2543,9 +2548,9 @@ static SANE_Status umax_do_calibration(Umax_Device *dev)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
width = get_RS_SCC_calibration_width(dev->buffer[0]);
|
|
||||||
lines = get_RS_SCC_calibration_lines(dev->buffer[0]);
|
lines = get_RS_SCC_calibration_lines(dev->buffer[0]);
|
||||||
bytespp = get_RS_SCC_calibration_bytespp(dev->buffer[0]);
|
bytespp = get_RS_SCC_calibration_bytespp(dev->buffer[0]);
|
||||||
|
width = get_RS_SCC_calibration_bytesperline(dev->buffer[0]) / bytespp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->calibration_bytespp > 0) /* correct bytespp if necessary and driver knows about it or user did select it */
|
if (dev->calibration_bytespp > 0) /* correct bytespp if necessary and driver knows about it or user did select it */
|
||||||
|
|
Ładowanie…
Reference in New Issue