Skip to content

Commit

Permalink
caif_virtio: Introduce caif over virtio
Browse files Browse the repository at this point in the history
Add the CAIF Virtio shared memory driver for talking
to a modem.

This CAIF Link layer communicates to the modem over
shared memory. It is implemented as a virtio_driver.
The underlying virtio device is managed by the remoteproc
framework. The Virtio queue is used for transmitting data
to the modem, and the new vringh is used for receiving data.

Genalloc is used for managing the shared memory used for TX
data. The default dma-alloc-coherent allocator can only
allocate whole pages, and this wastes too much shared memory.

Flow control is implemented by stopping the TX-queues if the
virtio queues go full or we run out of memory. Queued are
reopened when queues are below the watermark.

NAPI is used in RX path, and a dedicated tasklet is used
for releasing TX buffers.

Signed-off-by: Erwan Yvin <erwan.yvin@stericsson.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor fixes)
  • Loading branch information
Erwan Yvin authored and Rusty Russell committed Mar 20, 2013
1 parent 3beee86 commit 0d2e1a2
Show file tree
Hide file tree
Showing 5 changed files with 827 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/net/caif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ config CAIF_HSI
The caif low level driver for CAIF over HSI.
Be aware that if you enable this then you also need to
enable a low-level HSI driver.

config CAIF_VIRTIO
tristate "CAIF virtio transport driver"
depends on CAIF
select VHOST_RING
select VIRTIO
select GENERIC_ALLOCATOR
default n
---help---
The caif driver for CAIF over Virtio.

if CAIF_VIRTIO
source "drivers/vhost/Kconfig"
endif
3 changes: 3 additions & 0 deletions drivers/net/caif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ obj-$(CONFIG_CAIF_SHM) += caif_shm.o

# HSI interface
obj-$(CONFIG_CAIF_HSI) += caif_hsi.o

# Virtio interface
obj-$(CONFIG_CAIF_VIRTIO) += caif_virtio.o
Loading

0 comments on commit 0d2e1a2

Please sign in to comment.