patch-2.3.40 linux/drivers/usb/keybdev.c

Next file: linux/drivers/usb/mousedev.c
Previous file: linux/drivers/usb/joydev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.39/linux/drivers/usb/keybdev.c linux/drivers/usb/keybdev.c
@@ -34,6 +34,7 @@
 #include <linux/malloc.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/kbd_kern.h>
 
 #ifdef CONFIG_X86
 
@@ -57,6 +58,21 @@
 
 #endif
 
+struct input_handler keybdev_handler;
+
+void keybdev_ledfunc(unsigned int led)
+{
+	struct input_handle *handle;	
+
+	for (handle = keybdev_handler.handle; handle; handle = handle->hnext) {
+
+		input_event(handle->dev, EV_LED, LED_SCROLLL, !!(led & 0x01));
+		input_event(handle->dev, EV_LED, LED_NUML,    !!(led & 0x02));
+		input_event(handle->dev, EV_LED, LED_CAPSL,   !!(led & 0x04));
+
+	}
+}
+
 void keybdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int down)
 {
 	if (type != EV_KEY || code > 255) return;
@@ -96,6 +112,7 @@
 #error "Cannot generate rawmode keyboard for your architecture yet."
 #endif
 
+	mark_bh(KEYBOARD_BH);
 }
 
 static int keybdev_connect(struct input_handler *handler, struct input_dev *dev)
@@ -137,6 +154,7 @@
 #ifdef MODULE
 void cleanup_module(void)
 {
+	kbd_ledfunc = NULL;
 	input_unregister_handler(&keybdev_handler);
 }
 int init_module(void)
@@ -145,5 +163,6 @@
 #endif
 {
 	input_register_handler(&keybdev_handler);
+	kbd_ledfunc = keybdev_ledfunc;
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)