Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 152655 | Differences between
and this patch

Collapse All | Expand All

(-)a/configure.ac (+19 lines)
Lines 1061-1066 dnl has it in libc), or if libdl is need Link Here
1061
		  *)
1061
		  *)
1062
			;;
1062
			;;
1063
		esac
1063
		esac
1064
1065
		# check whether struct kbd_repeat has the 'period' field.
1066
		# on kernels < 2.5.42 it's called 'rate' instead.
1067
		AC_TRY_COMPILE([
1068
#include <linux/kd.h>
1069
#ifdef __sparc__
1070
#include <asm/param.h>
1071
#include <asm/kbio.h>
1072
#endif
1073
],[
1074
int main () { 
1075
	struct kbd_repeat k;
1076
	k.period = 0;
1077
	return 0;
1078
}],
1079
		[period_field="period"],
1080
		[period_field="rate"])
1081
		AC_DEFINE_UNQUOTED(LNX_KBD_PERIOD_NAME, [$period_field],
1082
		                   [Name of the period field in struct kbd_repeat])
1064
		;;
1083
		;;
1065
	  freebsd* | kfreebsd*-gnu)
1084
	  freebsd* | kfreebsd*-gnu)
1066
	  	XORG_OS="freebsd"
1085
	  	XORG_OS="freebsd"
(-)a/hw/xfree86/os-support/linux/lnx_io.c (-33 / +5 lines)
Lines 67-91 xf86GetKbdLeds() Link Here
67
	return(leds);
67
	return(leds);
68
}
68
}
69
69
70
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
71
 * from util-linux-2.9t package */
72
73
#include <linux/kd.h>
74
#include <linux/version.h>
75
#ifdef __sparc__
76
#include <asm/param.h>
77
#include <asm/kbio.h>
78
#endif
79
80
/* Deal with spurious kernel header change in struct kbd_repeat.
81
   We undo this define after the routine using that struct is over,
82
   so as not to interfere with other 'rate' elements.  */
83
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
84
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
85
#  define rate period
86
# endif
87
#endif
88
89
static int
70
static int
90
KDKBDREP_ioctl_ok(int rate, int delay) {
71
KDKBDREP_ioctl_ok(int rate, int delay) {
91
#if defined(KDKBDREP) && !defined(__sparc__)
72
#if defined(KDKBDREP) && !defined(__sparc__)
Lines 94-111 #if defined(KDKBDREP) && !defined(__spar Link Here
94
   struct kbd_repeat kbdrep_s;
75
   struct kbd_repeat kbdrep_s;
95
76
96
   /* don't change, just test */
77
   /* don't change, just test */
97
   kbdrep_s.rate = -1;
78
   kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
98
   kbdrep_s.delay = -1;
79
   kbdrep_s.delay = -1;
99
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
80
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
100
       return 0;
81
       return 0;
101
   }
82
   }
102
   /* do the change */
83
   /* do the change */
103
   if (rate == 0)				/* switch repeat off */
84
   if (rate == 0)				/* switch repeat off */
104
     kbdrep_s.rate = 0;
85
     kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
105
   else
86
   else
106
     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
87
     kbdrep_s.LNX_KBD_PERIOD_NAME = 10000 / rate; /* convert cps to msec */
107
   if (kbdrep_s.rate < 1)
88
   if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
108
     kbdrep_s.rate = 1;
89
     kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
109
   kbdrep_s.delay = delay;
90
   kbdrep_s.delay = delay;
110
   if (kbdrep_s.delay < 1)
91
   if (kbdrep_s.delay < 1)
111
     kbdrep_s.delay = 1;
92
     kbdrep_s.delay = 1;
