Changeset 60e5a856 in mainline for uspace/drv/usbhid/kbd/kbddev.c


Ignore:
Timestamp:
2011-06-12T16:22:18Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46b60e6
Parents:
5f88293
Message:

Bring back support for setting LEDs on USB keyboard.

File:
1 edited

Legend:

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

    r5f88293 r60e5a856  
    101101const char *HID_KBD_FUN_NAME = "keyboard";
    102102const char *HID_KBD_CLASS_NAME = "keyboard";
     103
     104static void usb_kbd_set_led(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev);
    103105
    104106/*----------------------------------------------------------------------------*/
     
    174176{
    175177        sysarg_t method = IPC_GET_IMETHOD(*icall);
     178        int callback;
    176179       
    177180        usb_kbd_t *kbd_dev = (usb_kbd_t *)fun->driver_data;
     
    183186        }
    184187
    185         if (method == IPC_M_CONNECT_TO_ME) {
    186                 int callback = IPC_GET_ARG5(*icall);
     188        switch (method) {
     189        case IPC_M_CONNECT_TO_ME:
     190                callback = IPC_GET_ARG5(*icall);
    187191
    188192                if (kbd_dev->console_phone != -1) {
     
    197201                usb_log_debug("default_connection_handler: OK\n");
    198202                async_answer_0(icallid, EOK);
    199                 return;
    200         }
    201        
    202         usb_log_debug("default_connection_handler: Wrong function.\n");
    203         async_answer_0(icallid, EINVAL);
     203                break;
     204        case KBDEV_SET_IND:
     205                kbd_dev->mods = IPC_GET_ARG1(*icall);
     206                usb_kbd_set_led(kbd_dev->hid_dev, kbd_dev);
     207                async_answer_0(icallid, EOK);
     208                break;
     209        default:
     210                usb_log_debug("default_connection_handler: Wrong function.\n");
     211                async_answer_0(icallid, EINVAL);
     212                break;
     213        }
    204214}
    205215
     
    615625                return ENOMEM;  // TODO: some other code??
    616626        }
     627
     628        /* Store link to HID device */
     629        kbd_dev->hid_dev = hid_dev;
    617630       
    618631        /*
Note: See TracChangeset for help on using the changeset viewer.