Changeset 7813516 in mainline for uspace/drv/bus/usb/ohci/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/ohci/hc.c
rd1df381 r7813516 148 148 * 149 149 * @param[in] instance Memory place for the structure. 150 * @param[in] regs Device's I/O registers range.150 * @param[in] regs Device's resources 151 151 * @param[in] interrupts True if w interrupts should be used 152 152 * @return Error code 153 153 */ 154 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts) 155 { 156 assert(instance); 157 158 int ret = pio_enable_range(regs, (void **) &instance->registers); 154 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts) 155 { 156 assert(instance); 157 assert(hw_res); 158 if (hw_res->mem_ranges.count != 1 || 159 hw_res->mem_ranges.ranges[0].size < sizeof(ohci_regs_t)) 160 return EINVAL; 161 162 int ret = pio_enable_range(&hw_res->mem_ranges.ranges[0], 163 (void **) &instance->registers); 159 164 if (ret != EOK) { 160 usb_log_error("Failed to gain access to deviceregisters: %s.\n",165 usb_log_error("Failed to gain access to registers: %s.\n", 161 166 str_error(ret)); 162 167 return ret; 163 168 } 169 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.\n", 170 hw_res->mem_ranges.ranges[0].address.absolute, 171 hw_res->mem_ranges.ranges[0].size); 164 172 165 173 list_initialize(&instance->pending_batches); … … 186 194 return EOK; 187 195 } 196 197 /** Safely dispose host controller internal structures 198 * 199 * @param[in] instance Host controller structure to use. 200 */ 201 void hc_fini(hc_t *instance) 202 { 203 assert(instance); 204 /* TODO: implement*/ 205 }; 188 206 189 207 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep)
Note:
See TracChangeset
for help on using the changeset viewer.