mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
rpmsg: virtio_rpmsg_bus: Rename rbufs and sbufs
rename variables with clear names. %s/rbufs/rx_bufs/ %s/sbufs/tx_bufs/ %s/last_sbuf/last_tx_buf/ Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20260828145853.2843486-2-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
parent
6c4fbf1ce4
commit
92619efc92
|
|
@ -35,13 +35,13 @@
|
|||
* @vdev: the virtio device
|
||||
* @rvq: rx virtqueue
|
||||
* @svq: tx virtqueue
|
||||
* @rbufs: kernel address of rx buffers
|
||||
* @sbufs: kernel address of tx buffers
|
||||
* @num_bufs: total number of buffers for rx and tx
|
||||
* @rx_bufs: kernel address of rx buffers
|
||||
* @tx_bufs: kernel address of tx buffers
|
||||
* @num_bufs: total number of buffers for rx and tx
|
||||
* @buf_size: size of one rx or tx buffer
|
||||
* @last_sbuf: index of last tx buffer used
|
||||
* @last_tx_buf: index of last tx buffer used
|
||||
* @bufs_dma: dma base addr of the buffers
|
||||
* @tx_lock: protects svq and sbufs, to allow concurrent senders.
|
||||
* @tx_lock: protects svq and tx_bufs, to allow concurrent senders.
|
||||
* sending a message might require waking up a dozing remote
|
||||
* processor, which involves sleeping, hence the mutex.
|
||||
* @endpoints: idr of local endpoints, allows fast retrieval
|
||||
|
|
@ -55,10 +55,10 @@
|
|||
struct virtproc_info {
|
||||
struct virtio_device *vdev;
|
||||
struct virtqueue *rvq, *svq;
|
||||
void *rbufs, *sbufs;
|
||||
void *rx_bufs, *tx_bufs;
|
||||
unsigned int num_bufs;
|
||||
unsigned int buf_size;
|
||||
int last_sbuf;
|
||||
int last_tx_buf;
|
||||
dma_addr_t bufs_dma;
|
||||
struct mutex tx_lock;
|
||||
struct idr endpoints;
|
||||
|
|
@ -443,8 +443,8 @@ static void *get_a_tx_buf(struct virtproc_info *vrp)
|
|||
* either pick the next unused tx buffer
|
||||
* (half of our buffers are used for sending messages)
|
||||
*/
|
||||
if (vrp->last_sbuf < vrp->num_bufs / 2)
|
||||
ret = vrp->sbufs + vrp->buf_size * vrp->last_sbuf++;
|
||||
if (vrp->last_tx_buf < vrp->num_bufs / 2)
|
||||
ret = vrp->tx_bufs + vrp->buf_size * vrp->last_tx_buf++;
|
||||
/* or recycle a used one */
|
||||
else
|
||||
ret = virtqueue_get_buf(vrp->svq, &len);
|
||||
|
|
@ -634,7 +634,7 @@ static __poll_t virtio_rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
|
|||
* allocated buffers are used for transmit, hence num_bufs / 2), or,
|
||||
* - we ask the virtqueue if there's a buffer available
|
||||
*/
|
||||
if (vrp->last_sbuf < vrp->num_bufs / 2 ||
|
||||
if (vrp->last_tx_buf < vrp->num_bufs / 2 ||
|
||||
!virtqueue_enable_cb(vrp->svq))
|
||||
mask |= EPOLLOUT;
|
||||
|
||||
|
|
@ -872,15 +872,15 @@ static int rpmsg_probe(struct virtio_device *vdev)
|
|||
bufs_va, &vrp->bufs_dma);
|
||||
|
||||
/* half of the buffers is dedicated for RX */
|
||||
vrp->rbufs = bufs_va;
|
||||
vrp->rx_bufs = bufs_va;
|
||||
|
||||
/* and half is dedicated for TX */
|
||||
vrp->sbufs = bufs_va + total_buf_space / 2;
|
||||
vrp->tx_bufs = bufs_va + total_buf_space / 2;
|
||||
|
||||
/* set up the receive buffers */
|
||||
for (i = 0; i < vrp->num_bufs / 2; i++) {
|
||||
struct scatterlist sg;
|
||||
void *cpu_addr = vrp->rbufs + i * vrp->buf_size;
|
||||
void *cpu_addr = vrp->rx_bufs + i * vrp->buf_size;
|
||||
|
||||
rpmsg_sg_init(&sg, cpu_addr, vrp->buf_size);
|
||||
|
||||
|
|
@ -979,7 +979,7 @@ static void rpmsg_remove(struct virtio_device *vdev)
|
|||
vdev->config->del_vqs(vrp->vdev);
|
||||
|
||||
dma_free_coherent(vdev->dev.parent, total_buf_space,
|
||||
vrp->rbufs, vrp->bufs_dma);
|
||||
vrp->rx_bufs, vrp->bufs_dma);
|
||||
|
||||
kfree(vrp);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user