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


Ignore:
Timestamp:
2011-03-14T21:24:02Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fcf07e6
Parents:
c69209d (diff), 9370884 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Doxygen comments, enable hw interrupts if possible

File:
1 edited

Legend:

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

    rc69209d r15d3b54  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28/** @addtogroup drvusbuhcihc
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI driver
     32 * @brief UHCI driver transfer list implementation
    3333 */
    3434#include <errno.h>
    35 
    3635#include <usb/debug.h>
    3736
     
    4140    transfer_list_t *instance, batch_t *batch);
    4241/*----------------------------------------------------------------------------*/
    43 /** Initializes transfer list structures.
     42/** Initialize transfer list structures.
    4443 *
    4544 * @param[in] instance Memory place to use.
    46  * @param[in] name Name of te new list.
     45 * @param[in] name Name of the new list.
    4746 * @return Error code
    4847 *
     
    6665}
    6766/*----------------------------------------------------------------------------*/
    68 /** Set the next list in chain.
     67/** Set the next list in transfer list chain.
    6968 *
    7069 * @param[in] instance List to lead.
     
    7271 * @return Error code
    7372 *
    74  * Does not check whether there was a next list already.
     73 * Does not check whether this replaces an existing list .
    7574 */
    7675void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next)
     
    8079        if (!instance->queue_head)
    8180                return;
    82         /* set both next and element to point to the same QH */
     81        /* Set both next and element to point to the same QH */
    8382        qh_set_next_qh(instance->queue_head, next->queue_head_pa);
    8483        qh_set_element_qh(instance->queue_head, next->queue_head_pa);
    8584}
    8685/*----------------------------------------------------------------------------*/
    87 /** Submits a new transfer batch to list and queue.
     86/** Submit transfer batch to the list and queue.
    8887 *
    8988 * @param[in] instance List to use.
    9089 * @param[in] batch Transfer batch to submit.
    9190 * @return Error code
     91 *
     92 * The batch is added to the end of the list and queue.
    9293 */
    9394void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch)
     
    106107        fibril_mutex_lock(&instance->guard);
    107108
     109        /* Add to the hardware queue. */
    108110        if (list_empty(&instance->batch_list)) {
    109111                /* There is nothing scheduled */
     
    117119                qh_set_next_qh(last->qh, pa);
    118120        }
     121        /* Add to the driver list */
    119122        list_append(&batch->link, &instance->batch_list);
    120123
     
    126129}
    127130/*----------------------------------------------------------------------------*/
    128 /** Removes a transfer batch from the list and queue.
     131/** Remove a transfer batch from the list and queue.
    129132 *
    130133 * @param[in] instance List to use.
     
    144147
    145148        const char * pos = NULL;
     149        /* Remove from the hardware queue */
    146150        if (batch->link.prev == &instance->batch_list) {
    147151                /* I'm the first one here */
     
    154158                pos = "NOT FIRST";
    155159        }
     160        /* Remove from the driver list */
    156161        list_remove(&batch->link);
    157162        usb_log_debug("Batch(%p) removed (%s) from %s, next element %x.\n",
     
    159164}
    160165/*----------------------------------------------------------------------------*/
    161 /** Checks list for finished batches.
     166/** Check list for finished batches.
    162167 *
    163168 * @param[in] instance List to use.
    164169 * @return Error code
     170 *
     171 * Creates a local list of finished batches and calls next_step on each and
     172 * every one. This is safer because next_step may theoretically access
     173 * this transfer list leading to the deadlock if its done inline.
    165174 */
    166175void transfer_list_remove_finished(transfer_list_t *instance)
     
    177186
    178187                if (batch_is_complete(batch)) {
     188                        /* Save for post-processing */
    179189                        transfer_list_remove_batch(instance, batch);
    180190                        list_append(current, &done);
Note: See TracChangeset for help on using the changeset viewer.