Changeset eb1a2f4 in mainline for uspace/drv/vhc/hub.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/vhc/hub.c

    rdbe25f1 reb1a2f4  
    3939#include <str_error.h>
    4040#include <stdlib.h>
    41 #include <driver.h>
     41#include <ddf/driver.h>
     42#include <devman.h>
    4243#include <usb/hub.h>
    4344#include <usb/recognise.h>
     
    4647#include "hub/virthub.h"
    4748#include "vhcd.h"
     49#include "conn.h"
    4850
    4951usbvirt_device_t virtual_hub_device;
     52static ddf_dev_ops_t rh_ops = {
     53        .interfaces[USB_DEV_IFACE] = &rh_usb_iface,
     54};
    5055
    5156static int hub_register_in_devman_fibril(void *arg);
    5257
    53 void virtual_hub_device_init(device_t *hc_dev)
     58void virtual_hub_device_init(ddf_fun_t *hc_dev)
    5459{
    5560        virthub_init(&virtual_hub_device);
     
    8388int hub_register_in_devman_fibril(void *arg)
    8489{
    85         device_t *hc_dev = (device_t *) arg;
     90        ddf_fun_t *hc_dev = (ddf_fun_t *) arg;
    8691
    8792        /*
     
    9499        async_hangup(phone);
    95100
     101        int rc;
     102
    96103        usb_hc_connection_t hc_conn;
    97         usb_hc_connection_initialize(&hc_conn, hc_dev->handle);
     104        rc = usb_hc_connection_initialize(&hc_conn, hc_dev->handle);
     105        assert(rc == EOK);
    98106
    99         usb_hc_connection_open(&hc_conn);
     107        rc = usb_hc_connection_open(&hc_conn);
     108        assert(rc == EOK);
    100109
    101         int rc = usb_hc_new_device_wrapper(hc_dev, &hc_conn, USB_SPEED_FULL,
     110        ddf_fun_t *hub_dev;
     111        rc = usb_hc_new_device_wrapper(hc_dev->dev, &hc_conn,
     112            USB_SPEED_FULL,
    102113            pretend_port_rest, 0, NULL,
    103             NULL, NULL);
     114            NULL, NULL, &rh_ops, hc_dev, &hub_dev);
    104115        if (rc != EOK) {
    105116                usb_log_fatal("Failed to create root hub: %s.\n",
     
    108119
    109120        usb_hc_connection_close(&hc_conn);
     121
     122        usb_log_info("Created root hub function (handle %zu).\n",
     123            (size_t) hub_dev->handle);
    110124
    111125        return 0;
Note: See TracChangeset for help on using the changeset viewer.