Changeset e50cd7f in mainline for uspace/drv/usbkbd/main.c


Ignore:
Timestamp:
2011-04-17T19:17:55Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63517c2, cfbbe1d3
Parents:
ef354b6 (diff), 8595577b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

new report structure fixes

File:
1 edited

Legend:

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

    ref354b6 re50cd7f  
    3333/**
    3434 * @file
    35  * Main routines of USB HID driver.
     35 * Main routines of USB KBD driver.
    3636 */
    3737
     
    4242
    4343#include <usb/devdrv.h>
     44#include <usb/devpoll.h>
    4445
    4546#include "kbddev.h"
     
    7576 * @sa usb_kbd_fibril(), usb_kbd_repeat_fibril()
    7677 */
    77 static int usbhid_try_add_device(usb_device_t *dev)
     78static int usb_kbd_try_add_device(usb_device_t *dev)
    7879{
    7980        /* Create the function exposed under /dev/devices. */
     
    105106                usb_kbd_free(&kbd_dev);
    106107                return rc;
    107         }       
     108        }
    108109       
    109110        usb_log_debug("USB/HID KBD device structure initialized.\n");
     
    195196 * @retval EREFUSED if the device is not supported.
    196197 */
    197 static int usbhid_add_device(usb_device_t *dev)
     198static int usb_kbd_add_device(usb_device_t *dev)
    198199{
    199         usb_log_debug("usbhid_add_device()\n");
     200        usb_log_debug("usb_kbd_add_device()\n");
    200201       
    201202        if (dev->interface_no < 0) {
    202203                usb_log_warning("Device is not a supported keyboard.\n");
    203                 usb_log_error("Failed to add HID device: endpoint not found."
    204                     "\n");
     204                usb_log_error("Failed to add USB KBD device: endpoint not "
     205                    "found.\n");
    205206                return ENOTSUP;
    206207        }
    207208       
    208         int rc = usbhid_try_add_device(dev);
     209        int rc = usb_kbd_try_add_device(dev);
    209210       
    210211        if (rc != EOK) {
    211212                usb_log_warning("Device is not a supported keyboard.\n");
    212                 usb_log_error("Failed to add HID device: %s.\n",
     213                usb_log_error("Failed to add KBD device: %s.\n",
    213214                    str_error(rc));
    214215                return rc;
     
    224225/* Currently, the framework supports only device adding. Once the framework
    225226 * supports unplug, more callbacks will be added. */
    226 static usb_driver_ops_t usbhid_driver_ops = {
    227         .add_device = usbhid_add_device,
     227static usb_driver_ops_t usb_kbd_driver_ops = {
     228        .add_device = usb_kbd_add_device,
    228229};
    229230
    230231
    231232/* The driver itself. */
    232 static usb_driver_t usbhid_driver = {
     233static usb_driver_t usb_kbd_driver = {
    233234        .name = NAME,
    234         .ops = &usbhid_driver_ops,
     235        .ops = &usb_kbd_driver_ops,
    235236        .endpoints = usb_kbd_endpoints
    236237};
     
    238239/*----------------------------------------------------------------------------*/
    239240
    240 //static driver_ops_t kbd_driver_ops = {
    241 //      .add_device = usbhid_add_device,
    242 //};
    243 
    244 ///*----------------------------------------------------------------------------*/
    245 
    246 //static driver_t kbd_driver = {
    247 //      .name = NAME,
    248 //      .driver_ops = &kbd_driver_ops
    249 //};
    250 
    251 /*----------------------------------------------------------------------------*/
    252 
    253241int main(int argc, char *argv[])
    254242{
    255         printf(NAME ": HelenOS USB HID driver.\n");
     243        printf(NAME ": HelenOS USB KBD driver.\n");
    256244
    257245        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    258246
    259         return usb_driver_main(&usbhid_driver);
     247        return usb_driver_main(&usb_kbd_driver);
    260248}
    261249
Note: See TracChangeset for help on using the changeset viewer.