Changeset ba4a03a5 in mainline for uspace/drv/bus/usb/ohci/hc.c
- Timestamp:
- 2013-12-31T23:11:00Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d1df381
- Parents:
- e3a07bba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
re3a07bba rba4a03a5 100 100 * @param[out] cmds Commands buffer. 101 101 * @param[in] cmds_size Size of the commands buffer (bytes). 102 * @param[in] regs Device's register range.102 * @param[in] hw_res Device's resources. 103 103 * 104 104 * @return Error code. 105 105 */ 106 int hc_gen_irq_code(irq_code_t *code, addr_range_t *regs)106 int hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res) 107 107 { 108 108 assert(code); 109 if (RNGSZ(*regs) < sizeof(ohci_regs_t)) 109 assert(hw_res); 110 111 if (hw_res->irqs.count != 1 || hw_res->mem_ranges.count != 1) 112 return EINVAL; 113 114 const addr_range_t regs = hw_res->mem_ranges.ranges[0]; 115 116 if (RNGSZ(regs) < sizeof(ohci_regs_t)) 110 117 return EOVERFLOW; 111 118 … … 124 131 125 132 memcpy(code->ranges, ohci_pio_ranges, sizeof(ohci_pio_ranges)); 126 code->ranges[0].base = RNGABS( *regs);133 code->ranges[0].base = RNGABS(regs); 127 134 128 135 memcpy(code->cmds, ohci_irq_commands, sizeof(ohci_irq_commands)); 129 ohci_regs_t *registers = (ohci_regs_t *) RNGABSPTR( *regs);136 ohci_regs_t *registers = (ohci_regs_t *) RNGABSPTR(regs); 130 137 code->cmds[0].addr = (void *) ®isters->interrupt_status; 131 138 code->cmds[3].addr = (void *) ®isters->interrupt_status; 132 139 OHCI_WR(code->cmds[1].value, OHCI_USED_INTERRUPTS); 133 140 134 return EOK; 141 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.\n", 142 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]); 143 144 return hw_res->irqs.irqs[0]; 135 145 } 136 146
Note:
See TracChangeset
for help on using the changeset viewer.