From eea3860a3795c78ee4e561e4032e36201fb3c0f0 Mon Sep 17 00:00:00 2001 From: James Lamanna Date: Mon, 26 Jan 2004 15:16:54 +0100 Subject: input: Add a new ioctl to hiddev, which allows multiple usages to be set in a single request. Also fixes sizes of fields in hiddev structs to use _uXX types. --- include/linux/hiddev.h | 74 +++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 31 deletions(-) (limited to 'include/linux') diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h index 9e6d27476a74..75c1fa0d2189 100644 --- a/include/linux/hiddev.h +++ b/include/linux/hiddev.h @@ -39,33 +39,33 @@ struct hiddev_event { }; struct hiddev_devinfo { - unsigned int bustype; - unsigned int busnum; - unsigned int devnum; - unsigned int ifnum; - short vendor; - short product; - short version; - unsigned num_applications; + __u32 bustype; + __u32 busnum; + __u32 devnum; + __u32 ifnum; + __s16 vendor; + __s16 product; + __s16 version; + __u32 num_applications; }; struct hiddev_collection_info { - unsigned index; - unsigned type; - unsigned usage; - unsigned level; + __u32 index; + __u32 type; + __u32 usage; + __u32 level; }; #define HID_STRING_SIZE 256 struct hiddev_string_descriptor { - int index; + __s32 index; char value[HID_STRING_SIZE]; }; struct hiddev_report_info { - unsigned report_type; - unsigned report_id; - unsigned num_fields; + __u32 report_type; + __u32 report_id; + __u32 num_fields; }; /* To do a GUSAGE/SUSAGE, fill in at least usage_code, report_type and @@ -88,20 +88,20 @@ struct hiddev_report_info { #define HID_REPORT_TYPE_MAX 3 struct hiddev_field_info { - unsigned report_type; - unsigned report_id; - unsigned field_index; - unsigned maxusage; - unsigned flags; - unsigned physical; /* physical usage for this field */ - unsigned logical; /* logical usage for this field */ - unsigned application; /* application usage for this field */ + __u32 report_type; + __u32 report_id; + __u32 field_index; + __u32 maxusage; + __u32 flags; + __u32 physical; /* physical usage for this field */ + __u32 logical; /* logical usage for this field */ + __u32 application; /* application usage for this field */ __s32 logical_minimum; __s32 logical_maximum; __s32 physical_minimum; __s32 physical_maximum; - unsigned unit_exponent; - unsigned unit; + __u32 unit_exponent; + __u32 unit; }; /* Fill in report_type, report_id and field_index to get the information on a @@ -118,14 +118,22 @@ struct hiddev_field_info { #define HID_FIELD_BUFFERED_BYTE 0x100 struct hiddev_usage_ref { - unsigned report_type; - unsigned report_id; - unsigned field_index; - unsigned usage_index; - unsigned usage_code; + __u32 report_type; + __u32 report_id; + __u32 field_index; + __u32 usage_index; + __u32 usage_code; __s32 value; }; +/* hiddev_usage_ref_multi is used for sending multiple bytes to a control. + * It really manifests itself as setting the value of consecutive usages */ +struct hiddev_usage_ref_multi { + struct hiddev_usage_ref uref; + __u32 num_values; + __s32 values[HID_MAX_USAGES]; +}; + /* FIELD_INDEX_NONE is returned in read() data from the kernel when flags * is set to (HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT) and a new report has * been sent by the device @@ -161,6 +169,10 @@ struct hiddev_usage_ref { #define HIDIOCGCOLLECTIONINFO _IOWR('H', 0x11, struct hiddev_collection_info) #define HIDIOCGPHYS(len) _IOC(_IOC_READ, 'H', 0x12, len) +/* For writing/reading to multiple/consecutive usages */ +#define HIDIOCGUSAGES _IOWR('H', 0x13, struct hiddev_usage_ref_multi) +#define HIDIOCSUSAGES _IOW('H', 0x14, struct hiddev_usage_ref_multi) + /* * Flags to be used in HIDIOCSFLAG */ -- cgit v1.2.3 From 99f30a27d75b5b3a9a18ce193b792f553ec2eb2d Mon Sep 17 00:00:00 2001 From: Aristeu Sergio Rozanski Filho Date: Tue, 27 Jan 2004 23:01:27 +0100 Subject: input: Remove the obsolete "busmouse.c" helper driver. --- arch/arm26/Kconfig | 5 ----- drivers/char/Kconfig | 24 ------------------------ drivers/char/Makefile | 1 - include/linux/miscdevice.h | 1 - 4 files changed, 31 deletions(-) (limited to 'include/linux') diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig index 05a9a2e55667..2862f0afa2cb 100644 --- a/arch/arm26/Kconfig +++ b/arch/arm26/Kconfig @@ -216,11 +216,6 @@ source "drivers/input/Kconfig" source "drivers/char/Kconfig" -config KBDMOUSE - bool - depends on ARCH_ACORN && BUSMOUSE=y - default y - source "drivers/media/Kconfig" source "fs/Kconfig" diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 4afb1bb01e83..8b7b63ea9690 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -588,30 +588,6 @@ config PC9800_OLDLP_CONSOLE bool "Support for console on line printer" depends on PC9800_OLDLP - -menu "Mice" - -config BUSMOUSE - tristate "Bus Mouse Support" - ---help--- - Say Y here if your machine has a bus mouse as opposed to a serial - mouse. Most people have a regular serial MouseSystem or - Microsoft mouse (made by Logitech) that plugs into a COM port - (rectangular with 9 or 25 pins). These people say N here. - - If you have a laptop, you either have to check the documentation or - experiment a bit to find out whether the trackball is a serial mouse - or not; it's best to say Y here for you. - - This is the generic bus mouse driver code. If you have a bus mouse, - you will have to say Y here and also to the specific driver for your - mouse below. - - To compile this driver as a module, choose M here: the - module will be called busmouse. - -endmenu - config QIC02_TAPE tristate "QIC-02 tape support" help diff --git a/drivers/char/Makefile b/drivers/char/Makefile index ca8aa47ef43e..130df75eb098 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -49,7 +49,6 @@ obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o -obj-$(CONFIG_BUSMOUSE) += busmouse.o obj-$(CONFIG_DTLK) += dtlk.o obj-$(CONFIG_R3964) += n_r3964.o obj-$(CONFIG_APPLICOM) += applicom.o diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 98f61665d4c2..89b87832c769 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -3,7 +3,6 @@ #include #include -#define BUSMOUSE_MINOR 0 #define PSMOUSE_MINOR 1 #define MS_BUSMOUSE_MINOR 2 #define ATIXL_BUSMOUSE_MINOR 3 -- cgit v1.2.3 From 912f9f42ddf8973b1294ecc7672af6c31cb6a0ff Mon Sep 17 00:00:00 2001 From: Jan-Benedict Glaw Date: Tue, 2 Mar 2004 15:47:14 +0100 Subject: input: Add serio entries for LK keyboards. --- include/linux/serio.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/serio.h b/include/linux/serio.h index d99e973302de..28f62471af10 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -117,6 +117,7 @@ static __inline__ void serio_cleanup(struct serio *serio) #define SERIO_MZ 0x05 #define SERIO_MZP 0x06 #define SERIO_MZPP 0x07 +#define SERIO_VSXXXAA 0x08 #define SERIO_SUNKBD 0x10 #define SERIO_WARRIOR 0x18 #define SERIO_SPACEORB 0x19 @@ -134,6 +135,7 @@ static __inline__ void serio_cleanup(struct serio *serio) #define SERIO_HIL 0x25 #define SERIO_SNES232 0x26 #define SERIO_SEMTECH 0x27 +#define SERIO_LKKBD 0x28 #define SERIO_ID 0xff00UL #define SERIO_EXTRA 0xff0000UL -- cgit v1.2.3 From dfd797720ab97f536696c5113945e434605756dc Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 2 Mar 2004 14:32:43 -0500 Subject: Introduce module_param_array_named to allow for module options with name different form corresponding array variable. Allows using short (but descriptive) option names without hurting code readability. Modeled after module_param_named. --- include/linux/moduleparam.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index cbca00722b5c..e9d6a16d3fef 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -126,13 +126,16 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); #define param_check_invbool(name, p) __param_check(name, p, int) /* Comma-separated array: num is set to number they actually specified. */ -#define module_param_array(name, type, num, perm) \ +#define module_param_array_named(name, array, type, num, perm) \ static struct kparam_array __param_arr_##name \ - = { ARRAY_SIZE(name), &num, param_set_##type, param_get_##type, \ - sizeof(name[0]), name }; \ + = { ARRAY_SIZE(array), &num, param_set_##type, param_get_##type,\ + sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ &__param_arr_##name, perm) +#define module_param_array(name, type, num, perm) \ + module_param_array_named(name, name, type, num, perm) + extern int param_array_set(const char *val, struct kernel_param *kp); extern int param_array_get(char *buffer, struct kernel_param *kp); -- cgit v1.2.3 From e6bfc7535780721ad6430e52d25adf5a49fab418 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 2 Mar 2004 14:35:47 -0500 Subject: Setup: introduce __obsolete_setup macro to denote truly obsolete parameters. Whenever such parameter is specified kernel will complain that "Parameter %s is obsolete, ignored" --- include/linux/init.h | 22 +++++++++++++++++----- init/main.c | 7 +++++-- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'include/linux') diff --git a/include/linux/init.h b/include/linux/init.h index 0ab73cff6c48..45069e275b3d 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -110,12 +110,21 @@ struct obs_kernel_param { }; /* OBSOLETE: see moduleparam.h for the right way. */ -#define __setup(str, fn) \ - static char __setup_str_##fn[] __initdata = str; \ - static struct obs_kernel_param __setup_##fn \ +#define __setup_param(str, unique_id, fn) \ + static char __setup_str_##unique_id[] __initdata = str; \ + static struct obs_kernel_param __setup_##unique_id \ __attribute_used__ \ __attribute__((__section__(".init.setup"))) \ - = { __setup_str_##fn, fn } + = { __setup_str_##unique_id, fn } + +#define __setup_null_param(str, unique_id) \ + __setup_param(str, unique_id, NULL) + +#define __setup(str, fn) \ + __setup_param(str, fn, fn) + +#define __obsolete_setup(str) \ + __setup_null_param(str, __LINE__) #endif /* __ASSEMBLY__ */ @@ -172,7 +181,10 @@ struct obs_kernel_param { { return exitfn; } \ void cleanup_module(void) __attribute__((alias(#exitfn))); -#define __setup(str,func) /* nothing */ +#define __setup_param(str, unique_id, fn) /* nothing */ +#define __setup_null_param(str, unique_id) /* nothing */ +#define __setup(str, func) /* nothing */ +#define __obsolete_setup(str) /* nothing */ #endif /* Data marked not to be saved by software_suspend() */ diff --git a/init/main.c b/init/main.c index 74fce35f2598..820764acf8d6 100644 --- a/init/main.c +++ b/init/main.c @@ -155,8 +155,11 @@ static int __init obsolete_checksetup(char *line) p = &__setup_start; do { int n = strlen(p->str); - if (!strncmp(line,p->str,n)) { - if (p->setup_func(line+n)) + if (!strncmp(line, p->str, n)) { + if (!p->setup_func) { + printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str); + return 1; + } else if (p->setup_func(line + n)) return 1; } p++; -- cgit v1.2.3