Changeset 17ceb72 in mainline for uspace/drv/uhci-hcd/transfer_list.c
- Timestamp:
- 2011-03-14T01:39:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6298d80
- Parents:
- 3bd96bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/transfer_list.c
r3bd96bb r17ceb72 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver 32 * @brief UHCI driver transfer list implementation 33 33 */ 34 34 #include <errno.h> 35 36 35 #include <usb/debug.h> 37 36 … … 41 40 transfer_list_t *instance, batch_t *batch); 42 41 /*----------------------------------------------------------------------------*/ 43 /** Initialize stransfer list structures.42 /** Initialize transfer list structures. 44 43 * 45 44 * @param[in] instance Memory place to use. 46 * @param[in] name Name of t e new list.45 * @param[in] name Name of the new list. 47 46 * @return Error code 48 47 * … … 66 65 } 67 66 /*----------------------------------------------------------------------------*/ 68 /** Set the next list in chain.67 /** Set the next list in transfer list chain. 69 68 * 70 69 * @param[in] instance List to lead. … … 72 71 * @return Error code 73 72 * 74 * Does not check whether th ere was a next list already.73 * Does not check whether this replaces an existing list . 75 74 */ 76 75 void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next) … … 80 79 if (!instance->queue_head) 81 80 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 */ 83 82 qh_set_next_qh(instance->queue_head, next->queue_head_pa); 84 83 qh_set_element_qh(instance->queue_head, next->queue_head_pa); 85 84 } 86 85 /*----------------------------------------------------------------------------*/ 87 /** Submit s a new transfer batch tolist and queue.86 /** Submit transfer batch to the list and queue. 88 87 * 89 88 * @param[in] instance List to use. 90 89 * @param[in] batch Transfer batch to submit. 91 90 * @return Error code 91 * 92 * The batch is added to the end of the list and queue. 92 93 */ 93 94 void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch) … … 106 107 fibril_mutex_lock(&instance->guard); 107 108 109 /* Add to the hardware queue. */ 108 110 if (list_empty(&instance->batch_list)) { 109 111 /* There is nothing scheduled */ … … 117 119 qh_set_next_qh(last->qh, pa); 118 120 } 121 /* Add to the driver list */ 119 122 list_append(&batch->link, &instance->batch_list); 120 123 … … 126 129 } 127 130 /*----------------------------------------------------------------------------*/ 128 /** Remove sa transfer batch from the list and queue.131 /** Remove a transfer batch from the list and queue. 129 132 * 130 133 * @param[in] instance List to use. … … 144 147 145 148 const char * pos = NULL; 149 /* Remove from the hardware queue */ 146 150 if (batch->link.prev == &instance->batch_list) { 147 151 /* I'm the first one here */ … … 154 158 pos = "NOT FIRST"; 155 159 } 160 /* Remove from the driver list */ 156 161 list_remove(&batch->link); 157 162 usb_log_debug("Batch(%p) removed (%s) from %s, next element %x.\n", … … 159 164 } 160 165 /*----------------------------------------------------------------------------*/ 161 /** Check slist for finished batches.166 /** Check list for finished batches. 162 167 * 163 168 * @param[in] instance List to use. 164 169 * @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. 165 174 */ 166 175 void transfer_list_remove_finished(transfer_list_t *instance) … … 177 186 178 187 if (batch_is_complete(batch)) { 188 /* Save for post-processing */ 179 189 transfer_list_remove_batch(instance, batch); 180 190 list_append(current, &done);
Note:
See TracChangeset
for help on using the changeset viewer.