Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/usb_endpoint_manager.c

    r46f2808 rcbd568b  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28/**  @addtogroup libusbhost
     29 * @{
     30 */
     31/** @file
     32 * HC Endpoint management.
     33 */
    2834
    2935#include <bool.h>
     
    5662}
    5763/*----------------------------------------------------------------------------*/
    58 /** Get list that holds endpints for given address.
     64/** Get list that holds endpoints for given address.
    5965 * @param instance usb_endpoint_manager structure, non-null.
    6066 * @param addr USB address, must be >= 0.
     
    7581 * @return Pointer to endpoint_t structure representing given communication
    7682 * target, NULL if there is no such endpoint registered.
     83 * @note Assumes that the internal mutex is locked.
    7784 */
    7885static endpoint_t * find_locked(usb_endpoint_manager_t *instance,
     
    169176 *
    170177 * Really ugly one. Resets toggle bit on all endpoints that need it.
     178 * @TODO Use tools from libusbdev requests.h
    171179 */
    172180void usb_endpoint_manager_reset_eps_if_need(usb_endpoint_manager_t *instance,
     
    184192        case 0x01: /* Clear Feature -- resets only cleared ep */
    185193                /* Recipient is endpoint, value is zero (ENDPOINT_STALL) */
     194                // TODO Use macros in libusbdev requests.h
    186195                if (((data[0] & 0xf) == 1) && ((data[2] | data[3]) == 0)) {
    187196                        fibril_mutex_lock(&instance->guard);
     
    202211                /* Recipient must be device, this resets all endpoints,
    203212                 * In fact there should be no endpoints but EP 0 registered
    204                  * as different interfaces use different endpoints. */
     213                 * as different interfaces use different endpoints,
     214                 * unless you're changing configuration or alternative
     215                 * interface of an already setup device. */
    205216                if ((data[0] & 0xf) == 0) {
    206217                        fibril_mutex_lock(&instance->guard);
     
    385396}
    386397/*----------------------------------------------------------------------------*/
     398/** Unregister and destroy all endpoints using given address.
     399 * @param instance usb_endpoint_manager structure, non-null.
     400 * @param address USB address.
     401 * @param endpoint USB endpoint number.
     402 * @param direction Communication direction.
     403 * @param callback Function to call after unregister, before destruction.
     404 * @arg Argument to pass to the callback function.
     405 * @return Error code.
     406 */
    387407void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance,
    388408    usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg)
     
    403423        fibril_mutex_unlock(&instance->guard);
    404424}
     425/**
     426 * @}
     427 */
Note: See TracChangeset for help on using the changeset viewer.