diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Config.c xc/programs/Xserver/hw/xfree86/common/xf86Config.c --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Config.c Thu Feb 20 13:36:07 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86Config.c Mon Jan 5 22:27:59 2004 @@ -1059,7 +1059,7 @@ xf86Info.panix106 = FALSE; #endif xf86Info.kbdCustomKeycodes = FALSE; -#ifdef WSCONS_SUPPORT +#if defined(WSCONS_SUPPORT) || defined(SYSCONS_SUPPORT) xf86Info.kbdFd = -1; #endif #ifdef XKB @@ -1150,6 +1150,21 @@ return FALSE; } #endif + } else if (xf86NameCmp(s, "extrakbd") == 0) { + xf86Info.kbdProc = xf86KbdProc; + xf86Info.kbdEvents = xf86ExtraKbdEvents; + xf86Msg(X_CONFIG, "Keyboard: Protocol: extrakbd\n"); + s = xf86SetStrOption(inputp->commonOptions, "Device", NULL); + if (s == NULL) { + xf86ConfigError("A \"device\" option is required with" + " the \"extrakbd\" keyboard protocol"); + return FALSE; + } + xf86Info.kbdFd = open(s, O_RDWR | O_NONBLOCK | O_EXCL); + if (xf86Info.kbdFd == -1) { + xf86ConfigError("Keyboard device: cannot open \"%s\"", s); + return FALSE; + } } else { xf86ConfigError("\"%s\" is not a valid keyboard protocol name", s); xfree(s); diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c xc/programs/Xserver/hw/xfree86/common/xf86Globals.c --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c Thu Feb 20 13:05:14 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86Globals.c Mon Jan 5 16:34:30 2004 @@ -222,3 +222,6 @@ * only to be used when using dlopen() modules for debugging purposes. */ #endif + +Bool xf86NoVTSwitches = FALSE; +Bool xf86NoPCIAccessDisable = FALSE; diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Init.c xc/programs/Xserver/hw/xfree86/common/xf86Init.c --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Init.c Wed Feb 26 18:21:38 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86Init.c Mon Jan 5 16:34:30 2004 @@ -1283,6 +1283,28 @@ xf86ProbeOnly = TRUE; return 1; } + if (!strcmp(argv[i],"-delay")) + { + int delay; + + if (!argv[i + 1] || (delay = atoi(argv[i + 1])) <= 0) { + sleep(10); + return 1; + } else { + sleep((unsigned) delay); + return 2; + } + } + if (!strcmp(argv[i],"-novtswitches")) + { + xf86NoVTSwitches = TRUE; + return 1; + } + if (!strcmp(argv[i],"-nopciaccessdisable")) + { + xf86NoPCIAccessDisable = TRUE; + return 1; + } if (!strcmp(argv[i],"-flipPixels")) { xf86FlipPixels = TRUE; diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h xc/programs/Xserver/hw/xfree86/common/xf86Priv.h --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h Fri Dec 13 03:29:10 2002 +++ xc/programs/Xserver/hw/xfree86/common/xf86Priv.h Mon Jan 5 16:34:30 2004 @@ -90,6 +90,9 @@ extern Bool xf86ProbeOnly; extern Bool xf86DoProbe; +extern Bool xf86NoVTSwitches; +extern Bool xf86NoPCIAccessDisable; + #ifndef DEFAULT_VERBOSE #define DEFAULT_VERBOSE 0 #endif diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h Thu Feb 20 13:05:14 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h Mon Jan 5 21:46:12 2004 @@ -59,6 +59,7 @@ int bell_pitch; int bell_duration; Bool autoRepeat; + int ledsave; unsigned long leds; unsigned long xleds; char * vtinit; @@ -197,6 +198,7 @@ #define SYSCONS 8 #define PCVT 16 #define WSCONS 32 +#define SYSCONS_ALTKBD 64 #endif /* Prefix strings for driver messages */ diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c --- xc.orig/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c Wed Feb 19 00:42:11 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c Mon Jan 5 16:34:30 2004 @@ -573,6 +573,9 @@ static void pciIoAccessDisable(void* arg) { + if (xf86NoPCIAccessDisable) + return; + #ifdef DEBUG ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif @@ -595,6 +598,9 @@ static void pciIo_MemAccessDisable(void* arg) { + if (xf86NoPCIAccessDisable) + return; + #ifdef DEBUG ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif @@ -617,6 +623,9 @@ static void pciMemAccessDisable(void* arg) { + if (xf86NoPCIAccessDisable) + return; + #ifdef DEBUG ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c Sun Jul 26 01:56:33 1998 +++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_VTsw.c Mon Jan 5 17:12:32 2004 @@ -42,6 +42,9 @@ void xf86VTRequest(int sig) { + if (xf86NoVTSwitches) + return; + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = TRUE; @@ -55,7 +58,7 @@ { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { - return(xf86Info.vtRequestsPending ? TRUE : FALSE); + return(!xf86NoVTSwitches && xf86Info.vtRequestsPending ? TRUE : FALSE); } #endif return FALSE; @@ -64,6 +67,9 @@ Bool xf86VTSwitchAway() { + if (xf86NoVTSwitches) + return FALSE; + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = FALSE; @@ -79,6 +85,9 @@ Bool xf86VTSwitchTo() { + if (xf86NoVTSwitches) + return TRUE; + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { xf86Info.vtRequestsPending = FALSE; diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c Mon May 6 03:54:02 2002 +++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c Mon Jan 5 22:56:02 2004 @@ -229,6 +229,7 @@ #endif #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: + case SYSCONS_ALTKBD: /* as of FreeBSD 2.2.8, syscons driver does not need the #1 vt * switching anymore. Here we check for FreeBSD 3.1 and up. * Add cases for other *BSD that behave the same. @@ -259,6 +260,9 @@ /* * now get the VT */ + + if (xf86Info.consType != SYSCONS_ALTKBD) { + SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)); if (result != 0) @@ -293,6 +297,7 @@ { FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); } + } break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT @@ -307,6 +312,7 @@ { /* serverGeneration != 1 */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) + /* hrs: no activate when SYSCONS_ALTKBD */ if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) @@ -420,6 +426,11 @@ { /* stdin is a VT */ xf86Info.vtno = minor(status.st_rdev) + 1; + + if (xf86Info.kbdFd != -1) { + /* hrs: vf86Info.vtno have to point to the current VT number. */ + xf86Info.vtno = minor(status.st_rdev); + } } else { @@ -457,6 +468,10 @@ } xf86Info.consType = SYSCONS; xf86Msg(X_PROBED, "Using syscons driver with X support"); + if (xf86Info.kbdFd != -1) { + xf86Info.consType = SYSCONS_ALTKBD; + xf86Msg(X_PROBED, ", but VT switching ignored (fd: %d)", xf86Info.kbdFd); + } if (syscons_version >= 0x100) { xf86ErrorF(" (version %d.%d)\n", syscons_version >> 8, @@ -641,6 +656,8 @@ break; #endif /* PCCONS_SUPPORT */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) + case SYSCONS_ALTKBD: + return; case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode */ diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c Tue Oct 22 05:38:04 2002 +++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_io.c Mon Jan 5 23:01:55 2004 @@ -34,7 +34,7 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" -#ifdef WSCONS_SUPPORT +#if defined(WSCONS_SUPPORT) #define KBD_FD(i) ((i).kbdFd != -1 ? (i).kbdFd : (i).consoleFd) #endif @@ -158,6 +158,9 @@ case PCVT: tcgetattr(xf86Info.consoleFd, &kbdtty); break; + case SYSCONS_ALTKBD: + xf86FlushInput(xf86Info.kbdFd); + break; #endif #if defined WSCONS_SUPPORT case WSCONS: @@ -178,7 +181,6 @@ int option; #endif - switch (xf86Info.consType) { #if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) @@ -200,6 +202,9 @@ ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW); #endif break; + case SYSCONS_ALTKBD: + return xf86Info.kbdFd; + break; #endif #ifdef WSCONS_SUPPORT case WSCONS: @@ -241,6 +246,9 @@ switch (xf86Info.consType) { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) + case SYSCONS_ALTKBD: + return xf86Info.kbdFd; + break; case SYSCONS: case PCVT: ioctl(xf86Info.consoleFd, KDSKBMODE, K_XLATE); @@ -286,4 +294,15 @@ #endif /* WSCONS_SUPPORT */ +void +xf86ExtraKbdEvents(void) +{ + unsigned char rBuf[64]; + int nBytes, i; + if ((nBytes = read( xf86Info.kbdFd, (char *)rBuf, sizeof(rBuf))) > 0) + { + for (i = 0; i < nBytes; i++) + xf86PostKbdEvent(rBuf[i]); + } +} diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c Tue Feb 18 00:11:56 2003 +++ xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c Mon Jan 5 21:26:36 2004 @@ -33,6 +33,7 @@ #ifdef WSCONS_SUPPORT {"wskbd", PROT_WSCONS }, #endif + {"extrakbd", PROT_STD }, { NULL, PROT_UNKNOWN } }; diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c Thu Nov 1 07:50:30 2001 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_init.c Mon Jan 5 16:34:30 2004 @@ -87,22 +87,35 @@ FatalError( "xf86OpenConsole: Cannot open /dev/tty0 (%s)\n", strerror(errno)); - if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || - (xf86Info.vtno == -1)) { - FatalError("xf86OpenConsole: Cannot find a free VT\n"); + + if (xf86NoVTSwitches) { + if (ioctl(fd, VT_GETSTATE, &vts) == 0) + { + xf86Info.vtno = vts.v_active; + } else { + FatalError("xf86OpenConsole: Cannot find the current VT\n"); + } + } else { + if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || + (xf86Info.vtno == -1)) { + FatalError("xf86OpenConsole: Cannot find a free VT\n"); + } } + close(fd); } #ifdef USE_DEV_FB - fb_dev_name=getenv("FRAMEBUFFER"); - if (!fb_dev_name) - fb_dev_name="/dev/fb0current"; - if ((fbfd = open(fb_dev_name, O_RDONLY)) < 0) - FatalError("xf86OpenConsole: Cannot open %s (%s)\n", - fb_dev_name, strerror(errno)); - if (ioctl(fbfd, FBIOGET_VSCREENINFO, &var)) - FatalError("xf86OpenConsole: Unable to get screen info\n"); + if (!xf86NoVTSwitches) { + fb_dev_name=getenv("FRAMEBUFFER"); + if (!fb_dev_name) + fb_dev_name="/dev/fb0current"; + if ((fbfd = open(fb_dev_name, O_RDONLY)) < 0) + FatalError("xf86OpenConsole: Cannot open %s (%s)\n", + fb_dev_name, strerror(errno)); + if (ioctl(fbfd, FBIOGET_VSCREENINFO, &var)) + FatalError("xf86OpenConsole: Unable to get screen info\n"); + } #endif xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); @@ -124,8 +137,12 @@ xf86Info.vtno, strerror(errno)); } - /* change ownership of the vt */ - chown(vtname, getuid(), getgid()); + /* humm, not a good idea if we don't really use this vt, chowning it would + probably mess with the first XFree instance. Right? i don't know! */ + if (!xf86NoVTSwitches) { + /* change ownership of the vt */ + chown(vtname, getuid(), getgid()); + } /* * the current VT device we're running on is not "console", we want @@ -170,37 +187,42 @@ { xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); } - SYSCALL(result = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); - if (result < 0) - { - FatalError("xf86OpenConsole: VT_GETMODE failed\n"); - } - signal(SIGUSR1, xf86VTRequest); + if (xf86NoVTSwitches) { + close(xf86Info.consoleFd); + } else { + SYSCALL(result = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); + if (result < 0) + { + FatalError("xf86OpenConsole: VT_GETMODE failed\n"); + } - VT.mode = VT_PROCESS; - VT.relsig = SIGUSR1; - VT.acqsig = SIGUSR1; - if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) - { - FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); - } - if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) - { - FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); - } + signal(SIGUSR1, xf86VTRequest); + + VT.mode = VT_PROCESS; + VT.relsig = SIGUSR1; + VT.acqsig = SIGUSR1; + if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) + { + FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); + } + if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) + { + FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); + } + + /* we really should have a InitOSInputDevices() function instead + * of Init?$#*&Device(). So I just place it here */ - /* we really should have a InitOSInputDevices() function instead - * of Init?$#*&Device(). So I just place it here */ - #ifdef USE_DEV_FB - /* copy info to new console */ - var.yoffset=0; - var.xoffset=0; - if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &var)) - FatalError("Unable to set screen info\n"); - close(fbfd); + /* copy info to new console */ + var.yoffset=0; + var.xoffset=0; + if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &var)) + FatalError("Unable to set screen info\n"); + close(fbfd); #endif + } } else { @@ -208,16 +230,18 @@ /* * now get the VT */ - SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)); - if (result != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); - } - SYSCALL(result = - ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno)); - if (result != 0) - { - xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); + if (!xf86NoVTSwitches) { + SYSCALL(result = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)); + if (result != 0) + { + xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); + } + SYSCALL(result = + ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno)); + if (result != 0) + { + xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n"); + } } } return; @@ -232,21 +256,23 @@ ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno); ioctl(xf86Info.consoleFd, VT_WAITACTIVE, 0); #endif - ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ - if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) - { - VT.mode = VT_AUTO; - ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ - } - /* - * Perform a switch back to the active VT when we were started - */ - if (activeVT >= 0) - { - ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT); - activeVT = -1; + if (!xf86NoVTSwitches) { + ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ + if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) + { + VT.mode = VT_AUTO; + ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* set dflt vt handling */ + } + /* + * Perform a switch back to the active VT when we were started + */ + if (activeVT >= 0) + { + ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT); + activeVT = -1; + } + close(xf86Info.consoleFd); /* make the vt-manager happy */ } - close(xf86Info.consoleFd); /* make the vt-manager happy */ return; } diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c Mon Oct 21 06:45:27 2002 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c Mon Jan 5 16:34:30 2004 @@ -33,12 +33,19 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" +#include +#include #define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */ void xf86SoundKbdBell(int loudness, int pitch, int duration) { + /* i guess it should be safe to beep even on a diferent keyboard (?) */ + /* the beep will be on the system speaker anyway... */ + if (xf86Info.kbdEvents == xf86USBKbdEvents) + return; + if (loudness && pitch) { ioctl(xf86Info.consoleFd, KDMKTONE, @@ -51,7 +58,34 @@ void xf86SetKbdLeds(int leds) { - ioctl(xf86Info.consoleFd, KDSETLED, leds); + struct s_output_event { + struct timeval time; + unsigned short type; + unsigned short code; + unsigned int value; + } output_event; + + if (xf86Info.kbdEvents != xf86USBKbdEvents) { + ioctl(xf86Info.consoleFd, KDSETLED, leds); + return; + } + + output_event.type = EV_LED; + output_event.code = LED_NUML; + output_event.value = (leds&(LED_NUM)) ? 1 : 0; + write( xf86Info.kbdFd, (char *)&output_event, sizeof(output_event)); + + output_event.type = EV_LED; + output_event.code = LED_CAPSL; + output_event.value = (leds&(LED_CAP)) ? 1 : 0; + write( xf86Info.kbdFd, (char *)&output_event, sizeof(output_event)); + + output_event.type = EV_LED; + output_event.code = LED_SCROLLL; + output_event.value = (leds&(LED_SCR)) ? 1 : 0; + write( xf86Info.kbdFd, (char *)&output_event, sizeof(output_event)); + + xf86Info.ledsave = leds; } int @@ -59,7 +93,12 @@ { int leds = 0; - ioctl(xf86Info.consoleFd, KDGETLED, &leds); + if (xf86Info.kbdEvents == xf86USBKbdEvents) { + leds = xf86Info.ledsave; + } else { + ioctl(xf86Info.consoleFd, KDGETLED, &leds); + } + return(leds); } @@ -177,6 +216,9 @@ if (xf86Info.kbdDelay >= 0) delay = xf86Info.kbdDelay; + /* FIXME: just returning so we don't mess with any other keyboards... */ + if (xf86Info.kbdEvents == xf86USBKbdEvents) + return; if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */ return; @@ -228,14 +270,19 @@ void xf86KbdInit() { - ioctl (xf86Info.consoleFd, KDGKBMODE, &kbdtrans); - tcgetattr (xf86Info.consoleFd, &kbdtty); + if (xf86Info.kbdEvents != xf86USBKbdEvents) { + ioctl (xf86Info.consoleFd, KDGKBMODE, &kbdtrans); + tcgetattr (xf86Info.consoleFd, &kbdtty); + } } int xf86KbdOn() { struct termios nTty; + + if (xf86Info.kbdEvents == xf86USBKbdEvents) + return(xf86Info.kbdFd); #ifdef __powerpc__ if (xf86Info.kbdCustomKeycodes) @@ -260,6 +307,9 @@ int xf86KbdOff() { + if (xf86Info.kbdEvents == xf86USBKbdEvents) + return(xf86Info.kbdFd); + ioctl(xf86Info.consoleFd, KDSKBMODE, kbdtrans); tcsetattr(xf86Info.consoleFd, TCSANOW, &kbdtty); return(xf86Info.consoleFd); diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c Tue Sep 17 03:06:14 2002 +++ xc/programs/Xserver/hw/xfree86/os-support/shared/VTsw_usl.c Mon Jan 5 16:34:30 2004 @@ -41,6 +41,9 @@ void xf86VTRequest(int sig) { + if (xf86NoVTSwitches) + return; + signal(sig, (void(*)(int))xf86VTRequest); xf86Info.vtRequestsPending = TRUE; return; @@ -49,12 +52,15 @@ Bool xf86VTSwitchPending() { - return(xf86Info.vtRequestsPending ? TRUE : FALSE); + return(!xf86NoVTSwitches && xf86Info.vtRequestsPending ? TRUE : FALSE); } Bool xf86VTSwitchAway() { + if (xf86NoVTSwitches) + return FALSE; + xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) { @@ -69,6 +75,9 @@ Bool xf86VTSwitchTo() { + if (xf86NoVTSwitches) + return TRUE; + xf86Info.vtRequestsPending = FALSE; if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { diff -ruN -x CVS -x *.orig xc.orig/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h --- xc.orig/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h Sat Jan 26 06:56:17 2002 +++ xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h Mon Jan 5 22:24:58 2004 @@ -228,6 +228,7 @@ extern int xf86KbdOn(void); extern int xf86KbdOff(void); extern void xf86KbdEvents(void); +extern void xf86ExtraKbdEvents(void); #ifdef XQUEUE extern int xf86XqueKbdProc(DeviceIntPtr, int); extern void xf86XqueEvents(void);