Changeset e0d8b740 in mainline
- Timestamp:
- 2013-08-07T08:26:40Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6340a6ff
- Parents:
- cce3228
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
rcce3228 re0d8b740 208 208 { 209 209 assert(reg_size >= sizeof(uhci_regs_t)); 210 int ret;211 212 #define CHECK_RET_RETURN(ret, message...) \213 if (ret != EOK) { \214 usb_log_error(message); \215 return ret; \216 } else (void) 0217 210 218 211 instance->hw_interrupts = interrupts; … … 221 214 /* allow access to hc control registers */ 222 215 uhci_regs_t *io; 223 ret = pio_enable(regs, reg_size, (void **)&io); 224 CHECK_RET_RETURN(ret, "Failed to gain access to registers at %p: %s.\n", 225 io, str_error(ret)); 216 int ret = pio_enable(regs, reg_size, (void **)&io); 217 if (ret != EOK) { 218 usb_log_error("Failed to gain access to registers at %p: %s.\n", 219 io, str_error(ret)); 220 return ret; 221 } 226 222 instance->registers = io; 223 227 224 usb_log_debug( 228 225 "Device registers at %p (%zuB) accessible.\n", io, reg_size); 229 226 230 227 ret = hc_init_mem_structures(instance); 231 CHECK_RET_RETURN(ret, 232 "Failed to initialize UHCI memory structures: %s.\n", 233 str_error(ret)); 234 235 #undef CHECK_RET_RETURN 228 if (ret != EOK) { 229 usb_log_error("Failed to init UHCI memory structures: %s.\n", 230 str_error(ret)); 231 // TODO: we should disable pio here 232 return ret; 233 } 236 234 237 235 hc_init_hw(instance); … … 391 389 392 390 return EOK; 393 #undef CHECK_RET_CLEAR_RETURN394 391 } 395 392 -
uspace/drv/bus/usb/uhci/res.c
rcce3228 re0d8b740 64 64 hw_res_list_parsed_t hw_res; 65 65 hw_res_list_parsed_init(&hw_res); 66 const int ret = 66 const int ret = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 67 67 async_hangup(parent_sess); 68 68 if (ret != EOK) { -
uspace/drv/bus/usb/uhci/uhci.c
rcce3228 re0d8b740 149 149 hcd_set_implementation(dev_to_hcd(device), hc, hc_schedule, NULL, NULL); 150 150 151 // TODO: Undo hcd_setup_device 152 #define CHECK_RET_FINI_RETURN(ret, message...) \ 153 if (ret != EOK) { \ 154 hc_fini(hc); \ 155 CHECK_RET_RETURN(ret, message); \ 156 return ret; \ 157 } else (void)0 158 151 /* 152 * Creating root hub registers a new USB device so all HC 153 * functionality needs to be ready at this time. 154 */ 159 155 ret = hcd_ddf_setup_root_hub(device, USB_SPEED_FULL); 160 CHECK_RET_FINI_RETURN(ret, 161 "Failed to setup UHCI root hub: %s.\n", str_error(ret)); 156 if (ret != EOK) { 157 // TODO: Undo hcd_setup_device 158 hc_fini(hc); 159 CHECK_RET_RETURN(ret, "Failed to setup UHCI root hub: %s.\n", 160 str_error(ret)); 161 return ret; 162 } 162 163 163 164 return EOK; 164 #undef CHECK_RET_FINI_RETURN165 165 } 166 166 /**
Note:
See TracChangeset
for help on using the changeset viewer.