From: Lionel Sambuc Date: Mon, 19 May 2014 08:39:55 +0000 (+0200) Subject: Message type for INPUT_SETLEDS X-Git-Tag: v3.3.0~239 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/host.html?a=commitdiff_plain;h=1a943bea521cc74650556835d3aa9020c3c6ded5;p=minix.git Message type for INPUT_SETLEDS Change-Id: I84ee6ee43d771409526468ce45f1ddc27e9ca986 --- diff --git a/drivers/tty/arch/i386/keyboard.c b/drivers/tty/arch/i386/keyboard.c index 26f5d4baa..736043ede 100644 --- a/drivers/tty/arch/i386/keyboard.c +++ b/drivers/tty/arch/i386/keyboard.c @@ -378,7 +378,7 @@ static void set_leds(void) memset(&m, 0, sizeof(m)); m.m_type = INPUT_SETLEDS; - m.INPUT_LED_MASK = locks[ccurrent] & ~ALT_LOCK; + m.m_input_linputdriver_setleds.led_mask = locks[ccurrent] & ~ALT_LOCK; if ((r = asynsend3(input_endpt, &m, AMF_NOREPLY)) != OK) printf("TTY: asynsend to INPUT %u failed (%d)\n", input_endpt, r); diff --git a/include/minix/com.h b/include/minix/com.h index 0b5b0c2dd..36a071375 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1084,9 +1084,7 @@ #define INPUT_RS_BASE 0x1580 /* from input driver to input server */ #define INPUT_CONF (INPUT_RQ_BASE + 0) /* configure driver */ - #define INPUT_SETLEDS (INPUT_RQ_BASE + 1) /* set keyboard LEDs */ -# define INPUT_LED_MASK m7_i1 /* status mask of LEDs */ #define INPUT_EVENT (INPUT_RS_BASE + 0) /* send input event */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 0e449e284..6a961d5c7 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -640,6 +640,13 @@ typedef struct { } mess_input_linputdriver_input_conf; _ASSERT_MSG_SIZE(mess_input_linputdriver_input_conf); +typedef struct { + uint32_t led_mask; + + uint8_t padding[52]; +} mess_input_linputdriver_setleds; +_ASSERT_MSG_SIZE(mess_input_linputdriver_setleds); + typedef struct { int id; int page; @@ -1271,6 +1278,7 @@ typedef struct { mess_i2c_li2cdriver_busc_i2c_reserve m_i2c_li2cdriver_busc_i2c_reserve; mess_input_linputdriver_input_conf m_input_linputdriver_input_conf; + mess_input_linputdriver_setleds m_input_linputdriver_setleds; mess_lc_pm_exec m_lc_pm_exec; mess_lc_pm_exit m_lc_pm_exit; diff --git a/lib/libinputdriver/inputdriver.c b/lib/libinputdriver/inputdriver.c index 480aa0c44..3c360cdcb 100644 --- a/lib/libinputdriver/inputdriver.c +++ b/lib/libinputdriver/inputdriver.c @@ -128,7 +128,7 @@ do_setleds(struct inputdriver *idp, message *m_ptr) return; } - mask = m_ptr->INPUT_LED_MASK; + mask = m_ptr->m_input_linputdriver_setleds.led_mask; if (idp->idr_leds) idp->idr_leds(mask); diff --git a/servers/input/input.c b/servers/input/input.c index 99e082f7b..6390255fe 100644 --- a/servers/input/input.c +++ b/servers/input/input.c @@ -212,7 +212,7 @@ input_set_leds(devminor_t minor, unsigned int mask) memset(&m, 0, sizeof(m)); m.m_type = INPUT_SETLEDS; - m.INPUT_LED_MASK = mask; + m.m_input_linputdriver_setleds.led_mask = mask; /* * Send the request to all matching keyboard devices. As side effect, @@ -621,7 +621,7 @@ input_other(message *m, int ipc_status) case INPUT_SETLEDS: if (m->m_source == TTY_PROC_NR) { - input_set_leds(KBDMUX_MINOR, m->INPUT_LED_MASK); + input_set_leds(KBDMUX_MINOR, m->m_input_linputdriver_setleds.led_mask); break; }