Changes in uspace/drv/bus/usb/uhci/hc.c [8d2dd7f2:17873ac7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
r8d2dd7f2 r17873ac7 50 50 #include <usb/usb.h> 51 51 #include <usb/host/utils/malloc32.h> 52 #include <usb/host/bandwidth.h> 52 53 53 54 #include "uhci_batch.h" … … 106 107 * @return Error code. 107 108 */ 108 int uhci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res)109 int uhci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res) 109 110 { 110 111 assert(code); … … 176 177 uhci_transfer_batch_t *batch = 177 178 uhci_transfer_batch_from_link(current); 178 u hci_transfer_batch_finish_dispose(batch);179 usb_transfer_batch_finish(&batch->base); 179 180 } 180 181 } … … 214 215 * interrupt fibrils. 215 216 */ 216 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res , bool interrupts)217 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res) 217 218 { 218 219 assert(instance); … … 222 223 return EINVAL; 223 224 224 instance->hw_interrupts = interrupts;225 225 instance->hw_failures = 0; 226 226 … … 246 246 } 247 247 248 return EOK; 249 } 250 251 void hc_start(hc_t *instance) 252 { 248 253 hc_init_hw(instance); 249 254 (void)hc_debug_checker; 250 255 251 256 uhci_rh_init(&instance->rh, instance->registers->ports, "uhci"); 252 253 return EOK;254 257 } 255 258 … … 306 309 } 307 310 311 static usb_transfer_batch_t *create_transfer_batch(bus_t *bus, endpoint_t *ep) 312 { 313 uhci_transfer_batch_t *batch = uhci_transfer_batch_create(ep); 314 return &batch->base; 315 } 316 317 static void destroy_transfer_batch(usb_transfer_batch_t *batch) 318 { 319 uhci_transfer_batch_destroy(uhci_transfer_batch_get(batch)); 320 } 321 308 322 /** Initialize UHCI hc memory structures. 309 323 * … … 318 332 int hc_init_mem_structures(hc_t *instance) 319 333 { 320 assert(instance); 334 int err; 335 assert(instance); 336 337 if ((err = usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11))) 338 return err; 339 340 instance->bus.base.ops.create_batch = create_transfer_batch; 341 instance->bus.base.ops.destroy_batch = destroy_transfer_batch; 321 342 322 343 /* Init USB frame list page */ … … 440 461 assert(batch); 441 462 442 if (batch-> ep->address == uhci_rh_get_address(&instance->rh))463 if (batch->target.address == uhci_rh_get_address(&instance->rh)) 443 464 return uhci_rh_schedule(&instance->rh, batch); 444 465 445 uhci_transfer_batch_t *uhci_batch = uhci_transfer_batch_get(batch);466 uhci_transfer_batch_t *uhci_batch = (uhci_transfer_batch_t *) batch; 446 467 if (!uhci_batch) { 447 468 usb_log_error("Failed to create UHCI transfer structures.\n"); 448 469 return ENOMEM; 449 470 } 471 472 const int err = uhci_transfer_batch_prepare(uhci_batch); 473 if (err) 474 return err; 450 475 451 476 transfer_list_t *list =
Note:
See TracChangeset
for help on using the changeset viewer.