Changeset e4d7363 in mainline for uspace/drv/bus/usb/ehci/res.c
- Timestamp:
- 2017-06-22T21:34:39Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91ca111
- Parents:
- cb89430
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/res.c
rcb89430 re4d7363 172 172 } 173 173 174 int disable_legacy( ddf_dev_t *device)174 int disable_legacy(hc_t *hc, ddf_dev_t *device) 175 175 { 176 176 assert(device); … … 183 183 usb_log_debug("Disabling EHCI legacy support.\n"); 184 184 185 hw_res_list_parsed_t res; 186 hw_res_list_parsed_init(&res); 187 int ret = hw_res_get_list_parsed(parent_sess, &res, 0); 188 if (ret != EOK) { 189 usb_log_error("Failed to get resource list: %s\n", 190 str_error(ret)); 191 goto clean; 192 } 193 194 if (res.mem_ranges.count < 1) { 195 usb_log_error("Incorrect mem range count: %zu", 196 res.mem_ranges.count); 197 ret = EINVAL; 198 goto clean; 199 } 200 201 /* Map EHCI registers */ 202 void *regs = NULL; 203 ret = pio_enable_range(&res.mem_ranges.ranges[0], ®s); 204 if (ret != EOK) { 205 usb_log_error("Failed to map registers %p: %s.\n", 206 RNGABSPTR(res.mem_ranges.ranges[0]), str_error(ret)); 207 goto clean; 208 } 209 210 usb_log_debug("Registers mapped at: %p.\n", regs); 211 212 ehci_caps_regs_t *ehci_caps = regs; 213 214 const uint32_t hcc_params = EHCI_RD(ehci_caps->hccparams); 185 186 const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams); 215 187 usb_log_debug2("Value of hcc params register: %x.\n", hcc_params); 216 188 … … 221 193 usb_log_debug2("Value of EECP: %x.\n", eecp); 222 194 223 ret = disable_extended_caps(parent_sess, eecp);195 int ret = disable_extended_caps(parent_sess, eecp); 224 196 if (ret != EOK) { 225 197 usb_log_error("Failed to disable extended capabilities: %s.\n", … … 228 200 } 229 201 clean: 230 //TODO unmap registers231 hw_res_list_parsed_clean(&res);232 202 async_hangup(parent_sess); 233 203 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.