Changeset 252e30c in mainline for uspace/drv/usbkbd/kbdrepeat.c


Ignore:
Timestamp:
2011-03-24T22:55:29Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d92638
Parents:
476b71ff
Message:

Huge refactoring of KBD driver code.

  • Separated code for retrieval of Report descriptor into hidreport.h/c (will be common for all HID drivers).
  • Removed unused files hiddev.h/c.
  • Changed prefix of usbkbd functions to usb_kbd_*.
  • Removed unused code.
  • Parsing of Report descriptor with fallback to boot protocol in KBD driver (not finished (boot report descriptor missing).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbkbd/kbdrepeat.c

    r476b71ff r252e30c  
    6262 *
    6363 * If the currently repeated key is not pressed any more (
    64  * usbhid_kbd_repeat_stop() was called), it stops repeating it and starts
     64 * usb_kbd_repeat_stop() was called), it stops repeating it and starts
    6565 * checking again.
    6666 *
     
    7070 * @param kbd Keyboard device structure.
    7171 */
    72 static void usbhid_kbd_repeat_loop(usbhid_kbd_t *kbd)
     72static void usb_kbd_repeat_loop(usb_kbd_t *kbd)
    7373{
    7474        unsigned int delay = 0;
     
    7878        while (true) {
    7979                // check if the kbd structure is usable
    80                 if (!usbhid_kbd_is_initialized(kbd)) {
    81                         if (usbhid_kbd_is_ready_to_destroy(kbd)) {
    82                                 usbhid_kbd_free(&kbd);
     80                if (!usb_kbd_is_initialized(kbd)) {
     81                        if (usb_kbd_is_ready_to_destroy(kbd)) {
     82                                usb_kbd_free(&kbd);
    8383                                assert(kbd == NULL);
    8484                        }
     
    9292                                usb_log_debug2("Repeating key: %u.\n",
    9393                                    kbd->repeat.key_repeated);
    94                                 usbhid_kbd_push_ev(kbd, KEY_PRESS,
     94                                usb_kbd_push_ev(kbd, KEY_PRESS,
    9595                                    kbd->repeat.key_repeated);
    9696                                delay = kbd->repeat.delay_between;
     
    127127 * @retval EINVAL if no argument is supplied.
    128128 */
    129 int usbhid_kbd_repeat_fibril(void *arg)
     129int usb_kbd_repeat_fibril(void *arg)
    130130{
    131131        usb_log_debug("Autorepeat fibril spawned.\n");
     
    136136        }
    137137       
    138         usbhid_kbd_t *kbd = (usbhid_kbd_t *)arg;
     138        usb_kbd_t *kbd = (usb_kbd_t *)arg;
    139139       
    140         usbhid_kbd_repeat_loop(kbd);
     140        usb_kbd_repeat_loop(kbd);
    141141       
    142142        return EOK;
     
    154154 * @param key Key to start repeating.
    155155 */
    156 void usbhid_kbd_repeat_start(usbhid_kbd_t *kbd, unsigned int key)
     156void usb_kbd_repeat_start(usb_kbd_t *kbd, unsigned int key)
    157157{
    158158        fibril_mutex_lock(kbd->repeat_mtx);
     
    172172 * @param key Key to stop repeating.
    173173 */
    174 void usbhid_kbd_repeat_stop(usbhid_kbd_t *kbd, unsigned int key)
     174void usb_kbd_repeat_stop(usb_kbd_t *kbd, unsigned int key)
    175175{
    176176        fibril_mutex_lock(kbd->repeat_mtx);
Note: See TracChangeset for help on using the changeset viewer.