| .. | .. |
|---|
| 9 | 9 | #include <linux/device.h> |
|---|
| 10 | 10 | #include <linux/mod_devicetable.h> |
|---|
| 11 | 11 | #include <linux/gfp.h> |
|---|
| 12 | | -#include <linux/vringh.h> |
|---|
| 13 | 12 | |
|---|
| 14 | 13 | /** |
|---|
| 15 | 14 | * virtqueue - a queue to register buffers for sending or receiving. |
|---|
| .. | .. |
|---|
| 90 | 89 | dma_addr_t virtqueue_get_avail_addr(struct virtqueue *vq); |
|---|
| 91 | 90 | dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq); |
|---|
| 92 | 91 | |
|---|
| 93 | | -/* |
|---|
| 94 | | - * Legacy accessors -- in almost all cases, these are the wrong functions |
|---|
| 95 | | - * to use. |
|---|
| 96 | | - */ |
|---|
| 97 | | -static inline void *virtqueue_get_desc(struct virtqueue *vq) |
|---|
| 98 | | -{ |
|---|
| 99 | | - return virtqueue_get_vring(vq)->desc; |
|---|
| 100 | | -} |
|---|
| 101 | | -static inline void *virtqueue_get_avail(struct virtqueue *vq) |
|---|
| 102 | | -{ |
|---|
| 103 | | - return virtqueue_get_vring(vq)->avail; |
|---|
| 104 | | -} |
|---|
| 105 | | -static inline void *virtqueue_get_used(struct virtqueue *vq) |
|---|
| 106 | | -{ |
|---|
| 107 | | - return virtqueue_get_vring(vq)->used; |
|---|
| 108 | | -} |
|---|
| 109 | | - |
|---|
| 110 | 92 | /** |
|---|
| 111 | 93 | * virtio_device - representation of a device using virtio |
|---|
| 112 | 94 | * @index: unique position on the virtio bus |
|---|
| .. | .. |
|---|
| 145 | 127 | void virtio_add_status(struct virtio_device *dev, unsigned int status); |
|---|
| 146 | 128 | int register_virtio_device(struct virtio_device *dev); |
|---|
| 147 | 129 | void unregister_virtio_device(struct virtio_device *dev); |
|---|
| 130 | +bool is_virtio_device(struct device *dev); |
|---|
| 148 | 131 | |
|---|
| 149 | 132 | void virtio_break_device(struct virtio_device *dev); |
|---|
| 150 | 133 | |
|---|
| 151 | 134 | void virtio_config_changed(struct virtio_device *dev); |
|---|
| 152 | 135 | void virtio_config_disable(struct virtio_device *dev); |
|---|
| 153 | 136 | void virtio_config_enable(struct virtio_device *dev); |
|---|
| 154 | | -int virtio_finalize_features(struct virtio_device *dev); |
|---|
| 155 | 137 | #ifdef CONFIG_PM_SLEEP |
|---|
| 156 | 138 | int virtio_device_freeze(struct virtio_device *dev); |
|---|
| 157 | 139 | int virtio_device_restore(struct virtio_device *dev); |
|---|
| 158 | 140 | #endif |
|---|
| 159 | 141 | |
|---|
| 142 | +size_t virtio_max_dma_size(struct virtio_device *vdev); |
|---|
| 143 | + |
|---|
| 160 | 144 | #define virtio_device_for_each_vq(vdev, vq) \ |
|---|
| 161 | 145 | list_for_each_entry(vq, &vdev->vqs, list) |
|---|
| 162 | 146 | |
|---|