fujitsu backend v134

rewrite init_vpd for scanners which fail to report overscan correctly
update description and man page to match
rebuild po files with updated line numbers
merge-requests/43/head
m. allan noah 2019-02-23 15:16:32 -05:00
rodzic 057a10e984
commit 156f7c9bd4
27 zmienionych plików z 6840 dodań i 6588 usunięć

Wyświetl plik

@ -276,7 +276,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define get_IN_ipc_ipc3(in) getbitfield(in+0x59, 1, 5) #define get_IN_ipc_ipc3(in) getbitfield(in+0x59, 1, 5)
#define get_IN_ipc_rotation(in) getbitfield(in+0x59, 1, 4) #define get_IN_ipc_rotation(in) getbitfield(in+0x59, 1, 4)
#define get_IN_ipc_hybrid_crop_deskew(in) getbitfield(in+0x59, 1, 3) #define get_IN_ipc_hybrid_crop_deskew(in) getbitfield(in+0x59, 1, 3)
#define get_IN_ipc_ipc2_byte67(in) getbitfield(in+0x59, 1, 0) #define get_IN_vpd_thru_byte_6f(in) getbitfield(in+0x59, 1, 0)
#define get_IN_compression_MH(in) getbitfield(in+0x5a, 1, 7) #define get_IN_compression_MH(in) getbitfield(in+0x5a, 1, 7)
#define get_IN_compression_MR(in) getbitfield(in+0x5a, 1, 6) #define get_IN_compression_MR(in) getbitfield(in+0x5a, 1, 6)
@ -383,9 +383,6 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define get_IN_op_halt(in) getbitfield(in+0x7a, 1, 7) #define get_IN_op_halt(in) getbitfield(in+0x7a, 1, 7)
/* some scanners need evpd inquiry data manipulated */
#define set_IN_page_length(in,val) in[0x04]=val
/* ==================================================================== */ /* ==================================================================== */
/* page codes used by mode_sense and mode_select */ /* page codes used by mode_sense and mode_select */
#define MS_pc_unk 0x2c /* Used by iX500 */ #define MS_pc_unk 0x2c /* Used by iX500 */

Wyświetl plik

