Ignore:
Timestamp:
2011-04-13T19:06:11Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d2d444
Parents:
a0a134b
Message:

Refactoring, doxygen

Remove queue_head_pa, it was not really needed as this value was use exactly once for every list.
qh_set_next_qh accepts virtual address and does the conversion internally.
Removed unused qh function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/hw_struct/queue_head.h

    ra0a134b r4c70554  
    3434#ifndef DRV_UHCI_QH_H
    3535#define DRV_UHCI_QH_H
    36 
    37 /* libc */
    3836#include <assert.h>
    3937
    4038#include "link_pointer.h"
     39#include "utils/malloc32.h"
    4140
    4241typedef struct queue_head {
     
    6766 * NULL.
    6867 */
    69 static inline void qh_set_next_qh(qh_t *instance, uint32_t pa)
     68static inline void qh_set_next_qh(qh_t *instance, qh_t *next)
    7069{
    7170        /* Address is valid and not terminal */
    72         if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) {
     71        uint32_t pa = addr_to_phys(next);
     72        if (pa) {
    7373                instance->next = LINK_POINTER_QH(pa);
    7474        } else {
    7575                instance->next = LINK_POINTER_TERM;
    76         }
    77 }
    78 /*----------------------------------------------------------------------------*/
    79 /** Set queue head element pointer
    80  *
    81  * @param[in] instance qh_t structure to initialize.
    82  * @param[in] pa Physical address of the next queue head.
    83  *
    84  * Adds proper flag. If the pointer is NULL or terminal, sets element
    85  * to terminal NULL.
    86  */
    87 static inline void qh_set_element_qh(qh_t *instance, uint32_t pa)
    88 {
    89         /* Address is valid and not terminal */
    90         if (pa && ((pa & LINK_POINTER_TERMINATE_FLAG) == 0)) {
    91                 instance->element = LINK_POINTER_QH(pa);
    92         } else {
    93                 instance->element = LINK_POINTER_TERM;
    9476        }
    9577}
Note: See TracChangeset for help on using the changeset viewer.