Home
last modified time | relevance | path

Searched refs:wr_idx (Results 1 – 24 of 24) sorted by relevance

/linux-6.1.9/drivers/misc/mei/
Ddma-ring.c216 u32 wr_idx, rd_idx, hbuf_depth, empty; in mei_dma_ring_empty_slots() local
227 wr_idx = READ_ONCE(ctrl->hbuf_wr_idx); in mei_dma_ring_empty_slots()
229 if (rd_idx > wr_idx) in mei_dma_ring_empty_slots()
230 empty = rd_idx - wr_idx; in mei_dma_ring_empty_slots()
232 empty = hbuf_depth - (wr_idx - rd_idx); in mei_dma_ring_empty_slots()
248 u32 wr_idx, rem, slots; in mei_dma_ring_write() local
255 wr_idx = READ_ONCE(ctrl->hbuf_wr_idx) & (hbuf_depth - 1); in mei_dma_ring_write()
258 if (wr_idx + slots > hbuf_depth) { in mei_dma_ring_write()
259 buf += mei_dma_copy_to(dev, buf, wr_idx, hbuf_depth - wr_idx); in mei_dma_ring_write()
260 rem = slots - (hbuf_depth - wr_idx); in mei_dma_ring_write()
[all …]
/linux-6.1.9/drivers/scsi/fnic/
Dfnic_trace.c57 fnic_trace_entries.page_offset[fnic_trace_entries.wr_idx]; in fnic_trace_get_buf()
58 fnic_trace_entries.wr_idx++; in fnic_trace_get_buf()
64 if (fnic_trace_entries.wr_idx >= fnic_max_trace_entries) in fnic_trace_get_buf()
65 fnic_trace_entries.wr_idx = 0; in fnic_trace_get_buf()
71 if (fnic_trace_entries.wr_idx == fnic_trace_entries.rd_idx) { in fnic_trace_get_buf()
96 int wr_idx; in fnic_get_trace_data() local
105 wr_idx = fnic_trace_entries.wr_idx; in fnic_get_trace_data()
106 if (wr_idx < rd_idx) { in fnic_get_trace_data()
145 if (rd_idx == wr_idx) in fnic_get_trace_data()
148 } else if (wr_idx > rd_idx) { in fnic_get_trace_data()
[all …]
Dfnic_trace.h35 int wr_idx; member
/linux-6.1.9/drivers/scsi/snic/
Dsnic_trc.c23 td = &trc->buf[trc->wr_idx]; in snic_get_trc_buf()
24 trc->wr_idx++; in snic_get_trc_buf()
26 if (trc->wr_idx == trc->max_idx) in snic_get_trc_buf()
27 trc->wr_idx = 0; in snic_get_trc_buf()
29 if (trc->wr_idx != trc->rd_idx) { in snic_get_trc_buf()
82 if (trc->rd_idx == trc->wr_idx) { in snic_get_trc_data()
130 trc->rd_idx = trc->wr_idx = 0; in snic_trc_init()
Dsnic_trc.h33 u32 wr_idx; member
/linux-6.1.9/drivers/net/ethernet/netronome/nfp/nfd3/
Ddp.c238 int f, nr_frags, wr_idx, md_bytes; in nfp_nfd3_tx() local
286 wr_idx = D_IDX(tx_ring, tx_ring->wr_p); in nfp_nfd3_tx()
289 txbuf = &tx_ring->txbufs[wr_idx]; in nfp_nfd3_tx()
297 txd = &tx_ring->txds[wr_idx]; in nfp_nfd3_tx()
331 wr_idx = D_IDX(tx_ring, wr_idx + 1); in nfp_nfd3_tx()
332 tx_ring->txbufs[wr_idx].skb = skb; in nfp_nfd3_tx()
333 tx_ring->txbufs[wr_idx].dma_addr = dma_addr; in nfp_nfd3_tx()
334 tx_ring->txbufs[wr_idx].fidx = f; in nfp_nfd3_tx()
336 txd = &tx_ring->txds[wr_idx]; in nfp_nfd3_tx()
366 dma_unmap_page(dp->dev, tx_ring->txbufs[wr_idx].dma_addr, in nfp_nfd3_tx()
[all …]
Dxsk.c24 unsigned int wr_idx; in nfp_nfd3_xsk_tx_xdp() local
32 wr_idx = D_IDX(tx_ring, tx_ring->wr_p); in nfp_nfd3_xsk_tx_xdp()
34 txbuf = &tx_ring->txbufs[wr_idx]; in nfp_nfd3_xsk_tx_xdp()
40 txd = &tx_ring->txds[wr_idx]; in nfp_nfd3_xsk_tx_xdp()
339 u32 pkts = 0, wr_idx; in nfp_nfd3_xsk_tx() local
352 wr_idx = D_IDX(tx_ring, tx_ring->wr_p + i); in nfp_nfd3_xsk_tx()
353 prefetchw(&tx_ring->txds[wr_idx]); in nfp_nfd3_xsk_tx()
360 wr_idx = D_IDX(tx_ring, tx_ring->wr_p + i); in nfp_nfd3_xsk_tx()
362 tx_ring->txbufs[wr_idx].real_len = desc[i].len; in nfp_nfd3_xsk_tx()
363 tx_ring->txbufs[wr_idx].is_xsk_tx = false; in nfp_nfd3_xsk_tx()
[all …]
/linux-6.1.9/drivers/net/ethernet/netronome/nfp/nfdk/
Ddp.c122 unsigned int wr_idx; in nfp_nfdk_tx_maybe_close_block() local
160 wr_idx = D_IDX(tx_ring, wr_p); in nfp_nfdk_tx_maybe_close_block()
161 tx_ring->ktxbufs[wr_idx].skb = NULL; in nfp_nfdk_tx_maybe_close_block()
162 txd = &tx_ring->ktxds[wr_idx]; in nfp_nfdk_tx_maybe_close_block()
244 int nr_frags, wr_idx; in nfp_nfdk_tx() local
278 wr_idx = D_IDX(tx_ring, tx_ring->wr_p); in nfp_nfdk_tx()
279 txd = &tx_ring->ktxds[wr_idx]; in nfp_nfdk_tx()
280 txbuf = &tx_ring->ktxbufs[wr_idx]; in nfp_nfdk_tx()
381 cnt = txd - tx_ring->ktxds - wr_idx; in nfp_nfdk_tx()
382 if (unlikely(round_down(wr_idx, NFDK_TX_DESC_BLOCK_CNT) != in nfp_nfdk_tx()
[all …]
/linux-6.1.9/drivers/net/ethernet/netronome/nfp/
Dnfp_net_xsk.c61 unsigned int wr_idx, wr_ptr_add = 0; in nfp_net_xsk_rx_ring_fill_freelist() local
65 wr_idx = D_IDX(rx_ring, rx_ring->wr_p); in nfp_net_xsk_rx_ring_fill_freelist()
71 nfp_net_xsk_rx_bufs_stash(rx_ring, wr_idx, xdp); in nfp_net_xsk_rx_ring_fill_freelist()
77 nfp_desc_set_dma_addr_48b(&rx_ring->rxds[wr_idx].fld, in nfp_net_xsk_rx_ring_fill_freelist()
78 rx_ring->xsk_rxbufs[wr_idx].dma_addr); in nfp_net_xsk_rx_ring_fill_freelist()
Dnfp_net_dp.c97 unsigned int wr_idx, last_idx; in nfp_net_rx_ring_reset() local
106 wr_idx = D_IDX(rx_ring, rx_ring->wr_p); in nfp_net_rx_ring_reset()
109 rx_ring->xsk_rxbufs[wr_idx] = rx_ring->xsk_rxbufs[last_idx]; in nfp_net_rx_ring_reset()
113 rx_ring->rxbufs[wr_idx] = rx_ring->rxbufs[last_idx]; in nfp_net_rx_ring_reset()
/linux-6.1.9/drivers/misc/bcm-vk/
Dbcm_vk_msg.c90 u32 wr_idx, rd_idx; in msgq_occupied() local
92 wr_idx = readl_relaxed(&msgq->wr_idx); in msgq_occupied()
95 return ((wr_idx - rd_idx) & qinfo->q_mask); in msgq_occupied()
488 readl_relaxed(&msgq->wr_idx), in bcm_vk_sync_msgq()
603 u32 wr_idx; /* local copy */ in bcm_to_v_msg_enqueue() local
642 wr_idx = readl_relaxed(&msgq->wr_idx); in bcm_to_v_msg_enqueue()
644 if (wr_idx >= qinfo->q_size) { in bcm_to_v_msg_enqueue()
646 wr_idx, qinfo->q_size); in bcm_to_v_msg_enqueue()
652 dst = msgq_blk_addr(qinfo, wr_idx); in bcm_to_v_msg_enqueue()
657 wr_idx = msgq_inc(qinfo, wr_idx, 1); in bcm_to_v_msg_enqueue()
[all …]
Dbcm_vk_msg.h19 u32 wr_idx; /* write idx */ member
Dbcm_vk_dev.c254 log.buf_size, log.mask, log.rd_idx, log.wr_idx); in bcm_vk_dump_peer_log()
263 (log.wr_idx > log_info->mask) || in bcm_vk_dump_peer_log()
270 log.rd_idx, log.wr_idx); in bcm_vk_dump_peer_log()
277 while (log.rd_idx != log.wr_idx) { in bcm_vk_dump_peer_log()
421 (vk->peerlog_info.wr_idx > vk->peerlog_info.mask)) { in bcm_vk_get_card_info()
426 vk->peerlog_info.wr_idx); in bcm_vk_get_card_info()
433 vk->peerlog_info.wr_idx); in bcm_vk_get_card_info()
Dbcm_vk.h311 u32 wr_idx; member
/linux-6.1.9/drivers/net/ethernet/cavium/liquidio/
Docteon_console.c738 u32 wr_idx, in octeon_console_free_bytes() argument
741 if (rd_idx >= buffer_size || wr_idx >= buffer_size) in octeon_console_free_bytes()
744 return ((buffer_size - 1) - (wr_idx - rd_idx)) % buffer_size; in octeon_console_free_bytes()
748 u32 wr_idx, in octeon_console_avail_bytes() argument
751 if (rd_idx >= buffer_size || wr_idx >= buffer_size) in octeon_console_avail_bytes()
755 octeon_console_free_bytes(buffer_size, wr_idx, rd_idx); in octeon_console_avail_bytes()
762 u32 rd_idx, wr_idx; in octeon_console_read() local
778 wr_idx = octeon_read_device_mem32(oct, console->addr + in octeon_console_read()
782 wr_idx, rd_idx); in octeon_console_read()
/linux-6.1.9/drivers/media/platform/qcom/venus/
Dhfi_venus.c169 u32 empty_space, rd_idx, wr_idx, qsize; in venus_write_queue() local
186 wr_idx = qhdr->write_idx; in venus_write_queue()
191 if (wr_idx >= rd_idx) in venus_write_queue()
192 empty_space = qsize - (wr_idx - rd_idx); in venus_write_queue()
194 empty_space = rd_idx - wr_idx; in venus_write_queue()
207 new_wr_idx = wr_idx + dwords; in venus_write_queue()
208 wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx << 2)); in venus_write_queue()
237 u32 rd_idx, wr_idx, type, qsize; in venus_read_queue() local
251 wr_idx = qhdr->write_idx; in venus_read_queue()
267 if (rd_idx == wr_idx) { in venus_read_queue()
[all …]
/linux-6.1.9/drivers/media/radio/wl128x/
Dfmdrv_common.c795 memcpy(&rds->buff[rds->wr_idx], &tmpbuf, FM_RDS_BLK_SIZE); in fm_irq_handle_rdsdata_getcmd_resp()
796 rds->wr_idx = (rds->wr_idx + FM_RDS_BLK_SIZE) % rds->buf_size; in fm_irq_handle_rdsdata_getcmd_resp()
799 if (rds->wr_idx == rds->rd_idx) { in fm_irq_handle_rdsdata_getcmd_resp()
801 rds->wr_idx = 0; in fm_irq_handle_rdsdata_getcmd_resp()
811 if (rds->wr_idx != rds->rd_idx) in fm_irq_handle_rdsdata_getcmd_resp()
1054 if (fmdev->rx.rds.rd_idx != fmdev->rx.rds.wr_idx) in fmc_is_rds_data_available()
1069 if (fmdev->rx.rds.wr_idx == fmdev->rx.rds.rd_idx) { in fmc_transfer_rds_from_internal_buff()
1074 (fmdev->rx.rds.wr_idx != fmdev->rx.rds.rd_idx)); in fmc_transfer_rds_from_internal_buff()
1087 if (fmdev->rx.rds.wr_idx == fmdev->rx.rds.rd_idx) { in fmc_transfer_rds_from_internal_buff()
Dfmdrv.h117 u32 wr_idx; member
Dfmdrv_rx.c19 fmdev->rx.rds.wr_idx = 0; in fm_rx_reset_rds_cache()
722 fmdev->rx.rds.wr_idx = 0; in fm_rx_set_rds_mode()
/linux-6.1.9/drivers/net/ethernet/marvell/prestera/
Dprestera_pci.c99 u32 wr_idx; member
177 #define PRESTERA_EVTQ_WR_IDX_REG(q) PRESTERA_EVTQ_REG_OFFSET(q, wr_idx)
238 u32 wr_idx = prestera_fw_read(fw, PRESTERA_EVTQ_WR_IDX_REG(qid)); in prestera_fw_evtq_avail() local
241 return CIRC_CNT(wr_idx, rd_idx, prestera_fw_evtq_len(fw, qid)); in prestera_fw_evtq_avail()
538 u32 wr_idx = fw->ldr_wr_idx; in prestera_ldr_wait_buf() local
542 CIRC_SPACE(wr_idx, rd_idx, buf_len) >= len, in prestera_ldr_wait_buf()
/linux-6.1.9/drivers/net/wwan/t7xx/
Dt7xx_hif_dpmaif.c43 unsigned int wr_idx, enum dpmaif_rdwr rd_wr) in t7xx_ring_buf_rd_wr_count() argument
48 pkt_cnt = wr_idx - rd_idx; in t7xx_ring_buf_rd_wr_count()
50 pkt_cnt = rd_idx - wr_idx - 1; in t7xx_ring_buf_rd_wr_count()
Dt7xx_hif_dpmaif.h204 unsigned int wr_idx, enum dpmaif_rdwr);
Dt7xx_dpmaif.c1189 unsigned int wr_idx, rd_idx; in t7xx_dpmaif_hw_stop_all_rxq() local
1204 wr_idx = ioread32(hw_info->pcie_base + DPMAIF_AO_DL_PIT_WR_IDX); in t7xx_dpmaif_hw_stop_all_rxq()
1205 wr_idx &= DPMAIF_DL_RD_WR_IDX_MSK; in t7xx_dpmaif_hw_stop_all_rxq()
1209 if (wr_idx == rd_idx) in t7xx_dpmaif_hw_stop_all_rxq()
/linux-6.1.9/drivers/media/pci/ivtv/
Divtv-fileops.c163 u32 wr_idx = (read_enc(itv->pgm_info_offset) - itv->pgm_info_offset - 4) / 24; in ivtv_update_pgm_info() local
167 if (wr_idx >= itv->pgm_info_num) { in ivtv_update_pgm_info()
168 IVTV_DEBUG_WARN("Invalid PGM index %d (>= %d)\n", wr_idx, itv->pgm_info_num); in ivtv_update_pgm_info()
171 cnt = (wr_idx + itv->pgm_info_num - itv->pgm_info_write_idx) % itv->pgm_info_num; in ivtv_update_pgm_info()