blob: b6a22d0ce24f48d11ca934f834bd2bdffe7c75b3 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_VIRTIO_BLK_H
20#define _LINUX_VIRTIO_BLK_H
21#include <linux/types.h>
22#include <linux/virtio_ids.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <linux/virtio_config.h>
25#define VIRTIO_BLK_F_BARRIER 0
26#define VIRTIO_BLK_F_SIZE_MAX 1
27#define VIRTIO_BLK_F_SEG_MAX 2
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define VIRTIO_BLK_F_GEOMETRY 4
30#define VIRTIO_BLK_F_RO 5
31#define VIRTIO_BLK_F_BLK_SIZE 6
32#define VIRTIO_BLK_F_SCSI 7
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define VIRTIO_BLK_F_WCE 9
35#define VIRTIO_BLK_F_TOPOLOGY 10
36#define VIRTIO_BLK_F_CONFIG_WCE 11
Christopher Ferris82d75042015-01-26 10:57:07 -080037#define VIRTIO_BLK_F_MQ 12
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -080039#define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define VIRTIO_BLK_ID_BYTES 20
41struct virtio_blk_config {
Tao Baod7db5942015-01-28 10:07:51 -080042 __u64 capacity;
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 __u32 size_max;
45 __u32 seg_max;
46 struct virtio_blk_geometry {
47 __u16 cylinders;
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 __u8 heads;
50 __u8 sectors;
51 } geometry;
52 __u32 blk_size;
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 __u8 physical_block_exp;
55 __u8 alignment_offset;
56 __u16 min_io_size;
57 __u32 opt_io_size;
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 __u8 wce;
60 __u8 unused;
61 __u16 num_queues;
Ben Cheng655a7c02013-10-16 16:09:24 -070062} __attribute__((packed));
Christopher Ferris82d75042015-01-26 10:57:07 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define VIRTIO_BLK_T_IN 0
65#define VIRTIO_BLK_T_OUT 1
66#define VIRTIO_BLK_T_SCSI_CMD 2
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define VIRTIO_BLK_T_FLUSH 4
Christopher Ferris82d75042015-01-26 10:57:07 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define VIRTIO_BLK_T_GET_ID 8
70#define VIRTIO_BLK_T_BARRIER 0x80000000
71struct virtio_blk_outhdr {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 type;
Christopher Ferris82d75042015-01-26 10:57:07 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074 __u32 ioprio;
75 __u64 sector;
Ben Cheng655a7c02013-10-16 16:09:24 -070076};
Ben Cheng655a7c02013-10-16 16:09:24 -070077struct virtio_scsi_inhdr {
Christopher Ferris82d75042015-01-26 10:57:07 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 __u32 errors;
80 __u32 data_len;
81 __u32 sense_len;
82 __u32 residual;
Christopher Ferris82d75042015-01-26 10:57:07 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070084};
85#define VIRTIO_BLK_S_OK 0
86#define VIRTIO_BLK_S_IOERR 1
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define VIRTIO_BLK_S_UNSUPP 2
Christopher Ferris82d75042015-01-26 10:57:07 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070089#endif