Changeset 7d6a676 in mainline
- Timestamp:
- 2011-03-21T14:20:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d1db18
- Parents:
- 925e099
- Location:
- uspace/drv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/hc.c
r925e099 r7d6a676 45 45 #include "hc.h" 46 46 47 static int dummy_reset(int foo, void *arg) 48 { 49 hc_t *hc = (hc_t*)arg; 50 assert(hc); 51 hc->rh.address = 0; 52 return EOK; 53 } 47 static int dummy_reset(int foo, void *arg); 48 static int interrupt_emulator(hc_t *instance); 54 49 /*----------------------------------------------------------------------------*/ 55 50 int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev, … … 66 61 instance->ddf_instance = fun; 67 62 device_keeper_init(&instance->manager); 63 64 if (!interrupts) { 65 instance->interrupt_emulator = 66 fibril_create((int(*)(void*))interrupt_emulator, instance); 67 fibril_add_ready(instance->interrupt_emulator); 68 } 68 69 69 70 … … 117 118 } 118 119 /*----------------------------------------------------------------------------*/ 119 void hc_interrupt(hc_t *instance, uint 16_t status)120 void hc_interrupt(hc_t *instance, uint32_t status) 120 121 { 121 122 assert(instance); 122 /* TODO: Check for interrupt cause */ 123 rh_interrupt(&instance->rh); 123 if (status == 0) 124 return; 125 if (status & IS_RHSC) 126 rh_interrupt(&instance->rh); 127 128 /* TODO: Check for further interrupt causes */ 124 129 /* TODO: implement */ 130 } 131 /*----------------------------------------------------------------------------*/ 132 static int dummy_reset(int foo, void *arg) 133 { 134 hc_t *hc = (hc_t*)arg; 135 assert(hc); 136 hc->rh.address = 0; 137 return EOK; 138 } 139 /*----------------------------------------------------------------------------*/ 140 static int interrupt_emulator(hc_t *instance) 141 { 142 assert(instance); 143 usb_log_info("Started interrupt emulator.\n"); 144 while (1) { 145 uint32_t status = instance->registers->interrupt_status; 146 instance->registers->interrupt_status = status; 147 hc_interrupt(instance, status); 148 async_usleep(1000); 149 } 150 return EOK; 125 151 } 126 152 /** -
uspace/drv/ohci/hc.h
r925e099 r7d6a676 54 54 ddf_fun_t *ddf_instance; 55 55 device_keeper_t manager; 56 fid_t interrupt_emulator; 56 57 } hc_t; 57 58 … … 63 64 int hc_schedule(hc_t *instance, batch_t *batch); 64 65 65 void hc_interrupt(hc_t *instance, uint 16_t status);66 void hc_interrupt(hc_t *instance, uint32_t status); 66 67 67 68 /** Safely dispose host controller internal structures -
uspace/drv/ohci/ohci_regs.h
r925e099 r7d6a676 43 43 volatile uint32_t command_status; 44 44 volatile uint32_t interrupt_status; 45 #define IS_SO (1 << 0) 46 #define IS_WDH (1 << 1) 47 #define IS_SF (1 << 2) 48 #define IS_RD (1 << 3) 49 #define IS_UE (1 << 4) 50 #define IS_FNO (1 << 5) 51 #define IS_RHSC (1 << 6) 52 #define IS_OC (1 << 30) 45 53 volatile uint32_t interupt_enable; 46 54 #define IE_SO (1 << 0) -
uspace/drv/uhci-hcd/uhci_hc.c
r925e099 r7d6a676 121 121 fibril_create(uhci_hc_interrupt_emulator, instance); 122 122 fibril_add_ready(instance->cleaner); 123 } else { 124 /* TODO: enable interrupts here */ 123 125 } 124 126
Note:
See TracChangeset
for help on using the changeset viewer.