--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c.orig	2003-07-29 09:35:09.245189864 +0200
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c	2003-07-29 09:38:13.303208792 +0200
@@ -65,7 +65,8 @@
 
 /* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
  * from util-linux-2.9t package */
-
+/* Linux 2.5 and Linux 2.6 use 'period' instead of 'rate'
+ * Nico Schottelius <nico-linux-xfree86@schottelius.org> */
 #include <linux/kd.h>
 #ifdef __sparc__
 #include <asm/param.h>
@@ -87,7 +88,7 @@
    struct kbd_repeat kbdrep_s;
 
    /* don't change, just test */
-   kbdrep_s.rate = -1;
+   kbdrep_s.period = -1;
    kbdrep_s.delay = -1;
    if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
        return 0;
@@ -95,11 +96,11 @@
 
    /* do the change */
    if (rate == 0)				/* switch repeat off */
-     kbdrep_s.rate = 0;
+     kbdrep_s.period = 0;
    else
-     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
-   if (kbdrep_s.rate < 1)
-     kbdrep_s.rate = 1;
+     kbdrep_s.period  = 10000 / rate;		/* convert cps to msec */
+   if (kbdrep_s.period < 1)
+     kbdrep_s.period = 1;
    kbdrep_s.delay = delay;
    if (kbdrep_s.delay < 1)
      kbdrep_s.delay = 1;
@@ -124,10 +125,10 @@
    if (fd == -1) 
      return 0;   
 
-   kbdrate_s.rate = (rate + 5) / 10;  /* must be integer, so round up */
+   kbdrate_s.period = (rate + 5) / 10;  /* must be integer, so round up */
    kbdrate_s.delay = delay * HZ / 1000;  /* convert ms to Hz */
-   if (kbdrate_s.rate > 50)
-     kbdrate_s.rate = 50;
+   if (kbdrate_s.period > 50)
+     kbdrate_s.period = 50;
 
    if (ioctl( fd, KIOCSRATE, &kbdrate_s ))
      return 0;

--- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c.orig	2003-07-29 12:43:21.224548072 +0200
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c	2003-07-29 12:46:50.243772320 +0200
@@ -92,6 +92,8 @@
 
 /* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
  * from util-linux-2.9t package */
+/* changes for Linux 2.6 by
+ * Nico Schottelius <nico-linux-xfree86@schottelius.org> */
 
 
 #ifdef __sparc__
@@ -107,7 +109,7 @@
    struct kbd_repeat kbdrep_s;
 
    /* don't change, just test */
-   kbdrep_s.rate = -1;
+   kbdrep_s.period = -1;
    kbdrep_s.delay = -1;
    if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
        return 0;
@@ -115,11 +117,11 @@
 
    /* do the change */
    if (rate == 0)				/* switch repeat off */
-     kbdrep_s.rate = 0;
+     kbdrep_s.period = 0;
    else
-     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
-   if (kbdrep_s.rate < 1)
-     kbdrep_s.rate = 1;
+     kbdrep_s.period  = 10000 / rate;		/* convert cps to msec */
+   if (kbdrep_s.period < 1)
+     kbdrep_s.period = 1;
    kbdrep_s.delay = delay;
    if (kbdrep_s.delay < 1)
      kbdrep_s.delay = 1;
@@ -144,10 +146,10 @@
    if (fd == -1) 
      return 0;   
 
-   kbdrate_s.rate = (rate + 5) / 10;  /* must be integer, so round up */
+   kbdrate_s.period = (rate + 5) / 10;  /* must be integer, so round up */
    kbdrate_s.delay = delay * HZ / 1000;  /* convert ms to Hz */
-   if (kbdrate_s.rate > 50)
-     kbdrate_s.rate = 50;
+   if (kbdrate_s.period > 50)
+     kbdrate_s.period = 50;
 
    if (ioctl( fd, KIOCSRATE, &kbdrate_s ))
      return 0;
