Changeset dcaf819 in mainline for uspace/drv/uhci-hcd/hc.c


Ignore:
Timestamp:
2011-04-06T22:33:08Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, 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

File:
1 edited

Legend:

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

    r6bf9bc4 rdcaf819  
    6666static int hc_interrupt_emulator(void *arg);
    6767static int hc_debug_checker(void *arg);
    68 
     68#if 0
    6969static bool usb_is_allowed(
    7070    bool low_speed, usb_transfer_type_t transfer, size_t size);
     71#endif
    7172/*----------------------------------------------------------------------------*/
    7273/** Initialize UHCI hcd driver structure
     
    239240        usb_log_debug("Initialized device manager.\n");
    240241
    241         ret = bandwidth_init(&instance->bandwidth, BANDWIDTH_AVAILABLE_USB11,
    242             bandwidth_count_usb11);
     242        ret =
     243            usb_endpoint_manager_init(&instance->ep_manager,
     244                BANDWIDTH_AVAILABLE_USB11);
    243245        assert(ret == EOK);
    244246
     
    326328        assert(instance);
    327329        assert(batch);
    328         const int low_speed = (batch->speed == USB_SPEED_LOW);
    329         if (!usb_is_allowed(
    330             low_speed, batch->transfer_type, batch->max_packet_size)) {
    331                 usb_log_error("Invalid USB transfer specified %s %d %zu.\n",
    332                     usb_str_speed(batch->speed), batch->transfer_type,
    333                     batch->max_packet_size);
    334                 return ENOTSUP;
    335         }
    336         /* Check available bandwidth */
    337         if (batch->transfer_type == USB_TRANSFER_INTERRUPT ||
    338             batch->transfer_type == USB_TRANSFER_ISOCHRONOUS) {
    339                 size_t bw = bandwidth_count_usb11(batch->speed,
    340                     batch->transfer_type, batch->buffer_size,
    341                     batch->max_packet_size);
    342                 int ret =
    343                     bandwidth_use(&instance->bandwidth, batch->target.address,
    344                     batch->target.endpoint, batch->direction, bw);
    345                 if (ret != EOK) {
    346                         usb_log_error("Failed(%d) to use reserved bw: %s.\n",
    347                             ret, str_error(ret));
    348                         return ret;
    349                 }
    350         }
    351330
    352331        transfer_list_t *list =
     
    402381                        case USB_TRANSFER_INTERRUPT:
    403382                        case USB_TRANSFER_ISOCHRONOUS: {
     383/*
    404384                                int ret = bandwidth_free(&instance->bandwidth,
    405385                                    batch->target.address,
     
    410390                                            "reserved bw: %s.\n", ret,
    411391                                            str_error(ret));
     392*/
    412393                                }
    413394                        default:
     
    533514 * @return True if transaction is allowed by USB specs, false otherwise
    534515 */
     516#if 0
    535517bool usb_is_allowed(
    536518    bool low_speed, usb_transfer_type_t transfer, size_t size)
     
    550532        return false;
    551533}
     534#endif
    552535/**
    553536 * @}
Note: See TracChangeset for help on using the changeset viewer.