Changeset 3e200736 in mainline for uspace/drv/bus/usb/uhci
- Timestamp:
- 2014-01-18T21:34:32Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5361fb
- Parents:
- e26a9d95
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
re26a9d95 r3e200736 96 96 static int hc_init_transfer_lists(hc_t *instance); 97 97 98 static int hc_interrupt_emulator(void *arg);99 98 static int hc_debug_checker(void *arg); 100 99 … … 245 244 246 245 hc_init_hw(instance); 247 if (!interrupts) {248 instance->interrupt_emulator =249 fibril_create(hc_interrupt_emulator, instance);250 fibril_add_ready(instance->interrupt_emulator);251 }252 246 (void)hc_debug_checker; 253 247 … … 460 454 } 461 455 462 /** Polling function, emulates interrupts.463 *464 * @param[in] arg UHCI hc structure to use.465 * @return EOK (should never return)466 */467 int hc_interrupt_emulator(void* arg)468 {469 usb_log_debug("Started interrupt emulator.\n");470 hc_t *instance = arg;471 assert(instance);472 473 while (1) {474 /* Read and clear status register */475 uint16_t status = pio_read_16(&instance->registers->usbsts);476 pio_write_16(&instance->registers->usbsts, status);477 if (status != 0)478 usb_log_debug2("UHCI status: %x.\n", status);479 hc_interrupt(instance, status);480 async_usleep(UHCI_INT_EMULATOR_TIMEOUT);481 }482 return EOK;483 }484 485 456 /** Debug function, checks consistency of memory structures. 486 457 * -
uspace/drv/bus/usb/uhci/hc.h
re26a9d95 r3e200736 93 93 94 94 #define UHCI_FRAME_LIST_COUNT 1024 95 #define UHCI_INT_EMULATOR_TIMEOUT 1000096 95 #define UHCI_DEBUGER_TIMEOUT 5000000 97 96 #define UHCI_ALLOWED_HW_FAIL 5 98 #define UHCI_NEEDED_IRQ_COMMANDS 599 97 100 98 /** Main UHCI driver structure */ … … 118 116 /** Pointer table to the above lists, helps during scheduling */ 119 117 transfer_list_t *transfers[2][4]; 120 /** Fibril periodically checking status register*/121 fid_t interrupt_emulator;122 118 /** Indicator of hw interrupts availability */ 123 119 bool hw_interrupts;
Note:
See TracChangeset
for help on using the changeset viewer.
