diff options
Diffstat (limited to 'include/linux/virtio_config.h')
| -rw-r--r-- | include/linux/virtio_config.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index f364bbf63c34..bf8ec283b232 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | #ifndef _LINUX_VIRTIO_CONFIG_H | 1 | #ifndef _LINUX_VIRTIO_CONFIG_H |
| 2 | #define _LINUX_VIRTIO_CONFIG_H | 2 | #define _LINUX_VIRTIO_CONFIG_H |
| 3 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | ||
| 4 | * anyone can use the definitions to implement compatible drivers/servers. */ | ||
| 5 | |||
| 3 | /* Virtio devices use a standardized configuration space to define their | 6 | /* Virtio devices use a standardized configuration space to define their |
| 4 | * features and pass configuration information, but each implementation can | 7 | * features and pass configuration information, but each implementation can |
| 5 | * store and access that space differently. */ | 8 | * store and access that space differently. */ |
| @@ -15,6 +18,12 @@ | |||
| 15 | /* We've given up on this device. */ | 18 | /* We've given up on this device. */ |
| 16 | #define VIRTIO_CONFIG_S_FAILED 0x80 | 19 | #define VIRTIO_CONFIG_S_FAILED 0x80 |
| 17 | 20 | ||
| 21 | /* Some virtio feature bits (currently bits 28 through 31) are reserved for the | ||
| 22 | * transport being used (eg. virtio_ring), the rest are per-device feature | ||
| 23 | * bits. */ | ||
| 24 | #define VIRTIO_TRANSPORT_F_START 28 | ||
| 25 | #define VIRTIO_TRANSPORT_F_END 32 | ||
| 26 | |||
| 18 | /* Do we get callbacks when the ring is completely used, even if we've | 27 | /* Do we get callbacks when the ring is completely used, even if we've |
| 19 | * suppressed them? */ | 28 | * suppressed them? */ |
| 20 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
| @@ -52,9 +61,10 @@ | |||
| 52 | * @get_features: get the array of feature bits for this device. | 61 | * @get_features: get the array of feature bits for this device. |
| 53 | * vdev: the virtio_device | 62 | * vdev: the virtio_device |
| 54 | * Returns the first 32 feature bits (all we currently need). | 63 | * Returns the first 32 feature bits (all we currently need). |
| 55 | * @set_features: confirm what device features we'll be using. | 64 | * @finalize_features: confirm what device features we'll be using. |
| 56 | * vdev: the virtio_device | 65 | * vdev: the virtio_device |
| 57 | * feature: the first 32 feature bits | 66 | * This gives the final feature bits for the device: it can change |
| 67 | * the dev->feature bits if it wants. | ||
| 58 | */ | 68 | */ |
| 59 | struct virtio_config_ops | 69 | struct virtio_config_ops |
| 60 | { | 70 | { |
| @@ -70,7 +80,7 @@ struct virtio_config_ops | |||
| 70 | void (*callback)(struct virtqueue *)); | 80 | void (*callback)(struct virtqueue *)); |
| 71 | void (*del_vq)(struct virtqueue *vq); | 81 | void (*del_vq)(struct virtqueue *vq); |
| 72 | u32 (*get_features)(struct virtio_device *vdev); | 82 | u32 (*get_features)(struct virtio_device *vdev); |
| 73 | void (*set_features)(struct virtio_device *vdev, u32 features); | 83 | void (*finalize_features)(struct virtio_device *vdev); |
| 74 | }; | 84 | }; |
| 75 | 85 | ||
| 76 | /* If driver didn't advertise the feature, it will never appear. */ | 86 | /* If driver didn't advertise the feature, it will never appear. */ |
