| 8 | #include "mana.h" |
| 9 | |
| 10 | uint8_t * |
| 11 | gdma_get_wqe_pointer(struct mana_gdma_queue *queue) |
| 12 | { |
| 13 | uint32_t offset_in_bytes = |
| 14 | (queue->head * GDMA_WQE_ALIGNMENT_UNIT_SIZE) & |
| 15 | (queue->size - 1); |
| 16 | |
| 17 | DP_LOG(DEBUG, "txq sq_head %u sq_size %u offset_in_bytes %u", |
| 18 | queue->head, queue->size, offset_in_bytes); |
| 19 | |
| 20 | if (offset_in_bytes + GDMA_WQE_ALIGNMENT_UNIT_SIZE > queue->size) |
| 21 | DP_LOG(ERR, "fatal error: offset_in_bytes %u too big", |
| 22 | offset_in_bytes); |
| 23 | |
| 24 | return ((uint8_t *)queue->buffer) + offset_in_bytes; |
| 25 | } |
| 26 | |
| 27 | static uint32_t |
| 28 | write_dma_client_oob(uint8_t *work_queue_buffer_pointer, |
no outgoing calls
no test coverage detected