diff options
author | Sasha Levin <levinsasha928@gmail.com> | 2011-08-14 10:52:32 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-11-01 21:10:58 -0400 |
commit | 3ead6f4d42e2866a48d7abf9bc98553f1110b6df (patch) | |
tree | db9bcecd8d232b0f3b9fb14589c58a872c400539 /include/linux/virtio_config.h | |
parent | 51c6d61ac58844b5e3e0d28271084c06f6a15371 (diff) |
virtio_config: Add virtio_config_val_len()
This patch adds virtio_config_val_len() which allows retrieving variable
length data from the virtio config space only if a specific feature is on.
Cc: Amit Shah <amit.shah@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux/virtio_config.h')
-rw-r--r-- | include/linux/virtio_config.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 39c88c5ad19d..add4790b21fe 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -155,6 +155,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
155 | #define virtio_config_val(vdev, fbit, offset, v) \ | 155 | #define virtio_config_val(vdev, fbit, offset, v) \ |
156 | virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) | 156 | virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) |
157 | 157 | ||
158 | #define virtio_config_val_len(vdev, fbit, offset, v, len) \ | ||
159 | virtio_config_buf((vdev), (fbit), (offset), (v), (len)) | ||
160 | |||
158 | static inline int virtio_config_buf(struct virtio_device *vdev, | 161 | static inline int virtio_config_buf(struct virtio_device *vdev, |
159 | unsigned int fbit, | 162 | unsigned int fbit, |
160 | unsigned int offset, | 163 | unsigned int offset, |