@ -600,6 +600,9 @@
- initial support for fi-7600/7700 - initial support for fi-7600/7700
- autodetect various double feed capabilities using VPD - autodetect various double feed capabilities using VPD
- call send_lut if we are using a downloaded gamma table - call send_lut if we are using a downloaded gamma table
v134 2019-02-23, MAN
- rewrite init_vpd for scanners which fail to report
overscan correctly
SANE FLOW DIAGRAM SANE FLOW DIAGRAM
@ -649,7 +652,7 @@
#include "fujitsu.h" #include "fujitsu.h"
#define DEBUG 1 #define DEBUG 1
#define BUILD 133 #define BUILD 134
/* values for SANE_DEBUG_FUJITSU env var: /* values for SANE_DEBUG_FUJITSU env var:
- errors 5 - errors 5
@ -1238,6 +1241,8 @@ init_vpd (struct fujitsu *s)
unsigned char in[INQUIRY_vpd_len]; unsigned char in[INQUIRY_vpd_len];
size_t inLen = INQUIRY_vpd_len; size_t inLen = INQUIRY_vpd_len;
int payload_len, payload_off;
DBG (10, "init_vpd: start\n"); DBG (10, "init_vpd: start\n");
/* get EVPD */ /* get EVPD */
@ -1254,18 +1259,28 @@ init_vpd (struct fujitsu *s)
in, &inLen in, &inLen
); );
/*FIXME no vpd, set some defaults? */
if (ret != SANE_STATUS_GOOD && ret != SANE_STATUS_EOF) {
DBG (5, "init_vpd: Your scanner does not support VPD?\n");
DBG (5, "init_vpd: Please contact kitno455 at gmail dot com\n");
DBG (5, "init_vpd: with details of your scanner model.\n");
return ret;
}
/* In byte 4, the scanner sends the length of the remainder of
* the payload. But, this value is often bogus. */
payload_len = get_IN_page_length(in);
DBG (15, "init_vpd: length=%0x\n", payload_len);
/* M3099 gives all data, but wrong length */ /* M3099 gives all data, but wrong length */
if (strstr (s->model_name, "M3099") if (strstr (s->model_name, "M3099") && payload_len == 0x19){
&& (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF)
&& get_IN_page_length (in) == 0x19){
DBG (5, "init_vpd: M3099 repair\n"); DBG (5, "init_vpd: M3099 repair\n");
set_IN_page_length(in,0x5f); payload_len = 0x5f;
} }
/* M3097G has short vpd, fill in missing part */ /* M3097G has short vpd, fill in missing part */
else if (strstr (s->model_name, "M3097G") else if (strstr (s->model_name, "M3097G") && payload_len == 0x19){
&& (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF)
&& get_IN_page_length (in) == 0x19){
unsigned char vpd3097g[] = { unsigned char vpd3097g[] = {
0, 0, 0, 0,
0xc2, 0x08, 0, 0, 0, 0, 0, 0, 0xed, 0xbf, 0, 0, 0, 0, 0, 0, 0xc2, 0x08, 0, 0, 0, 0, 0, 0, 0xed, 0xbf, 0, 0, 0, 0, 0, 0,
@ -1274,8 +1289,9 @@ init_vpd (struct fujitsu *s)
0, 0, 0xff, 0xff, 0xff, 0, 0x45, 0x35, 0, 0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0, 0x45, 0x35, 0, 0xe0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0 0, 0, 0, 0
}; };
DBG (5, "init_vpd: M3097G repair\n"); DBG (5, "init_vpd: M3097G repair\n");
set_IN_page_length(in,0x5f); payload_len = 0x5f;
memcpy(in+0x1e,vpd3097g,sizeof(vpd3097g)); memcpy(in+0x1e,vpd3097g,sizeof(vpd3097g));
/*IPC*/ /*IPC*/
@ -1304,12 +1320,31 @@ init_vpd (struct fujitsu *s)
} }
} }
DBG (15, "init_vpd: length=%0x\n",get_IN_page_length (in)); /* all other known scanners have at least 0x5f,
* less would require software changes like above */
else if (payload_len < 0x5f) {
DBG (5, "init_vpd: Your scanner supports only partial VPD?\n");
DBG (5, "init_vpd: Please contact kitno455 at gmail dot com\n");
DBG (5, "init_vpd: with details of your scanner model.\n");
return SANE_STATUS_INVAL;
}
/* This scanner supports vital product data. /* Special case- some scanners will under-report the amount of
* Use this data to set dpi-lists etc. */ * valid vpd that they send, and return the default length.
if (ret == SANE_STATUS_GOOD || ret == SANE_STATUS_EOF) { * Adding 4 more bytes allows us to include the overscan info.
* Scanners that don't support overscan seem to have all zeros
* in these bytes, so no harm is done.
* This may be an 'off-by-four' error in the firmware. */
else if (payload_len == 0x5f){
payload_len += 4;
}
/* Having an offset from the beginning of the payload
* is more useful than from byte 4, as that matches the
* documentation more closely. */
payload_off = payload_len + 4;
/* everything that appears in bytes 0 to 0x1d */
DBG (15, "standard options\n"); DBG (15, "standard options\n");
s->basic_x_res = get_IN_basic_x_res (in); s->basic_x_res = get_IN_basic_x_res (in);
@ -1411,9 +1446,7 @@ init_vpd (struct fujitsu *s)
s->can_mode[MODE_COLOR] = get_IN_multilevel_rgb (in); s->can_mode[MODE_COLOR] = get_IN_multilevel_rgb (in);
DBG (15, " color_grayscale: %d\n", s->can_mode[MODE_COLOR]); DBG (15, " color_grayscale: %d\n", s->can_mode[MODE_COLOR]);
/* now we look at vendor specific data */ /* now we look at vendor specific data in bytes 0x1e onward */
if (get_IN_page_length (in) >= 0x5f) {
DBG (15, "vendor options\n"); DBG (15, "vendor options\n");
s->has_adf = get_IN_adf(in); s->has_adf = get_IN_adf(in);
@ -1628,7 +1661,11 @@ init_vpd (struct fujitsu *s)
s->has_hybrid_crop_deskew = get_IN_ipc_hybrid_crop_deskew(in); s->has_hybrid_crop_deskew = get_IN_ipc_hybrid_crop_deskew(in);
DBG (15, " hybrid crop deskew: %d\n", s->has_hybrid_crop_deskew); DBG (15, " hybrid crop deskew: %d\n", s->has_hybrid_crop_deskew);
DBG (15, " ipc2 byte 67: %d\n", get_IN_ipc_ipc2_byte67(in)); /* this one is weird, overrides the payload length from scanner */
DBG (15, " vpd extends to byte 6f: %d\n", get_IN_vpd_thru_byte_6f(in));
if(get_IN_vpd_thru_byte_6f(in) && payload_off < 0x6f){
payload_off = 0x6f;
}
/* compression modes */ /* compression modes */
s->has_comp_MH = get_IN_compression_MH (in); s->has_comp_MH = get_IN_compression_MH (in);
@ -1671,8 +1708,6 @@ init_vpd (struct fujitsu *s)
s->endorser_type_f = get_IN_endorser_f_type(in); s->endorser_type_f = get_IN_endorser_f_type(in);
DBG (15, " back endorser type: %d\n", s->endorser_type_f); DBG (15, " back endorser type: %d\n", s->endorser_type_f);
/*not all scanners go this far*/
if (get_IN_page_length (in) >= 0x67-5) {
DBG (15, " connection type: %d\n", get_IN_connection(in)); DBG (15, " connection type: %d\n", get_IN_connection(in));
DBG (15, " endorser ext: %d\n", get_IN_endorser_type_ext(in)); DBG (15, " endorser ext: %d\n", get_IN_endorser_type_ext(in));
@ -1686,32 +1721,42 @@ init_vpd (struct fujitsu *s)
s->os_y_basic = get_IN_y_overscan_size(in); s->os_y_basic = get_IN_y_overscan_size(in);
DBG (15, " vertical overscan: %d\n", s->os_y_basic); DBG (15, " vertical overscan: %d\n", s->os_y_basic);
}
if (get_IN_page_length (in) >= 0x70-5) { /* not all scanners go this far */
if (payload_off >= 0x68) {
DBG (15, " default bg adf b: %d\n", get_IN_default_bg_adf_b(in)); DBG (15, " default bg adf b: %d\n", get_IN_default_bg_adf_b(in));
DBG (15, " default bg adf f: %d\n", get_IN_default_bg_adf_f(in)); DBG (15, " default bg adf f: %d\n", get_IN_default_bg_adf_f(in));
DBG (15, " default bg fb: %d\n", get_IN_default_bg_fb(in)); DBG (15, " default bg fb: %d\n", get_IN_default_bg_fb(in));
}
if (payload_off >= 0x69) {
DBG (15, " auto color: %d\n", get_IN_auto_color(in)); DBG (15, " auto color: %d\n", get_IN_auto_color(in));
DBG (15, " blank skip: %d\n", get_IN_blank_skip(in)); DBG (15, " blank skip: %d\n", get_IN_blank_skip(in));
DBG (15, " multi image: %d\n", get_IN_multi_image(in)); DBG (15, " multi image: %d\n", get_IN_multi_image(in));
DBG (15, " f b type indep: %d\n", get_IN_f_b_type_indep(in)); DBG (15, " f b type indep: %d\n", get_IN_f_b_type_indep(in));
DBG (15, " f b res indep: %d\n", get_IN_f_b_res_indep(in)); DBG (15, " f b res indep: %d\n", get_IN_f_b_res_indep(in));
}
if (payload_off >= 0x6a) {
DBG (15, " dropout spec: %d\n", get_IN_dropout_spec(in)); DBG (15, " dropout spec: %d\n", get_IN_dropout_spec(in));
DBG (15, " dropout non: %d\n", get_IN_dropout_non(in)); DBG (15, " dropout non: %d\n", get_IN_dropout_non(in));
DBG (15, " dropout white: %d\n", get_IN_dropout_white(in)); DBG (15, " dropout white: %d\n", get_IN_dropout_white(in));
}
if (payload_off >= 0x6d) {
DBG (15, " skew check: %d\n", get_IN_skew_check(in)); DBG (15, " skew check: %d\n", get_IN_skew_check(in));
DBG (15, " new feed roller: %d\n", get_IN_new_fd_roll(in)); DBG (15, " new feed roller: %d\n", get_IN_new_fd_roll(in));
s->has_adv_paper_prot = get_IN_paper_prot_2(in); s->has_adv_paper_prot = get_IN_paper_prot_2(in);
DBG (15, " paper protection: %d\n", s->has_adv_paper_prot); DBG (15, " paper protection: %d\n", s->has_adv_paper_prot);
} }
if (get_IN_page_length (in) > 0x70-5) { /* this one is weird, overrides the payload length from scanner,
* but the enlarged area is just null bytes, so we ignore this */
if (payload_off >= 0x6f) {
DBG (15, " extra evpd length: %d\n", get_IN_evpd_len(in));
}
if (payload_off >= 0x70) {
DBG (15, " paper count: %d\n", get_IN_paper_count(in)); DBG (15, " paper count: %d\n", get_IN_paper_count(in));
DBG (15, " paper number: %d\n", get_IN_paper_number(in)); DBG (15, " paper number: %d\n", get_IN_paper_number(in));
DBG (15, " ext send to: %d\n", get_IN_ext_send_to(in)); DBG (15, " ext send to: %d\n", get_IN_ext_send_to(in));
@ -1723,9 +1768,13 @@ init_vpd (struct fujitsu *s)
DBG (15, " pause panel: %d\n", get_IN_pause_panel(in)); DBG (15, " pause panel: %d\n", get_IN_pause_panel(in));
DBG (15, " pause conf: %d\n", get_IN_pause_conf(in)); DBG (15, " pause conf: %d\n", get_IN_pause_conf(in));
DBG (15, " hq print: %d\n", get_IN_hq_print(in)); DBG (15, " hq print: %d\n", get_IN_hq_print(in));
}
if (payload_off >= 0x71) {
DBG (15, " ext GHS len: %d\n", get_IN_ext_GHS_len(in)); DBG (15, " ext GHS len: %d\n", get_IN_ext_GHS_len(in));
}
if (payload_off >= 0x72) {
DBG (15, " smbc func: %d\n", get_IN_smbc_func(in)); DBG (15, " smbc func: %d\n", get_IN_smbc_func(in));
DBG (15, " imprint chk b: %d\n", get_IN_imprint_chk_b(in)); DBG (15, " imprint chk b: %d\n", get_IN_imprint_chk_b(in));
DBG (15, " imprint chk f: %d\n", get_IN_imprint_chk_f(in)); DBG (15, " imprint chk f: %d\n", get_IN_imprint_chk_f(in));
@ -1733,48 +1782,46 @@ init_vpd (struct fujitsu *s)
s->has_df_recovery = get_IN_mf_recover_lvl(in); s->has_df_recovery = get_IN_mf_recover_lvl(in);
DBG (15, " mf recover lvl: %d\n", s->has_df_recovery); DBG (15, " mf recover lvl: %d\n", s->has_df_recovery);
}
if (payload_off >= 0x73) {
DBG (15, " first read time: %d\n", get_IN_first_read_time(in)); DBG (15, " first read time: %d\n", get_IN_first_read_time(in));
DBG (15, " div scanning: %d\n", get_IN_div_scanning(in)); DBG (15, " div scanning: %d\n", get_IN_div_scanning(in));
DBG (15, " start job: %d\n", get_IN_start_job(in)); DBG (15, " start job: %d\n", get_IN_start_job(in));
DBG (15, " lifetime log: %d\n", get_IN_lifetime_log(in)); DBG (15, " lifetime log: %d\n", get_IN_lifetime_log(in));
DBG (15, " imff save rest: %d\n", get_IN_imff_save_rest(in)); DBG (15, " imff save rest: %d\n", get_IN_imff_save_rest(in));
DBG (15, " wide scsi type: %d\n", get_IN_wide_scsi_type(in)); DBG (15, " wide scsi type: %d\n", get_IN_wide_scsi_type(in));
}
if (payload_off >= 0x74) {
DBG (15, " lut hybrid crop: %d\n", get_IN_lut_hybrid_crop(in)); DBG (15, " lut hybrid crop: %d\n", get_IN_lut_hybrid_crop(in));
DBG (15, " over under amt: %d\n", get_IN_over_under_amt(in)); DBG (15, " over under amt: %d\n", get_IN_over_under_amt(in));
DBG (15, " rgb lut: %d\n", get_IN_rgb_lut(in)); DBG (15, " rgb lut: %d\n", get_IN_rgb_lut(in));
DBG (15, " num lut dl: %d\n", get_IN_num_lut_dl(in)); DBG (15, " num lut dl: %d\n", get_IN_num_lut_dl(in));
}
/* Various items below are poorly documented or missing */
if (payload_off >= 0x76) {
s->has_off_mode = get_IN_erp_lot6_supp(in); s->has_off_mode = get_IN_erp_lot6_supp(in);
DBG (15, " ErP Lot6 (power off timer): %d\n", s->has_off_mode); DBG (15, " ErP Lot6 (power off timer): %d\n", s->has_off_mode);
DBG (15, " sync next feed: %d\n", get_IN_sync_next_feed(in)); DBG (15, " sync next feed: %d\n", get_IN_sync_next_feed(in));
}
if (payload_off >= 0x79) {
DBG (15, " battery: %d\n", get_IN_battery(in));
DBG (15, " battery save: %d\n", get_IN_battery_save(in));
DBG (15, " object position reverse: %d\n", get_IN_op_reverse(in));
}
if (payload_off >= 0x7a) {
s->has_op_halt = get_IN_op_halt(in); s->has_op_halt = get_IN_op_halt(in);
DBG (15, " object position halt: %d\n", s->has_op_halt); DBG (15, " object position halt: %d\n", s->has_op_halt);
} }
ret = SANE_STATUS_GOOD;
}
/*FIXME no vendor vpd, set some defaults? */
else{
DBG (5, "init_vpd: Your scanner supports only partial VPD?\n");
DBG (5, "init_vpd: Please contact kitno455 at gmail dot com\n");
DBG (5, "init_vpd: with details of your scanner model.\n");
ret = SANE_STATUS_INVAL;
}
}
/*FIXME no vpd, set some defaults? */
else{
DBG (5, "init_vpd: Your scanner does not support VPD?\n");
DBG (5, "init_vpd: Please contact kitno455 at gmail dot com\n");
DBG (5, "init_vpd: with details of your scanner model.\n");
}
DBG (10, "init_vpd: finish\n"); DBG (10, "init_vpd: finish\n");
return ret; return SANE_STATUS_GOOD;
} }
static SANE_Status static SANE_Status

