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