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

TOMOYO Linux Cross Reference
Linux/include/xen/interface/io/kbdif.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/xen/interface/io/kbdif.h (Architecture i386) and /include/xen/interface/io/kbdif.h (Architecture alpha)


  1 /* SPDX-License-Identifier: MIT */                  1 /* SPDX-License-Identifier: MIT */
  2 /*                                                  2 /*
  3  * kbdif.h -- Xen virtual keyboard/mouse            3  * kbdif.h -- Xen virtual keyboard/mouse
  4  *                                                  4  *
  5  * Copyright (C) 2005 Anthony Liguori <aliguor      5  * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
  6  * Copyright (C) 2006 Red Hat, Inc., Markus Ar      6  * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
  7  */                                                 7  */
  8                                                     8 
  9 #ifndef __XEN_PUBLIC_IO_KBDIF_H__                   9 #ifndef __XEN_PUBLIC_IO_KBDIF_H__
 10 #define __XEN_PUBLIC_IO_KBDIF_H__                  10 #define __XEN_PUBLIC_IO_KBDIF_H__
 11                                                    11 
 12 /*                                                 12 /*
 13  *********************************************     13  *****************************************************************************
 14  *                     Feature and Parameter N     14  *                     Feature and Parameter Negotiation
 15  *********************************************     15  *****************************************************************************
 16  *                                                 16  *
 17  * The two halves of a para-virtual driver uti     17  * The two halves of a para-virtual driver utilize nodes within
 18  * XenStore to communicate capabilities and to     18  * XenStore to communicate capabilities and to negotiate operating parameters.
 19  * This section enumerates these nodes which r     19  * This section enumerates these nodes which reside in the respective front and
 20  * backend portions of XenStore, following Xen     20  * backend portions of XenStore, following XenBus convention.
 21  *                                                 21  *
 22  * All data in XenStore is stored as strings.      22  * All data in XenStore is stored as strings.  Nodes specifying numeric
 23  * values are encoded in decimal. Integer valu     23  * values are encoded in decimal. Integer value ranges listed below are
 24  * expressed as fixed sized integer types capa     24  * expressed as fixed sized integer types capable of storing the conversion
 25  * of a properly formated node string, without     25  * of a properly formated node string, without loss of information.
 26  *                                                 26  *
 27  *********************************************     27  *****************************************************************************
 28  *                            Backend XenBus N     28  *                            Backend XenBus Nodes
 29  *********************************************     29  *****************************************************************************
 30  *                                                 30  *
 31  *---------------------------- Features suppor     31  *---------------------------- Features supported ----------------------------
 32  *                                                 32  *
 33  * Capable backend advertises supported featur     33  * Capable backend advertises supported features by publishing
 34  * corresponding entries in XenStore and puts      34  * corresponding entries in XenStore and puts 1 as the value of the entry.
 35  * If a feature is not supported then 0 must b     35  * If a feature is not supported then 0 must be set or feature entry omitted.
 36  *                                                 36  *
 37  * feature-disable-keyboard                        37  * feature-disable-keyboard
 38  *      Values:         <uint>                     38  *      Values:         <uint>
 39  *                                                 39  *
 40  *      If there is no need to expose a virtua     40  *      If there is no need to expose a virtual keyboard device by the
 41  *      frontend then this must be set to 1.       41  *      frontend then this must be set to 1.
 42  *                                                 42  *
 43  * feature-disable-pointer                         43  * feature-disable-pointer
 44  *      Values:         <uint>                     44  *      Values:         <uint>
 45  *                                                 45  *
 46  *      If there is no need to expose a virtua     46  *      If there is no need to expose a virtual pointer device by the
 47  *      frontend then this must be set to 1.       47  *      frontend then this must be set to 1.
 48  *                                                 48  *
 49  * feature-abs-pointer                             49  * feature-abs-pointer
 50  *      Values:         <uint>                     50  *      Values:         <uint>
 51  *                                                 51  *
 52  *      Backends, which support reporting of a     52  *      Backends, which support reporting of absolute coordinates for pointer
 53  *      device should set this to 1.               53  *      device should set this to 1.
 54  *                                                 54  *
 55  * feature-multi-touch                             55  * feature-multi-touch
 56  *      Values:         <uint>                     56  *      Values:         <uint>
 57  *                                                 57  *
 58  *      Backends, which support reporting of m     58  *      Backends, which support reporting of multi-touch events
 59  *      should set this to 1.                      59  *      should set this to 1.
 60  *                                                 60  *
 61  * feature-raw-pointer                             61  * feature-raw-pointer
 62  *      Values:        <uint>                      62  *      Values:        <uint>
 63  *                                                 63  *
 64  *      Backends, which support reporting raw      64  *      Backends, which support reporting raw (unscaled) absolute coordinates
 65  *      for pointer devices should set this to     65  *      for pointer devices should set this to 1. Raw (unscaled) values have
 66  *      a range of [0, 0x7fff].                    66  *      a range of [0, 0x7fff].
 67  *                                                 67  *
 68  *-----------------------  Device Instance Par     68  *-----------------------  Device Instance Parameters ------------------------
 69  *                                                 69  *
 70  * unique-id                                       70  * unique-id
 71  *      Values:         <string>                   71  *      Values:         <string>
 72  *                                                 72  *
 73  *      After device instance initialization i     73  *      After device instance initialization it is assigned a unique ID,
 74  *      so every instance of the frontend can      74  *      so every instance of the frontend can be identified by the backend
 75  *      by this ID. This can be UUID or such.      75  *      by this ID. This can be UUID or such.
 76  *                                                 76  *
 77  *------------------------- Pointer Device Par     77  *------------------------- Pointer Device Parameters ------------------------
 78  *                                                 78  *
 79  * width                                           79  * width
 80  *      Values:         <uint>                     80  *      Values:         <uint>
 81  *                                                 81  *
 82  *      Maximum X coordinate (width) to be use     82  *      Maximum X coordinate (width) to be used by the frontend
 83  *      while reporting input events, pixels,      83  *      while reporting input events, pixels, [0; UINT32_MAX].
 84  *                                                 84  *
 85  * height                                          85  * height
 86  *      Values:         <uint>                     86  *      Values:         <uint>
 87  *                                                 87  *
 88  *      Maximum Y coordinate (height) to be us     88  *      Maximum Y coordinate (height) to be used by the frontend
 89  *      while reporting input events, pixels,      89  *      while reporting input events, pixels, [0; UINT32_MAX].
 90  *                                                 90  *
 91  *----------------------- Multi-touch Device P     91  *----------------------- Multi-touch Device Parameters ----------------------
 92  *                                                 92  *
 93  * multi-touch-num-contacts                        93  * multi-touch-num-contacts
 94  *      Values:         <uint>                     94  *      Values:         <uint>
 95  *                                                 95  *
 96  *      Number of simultaneous touches reporte     96  *      Number of simultaneous touches reported.
 97  *                                                 97  *
 98  * multi-touch-width                               98  * multi-touch-width
 99  *      Values:         <uint>                     99  *      Values:         <uint>
100  *                                                100  *
101  *      Width of the touch area to be used by     101  *      Width of the touch area to be used by the frontend
102  *      while reporting input events, pixels,     102  *      while reporting input events, pixels, [0; UINT32_MAX].
103  *                                                103  *
104  * multi-touch-height                             104  * multi-touch-height
105  *      Values:         <uint>                    105  *      Values:         <uint>
106  *                                                106  *
107  *      Height of the touch area to be used by    107  *      Height of the touch area to be used by the frontend
108  *      while reporting input events, pixels,     108  *      while reporting input events, pixels, [0; UINT32_MAX].
109  *                                                109  *
110  *********************************************    110  *****************************************************************************
111  *                            Frontend XenBus     111  *                            Frontend XenBus Nodes
112  *********************************************    112  *****************************************************************************
113  *                                                113  *
114  *------------------------------ Feature reque    114  *------------------------------ Feature request -----------------------------
115  *                                                115  *
116  * Capable frontend requests features from bac    116  * Capable frontend requests features from backend via setting corresponding
117  * entries to 1 in XenStore. Requests for feat    117  * entries to 1 in XenStore. Requests for features not advertised as supported
118  * by the backend have no effect.                 118  * by the backend have no effect.
119  *                                                119  *
120  * request-abs-pointer                            120  * request-abs-pointer
121  *      Values:         <uint>                    121  *      Values:         <uint>
122  *                                                122  *
123  *      Request backend to report absolute poi    123  *      Request backend to report absolute pointer coordinates
124  *      (XENKBD_TYPE_POS) instead of relative     124  *      (XENKBD_TYPE_POS) instead of relative ones (XENKBD_TYPE_MOTION).
125  *                                                125  *
126  * request-multi-touch                            126  * request-multi-touch
127  *      Values:         <uint>                    127  *      Values:         <uint>
128  *                                                128  *
129  *      Request backend to report multi-touch     129  *      Request backend to report multi-touch events.
130  *                                                130  *
131  * request-raw-pointer                            131  * request-raw-pointer
132  *      Values:         <uint>                    132  *      Values:         <uint>
133  *                                                133  *
134  *      Request backend to report raw unscaled    134  *      Request backend to report raw unscaled absolute pointer coordinates.
135  *      This option is only valid if request-a    135  *      This option is only valid if request-abs-pointer is also set.
136  *      Raw unscaled coordinates have the rang    136  *      Raw unscaled coordinates have the range [0, 0x7fff]
137  *                                                137  *
138  *----------------------- Request Transport Pa    138  *----------------------- Request Transport Parameters -----------------------
139  *                                                139  *
140  * event-channel                                  140  * event-channel
141  *      Values:         <uint>                    141  *      Values:         <uint>
142  *                                                142  *
143  *      The identifier of the Xen event channe    143  *      The identifier of the Xen event channel used to signal activity
144  *      in the ring buffer.                       144  *      in the ring buffer.
145  *                                                145  *
146  * page-gref                                      146  * page-gref
147  *      Values:         <uint>                    147  *      Values:         <uint>
148  *                                                148  *
149  *      The Xen grant reference granting permi    149  *      The Xen grant reference granting permission for the backend to map
150  *      a sole page in a single page sized eve    150  *      a sole page in a single page sized event ring buffer.
151  *                                                151  *
152  * page-ref                                       152  * page-ref
153  *      Values:         <uint>                    153  *      Values:         <uint>
154  *                                                154  *
155  *      OBSOLETE, not recommended for use.        155  *      OBSOLETE, not recommended for use.
156  *      PFN of the shared page.                   156  *      PFN of the shared page.
157  */                                               157  */
158                                                   158 
159 /*                                                159 /*
160  * EVENT CODES.                                   160  * EVENT CODES.
161  */                                               161  */
162                                                   162 
163 #define XENKBD_TYPE_MOTION              1         163 #define XENKBD_TYPE_MOTION              1
164 #define XENKBD_TYPE_RESERVED            2         164 #define XENKBD_TYPE_RESERVED            2
165 #define XENKBD_TYPE_KEY                 3         165 #define XENKBD_TYPE_KEY                 3
166 #define XENKBD_TYPE_POS                 4         166 #define XENKBD_TYPE_POS                 4
167 #define XENKBD_TYPE_MTOUCH              5         167 #define XENKBD_TYPE_MTOUCH              5
168                                                   168 
169 /* Multi-touch event sub-codes */                 169 /* Multi-touch event sub-codes */
170                                                   170 
171 #define XENKBD_MT_EV_DOWN               0         171 #define XENKBD_MT_EV_DOWN               0
172 #define XENKBD_MT_EV_UP                 1         172 #define XENKBD_MT_EV_UP                 1
173 #define XENKBD_MT_EV_MOTION             2         173 #define XENKBD_MT_EV_MOTION             2
174 #define XENKBD_MT_EV_SYN                3         174 #define XENKBD_MT_EV_SYN                3
175 #define XENKBD_MT_EV_SHAPE              4         175 #define XENKBD_MT_EV_SHAPE              4
176 #define XENKBD_MT_EV_ORIENT             5         176 #define XENKBD_MT_EV_ORIENT             5
177                                                   177 
178 /*                                                178 /*
179  * CONSTANTS, XENSTORE FIELD AND PATH NAME STR    179  * CONSTANTS, XENSTORE FIELD AND PATH NAME STRINGS, HELPERS.
180  */                                               180  */
181                                                   181 
182 #define XENKBD_DRIVER_NAME              "vkbd"    182 #define XENKBD_DRIVER_NAME              "vkbd"
183                                                   183 
184 #define XENKBD_FIELD_FEAT_DSBL_KEYBRD   "featu    184 #define XENKBD_FIELD_FEAT_DSBL_KEYBRD   "feature-disable-keyboard"
185 #define XENKBD_FIELD_FEAT_DSBL_POINTER  "featu    185 #define XENKBD_FIELD_FEAT_DSBL_POINTER  "feature-disable-pointer"
186 #define XENKBD_FIELD_FEAT_ABS_POINTER   "featu    186 #define XENKBD_FIELD_FEAT_ABS_POINTER   "feature-abs-pointer"
187 #define XENKBD_FIELD_FEAT_RAW_POINTER   "featu    187 #define XENKBD_FIELD_FEAT_RAW_POINTER   "feature-raw-pointer"
188 #define XENKBD_FIELD_FEAT_MTOUCH        "featu    188 #define XENKBD_FIELD_FEAT_MTOUCH        "feature-multi-touch"
189 #define XENKBD_FIELD_REQ_ABS_POINTER    "reque    189 #define XENKBD_FIELD_REQ_ABS_POINTER    "request-abs-pointer"
190 #define XENKBD_FIELD_REQ_RAW_POINTER    "reque    190 #define XENKBD_FIELD_REQ_RAW_POINTER    "request-raw-pointer"
191 #define XENKBD_FIELD_REQ_MTOUCH         "reque    191 #define XENKBD_FIELD_REQ_MTOUCH         "request-multi-touch"
192 #define XENKBD_FIELD_RING_GREF          "page-    192 #define XENKBD_FIELD_RING_GREF          "page-gref"
193 #define XENKBD_FIELD_EVT_CHANNEL        "event    193 #define XENKBD_FIELD_EVT_CHANNEL        "event-channel"
194 #define XENKBD_FIELD_WIDTH              "width    194 #define XENKBD_FIELD_WIDTH              "width"
195 #define XENKBD_FIELD_HEIGHT             "heigh    195 #define XENKBD_FIELD_HEIGHT             "height"
196 #define XENKBD_FIELD_MT_WIDTH           "multi    196 #define XENKBD_FIELD_MT_WIDTH           "multi-touch-width"
197 #define XENKBD_FIELD_MT_HEIGHT          "multi    197 #define XENKBD_FIELD_MT_HEIGHT          "multi-touch-height"
198 #define XENKBD_FIELD_MT_NUM_CONTACTS    "multi    198 #define XENKBD_FIELD_MT_NUM_CONTACTS    "multi-touch-num-contacts"
199 #define XENKBD_FIELD_UNIQUE_ID          "uniqu    199 #define XENKBD_FIELD_UNIQUE_ID          "unique-id"
200                                                   200 
201 /* OBSOLETE, not recommended for use */           201 /* OBSOLETE, not recommended for use */
202 #define XENKBD_FIELD_RING_REF           "page-    202 #define XENKBD_FIELD_RING_REF           "page-ref"
203                                                   203 
204 /*                                                204 /*
205  *********************************************    205  *****************************************************************************
206  * Description of the protocol between fronten    206  * Description of the protocol between frontend and backend driver.
207  *********************************************    207  *****************************************************************************
208  *                                                208  *
209  * The two halves of a Para-virtual driver com    209  * The two halves of a Para-virtual driver communicate with
210  * each other using a shared page and an event    210  * each other using a shared page and an event channel.
211  * Shared page contains a ring with event stru    211  * Shared page contains a ring with event structures.
212  *                                                212  *
213  * All reserved fields in the structures below    213  * All reserved fields in the structures below must be 0.
214  *                                                214  *
215  *********************************************    215  *****************************************************************************
216  *                           Backend to fronte    216  *                           Backend to frontend events
217  *********************************************    217  *****************************************************************************
218  *                                                218  *
219  * Frontends should ignore unknown in events.     219  * Frontends should ignore unknown in events.
220  * All event packets have the same length (40     220  * All event packets have the same length (40 octets)
221  * All event packets have common header:          221  * All event packets have common header:
222  *                                                222  *
223  *          0         octet                       223  *          0         octet
224  * +-----------------+                            224  * +-----------------+
225  * |       type      |                            225  * |       type      |
226  * +-----------------+                            226  * +-----------------+
227  * type - uint8_t, event code, XENKBD_TYPE_???    227  * type - uint8_t, event code, XENKBD_TYPE_???
228  *                                                228  *
229  *                                                229  *
230  * Pointer relative movement event                230  * Pointer relative movement event
231  *         0                1                     231  *         0                1                 2               3        octet
232  * +----------------+----------------+--------    232  * +----------------+----------------+----------------+----------------+
233  * |  _TYPE_MOTION  |                     rese    233  * |  _TYPE_MOTION  |                     reserved                     | 4
234  * +----------------+----------------+--------    234  * +----------------+----------------+----------------+----------------+
235  * |                               rel_x          235  * |                               rel_x                               | 8
236  * +----------------+----------------+--------    236  * +----------------+----------------+----------------+----------------+
237  * |                               rel_y          237  * |                               rel_y                               | 12
238  * +----------------+----------------+--------    238  * +----------------+----------------+----------------+----------------+
239  * |                               rel_z          239  * |                               rel_z                               | 16
240  * +----------------+----------------+--------    240  * +----------------+----------------+----------------+----------------+
241  * |                             reserved         241  * |                             reserved                              | 20
242  * +----------------+----------------+--------    242  * +----------------+----------------+----------------+----------------+
243  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    243  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
244  * +----------------+----------------+--------    244  * +----------------+----------------+----------------+----------------+
245  * |                             reserved         245  * |                             reserved                              | 40
246  * +----------------+----------------+--------    246  * +----------------+----------------+----------------+----------------+
247  *                                                247  *
248  * rel_x - int32_t, relative X motion             248  * rel_x - int32_t, relative X motion
249  * rel_y - int32_t, relative Y motion             249  * rel_y - int32_t, relative Y motion
250  * rel_z - int32_t, relative Z motion (wheel)     250  * rel_z - int32_t, relative Z motion (wheel)
251  */                                               251  */
252                                                   252 
253 struct xenkbd_motion {                            253 struct xenkbd_motion {
254         uint8_t type;                             254         uint8_t type;
255         int32_t rel_x;                            255         int32_t rel_x;
256         int32_t rel_y;                            256         int32_t rel_y;
257         int32_t rel_z;                            257         int32_t rel_z;
258 };                                                258 };
259                                                   259 
260 /*                                                260 /*
261  * Key event (includes pointer buttons)           261  * Key event (includes pointer buttons)
262  *         0                1                     262  *         0                1                 2               3        octet
263  * +----------------+----------------+--------    263  * +----------------+----------------+----------------+----------------+
264  * |  _TYPE_KEY     |     pressed    |            264  * |  _TYPE_KEY     |     pressed    |            reserved             | 4
265  * +----------------+----------------+--------    265  * +----------------+----------------+----------------+----------------+
266  * |                              keycode         266  * |                              keycode                              | 8
267  * +----------------+----------------+--------    267  * +----------------+----------------+----------------+----------------+
268  * |                             reserved         268  * |                             reserved                              | 12
269  * +----------------+----------------+--------    269  * +----------------+----------------+----------------+----------------+
270  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    270  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
271  * +----------------+----------------+--------    271  * +----------------+----------------+----------------+----------------+
272  * |                             reserved         272  * |                             reserved                              | 40
273  * +----------------+----------------+--------    273  * +----------------+----------------+----------------+----------------+
274  *                                                274  *
275  * pressed - uint8_t, 1 if pressed; 0 otherwis    275  * pressed - uint8_t, 1 if pressed; 0 otherwise
276  * keycode - uint32_t, KEY_* from linux/input.    276  * keycode - uint32_t, KEY_* from linux/input.h
277  */                                               277  */
278                                                   278 
279 struct xenkbd_key {                               279 struct xenkbd_key {
280         uint8_t type;                             280         uint8_t type;
281         uint8_t pressed;                          281         uint8_t pressed;
282         uint32_t keycode;                         282         uint32_t keycode;
283 };                                                283 };
284                                                   284 
285 /*                                                285 /*
286  * Pointer absolute position event                286  * Pointer absolute position event
287  *         0                1                     287  *         0                1                 2               3        octet
288  * +----------------+----------------+--------    288  * +----------------+----------------+----------------+----------------+
289  * |  _TYPE_POS     |                     rese    289  * |  _TYPE_POS     |                     reserved                     | 4
290  * +----------------+----------------+--------    290  * +----------------+----------------+----------------+----------------+
291  * |                               abs_x          291  * |                               abs_x                               | 8
292  * +----------------+----------------+--------    292  * +----------------+----------------+----------------+----------------+
293  * |                               abs_y          293  * |                               abs_y                               | 12
294  * +----------------+----------------+--------    294  * +----------------+----------------+----------------+----------------+
295  * |                               rel_z          295  * |                               rel_z                               | 16
296  * +----------------+----------------+--------    296  * +----------------+----------------+----------------+----------------+
297  * |                             reserved         297  * |                             reserved                              | 20
298  * +----------------+----------------+--------    298  * +----------------+----------------+----------------+----------------+
299  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    299  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
300  * +----------------+----------------+--------    300  * +----------------+----------------+----------------+----------------+
301  * |                             reserved         301  * |                             reserved                              | 40
302  * +----------------+----------------+--------    302  * +----------------+----------------+----------------+----------------+
303  *                                                303  *
304  * abs_x - int32_t, absolute X position (in FB    304  * abs_x - int32_t, absolute X position (in FB pixels)
305  * abs_y - int32_t, absolute Y position (in FB    305  * abs_y - int32_t, absolute Y position (in FB pixels)
306  * rel_z - int32_t, relative Z motion (wheel)     306  * rel_z - int32_t, relative Z motion (wheel)
307  */                                               307  */
308                                                   308 
309 struct xenkbd_position {                          309 struct xenkbd_position {
310         uint8_t type;                             310         uint8_t type;
311         int32_t abs_x;                            311         int32_t abs_x;
312         int32_t abs_y;                            312         int32_t abs_y;
313         int32_t rel_z;                            313         int32_t rel_z;
314 };                                                314 };
315                                                   315 
316 /*                                                316 /*
317  * Multi-touch event and its sub-types            317  * Multi-touch event and its sub-types
318  *                                                318  *
319  * All multi-touch event packets have common h    319  * All multi-touch event packets have common header:
320  *                                                320  *
321  *         0                1                     321  *         0                1                 2               3        octet
322  * +----------------+----------------+--------    322  * +----------------+----------------+----------------+----------------+
323  * |  _TYPE_MTOUCH  |   event_type   |   conta    323  * |  _TYPE_MTOUCH  |   event_type   |   contact_id   |    reserved    | 4
324  * +----------------+----------------+--------    324  * +----------------+----------------+----------------+----------------+
325  * |                             reserved         325  * |                             reserved                              | 8
326  * +----------------+----------------+--------    326  * +----------------+----------------+----------------+----------------+
327  *                                                327  *
328  * event_type - unt8_t, multi-touch event sub-    328  * event_type - unt8_t, multi-touch event sub-type, XENKBD_MT_EV_???
329  * contact_id - unt8_t, ID of the contact         329  * contact_id - unt8_t, ID of the contact
330  *                                                330  *
331  * Touch interactions can consist of one or mo    331  * Touch interactions can consist of one or more contacts.
332  * For each contact, a series of events is gen    332  * For each contact, a series of events is generated, starting
333  * with a down event, followed by zero or more    333  * with a down event, followed by zero or more motion events,
334  * and ending with an up event. Events relatin    334  * and ending with an up event. Events relating to the same
335  * contact point can be identified by the ID o    335  * contact point can be identified by the ID of the sequence: contact ID.
336  * Contact ID may be reused after XENKBD_MT_EV    336  * Contact ID may be reused after XENKBD_MT_EV_UP event and
337  * is in the [0; XENKBD_FIELD_NUM_CONTACTS - 1    337  * is in the [0; XENKBD_FIELD_NUM_CONTACTS - 1] range.
338  *                                                338  *
339  * For further information please refer to doc    339  * For further information please refer to documentation on Wayland [1],
340  * Linux [2] and Windows [3] multi-touch suppo    340  * Linux [2] and Windows [3] multi-touch support.
341  *                                                341  *
342  * [1] https://cgit.freedesktop.org/wayland/wa    342  * [1] https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml
343  * [2] https://www.kernel.org/doc/Documentatio    343  * [2] https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.rst
344  * [3] https://msdn.microsoft.com/en-us/librar    344  * [3] https://msdn.microsoft.com/en-us/library/jj151564(v=vs.85).aspx
345  *                                                345  *
346  *                                                346  *
347  * Multi-touch down event - sent when a new to    347  * Multi-touch down event - sent when a new touch is made: touch is assigned
348  * a unique contact ID, sent with this and con    348  * a unique contact ID, sent with this and consequent events related
349  * to this touch.                                 349  * to this touch.
350  *         0                1                     350  *         0                1                 2               3        octet
351  * +----------------+----------------+--------    351  * +----------------+----------------+----------------+----------------+
352  * |  _TYPE_MTOUCH  |   _MT_EV_DOWN  |   conta    352  * |  _TYPE_MTOUCH  |   _MT_EV_DOWN  |   contact_id   |    reserved    | 4
353  * +----------------+----------------+--------    353  * +----------------+----------------+----------------+----------------+
354  * |                             reserved         354  * |                             reserved                              | 8
355  * +----------------+----------------+--------    355  * +----------------+----------------+----------------+----------------+
356  * |                               abs_x          356  * |                               abs_x                               | 12
357  * +----------------+----------------+--------    357  * +----------------+----------------+----------------+----------------+
358  * |                               abs_y          358  * |                               abs_y                               | 16
359  * +----------------+----------------+--------    359  * +----------------+----------------+----------------+----------------+
360  * |                             reserved         360  * |                             reserved                              | 20
361  * +----------------+----------------+--------    361  * +----------------+----------------+----------------+----------------+
362  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    362  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
363  * +----------------+----------------+--------    363  * +----------------+----------------+----------------+----------------+
364  * |                             reserved         364  * |                             reserved                              | 40
365  * +----------------+----------------+--------    365  * +----------------+----------------+----------------+----------------+
366  *                                                366  *
367  * abs_x - int32_t, absolute X position, in pi    367  * abs_x - int32_t, absolute X position, in pixels
368  * abs_y - int32_t, absolute Y position, in pi    368  * abs_y - int32_t, absolute Y position, in pixels
369  *                                                369  *
370  * Multi-touch contact release event              370  * Multi-touch contact release event
371  *         0                1                     371  *         0                1                 2               3        octet
372  * +----------------+----------------+--------    372  * +----------------+----------------+----------------+----------------+
373  * |  _TYPE_MTOUCH  |  _MT_EV_UP     |   conta    373  * |  _TYPE_MTOUCH  |  _MT_EV_UP     |   contact_id   |    reserved    | 4
374  * +----------------+----------------+--------    374  * +----------------+----------------+----------------+----------------+
375  * |                             reserved         375  * |                             reserved                              | 8
376  * +----------------+----------------+--------    376  * +----------------+----------------+----------------+----------------+
377  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    377  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
378  * +----------------+----------------+--------    378  * +----------------+----------------+----------------+----------------+
379  * |                             reserved         379  * |                             reserved                              | 40
380  * +----------------+----------------+--------    380  * +----------------+----------------+----------------+----------------+
381  *                                                381  *
382  * Multi-touch motion event                       382  * Multi-touch motion event
383  *         0                1                     383  *         0                1                 2               3        octet
384  * +----------------+----------------+--------    384  * +----------------+----------------+----------------+----------------+
385  * |  _TYPE_MTOUCH  |  _MT_EV_MOTION |   conta    385  * |  _TYPE_MTOUCH  |  _MT_EV_MOTION |   contact_id   |    reserved    | 4
386  * +----------------+----------------+--------    386  * +----------------+----------------+----------------+----------------+
387  * |                             reserved         387  * |                             reserved                              | 8
388  * +----------------+----------------+--------    388  * +----------------+----------------+----------------+----------------+
389  * |                               abs_x          389  * |                               abs_x                               | 12
390  * +----------------+----------------+--------    390  * +----------------+----------------+----------------+----------------+
391  * |                               abs_y          391  * |                               abs_y                               | 16
392  * +----------------+----------------+--------    392  * +----------------+----------------+----------------+----------------+
393  * |                             reserved         393  * |                             reserved                              | 20
394  * +----------------+----------------+--------    394  * +----------------+----------------+----------------+----------------+
395  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    395  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
396  * +----------------+----------------+--------    396  * +----------------+----------------+----------------+----------------+
397  * |                             reserved         397  * |                             reserved                              | 40
398  * +----------------+----------------+--------    398  * +----------------+----------------+----------------+----------------+
399  *                                                399  *
400  * abs_x - int32_t, absolute X position, in pi    400  * abs_x - int32_t, absolute X position, in pixels,
401  * abs_y - int32_t, absolute Y position, in pi    401  * abs_y - int32_t, absolute Y position, in pixels,
402  *                                                402  *
403  * Multi-touch input synchronization event - s    403  * Multi-touch input synchronization event - shows end of a set of events
404  * which logically belong together.               404  * which logically belong together.
405  *         0                1                     405  *         0                1                 2               3        octet
406  * +----------------+----------------+--------    406  * +----------------+----------------+----------------+----------------+
407  * |  _TYPE_MTOUCH  |  _MT_EV_SYN    |   conta    407  * |  _TYPE_MTOUCH  |  _MT_EV_SYN    |   contact_id   |    reserved    | 4
408  * +----------------+----------------+--------    408  * +----------------+----------------+----------------+----------------+
409  * |                             reserved         409  * |                             reserved                              | 8
410  * +----------------+----------------+--------    410  * +----------------+----------------+----------------+----------------+
411  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    411  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
412  * +----------------+----------------+--------    412  * +----------------+----------------+----------------+----------------+
413  * |                             reserved         413  * |                             reserved                              | 40
414  * +----------------+----------------+--------    414  * +----------------+----------------+----------------+----------------+
415  *                                                415  *
416  * Multi-touch shape event - touch point's sha    416  * Multi-touch shape event - touch point's shape has changed its shape.
417  * Shape is approximated by an ellipse through    417  * Shape is approximated by an ellipse through the major and minor axis
418  * lengths: major is the longer diameter of th    418  * lengths: major is the longer diameter of the ellipse and minor is the
419  * shorter one. Center of the ellipse is repor    419  * shorter one. Center of the ellipse is reported via
420  * XENKBD_MT_EV_DOWN/XENKBD_MT_EV_MOTION event    420  * XENKBD_MT_EV_DOWN/XENKBD_MT_EV_MOTION events.
421  *         0                1                     421  *         0                1                 2               3        octet
422  * +----------------+----------------+--------    422  * +----------------+----------------+----------------+----------------+
423  * |  _TYPE_MTOUCH  |  _MT_EV_SHAPE  |   conta    423  * |  _TYPE_MTOUCH  |  _MT_EV_SHAPE  |   contact_id   |    reserved    | 4
424  * +----------------+----------------+--------    424  * +----------------+----------------+----------------+----------------+
425  * |                             reserved         425  * |                             reserved                              | 8
426  * +----------------+----------------+--------    426  * +----------------+----------------+----------------+----------------+
427  * |                               major          427  * |                               major                               | 12
428  * +----------------+----------------+--------    428  * +----------------+----------------+----------------+----------------+
429  * |                               minor          429  * |                               minor                               | 16
430  * +----------------+----------------+--------    430  * +----------------+----------------+----------------+----------------+
431  * |                             reserved         431  * |                             reserved                              | 20
432  * +----------------+----------------+--------    432  * +----------------+----------------+----------------+----------------+
433  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    433  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
434  * +----------------+----------------+--------    434  * +----------------+----------------+----------------+----------------+
435  * |                             reserved         435  * |                             reserved                              | 40
436  * +----------------+----------------+--------    436  * +----------------+----------------+----------------+----------------+
437  *                                                437  *
438  * major - unt32_t, length of the major axis,     438  * major - unt32_t, length of the major axis, pixels
439  * minor - unt32_t, length of the minor axis,     439  * minor - unt32_t, length of the minor axis, pixels
440  *                                                440  *
441  * Multi-touch orientation event - touch point    441  * Multi-touch orientation event - touch point's shape has changed
442  * its orientation: calculated as a clockwise     442  * its orientation: calculated as a clockwise angle between the major axis
443  * of the ellipse and positive Y axis in degre    443  * of the ellipse and positive Y axis in degrees, [-180; +180].
444  *         0                1                     444  *         0                1                 2               3        octet
445  * +----------------+----------------+--------    445  * +----------------+----------------+----------------+----------------+
446  * |  _TYPE_MTOUCH  |  _MT_EV_ORIENT |   conta    446  * |  _TYPE_MTOUCH  |  _MT_EV_ORIENT |   contact_id   |    reserved    | 4
447  * +----------------+----------------+--------    447  * +----------------+----------------+----------------+----------------+
448  * |                             reserved         448  * |                             reserved                              | 8
449  * +----------------+----------------+--------    449  * +----------------+----------------+----------------+----------------+
450  * |           orientation           |            450  * |           orientation           |            reserved             | 12
451  * +----------------+----------------+--------    451  * +----------------+----------------+----------------+----------------+
452  * |                             reserved         452  * |                             reserved                              | 16
453  * +----------------+----------------+--------    453  * +----------------+----------------+----------------+----------------+
454  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\    454  * |/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
455  * +----------------+----------------+--------    455  * +----------------+----------------+----------------+----------------+
456  * |                             reserved         456  * |                             reserved                              | 40
457  * +----------------+----------------+--------    457  * +----------------+----------------+----------------+----------------+
458  *                                                458  *
459  * orientation - int16_t, clockwise angle of t    459  * orientation - int16_t, clockwise angle of the major axis
460  */                                               460  */
461                                                   461 
462 struct xenkbd_mtouch {                            462 struct xenkbd_mtouch {
463         uint8_t type;                   /* XEN    463         uint8_t type;                   /* XENKBD_TYPE_MTOUCH */
464         uint8_t event_type;             /* XEN    464         uint8_t event_type;             /* XENKBD_MT_EV_??? */
465         uint8_t contact_id;                       465         uint8_t contact_id;
466         uint8_t reserved[5];            /* res    466         uint8_t reserved[5];            /* reserved for the future use */
467         union {                                   467         union {
468                 struct {                          468                 struct {
469                         int32_t abs_x;  /* abs    469                         int32_t abs_x;  /* absolute X position, pixels */
470                         int32_t abs_y;  /* abs    470                         int32_t abs_y;  /* absolute Y position, pixels */
471                 } pos;                            471                 } pos;
472                 struct {                          472                 struct {
473                         uint32_t major; /* len    473                         uint32_t major; /* length of the major axis, pixels */
474                         uint32_t minor; /* len    474                         uint32_t minor; /* length of the minor axis, pixels */
475                 } shape;                          475                 } shape;
476                 int16_t orientation;    /* clo    476                 int16_t orientation;    /* clockwise angle of the major axis */
477         } u;                                      477         } u;
478 };                                                478 };
479                                                   479 
480 #define XENKBD_IN_EVENT_SIZE 40                   480 #define XENKBD_IN_EVENT_SIZE 40
481                                                   481 
482 union xenkbd_in_event {                           482 union xenkbd_in_event {
483         uint8_t type;                             483         uint8_t type;
484         struct xenkbd_motion motion;              484         struct xenkbd_motion motion;
485         struct xenkbd_key key;                    485         struct xenkbd_key key;
486         struct xenkbd_position pos;               486         struct xenkbd_position pos;
487         struct xenkbd_mtouch mtouch;              487         struct xenkbd_mtouch mtouch;
488         char pad[XENKBD_IN_EVENT_SIZE];           488         char pad[XENKBD_IN_EVENT_SIZE];
489 };                                                489 };
490                                                   490 
491 /*                                                491 /*
492  *********************************************    492  *****************************************************************************
493  *                            Frontend to back    493  *                            Frontend to backend events
494  *********************************************    494  *****************************************************************************
495  *                                                495  *
496  * Out events may be sent only when requested     496  * Out events may be sent only when requested by backend, and receipt
497  * of an unknown out event is an error.           497  * of an unknown out event is an error.
498  * No out events currently defined.               498  * No out events currently defined.
499                                                   499 
500  * All event packets have the same length (40     500  * All event packets have the same length (40 octets)
501  * All event packets have common header:          501  * All event packets have common header:
502  *          0         octet                       502  *          0         octet
503  * +-----------------+                            503  * +-----------------+
504  * |       type      |                            504  * |       type      |
505  * +-----------------+                            505  * +-----------------+
506  * type - uint8_t, event code                     506  * type - uint8_t, event code
507  */                                               507  */
508                                                   508 
509 #define XENKBD_OUT_EVENT_SIZE 40                  509 #define XENKBD_OUT_EVENT_SIZE 40
510                                                   510 
511 union xenkbd_out_event {                          511 union xenkbd_out_event {
512         uint8_t type;                             512         uint8_t type;
513         char pad[XENKBD_OUT_EVENT_SIZE];          513         char pad[XENKBD_OUT_EVENT_SIZE];
514 };                                                514 };
515                                                   515 
516 /*                                                516 /*
517  *********************************************    517  *****************************************************************************
518  *                            Shared page         518  *                            Shared page
519  *********************************************    519  *****************************************************************************
520  */                                               520  */
521                                                   521 
522 #define XENKBD_IN_RING_SIZE 2048                  522 #define XENKBD_IN_RING_SIZE 2048
523 #define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZ    523 #define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZE / XENKBD_IN_EVENT_SIZE)
524 #define XENKBD_IN_RING_OFFS 1024                  524 #define XENKBD_IN_RING_OFFS 1024
525 #define XENKBD_IN_RING(page) \                    525 #define XENKBD_IN_RING(page) \
526         ((union xenkbd_in_event *)((char *)(pa    526         ((union xenkbd_in_event *)((char *)(page) + XENKBD_IN_RING_OFFS))
527 #define XENKBD_IN_RING_REF(page, idx) \           527 #define XENKBD_IN_RING_REF(page, idx) \
528         (XENKBD_IN_RING((page))[(idx) % XENKBD    528         (XENKBD_IN_RING((page))[(idx) % XENKBD_IN_RING_LEN])
529                                                   529 
530 #define XENKBD_OUT_RING_SIZE 1024                 530 #define XENKBD_OUT_RING_SIZE 1024
531 #define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_S    531 #define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_SIZE / XENKBD_OUT_EVENT_SIZE)
532 #define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_O    532 #define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_OFFS + XENKBD_IN_RING_SIZE)
533 #define XENKBD_OUT_RING(page) \                   533 #define XENKBD_OUT_RING(page) \
534         ((union xenkbd_out_event *)((char *)(p    534         ((union xenkbd_out_event *)((char *)(page) + XENKBD_OUT_RING_OFFS))
535 #define XENKBD_OUT_RING_REF(page, idx) \          535 #define XENKBD_OUT_RING_REF(page, idx) \
536         (XENKBD_OUT_RING((page))[(idx) % XENKB    536         (XENKBD_OUT_RING((page))[(idx) % XENKBD_OUT_RING_LEN])
537                                                   537 
538 struct xenkbd_page {                              538 struct xenkbd_page {
539         uint32_t in_cons, in_prod;                539         uint32_t in_cons, in_prod;
540         uint32_t out_cons, out_prod;              540         uint32_t out_cons, out_prod;
541 };                                                541 };
542                                                   542 
543 #endif /* __XEN_PUBLIC_IO_KBDIF_H__ */            543 #endif /* __XEN_PUBLIC_IO_KBDIF_H__ */
544                                                   544 

~ [ 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