Wyświetl plik

@ -12,9 +12,9 @@
:backend "fujitsu" ; name of backend :backend "fujitsu" ; name of backend
:url "http://www.thebility.com/fujitsu/" :url "http://www.thebility.com/fujitsu/"
:version "133" ; version of backend :version "134" ; version of backend
:manpage "sane-fujitsu" ; name of manpage (if it exists) :manpage "sane-fujitsu" ; name of manpage (if it exists)
:comment "Backend updated for SANE release 1.0.26, see sane-fujitsu manpage" :comment "Backend updated for SANE release 1.0.28, see sane-fujitsu manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api

Wyświetl plik

@ -10,7 +10,7 @@ The
library implements a SANE (Scanner Access Now Easy) backend which library implements a SANE (Scanner Access Now Easy) backend which
provides access to most Fujitsu flatbed and ADF scanners. provides access to most Fujitsu flatbed and ADF scanners.
This document describes backend version 133, which shipped with SANE 1.0.26. This document describes backend version 134, which shipped with SANE 1.0.28.
.SH SUPPORTED HARDWARE .SH SUPPORTED HARDWARE
This version supports every known model which speaks the Fujitsu SCSI and This version supports every known model which speaks the Fujitsu SCSI and
@ -40,7 +40,7 @@ ScanStation M3093E/DE/EX fi\-4110EOX/2
ScanPartner M3096EX fi\-4010CU ScanPartner M3096EX fi\-4010CU
SP\-Jr M3097E+/DE S300/S300M SP\-Jr M3097E+/DE S300/S300M
SP\-10/10C M3099A/EH/EX S1300/S1100 SP\-10/10C M3099A/EH/EX S1300/S1100
SP\-15C/300C fi\-60F SP\-15C/300C fi\-60F/65F
SP\-600C/620C fi\-5015C SP\-600C/620C fi\-5015C
SP\-2x/3x SP\-2x/3x
.fi .fi

