Message type for INPUT_EVENT

Change-Id: I50a815623ff4a9b6b0113000a798a3495c911ecf
This commit is contained in:
Lionel Sambuc 2014-05-19 10:18:55 +02:00
parent bcd669222a
commit 4ed3f29e7f
4 changed files with 27 additions and 17 deletions

View file

@ -1071,7 +1071,9 @@
/* This message uses no message fields. */
#define TTY_INPUT_EVENT (TTY_RQ_BASE + 3) /* relayed input event */
/* This message shares its message fields with INPUT_EVENT. */
# define INPUT_PAGE m7_i2 /* usage page */
# define INPUT_CODE m7_i3 /* usage code */
# define INPUT_VALUE m7_i4 /* event value */
/*===========================================================================*
* Messages for input server and drivers *
@ -1087,11 +1089,6 @@
# define INPUT_LED_MASK m7_i1 /* status mask of LEDs */
#define INPUT_EVENT (INPUT_RS_BASE + 0) /* send input event */
# define INPUT_ID m7_i1 /* device ID */
# define INPUT_PAGE m7_i2 /* usage page */
# define INPUT_CODE m7_i3 /* usage code */
# define INPUT_VALUE m7_i4 /* event value */
# define INPUT_FLAGS m7_i5 /* flags associated with value */
/*===========================================================================*
* VFS-FS TRANSACTION IDs *

View file

@ -640,6 +640,17 @@ typedef struct {
} mess_input_linputdriver_input_conf;
_ASSERT_MSG_SIZE(mess_input_linputdriver_input_conf);
typedef struct {
int id;
int page;
int code;
int value;
int flags;
uint8_t padding[36];
} mess_linputdriver_input_event;
_ASSERT_MSG_SIZE(mess_linputdriver_input_event);
typedef struct {
uint32_t flags;
endpoint_t endpoint;
@ -1309,6 +1320,8 @@ typedef struct {
mess_li2cdriver_i2c_busc_i2c_exec m_li2cdriver_i2c_busc_i2c_exec;
mess_li2cdriver_i2c_busc_i2c_reserve m_li2cdriver_i2c_busc_i2c_reserve;
mess_linputdriver_input_event m_linputdriver_input_event;
mess_lsys_krn_schedctl m_lsys_krn_schedctl;
mess_lsys_krn_schedule m_lsys_krn_schedule;

View file

@ -56,11 +56,11 @@ inputdriver_send_event(int mouse, unsigned short page, unsigned short code,
memset(&m, 0, sizeof(m));
m.m_type = INPUT_EVENT;
m.INPUT_ID = id;
m.INPUT_PAGE = page;
m.INPUT_CODE = code;
m.INPUT_VALUE = value;
m.INPUT_FLAGS = flags;
m.m_linputdriver_input_event.id = id;
m.m_linputdriver_input_event.page = page;
m.m_linputdriver_input_event.code = code;
m.m_linputdriver_input_event.value = value;
m.m_linputdriver_input_event.flags = flags;
/*
* Use a blocking send call, for two reasons. First, this avoids the

View file

@ -345,11 +345,11 @@ input_process(struct input_dev *input_dev, const message *m)
#endif
}
next = (input_dev->tail + input_dev->count) % EVENTBUF_SIZE;
input_dev->eventbuf[next].page = m->INPUT_PAGE;
input_dev->eventbuf[next].code = m->INPUT_CODE;
input_dev->eventbuf[next].value = m->INPUT_VALUE;
input_dev->eventbuf[next].flags = m->INPUT_FLAGS;
input_dev->eventbuf[next].devid = m->INPUT_ID;
input_dev->eventbuf[next].page = m->m_linputdriver_input_event.page;
input_dev->eventbuf[next].code = m->m_linputdriver_input_event.code;
input_dev->eventbuf[next].value = m->m_linputdriver_input_event.value;
input_dev->eventbuf[next].flags = m->m_linputdriver_input_event.flags;
input_dev->eventbuf[next].devid = m->m_linputdriver_input_event.id;
input_dev->eventbuf[next].rsvd[0] = 0;
input_dev->eventbuf[next].rsvd[1] = 0;
input_dev->count++;
@ -380,7 +380,7 @@ input_event(message *m)
int r, id;
/* Unlike minor numbers, device IDs are in fact array indices. */
id = m->INPUT_ID;
id = m->m_linputdriver_input_event.id;
if (id < 0 || id >= INPUT_DEV_MAX)
return;