Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
atkbd.c File Reference
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/workqueue.h>
#include <linux/libps2.h>
#include <linux/mutex.h>
#include <linux/dmi.h>

Go to the source code of this file.

Data Structures

struct  atkbd
 

Macros

#define DRIVER_DESC   "AT and PS/2 keyboard driver"
 
#define ATKBD_KEYMAP_SIZE   512
 
#define ATKBD_CMD_SETLEDS   0x10ed
 
#define ATKBD_CMD_GSCANSET   0x11f0
 
#define ATKBD_CMD_SSCANSET   0x10f0
 
#define ATKBD_CMD_GETID   0x02f2
 
#define ATKBD_CMD_SETREP   0x10f3
 
#define ATKBD_CMD_ENABLE   0x00f4
 
#define ATKBD_CMD_RESET_DIS   0x00f5 /* Reset to defaults and disable */
 
#define ATKBD_CMD_RESET_DEF   0x00f6 /* Reset to defaults */
 
#define ATKBD_CMD_SETALL_MB   0x00f8 /* Set all keys to give break codes */
 
#define ATKBD_CMD_SETALL_MBR   0x00fa /* ... and repeat */
 
#define ATKBD_CMD_RESET_BAT   0x02ff
 
#define ATKBD_CMD_RESEND   0x00fe
 
#define ATKBD_CMD_EX_ENABLE   0x10ea
 
#define ATKBD_CMD_EX_SETLEDS   0x20eb
 
#define ATKBD_CMD_OK_GETID   0x02e8
 
#define ATKBD_RET_ACK   0xfa
 
#define ATKBD_RET_NAK   0xfe
 
#define ATKBD_RET_BAT   0xaa
 
#define ATKBD_RET_EMUL0   0xe0
 
#define ATKBD_RET_EMUL1   0xe1
 
#define ATKBD_RET_RELEASE   0xf0
 
#define ATKBD_RET_HANJA   0xf1
 
#define ATKBD_RET_HANGEUL   0xf2
 
#define ATKBD_RET_ERR   0xff
 
#define ATKBD_KEY_UNKNOWN   0
 
#define ATKBD_KEY_NULL   255
 
#define ATKBD_SCR_1   0xfffe
 
#define ATKBD_SCR_2   0xfffd
 
#define ATKBD_SCR_4   0xfffc
 
#define ATKBD_SCR_8   0xfffb
 
#define ATKBD_SCR_CLICK   0xfffa
 
#define ATKBD_SCR_LEFT   0xfff9
 
#define ATKBD_SCR_RIGHT   0xfff8
 
#define ATKBD_SPECIAL   ATKBD_SCR_RIGHT
 
#define ATKBD_LED_EVENT_BIT   0
 
#define ATKBD_REP_EVENT_BIT   1
 
#define ATKBD_XL_ERR   0x01
 
#define ATKBD_XL_BAT   0x02
 
#define ATKBD_XL_ACK   0x04
 
#define ATKBD_XL_NAK   0x08
 
#define ATKBD_XL_HANGEUL   0x10
 
#define ATKBD_XL_HANJA   0x20
 
#define ATKBD_DEFINE_ATTR(_name)
 
#define ATKBD_DEFINE_RO_ATTR(_name)
 

Functions

 MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>")
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 
 module_param_named (set, atkbd_set, int, 0)
 
 MODULE_PARM_DESC (set,"Select keyboard code set (2 = default, 3 = PS/2 native)")
 
 module_param_named (reset, atkbd_reset, bool, 0)
 
 MODULE_PARM_DESC (reset,"Reset keyboard during initialization")
 
 module_param_named (softrepeat, atkbd_softrepeat, bool, 0)
 
 MODULE_PARM_DESC (softrepeat,"Use software keyboard repeat")
 
 module_param_named (softraw, atkbd_softraw, bool, 0)
 
 MODULE_PARM_DESC (softraw,"Use software generated rawmode")
 
 module_param_named (scroll, atkbd_scroll, bool, 0)
 
 MODULE_PARM_DESC (scroll,"Enable scroll-wheel on MS Office and similar keyboards")
 
 module_param_named (extra, atkbd_extra, bool, 0)
 
 MODULE_PARM_DESC (extra,"Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards")
 
 module_param_named (terminal, atkbd_terminal, bool, 0)
 
 MODULE_PARM_DESC (terminal,"Enable break codes on an IBM Terminal keyboard connected via AT/PS2")
 
 ATKBD_DEFINE_ATTR (extra)
 
 ATKBD_DEFINE_ATTR (force_release)
 
 ATKBD_DEFINE_ATTR (scroll)
 
 ATKBD_DEFINE_ATTR (set)
 
 ATKBD_DEFINE_ATTR (softrepeat)
 
 ATKBD_DEFINE_ATTR (softraw)
 
 ATKBD_DEFINE_RO_ATTR (err_count)
 
 MODULE_DEVICE_TABLE (serio, atkbd_serio_ids)
 
 module_init (atkbd_init)
 
 module_exit (atkbd_exit)
 

