Ignore:
Timestamp:
2012-02-09T20:35:12Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591762c6
Parents:
7cede12c (diff), 3d4750f (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 mainline changes

File:
1 edited

Legend:

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

    r7cede12c rb7068da  
    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.