Changes in uspace/drv/ohci/iface.c [0ede0c3:592369ae] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/iface.c
r0ede0c3 r592369ae 55 55 56 56 size_t res_bw; 57 endpoint_t *ep = usb_endpoint_manager_get_ep(&(*hc)->ep_manager,57 endpoint_t *ep = hc_get_endpoint(*hc, 58 58 target.address, target.endpoint, direction, &res_bw); 59 59 if (ep == NULL) { … … 164 164 } 165 165 const size_t size = max_packet_size; 166 int ret;167 166 168 167 usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n", … … 170 169 usb_str_speed(speed), direction, size, max_packet_size, interval); 171 170 172 endpoint_t *ep = malloc(sizeof(endpoint_t)); 173 if (ep == NULL) 174 return ENOMEM; 175 ret = endpoint_init(ep, address, endpoint, direction, 176 transfer_type, speed, max_packet_size); 177 if (ret != EOK) { 178 free(ep); 179 return ret; 180 } 181 182 ret = usb_endpoint_manager_register_ep(&hc->ep_manager, ep, size); 183 if (ret != EOK) { 184 endpoint_destroy(ep); 185 } 186 return ret; 171 return hc_add_endpoint(hc, address, endpoint, speed, transfer_type, 172 direction, max_packet_size, size, interval); 187 173 } 188 174 /*----------------------------------------------------------------------------*/ … … 195 181 usb_log_debug("Unregister endpoint %d:%d %d.\n", 196 182 address, endpoint, direction); 197 return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address, 198 endpoint, direction); 183 return hc_remove_endpoint(hc, address, endpoint, direction); 199 184 } 200 185 /*----------------------------------------------------------------------------*/ … … 228 213 ret = hc_schedule(hc, batch); 229 214 if (ret != EOK) { 230 batch_dispose(batch);215 usb_transfer_batch_dispose(batch); 231 216 } 232 217 return ret; … … 262 247 ret = hc_schedule(hc, batch); 263 248 if (ret != EOK) { 264 batch_dispose(batch);249 usb_transfer_batch_dispose(batch); 265 250 } 266 251 return ret; … … 296 281 ret = hc_schedule(hc, batch); 297 282 if (ret != EOK) { 298 batch_dispose(batch);283 usb_transfer_batch_dispose(batch); 299 284 } 300 285 return ret; … … 330 315 ret = hc_schedule(hc, batch); 331 316 if (ret != EOK) { 332 batch_dispose(batch);317 usb_transfer_batch_dispose(batch); 333 318 } 334 319 return ret; … … 346 331 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 347 332 * and deallocated by the caller). 348 * @param[in] setup_ packet_size Size of @p setup_packet buffer in bytes.333 * @param[in] setup_size Size of @p setup_packet buffer in bytes. 349 334 * @param[in] data_buffer Data buffer (in USB endianess, allocated and 350 335 * deallocated by the caller). 351 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes.336 * @param[in] size Size of @p data_buffer buffer in bytes. 352 337 * @param[in] callback Callback to be issued once the transfer is complete. 353 338 * @param[in] arg Pass-through argument to the callback. … … 370 355 ret = hc_schedule(hc, batch); 371 356 if (ret != EOK) { 372 batch_dispose(batch);357 usb_transfer_batch_dispose(batch); 373 358 } 374 359 return ret; … … 386 371 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 387 372 * and deallocated by the caller). 388 * @param[in] setup_ packet_size Size of @p setup_packet buffer in bytes.373 * @param[in] setup_size Size of @p setup_packet buffer in bytes. 389 374 * @param[in] data_buffer Buffer where to store the data (in USB endianess, 390 375 * allocated and deallocated by the caller). 391 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes.376 * @param[in] size Size of @p data_buffer buffer in bytes. 392 377 * @param[in] callback Callback to be issued once the transfer is complete. 393 378 * @param[in] arg Pass-through argument to the callback. … … 409 394 ret = hc_schedule(hc, batch); 410 395 if (ret != EOK) { 411 batch_dispose(batch);396 usb_transfer_batch_dispose(batch); 412 397 } 413 398 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.