Changeset 233e68d in mainline for uspace/drv/usbhid/main.c


Ignore:
Timestamp:
2011-02-23T18:28:41Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e9e58ea3
Parents:
deece2f (diff), a9c674e0 (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:

Devel changes

File:
1 edited

Legend:

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

    rdeece2f r233e68d  
    3636 */
    3737
    38 #include <driver.h>
     38#include <ddf/driver.h>
    3939#include <ipc/driver.h>
    4040#include <ipc/kbd.h>
     
    7272};
    7373
    74 static void default_connection_handler(device_t *, ipc_callid_t, ipc_call_t *);
    75 static device_ops_t keyboard_ops = {
     74static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
     75static ddf_dev_ops_t keyboard_ops = {
    7676        .default_handler = default_connection_handler
    7777};
     
    8585 * @param icall Call data.
    8686 */
    87 void default_connection_handler(device_t *dev,
     87void default_connection_handler(ddf_fun_t *fun,
    8888    ipc_callid_t icallid, ipc_call_t *icall)
    8989{
     
    413413}
    414414
    415 static usb_hid_dev_kbd_t *usbkbd_init_device(device_t *dev)
     415static usb_hid_dev_kbd_t *usbkbd_init_device(ddf_dev_t *dev)
    416416{
    417417        int rc;
     
    554554        }
    555555
    556         device_t *dev = (device_t *)arg;
     556        ddf_dev_t *dev = (ddf_dev_t *)arg;
    557557
    558558        // initialize device (get and process descriptors, get address, etc.)
     
    568568}
    569569
    570 static int usbkbd_add_device(device_t *dev)
     570static int usbkbd_add_device(ddf_dev_t *dev)
    571571{
    572572        /* For now, fail immediately. */
     
    590590
    591591        /*
     592         * Create default function.
     593         */
     594        // FIXME - check for errors
     595        ddf_fun_t *kbd_fun = ddf_fun_create(dev, fun_exposed, "keyboard");
     596        assert(kbd_fun != NULL);
     597        kbd_fun->ops = &keyboard_ops;
     598
     599        int rc = ddf_fun_bind(kbd_fun);
     600        assert(rc == EOK);
     601        rc = ddf_fun_add_to_class(kbd_fun, "keyboard");
     602        assert(rc == EOK);
     603
     604        /*
    592605         * Create new fibril for handling this keyboard
    593606         */
     
    599612        fibril_add_ready(fid);
    600613
    601         dev->ops = &keyboard_ops;
    602 
    603         add_device_to_class(dev, "keyboard");
     614        //dev->ops = &keyboard_ops;
     615        (void)keyboard_ops;
     616
     617        //add_device_to_class(dev, "keyboard");
    604618
    605619        /*
     
    621635{
    622636        usb_log_enable(USB_LOG_LEVEL_INFO, "usbhid");
    623         return driver_main(&kbd_driver);
     637        return ddf_driver_main(&kbd_driver);
    624638}
    625639
Note: See TracChangeset for help on using the changeset viewer.