Changes in uspace/lib/usbhost/src/usb_bus.c [516d361:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_bus.c
r516d361 rb7fd2a0 105 105 * @return Error code. 106 106 */ 107 static int usb_bus_get_free_address(usb_bus_t *instance, usb_address_t *address)107 static errno_t usb_bus_get_free_address(usb_bus_t *instance, usb_address_t *address) 108 108 { 109 109 … … 200 200 * @return Error code. 201 201 */ 202 int usb_bus_init(usb_bus_t *instance,202 errno_t usb_bus_init(usb_bus_t *instance, 203 203 size_t available_bandwidth, bw_count_func_t bw_count, usb_speed_t max_speed) 204 204 { … … 224 224 * @return Error code. 225 225 */ 226 int usb_bus_register_ep(usb_bus_t *instance, endpoint_t *ep, size_t data_size)226 errno_t usb_bus_register_ep(usb_bus_t *instance, endpoint_t *ep, size_t data_size) 227 227 { 228 228 assert(instance); … … 262 262 * @return Error code. 263 263 */ 264 int usb_bus_unregister_ep(usb_bus_t *instance, endpoint_t *ep)264 errno_t usb_bus_unregister_ep(usb_bus_t *instance, endpoint_t *ep) 265 265 { 266 266 assert(instance); … … 316 316 * @return Error code. 317 317 */ 318 int usb_bus_add_ep(usb_bus_t *instance,318 errno_t usb_bus_add_ep(usb_bus_t *instance, 319 319 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 320 320 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, … … 364 364 365 365 if (callback) { 366 const int ret = callback(ep, arg);366 const errno_t ret = callback(ep, arg); 367 367 if (ret != EOK) { 368 368 fibril_mutex_unlock(&instance->guard); … … 394 394 * @return Error code. 395 395 */ 396 int usb_bus_remove_ep(usb_bus_t *instance,396 errno_t usb_bus_remove_ep(usb_bus_t *instance, 397 397 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 398 398 ep_remove_callback_t callback, void *arg) … … 417 417 } 418 418 419 int usb_bus_reset_toggle(usb_bus_t *instance, usb_target_t target, bool all)419 errno_t usb_bus_reset_toggle(usb_bus_t *instance, usb_target_t target, bool all) 420 420 { 421 421 assert(instance); … … 423 423 return EINVAL; 424 424 425 int ret = ENOENT;425 errno_t ret = ENOENT; 426 426 427 427 fibril_mutex_lock(&instance->guard); … … 446 446 * @return Error code. 447 447 */ 448 int usb_bus_remove_address(usb_bus_t *instance,448 errno_t usb_bus_remove_address(usb_bus_t *instance, 449 449 usb_address_t address, ep_remove_callback_t callback, void *arg) 450 450 { … … 455 455 fibril_mutex_lock(&instance->guard); 456 456 457 const int ret = instance->devices[address].occupied ? EOK : ENOENT;457 const errno_t ret = instance->devices[address].occupied ? EOK : ENOENT; 458 458 instance->devices[address].occupied = false; 459 459 … … 481 481 * @note Default address is only available in strict mode. 482 482 */ 483 int usb_bus_request_address(usb_bus_t *instance,483 errno_t usb_bus_request_address(usb_bus_t *instance, 484 484 usb_address_t *address, bool strict, usb_speed_t speed) 485 485 { … … 493 493 494 494 usb_address_t addr = *address; 495 int rc;495 errno_t rc; 496 496 497 497 fibril_mutex_lock(&instance->guard); … … 539 539 * @return Error code. 540 540 */ 541 int usb_bus_get_speed(usb_bus_t *instance, usb_address_t address,541 errno_t usb_bus_get_speed(usb_bus_t *instance, usb_address_t address, 542 542 usb_speed_t *speed) 543 543 { … … 549 549 fibril_mutex_lock(&instance->guard); 550 550 551 const int ret = instance->devices[address].occupied ? EOK : ENOENT;551 const errno_t ret = instance->devices[address].occupied ? EOK : ENOENT; 552 552 if (speed && instance->devices[address].occupied) { 553 553 *speed = instance->devices[address].speed;
Note:
See TracChangeset
for help on using the changeset viewer.