Changeset 3f03199 in mainline for uspace/drv/bus/usb/ehci/res.c
- Timestamp:
- 2013-09-15T06:33:53Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9348862
- Parents:
- dd7078c (diff), 1c0cef0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/res.c
rdd7078c r3f03199 71 71 * 72 72 * @param[in] dev Device asking for the addresses. 73 * @param[out] mem_reg_address Base address of the memory range. 74 * @param[out] mem_reg_size Size of the memory range. 73 * @param[out] mem_regs_p Pointer to the register range. 75 74 * @param[out] irq_no IRQ assigned to the device. 76 75 * @return Error code. 77 76 */ 78 77 int get_my_registers(ddf_dev_t *dev, 79 uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)78 addr_range_t *mem_regs_p, int *irq_no) 80 79 { 81 80 assert(dev); … … 99 98 } 100 99 101 if (mem_reg_address) 102 *mem_reg_address = hw_res.mem_ranges.ranges[0].address; 103 if (mem_reg_size) 104 *mem_reg_size = hw_res.mem_ranges.ranges[0].size; 100 if (mem_regs_p) 101 *mem_regs_p = hw_res.mem_ranges.ranges[0]; 105 102 if (irq_no) 106 103 *irq_no = hw_res.irqs.irqs[0]; … … 234 231 } 235 232 236 int disable_legacy(ddf_dev_t *device, uintptr_t reg_base, size_t reg_size)233 int disable_legacy(ddf_dev_t *device, addr_range_t *reg_range) 237 234 { 238 235 assert(device); 239 236 usb_log_debug("Disabling EHCI legacy support.\n"); 240 237 241 #define CHECK_RET_RETURN(ret, message...) \242 if (ret != EOK) { \243 usb_log_error(message); \244 return ret; \245 } else (void)0246 247 238 /* Map EHCI registers */ 248 239 void *regs = NULL; 249 int ret = pio_enable((void*)reg_base, reg_size, ®s); 250 CHECK_RET_RETURN(ret, "Failed to map registers %p: %s.\n", 251 (void *) reg_base, str_error(ret)); 240 int ret = pio_enable_range(reg_range, ®s); 241 if (ret != EOK) { 242 usb_log_error("Failed to map registers %p: %s.\n", 243 RNGABSPTR(*reg_range), str_error(ret)); 244 return ret; 245 } 252 246 253 247 usb_log_debug2("Registers mapped at: %p.\n", regs); … … 264 258 265 259 ret = disable_extended_caps(device, eecp); 266 CHECK_RET_RETURN(ret, "Failed to disable extended capabilities: %s.\n", 267 str_error(ret)); 268 269 #undef CHECK_RET_RETURN 260 if (ret != EOK) { 261 usb_log_error("Failed to disable extended capabilities: %s.\n", 262 str_error(ret)); 263 return ret; 264 } 265 270 266 271 267 /*
Note:
See TracChangeset
for help on using the changeset viewer.