summaryrefslogtreecommitdiff
path: root/tools/mustek600iin-off.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
commit882fd010527b8d8823f09e19edbed3746265fa08 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /tools/mustek600iin-off.c
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parente0d94cf4d39395df1e2c6bb4d967200298c13881 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tools/mustek600iin-off.c')
-rw-r--r--tools/mustek600iin-off.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/tools/mustek600iin-off.c b/tools/mustek600iin-off.c
index 4d89bdd..5fb7a61 100644
--- a/tools/mustek600iin-off.c
+++ b/tools/mustek600iin-off.c
@@ -26,6 +26,7 @@
#include "../include/sane/config.h"
#include "../include/sane/sanei.h"
+#include "../include/sane/sanei_directio.h"
#define MUSTEK_CONF STRINGIFY(PATH_SANE_CONFIG_DIR) "/mustek.conf"
#define PORT_DEV "/dev/port"
@@ -39,28 +40,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_IO_H
-# include <sys/io.h> /* use where available (glibc 2.x, for example) */
-#elif HAVE_ASM_IO_H
-# include <asm/io.h> /* ugly, but backwards compatible */
-#elif defined(__i386__) && defined (__GNUC__)
-
-static __inline__ void
-outb (u_char value, u_long port)
-{
- __asm__ __volatile__ ("outb %0,%1"::"a" (value), "d" ((u_short) port));
-}
-
-static __inline__ u_char
-inb (u_long port)
-{
- u_char value;
-
- __asm__ __volatile__ ("inb %1,%0":"=a" (value):"d" ((u_short) port));
- return value;
-}
-#endif
-
char *Mustek_Conf = MUSTEK_CONF;
int allowed_ports[] =
@@ -165,9 +144,9 @@ main (int argc, char **argv)
fprintf (stderr, "using control port address 0x%03x\n", portaddr);
/* try to get I/O permission from the kernel */
- if (ioperm (portaddr, 1, 1) == 0)
+ if (sanei_ioperm (portaddr, 1, 1) == 0)
{
- outb (0x00, portaddr);
+ sanei_outb (portaddr, 0x00);
}
/* else try to open /dev/port to access the I/O port */
else if ((pfd = open (PORT_DEV, O_RDWR, 0666)) >= 0)