Changeset 1ecc5de in mainline for uspace/drv/bus/usb/ohci/hc.c
- Timestamp:
- 2011-07-10T20:43:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e8a01b
- Parents:
- 2bc7122
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hc.c
r2bc7122 r1ecc5de 46 46 #define OHCI_USED_INTERRUPTS \ 47 47 (I_SO | I_WDH | I_UE | I_RHSC) 48 49 static const irq_cmd_t ohci_irq_commands[] = 50 { 51 { .cmd = CMD_MEM_READ_32, .dstarg = 1, .addr = NULL /*filled later*/ }, 52 { .cmd = CMD_BTEST, .srcarg = 1, .dstarg = 2, .value = OHCI_USED_INTERRUPTS }, 53 { .cmd = CMD_PREDICATE, .srcarg = 2, .value = 2 }, 54 { .cmd = CMD_MEM_WRITE_A_32, .srcarg = 1, .addr = NULL /*filled later*/ }, 55 { .cmd = CMD_ACCEPT }, 56 }; 57 48 58 static int interrupt_emulator(hc_t *instance); 49 59 static void hc_gain_control(hc_t *instance); … … 150 160 } 151 161 /*----------------------------------------------------------------------------*/ 152 /** Create end register endpoint structures 162 size_t hc_irq_cmd_count(void) 163 { 164 return sizeof(ohci_irq_commands) / sizeof(irq_cmd_t); 165 } 166 /*----------------------------------------------------------------------------*/ 167 int hc_get_irq_commands( 168 irq_cmd_t cmds[], size_t cmd_size, uintptr_t regs, size_t reg_size) 169 { 170 if (cmd_size < sizeof(ohci_irq_commands) 171 || reg_size < sizeof(ohci_regs_t)) 172 return EOVERFLOW; 173 174 /* Create register mapping to use in IRQ handler 175 * this mapping should be present in kernel only. 176 * Remove it from here when kernel knows how to create mappings 177 * and accepts physical addresses in IRQ code. 178 * TODO: remove */ 179 void *registers; 180 const int ret = pio_enable((void*)regs, reg_size, ®isters); 181 182 if (ret != EOK) 183 return ret; 184 185 memcpy(cmds, ohci_irq_commands, sizeof(ohci_irq_commands)); 186 187 void *address = (void*)&(((ohci_regs_t*)registers)->interrupt_status); 188 cmds[0].addr = address; 189 cmds[3].addr = address; 190 return EOK; 191 } 192 /*----------------------------------------------------------------------------*/ 193 /** Create and register endpoint structures 153 194 * 154 195 * @param[in] instance OHCI driver structure. … … 621 662 return EOK; 622 663 } 664 623 665 /** 624 666 * @}
Note:
See TracChangeset
for help on using the changeset viewer.