Changeset 4b39af4 in mainline for uspace/drv/usbkbd/main.c


Ignore:
Timestamp:
2011-04-08T13:24:21Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6acc80f3, 85c47729
Parents:
ffc63b0 (diff), 8b74997f (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:

Development branch changes

File:
1 edited

Legend:

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

    rffc63b0 r4b39af4  
    3333/**
    3434 * @file
    35  * Main routines of USB HID driver.
     35 * Main routines of USB KBD driver.
    3636 */
    3737
     
    7575 * @sa usb_kbd_fibril(), usb_kbd_repeat_fibril()
    7676 */
    77 static int usbhid_try_add_device(usb_device_t *dev)
     77static int usb_kbd_try_add_device(usb_device_t *dev)
    7878{
    7979        /* Create the function exposed under /dev/devices. */
     
    105105                usb_kbd_free(&kbd_dev);
    106106                return rc;
    107         }       
     107        }
    108108       
    109109        usb_log_debug("USB/HID KBD device structure initialized.\n");
     
    195195 * @retval EREFUSED if the device is not supported.
    196196 */
    197 static int usbhid_add_device(usb_device_t *dev)
     197static int usb_kbd_add_device(usb_device_t *dev)
    198198{
    199         usb_log_debug("usbhid_add_device()\n");
     199        usb_log_debug("usb_kbd_add_device()\n");
    200200       
    201201        if (dev->interface_no < 0) {
    202202                usb_log_warning("Device is not a supported keyboard.\n");
    203                 usb_log_error("Failed to add HID device: endpoint not found."
    204                     "\n");
     203                usb_log_error("Failed to add USB KBD device: endpoint not "
     204                    "found.\n");
    205205                return ENOTSUP;
    206206        }
    207207       
    208         int rc = usbhid_try_add_device(dev);
     208        int rc = usb_kbd_try_add_device(dev);
    209209       
    210210        if (rc != EOK) {
    211211                usb_log_warning("Device is not a supported keyboard.\n");
    212                 usb_log_error("Failed to add HID device: %s.\n",
     212                usb_log_error("Failed to add KBD device: %s.\n",
    213213                    str_error(rc));
    214214                return rc;
     
    224224/* Currently, the framework supports only device adding. Once the framework
    225225 * supports unplug, more callbacks will be added. */
    226 static usb_driver_ops_t usbhid_driver_ops = {
    227         .add_device = usbhid_add_device,
     226static usb_driver_ops_t usb_kbd_driver_ops = {
     227        .add_device = usb_kbd_add_device,
    228228};
    229229
    230230
    231231/* The driver itself. */
    232 static usb_driver_t usbhid_driver = {
     232static usb_driver_t usb_kbd_driver = {
    233233        .name = NAME,
    234         .ops = &usbhid_driver_ops,
     234        .ops = &usb_kbd_driver_ops,
    235235        .endpoints = usb_kbd_endpoints
    236236};
     
    238238/*----------------------------------------------------------------------------*/
    239239
    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 
    253240int main(int argc, char *argv[])
    254241{
    255         printf(NAME ": HelenOS USB HID driver.\n");
     242        printf(NAME ": HelenOS USB KBD driver.\n");
    256243
    257244        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    258245
    259         return usb_driver_main(&usbhid_driver);
     246        return usb_driver_main(&usb_kbd_driver);
    260247}
    261248
Note: See TracChangeset for help on using the changeset viewer.