| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 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> | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 25 | #include <linux/virtio_types.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 32 | #define VIRTIO_BLK_F_TOPOLOGY 10 | 
|  | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
|  | 34 | #define VIRTIO_BLK_F_MQ 12 | 
|  | 35 | #ifndef VIRTIO_BLK_NO_LEGACY | 
|  | 36 | #define VIRTIO_BLK_F_BARRIER 0 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 37 | #define VIRTIO_BLK_F_SCSI 7 | 
|  | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
|  | 39 | #define VIRTIO_BLK_F_WCE 9 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #define VIRTIO_BLK_F_CONFIG_WCE 11 | 
| Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 41 | #define VIRTIO_BLK_F_FLUSH VIRTIO_BLK_F_WCE | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 42 | #endif | 
|  | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #define VIRTIO_BLK_ID_BYTES 20 | 
|  | 45 | struct virtio_blk_config { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | __u64 capacity; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | __u32 size_max; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 49 | __u32 seg_max; | 
|  | 50 | struct virtio_blk_geometry { | 
|  | 51 | __u16 cylinders; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | __u8 heads; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | __u8 sectors; | 
|  | 55 | } geometry; | 
|  | 56 | __u32 blk_size; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 57 | __u8 physical_block_exp; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | __u8 alignment_offset; | 
|  | 60 | __u16 min_io_size; | 
|  | 61 | __u32 opt_io_size; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 62 | __u8 wce; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | __u8 unused; | 
|  | 65 | __u16 num_queues; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 66 | } __attribute__((packed)); | 
|  | 67 | #define VIRTIO_BLK_T_IN 0 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #define VIRTIO_BLK_T_OUT 1 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 70 | #ifndef VIRTIO_BLK_NO_LEGACY | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 72 | #endif | 
|  | 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 74 | #define VIRTIO_BLK_T_FLUSH 4 | 
|  | 75 | #define VIRTIO_BLK_T_GET_ID 8 | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 76 | #ifndef VIRTIO_BLK_NO_LEGACY | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 
| Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 79 | #endif | 
|  | 80 | struct virtio_blk_outhdr { | 
|  | 81 | __virtio32 type; | 
|  | 82 | __virtio32 ioprio; | 
|  | 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
|  | 84 | __virtio64 sector; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | }; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 86 | #ifndef VIRTIO_BLK_NO_LEGACY | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | struct virtio_scsi_inhdr { | 
| Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 89 | __virtio32 errors; | 
|  | 90 | __virtio32 data_len; | 
|  | 91 | __virtio32 sense_len; | 
|  | 92 | __virtio32 residual; | 
| Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | }; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 95 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | #define VIRTIO_BLK_S_OK 0 | 
|  | 97 | #define VIRTIO_BLK_S_IOERR 1 | 
| Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 99 | #define VIRTIO_BLK_S_UNSUPP 2 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | #endif |