Changeset b7fd2a0 in mainline for uspace/lib/usbhost/src/hcd.c
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/hcd.c
r36f0738 rb7fd2a0 49 49 * @return Error code. 50 50 */ 51 static int register_helper(endpoint_t *ep, void *arg)51 static errno_t register_helper(endpoint_t *ep, void *arg) 52 52 { 53 53 hcd_t *hcd = arg; … … 102 102 } 103 103 104 int hcd_request_address(hcd_t *hcd, usb_speed_t speed, usb_address_t *address)104 errno_t hcd_request_address(hcd_t *hcd, usb_speed_t speed, usb_address_t *address) 105 105 { 106 106 assert(hcd); … … 108 108 } 109 109 110 int hcd_release_address(hcd_t *hcd, usb_address_t address)110 errno_t hcd_release_address(hcd_t *hcd, usb_address_t address) 111 111 { 112 112 assert(hcd); … … 115 115 } 116 116 117 int hcd_reserve_default_address(hcd_t *hcd, usb_speed_t speed)117 errno_t hcd_reserve_default_address(hcd_t *hcd, usb_speed_t speed) 118 118 { 119 119 assert(hcd); … … 122 122 } 123 123 124 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir,124 errno_t hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir, 125 125 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, 126 126 size_t size, usb_address_t tt_address, unsigned tt_port) … … 132 132 } 133 133 134 int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir)134 errno_t hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir) 135 135 { 136 136 assert(hcd); … … 147 147 } toggle_t; 148 148 149 static void toggle_reset_callback( int retval, void *arg)149 static void toggle_reset_callback(errno_t retval, void *arg) 150 150 { 151 151 assert(arg); … … 172 172 * @return Error code. 173 173 */ 174 int hcd_send_batch(174 errno_t hcd_send_batch( 175 175 hcd_t *hcd, usb_target_t target, usb_direction_t direction, 176 176 void *data, size_t size, uint64_t setup_data, … … 232 232 } 233 233 234 const int ret = hcd->ops.schedule(hcd, batch);234 const errno_t ret = hcd->ops.schedule(hcd, batch); 235 235 if (ret != EOK) 236 236 usb_transfer_batch_destroy(batch); … … 244 244 typedef struct { 245 245 volatile unsigned done; 246 int ret;246 errno_t ret; 247 247 size_t size; 248 248 } sync_data_t; 249 249 250 static void transfer_in_cb( int ret, size_t size, void* data)250 static void transfer_in_cb(errno_t ret, size_t size, void* data) 251 251 { 252 252 sync_data_t *d = data; … … 257 257 } 258 258 259 static void transfer_out_cb( int ret, void* data)259 static void transfer_out_cb(errno_t ret, void* data) 260 260 { 261 261 sync_data_t *d = data; … … 266 266 267 267 /** this is really ugly version of sync usb communication */ 268 int hcd_send_batch_sync(268 errno_t hcd_send_batch_sync( 269 269 hcd_t *hcd, usb_target_t target, usb_direction_t dir, 270 270 void *data, size_t size, uint64_t setup_data, const char* name, size_t *out_size) … … 273 273 sync_data_t sd = { .done = 0, .ret = EBUSY, .size = size }; 274 274 275 const int ret = hcd_send_batch(hcd, target, dir, data, size, setup_data,275 const errno_t ret = hcd_send_batch(hcd, target, dir, data, size, setup_data, 276 276 dir == USB_DIRECTION_IN ? transfer_in_cb : NULL, 277 277 dir == USB_DIRECTION_OUT ? transfer_out_cb : NULL, &sd, name);
Note:
See TracChangeset
for help on using the changeset viewer.