Changeset 1102eca in mainline for uspace/lib/usbhost/src/hcd.c
- Timestamp:
- 2018-01-08T17:17:38Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bdd8842c
- Parents:
- eb928c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/hcd.c
reb928c4 r1102eca 32 32 /** @file 33 33 * 34 * Host controller driver framework. Encapsulates DDF device of HC to an 35 * hc_device_t, which is passed to driver implementing hc_driver_t. 34 36 */ 35 37 … … 68 70 static const hc_driver_t *hc_driver; 69 71 72 /** 73 * The main HC driver routine. 74 */ 70 75 int hc_driver_main(const hc_driver_t *driver) 71 76 { … … 81 86 } 82 87 83 /** IRQ handling callback, forward status from call to diver structure. 84 * 85 * @param[in] dev DDF instance of the device to use. 86 * @param[in] iid (Unused). 87 * @param[in] call Pointer to the call from kernel. 88 /** 89 * IRQ handling callback. Call the bus operation. 90 * 91 * Currently, there is a bus ops lookup to find the interrupt handler. So far, 92 * the mechanism is too flexible, as it allows different instances of HC to 93 * have different IRQ handlers, disallowing us to optimize the lookup here. 94 * TODO: Make the bus mechanism less flexible in irq handling and remove the 95 * lookup. 88 96 */ 89 97 static void irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev) … … 99 107 } 100 108 101 /** Worker for the HW interrupt replacement fibril. 109 /** 110 * Worker for the HW interrupt replacement fibril. 102 111 */ 103 112 static int interrupt_polling(void *arg) … … 123 132 } 124 133 134 /** 135 * Clean the IRQ code bottom-half. 136 */ 125 137 static inline void irq_code_clean(irq_code_t *code) 126 138 { … … 135 147 } 136 148 137 /** Register interrupt handler 138 * 139 * @param[in] device Host controller DDF device 140 * @param[in] regs Register range 141 * @param[in] irq Interrupt number 142 * @paran[in] handler Interrupt handler 143 * @param[in] gen_irq_code IRQ code generator. 149 /** 150 * Register an interrupt handler. If there is a callback to setup the bottom half, 151 * invoke it and register it. Register for notifications. 152 * 153 * If this method fails, a polling fibril is started instead. 154 * 155 * @param[in] hcd Host controller device. 156 * @param[in] hw_res Resources to be used. 144 157 * 145 158 * @return IRQ capability handle on success. … … 181 194 } 182 195 183 /** Initialize HC in memory of the driver. 184 * 185 * @param device DDF instance of the device to use 186 * @return Error code 196 /** 197 * Initialize HC in memory of the driver. 187 198 * 188 199 * This function does all the preparatory work for hc and rh drivers: … … 192 203 * - calls driver specific initialization 193 204 * - registers root hub 205 * 206 * @param device DDF instance of the device to use 207 * @return Error code 194 208 */ 195 209 int hc_dev_add(ddf_dev_t *device)
Note:
See TracChangeset
for help on using the changeset viewer.