Changes in uspace/lib/usbhost/src/usb_endpoint_manager.c [46f2808:cbd568b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_endpoint_manager.c
r46f2808 rcbd568b 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup libusbhost 29 * @{ 30 */ 31 /** @file 32 * HC Endpoint management. 33 */ 28 34 29 35 #include <bool.h> … … 56 62 } 57 63 /*----------------------------------------------------------------------------*/ 58 /** Get list that holds endp ints for given address.64 /** Get list that holds endpoints for given address. 59 65 * @param instance usb_endpoint_manager structure, non-null. 60 66 * @param addr USB address, must be >= 0. … … 75 81 * @return Pointer to endpoint_t structure representing given communication 76 82 * target, NULL if there is no such endpoint registered. 83 * @note Assumes that the internal mutex is locked. 77 84 */ 78 85 static endpoint_t * find_locked(usb_endpoint_manager_t *instance, … … 169 176 * 170 177 * Really ugly one. Resets toggle bit on all endpoints that need it. 178 * @TODO Use tools from libusbdev requests.h 171 179 */ 172 180 void usb_endpoint_manager_reset_eps_if_need(usb_endpoint_manager_t *instance, … … 184 192 case 0x01: /* Clear Feature -- resets only cleared ep */ 185 193 /* Recipient is endpoint, value is zero (ENDPOINT_STALL) */ 194 // TODO Use macros in libusbdev requests.h 186 195 if (((data[0] & 0xf) == 1) && ((data[2] | data[3]) == 0)) { 187 196 fibril_mutex_lock(&instance->guard); … … 202 211 /* Recipient must be device, this resets all endpoints, 203 212 * 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. */ 205 216 if ((data[0] & 0xf) == 0) { 206 217 fibril_mutex_lock(&instance->guard); … … 385 396 } 386 397 /*----------------------------------------------------------------------------*/ 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 */ 387 407 void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance, 388 408 usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg) … … 403 423 fibril_mutex_unlock(&instance->guard); 404 424 } 425 /** 426 * @} 427 */
Note:
See TracChangeset
for help on using the changeset viewer.