Changeset 7813516 in mainline for uspace/drv/bus/usb/ehci
- Timestamp:
- 2014-01-01T01:19:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7191992
- Parents:
- d1df381
- Location:
- uspace/drv/bus/usb/ehci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci.c
rd1df381 r7813516 94 94 return ret; 95 95 } 96 addr_range_t regs = hw_res.mem_ranges.ranges[0];97 96 98 97 /* Initialize generic HCD driver */ … … 127 126 128 127 /* Initialize EHCI HC */ 129 ret = hc_init(hc, & regs, interrupts);128 ret = hc_init(hc, &hw_res, interrupts); 130 129 hw_res_list_parsed_clean(&hw_res); 131 130 if (ret != EOK) { -
uspace/drv/bus/usb/ehci/hc.c
rd1df381 r7813516 157 157 * @return Error code 158 158 */ 159 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts) 160 { 161 assert(instance); 162 163 int ret = pio_enable_range(regs, (void **) &instance->caps); 159 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts) 160 { 161 assert(instance); 162 assert(hw_res); 163 if (hw_res->mem_ranges.count != 1 || 164 hw_res->mem_ranges.ranges[0].size < 165 (sizeof(ehci_caps_regs_t) + sizeof(ehci_regs_t))) 166 return EINVAL; 167 168 int ret = pio_enable_range(&hw_res->mem_ranges.ranges[0], 169 (void **)&instance->caps); 164 170 if (ret != EOK) { 165 171 usb_log_error("Failed to gain access to device registers: %s.\n", … … 167 173 return ret; 168 174 } 175 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.\n", 176 hw_res->mem_ranges.ranges[0].address.absolute, 177 hw_res->mem_ranges.ranges[0].size); 169 178 instance->registers = 170 179 (void*)instance->caps + EHCI_RD8(instance->caps->caplength); … … 194 203 return EOK; 195 204 } 205 206 /** Safely dispose host controller internal structures 207 * 208 * @param[in] instance Host controller structure to use. 209 */ 210 void hc_fini(hc_t *instance) 211 { 212 assert(instance); 213 /* TODO: implement*/ 214 }; 196 215 197 216 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep) -
uspace/drv/bus/usb/ehci/hc.h
rd1df381 r7813516 76 76 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res); 77 77 int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun); 78 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts); 79 80 /** Safely dispose host controller internal structures 81 * 82 * @param[in] instance Host controller structure to use. 83 */ 84 static inline void hc_fini(hc_t *instance) { /* TODO: implement*/ }; 78 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts); 79 void hc_fini(hc_t *instance); 85 80 86 81 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep);
Note:
See TracChangeset
for help on using the changeset viewer.
