Back to home page

OSCL-LXR

 
 

    


0001 #ifndef _LINUX_VIRTIO_INPUT_H
0002 #define _LINUX_VIRTIO_INPUT_H
0003 /* This header is BSD licensed so anyone can use the definitions to implement
0004  * compatible drivers/servers.
0005  *
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions
0008  * are met:
0009  * 1. Redistributions of source code must retain the above copyright
0010  *    notice, this list of conditions and the following disclaimer.
0011  * 2. Redistributions in binary form must reproduce the above copyright
0012  *    notice, this list of conditions and the following disclaimer in the
0013  *    documentation and/or other materials provided with the distribution.
0014  * 3. Neither the name of IBM nor the names of its contributors
0015  *    may be used to endorse or promote products derived from this software
0016  *    without specific prior written permission.
0017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0018  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0019  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0020  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR
0021  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0022  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0023  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
0024  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0025  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0026  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
0027  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0028  * SUCH DAMAGE. */
0029 
0030 #include <linux/types.h>
0031 
0032 enum virtio_input_config_select {
0033     VIRTIO_INPUT_CFG_UNSET      = 0x00,
0034     VIRTIO_INPUT_CFG_ID_NAME    = 0x01,
0035     VIRTIO_INPUT_CFG_ID_SERIAL  = 0x02,
0036     VIRTIO_INPUT_CFG_ID_DEVIDS  = 0x03,
0037     VIRTIO_INPUT_CFG_PROP_BITS  = 0x10,
0038     VIRTIO_INPUT_CFG_EV_BITS    = 0x11,
0039     VIRTIO_INPUT_CFG_ABS_INFO   = 0x12,
0040 };
0041 
0042 struct virtio_input_absinfo {
0043     __le32 min;
0044     __le32 max;
0045     __le32 fuzz;
0046     __le32 flat;
0047     __le32 res;
0048 };
0049 
0050 struct virtio_input_devids {
0051     __le16 bustype;
0052     __le16 vendor;
0053     __le16 product;
0054     __le16 version;
0055 };
0056 
0057 struct virtio_input_config {
0058     __u8    select;
0059     __u8    subsel;
0060     __u8    size;
0061     __u8    reserved[5];
0062     union {
0063         char string[128];
0064         __u8 bitmap[128];
0065         struct virtio_input_absinfo abs;
0066         struct virtio_input_devids ids;
0067     } u;
0068 };
0069 
0070 struct virtio_input_event {
0071     __le16 type;
0072     __le16 code;
0073     __le32 value;
0074 };
0075 
0076 #endif /* _LINUX_VIRTIO_INPUT_H */