Changeset 252e30c in mainline for uspace/drv/usbkbd/kbddev.h


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/kbddev.h

    r476b71ff r252e30c  
    3434 */
    3535
    36 #ifndef USBHID_KBDDEV_H_
    37 #define USBHID_KBDDEV_H_
     36#ifndef USB_KBDDEV_H_
     37#define USB_KBDDEV_H_
    3838
    3939#include <stdint.h>
     
    6262 *       being device-specific.
    6363 */
    64 typedef struct usbhid_kbd_t {
     64typedef struct usb_kbd_t {
    6565        /** Structure holding generic USB device information. */
    6666        //usbhid_dev_t *hid_dev;
     
    8484       
    8585        /** Information for auto-repeat of keys. */
    86         usbhid_kbd_repeat_t repeat;
     86        usb_kbd_repeat_t repeat;
    8787       
    8888        /** Mutex for accessing the information about auto-repeat. */
     
    105105         */
    106106        int initialized;
    107 } usbhid_kbd_t;
     107} usb_kbd_t;
    108108
    109109/*----------------------------------------------------------------------------*/
    110110
    111111enum {
    112         USBHID_KBD_POLL_EP_NO = 0,
    113         USBHID_KBD_POLL_EP_COUNT = 1
     112        USB_KBD_POLL_EP_NO = 0,
     113        USB_KBD_POLL_EP_COUNT = 1
    114114};
    115115
    116 usb_endpoint_description_t *usbhid_kbd_endpoints[USBHID_KBD_POLL_EP_COUNT + 1];
     116usb_endpoint_description_t *usb_kbd_endpoints[USB_KBD_POLL_EP_COUNT + 1];
    117117
    118118ddf_dev_ops_t keyboard_ops;
     
    120120/*----------------------------------------------------------------------------*/
    121121
    122 usbhid_kbd_t *usbhid_kbd_new(void);
     122usb_kbd_t *usb_kbd_new(void);
    123123
    124 int usbhid_kbd_init(usbhid_kbd_t *kbd_dev, usb_device_t *dev);
     124int usb_kbd_init(usb_kbd_t *kbd_dev, usb_device_t *dev);
    125125
    126 bool usbhid_kbd_polling_callback(usb_device_t *dev, uint8_t *buffer,
     126bool usb_kbd_polling_callback(usb_device_t *dev, uint8_t *buffer,
    127127     size_t buffer_size, void *arg);
    128128
    129 void usbhid_kbd_polling_ended_callback(usb_device_t *dev, bool reason,
     129void usb_kbd_polling_ended_callback(usb_device_t *dev, bool reason,
    130130     void *arg);
    131131
    132 int usbhid_kbd_is_initialized(const usbhid_kbd_t *kbd_dev);
     132int usb_kbd_is_initialized(const usb_kbd_t *kbd_dev);
    133133
    134 int usbhid_kbd_is_ready_to_destroy(const usbhid_kbd_t *kbd_dev);
     134int usb_kbd_is_ready_to_destroy(const usb_kbd_t *kbd_dev);
    135135
    136 void usbhid_kbd_free(usbhid_kbd_t **kbd_dev);
     136void usb_kbd_free(usb_kbd_t **kbd_dev);
    137137
    138 void usbhid_kbd_push_ev(usbhid_kbd_t *kbd_dev, int type, unsigned int key);
     138void usb_kbd_push_ev(usb_kbd_t *kbd_dev, int type, unsigned int key);
    139139
    140 #endif /* USBHID_KBDDEV_H_ */
     140#endif /* USB_KBDDEV_H_ */
    141141
    142142/**
Note: See TracChangeset for help on using the changeset viewer.