Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
libps2.h File Reference

Go to the source code of this file.

Data Structures

struct  ps2dev
 

Macros

#define PS2_CMD_GETID   0x02f2
 
#define PS2_CMD_RESET_BAT   0x02ff
 
#define PS2_RET_BAT   0xaa
 
#define PS2_RET_ID   0x00
 
#define PS2_RET_ACK   0xfa
 
#define PS2_RET_NAK   0xfe
 
#define PS2_RET_ERR   0xfc
 
#define PS2_FLAG_ACK   1 /* Waiting for ACK/NAK */
 
#define PS2_FLAG_CMD   2 /* Waiting for command to finish */
 
#define PS2_FLAG_CMD1   4 /* Waiting for the first byte of command response */
 
#define PS2_FLAG_WAITID   8 /* Command execiting is GET ID */
 
#define PS2_FLAG_NAK   16 /* Last transmission was NAKed */
 

Functions

void ps2_init (struct ps2dev *ps2dev, struct serio *serio)
 
int ps2_sendbyte (struct ps2dev *ps2dev, unsigned char byte, int timeout)
 
void ps2_drain (struct ps2dev *ps2dev, int maxbytes, int timeout)
 
void ps2_begin_command (struct ps2dev *ps2dev)
 
void ps2_end_command (struct ps2dev *ps2dev)
 
int __ps2_command (struct ps2dev *ps2dev, unsigned char *param, int command)
 
int ps2_command (struct ps2dev *ps2dev, unsigned char *param, int command)
 
int ps2_handle_ack (struct ps2dev *ps2dev, unsigned char data)
 
int ps2_handle_response (struct ps2dev *ps2dev, unsigned char data)
 
void ps2_cmd_aborted (struct ps2dev *ps2dev)
 
int ps2_is_keyboard_id (char id)
 

Macro Definition Documentation

#define PS2_CMD_GETID   0x02f2

Definition at line 14 of file libps2.h.

#define PS2_CMD_RESET_BAT   0x02ff

Definition at line 15 of file libps2.h.

#define PS2_FLAG_ACK   1 /* Waiting for ACK/NAK */

Definition at line 23 of file libps2.h.

#define PS2_FLAG_CMD   2 /* Waiting for command to finish */

Definition at line 24 of file libps2.h.

#define PS2_FLAG_CMD1   4 /* Waiting for the first byte of command response */

Definition at line 25 of file libps2.h.

#define PS2_FLAG_NAK   16 /* Last transmission was NAKed */

Definition at line 27 of file libps2.h.

#define PS2_FLAG_WAITID   8 /* Command execiting is GET ID */

Definition at line 26 of file libps2.h.

#define PS2_RET_ACK   0xfa

Definition at line 19 of file libps2.h.

#define PS2_RET_BAT   0xaa

Definition at line 17 of file libps2.h.

#define PS2_RET_ERR   0xfc

Definition at line 21 of file libps2.h.

#define PS2_RET_ID   0x00

Definition at line 18 of file libps2.h.

#define PS2_RET_NAK   0xfe

Definition at line 20 of file libps2.h.

Function Documentation

int __ps2_command ( struct ps2dev ps2dev,
unsigned char param,
int  command 
)

Definition at line 184 of file libps2.c.

void ps2_begin_command ( struct ps2dev ps2dev)

Definition at line 58 of file libps2.c.

void ps2_cmd_aborted ( struct ps2dev ps2dev)

Definition at line 364 of file libps2.c.

int ps2_command ( struct ps2dev ps2dev,
unsigned char param,
int  command 
)

Definition at line 256 of file libps2.c.

void ps2_drain ( struct ps2dev ps2dev,
int  maxbytes,
int  timeout 
)

Definition at line 81 of file libps2.c.

void ps2_end_command ( struct ps2dev ps2dev)

Definition at line 67 of file libps2.c.

int ps2_handle_ack ( struct ps2dev ps2dev,
unsigned char  data 
)

Definition at line 286 of file libps2.c.

int ps2_handle_response ( struct ps2dev ps2dev,
unsigned char  data 
)

Definition at line 344 of file libps2.c.

void ps2_init ( struct ps2dev ps2dev,
struct serio serio 
)

Definition at line 272 of file libps2.c.

int ps2_is_keyboard_id ( char  id)

Definition at line 108 of file libps2.c.

int ps2_sendbyte ( struct ps2dev ps2dev,
unsigned char  byte,
int  timeout 
)

Definition at line 38 of file libps2.c.