123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- #ifndef __USF_H__
- #define __USF_H__
- #include <linux/types.h>
- #include <linux/ioctl.h>
- #define USF_IOCTL_MAGIC 'U'
- #define US_SET_TX_INFO _IOW(USF_IOCTL_MAGIC, 0, \
- struct us_tx_info_type)
- #define US_START_TX _IO(USF_IOCTL_MAGIC, 1)
- #define US_GET_TX_UPDATE _IOWR(USF_IOCTL_MAGIC, 2, \
- struct us_tx_update_info_type)
- #define US_SET_RX_INFO _IOW(USF_IOCTL_MAGIC, 3, \
- struct us_rx_info_type)
- #define US_SET_RX_UPDATE _IOWR(USF_IOCTL_MAGIC, 4, \
- struct us_rx_update_info_type)
- #define US_START_RX _IO(USF_IOCTL_MAGIC, 5)
- #define US_STOP_TX _IO(USF_IOCTL_MAGIC, 6)
- #define US_STOP_RX _IO(USF_IOCTL_MAGIC, 7)
- #define US_SET_DETECTION _IOWR(USF_IOCTL_MAGIC, 8, \
- struct us_detect_info_type)
- #define US_GET_VERSION _IOWR(USF_IOCTL_MAGIC, 9, \
- struct us_version_info_type)
- #define US_SET_TX_STREAM_PARAM _IOW(USF_IOCTL_MAGIC, 10, \
- struct us_stream_param_type)
- #define US_GET_TX_STREAM_PARAM _IOWR(USF_IOCTL_MAGIC, 11, \
- struct us_stream_param_type)
- #define US_SET_RX_STREAM_PARAM _IOW(USF_IOCTL_MAGIC, 12, \
- struct us_stream_param_type)
- #define US_GET_RX_STREAM_PARAM _IOWR(USF_IOCTL_MAGIC, 13, \
- struct us_stream_param_type)
- #define USF_NO_WAIT_TIMEOUT 0x00000000
- #define USF_INFINITIVE_TIMEOUT 0xffffffff
- #define USF_DEFAULT_TIMEOUT 0xfffffffe
- enum us_detect_place_enum {
- US_DETECT_HW,
- US_DETECT_FW
- };
- enum us_detect_mode_enum {
- US_DETECT_DISABLED_MODE,
- US_DETECT_CONTINUE_MODE,
- US_DETECT_SHOT_MODE
- };
- #define USF_POINT_EPOS_FORMAT 0
- #define USF_RAW_FORMAT 1
- #define USF_TSC_EVENT_IND 0
- #define USF_TSC_PTR_EVENT_IND 1
- #define USF_MOUSE_EVENT_IND 2
- #define USF_KEYBOARD_EVENT_IND 3
- #define USF_TSC_EXT_EVENT_IND 4
- #define USF_MAX_EVENT_IND 5
- #define USF_NO_EVENT 0
- #define USF_TSC_EVENT (1 << USF_TSC_EVENT_IND)
- #define USF_TSC_PTR_EVENT (1 << USF_TSC_PTR_EVENT_IND)
- #define USF_MOUSE_EVENT (1 << USF_MOUSE_EVENT_IND)
- #define USF_KEYBOARD_EVENT (1 << USF_KEYBOARD_EVENT_IND)
- #define USF_TSC_EXT_EVENT (1 << USF_TSC_EXT_EVENT_IND)
- #define USF_ALL_EVENTS (USF_TSC_EVENT |\
- USF_TSC_PTR_EVENT |\
- USF_MOUSE_EVENT |\
- USF_KEYBOARD_EVENT |\
- USF_TSC_EXT_EVENT)
- #define MIN_MAX_DIM 2
- #define COORDINATES_DIM 3
- #define TILTS_DIM 2
- #define USF_MAX_CLIENT_NAME_SIZE 20
- #define USF_MAX_PORT_NUM 8
- struct us_xx_info_type {
- const char __user *client_name;
- uint32_t dev_id;
- uint32_t stream_format;
- uint32_t sample_rate;
- uint32_t buf_size;
- uint16_t buf_num;
- uint16_t port_cnt;
- uint8_t port_id[USF_MAX_PORT_NUM];
- uint16_t bits_per_sample;
- uint16_t params_data_size;
- uint8_t __user *params_data;
- uint32_t max_get_set_param_buf_size;
- };
- struct us_input_info_type {
-
- int tsc_x_dim[MIN_MAX_DIM];
- int tsc_y_dim[MIN_MAX_DIM];
- int tsc_z_dim[MIN_MAX_DIM];
-
- int tsc_x_tilt[MIN_MAX_DIM];
- int tsc_y_tilt[MIN_MAX_DIM];
-
- int tsc_pressure[MIN_MAX_DIM];
-
- uint16_t req_buttons_bitmap;
-
- uint16_t event_types;
-
- uint16_t conflicting_event_types;
- };
- struct us_tx_info_type {
-
- struct us_xx_info_type us_xx_info;
-
- struct us_input_info_type input_info;
- };
- struct us_rx_info_type {
-
- struct us_xx_info_type us_xx_info;
-
- };
- struct point_event_type {
- int coordinates[COORDINATES_DIM];
-
- int inclinations[TILTS_DIM];
- uint32_t pressure;
- uint16_t buttons_state_bitmap;
- };
- #define USF_BUTTON_LEFT_MASK 1
- #define USF_BUTTON_MIDDLE_MASK 2
- #define USF_BUTTON_RIGHT_MASK 4
- struct mouse_event_type {
- int rels[COORDINATES_DIM];
- uint16_t buttons_states;
- };
- struct key_event_type {
- uint32_t key;
- uint8_t key_state;
- };
- struct usf_event_type {
- uint32_t seq_num;
- uint32_t timestamp;
- uint16_t event_type_ind;
- union {
- struct point_event_type point_event;
- struct mouse_event_type mouse_event;
- struct key_event_type key_event;
- } event_data;
- };
- struct us_tx_update_info_type {
- uint16_t event_counter;
- struct usf_event_type __user *event;
- uint32_t free_region;
- uint32_t timeout;
- uint16_t event_filters;
- uint16_t params_data_size;
- uint8_t __user *params_data;
- uint32_t ready_region;
- };
- struct us_rx_update_info_type {
- uint32_t ready_region;
- uint16_t params_data_size;
- uint8_t __user *params_data;
- uint32_t free_region;
- };
- struct us_detect_info_type {
- enum us_detect_place_enum us_detector;
- enum us_detect_mode_enum us_detect_mode;
- uint32_t skip_time;
- uint16_t params_data_size;
- uint8_t __user *params_data;
- uint32_t detect_timeout;
- bool is_us;
- };
- struct us_version_info_type {
- uint16_t buf_size;
- char __user *pbuf;
- };
- struct us_stream_param_type {
- uint32_t module_id;
- uint32_t param_id;
- uint32_t buf_size;
- uint8_t __user *pbuf;
- };
- #endif
|