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


Ignore:
Timestamp:
2011-04-07T15:53:46Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c156c2d
Parents:
64dbc83 (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:

development merge

File:
1 edited

Legend:

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

    r64dbc83 rb04967a  
    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
     
    238239        usb_device_keeper_init(&instance->manager);
    239240        usb_log_debug("Initialized device manager.\n");
     241
     242        ret =
     243            usb_endpoint_manager_init(&instance->ep_manager,
     244                BANDWIDTH_AVAILABLE_USB11);
     245        assert(ret == EOK);
    240246
    241247        return EOK;
     
    322328        assert(instance);
    323329        assert(batch);
    324         const int low_speed = (batch->speed == USB_SPEED_LOW);
    325         if (!usb_is_allowed(
    326             low_speed, batch->transfer_type, batch->max_packet_size)) {
    327                 usb_log_warning(
    328                     "Invalid USB transfer specified %s SPEED %d %zu.\n",
    329                     low_speed ? "LOW" : "FULL" , batch->transfer_type,
    330                     batch->max_packet_size);
    331                 return ENOTSUP;
    332         }
    333         /* TODO: check available bandwidth here */
    334330
    335331        transfer_list_t *list =
     
    338334        if (batch->transfer_type == USB_TRANSFER_CONTROL) {
    339335                usb_device_keeper_use_control(
    340                     &instance->manager, batch->target.address);
     336                    &instance->manager, batch->target);
    341337        }
    342338        transfer_list_add_batch(list, batch);
     
    358354{
    359355        assert(instance);
     356//      status |= 1; //Uncomment to work around qemu hang
    360357        /* TODO: Resume interrupts are not supported */
    361358        /* Lower 2 bits are transaction error and transaction complete */
     
    376373                        usb_transfer_batch_t *batch =
    377374                            list_get_instance(item, usb_transfer_batch_t, link);
    378                         if (batch->transfer_type == USB_TRANSFER_CONTROL) {
     375                        switch (batch->transfer_type)
     376                        {
     377                        case USB_TRANSFER_CONTROL:
    379378                                usb_device_keeper_release_control(
    380                                     &instance->manager, batch->target.address);
     379                                    &instance->manager, batch->target);
     380                                break;
     381                        case USB_TRANSFER_INTERRUPT:
     382                        case USB_TRANSFER_ISOCHRONOUS: {
     383/*
     384                                int ret = bandwidth_free(&instance->bandwidth,
     385                                    batch->target.address,
     386                                    batch->target.endpoint,
     387                                    batch->direction);
     388                                if (ret != EOK)
     389                                        usb_log_warning("Failed(%d) to free "
     390                                            "reserved bw: %s.\n", ret,
     391                                            str_error(ret));
     392*/
     393                                }
     394                        default:
     395                                break;
    381396                        }
    382397                        batch->next_step(batch);
     
    499514 * @return True if transaction is allowed by USB specs, false otherwise
    500515 */
     516#if 0
    501517bool usb_is_allowed(
    502518    bool low_speed, usb_transfer_type_t transfer, size_t size)
     
    516532        return false;
    517533}
     534#endif
    518535/**
    519536 * @}
Note: See TracChangeset for help on using the changeset viewer.