Changeset 60e5a856 in mainline


Ignore:
Timestamp:
2011-06-12T16:22:18Z (13 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.

Location:
uspace
Files:
10 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        /*
  • uspace/drv/usbhid/kbd/kbddev.h

    r5f88293 r60e5a856  
    6565 */
    6666typedef struct usb_kbd_t {
     67        /** Link to HID device structure */
     68        struct usb_hid_dev *hid_dev;
     69
    6770        /** Previously pressed keys (not translated to key codes). */
    6871        int32_t *keys_old;
  • uspace/srv/hid/input/ctl/apple.c

    r5f88293 r60e5a856  
    4444static void apple_ctl_parse_scancode(int);
    4545static int apple_ctl_init(kbd_dev_t *);
    46 static void apple_ctl_set_ind(unsigned);
     46static void apple_ctl_set_ind(kbd_dev_t *, unsigned);
    4747
    4848kbd_ctl_ops_t apple_ctl = {
     
    8484}
    8585
    86 static void apple_ctl_set_ind(unsigned mods)
     86static void apple_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    8787{
    8888        (void) mods;
  • uspace/srv/hid/input/ctl/gxe_fb.c

    r5f88293 r60e5a856  
    4646static void gxe_fb_ctl_parse_scancode(int);
    4747static int gxe_fb_ctl_init(kbd_dev_t *);
    48 static void gxe_fb_ctl_set_ind(unsigned);
     48static void gxe_fb_ctl_set_ind(kbd_dev_t *, unsigned);
    4949
    5050kbd_ctl_ops_t gxe_fb_ctl = {
     
    239239}
    240240
    241 static void gxe_fb_ctl_set_ind(unsigned mods)
     241static void gxe_fb_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    242242{
    243243        (void) mods;
  • uspace/srv/hid/input/ctl/pc.c

    r5f88293 r60e5a856  
    4545static void pc_ctl_parse_scancode(int);
    4646static int pc_ctl_init(kbd_dev_t *);
    47 static void pc_ctl_set_ind(unsigned);
     47static void pc_ctl_set_ind(kbd_dev_t *, unsigned);
    4848
    4949kbd_ctl_ops_t pc_ctl = {
     
    265265}
    266266
    267 static void pc_ctl_set_ind(unsigned mods)
     267static void pc_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    268268{
    269269        uint8_t b;
  • uspace/srv/hid/input/ctl/stty.c

    r5f88293 r60e5a856  
    4545static void stty_ctl_parse_scancode(int);
    4646static int stty_ctl_init(kbd_dev_t *);
    47 static void stty_ctl_set_ind(unsigned);
     47static void stty_ctl_set_ind(kbd_dev_t *, unsigned);
    4848
    4949kbd_ctl_ops_t stty_ctl = {
     
    238238}
    239239
    240 static void stty_ctl_set_ind(unsigned mods)
     240static void stty_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    241241{
    242242        (void) mods;
  • uspace/srv/hid/input/ctl/sun.c

    r5f88293 r60e5a856  
    4545static void sun_ctl_parse_scancode(int);
    4646static int sun_ctl_init(kbd_dev_t *);
    47 static void sun_ctl_set_ind(unsigned);
     47static void sun_ctl_set_ind(kbd_dev_t *, unsigned);
    4848
    4949kbd_ctl_ops_t sun_ctl = {
     
    8989}
    9090
    91 static void sun_ctl_set_ind(unsigned mods)
     91static void sun_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
    9292{
    9393        (void) mods;
  • uspace/srv/hid/input/generic/input.c

    r5f88293 r60e5a856  
    138138
    139139                        /* Update keyboard lock indicator lights. */
    140                         (*kdev->ctl_ops->set_ind)(mods);
     140                        (*kdev->ctl_ops->set_ind)(kdev, mods);
    141141                } else {
    142142                        lock_keys = lock_keys & ~mod_mask;
  • uspace/srv/hid/input/include/kbd.h

    r5f88293 r60e5a856  
    6060        /** Ctl ops */
    6161        struct kbd_ctl_ops *ctl_ops;
     62
     63        /** Controller-private data */
     64        void *ctl_private;
    6265} kbd_dev_t;
    6366
  • uspace/srv/hid/input/include/kbd_ctl.h

    r5f88293 r60e5a856  
    4545        void (*parse_scancode)(int);
    4646        int (*init)(struct kbd_dev *);
    47         void (*set_ind)(unsigned);
     47        void (*set_ind)(struct kbd_dev *, unsigned);
    4848} kbd_ctl_ops_t;
    4949
Note: See TracChangeset for help on using the changeset viewer.