Changeset 1998bcd in mainline for uspace/drv/ohci/iface.c


Ignore:
Timestamp:
2011-04-08T22:25:00Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98064795
Parents:
297341b
Message:

Endpoint registration sends address as well

This is the first step towards using endpoint registration instead
of reservation of default address.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/iface.c

    r297341b r1998bcd  
    139139 * @param[in] fun Device function the action was invoked on.
    140140 * @param[in] address USB address of the device.
     141 * @param[in] ep_speed Endpoint speed (invalid means to use device one).
    141142 * @param[in] endpoint Endpoint number.
    142143 * @param[in] transfer_type USB transfer type.
     
    146147 * @return Error code.
    147148 */
    148 static int register_endpoint(
    149     ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint,
     149static int register_endpoint(ddf_fun_t *fun,
     150    usb_address_t address, usb_speed_t ep_speed, usb_endpoint_t endpoint,
    150151    usb_transfer_type_t transfer_type, usb_direction_t direction,
    151152    size_t max_packet_size, unsigned int interval)
     
    156157        if (address == hc->rh.address)
    157158                return EOK;
    158         const usb_speed_t speed =
    159                 usb_device_keeper_get_speed(&hc->manager, address);
     159        usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, address);
     160        if (speed >= USB_SPEED_MAX) {
     161                speed = ep_speed;
     162        }
    160163        const size_t size = max_packet_size;
    161164        usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
     
    183186        usb_log_debug("Unregister endpoint %d:%d %d.\n",
    184187            address, endpoint, direction);
     188        endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
     189            address, endpoint, direction, NULL);
     190        if (ep != NULL) {
     191                usb_device_keeper_del_ep(&hc->manager, address, ep);
     192        }
    185193        return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address,
    186194            endpoint, direction);
Note: See TracChangeset for help on using the changeset viewer.