diff options
author | Erwan Yvin <erwan.yvin@stericsson.com> | 2013-03-19 23:22:24 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-03-19 23:36:06 -0400 |
commit | 0d2e1a2926b1839a4b74519e660739b2566c9386 (patch) | |
tree | 29f6397b0f544c60bfdbc8d9ad0aae5337fc7532 /include | |
parent | 3beee86a4b9374e38dba36b44e81f1423a0d6b54 (diff) |
caif_virtio: Introduce caif over virtio
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)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/virtio_caif.h | 24 | ||||
-rw-r--r-- | include/uapi/linux/virtio_ids.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/virtio_caif.h b/include/linux/virtio_caif.h new file mode 100644 index 000000000000..5d2d3124ca3d --- /dev/null +++ b/include/linux/virtio_caif.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson AB 2012 | ||
3 | * Author: Sjur Brændeland <sjur.brandeland@stericsson.com> | ||
4 | * | ||
5 | * This header is BSD licensed so | ||
6 | * anyone can use the definitions to implement compatible remote processors | ||
7 | */ | ||
8 | |||
9 | #ifndef VIRTIO_CAIF_H | ||
10 | #define VIRTIO_CAIF_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | struct virtio_caif_transf_config { | ||
14 | u16 headroom; | ||
15 | u16 tailroom; | ||
16 | u32 mtu; | ||
17 | u8 reserved[4]; | ||
18 | }; | ||
19 | |||
20 | struct virtio_caif_config { | ||
21 | struct virtio_caif_transf_config uplink, downlink; | ||
22 | u8 reserved[8]; | ||
23 | }; | ||
24 | #endif | ||
diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h index a7630d04029f..284fc3a05f7b 100644 --- a/include/uapi/linux/virtio_ids.h +++ b/include/uapi/linux/virtio_ids.h | |||
@@ -38,5 +38,6 @@ | |||
38 | #define VIRTIO_ID_SCSI 8 /* virtio scsi */ | 38 | #define VIRTIO_ID_SCSI 8 /* virtio scsi */ |
39 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ | 39 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ |
40 | #define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */ | 40 | #define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */ |
41 | #define VIRTIO_ID_CAIF 12 /* Virtio caif */ | ||
41 | 42 | ||
42 | #endif /* _LINUX_VIRTIO_IDS_H */ | 43 | #endif /* _LINUX_VIRTIO_IDS_H */ |