513
po/bg.po

Plik diff jest za duży Load Diff

513
po/ca.po

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

513
po/cs.po

Plik diff jest za duży Load Diff

513
po/da.po

Plik diff jest za duży Load Diff

513
po/de.po

Plik diff jest za duży Load Diff

Plik diff jest za duży Load Diff

513
po/eo.po

Plik diff jest za duży Load Diff

513
po/es.po

Plik diff jest za duży Load Diff

513
po/fi.po

Plik diff jest za duży Load Diff

513
po/fr.po

Plik diff jest za duży Load Diff

513
po/gl.po

Plik diff jest za duży Load Diff

1086
po/he.po

Plik diff jest za duży Load Diff

513
po/hu.po

Plik diff jest za duży Load Diff

513
po/it.po

Plik diff jest za duży Load Diff

513
po/ja.po

Plik diff jest za duży Load Diff

513
po/nb.po

Plik diff jest za duży Load Diff

513
po/nl.po

Plik diff jest za duży Load Diff

513
po/pl.po

Plik diff jest za duży Load Diff

513
po/pt.po

Plik diff jest za duży Load Diff

513
po/ru.po

Plik diff jest za duży Load Diff

513
po/sv.po

Plik diff jest za duży Load Diff

513
po/uk.po

Plik diff jest za duży Load Diff