Changeset eb1a2f4 in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-02-22T23:30:56Z (13 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/uhci-hcd/iface.c

    rdbe25f1 reb1a2f4  
    3232 * @brief UHCI driver
    3333 */
    34 #include <driver.h>
     34#include <ddf/driver.h>
    3535#include <remote_usbhc.h>
    3636
     
    4343
    4444/*----------------------------------------------------------------------------*/
    45 static int reserve_default_address(device_t *dev, usb_speed_t speed)
     45static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
    4646{
    47         assert(dev);
    48         uhci_t *hc = dev_to_uhci(dev);
     47        assert(fun);
     48        uhci_t *hc = fun_to_uhci(fun);
    4949        assert(hc);
    5050        usb_address_keeping_reserve_default(&hc->address_manager);
     
    5252}
    5353/*----------------------------------------------------------------------------*/
    54 static int release_default_address(device_t *dev)
     54static int release_default_address(ddf_fun_t *fun)
    5555{
    56         assert(dev);
    57         uhci_t *hc = dev_to_uhci(dev);
     56        assert(fun);
     57        uhci_t *hc = fun_to_uhci(fun);
    5858        assert(hc);
    5959        usb_address_keeping_release_default(&hc->address_manager);
     
    6161}
    6262/*----------------------------------------------------------------------------*/
    63 static int request_address(device_t *dev, usb_speed_t speed,
     63static int request_address(ddf_fun_t *fun, usb_speed_t speed,
    6464    usb_address_t *address)
    6565{
    66         assert(dev);
    67         uhci_t *hc = dev_to_uhci(dev);
     66        assert(fun);
     67        uhci_t *hc = fun_to_uhci(fun);
    6868        assert(hc);
    6969        *address = usb_address_keeping_request(&hc->address_manager);
     
    7474/*----------------------------------------------------------------------------*/
    7575static int bind_address(
    76   device_t *dev, usb_address_t address, devman_handle_t handle)
     76  ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
    7777{
    78         assert(dev);
    79         uhci_t *hc = dev_to_uhci(dev);
     78        assert(fun);
     79        uhci_t *hc = fun_to_uhci(fun);
    8080        assert(hc);
    8181        usb_address_keeping_devman_bind(&hc->address_manager, address, handle);
     
    8383}
    8484/*----------------------------------------------------------------------------*/
    85 static int release_address(device_t *dev, usb_address_t address)
     85static int release_address(ddf_fun_t *fun, usb_address_t address)
    8686{
    87         assert(dev);
    88         uhci_t *hc = dev_to_uhci(dev);
     87        assert(fun);
     88        uhci_t *hc = fun_to_uhci(fun);
    8989        assert(hc);
    9090        usb_address_keeping_release_default(&hc->address_manager);
     
    9292}
    9393/*----------------------------------------------------------------------------*/
    94 static int interrupt_out(device_t *dev, usb_target_t target,
     94static int interrupt_out(ddf_fun_t *fun, usb_target_t target,
    9595    size_t max_packet_size,
    9696    void *data, size_t size,
     
    9999        dev_speed_t speed = FULL_SPEED;
    100100
    101         batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
     101        batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    102102            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
    103103        if (!batch)
     
    107107}
    108108/*----------------------------------------------------------------------------*/
    109 static int interrupt_in(device_t *dev, usb_target_t target,
     109static int interrupt_in(ddf_fun_t *fun, usb_target_t target,
    110110    size_t max_packet_size,
    111111    void *data, size_t size,
     
    114114        dev_speed_t speed = FULL_SPEED;
    115115
    116         batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
     116        batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    117117            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg);
    118118        if (!batch)
     
    122122}
    123123/*----------------------------------------------------------------------------*/
    124 static int control_write(device_t *dev, usb_target_t target,
     124static int control_write(ddf_fun_t *fun, usb_target_t target,
    125125    size_t max_packet_size,
    126126    void *setup_data, size_t setup_size, void *data, size_t size,
     
    129129        dev_speed_t speed = FULL_SPEED;
    130130
    131         batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
     131        batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    132132            max_packet_size, speed, data, size, setup_data, setup_size,
    133133            NULL, callback, arg);
     
    138138}
    139139/*----------------------------------------------------------------------------*/
    140 static int control_read(device_t *dev, usb_target_t target,
     140static int control_read(ddf_fun_t *fun, usb_target_t target,
    141141    size_t max_packet_size,
    142142    void *setup_data, size_t setup_size, void *data, size_t size,
     
    145145        dev_speed_t speed = FULL_SPEED;
    146146
    147         batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
     147        batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    148148            max_packet_size, speed, data, size, setup_data, setup_size, callback,
    149149            NULL, arg);
Note: See TracChangeset for help on using the changeset viewer.