Lines Matching refs:d_idx

134 	unsigned int d_idx;  in dwmac_send()  local
145 d_idx = p->tx_desc_head; in dwmac_send()
166 p->tx_frags[d_idx] = pinned; in dwmac_send()
167 LOG_DBG("d[%d]: frag %p pinned %p len %d", d_idx, in dwmac_send()
178 d = &p->tx_descs[d_idx]; in dwmac_send()
187 INC_WRAP(d_idx, NB_TX_DESCS); in dwmac_send()
195 p->tx_desc_head = d_idx; in dwmac_send()
198 REG_WRITE(DMA_CHn_TXDESC_TAIL_PTR(0), TXDESC_PHYS_L(d_idx)); in dwmac_send()
203 while (d_idx != p->tx_desc_head) { in dwmac_send()
205 DEC_WRAP(d_idx, NB_TX_DESCS); in dwmac_send()
206 frag = p->tx_frags[d_idx]; in dwmac_send()
215 unsigned int d_idx; in dwmac_tx_release() local
220 for (d_idx = p->tx_desc_tail; in dwmac_tx_release()
221 d_idx != p->tx_desc_head; in dwmac_tx_release()
222 INC_WRAP(d_idx, NB_TX_DESCS), k_sem_give(&p->free_tx_descs)) { in dwmac_tx_release()
228 d = &p->tx_descs[d_idx]; in dwmac_tx_release()
230 LOG_DBG("TDES3[%d] = 0x%08x", d_idx, des3_val); in dwmac_tx_release()
238 frag = p->tx_frags[d_idx]; in dwmac_tx_release()
251 p->tx_desc_tail = d_idx; in dwmac_tx_release()
258 unsigned int d_idx, bytes_so_far; in dwmac_receive() local
261 for (d_idx = p->rx_desc_tail; in dwmac_receive()
262 d_idx != p->rx_desc_head; in dwmac_receive()
263 INC_WRAP(d_idx, NB_RX_DESCS), k_sem_give(&p->free_rx_descs)) { in dwmac_receive()
267 d_idx, p->rx_desc_head); in dwmac_receive()
269 d = &p->rx_descs[d_idx]; in dwmac_receive()
271 LOG_DBG("RDES3[%d] = 0x%08x", d_idx, des3_val); in dwmac_receive()
287 LOG_ERR("d[%d] first desc but pkt exists", d_idx); in dwmac_receive()
299 LOG_ERR("no rx_pkt: skipping desc %d", d_idx); in dwmac_receive()
304 frag = p->rx_frags[d_idx]; in dwmac_receive()
305 p->rx_frags[d_idx] = NULL; in dwmac_receive()
327 p->rx_desc_tail = d_idx; in dwmac_receive()
335 unsigned int d_idx; in dwmac_rx_refill_thread() local
340 d_idx = p->rx_desc_head; in dwmac_rx_refill_thread()
352 d = &p->rx_descs[d_idx]; in dwmac_rx_refill_thread()
356 d_idx, d->des3, k_sem_count_get(&p->free_rx_descs), in dwmac_rx_refill_thread()
359 frag = p->rx_frags[d_idx]; in dwmac_rx_refill_thread()
369 LOG_DBG("new frag[%d] at %p", d_idx, frag->data); in dwmac_rx_refill_thread()
372 p->rx_frags[d_idx] = frag; in dwmac_rx_refill_thread()
374 LOG_DBG("reusing frag[%d] at %p", d_idx, frag->data); in dwmac_rx_refill_thread()
387 p->rx_desc_head = INC_WRAP(d_idx, NB_RX_DESCS); in dwmac_rx_refill_thread()
390 REG_WRITE(DMA_CHn_RXDESC_TAIL_PTR(0), RXDESC_PHYS_L(d_idx)); in dwmac_rx_refill_thread()