Ignore:
File:
1 edited

Legend:

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

    r5e07e2b5 r252e30c  
    3333/**
    3434 * @file
    35  * Main routines of USB KBD driver.
     35 * Main routines of USB HID driver.
    3636 */
    3737
     
    4242
    4343#include <usb/devdrv.h>
    44 #include <usb/devpoll.h>
    4544
    4645#include "kbddev.h"
     
    7675 * @sa usb_kbd_fibril(), usb_kbd_repeat_fibril()
    7776 */
    78 static int usb_kbd_try_add_device(usb_device_t *dev)
     77static int usbhid_try_add_device(usb_device_t *dev)
    7978{
    8079        /* Create the function exposed under /dev/devices. */
     
    106105                usb_kbd_free(&kbd_dev);
    107106                return rc;
    108         }
     107        }       
    109108       
    110109        usb_log_debug("USB/HID KBD device structure initialized.\n");
     
    196195 * @retval EREFUSED if the device is not supported.
    197196 */
    198 static int usb_kbd_add_device(usb_device_t *dev)
     197static int usbhid_add_device(usb_device_t *dev)
    199198{
    200         usb_log_debug("usb_kbd_add_device()\n");
     199        usb_log_debug("usbhid_add_device()\n");
    201200       
    202201        if (dev->interface_no < 0) {
    203202                usb_log_warning("Device is not a supported keyboard.\n");
    204                 usb_log_error("Failed to add USB KBD device: endpoint not "
    205                     "found.\n");
     203                usb_log_error("Failed to add HID device: endpoint not found."
     204                    "\n");
    206205                return ENOTSUP;
    207206        }
    208207       
    209         int rc = usb_kbd_try_add_device(dev);
     208        int rc = usbhid_try_add_device(dev);
    210209       
    211210        if (rc != EOK) {
    212211                usb_log_warning("Device is not a supported keyboard.\n");
    213                 usb_log_error("Failed to add KBD device: %s.\n",
     212                usb_log_error("Failed to add HID device: %s.\n",
    214213                    str_error(rc));
    215214                return rc;
     
    225224/* Currently, the framework supports only device adding. Once the framework
    226225 * supports unplug, more callbacks will be added. */
    227 static usb_driver_ops_t usb_kbd_driver_ops = {
    228         .add_device = usb_kbd_add_device,
     226static usb_driver_ops_t usbhid_driver_ops = {
     227        .add_device = usbhid_add_device,
    229228};
    230229
    231230
    232231/* The driver itself. */
    233 static usb_driver_t usb_kbd_driver = {
     232static usb_driver_t usbhid_driver = {
    234233        .name = NAME,
    235         .ops = &usb_kbd_driver_ops,
     234        .ops = &usbhid_driver_ops,
    236235        .endpoints = usb_kbd_endpoints
    237236};
     
    239238/*----------------------------------------------------------------------------*/
    240239
     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
    241253int main(int argc, char *argv[])
    242254{
    243         printf(NAME ": HelenOS USB KBD driver.\n");
     255        printf(NAME ": HelenOS USB HID driver.\n");
    244256
    245257        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    246258
    247         return usb_driver_main(&usb_kbd_driver);
     259        return usb_driver_main(&usbhid_driver);
    248260}
    249261
Note: See TracChangeset for help on using the changeset viewer.