Lines Matching +full:command +full:- +full:sequencer

1 /* SPDX-License-Identifier: GPL-2.0-only */
14 #include <linux/dma-mapping.h>
63 /* From CTRL-A settings, then set to what is appropriate */
95 u32 max_scbs; /* absolute sequencer scb queue size */
116 struct scb *scb; /* equals dma_scb->vaddr */
123 /* internally generated command */
129 /* If this is an Empty SCB, index of first edb in seq->edb_arr. */
157 struct asd_dma_tok *actual_dl; /* actual_dl->vaddr */
201 struct asd_seq_data seq; /* sequencer related */
206 /* ---------- Common macros ---------- */
227 #define PHY_ENABLED(_HA, _I) ((_HA)->hw_prof.enabled_phys & (1<<(_I)))
229 /* ---------- DMA allocs ---------- */
247 token->size = size; in asd_alloc_coherent()
248 token->vaddr = dma_alloc_coherent(&asd_ha->pcidev->dev, in asd_alloc_coherent()
249 token->size, in asd_alloc_coherent()
250 &token->dma_handle, in asd_alloc_coherent()
252 if (!token->vaddr) { in asd_alloc_coherent()
264 dma_free_coherent(&asd_ha->pcidev->dev, token->size, in asd_free_coherent()
265 token->vaddr, token->dma_handle); in asd_free_coherent()
273 INIT_LIST_HEAD(&ascb->list); in asd_init_ascb()
274 ascb->scb = ascb->dma_scb.vaddr; in asd_init_ascb()
275 ascb->ha = asd_ha; in asd_init_ascb()
276 timer_setup(&ascb->timer, NULL, 0); in asd_init_ascb()
277 ascb->tc_index = -1; in asd_init_ascb()
284 seq->tc_index_array[index] = NULL; in asd_tc_index_release()
285 clear_bit(index, seq->tc_index_bitmap); in asd_tc_index_release()
294 index = find_first_zero_bit(seq->tc_index_bitmap, in asd_tc_index_get()
295 seq->tc_index_bitmap_bits); in asd_tc_index_get()
296 if (index == seq->tc_index_bitmap_bits) in asd_tc_index_get()
297 return -1; in asd_tc_index_get()
299 seq->tc_index_array[index] = ptr; in asd_tc_index_get()
300 set_bit(index, seq->tc_index_bitmap); in asd_tc_index_get()
309 return seq->tc_index_array[index]; in asd_tc_index_find()
313 * asd_ascb_free -- free a single aSCB after is has completed
317 * the sequencer.
322 struct asd_ha_struct *asd_ha = ascb->ha; in asd_ascb_free()
325 BUG_ON(!list_empty(&ascb->list)); in asd_ascb_free()
326 spin_lock_irqsave(&ascb->ha->seq.tc_index_lock, flags); in asd_ascb_free()
327 asd_tc_index_release(&ascb->ha->seq, ascb->tc_index); in asd_ascb_free()
328 spin_unlock_irqrestore(&ascb->ha->seq.tc_index_lock, flags); in asd_ascb_free()
329 dma_pool_free(asd_ha->scb_pool, ascb->dma_scb.vaddr, in asd_ascb_free()
330 ascb->dma_scb.dma_handle); in asd_ascb_free()
336 * asd_ascb_list_free -- free a list of ascbs
348 __list_add(&list, ascb_list->list.prev, &ascb_list->list); in asd_ascb_free_list()
355 /* ---------- Function declarations ---------- */