Changeset a84ddf0 in mainline
- Timestamp:
- 2011-12-27T11:11:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bff90ba
- Parents:
- 336f03b
- Location:
- uspace/drv/char/xtkbd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/xtkbd/main.c
r336f03b ra84ddf0 47 47 48 48 static int xt_kbd_add(ddf_dev_t *device); 49 49 /*----------------------------------------------------------------------------*/ 50 /** DDF driver ops. */ 50 51 static driver_ops_t kbd_driver_ops = { 51 52 .dev_add = xt_kbd_add, 52 53 }; 53 54 /*----------------------------------------------------------------------------*/ 55 /** DDF driver structure. */ 54 56 static driver_t kbd_driver = { 55 57 .name = NAME, 56 58 .driver_ops = &kbd_driver_ops 57 59 }; 58 60 /*----------------------------------------------------------------------------*/ 59 61 /** Initialize global driver structures (NONE). 60 62 * … … 68 70 { 69 71 printf(NAME ": HelenOS XT keyboard driver.\n"); 70 ddf_log_init(NAME, LVL_ DEBUG2);72 ddf_log_init(NAME, LVL_NOTE); 71 73 return ddf_driver_main(&kbd_driver); 72 74 } 73 75 /*----------------------------------------------------------------------------*/ 74 76 /** Initialize a new ddf driver instance of the driver 75 77 * -
uspace/drv/char/xtkbd/xtkbd.c
r336f03b ra84ddf0 43 43 44 44 #include "xtkbd.h" 45 /** Scancode set 1 table. */ 45 46 static const int scanmap_simple[] = { 46 47 … … 152 153 }; 153 154 /*----------------------------------------------------------------------------*/ 155 #define SCANCODE_SET_EXTENDED 0xe0 156 /** Scancode set 1 extended codes table */ 154 157 static const int scanmap_e0[] = { 155 158 [0x38] = KC_RALT, … … 179 182 ipc_callid_t icallid, ipc_call_t *icall); 180 183 /*----------------------------------------------------------------------------*/ 184 /** Keyboard function ops. */ 181 185 static ddf_dev_ops_t kbd_ops = { 182 186 .default_handler = default_connection_handler … … 230 234 } 231 235 /*----------------------------------------------------------------------------*/ 236 /** Get data and parse scancodes. 237 * @param arg Pointter to xt_kbd_t structure. 238 * @return Never. 239 */ 232 240 int polling(void *arg) 233 241 { … … 243 251 ssize_t size = char_dev_read(kbd->parent_sess, &code, 1); 244 252 245 if (code == 0xe0) {253 if (code == SCANCODE_SET_EXTENDED) { 246 254 map = scanmap_e0; 247 255 map_size = sizeof(scanmap_e0) / sizeof(int); … … 279 287 } 280 288 /*----------------------------------------------------------------------------*/ 289 /** Default handler for IPC methods not handled by DDF. 290 * 291 * @param fun Device function handling the call. 292 * @param icallid Call id. 293 * @param icall Call data. 294 */ 281 295 void default_connection_handler(ddf_fun_t *fun, 282 296 ipc_callid_t icallid, ipc_call_t *icall) -
uspace/drv/char/xtkbd/xtkbd.h
r336f03b ra84ddf0 30 30 */ 31 31 /** @file 32 * @brief XT keyboard driver ;32 * @brief XT keyboard driver 33 33 */ 34 34 … … 39 39 #include <fibril.h> 40 40 41 /** PC/XT keyboard driver structure. */ 41 42 typedef struct { 42 ddf_fun_t *kbd_fun; 43 async_sess_t *parent_sess; 44 async_sess_t *input_sess; 45 fid_t polling_fibril; 43 ddf_fun_t *kbd_fun; /**< Keyboard function. */ 44 async_sess_t *parent_sess; /**< Connection to device providing data. */ 45 async_sess_t *input_sess; /**< Callback connection to consumer. */ 46 fid_t polling_fibril; /**< Fibril retrieving an parsing data. */ 46 47 } xt_kbd_t; 47 48
Note:
See TracChangeset
for help on using the changeset viewer.