Changes in uspace/drv/bus/usb/ehci/res.c [e4d7363:53a309e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/res.c
re4d7363 r53a309e 39 39 #include <str_error.h> 40 40 #include <assert.h> 41 #include <d evman.h>41 #include <ddf/driver.h> 42 42 #include <ddi.h> 43 43 #include <usb/debug.h> … … 172 172 } 173 173 174 int disable_legacy( hc_t *hc,ddf_dev_t *device)174 int disable_legacy(ddf_dev_t *device) 175 175 { 176 176 assert(device); 177 177 178 async_sess_t *parent_sess = devman_parent_device_connect( 179 ddf_dev_get_handle(device), IPC_FLAG_BLOCKING); 180 if (!parent_sess) 178 async_sess_t *parent_sess = ddf_dev_parent_sess_get(device); 179 if (parent_sess == NULL) 181 180 return ENOMEM; 182 181 183 182 usb_log_debug("Disabling EHCI legacy support.\n"); 184 183 185 186 const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams); 184 hw_res_list_parsed_t res; 185 hw_res_list_parsed_init(&res); 186 int ret = hw_res_get_list_parsed(parent_sess, &res, 0); 187 if (ret != EOK) { 188 usb_log_error("Failed to get resource list: %s\n", 189 str_error(ret)); 190 goto clean; 191 } 192 193 if (res.mem_ranges.count < 1) { 194 usb_log_error("Incorrect mem range count: %zu", 195 res.mem_ranges.count); 196 ret = EINVAL; 197 goto clean; 198 } 199 200 /* Map EHCI registers */ 201 void *regs = NULL; 202 ret = pio_enable_range(&res.mem_ranges.ranges[0], ®s); 203 if (ret != EOK) { 204 usb_log_error("Failed to map registers %p: %s.\n", 205 RNGABSPTR(res.mem_ranges.ranges[0]), str_error(ret)); 206 goto clean; 207 } 208 209 usb_log_debug("Registers mapped at: %p.\n", regs); 210 211 ehci_caps_regs_t *ehci_caps = regs; 212 213 const uint32_t hcc_params = EHCI_RD(ehci_caps->hccparams); 187 214 usb_log_debug2("Value of hcc params register: %x.\n", hcc_params); 188 215 … … 193 220 usb_log_debug2("Value of EECP: %x.\n", eecp); 194 221 195 intret = disable_extended_caps(parent_sess, eecp);222 ret = disable_extended_caps(parent_sess, eecp); 196 223 if (ret != EOK) { 197 224 usb_log_error("Failed to disable extended capabilities: %s.\n", … … 200 227 } 201 228 clean: 202 async_hangup(parent_sess); 229 //TODO unmap registers 230 hw_res_list_parsed_clean(&res); 203 231 return ret; 204 232 }
Note:
See TracChangeset
for help on using the changeset viewer.