Changeset 2b621cb in mainline
- Timestamp:
- 2011-12-28T13:05:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8afeb04
- Parents:
- 295f658
- Location:
- uspace/drv/bus/usb/usbhid
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/drv/bus/usb/usbhid/kbd/kbddev.c ¶
r295f658 r2b621cb 71 71 #include "../usbhid.h" 72 72 73 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 74 static ddf_dev_ops_t kbdops = { .default_handler = default_connection_handler }; 73 75 /*----------------------------------------------------------------------------*/ 74 76 … … 187 189 break; 188 190 } 189 if (kbd_dev->c onsole_sess == NULL) {190 kbd_dev->c onsole_sess = sess;191 if (kbd_dev->client_sess == NULL) { 192 kbd_dev->client_sess = sess; 191 193 usb_log_debug("%s: OK\n", __FUNCTION__); 192 194 async_answer_0(icallid, EOK); … … 292 294 { 293 295 usb_log_debug2("Sending kbdev event %d/%d to the console\n", type, key); 294 if (kbd_dev->c onsole_sess == NULL) {296 if (kbd_dev->client_sess == NULL) { 295 297 usb_log_warning( 296 298 "Connection to console not ready, key discarded.\n"); … … 298 300 } 299 301 300 async_exch_t *exch = async_exchange_begin(kbd_dev->c onsole_sess);302 async_exch_t *exch = async_exchange_begin(kbd_dev->client_sess); 301 303 if (exch != NULL) { 302 304 async_msg_2(exch, KBDEV_EVENT, type, key); … … 499 501 /* Store the initialized HID device and HID ops 500 502 * to the DDF function. */ 501 fun->ops = &kbd _dev->ops;503 fun->ops = &kbdops; 502 504 fun->driver_data = kbd_dev; 503 505 … … 576 578 fibril_mutex_initialize(&kbd_dev->repeat_mtx); 577 579 kbd_dev->initialized = USB_KBD_STATUS_UNINITIALIZED; 578 kbd_dev->ops.default_handler = default_connection_handler;579 580 580 581 /* Store link to HID device */ … … 737 738 738 739 /* Hangup session to the console. */ 739 if (kbd_dev->c onsole_sess)740 async_hangup(kbd_dev->c onsole_sess);740 if (kbd_dev->client_sess) 741 async_hangup(kbd_dev->client_sess); 741 742 742 743 //assert(!fibril_mutex_is_locked((*kbd_dev)->repeat_mtx)); -
TabularUnified uspace/drv/bus/usb/usbhid/kbd/kbddev.h ¶
r295f658 r2b621cb 82 82 unsigned lock_keys; 83 83 84 /** IPC session to the console device (for sending key events). */ 85 async_sess_t *console_sess; 86 87 /** @todo What is this actually? */ 88 ddf_dev_ops_t ops; 84 /** IPC session to client (for sending key events). */ 85 async_sess_t *client_sess; 89 86 90 87 /** Information for auto-repeat of keys. */ -
TabularUnified uspace/drv/bus/usb/usbhid/mouse/mousedev.c ¶
r295f658 r2b621cb 57 57 #define NAME "mouse" 58 58 59 /*----------------------------------------------------------------------------*/ 60 59 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 60 61 static ddf_dev_ops_t ops = { .default_handler = default_connection_handler }; 62 63 /*----------------------------------------------------------------------------*/ 61 64 const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = { 62 65 .transfer_type = USB_TRANSFER_INTERRUPT, … … 307 310 } 308 311 309 fun->ops = & mouse->ops;312 fun->ops = &ops; 310 313 fun->driver_data = mouse; 311 314 … … 350 353 * to the DDF function. 351 354 */ 352 fun->ops = & mouse->ops;355 fun->ops = &ops; 353 356 fun->driver_data = mouse; 354 357 … … 458 461 } 459 462 460 // set handler for incoming calls461 mouse_dev->ops.default_handler = default_connection_handler;462 463 463 // TODO: how to know if the device supports the request??? 464 464 usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe, -
TabularUnified uspace/drv/bus/usb/usbhid/mouse/mousedev.h ¶
r295f658 r2b621cb 46 46 /** Container for USB mouse device. */ 47 47 typedef struct { 48 /** IPC session to cons ole (consumer). */48 /** IPC session to consumer. */ 49 49 async_sess_t *mouse_sess; 50 50 async_sess_t *wheel_sess; … … 54 54 size_t buttons_count; 55 55 56 ddf_dev_ops_t ops;57 56 /* DDF mouse function */ 58 57 ddf_fun_t *mouse_fun;
Note:
See TracChangeset
for help on using the changeset viewer.