Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    r1ae51ae r357a302  
    3232 * @brief UHCI driver
    3333 */
    34 #include <ddf/driver.h>
     34#include <driver.h>
    3535#include <remote_usbhc.h>
    3636
     
    4141#include "iface.h"
    4242#include "uhci.h"
    43 #include "utils/device_keeper.h"
    4443
    4544/*----------------------------------------------------------------------------*/
    46 static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
     45static int reserve_default_address(device_t *dev, usb_speed_t speed)
    4746{
    48         assert(fun);
    49         uhci_t *hc = fun_to_uhci(fun);
     47        assert(dev);
     48        uhci_t *hc = dev_to_uhci(dev);
    5049        assert(hc);
    51         usb_log_debug("Default address request with speed %d.\n", speed);
    52         device_keeper_reserve_default(&hc->device_manager, speed);
     50        usb_address_keeping_reserve_default(&hc->address_manager);
    5351        return EOK;
    5452}
    5553/*----------------------------------------------------------------------------*/
    56 static int release_default_address(ddf_fun_t *fun)
     54static int release_default_address(device_t *dev)
    5755{
    58         assert(fun);
    59         uhci_t *hc = fun_to_uhci(fun);
     56        assert(dev);
     57        uhci_t *hc = dev_to_uhci(dev);
    6058        assert(hc);
    61         usb_log_debug("Default address release.\n");
    62         device_keeper_release_default(&hc->device_manager);
     59        usb_address_keeping_release_default(&hc->address_manager);
    6360        return EOK;
    6461}
    6562/*----------------------------------------------------------------------------*/
    66 static int request_address(ddf_fun_t *fun, usb_speed_t speed,
     63static int request_address(device_t *dev, usb_speed_t speed,
    6764    usb_address_t *address)
    6865{
    69         assert(fun);
    70         uhci_t *hc = fun_to_uhci(fun);
     66        assert(dev);
     67        uhci_t *hc = dev_to_uhci(dev);
    7168        assert(hc);
    72         assert(address);
    73 
    74         usb_log_debug("Address request with speed %d.\n", speed);
    75         *address = device_keeper_request(&hc->device_manager, speed);
    76         usb_log_debug("Address request with result: %d.\n", *address);
     69        *address = usb_address_keeping_request(&hc->address_manager);
    7770        if (*address <= 0)
    7871          return *address;
     
    8174/*----------------------------------------------------------------------------*/
    8275static int bind_address(
    83   ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
     76  device_t *dev, usb_address_t address, devman_handle_t handle)
    8477{
    85         assert(fun);
    86         uhci_t *hc = fun_to_uhci(fun);
     78        assert(dev);
     79        uhci_t *hc = dev_to_uhci(dev);
    8780        assert(hc);
    88         usb_log_debug("Address bind %d-%d.\n", address, handle);
    89         device_keeper_bind(&hc->device_manager, address, handle);
     81        usb_address_keeping_devman_bind(&hc->address_manager, address, handle);
    9082        return EOK;
    9183}
    9284/*----------------------------------------------------------------------------*/
    93 static int release_address(ddf_fun_t *fun, usb_address_t address)
     85static int release_address(device_t *dev, usb_address_t address)
    9486{
    95         assert(fun);
    96         uhci_t *hc = fun_to_uhci(fun);
     87        assert(dev);
     88        uhci_t *hc = dev_to_uhci(dev);
    9789        assert(hc);
    98         usb_log_debug("Address release %d.\n", address);
    99         device_keeper_release(&hc->device_manager, address);
     90        usb_address_keeping_release_default(&hc->address_manager);
    10091        return EOK;
    10192}
    10293/*----------------------------------------------------------------------------*/
    103 static int interrupt_out(ddf_fun_t *fun, usb_target_t target,
    104     size_t max_packet_size, void *data, size_t size,
     94static int interrupt_out(device_t *dev, usb_target_t target,
     95    size_t max_packet_size,
     96    void *data, size_t size,
    10597    usbhc_iface_transfer_out_callback_t callback, void *arg)
    10698{
    107         assert(fun);
    108         uhci_t *hc = fun_to_uhci(fun);
    109         assert(hc);
    110         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     99        dev_speed_t speed = FULL_SPEED;
    111100
    112         usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    113             target.address, target.endpoint, size, max_packet_size);
    114 
    115         batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     101        batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
    116102            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
    117103        if (!batch)
     
    121107}
    122108/*----------------------------------------------------------------------------*/
    123 static int interrupt_in(ddf_fun_t *fun, usb_target_t target,
    124     size_t max_packet_size, void *data, size_t size,
     109static int interrupt_in(device_t *dev, usb_target_t target,
     110    size_t max_packet_size,
     111    void *data, size_t size,
    125112    usbhc_iface_transfer_in_callback_t callback, void *arg)
    126113{
    127         assert(fun);
    128         uhci_t *hc = fun_to_uhci(fun);
    129         assert(hc);
    130         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
    131         usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    132             target.address, target.endpoint, size, max_packet_size);
     114        dev_speed_t speed = FULL_SPEED;
    133115
    134         batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     116        batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT,
    135117            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg);
    136118        if (!batch)
     
    140122}
    141123/*----------------------------------------------------------------------------*/
    142 static int control_write(ddf_fun_t *fun, usb_target_t target,
     124static int control_write(device_t *dev, usb_target_t target,
    143125    size_t max_packet_size,
    144126    void *setup_data, size_t setup_size, void *data, size_t size,
    145127    usbhc_iface_transfer_out_callback_t callback, void *arg)
    146128{
    147         assert(fun);
    148         uhci_t *hc = fun_to_uhci(fun);
    149         assert(hc);
    150         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
    151         usb_log_debug("Control WRITE %d:%d %zu(%zu).\n",
    152             target.address, target.endpoint, size, max_packet_size);
     129        dev_speed_t speed = FULL_SPEED;
    153130
    154         batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     131        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    155132            max_packet_size, speed, data, size, setup_data, setup_size,
    156133            NULL, callback, arg);
     
    161138}
    162139/*----------------------------------------------------------------------------*/
    163 static int control_read(ddf_fun_t *fun, usb_target_t target,
     140static int control_read(device_t *dev, usb_target_t target,
    164141    size_t max_packet_size,
    165142    void *setup_data, size_t setup_size, void *data, size_t size,
    166143    usbhc_iface_transfer_in_callback_t callback, void *arg)
    167144{
    168         assert(fun);
    169         uhci_t *hc = fun_to_uhci(fun);
    170         assert(hc);
    171         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     145        dev_speed_t speed = FULL_SPEED;
    172146
    173         usb_log_debug("Control READ %d:%d %zu(%zu).\n",
    174             target.address, target.endpoint, size, max_packet_size);
    175         batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     147        batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL,
    176148            max_packet_size, speed, data, size, setup_data, setup_size, callback,
    177149            NULL, arg);
Note: See TracChangeset for help on using the changeset viewer.