Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: lguest: notify on empty virtio: force callback on empty. virtio_blk: fix endianess annotations virtio_config: fix len calculation of config elements virtio_net: another race with virtio_net and enable_cb virtio: An entropy device, as suggested by hpa. virtio_blk: allow read-only disks lguest: fix ugly <NULL> in /proc/interrupts virtio: set device index in common code. virtio: virtio_pci should not set bus_id. virtio: bus_id for devices should contain 'virtio' Fix crash in virtio_blk during modprobe ; rmmod ; modprobe lguest: use ioremap_cache, not ioremap
This commit is contained in:
@@ -10,18 +10,19 @@
|
||||
#define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */
|
||||
#define VIRTIO_BLK_F_SEG_MAX 2 /* Indicates maximum # of segments */
|
||||
#define VIRTIO_BLK_F_GEOMETRY 4 /* Legacy geometry available */
|
||||
#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */
|
||||
|
||||
struct virtio_blk_config
|
||||
{
|
||||
/* The capacity (in 512-byte sectors). */
|
||||
__le64 capacity;
|
||||
__u64 capacity;
|
||||
/* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
|
||||
__le32 size_max;
|
||||
__u32 size_max;
|
||||
/* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
|
||||
__le32 seg_max;
|
||||
__u32 seg_max;
|
||||
/* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
|
||||
struct virtio_blk_geometry {
|
||||
__le16 cylinders;
|
||||
__u16 cylinders;
|
||||
__u8 heads;
|
||||
__u8 sectors;
|
||||
} geometry;
|
||||
|
@@ -15,6 +15,10 @@
|
||||
/* We've given up on this device. */
|
||||
#define VIRTIO_CONFIG_S_FAILED 0x80
|
||||
|
||||
/* Do we get callbacks when the ring is completely used, even if we've
|
||||
* suppressed them? */
|
||||
#define VIRTIO_F_NOTIFY_ON_EMPTY 24
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/virtio.h>
|
||||
|
||||
@@ -99,7 +103,7 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
|
||||
* The return value is -ENOENT if the feature doesn't exist. Otherwise
|
||||
* the config value is copied into whatever is pointed to by v. */
|
||||
#define virtio_config_val(vdev, fbit, offset, v) \
|
||||
virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(v))
|
||||
virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))
|
||||
|
||||
static inline int virtio_config_buf(struct virtio_device *vdev,
|
||||
unsigned int fbit,
|
||||
|
8
include/linux/virtio_rng.h
Normal file
8
include/linux/virtio_rng.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _LINUX_VIRTIO_RNG_H
|
||||
#define _LINUX_VIRTIO_RNG_H
|
||||
#include <linux/virtio_config.h>
|
||||
|
||||
/* The ID for virtio_rng */
|
||||
#define VIRTIO_ID_RNG 4
|
||||
|
||||
#endif /* _LINUX_VIRTIO_RNG_H */
|
Reference in New Issue
Block a user