Lines Matching +full:solid +full:- +full:state

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2022-2023 SolidRun
7 * Author: Alvaro Karsz <alvaro.karsz@solid-run.com>
29 #define SNET_VAL_TO_ERR(val) (-(((val) & SNET_CTRL_ERROR_MASK) >> 18))
64 return snet->bar + snet->psnet->cfg.ctrl_off; in snet_get_ctrl()
71 return readx_poll_timeout(ioread32, &regs->ctrl, val, SNET_EMPTY_CTRL(val), 10, in snet_wait_for_empty_ctrl()
79 return readx_poll_timeout(ioread32, &regs->op, val, !val, 10, SNET_CTRL_TIMEOUT); in snet_wait_for_empty_op()
86 return readx_poll_timeout(ioread32, &regs->ctrl, val, SNET_DATA_READY(val), 10, in snet_wait_for_data()
92 return ioread32(&ctrl_regs->data[word_idx]); in snet_read32_word()
97 return ioread32(&ctrl_regs->ctrl); in snet_read_ctrl()
102 iowrite32(val, &ctrl_regs->ctrl); in snet_write_ctrl()
107 iowrite32(val, &ctrl_regs->op); in snet_write_op()
135 struct pci_dev *pdev = snet->pdev; in snet_ctrl_read_from_dpu()
145 return -EOPNOTSUPP; in snet_ctrl_read_from_dpu()
148 return -EINVAL; in snet_ctrl_read_from_dpu()
150 mutex_lock(&snet->ctrl_lock); in snet_ctrl_read_from_dpu()
165 spin_lock(&snet->ctrl_spinlock); in snet_ctrl_read_from_dpu()
170 spin_unlock(&snet->ctrl_spinlock); in snet_ctrl_read_from_dpu()
188 words = min_t(u16, val & SNET_CTRL_DATA_SIZE_MASK, buf_words - tot_words); in snet_ctrl_read_from_dpu()
211 mutex_unlock(&snet->ctrl_lock); in snet_ctrl_read_from_dpu()
220 struct pci_dev *pdev = snet->pdev; in snet_send_ctrl_msg_old()
224 mutex_lock(&snet->ctrl_lock); in snet_send_ctrl_msg_old()
245 mutex_unlock(&snet->ctrl_lock); in snet_send_ctrl_msg_old()
254 struct pci_dev *pdev = snet->pdev; in snet_send_ctrl_msg()
263 mutex_lock(&snet->ctrl_lock); in snet_send_ctrl_msg()
276 spin_lock(&snet->ctrl_spinlock); in snet_send_ctrl_msg()
281 spin_unlock(&snet->ctrl_spinlock); in snet_send_ctrl_msg()
306 mutex_unlock(&snet->ctrl_lock); in snet_send_ctrl_msg()
322 int snet_read_vq_state(struct snet *snet, u16 idx, struct vdpa_vq_state *state) in snet_read_vq_state() argument
324 return snet_ctrl_read_from_dpu(snet, SNET_CTRL_OP_READ_VQ_STATE, idx, state, in snet_read_vq_state()
325 sizeof(*state)); in snet_read_vq_state()