Changeset fb8927d in mainline


Ignore:
Timestamp:
2011-04-06T19:30:39Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e70157
Parents:
88dd355
Message:

Only INT and ISO transfers require bandwidth reservation

add dead code for alternate default address reservation.

File:
1 edited

Legend:

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

    r88dd355 rfb8927d  
    5555        usb_device_keeper_reserve_default_address(&hc->manager, speed);
    5656        return EOK;
     57#if 0
     58        endpoint_t *ep = malloc(sizeof(endpoint_t));
     59        if (ep == NULL)
     60                return ENOMEM;
     61        const size_t max_packet_size = speed == USB_SPEED_LOW ? 8 : 64;
     62        endpoint_init(ep, USB_TRANSFER_CONTROL, speed, max_packet_size);
     63        int ret;
     64try_retgister:
     65        ret = usb_endpoint_manager_register_ep(&hc->ep_manager,
     66            USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH, ep, endpoint_destroy, 0);
     67        if (ret == EEXISTS) {
     68                async_usleep(1000);
     69                goto try_retgister;
     70        }
     71        if (ret != EOK) {
     72                endpoint_destroy(ep);
     73        }
     74        return ret;
     75#endif
    5776}
    5877/*----------------------------------------------------------------------------*/
     
    6887        assert(hc);
    6988        usb_log_debug("Default address release.\n");
     89//      return usb_endpoint_manager_unregister_ep(&hc->ep_manager,
     90//          USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH);
    7091        usb_device_keeper_release_default_address(&hc->manager);
    7192        return EOK;
     
    149170            usb_str_speed(speed), direction, size, max_packet_size, interval);
    150171
    151         const size_t bw = bandwidth_count_usb11(speed, transfer_type, size,
    152             max_packet_size);
     172        const size_t bw =
     173            (transfer_type == USB_TRANSFER_INTERRUPT
     174            || transfer_type == USB_TRANSFER_ISOCHRONOUS) ?
     175            bandwidth_count_usb11(speed, transfer_type, size, max_packet_size) :
     176            0;
     177
    153178        int ret = usb_endpoint_manager_register_ep(&hc->ep_manager,
    154179            address, endpoint, direction, ep, endpoint_destroy, bw);
     
    156181                endpoint_destroy(ep);
    157182        }
    158 
    159183        return ret;
    160184}
Note: See TracChangeset for help on using the changeset viewer.