Changes in uspace/drv/bus/usb/uhcirh/main.c [c53007f:5b89d43b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhcirh/main.c
rc53007f r5b89d43b 48 48 #define NAME "uhcirh" 49 49 50 static int hc_get_my_registers(ddf_dev_t *dev, 51 uintptr_t *io_reg_address, size_t *io_reg_size); 50 static int hc_get_my_registers(ddf_dev_t *dev, addr_range_t *io_regs); 52 51 53 52 static int uhci_rh_dev_add(ddf_dev_t *device); … … 90 89 ddf_dev_get_handle(device)); 91 90 92 uintptr_t io_regs = 0; 93 size_t io_size = 0; 91 addr_range_t regs; 94 92 uhci_root_hub_t *rh = NULL; 95 93 int rc; 96 94 97 rc = hc_get_my_registers(device, & io_regs, &io_size);95 rc = hc_get_my_registers(device, ®s); 98 96 if (rc != EOK) { 99 97 usb_log_error( "Failed to get registers from HC: %s.\n", … … 103 101 104 102 usb_log_debug("I/O regs at %p (size %zuB).\n", 105 (void *) io_regs, io_size);103 RNGABSPTR(regs), RNGSZ(regs)); 106 104 107 105 rh = ddf_dev_data_alloc(device, sizeof(uhci_root_hub_t)); … … 111 109 } 112 110 113 rc = uhci_root_hub_init(rh, (void*)io_regs, io_size, device);111 rc = uhci_root_hub_init(rh, ®s, device); 114 112 if (rc != EOK) { 115 113 usb_log_error("Failed(%d) to initialize rh driver instance: " … … 127 125 * 128 126 * @param[in] dev Device asking for the addresses. 129 * @param[out] io_reg_address Base address of the memory range. 130 * @param[out] io_reg_size Size of the memory range. 127 * @param[out] io_regs_p Pointer to the device's register range. 131 128 * @return Error code. 132 129 */ 133 int hc_get_my_registers( 134 ddf_dev_t *dev, uintptr_t *io_reg_address, size_t *io_reg_size) 130 int hc_get_my_registers(ddf_dev_t *dev, addr_range_t *io_regs_p) 135 131 { 136 132 async_sess_t *parent_sess = … … 142 138 hw_res_list_parsed_t hw_res; 143 139 hw_res_list_parsed_init(&hw_res); 144 const int ret = 140 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 145 141 async_hangup(parent_sess); 146 142 if (ret != EOK) { … … 153 149 } 154 150 155 if (io_reg_address != NULL) 156 *io_reg_address = hw_res.io_ranges.ranges[0].address; 157 158 if (io_reg_size != NULL) 159 *io_reg_size = hw_res.io_ranges.ranges[0].size; 151 if (io_regs_p != NULL) 152 *io_regs_p = hw_res.io_ranges.ranges[0]; 160 153 161 154 hw_res_list_parsed_clean(&hw_res);
Note:
See TracChangeset
for help on using the changeset viewer.