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


Ignore:
Timestamp:
2011-04-07T15:04:16Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36cd378
Parents:
9d06563 (diff), a82889e (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:

partial merge form usb/development

File:
1 edited

Legend:

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

    r9d06563 ra4e18e1  
    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                 int ret =
    340                     bandwidth_use(&instance->bandwidth, batch->target.address,
    341                     batch->target.endpoint, batch->direction);
    342                 if (ret != EOK) {
    343                         usb_log_warning("Failed(%d) to use reserved bw: %s.\n",
    344                             ret, str_error(ret));
    345                 }
    346         }
    347330
    348331        transfer_list_t *list =
     
    398381                        case USB_TRANSFER_INTERRUPT:
    399382                        case USB_TRANSFER_ISOCHRONOUS: {
     383/*
    400384                                int ret = bandwidth_free(&instance->bandwidth,
    401385                                    batch->target.address,
     
    406390                                            "reserved bw: %s.\n", ret,
    407391                                            str_error(ret));
     392*/
    408393                                }
    409394                        default:
     
    529514 * @return True if transaction is allowed by USB specs, false otherwise
    530515 */
     516#if 0
    531517bool usb_is_allowed(
    532518    bool low_speed, usb_transfer_type_t transfer, size_t size)
     
    546532        return false;
    547533}
     534#endif
    548535/**
    549536 * @}
Note: See TracChangeset for help on using the changeset viewer.