Changeset f8e4cb6 in mainline for uspace/drv/usbhid/kbddev.h


Ignore:
Timestamp:
2011-03-22T19:11:21Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
82d04a48
Parents:
62f4212
Message:

Ported usbhid driver to the new USB framework (#141).

Not tested thoroughly yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbddev.h

    r62f4212 rf8e4cb6  
    4646#include <usb/pipes.h>
    4747
    48 #include "hiddev.h"
     48#include <usb/devdrv.h>
     49
     50//#include "hiddev.h"
    4951
    5052/*----------------------------------------------------------------------------*/
     
    7577 *       being device-specific.
    7678 */
    77 typedef struct {
    78         /** Structure holding generic USB/HID device information. */
    79         usbhid_dev_t *hid_dev;
     79typedef struct usbhid_kbd_t {
     80        /** Structure holding generic USB device information. */
     81        //usbhid_dev_t *hid_dev;
     82        usb_device_t *usb_dev;
    8083       
    8184        /** Currently pressed keys (not translated to key codes). */
     
    101104        fibril_mutex_t *repeat_mtx;
    102105       
     106        /** Report descriptor. */
     107        uint8_t *report_desc;
     108
     109        /** Report descriptor size. */
     110        size_t report_desc_size;
     111
     112        /** HID Report parser. */
     113        usb_hid_report_parser_t *parser;
     114       
    103115        /** State of the structure (for checking before use).
    104116         *
     
    112124/*----------------------------------------------------------------------------*/
    113125
    114 int usbhid_kbd_try_add_device(ddf_dev_t *dev);
     126enum {
     127        USBHID_KBD_POLL_EP_NO = 0,
     128        USBHID_KBD_POLL_EP_COUNT = 1
     129};
     130
     131usb_endpoint_description_t *usbhid_kbd_endpoints[USBHID_KBD_POLL_EP_COUNT + 1];
     132
     133ddf_dev_ops_t keyboard_ops;
     134
     135/*----------------------------------------------------------------------------*/
     136
     137usbhid_kbd_t *usbhid_kbd_new(void);
     138
     139int usbhid_kbd_init(usbhid_kbd_t *kbd_dev, usb_device_t *dev);
     140
     141bool usbhid_kbd_polling_callback(usb_device_t *dev, uint8_t *buffer,
     142     size_t buffer_size, void *arg);
     143
     144void usbhid_kbd_polling_ended_callback(usb_device_t *dev, bool reason,
     145     void *arg);
    115146
    116147int usbhid_kbd_is_initialized(const usbhid_kbd_t *kbd_dev);
Note: See TracChangeset for help on using the changeset viewer.