Lines Matching +full:bd +full:- +full:address

7  *                         ( by Andrey Volkov <avolkov@varma-el.com> )
8 * Copyright (C) 2003-2004 MontaVista, Software, Inc.
20 * struct bcom_bd - Structure describing a generic BestComm buffer descriptor
38 * struct bcom_task - Structure describing a loaded BestComm task
52 struct bcom_bd *bd; member
67 * bcom_enable - Enable a BestComm task
76 * bcom_disable - Disable a BestComm task
86 * bcom_get_task_irq - Returns the irq number of a BestComm task
91 return tsk->irq; in bcom_get_task_irq()
95 /* BD based tasks helpers */
100 /** _bcom_next_index - Get next input index.
108 return ((tsk->index + 1) == tsk->num_bd) ? 0 : tsk->index + 1; in _bcom_next_index()
111 /** _bcom_next_outdex - Get next output index.
119 return ((tsk->outdex + 1) == tsk->num_bd) ? 0 : tsk->outdex + 1; in _bcom_next_outdex()
123 * bcom_queue_empty - Checks if a BestComm task BD queue is empty
129 return tsk->index == tsk->outdex; in bcom_queue_empty()
133 * bcom_queue_full - Checks if a BestComm task BD queue is full
139 return tsk->outdex == _bcom_next_index(tsk); in bcom_queue_full()
143 * bcom_get_bd - Get a BD from the queue
145 * index: Index of the BD to fetch
150 /* A cast to (void*) so the address can be incremented by the in bcom_get_bd()
152 return ((void *)tsk->bd) + (index * tsk->bd_size); in bcom_get_bd()
156 * bcom_buffer_done - Checks if a BestComm
162 struct bcom_bd *bd; in bcom_buffer_done() local
166 bd = bcom_get_bd(tsk, tsk->outdex); in bcom_buffer_done()
167 return !(bd->status & BCOM_BD_READY); in bcom_buffer_done()
171 * bcom_prepare_next_buffer - clear status of next available buffer.
179 struct bcom_bd *bd; in bcom_prepare_next_buffer() local
181 bd = bcom_get_bd(tsk, tsk->index); in bcom_prepare_next_buffer()
182 bd->status = 0; /* cleanup last status */ in bcom_prepare_next_buffer()
183 return bd; in bcom_prepare_next_buffer()
189 struct bcom_bd *bd = bcom_get_bd(tsk, tsk->index); in bcom_submit_next_buffer() local
191 tsk->cookie[tsk->index] = cookie; in bcom_submit_next_buffer()
192 mb(); /* ensure the bd is really up-to-date */ in bcom_submit_next_buffer()
193 bd->status |= BCOM_BD_READY; in bcom_submit_next_buffer()
194 tsk->index = _bcom_next_index(tsk); in bcom_submit_next_buffer()
195 if (tsk->flags & BCOM_FLAGS_ENABLE_TASK) in bcom_submit_next_buffer()
202 void *cookie = tsk->cookie[tsk->outdex]; in bcom_retrieve_buffer()
203 struct bcom_bd *bd = bcom_get_bd(tsk, tsk->outdex); in bcom_retrieve_buffer() local
206 *p_status = bd->status; in bcom_retrieve_buffer()
208 *p_bd = bd; in bcom_retrieve_buffer()
209 tsk->outdex = _bcom_next_outdex(tsk); in bcom_retrieve_buffer()