Changeset 6b6e3ed3 in mainline
- Timestamp:
- 2011-04-08T15:46:32Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 344925c
- Parents:
- f98b8269
- Location:
- uspace/drv/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
rf98b8269 r6b6e3ed3 47 47 static void hc_gain_control(hc_t *instance); 48 48 static void hc_init_hw(hc_t *instance); 49 static int hc_init_transfer_lists(hc_t *instance); 49 50 /*----------------------------------------------------------------------------*/ 50 51 int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun) … … 211 212 assert((instance->registers->command_status & CS_HCR) == 0); 212 213 /* hc is now in suspend state */ 214 /* init queues */ 215 hc_init_transfer_lists(instance); 213 216 /* TODO: init HCCA block */ 214 /* TODO: init queues */215 217 /* TODO: enable queues */ 216 218 /* TODO: enable interrupts */ … … 220 222 usb_log_info("OHCI HC up and running.\n"); 221 223 } 224 /*----------------------------------------------------------------------------*/ 225 int hc_init_transfer_lists(hc_t *instance) 226 { 227 assert(instance); 228 #define CHECK_RET_CLEAR_RETURN(ret, message...) \ 229 if (ret != EOK) { \ 230 usb_log_error(message); \ 231 transfer_list_fini(&instance->transfers_isochronous); \ 232 transfer_list_fini(&instance->transfers_interrupt); \ 233 transfer_list_fini(&instance->transfers_control); \ 234 transfer_list_fini(&instance->transfers_bulk); \ 235 return ret; \ 236 } else (void) 0 237 238 int ret; 239 ret = transfer_list_init(&instance->transfers_bulk, "BULK"); 240 CHECK_RET_CLEAR_RETURN(ret, "Failed to init BULK list."); 241 242 ret = transfer_list_init(&instance->transfers_control, "CONTROL"); 243 CHECK_RET_CLEAR_RETURN(ret, "Failed to init CONTROL list."); 244 245 ret = transfer_list_init(&instance->transfers_interrupt, "INTERRUPT"); 246 CHECK_RET_CLEAR_RETURN(ret, "Failed to init INTERRUPT list."); 247 248 transfer_list_set_next(&instance->transfers_interrupt, 249 &instance->transfers_isochronous); 250 251 /* Assign pointers to be used during scheduling */ 252 instance->transfers[USB_TRANSFER_INTERRUPT] = 253 &instance->transfers_interrupt; 254 instance->transfers[USB_TRANSFER_ISOCHRONOUS] = 255 &instance->transfers_interrupt; 256 instance->transfers[USB_TRANSFER_CONTROL] = 257 &instance->transfers_control; 258 instance->transfers[USB_TRANSFER_BULK] = 259 &instance->transfers_bulk; 260 261 return EOK; 262 #undef CHECK_RET_CLEAR_RETURN 263 } 222 264 /** 223 265 * @} -
uspace/drv/ohci/hc.h
rf98b8269 r6b6e3ed3 48 48 #include "ohci_regs.h" 49 49 #include "root_hub.h" 50 #include "transfer_list.h" 50 51 #include "hw_struct/hcca.h" 51 52 … … 54 55 usb_address_t rh_address; 55 56 rh_t rh; 57 58 transfer_list_t transfers_isochronous; 59 transfer_list_t transfers_interrupt; 60 transfer_list_t transfers_control; 61 transfer_list_t transfers_bulk; 62 63 transfer_list_t *transfers[4]; 64 56 65 ddf_fun_t *ddf_instance; 57 66 usb_device_keeper_t manager;
Note:
See TracChangeset
for help on using the changeset viewer.