Changeset eb1a2f4 in mainline for uspace/drv/uhci-rhd


Ignore:
Timestamp:
2011-02-22T23:30:56Z (15 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
Location:
uspace/drv/uhci-rhd
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/main.c

    rdbe25f1 reb1a2f4  
    3232 * @brief UHCI driver
    3333 */
    34 #include <driver.h>
     34#include <ddf/driver.h>
    3535#include <usb_iface.h>
    3636#include <usb/ddfiface.h>
     
    4444#define NAME "uhci-rhd"
    4545
    46 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     46static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
    4747{
    48         assert(dev);
    49         assert(dev->driver_data);
     48        assert(fun);
     49        assert(fun->driver_data);
    5050        assert(handle);
    5151
    52         *handle = ((uhci_root_hub_t*)dev->driver_data)->hc_handle;
    53         usb_log_debug("Answering HC handle: %d.\n", *handle);
     52        *handle = ((uhci_root_hub_t*)fun->driver_data)->hc_handle;
    5453
    5554        return EOK;
     
    6160};
    6261
    63 static device_ops_t uhci_rh_ops = {
     62static ddf_dev_ops_t uhci_rh_ops = {
    6463        .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface,
    6564};
    6665
    67 static int uhci_rh_add_device(device_t *device)
     66static int uhci_rh_add_device(ddf_dev_t *device)
    6867{
    6968        if (!device)
     
    7170
    7271        usb_log_debug2("%s called device %d\n", __FUNCTION__, device->handle);
    73         device->ops = &uhci_rh_ops;
     72
     73        //device->ops = &uhci_rh_ops;
     74        (void) uhci_rh_ops;
    7475
    7576        uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t));
     
    104105int main(int argc, char *argv[])
    105106{
    106         usb_log_enable(USB_LOG_LEVEL_ERROR, NAME);
    107         return driver_main(&uhci_rh_driver);
     107        usb_log_enable(USB_LOG_LEVEL_INFO, NAME);
     108        return ddf_driver_main(&uhci_rh_driver);
    108109}
    109110/**
  • uspace/drv/uhci-rhd/port.c

    rdbe25f1 reb1a2f4  
    5252int uhci_port_init(
    5353  uhci_port_t *port, port_status_t *address, unsigned number,
    54   unsigned usec, device_t *rh, int parent_phone)
     54  unsigned usec, ddf_dev_t *rh, int parent_phone)
    5555{
    5656        assert(port);
     
    187187            USB_SPEED_FULL,
    188188            new_device_enable_port, port->number, port,
    189             &dev_addr, &port->attached_device);
     189            &dev_addr, &port->attached_device, NULL, NULL, NULL);
    190190        if (rc != EOK) {
    191191                usb_log_error("Failed adding new device on port %u: %s.\n",
  • uspace/drv/uhci-rhd/port.h

    rdbe25f1 reb1a2f4  
    3636
    3737#include <assert.h>
    38 #include <driver.h> /* device_t */
     38#include <ddf/driver.h>
    3939#include <stdint.h>
    4040#include <usb/usbdevice.h>
     
    4848        unsigned wait_period_usec;
    4949        usb_hc_connection_t hc_connection;
    50         device_t *rh;
     50        ddf_dev_t *rh;
    5151        devman_handle_t attached_device;
    5252        fid_t checker;
     
    5555int uhci_port_init(
    5656  uhci_port_t *port, port_status_t *address, unsigned number,
    57   unsigned usec, device_t *rh, int parent_phone);
     57  unsigned usec, ddf_dev_t *rh, int parent_phone);
    5858
    5959void uhci_port_fini(uhci_port_t *port);
  • uspace/drv/uhci-rhd/root_hub.c

    rdbe25f1 reb1a2f4  
    3434#include <errno.h>
    3535#include <stdint.h>
    36 
     36#include <ddi.h>
     37#include <devman.h>
    3738#include <usb/debug.h>
    3839
     
    4142
    4243int uhci_root_hub_init(
    43   uhci_root_hub_t *instance, void *addr, size_t size, device_t *rh)
     44  uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh)
    4445{
    4546        assert(instance);
  • uspace/drv/uhci-rhd/root_hub.h

    rdbe25f1 reb1a2f4  
    3636
    3737#include <fibril.h>
    38 #include <driver.h> /* for device_t */
     38#include <ddf/driver.h>
    3939
    4040#include "port.h"
     
    5050
    5151int uhci_root_hub_init(
    52   uhci_root_hub_t *instance, void *addr, size_t size, device_t *rh);
     52  uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh);
    5353
    5454int uhci_root_hub_fini(uhci_root_hub_t *instance);
Note: See TracChangeset for help on using the changeset viewer.