Changeset dcaf819 in mainline for uspace/drv/ohci


Ignore:
Timestamp:
2011-04-06T22:33:08Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
9a7e5b4
Parents:
6bf9bc4 (diff), 87305bb (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:

OHCI structures, bandwidth reworked

Initial support for endpoint registration and a new way of bandwidth reservation
New usb_endpoint_manager to manage endpoints, bandwidth, and toggle states.
Further work:

switch communication collision avoidance to the new endpoint manager (requires registration of all endpoints)

use endpoint registration in default address reservation

Location:
uspace/drv/ohci
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/batch.c

    r6bf9bc4 rdcaf819  
    7373        CHECK_NULL_DISPOSE_RETURN(instance,
    7474            "Failed to allocate batch instance.\n");
    75         usb_transfer_batch_init(instance, target, transfer_type, speed, max_packet_size,
    76             buffer, NULL, buffer_size, NULL, setup_size, func_in,
    77             func_out, arg, fun, NULL);
     75        usb_transfer_batch_init(instance, target, transfer_type, speed,
     76            max_packet_size, buffer, NULL, buffer_size, NULL, setup_size,
     77            func_in, func_out, arg, fun, NULL, NULL);
    7878
    7979        if (buffer_size > 0) {
  • uspace/drv/ohci/hc.c

    r6bf9bc4 rdcaf819  
    9292        instance->ddf_instance = fun;
    9393        usb_device_keeper_init(&instance->manager);
    94         ret = bandwidth_init(&instance->bandwidth, BANDWIDTH_AVAILABLE_USB11,
    95             bandwidth_count_usb11);
    96         CHECK_RET_RETURN(ret, "Failed to initialize bandwidth allocator: %s.\n",
     94        ret = usb_endpoint_manager_init(&instance->ep_manager,
     95            BANDWIDTH_AVAILABLE_USB11);
     96        CHECK_RET_RETURN(ret, "Failed to initialize endpoint manager: %s.\n",
    9797            ret, str_error(ret));
    9898
  • uspace/drv/ohci/hc.h

    r6bf9bc4 rdcaf819  
    4242#include <usb/usb.h>
    4343#include <usb/host/device_keeper.h>
    44 #include <usb/host/bandwidth.h>
     44#include <usb/host/usb_endpoint_manager.h>
    4545#include <usbhc_iface.h>
    4646
     
    5555        ddf_fun_t *ddf_instance;
    5656        usb_device_keeper_t manager;
    57         bandwidth_t bandwidth;
     57        usb_endpoint_manager_t ep_manager;
    5858        fid_t interrupt_emulator;
    5959} hc_t;
  • uspace/drv/ohci/iface.c

    r6bf9bc4 rdcaf819  
    162162            address, endpoint, usb_str_transfer_type(transfer_type),
    163163            usb_str_speed(speed), direction, size, max_packet_size, interval);
    164         return bandwidth_reserve(&hc->bandwidth, address, endpoint, direction,
    165             speed, transfer_type, max_packet_size, size, interval);
     164        // TODO use real endpoint here!
     165        return usb_endpoint_manager_register_ep(&hc->ep_manager,
     166            address, endpoint, direction, NULL, 0);
    166167}
    167168/*----------------------------------------------------------------------------*/
     
    183184        usb_log_debug("Unregister endpoint %d:%d %d.\n",
    184185            address, endpoint, direction);
    185         return bandwidth_release(&hc->bandwidth, address, endpoint, direction);
    186 
    187         return ENOTSUP;
     186        return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address,
     187            endpoint, direction);
    188188}
    189189/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.