Changeset 1ff1ee1 in mainline
- Timestamp:
- 2012-01-03T13:29:09Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ecc6323
- Parents:
- 8bb9540
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/xtkbd/xtkbd.c
r8bb9540 r1ff1ee1 178 178 }; 179 179 180 #define KBD_CMD_SET_LEDS 0xed 181 enum led_indicators { 182 LI_SCROLL = 0x01, 183 LI_NUM = 0x02, 184 LI_CAPS = 0x04, 185 }; 186 180 187 static int polling(void *); 181 188 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); … … 310 317 311 318 switch (method) { 312 case KBDEV_SET_IND: 313 /* XT keyboards do not support setting mods */ 314 async_answer_0(icallid, ENOTSUP); 319 case KBDEV_SET_IND: { 320 /* XT keyboards do not support setting mods, 321 * assume AT keyboard with Scan Code Set 1 */ 322 const unsigned mods = IPC_GET_ARG1(*icall); 323 const uint8_t status = 0 | 324 ((mods & KM_CAPS_LOCK) ? LI_CAPS : 0) | 325 ((mods & KM_NUM_LOCK) ? LI_NUM : 0) | 326 ((mods & KM_SCROLL_LOCK) ? LI_SCROLL : 0); 327 uint8_t cmds[] = { KBD_CMD_SET_LEDS, status }; 328 const ssize_t size = 329 char_dev_write(kbd->parent_sess, cmds, sizeof(cmds)); 330 async_answer_0(icallid, size < 0 ? size : EOK); 315 331 break; 332 } 316 333 /* This might be ugly but async_callback_receive_start makes no 317 334 * difference for incorrect call and malloc failure. */
Note:
See TracChangeset
for help on using the changeset viewer.