diff --git a/backend/Makefile.am b/backend/Makefile.am index 318fce084..61b40cb68 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -1538,7 +1538,8 @@ libsane_qcam_la_LIBADD = $(COMMON_LIBS) \ ../sanei/sanei_constrain_value.lo \ ../sanei/sanei_config.lo \ sane_strstatus.lo \ - ../sanei/sanei_pio.lo + ../sanei/sanei_pio.lo \ + ../sanei/sanei_directio.lo EXTRA_DIST += qcam.conf.in diff --git a/backend/qcam.c b/backend/qcam.c index 9d550555b..d3799d79f 100644 --- a/backend/qcam.c +++ b/backend/qcam.c @@ -191,23 +191,13 @@ static const SANE_Range odd_bw_x_range = { 1, 335, 2 }; static const SANE_Range bw_y_range = { 0, 241, 1 }; static const SANE_Range odd_bw_y_range = { 1, 242, 1 }; -#if defined(HAVE_SYS_IO_H) || defined(HAVE_ASM_IO_H) || defined (HAVE_SYS_HW_H) +#include "../include/sane/sanei_directio.h" -#ifdef HAVE_SYS_IO_H -# include /* GNU libc based OS */ -#elif HAVE_ASM_IO_H -# include /* older Linux */ -#elif HAVE_SYS_HW_H -# include /* OS/2 */ -#endif - -#endif /* || || */ - -#define read_lpdata(d) inb ((d)->port) -#define read_lpstatus(d) inb ((d)->port + 1) -#define read_lpcontrol(d) inb ((d)->port + 2) -#define write_lpdata(d,v) outb ((v), (d)->port) -#define write_lpcontrol(d,v) outb ((v), (d)->port + 2) +#define read_lpdata(d) sanei_inb ((d)->port) +#define read_lpstatus(d) sanei_inb ((d)->port + 1) +#define read_lpcontrol(d) sanei_inb ((d)->port + 2) +#define write_lpdata(d,v) sanei_outb ((d)->port, (v)) +#define write_lpcontrol(d,v) sanei_outb ((d)->port + 2, (v)) static SANE_Status @@ -217,7 +207,7 @@ enable_ports (QC_Device * q) if (q->port < 0x278 || q->port > 0x3bc) return SANE_STATUS_INVAL; - if (ioperm (q->port, 3, 1) < 0) + if (sanei_ioperm (q->port, 3, 1) < 0) return SANE_STATUS_INVAL; return SANE_STATUS_GOOD; @@ -226,7 +216,7 @@ enable_ports (QC_Device * q) static SANE_Status disable_ports (QC_Device * q) { - if (ioperm (q->port, 3, 0) < 0) + if (sanei_ioperm (q->port, 3, 0) < 0) return SANE_STATUS_INVAL; return SANE_STATUS_GOOD;