kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'xerox_mfp-no-usb-clear_halt-workaround' into 'master'
xerox_mfp: skip ENDPOINT CLEAR HALT command by default. #706 See merge request sane-project/backends!799merge-requests/569/head
commit
b38e620c23
|
@ -21,6 +21,21 @@
|
||||||
|
|
||||||
extern int sanei_debug_xerox_mfp;
|
extern int sanei_debug_xerox_mfp;
|
||||||
|
|
||||||
|
static int
|
||||||
|
xerox_need_clear_halt()
|
||||||
|
{
|
||||||
|
char *env;
|
||||||
|
int workaround = 0;
|
||||||
|
|
||||||
|
env = getenv("SANE_XEROX_USB_HALT_WORKAROUND");
|
||||||
|
if (env) {
|
||||||
|
workaround = atoi(env);
|
||||||
|
DBG(5, "xerox_need_clear_halt: workaround: %d\n", workaround);
|
||||||
|
return workaround;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
usb_dev_request(struct device *dev,
|
usb_dev_request(struct device *dev,
|
||||||
SANE_Byte *cmd, size_t cmdlen,
|
SANE_Byte *cmd, size_t cmdlen,
|
||||||
|
@ -70,7 +85,9 @@ usb_dev_open(struct device *dev)
|
||||||
dev->dn = -1;
|
dev->dn = -1;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
sanei_usb_clear_halt(dev->dn);
|
if (xerox_need_clear_halt()) {
|
||||||
|
sanei_usb_clear_halt(dev->dn);
|
||||||
|
}
|
||||||
return SANE_STATUS_GOOD;
|
return SANE_STATUS_GOOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +109,9 @@ usb_dev_close(struct device *dev)
|
||||||
ret_cancel(dev, 0);
|
ret_cancel(dev, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
sanei_usb_clear_halt(dev->dn); /* unstall for next users */
|
if (xerox_need_clear_halt()) {
|
||||||
|
sanei_usb_clear_halt(dev->dn); /* unstall for next users */
|
||||||
|
}
|
||||||
sanei_usb_close(dev->dn);
|
sanei_usb_close(dev->dn);
|
||||||
dev->dn = -1;
|
dev->dn = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,6 +178,15 @@ setting the environment variable
|
||||||
to 1. This may work around issues which happen with particular kernel
|
to 1. This may work around issues which happen with particular kernel
|
||||||
versions. Example:
|
versions. Example:
|
||||||
.I export SANE_USB_WORKAROUND=1.
|
.I export SANE_USB_WORKAROUND=1.
|
||||||
|
.TP
|
||||||
|
.B SANE_XEROX_USB_HALT_WORKAROUND
|
||||||
|
If your old (pre-2010) Xerox / Samsung / HP scanner is detected
|
||||||
|
only once and subsequent usage requires replugging the cable, try
|
||||||
|
setting the environment variable
|
||||||
|
.B SANE_XEROX_USB_HALT_WORKAROUND
|
||||||
|
to 1. This may work around issues which happen with particular USB
|
||||||
|
controllers. Example:
|
||||||
|
.I export SANE_XEROX_USB_HALT_WORKAROUND=1.
|
||||||
|
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR sane (7),
|
.BR sane (7),
|
||||||
|
|
Ładowanie…
Reference in New Issue