Changes in uspace/drv/bus/usb/ehci/hc.c [741bcdeb:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/hc.c
r741bcdeb r8d2dd7f2 89 89 }; 90 90 91 static void hc_start(hc_t *instance); 91 92 static int hc_init_memory(hc_t *instance); 92 93 … … 97 98 * @return Error code. 98 99 */ 99 int ehci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd,const hw_res_list_parsed_t *hw_res)100 int ehci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res) 100 101 { 101 102 assert(code); 102 103 assert(hw_res); 103 104 hc_t *instance = hcd_get_driver_data(hcd);105 104 106 105 if (hw_res->irqs.count != 1 || hw_res->mem_ranges.count != 1) … … 129 128 130 129 memcpy(code->cmds, ehci_irq_commands, sizeof(ehci_irq_commands)); 130 ehci_caps_regs_t *caps = NULL; 131 132 int ret = pio_enable_range(®s, (void**)&caps); 133 if (ret != EOK) { 134 free(code->ranges); 135 free(code->cmds); 136 return ret; 137 } 131 138 132 139 ehci_regs_t *registers = 133 (ehci_regs_t *)(RNGABSPTR(regs) + EHCI_RD8(instance->caps->caplength));140 (ehci_regs_t *)(RNGABSPTR(regs) + EHCI_RD8(caps->caplength)); 134 141 code->cmds[0].addr = (void *) ®isters->usbsts; 135 142 code->cmds[3].addr = (void *) ®isters->usbsts; … … 149 156 * @return Error code 150 157 */ 151 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res )158 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts) 152 159 { 153 160 assert(instance); … … 165 172 return ret; 166 173 } 167 168 174 usb_log_info("HC(%p): Device registers at %"PRIx64" (%zuB) accessible.", 169 175 instance, hw_res->mem_ranges.ranges[0].address.absolute, … … 189 195 ehci_rh_init( 190 196 &instance->rh, instance->caps, instance->registers, "ehci rh"); 191 192 ehci_bus_init(&instance->bus, instance); 197 usb_log_debug("HC(%p): Starting HW.", instance); 198 hc_start(instance); 199 193 200 return EOK; 194 201 } … … 215 222 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 216 223 usb_log_debug("HC(%p) enqueue EP(%d:%d:%s:%s)\n", instance, 217 ep-> target.address, ep->target.endpoint,224 ep->address, ep->endpoint, 218 225 usb_str_transfer_type_short(ep->transfer_type), 219 226 usb_str_direction(ep->direction)); … … 239 246 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 240 247 usb_log_debug("HC(%p) dequeue EP(%d:%d:%s:%s)\n", instance, 241 ep-> target.address, ep->target.endpoint,248 ep->address, ep->endpoint, 242 249 usb_str_transfer_type_short(ep->transfer_type), 243 250 usb_str_direction(ep->direction)); … … 291 298 292 299 /* Check for root hub communication */ 293 if (batch->ep-> target.address == ehci_rh_get_address(&instance->rh)) {300 if (batch->ep->address == ehci_rh_get_address(&instance->rh)) { 294 301 usb_log_debug("HC(%p): Scheduling BATCH(%p) for RH(%p)", 295 302 instance, batch, &instance->rh); … … 361 368 * @param[in] instance EHCI hc driver structure. 362 369 */ 363 int hc_start(hc_t *instance, bool interrupts) 364 { 365 assert(instance); 366 usb_log_debug("HC(%p): Starting HW.", instance); 367 370 void hc_start(hc_t *instance) 371 { 372 assert(instance); 368 373 /* Turn off the HC if it's running, Reseting a running device is 369 374 * undefined */ … … 430 435 EHCI_WR(instance->registers->usbsts, EHCI_RD(instance->registers->usbsts)); 431 436 EHCI_WR(instance->registers->usbintr, EHCI_USED_INTERRUPTS); 432 433 return EOK;434 437 } 435 438
Note:
See TracChangeset
for help on using the changeset viewer.