Changeset 1102eca in mainline for uspace/lib/usbhost/src/hcd.c


Ignore:
Timestamp:
2018-01-08T17:17:38Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bdd8842c
Parents:
eb928c4
Message:

usbhost: documentation & cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/hcd.c

    reb928c4 r1102eca  
    3232/** @file
    3333 *
     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.
    3436 */
    3537
     
    6870static const hc_driver_t *hc_driver;
    6971
     72/**
     73 * The main HC driver routine.
     74 */
    7075int hc_driver_main(const hc_driver_t *driver)
    7176{
     
    8186}
    8287
    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.
    8896 */
    8997static void irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)
     
    99107}
    100108
    101 /** Worker for the HW interrupt replacement fibril.
     109/**
     110 * Worker for the HW interrupt replacement fibril.
    102111 */
    103112static int interrupt_polling(void *arg)
     
    123132}
    124133
     134/**
     135 * Clean the IRQ code bottom-half.
     136 */
    125137static inline void irq_code_clean(irq_code_t *code)
    126138{
     
    135147}
    136148
    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.
    144157 *
    145158 * @return IRQ capability handle on success.
     
    181194}
    182195
    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.
    187198 *
    188199 * This function does all the preparatory work for hc and rh drivers:
     
    192203 *  - calls driver specific initialization
    193204 *  - registers root hub
     205 *
     206 * @param device DDF instance of the device to use
     207 * @return Error code
    194208 */
    195209int hc_dev_add(ddf_dev_t *device)
Note: See TracChangeset for help on using the changeset viewer.