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