Lines 120-134 #else /* no KDKBDREP */ Link Here
120
#endif /* KDKBDREP */
101
#endif /* KDKBDREP */
121
}
102
}
122
103
123
#undef rate
124
125
/* Undo the earlier define for the struct kbd_repeat problem. */
126
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
127
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
128
#  undef rate
129
# endif
130
#endif
131
132
static int
104
static int
133
KIOCSRATE_ioctl_ok(int rate, int delay) {
105
KIOCSRATE_ioctl_ok(int rate, int delay) {
134
#ifdef KIOCSRATE
106
#ifdef KIOCSRATE
(-)a/hw/xfree86/os-support/linux/lnx_kbd.c (-33 / +5 lines)
Lines 97-121 GetKbdLeds(InputInfoPtr pInfo) Link Here
97
    return(leds);
97
    return(leds);
98
}
98
}
99
99
100
/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
101
 * from util-linux-2.9t package */
102
103
#include <linux/kd.h>
104
#include <linux/version.h>
105
#ifdef __sparc__
106
#include <asm/param.h>
107
#include <asm/kbio.h>
108
#endif
109
110
/* Deal with spurious kernel header change in struct kbd_repeat.
111
   We undo this define after the routine using that struct is over,
112
   so as not to interfere with other 'rate' elements.  */
113
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
114
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
115
#  define rate period
116
# endif
117
#endif
118
119
static int
100
static int
120
KDKBDREP_ioctl_ok(int rate, int delay) {
101
KDKBDREP_ioctl_ok(int rate, int delay) {
121
#if defined(KDKBDREP) && !defined(__sparc__)
102
#if defined(KDKBDREP) && !defined(__sparc__)
Lines 124-130 #if defined(KDKBDREP) && !defined(__spar Link Here
124
   struct kbd_repeat kbdrep_s;
105
   struct kbd_repeat kbdrep_s;
125
106
126
   /* don't change, just test */
107
   /* don't change, just test */
127
   kbdrep_s.rate = -1;
108
   kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
128
   kbdrep_s.delay = -1;
109
   kbdrep_s.delay = -1;
129
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
110
   if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
130
       return 0;
111
       return 0;
Lines 132-142 #if defined(KDKBDREP) && !defined(__spar Link Here
132
113
133
   /* do the change */
114
   /* do the change */
134
   if (rate == 0)				/* switch repeat off */
115
   if (rate == 0)				/* switch repeat off */
135
     kbdrep_s.rate = 0;
116
     kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
136
   else
117
   else
137
     kbdrep_s.rate  = 10000 / rate;		/* convert cps to msec */
118
     kbdrep_s.LNX_KBD_PERIOD_NAME = 10000 / rate; /* convert cps to msec */
138
   if (kbdrep_s.rate < 1)
119
   if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
139
     kbdrep_s.rate = 1;
120
     kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
140
   kbdrep_s.delay = delay;
121
   kbdrep_s.delay = delay;
141
   if (kbdrep_s.delay < 1)
122
   if (kbdrep_s.delay < 1)
142
     kbdrep_s.delay = 1;
123
     kbdrep_s.delay = 1;
Lines 151-165 #else /* no KDKBDREP */ Link Here
151
#endif /* KDKBDREP */
132
#endif /* KDKBDREP */
152
}
133
}
153
134
154
#undef rate
155
156
/* Undo the earlier define for the struct kbd_repeat problem. */
157
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
158
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
159
#  undef rate
160
# endif
161
#endif
162
163
static int
135
static int
164
KIOCSRATE_ioctl_ok(int rate, int delay) {
136
KIOCSRATE_ioctl_ok(int rate, int delay) {
165
#ifdef KIOCSRATE
137
#ifdef KIOCSRATE
(-)a/include/xorg-config.h.in (+3 lines)
Lines 106-109 #undef HAS_APERTURE_DRV Link Here
106
/* Has backtrace support */
106
/* Has backtrace support */
107
#undef HAVE_BACKTRACE
107
#undef HAVE_BACKTRACE
108
108
109
/* Name of the period field in struct kbd_repeat */
110
#undef LNX_KBD_PERIOD_NAME
111
109
#endif /* _XORG_CONFIG_H_ */
112
#endif /* _XORG_CONFIG_H_ */

Return to bug 152655