Changeset 2b621cb in mainline


Ignore:
Timestamp:
2011-12-28T13:05:59Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8afeb04
Parents:
295f658
Message:

usbhid: Remove useless structure members. Rename references to console.

Location:
uspace/drv/bus/usb/usbhid
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.c

    r295f658 r2b621cb  
    7171#include "../usbhid.h"
    7272
     73static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
     74static ddf_dev_ops_t kbdops = { .default_handler = default_connection_handler };
    7375/*----------------------------------------------------------------------------*/
    7476
     
    187189                        break;
    188190                }
    189                 if (kbd_dev->console_sess == NULL) {
    190                         kbd_dev->console_sess = sess;
     191                if (kbd_dev->client_sess == NULL) {
     192                        kbd_dev->client_sess = sess;
    191193                        usb_log_debug("%s: OK\n", __FUNCTION__);
    192194                        async_answer_0(icallid, EOK);
     
    292294{
    293295        usb_log_debug2("Sending kbdev event %d/%d to the console\n", type, key);
    294         if (kbd_dev->console_sess == NULL) {
     296        if (kbd_dev->client_sess == NULL) {
    295297                usb_log_warning(
    296298                    "Connection to console not ready, key discarded.\n");
     
    298300        }
    299301
    300         async_exch_t *exch = async_exchange_begin(kbd_dev->console_sess);
     302        async_exch_t *exch = async_exchange_begin(kbd_dev->client_sess);
    301303        if (exch != NULL) {
    302304                async_msg_2(exch, KBDEV_EVENT, type, key);
     
    499501        /* Store the initialized HID device and HID ops
    500502         * to the DDF function. */
    501         fun->ops = &kbd_dev->ops;
     503        fun->ops = &kbdops;
    502504        fun->driver_data = kbd_dev;
    503505
     
    576578        fibril_mutex_initialize(&kbd_dev->repeat_mtx);
    577579        kbd_dev->initialized = USB_KBD_STATUS_UNINITIALIZED;
    578         kbd_dev->ops.default_handler = default_connection_handler;
    579580
    580581        /* Store link to HID device */
     
    737738
    738739        /* Hangup session to the console. */
    739         if (kbd_dev->console_sess)
    740                 async_hangup(kbd_dev->console_sess);
     740        if (kbd_dev->client_sess)
     741                async_hangup(kbd_dev->client_sess);
    741742
    742743        //assert(!fibril_mutex_is_locked((*kbd_dev)->repeat_mtx));
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.h

    r295f658 r2b621cb  
    8282        unsigned lock_keys;
    8383
    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;
    8986
    9087        /** Information for auto-repeat of keys. */
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    r295f658 r2b621cb  
    5757#define NAME "mouse"
    5858
    59 /*----------------------------------------------------------------------------*/
    60 
     59static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
     60
     61static ddf_dev_ops_t ops = { .default_handler = default_connection_handler };
     62
     63/*----------------------------------------------------------------------------*/
    6164const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {
    6265        .transfer_type = USB_TRANSFER_INTERRUPT,
     
    307310        }
    308311
    309         fun->ops = &mouse->ops;
     312        fun->ops = &ops;
    310313        fun->driver_data = mouse;
    311314
     
    350353         * to the DDF function.
    351354         */
    352         fun->ops = &mouse->ops;
     355        fun->ops = &ops;
    353356        fun->driver_data = mouse;
    354357
     
    458461        }
    459462
    460         // set handler for incoming calls
    461         mouse_dev->ops.default_handler = default_connection_handler;
    462 
    463463        // TODO: how to know if the device supports the request???
    464464        usbhid_req_set_idle(&hid_dev->usb_dev->ctrl_pipe,
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.h

    r295f658 r2b621cb  
    4646/** Container for USB mouse device. */
    4747typedef struct {
    48         /** IPC session to console (consumer). */
     48        /** IPC session to consumer. */
    4949        async_sess_t *mouse_sess;
    5050        async_sess_t *wheel_sess;
     
    5454        size_t buttons_count;
    5555
    56         ddf_dev_ops_t ops;
    5756        /* DDF mouse function */
    5857        ddf_fun_t *mouse_fun;
Note: See TracChangeset for help on using the changeset viewer.