Changes in uspace/drv/bus/usb/ohci/hc.c [a5b3de6:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
ra5b3de6 r8d2dd7f2 47 47 #include <usb/usb.h> 48 48 49 #include "ohci_ bus.h"49 #include "ohci_endpoint.h" 50 50 #include "ohci_batch.h" 51 51 … … 89 89 }; 90 90 91 static void hc_gain_control(hc_t *instance); 92 static void hc_start(hc_t *instance); 91 93 static int hc_init_transfer_lists(hc_t *instance); 92 94 static int hc_init_memory(hc_t *instance); … … 101 103 * @return Error code. 102 104 */ 103 int ohci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd,const hw_res_list_parsed_t *hw_res)105 int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res) 104 106 { 105 107 assert(code); … … 149 151 * @return Error code 150 152 */ 151 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res )153 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts) 152 154 { 153 155 assert(instance); … … 170 172 list_initialize(&instance->pending_batches); 171 173 fibril_mutex_initialize(&instance->guard); 174 instance->hw_interrupts = interrupts; 172 175 173 176 ret = hc_init_memory(instance); … … 178 181 return ret; 179 182 } 183 184 hc_gain_control(instance); 185 186 ohci_rh_init(&instance->rh, instance->registers, "ohci rh"); 187 hc_start(instance); 180 188 181 189 return EOK; … … 287 295 288 296 /* Check for root hub communication */ 289 if (batch-> target.address == ohci_rh_get_address(&instance->rh)) {297 if (batch->ep->address == ohci_rh_get_address(&instance->rh)) { 290 298 usb_log_debug("OHCI root hub request.\n"); 291 299 return ohci_rh_schedule(&instance->rh, batch); … … 294 302 if (!ohci_batch) 295 303 return ENOMEM; 296 297 const int err = ohci_transfer_batch_prepare(ohci_batch);298 if (err)299 return err;300 304 301 305 fibril_mutex_lock(&instance->guard); … … 350 354 ohci_transfer_batch_from_link(current); 351 355 352 if (ohci_transfer_batch_ check_completed(batch)) {356 if (ohci_transfer_batch_is_complete(batch)) { 353 357 list_remove(current); 354 usb_transfer_batch_finish(&batch->base);358 ohci_transfer_batch_finish_dispose(batch); 355 359 } 356 360 … … 439 443 void hc_start(hc_t *instance) 440 444 { 441 ohci_rh_init(&instance->rh, instance->registers, "ohci rh");442 443 445 /* OHCI guide page 42 */ 444 446 assert(instance);
Note:
See TracChangeset
for help on using the changeset viewer.