Changeset 27205841 in mainline
- Timestamp:
- 2011-04-14T07:36:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 540abef
- Parents:
- 3eeb270f
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
r3eeb270f r27205841 247 247 { 248 248 assert(instance); 249 #define CHECK_RET_CLEAR_RETURN(ret, message...) \ 249 #define SETUP_TRANSFER_LIST(type, name) \ 250 do { \ 251 int ret = transfer_list_init(&instance->transfers_##type, name); \ 250 252 if (ret != EOK) { \ 251 usb_log_error(message); \ 253 usb_log_error("Failed(%d) to setup %s transfer list: %s.\n", \ 254 ret, name, str_error(ret)); \ 252 255 transfer_list_fini(&instance->transfers_bulk_full); \ 253 256 transfer_list_fini(&instance->transfers_control_full); \ … … 255 258 transfer_list_fini(&instance->transfers_interrupt); \ 256 259 return ret; \ 257 } else (void) 0 258 259 /* initialize TODO: check errors */ 260 int ret; 261 ret = transfer_list_init(&instance->transfers_bulk_full, "BULK_FULL"); 262 CHECK_RET_CLEAR_RETURN(ret, "Failed to init BULK list."); 263 264 ret = transfer_list_init( 265 &instance->transfers_control_full, "CONTROL_FULL"); 266 CHECK_RET_CLEAR_RETURN(ret, "Failed to init CONTROL FULL list."); 267 268 ret = transfer_list_init( 269 &instance->transfers_control_slow, "CONTROL_SLOW"); 270 CHECK_RET_CLEAR_RETURN(ret, "Failed to init CONTROL SLOW list."); 271 272 ret = transfer_list_init(&instance->transfers_interrupt, "INTERRUPT"); 273 CHECK_RET_CLEAR_RETURN(ret, "Failed to init INTERRUPT list."); 274 260 } \ 261 } while (0) 262 263 SETUP_TRANSFER_LIST(bulk_full, "BULK FULL"); 264 SETUP_TRANSFER_LIST(control_full, "CONTROL FULL"); 265 SETUP_TRANSFER_LIST(control_slow, "CONTROL LOW"); 266 SETUP_TRANSFER_LIST(interrupt, "INTERRUPT"); 267 #undef SETUP_TRANSFER_LIST 268 /* Connect lists into one schedule */ 275 269 transfer_list_set_next(&instance->transfers_control_full, 276 270 &instance->transfers_bulk_full); … … 337 331 assert(instance); 338 332 // status |= 1; //Uncomment to work around qemu hang 339 /* TODO: Resume interrupts are not supported */340 333 /* Lower 2 bits are transaction error and transaction complete */ 341 if (status & 0x3) {334 if (status & (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)) { 342 335 LIST_INITIALIZE(done); 343 336 transfer_list_remove_finished( … … 358 351 } 359 352 } 360 /* bits 4 and 5 indicate hc error */ 361 if (status & 0x18) { 353 /* Resume interrupts are not supported */ 354 355 /* Bits 4 and 5 indicate hc error */ 356 if (status & (UHCI_STATUS_PROCESS_ERROR | UHCI_STATUS_SYSTEM_ERROR)) { 362 357 usb_log_error("UHCI hardware failure!.\n"); 363 358 ++instance->hw_failures; … … 389 384 390 385 while (1) { 391 /* read and ack interrupts*/386 /* Readd and clear status register */ 392 387 uint16_t status = pio_read_16(&instance->registers->usbsts); 393 pio_write_16(&instance->registers->usbsts, 0x1f);388 pio_write_16(&instance->registers->usbsts, status); 394 389 if (status != 0) 395 390 usb_log_debug2("UHCI status: %x.\n", status); 396 391 hc_interrupt(instance, status); 397 async_usleep(UHCI_ CLEANER_TIMEOUT);392 async_usleep(UHCI_INT_EMULATOR_TIMEOUT); 398 393 } 399 394 return EOK; -
uspace/drv/uhci-hcd/hc.h
r3eeb270f r27205841 88 88 89 89 #define UHCI_FRAME_LIST_COUNT 1024 90 #define UHCI_ CLEANER_TIMEOUT 1000090 #define UHCI_INT_EMULATOR_TIMEOUT 10000 91 91 #define UHCI_DEBUGER_TIMEOUT 5000000 92 92 #define UHCI_ALLOWED_HW_FAIL 5
Note:
See TracChangeset
for help on using the changeset viewer.