Changeset a43f1d18 in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-04-09T18:26:22Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2ad98fd
Parents:
f35b294 (diff), 97e7e8a (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:

merge with usb/development

File:
1 edited

Legend:

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

    rf35b294 ra43f1d18  
    7474            name, target.address, target.endpoint, size, ep->max_packet_size);
    7575
    76         assert(ep->speed ==
    77             usb_device_keeper_get_speed(&(*hc)->manager, target.address));
     76//      assert(ep->speed ==
     77//          usb_device_keeper_get_speed(&(*hc)->manager, target.address));
    7878//      assert(ep->max_packet_size == max_packet_size);
    7979//      assert(ep->transfer_type == USB_TRANSFER_CONTROL);
     
    198198/*----------------------------------------------------------------------------*/
    199199static int register_endpoint(
    200     ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint,
     200    ddf_fun_t *fun, usb_address_t address, usb_speed_t ep_speed,
     201    usb_endpoint_t endpoint,
    201202    usb_transfer_type_t transfer_type, usb_direction_t direction,
    202203    size_t max_packet_size, unsigned int interval)
     
    204205        hc_t *hc = fun_to_hc(fun);
    205206        assert(hc);
    206         const usb_speed_t speed =
    207             usb_device_keeper_get_speed(&hc->manager, address);
     207        usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
     208        if (speed >= USB_SPEED_MAX) {
     209                speed = ep_speed;
     210        }
    208211        const size_t size =
    209212            (transfer_type == USB_TRANSFER_INTERRUPT
     
    243246        usb_log_debug("Unregister endpoint %d:%d %d.\n",
    244247            address, endpoint, direction);
     248        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
     249            address, endpoint, direction, NULL);
     250        if (ep != NULL) {
     251                usb_device_keeper_del_ep(&hc->manager, address, ep);
     252        }
    245253        return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address,
    246254            endpoint, direction);
     
    251259 * @param[in] fun DDF function that was called.
    252260 * @param[in] target USB device to write to.
    253  * @param[in] max_packet_size maximum size of data packet the device accepts
    254261 * @param[in] data Source of data.
    255262 * @param[in] size Size of data source.
     
    259266 */
    260267static int interrupt_out(
    261     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     268    ddf_fun_t *fun, usb_target_t target, void *data,
    262269    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    263270{
     
    280287 * @param[in] fun DDF function that was called.
    281288 * @param[in] target USB device to write to.
    282  * @param[in] max_packet_size maximum size of data packet the device accepts
    283289 * @param[out] data Data destination.
    284290 * @param[in] size Size of data source.
     
    288294 */
    289295static int interrupt_in(
    290     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     296    ddf_fun_t *fun, usb_target_t target, void *data,
    291297    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    292298{
     
    309315 * @param[in] fun DDF function that was called.
    310316 * @param[in] target USB device to write to.
    311  * @param[in] max_packet_size maximum size of data packet the device accepts
    312317 * @param[in] data Source of data.
    313318 * @param[in] size Size of data source.
     
    317322 */
    318323static int bulk_out(
    319     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     324    ddf_fun_t *fun, usb_target_t target, void *data,
    320325    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
    321326{
     
    338343 * @param[in] fun DDF function that was called.
    339344 * @param[in] target USB device to write to.
    340  * @param[in] max_packet_size maximum size of data packet the device accepts
    341345 * @param[out] data Data destination.
    342346 * @param[in] size Size of data source.
     
    346350 */
    347351static int bulk_in(
    348     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     352    ddf_fun_t *fun, usb_target_t target, void *data,
    349353    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
    350354{
     
    367371 * @param[in] fun DDF function that was called.
    368372 * @param[in] target USB device to write to.
    369  * @param[in] max_packet_size maximum size of data packet the device accepts.
    370373 * @param[in] setup_data Data to send with SETUP transfer.
    371374 * @param[in] setup_size Size of data to send with SETUP transfer (always 8B).
     
    377380 */
    378381static int control_write(
    379     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
     382    ddf_fun_t *fun, usb_target_t target,
    380383    void *setup_data, size_t setup_size, void *data, size_t size,
    381384    usbhc_iface_transfer_out_callback_t callback, void *arg)
     
    401404 * @param[in] fun DDF function that was called.
    402405 * @param[in] target USB device to write to.
    403  * @param[in] max_packet_size maximum size of data packet the device accepts.
    404406 * @param[in] setup_data Data to send with SETUP packet.
    405407 * @param[in] setup_size Size of data to send with SETUP packet (should be 8B).
     
    411413 */
    412414static int control_read(
    413     ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
     415    ddf_fun_t *fun, usb_target_t target,
    414416    void *setup_data, size_t setup_size, void *data, size_t size,
    415417    usbhc_iface_transfer_in_callback_t callback, void *arg)
Note: See TracChangeset for help on using the changeset viewer.