Macro Definition Documentation

#define ATKBD_CMD_ENABLE   0x00f4

Definition at line 140 of file atkbd.c.

#define ATKBD_CMD_EX_ENABLE   0x10ea

Definition at line 147 of file atkbd.c.

#define ATKBD_CMD_EX_SETLEDS   0x20eb

Definition at line 148 of file atkbd.c.

#define ATKBD_CMD_GETID   0x02f2

Definition at line 138 of file atkbd.c.

#define ATKBD_CMD_GSCANSET   0x11f0

Definition at line 136 of file atkbd.c.

#define ATKBD_CMD_OK_GETID   0x02e8

Definition at line 149 of file atkbd.c.

#define ATKBD_CMD_RESEND   0x00fe

Definition at line 146 of file atkbd.c.

#define ATKBD_CMD_RESET_BAT   0x02ff

Definition at line 145 of file atkbd.c.

#define ATKBD_CMD_RESET_DEF   0x00f6 /* Reset to defaults */

Definition at line 142 of file atkbd.c.

#define ATKBD_CMD_RESET_DIS   0x00f5 /* Reset to defaults and disable */

Definition at line 141 of file atkbd.c.

#define ATKBD_CMD_SETALL_MB   0x00f8 /* Set all keys to give break codes */

Definition at line 143 of file atkbd.c.

#define ATKBD_CMD_SETALL_MBR   0x00fa /* ... and repeat */

Definition at line 144 of file atkbd.c.

#define ATKBD_CMD_SETLEDS   0x10ed

Definition at line 135 of file atkbd.c.

#define ATKBD_CMD_SETREP   0x10f3

Definition at line 139 of file atkbd.c.

#define ATKBD_CMD_SSCANSET   0x10f0

Definition at line 137 of file atkbd.c.

