~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/libps2.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/libps2.h (Version linux-6.12-rc7) and /include/linux/libps2.h (Version linux-6.11.7)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 #ifndef _LIBPS2_H                                   2 #ifndef _LIBPS2_H
  3 #define _LIBPS2_H                                   3 #define _LIBPS2_H
  4                                                     4 
  5 /*                                                  5 /*
  6  * Copyright (C) 1999-2002 Vojtech Pavlik           6  * Copyright (C) 1999-2002 Vojtech Pavlik
  7  * Copyright (C) 2004 Dmitry Torokhov               7  * Copyright (C) 2004 Dmitry Torokhov
  8  */                                                 8  */
  9                                                     9 
 10 #include <linux/bitops.h>                          10 #include <linux/bitops.h>
 11 #include <linux/interrupt.h>                       11 #include <linux/interrupt.h>
 12 #include <linux/mutex.h>                           12 #include <linux/mutex.h>
 13 #include <linux/types.h>                           13 #include <linux/types.h>
 14 #include <linux/wait.h>                            14 #include <linux/wait.h>
 15                                                    15 
 16 struct ps2dev;                                     16 struct ps2dev;
 17                                                    17 
 18 /**                                                18 /**
 19  * enum ps2_disposition - indicates how receiv     19  * enum ps2_disposition - indicates how received byte should be handled
 20  * @PS2_PROCESS: pass to the main protocol han     20  * @PS2_PROCESS: pass to the main protocol handler, process normally
 21  * @PS2_IGNORE: skip the byte                      21  * @PS2_IGNORE: skip the byte
 22  * @PS2_ERROR: do not process the byte, abort      22  * @PS2_ERROR: do not process the byte, abort command in progress
 23  */                                                23  */
 24 enum ps2_disposition {                             24 enum ps2_disposition {
 25         PS2_PROCESS,                               25         PS2_PROCESS,
 26         PS2_IGNORE,                                26         PS2_IGNORE,
 27         PS2_ERROR,                                 27         PS2_ERROR,
 28 };                                                 28 };
 29                                                    29 
 30 typedef enum ps2_disposition (*ps2_pre_receive     30 typedef enum ps2_disposition (*ps2_pre_receive_handler_t)(struct ps2dev *, u8,
 31                                                    31                                                           unsigned int);
 32 typedef void (*ps2_receive_handler_t)(struct p     32 typedef void (*ps2_receive_handler_t)(struct ps2dev *, u8);
 33                                                    33 
 34 /**                                                34 /**
 35  * struct ps2dev - represents a device using P     35  * struct ps2dev - represents a device using PS/2 protocol
 36  * @serio: a serio port used by the PS/2 devic     36  * @serio: a serio port used by the PS/2 device
 37  * @cmd_mutex: a mutex ensuring that only one      37  * @cmd_mutex: a mutex ensuring that only one command is executing at a time
 38  * @wait: a waitqueue used to signal completio     38  * @wait: a waitqueue used to signal completion from the serio interrupt handler
 39  * @flags: various internal flags indicating s     39  * @flags: various internal flags indicating stages of PS/2 command execution
 40  * @cmdbuf: buffer holding command response        40  * @cmdbuf: buffer holding command response
 41  * @cmdcnt: outstanding number of bytes of the     41  * @cmdcnt: outstanding number of bytes of the command response
 42  * @nak: a byte transmitted by the device when     42  * @nak: a byte transmitted by the device when it refuses command
 43  * @pre_receive_handler: checks communication      43  * @pre_receive_handler: checks communication errors and returns disposition
 44  * (&enum ps2_disposition) of the received dat     44  * (&enum ps2_disposition) of the received data byte
 45  * @receive_handler: main handler of particula     45  * @receive_handler: main handler of particular PS/2 protocol, such as keyboard
 46  *   or mouse protocol                             46  *   or mouse protocol
 47  */                                                47  */
 48 struct ps2dev {                                    48 struct ps2dev {
 49         struct serio *serio;                       49         struct serio *serio;
 50         struct mutex cmd_mutex;                    50         struct mutex cmd_mutex;
 51         wait_queue_head_t wait;                    51         wait_queue_head_t wait;
 52         unsigned long flags;                       52         unsigned long flags;
 53         u8 cmdbuf[8];                              53         u8 cmdbuf[8];
 54         u8 cmdcnt;                                 54         u8 cmdcnt;
 55         u8 nak;                                    55         u8 nak;
 56                                                    56 
 57         ps2_pre_receive_handler_t pre_receive_     57         ps2_pre_receive_handler_t pre_receive_handler;
 58         ps2_receive_handler_t receive_handler;     58         ps2_receive_handler_t receive_handler;
 59 };                                                 59 };
 60                                                    60 
 61 void ps2_init(struct ps2dev *ps2dev, struct se     61 void ps2_init(struct ps2dev *ps2dev, struct serio *serio,
 62               ps2_pre_receive_handler_t pre_re     62               ps2_pre_receive_handler_t pre_receive_handler,
 63               ps2_receive_handler_t receive_ha     63               ps2_receive_handler_t receive_handler);
 64 int ps2_sendbyte(struct ps2dev *ps2dev, u8 byt     64 int ps2_sendbyte(struct ps2dev *ps2dev, u8 byte, unsigned int timeout);
 65 void ps2_drain(struct ps2dev *ps2dev, size_t m     65 void ps2_drain(struct ps2dev *ps2dev, size_t maxbytes, unsigned int timeout);
 66 void ps2_begin_command(struct ps2dev *ps2dev);     66 void ps2_begin_command(struct ps2dev *ps2dev);
 67 void ps2_end_command(struct ps2dev *ps2dev);       67 void ps2_end_command(struct ps2dev *ps2dev);
 68 int __ps2_command(struct ps2dev *ps2dev, u8 *p     68 int __ps2_command(struct ps2dev *ps2dev, u8 *param, unsigned int command);
 69 int ps2_command(struct ps2dev *ps2dev, u8 *par     69 int ps2_command(struct ps2dev *ps2dev, u8 *param, unsigned int command);
 70 int ps2_sliced_command(struct ps2dev *ps2dev,      70 int ps2_sliced_command(struct ps2dev *ps2dev, u8 command);
 71 bool ps2_is_keyboard_id(u8 id);                    71 bool ps2_is_keyboard_id(u8 id);
 72                                                    72 
 73 irqreturn_t ps2_interrupt(struct serio *serio,     73 irqreturn_t ps2_interrupt(struct serio *serio, u8 data, unsigned int flags);
 74                                                    74 
 75 #endif /* _LIBPS2_H */                             75 #endif /* _LIBPS2_H */
 76                                                    76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php