Changeset eb1a2f4 in mainline for uspace/drv/usbhid/main.c


Ignore:
Timestamp:
2011-02-22T23:30:56Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b5d1535, a9c674e0
Parents:
dbe25f1 (diff), 664af708 (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:

Merge mainline changes (DDF refactoring)

This merge includes DDF refactoring that brought multifunctional devices
(i.e. ddf_dev_t and ddf_fun_t). Please, see ticket #295 at HelenOS
upstream Trac.

The conflicts themselves were easy to solve (merely several renamings).

Changes to USB subsystem:

  • drivers uses ddf_dev_t and ddf_fun_t
  • different signatures of many library functions
  • several hacks around communication with parent device (now the communication is clearer and somehow what we have now is hack about other hacks)
    • will repair and clean later
  • maybe added some extra debugging messages (the diff has about 240K, and I admit I have no energy to double check that)

WARNING:

  • the diff is VERY long, recommended is viewing partial diffs of the merge (i.e. merges in mainline branch that lead to the parent one)
  • merging with your branches might involve huge renamings, sorry, no other way is possible

BUGS:

  • hub driver will not work (no function created)

GOOD NEWS:

  • QEMU keyboard seems to work with QEMU 0.13 and 0.14
  • we are up-to-date with mainline again
File:
1 edited

Legend:

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

    rdbe25f1 reb1a2f4  
    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.