Changeset a7e2f0d in mainline for uspace/drv/uhci-hcd/transfer_list.c


Ignore:
Timestamp:
2011-03-07T18:57:00Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
18e9eeb
Parents:
0d3167e
Message:

Doxygen and other comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/transfer_list.c

    r0d3167e ra7e2f0d  
    3838#include "transfer_list.h"
    3939
     40static void transfer_list_remove_batch(
     41    transfer_list_t *instance, batch_t *batch);
     42/*----------------------------------------------------------------------------*/
     43/** Initializes transfer list structures.
     44 *
     45 * @param[in] instance Memory place to use.
     46 * @param[in] name Name of te new list.
     47 * @return Error code
     48 *
     49 * Allocates memory for internat queue_head_t structure.
     50 */
    4051int transfer_list_init(transfer_list_t *instance, const char *name)
    4152{
     
    4859                return ENOMEM;
    4960        }
    50         queue_head_init(instance->queue_head);
    5161        instance->queue_head_pa = addr_to_phys(instance->queue_head);
    5262
     
    5767}
    5868/*----------------------------------------------------------------------------*/
     69/** Set the next list in chain.
     70 *
     71 * @param[in] instance List to lead.
     72 * @param[in] next List to append.
     73 * @return Error code
     74 */
    5975void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next)
    6076{
     
    6783}
    6884/*----------------------------------------------------------------------------*/
     85/** Submits a new transfer batch to list and queue.
     86 *
     87 * @param[in] instance List to use.
     88 * @param[in] batch Transfer batch to submit.
     89 * @return Error code
     90 */
    6991void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch)
    7092{
    7193        assert(instance);
    7294        assert(batch);
    73         usb_log_debug2("Adding batch(%p) to queue %s.\n", batch, instance->name);
     95        usb_log_debug2(
     96            "Adding batch(%p) to queue %s.\n", batch, instance->name);
    7497
    7598        uint32_t pa = (uintptr_t)addr_to_phys(batch->qh);
     
    98121        queue_head_append_qh(last->qh, pa);
    99122        list_append(&batch->link, &instance->batch_list);
     123
    100124        usb_log_debug("Batch(%p) added to queue %s last, first is %p.\n",
    101                 batch, instance->name, first );
     125                batch, instance->name, first);
    102126        fibril_mutex_unlock(&instance->guard);
    103127}
    104128/*----------------------------------------------------------------------------*/
    105 static void transfer_list_remove_batch(
    106     transfer_list_t *instance, batch_t *batch)
     129/** Removes a transfer batch from list and queue.
     130 *
     131 * @param[in] instance List to use.
     132 * @param[in] batch Transfer batch to remove.
     133 * @return Error code
     134 */
     135void transfer_list_remove_batch(transfer_list_t *instance, batch_t *batch)
    107136{
    108137        assert(instance);
     
    110139        assert(instance->queue_head);
    111140        assert(batch->qh);
    112         usb_log_debug2("Removing batch(%p) from queue %s.\n", batch, instance->name);
     141        usb_log_debug2(
     142            "Removing batch(%p) from queue %s.\n", batch, instance->name);
    113143
    114         /* I'm the first one here */
    115144        if (batch->link.prev == &instance->batch_list) {
    116                 usb_log_debug("Batch(%p) removed (FIRST) from queue %s, next element %x.\n",
    117                         batch, instance->name, batch->qh->next_queue);
     145                /* I'm the first one here */
     146                usb_log_debug(
     147                    "Batch(%p) removed (FIRST) from %s, next element %x.\n",
     148                    batch, instance->name, batch->qh->next_queue);
    118149                instance->queue_head->element = batch->qh->next_queue;
    119150        } else {
    120                 usb_log_debug("Batch(%p) removed (NOT FIRST) from queue, next element %x.\n",
    121                         batch, instance->name, batch->qh->next_queue);
    122                 batch_t *prev = list_get_instance(batch->link.prev, batch_t, link);
     151                usb_log_debug(
     152                    "Batch(%p) removed (FIRST:NO) from %s, next element %x.\n",
     153                    batch, instance->name, batch->qh->next_queue);
     154                batch_t *prev =
     155                    list_get_instance(batch->link.prev, batch_t, link);
    123156                prev->qh->next_queue = batch->qh->next_queue;
    124157        }
     
    126159}
    127160/*----------------------------------------------------------------------------*/
     161/** Checks list for finished transfers.
     162 *
     163 * @param[in] instance List to use.
     164 * @return Error code
     165 */
    128166void transfer_list_remove_finished(transfer_list_t *instance)
    129167{
Note: See TracChangeset for help on using the changeset viewer.