#define ATKBD_DEFINE_ATTR (   _name)
Value:
static ssize_t atkbd_show_##_name(struct atkbd *, char *); \
static ssize_t atkbd_set_##_name(struct atkbd *, const char *, size_t); \
static ssize_t atkbd_do_show_##_name(struct device *d, \
struct device_attribute *attr, char *b) \
{ \
return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \
} \
static ssize_t atkbd_do_set_##_name(struct device *d, \
struct device_attribute *attr, const char *b, size_t s) \
{ \
return atkbd_attr_set_helper(d, b, s, atkbd_set_##_name); \
} \
static struct device_attribute atkbd_attr_##_name = \
__ATTR(_name, S_IWUSR | S_IRUGO, atkbd_do_show_##_name, atkbd_do_set_##_name);

Definition at line 250 of file atkbd.c.

#define ATKBD_DEFINE_RO_ATTR (   _name)
Value:
static ssize_t atkbd_show_##_name(struct atkbd *, char *); \
static ssize_t atkbd_do_show_##_name(struct device *d, \
struct device_attribute *attr, char *b) \
{ \
return atkbd_attr_show_helper(d, b, atkbd_show_##_name); \
} \
static struct device_attribute atkbd_attr_##_name = \
__ATTR(_name, S_IRUGO, atkbd_do_show_##_name, NULL);

Definition at line 273 of file atkbd.c.

#define ATKBD_KEY_NULL   255

Definition at line 162 of file atkbd.c.

#define ATKBD_KEY_UNKNOWN   0

Definition at line 161 of file atkbd.c.

#define ATKBD_KEYMAP_SIZE   512

Definition at line 75 of file atkbd.c.

#define ATKBD_LED_EVENT_BIT   0

Definition at line 174 of file atkbd.c.

#define ATKBD_REP_EVENT_BIT   1

Definition at line 175 of file atkbd.c.

#define ATKBD_RET_ACK   0xfa

Definition at line 151 of file atkbd.c.

#define ATKBD_RET_BAT   0xaa

Definition at line 153 of file atkbd.c.

#define ATKBD_RET_EMUL0   0xe0

Definition at line 154 of file atkbd.c.

#define ATKBD_RET_EMUL1   0xe1

Definition at line 155 of file atkbd.c.

#define ATKBD_RET_ERR   0xff

Definition at line 159 of file atkbd.c.

#define ATKBD_RET_HANGEUL   0xf2

Definition at line 158 of file atkbd.c.

#define ATKBD_RET_HANJA   0xf1

Definition at line 157 of file atkbd.c.

#define ATKBD_RET_NAK   0xfe

Definition at line 152 of file atkbd.c.

#define ATKBD_RET_RELEASE   0xf0

Definition at line 156 of file atkbd.c.

#define ATKBD_SCR_1   0xfffe

Definition at line 164 of file atkbd.c.

#define ATKBD_SCR_2   0xfffd

Definition at line 165 of file atkbd.c.

#define ATKBD_SCR_4   0xfffc

Definition at line 166 of file atkbd.c.

#define ATKBD_SCR_8   0xfffb

Definition at line 167 of file atkbd.c.

#define ATKBD_SCR_CLICK   0xfffa

Definition at line 168 of file atkbd.c.

#define ATKBD_SCR_LEFT   0xfff9

Definition at line 169 of file atkbd.c.

#define ATKBD_SCR_RIGHT   0xfff8

Definition at line 170 of file atkbd.c.

#define ATKBD_SPECIAL   ATKBD_SCR_RIGHT

Definition at line 172 of file atkbd.c.

#define ATKBD_XL_ACK   0x04

Definition at line 179 of file atkbd.c.

#define ATKBD_XL_BAT   0x02

Definition at line 178 of file atkbd.c.

#define ATKBD_XL_ERR   0x01

Definition at line 177 of file atkbd.c.

#define ATKBD_XL_HANGEUL   0x10

Definition at line 181 of file atkbd.c.

#define ATKBD_XL_HANJA   0x20

Definition at line 182 of file atkbd.c.

#define ATKBD_XL_NAK   0x08

Definition at line 180 of file atkbd.c.

#define DRIVER_DESC   "AT and PS/2 keyboard driver"

Definition at line 32 of file atkbd.c.

Function Documentation

ATKBD_DEFINE_ATTR ( extra  )
ATKBD_DEFINE_ATTR ( force_release  )
ATKBD_DEFINE_ATTR ( scroll  )
ATKBD_DEFINE_ATTR ( set  )
ATKBD_DEFINE_ATTR ( softrepeat  )
ATKBD_DEFINE_ATTR ( softraw  )
ATKBD_DEFINE_RO_ATTR ( err_count  )
MODULE_AUTHOR ( "Vojtech Pavlik <[email protected]>"  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( serio  ,
atkbd_serio_ids   
)
module_exit ( atkbd_exit  )
module_init ( atkbd_init  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( set  ,
atkbd_set  ,
int  ,
 
)
module_param_named ( reset  ,
atkbd_reset  ,
bool  ,
 
)
module_param_named ( softrepeat  ,
atkbd_softrepeat  ,
bool  ,
 
)
module_param_named ( softraw  ,
atkbd_softraw  ,
bool  ,
 
)
module_param_named ( scroll  ,
atkbd_scroll  ,
bool  ,
 
)
module_param_named ( extra  ,
atkbd_extra  ,
bool  ,
 
)
module_param_named ( terminal  ,
atkbd_terminal  ,
bool  ,
 
)
MODULE_PARM_DESC ( set  ,
"Select keyboard code set (2 = default, 3 = PS/2 native)"   
)
MODULE_PARM_DESC ( reset  ,
"Reset keyboard during initialization"   
)
MODULE_PARM_DESC ( softrepeat  ,
"Use software keyboard repeat"   
)
MODULE_PARM_DESC ( softraw  ,
"Use software generated rawmode"   
)
MODULE_PARM_DESC ( scroll  ,
"Enable scroll-wheel on MS Office and similar keyboards"   
)
MODULE_PARM_DESC ( extra  ,
"Enable extra LEDs and keys on IBM  RapidAcces,
EzKey and similar keyboards"   
)
MODULE_PARM_DESC ( terminal  ,
"Enable break codes on an IBM Terminal keyboard connected via AT/PS2"   
)

Variable Documentation

unsigned short keycode

Definition at line 185 of file atkbd.c.

unsigned char set2

Definition at line 186 of file atkbd.c.