Changeset a1313b8c in mainline


Ignore:
Timestamp:
2011-04-02T14:41:12Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1273b86c
Parents:
4ab89e5
Message:

Implement hc bandwidth reservation

Location:
uspace/drv/uhci-hcd
Files:
3 edited

Legend:

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

    r4ab89e5 ra1313b8c  
    239239        usb_log_debug("Initialized device manager.\n");
    240240
     241        ret = bandwidth_init(&instance->bandwidth, BANDWIDTH_AVAILABLE_USB11,
     242            bandwidth_count_usb11);
     243        assert(ret == true);
     244
    241245        return EOK;
    242246#undef CHECK_RET_DEST_CMDS_RETURN
  • uspace/drv/uhci-hcd/hc.h

    r4ab89e5 ra1313b8c  
    4343#include <usbhc_iface.h>
    4444#include <usb/host/device_keeper.h>
     45#include <usb/host/bandwidth.h>
    4546
    4647#include "batch.h"
     
    8485typedef struct hc {
    8586        usb_device_keeper_t manager;
     87        bandwidth_t bandwidth;
    8688
    8789        regs_t *registers;
  • uspace/drv/uhci-hcd/iface.c

    r4ab89e5 ra1313b8c  
    133133    size_t max_packet_size, unsigned int interval)
    134134{
    135         return ENOTSUP;
     135        hc_t *hc = fun_to_hc(fun);
     136        assert(hc);
     137        const usb_speed_t speed =
     138            usb_device_keeper_get_speed(&hc->manager, address);
     139        size_t size = max_packet_size;
     140
     141        usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
     142            address, endpoint, usb_str_transfer_type(transfer_type),
     143            usb_str_speed(speed), direction, size, max_packet_size, interval);
     144        return bandwidth_reserve(&hc->bandwidth, address, endpoint, direction,
     145            speed, transfer_type, max_packet_size, size, interval);
    136146}
    137147/*----------------------------------------------------------------------------*/
     
    140150    usb_endpoint_t endpoint, usb_direction_t direction)
    141151{
    142         return ENOTSUP;
     152        hc_t *hc = fun_to_hc(fun);
     153        assert(hc);
     154        usb_log_debug("Unregister endpoint %d:%d %d.\n",
     155            address, endpoint, direction);
     156        return bandwidth_release(&hc->bandwidth, address, endpoint, direction);
    143157}
    144158/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.