Changeset 52f1882 in mainline for uspace/drv/bus/usb/ohci/ohci_rh.c


Ignore:
Timestamp:
2013-02-08T23:31:23Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db71e2a
Parents:
39339378
Message:

ohci: Add comments. Fix uninitialized pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_rh.c

    r39339378 r52f1882  
    4343static usbvirt_device_ops_t ops;
    4444
     45/** Initialize internal USB HUB class descriptor.
     46 * @param instance OHCI root hub.
     47 * Use register based info to create accurate descriptor.
     48 */
    4549static void ohci_rh_hub_desc_init(ohci_rh_t *instance)
    4650{
     
    8387
    8488}
    85 
     89/** Initialize OHCI root hub.
     90 * @param instance Place to initialize.
     91 * @param regs OHCI device registers.
     92 * @param name Device name.
     93 * return Error code, EOK on success.
     94 *
     95 * Selects preconfigured port powering mode, sets up descriptor, and
     96 * initializes internal virtual hub.
     97 */
    8698int ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, const char *name)
    8799{
     
    137149
    138150        ohci_rh_hub_desc_init(instance);
     151        instance->unfinished_interrupt_transfer = NULL;
    139152        return virthub_base_init(&instance->base, name, &ops, instance,
    140153            NULL, &instance->hub_descriptor.header, HUB_STATUS_CHANGE_PIPE);
    141154}
    142155
     156/** Schedule USB request.
     157 * @param instance OCHI root hub instance.
     158 * @param batch USB requst batch to schedule.
     159 * @return Always EOK.
     160 * Most requests complete even before this function returns,
     161 * status change requests might be postponed until there is something to report.
     162 */
    143163int ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch)
    144164{
     
    165185}
    166186
     187/** Handle OHCI RHSC interrupt.
     188 * @param instance OHCI root hub isntance.
     189 * @return Always EOK.
     190 *
     191 * Interrupt means there is a change of status to report. It may trigger
     192 * processing of a postponed request.
     193 */
    167194int ohci_rh_interrupt(ohci_rh_t *instance)
    168195{
     196        //TODO atomic swap needed
    169197        usb_transfer_batch_t *batch = instance->unfinished_interrupt_transfer;
    170198        instance->unfinished_interrupt_transfer = NULL;
     
    484512};
    485513
     514/** Virtual OHCI root hub ops */
    486515static usbvirt_device_ops_t ops = {
    487516        .control = control_transfer_handlers,
Note: See TracChangeset for help on using the changeset viewer.