aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/kdrive/linux
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/kdrive/linux')
-rw-r--r--xorg-server/hw/kdrive/linux/Makefile.am8
-rw-r--r--xorg-server/hw/kdrive/linux/Makefile.in115
-rw-r--r--xorg-server/hw/kdrive/linux/bus.c3
-rw-r--r--xorg-server/hw/kdrive/linux/evdev.c22
-rw-r--r--xorg-server/hw/kdrive/linux/keyboard.c290
-rw-r--r--xorg-server/hw/kdrive/linux/linux.c4
-rw-r--r--xorg-server/hw/kdrive/linux/mouse.c9
-rw-r--r--xorg-server/hw/kdrive/linux/ms.c5
-rw-r--r--xorg-server/hw/kdrive/linux/ps2.c5
-rw-r--r--xorg-server/hw/kdrive/linux/tslib.c5
10 files changed, 204 insertions, 262 deletions
diff --git a/xorg-server/hw/kdrive/linux/Makefile.am b/xorg-server/hw/kdrive/linux/Makefile.am
index 6380bd5ab..be07561ef 100644
--- a/xorg-server/hw/kdrive/linux/Makefile.am
+++ b/xorg-server/hw/kdrive/linux/Makefile.am
@@ -4,22 +4,18 @@ INCLUDES = \
AM_CFLAGS = -DHAVE_DIX_CONFIG_H
-noinst_LIBRARIES = liblinux.a
+noinst_LTLIBRARIES = liblinux.la
if TSLIB
TSLIB_C = tslib.c
endif
-if KDRIVE_HW
KDRIVE_HW_SOURCES = \
- agp.c \
- agp.h \
evdev.c \
keyboard.c \
linux.c
-endif
-liblinux_a_SOURCES = \
+liblinux_la_SOURCES = \
bus.c \
klinux.h \
mouse.c \
diff --git a/xorg-server/hw/kdrive/linux/Makefile.in b/xorg-server/hw/kdrive/linux/Makefile.in
index 717965e53..c0e625176 100644
--- a/xorg-server/hw/kdrive/linux/Makefile.in
+++ b/xorg-server/hw/kdrive/linux/Makefile.in
@@ -37,8 +37,11 @@ host_triplet = @host@
subdir = hw/kdrive/linux
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -48,21 +51,19 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
- $(top_builddir)/include/kdrive-config.h
+ $(top_builddir)/include/kdrive-config.h \
+ $(top_builddir)/include/version-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-liblinux_a_AR = $(AR) $(ARFLAGS)
-liblinux_a_LIBADD =
-am__liblinux_a_SOURCES_DIST = bus.c klinux.h mouse.c ms.c ps2.c agp.c \
- agp.h evdev.c keyboard.c linux.c tslib.c
-@KDRIVE_HW_TRUE@am__objects_1 = agp.$(OBJEXT) evdev.$(OBJEXT) \
-@KDRIVE_HW_TRUE@ keyboard.$(OBJEXT) linux.$(OBJEXT)
-@TSLIB_TRUE@am__objects_2 = tslib.$(OBJEXT)
-am_liblinux_a_OBJECTS = bus.$(OBJEXT) mouse.$(OBJEXT) ms.$(OBJEXT) \
- ps2.$(OBJEXT) $(am__objects_1) $(am__objects_2)
-liblinux_a_OBJECTS = $(am_liblinux_a_OBJECTS)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+liblinux_la_LIBADD =
+am__liblinux_la_SOURCES_DIST = bus.c klinux.h mouse.c ms.c ps2.c \
+ evdev.c keyboard.c linux.c tslib.c
+am__objects_1 = evdev.lo keyboard.lo linux.lo
+@TSLIB_TRUE@am__objects_2 = tslib.lo
+am_liblinux_la_OBJECTS = bus.lo mouse.lo ms.lo ps2.lo $(am__objects_1) \
+ $(am__objects_2)
+liblinux_la_OBJECTS = $(am_liblinux_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -73,8 +74,8 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(liblinux_a_SOURCES)
-DIST_SOURCES = $(am__liblinux_a_SOURCES_DIST)
+SOURCES = $(liblinux_la_SOURCES)
+DIST_SOURCES = $(am__liblinux_la_SOURCES_DIST)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -83,6 +84,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
+AM_MAKEFLAGS = @AM_MAKEFLAGS@
APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@
APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
@@ -103,9 +105,12 @@ CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+CXX = @CXX@
CYGPATH_W = @CYGPATH_W@
DARWIN_LIBS = @DARWIN_LIBS@
DBUS_CFLAGS = @DBUS_CFLAGS@
@@ -134,7 +139,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
DRIPROTO_LIBS = @DRIPROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_CFLAGS = @DRI_CFLAGS@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DRI_LIBS = @DRI_LIBS@
DSYMUTIL = @DSYMUTIL@
DTRACE = @DTRACE@
DUMPBIN = @DUMPBIN@
@@ -143,9 +150,13 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GL_CFLAGS = @GL_CFLAGS@
@@ -184,12 +195,13 @@ LTCOMPILE = @LTCOMPILE@
LTCXXCOMPILE = @LTCXXCOMPILE@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
+MAIN_LIB = @MAIN_LIB@
+MAKEFLAGS = @MAKEFLAGS@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
MAKE_PS = @MAKE_PS@
MAKE_TEXT = @MAKE_TEXT@
-MESA_SOURCE = @MESA_SOURCE@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
@@ -209,7 +221,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
@@ -219,6 +230,7 @@ PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PROJECTROOT = @PROJECTROOT@
PS2PDF = @PS2PDF@
+Q = @Q@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
@@ -232,11 +244,10 @@ STRIP = @STRIP@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
-VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
-VENDOR_NAME = @VENDOR_NAME@
+V = @V@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
-VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
+WINDRES = @WINDRES@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
@@ -272,6 +283,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
XORG_SYS_LIBS = @XORG_SYS_LIBS@
XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
XPBPROXY_LIBS = @XPBPROXY_LIBS@
+XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSDL_INCS = @XSDL_INCS@
@@ -296,7 +308,6 @@ YFLAGS = @YFLAGS@
__XCONFIGFILE__ = @__XCONFIGFILE__@
abi_ansic = @abi_ansic@
abi_extension = @abi_extension@
-abi_font = @abi_font@
abi_videodrv = @abi_videodrv@
abi_xinput = @abi_xinput@
abs_builddir = @abs_builddir@
@@ -319,6 +330,7 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
driverdir = @driverdir@
dvidir = @dvidir@
@@ -350,7 +362,9 @@ psdir = @psdir@
sbindir = @sbindir@
sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
+shavedir = @shavedir@
srcdir = @srcdir@
+symbol_visibility = @symbol_visibility@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
@@ -361,16 +375,14 @@ INCLUDES = \
@KDRIVE_CFLAGS@
AM_CFLAGS = -DHAVE_DIX_CONFIG_H
-noinst_LIBRARIES = liblinux.a
+noinst_LTLIBRARIES = liblinux.la
@TSLIB_TRUE@TSLIB_C = tslib.c
-@KDRIVE_HW_TRUE@KDRIVE_HW_SOURCES = \
-@KDRIVE_HW_TRUE@ agp.c \
-@KDRIVE_HW_TRUE@ agp.h \
-@KDRIVE_HW_TRUE@ evdev.c \
-@KDRIVE_HW_TRUE@ keyboard.c \
-@KDRIVE_HW_TRUE@ linux.c
-
-liblinux_a_SOURCES = \
+KDRIVE_HW_SOURCES = \
+ evdev.c \
+ keyboard.c \
+ linux.c
+
+liblinux_la_SOURCES = \
bus.c \
klinux.h \
mouse.c \
@@ -414,12 +426,16 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-liblinux.a: $(liblinux_a_OBJECTS) $(liblinux_a_DEPENDENCIES)
- -rm -f liblinux.a
- $(liblinux_a_AR) liblinux.a $(liblinux_a_OBJECTS) $(liblinux_a_LIBADD)
- $(RANLIB) liblinux.a
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+liblinux.la: $(liblinux_la_OBJECTS) $(liblinux_la_DEPENDENCIES)
+ $(LINK) $(liblinux_la_OBJECTS) $(liblinux_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -427,15 +443,14 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdev.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ms.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tslib.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdev.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mouse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ms.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ps2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tslib.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -548,7 +563,7 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LTLIBRARIES)
installdirs:
install: install-am
install-exec: install-exec-am
@@ -577,7 +592,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
@@ -649,7 +664,7 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLIBRARIES ctags distclean \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
diff --git a/xorg-server/hw/kdrive/linux/bus.c b/xorg-server/hw/kdrive/linux/bus.c
index 2d7a15751..ba8a6cd43 100644
--- a/xorg-server/hw/kdrive/linux/bus.c
+++ b/xorg-server/hw/kdrive/linux/bus.c
@@ -23,7 +23,6 @@
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xpoll.h>
@@ -78,7 +77,7 @@ BusInit (KdPointerInfo *pi)
close(fd);
if (pi->path)
xfree(pi->path);
- pi->path = KdSaveString(BusNames[i]);
+ pi->path = strdup(BusNames[i]);
return Success;
}
}
diff --git a/xorg-server/hw/kdrive/linux/evdev.c b/xorg-server/hw/kdrive/linux/evdev.c
index 4ccd82239..f6017ba51 100644
--- a/xorg-server/hw/kdrive/linux/evdev.c
+++ b/xorg-server/hw/kdrive/linux/evdev.c
@@ -23,7 +23,6 @@
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <errno.h>
#include <linux/input.h>
#include <X11/X.h>
@@ -210,7 +209,7 @@ EvdevPtrInit (KdPointerInfo *pi)
for (i = 0; i < NUM_DEFAULT_EVDEV; i++) {
fd = open (kdefaultEvdev[i], 2);
if (fd >= 0) {
- pi->path = KdSaveString (kdefaultEvdev[i]);
+ pi->path = strdup (kdefaultEvdev[i]);
break;
}
}
@@ -225,7 +224,7 @@ EvdevPtrInit (KdPointerInfo *pi)
close(fd);
- pi->name = KdSaveString("Evdev mouse");
+ pi->name = strdup("Evdev mouse");
return Success;
}
@@ -234,6 +233,8 @@ static Status
EvdevPtrEnable (KdPointerInfo *pi)
{
int fd;
+ unsigned long ev[NBITS(EV_MAX)];
+ Kevdev *ke;
if (!pi || !pi->path)
return BadImplementation;
@@ -242,8 +243,6 @@ EvdevPtrEnable (KdPointerInfo *pi)
if (fd < 0)
return BadMatch;
- unsigned long ev[NBITS(EV_MAX)];
- Kevdev *ke;
if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
{
@@ -353,18 +352,11 @@ EvdevPtrFini (KdPointerInfo *pi)
static void
readMapping (KdKeyboardInfo *ki)
{
- int minScanCode, maxScanCode;
-
if (!ki)
return;
- minScanCode = 0;
- maxScanCode = 193;
-
- ki->keySyms.mapWidth = 2;
-
- ki->minScanCode = minScanCode;
- ki->maxScanCode = maxScanCode;
+ ki->minScanCode = 0;
+ ki->maxScanCode = 193;
}
static void
@@ -412,7 +404,7 @@ EvdevKbdInit (KdKeyboardInfo *ki)
close (fd);
- ki->name = KdSaveString("Evdev keyboard");
+ ki->name = strdup("Evdev keyboard");
readMapping(ki);
diff --git a/xorg-server/hw/kdrive/linux/keyboard.c b/xorg-server/hw/kdrive/linux/keyboard.c
index ae981b776..79cf59898 100644
--- a/xorg-server/hw/kdrive/linux/keyboard.c
+++ b/xorg-server/hw/kdrive/linux/keyboard.c
@@ -42,8 +42,6 @@
#include <sys/ioctl.h>
extern int LinuxConsoleFd;
-static unsigned char mediumraw_data, mediumraw_up;
-static enum { DEFAULT, EXTBYTE1, EXTBYTE2 } mediumraw_state = DEFAULT;
static const KeySym linux_to_x[256] = {
NoSymbol, NoSymbol, NoSymbol, NoSymbol,
@@ -112,7 +110,6 @@ static const KeySym linux_to_x[256] = {
XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
};
-#ifdef XKB
/*
* Getting a keycode from scancode
*
@@ -137,6 +134,7 @@ static const KeySym linux_to_x[256] = {
for the core X keyboard protocol has to be AT-scancode based so that it
corresponds to the Xkb keymap.
*/
+#if 0
static unsigned char at2lnx[] =
{
0x0, /* no valid scancode */
@@ -209,10 +207,6 @@ static unsigned char at2lnx[] =
#define NUM_AT_KEYS (sizeof(at2lnx)/sizeof(at2lnx[0]))
#define LNX_KEY_INDEX(n) n < NUM_AT_KEYS ? at2lnx[n] : 0
-#else /* not XKB */
-#define LNX_KEY_INDEX(n) n
-#endif
-
static unsigned char tbl[KD_MAX_WIDTH] =
{
0,
@@ -220,10 +214,12 @@ static unsigned char tbl[KD_MAX_WIDTH] =
(1 << KG_ALTGR),
(1 << KG_ALTGR) | (1 << KG_SHIFT)
};
+#endif
static void
readKernelMapping(KdKeyboardInfo *ki)
{
+#if 0
KeySym *k;
int i, j;
struct kbentry kbe;
@@ -489,10 +485,9 @@ readKernelMapping(KdKeyboardInfo *ki)
}
ki->minScanCode = minKeyCode;
ki->maxScanCode = maxKeyCode;
+#endif
}
-#ifdef XKB
-
/*
* We need these to handle extended scancodes correctly (I could just use the
* numbers below, but this makes the code more readable
@@ -555,9 +550,6 @@ readKernelMapping(KdKeyboardInfo *ki)
#define KEY_F17 /* F17 0x72 */ 114
#define KEY_KP_DEC /* KP_DEC 0x73 */ 115
-#endif /* XKB */
-
-
static void
LinuxKeyboardRead (int fd, void *closure)
{
@@ -568,164 +560,118 @@ LinuxKeyboardRead (int fd, void *closure)
while ((n = read (fd, buf, sizeof (buf))) > 0) {
b = buf;
while (n--) {
-#ifdef XKB
- if (!noXkbExtension) {
- /*
- * With xkb we use RAW mode for reading the console, which allows us
- * process extended scancodes.
- *
- * See if this is a prefix extending the following keycode
- */
- if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0))
- {
- prefix = KEY_Prefix0;
-#ifdef DEBUG
- ErrorF("Prefix0");
-#endif
- /* swallow this up */
- b++;
- continue;
- }
- else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1))
- {
- prefix = KEY_Prefix1;
- ErrorF("Prefix1");
- /* swallow this up */
- b++;
- continue;
- }
- scancode = b[0] & 0x7f;
-
- switch (prefix) {
- /* from xf86Events.c */
- case KEY_Prefix0:
- {
-#ifdef DEBUG
- ErrorF("Prefix0 scancode: 0x%02x\n", scancode);
-#endif
- switch (scancode) {
- case KEY_KP_7:
- scancode = KEY_Home; break; /* curs home */
- case KEY_KP_8:
- scancode = KEY_Up; break; /* curs up */
- case KEY_KP_9:
- scancode = KEY_PgUp; break; /* curs pgup */
- case KEY_KP_4:
- scancode = KEY_Left; break; /* curs left */
- case KEY_KP_5:
- scancode = KEY_Begin; break; /* curs begin */
- case KEY_KP_6:
- scancode = KEY_Right; break; /* curs right */
- case KEY_KP_1:
- scancode = KEY_End; break; /* curs end */
- case KEY_KP_2:
- scancode = KEY_Down; break; /* curs down */
- case KEY_KP_3:
- scancode = KEY_PgDown; break; /* curs pgdown */
- case KEY_KP_0:
- scancode = KEY_Insert; break; /* curs insert */
- case KEY_KP_Decimal:
- scancode = KEY_Delete; break; /* curs delete */
- case KEY_Enter:
- scancode = KEY_KP_Enter; break; /* keypad enter */
- case KEY_LCtrl:
- scancode = KEY_RCtrl; break; /* right ctrl */
- case KEY_KP_Multiply:
- scancode = KEY_Print; break; /* print */
- case KEY_Slash:
- scancode = KEY_KP_Divide; break; /* keyp divide */
- case KEY_Alt:
- scancode = KEY_AltLang; break; /* right alt */
- case KEY_ScrollLock:
- scancode = KEY_Break; break; /* curs break */
- case 0x5b:
- scancode = KEY_LMeta; break;
- case 0x5c:
- scancode = KEY_RMeta; break;
- case 0x5d:
- scancode = KEY_Menu; break;
- case KEY_F3:
- scancode = KEY_F13; break;
- case KEY_F4:
- scancode = KEY_F14; break;
- case KEY_F5:
- scancode = KEY_F15; break;
- case KEY_F6:
- scancode = KEY_F16; break;
- case KEY_F7:
- scancode = KEY_F17; break;
- case KEY_KP_Plus:
- scancode = KEY_KP_DEC; break;
- /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */
- case 0x2A:
- case 0x36:
- b++;
- prefix = 0;
- continue;
- default:
-#ifdef DEBUG
- ErrorF("Unreported Prefix0 scancode: 0x%02x\n",
- scancode);
-#endif
- /*
- * "Internet" keyboards are generating lots of new
- * codes. Let them pass. There is little consistency
- * between them, so don't bother with symbolic names at
- * this level.
- */
- scancode += 0x78;
- }
- break;
- }
-
- case KEY_Prefix1:
- {
- /* we do no handle these */
-#ifdef DEBUG
- ErrorF("Prefix1 scancode: 0x%02x\n", scancode);
-#endif
- b++;
- prefix = 0;
- continue;
+ /*
+ * With xkb we use RAW mode for reading the console, which allows us
+ * process extended scancodes.
+ *
+ * See if this is a prefix extending the following keycode
+ */
+ if (!prefix && ((b[0] & 0x7f) == KEY_Prefix0))
+ {
+ prefix = KEY_Prefix0;
+ /* swallow this up */
+ b++;
+ continue;
+ }
+ else if (!prefix && ((b[0] & 0x7f) == KEY_Prefix1))
+ {
+ prefix = KEY_Prefix1;
+ /* swallow this up */
+ b++;
+ continue;
+ }
+ scancode = b[0] & 0x7f;
+
+ switch (prefix) {
+ /* from xf86Events.c */
+ case KEY_Prefix0:
+ {
+ switch (scancode) {
+ case KEY_KP_7:
+ scancode = KEY_Home; break; /* curs home */
+ case KEY_KP_8:
+ scancode = KEY_Up; break; /* curs up */
+ case KEY_KP_9:
+ scancode = KEY_PgUp; break; /* curs pgup */
+ case KEY_KP_4:
+ scancode = KEY_Left; break; /* curs left */
+ case KEY_KP_5:
+ scancode = KEY_Begin; break; /* curs begin */
+ case KEY_KP_6:
+ scancode = KEY_Right; break; /* curs right */
+ case KEY_KP_1:
+ scancode = KEY_End; break; /* curs end */
+ case KEY_KP_2:
+ scancode = KEY_Down; break; /* curs down */
+ case KEY_KP_3:
+ scancode = KEY_PgDown; break; /* curs pgdown */
+ case KEY_KP_0:
+ scancode = KEY_Insert; break; /* curs insert */
+ case KEY_KP_Decimal:
+ scancode = KEY_Delete; break; /* curs delete */
+ case KEY_Enter:
+ scancode = KEY_KP_Enter; break; /* keypad enter */
+ case KEY_LCtrl:
+ scancode = KEY_RCtrl; break; /* right ctrl */
+ case KEY_KP_Multiply:
+ scancode = KEY_Print; break; /* print */
+ case KEY_Slash:
+ scancode = KEY_KP_Divide; break; /* keyp divide */
+ case KEY_Alt:
+ scancode = KEY_AltLang; break; /* right alt */
+ case KEY_ScrollLock:
+ scancode = KEY_Break; break; /* curs break */
+ case 0x5b:
+ scancode = KEY_LMeta; break;
+ case 0x5c:
+ scancode = KEY_RMeta; break;
+ case 0x5d:
+ scancode = KEY_Menu; break;
+ case KEY_F3:
+ scancode = KEY_F13; break;
+ case KEY_F4:
+ scancode = KEY_F14; break;
+ case KEY_F5:
+ scancode = KEY_F15; break;
+ case KEY_F6:
+ scancode = KEY_F16; break;
+ case KEY_F7:
+ scancode = KEY_F17; break;
+ case KEY_KP_Plus:
+ scancode = KEY_KP_DEC; break;
+ /* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6) */
+ case 0x2A:
+ case 0x36:
+ b++;
+ prefix = 0;
+ continue;
+ default:
+ /*
+ * "Internet" keyboards are generating lots of new
+ * codes. Let them pass. There is little consistency
+ * between them, so don't bother with symbolic names at
+ * this level.
+ */
+ scancode += 0x78;
}
+ break;
+ }
- default: /* should not happen*/
- case 0: /* do nothing */
-#ifdef DEBUG
- ErrorF("Plain scancode: 0x%02x\n", scancode);
-#endif
- ;
- }
+ case KEY_Prefix1:
+ {
+ /* we do no handle these */
+ b++;
+ prefix = 0;
+ continue;
+ }
- prefix = 0;
+ default: /* should not happen*/
+ case 0: /* do nothing */
+ ;
}
- /* without xkb we use mediumraw mode -- enqueue the scancode as is */
- else
-#endif
- scancode = b[0] & 0x7f;
- /* This is extended medium raw mode interpreter
- see linux/drivers/keyboard.c (kbd->kbdmode == VC_MEDIUMRAW) */
- switch (mediumraw_state)
- {
- case DEFAULT:
- if (scancode == 0)
- {
- mediumraw_state = EXTBYTE1;
- mediumraw_up = b[0] & 0x80;
- }
- else
- KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80);
- break;
- case EXTBYTE1:
- mediumraw_data = scancode;
- mediumraw_state = EXTBYTE2;
- break;
- case EXTBYTE2:
- /* Note: Only codes < 256 will pass correctly through KdEnqueueKeyboardEvent() */
- KdEnqueueKeyboardEvent (closure, (int)mediumraw_data << 7 | scancode, mediumraw_up);
- mediumraw_state = DEFAULT;
- break;
- }
+
+ prefix = 0;
+ KdEnqueueKeyboardEvent (closure, scancode, b[0] & 0x80);
b++;
}
}
@@ -750,13 +696,7 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki)
ioctl (fd, KDGKBMODE, &LinuxKbdTrans);
tcgetattr (fd, &LinuxTermios);
-#ifdef XKB
- if (!noXkbExtension)
- ioctl(fd, KDSKBMODE, K_RAW);
- else
-#else
- ioctl(fd, KDSKBMODE, K_MEDIUMRAW);
-#endif
+ ioctl(fd, KDSKBMODE, K_RAW);
nTty = LinuxTermios;
nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
nTty.c_oflag = 0;
@@ -799,10 +739,10 @@ LinuxKeyboardInit (KdKeyboardInfo *ki)
if (ki->path)
xfree(ki->path);
- ki->path = KdSaveString("console");
+ ki->path = strdup("console");
if (ki->name)
xfree(ki->name);
- ki->name = KdSaveString("Linux console keyboard");
+ ki->name = strdup("Linux console keyboard");
readKernelMapping (ki);
diff --git a/xorg-server/hw/kdrive/linux/linux.c b/xorg-server/hw/kdrive/linux/linux.c
index 258dc7b81..3fba056df 100644
--- a/xorg-server/hw/kdrive/linux/linux.c
+++ b/xorg-server/hw/kdrive/linux/linux.c
@@ -91,8 +91,8 @@ LinuxInit (void)
{
FatalError("xf86OpenConsole: Cannot find a free VT\n");
}
+ close(fd);
}
- close(fd);
sprintf(vtname,"/dev/tty%d",vtno); /* /dev/tty1-64 */
@@ -448,7 +448,7 @@ LinuxFini (void)
}
void
-KdOsAddInputDrivers ()
+KdOsAddInputDrivers (void)
{
KdAddPointerDriver(&LinuxMouseDriver);
KdAddPointerDriver(&MsMouseDriver);
diff --git a/xorg-server/hw/kdrive/linux/mouse.c b/xorg-server/hw/kdrive/linux/mouse.c
index 1965342b8..6f399b586 100644
--- a/xorg-server/hw/kdrive/linux/mouse.c
+++ b/xorg-server/hw/kdrive/linux/mouse.c
@@ -23,7 +23,6 @@
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <errno.h>
#include <termios.h>
#include <X11/X.h>
@@ -945,7 +944,7 @@ MouseInit (KdPointerInfo *pi)
for (i = 0; i < NUM_DEFAULT_MOUSE; i++) {
fd = open (kdefaultMouse[i], 2);
if (fd >= 0) {
- pi->path = KdSaveString (kdefaultMouse[i]);
+ pi->path = strdup (kdefaultMouse[i]);
break;
}
}
@@ -962,7 +961,11 @@ MouseInit (KdPointerInfo *pi)
km = (Kmouse *) xalloc (sizeof (Kmouse));
if (km) {
km->iob.avail = km->iob.used = 0;
- MouseFirstProtocol(km, "exps/2");
+ MouseFirstProtocol(km, pi->protocol ? pi->protocol : "exps/2");
+ /* MouseFirstProtocol sets state to MouseBroken for later protocol
+ * checks. Skip these checks if a protocol was supplied */
+ if (pi->protocol)
+ km->state = MouseWorking;
km->i_prot = 0;
km->tty = isatty (fd);
km->iob.fd = -1;
diff --git a/xorg-server/hw/kdrive/linux/ms.c b/xorg-server/hw/kdrive/linux/ms.c
index d0b47a3ee..5786ed170 100644
--- a/xorg-server/hw/kdrive/linux/ms.c
+++ b/xorg-server/hw/kdrive/linux/ms.c
@@ -24,7 +24,6 @@ THE SOFTWARE.
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <errno.h>
#include <termios.h>
#include <X11/X.h>
@@ -101,9 +100,9 @@ MsInit (KdPointerInfo *pi)
return BadImplementation;
if (!pi->path || strcmp(pi->path, "auto"))
- pi->path = KdSaveString("/dev/mouse");
+ pi->path = strdup("/dev/mouse");
if (!pi->name)
- pi->name = KdSaveString("Microsoft protocol mouse");
+ pi->name = strdup("Microsoft protocol mouse");
return Success;
}
diff --git a/xorg-server/hw/kdrive/linux/ps2.c b/xorg-server/hw/kdrive/linux/ps2.c
index d361e82a1..396758481 100644
--- a/xorg-server/hw/kdrive/linux/ps2.c
+++ b/xorg-server/hw/kdrive/linux/ps2.c
@@ -23,7 +23,6 @@
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xpoll.h>
@@ -124,7 +123,7 @@ Ps2Init (KdPointerInfo *pi)
for (i = 0; i < NUM_PS2_NAMES; i++) {
ps2Port = open (Ps2Names[i], 0);
if (ps2Port >= 0) {
- pi->path = KdSaveString (Ps2Names[i]);
+ pi->path = strdup (Ps2Names[i]);
break;
}
}
@@ -138,7 +137,7 @@ Ps2Init (KdPointerInfo *pi)
close(ps2Port);
if (!pi->name)
- pi->name = KdSaveString ("PS/2 Mouse");
+ pi->name = strdup ("PS/2 Mouse");
return Success;
}
diff --git a/xorg-server/hw/kdrive/linux/tslib.c b/xorg-server/hw/kdrive/linux/tslib.c
index e0e860e48..59011b0e3 100644
--- a/xorg-server/hw/kdrive/linux/tslib.c
+++ b/xorg-server/hw/kdrive/linux/tslib.c
@@ -35,7 +35,6 @@
#include <kdrive-config.h>
#endif
-#define NEED_EVENTS
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xpoll.h>
@@ -115,7 +114,7 @@ TslibEnable (KdPointerInfo *pi)
private->raw_event_hook = NULL;
private->raw_event_closure = NULL;
if (!pi->path) {
- pi->path = "/dev/input/touchscreen0";
+ pi->path = strdup("/dev/input/touchscreen0");
ErrorF("[tslib/TslibEnable] no device path given, trying %s\n", pi->path);
}
private->tsDev = ts_open(pi->path, 0);
@@ -170,7 +169,7 @@ TslibInit (KdPointerInfo *pi)
/* hacktastic */
private->phys_screen = 0;
pi->nAxes = 3;
- pi->name = KdSaveString("Touchscreen");
+ pi->name = strdup("Touchscreen");
pi->inputClass = KD_TOUCHSCREEN;
return Success;