Changeset 7813516 in mainline for uspace/drv/bus/usb/ehci/hc.c
- Timestamp:
- 2014-01-01T01:19:10Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7191992
- Parents:
- d1df381
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.