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_SCSI_H 20 #define _LINUX_VIRTIO_SCSI_H 21 #include <linux/virtio_types.h> 22 #define VIRTIO_SCSI_CDB_DEFAULT_SIZE 32 23 #define VIRTIO_SCSI_SENSE_DEFAULT_SIZE 96 24 #ifndef VIRTIO_SCSI_CDB_SIZE 25 #define VIRTIO_SCSI_CDB_SIZE VIRTIO_SCSI_CDB_DEFAULT_SIZE 26 #endif 27 #ifndef VIRTIO_SCSI_SENSE_SIZE 28 #define VIRTIO_SCSI_SENSE_SIZE VIRTIO_SCSI_SENSE_DEFAULT_SIZE 29 #endif 30 struct virtio_scsi_cmd_req { 31 __u8 lun[8]; 32 __virtio64 tag; 33 __u8 task_attr; 34 __u8 prio; 35 __u8 crn; 36 __u8 cdb[VIRTIO_SCSI_CDB_SIZE]; 37 } __attribute__((packed)); 38 struct virtio_scsi_cmd_req_pi { 39 __u8 lun[8]; 40 __virtio64 tag; 41 __u8 task_attr; 42 __u8 prio; 43 __u8 crn; 44 __virtio32 pi_bytesout; 45 __virtio32 pi_bytesin; 46 __u8 cdb[VIRTIO_SCSI_CDB_SIZE]; 47 } __attribute__((packed)); 48 struct virtio_scsi_cmd_resp { 49 __virtio32 sense_len; 50 __virtio32 resid; 51 __virtio16 status_qualifier; 52 __u8 status; 53 __u8 response; 54 __u8 sense[VIRTIO_SCSI_SENSE_SIZE]; 55 } __attribute__((packed)); 56 struct virtio_scsi_ctrl_tmf_req { 57 __virtio32 type; 58 __virtio32 subtype; 59 __u8 lun[8]; 60 __virtio64 tag; 61 } __attribute__((packed)); 62 struct virtio_scsi_ctrl_tmf_resp { 63 __u8 response; 64 } __attribute__((packed)); 65 struct virtio_scsi_ctrl_an_req { 66 __virtio32 type; 67 __u8 lun[8]; 68 __virtio32 event_requested; 69 } __attribute__((packed)); 70 struct virtio_scsi_ctrl_an_resp { 71 __virtio32 event_actual; 72 __u8 response; 73 } __attribute__((packed)); 74 struct virtio_scsi_event { 75 __virtio32 event; 76 __u8 lun[8]; 77 __virtio32 reason; 78 } __attribute__((packed)); 79 struct virtio_scsi_config { 80 __u32 num_queues; 81 __u32 seg_max; 82 __u32 max_sectors; 83 __u32 cmd_per_lun; 84 __u32 event_info_size; 85 __u32 sense_size; 86 __u32 cdb_size; 87 __u16 max_channel; 88 __u16 max_target; 89 __u32 max_lun; 90 } __attribute__((packed)); 91 #define VIRTIO_SCSI_F_INOUT 0 92 #define VIRTIO_SCSI_F_HOTPLUG 1 93 #define VIRTIO_SCSI_F_CHANGE 2 94 #define VIRTIO_SCSI_F_T10_PI 3 95 #define VIRTIO_SCSI_S_OK 0 96 #define VIRTIO_SCSI_S_OVERRUN 1 97 #define VIRTIO_SCSI_S_ABORTED 2 98 #define VIRTIO_SCSI_S_BAD_TARGET 3 99 #define VIRTIO_SCSI_S_RESET 4 100 #define VIRTIO_SCSI_S_BUSY 5 101 #define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6 102 #define VIRTIO_SCSI_S_TARGET_FAILURE 7 103 #define VIRTIO_SCSI_S_NEXUS_FAILURE 8 104 #define VIRTIO_SCSI_S_FAILURE 9 105 #define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10 106 #define VIRTIO_SCSI_S_FUNCTION_REJECTED 11 107 #define VIRTIO_SCSI_S_INCORRECT_LUN 12 108 #define VIRTIO_SCSI_T_TMF 0 109 #define VIRTIO_SCSI_T_AN_QUERY 1 110 #define VIRTIO_SCSI_T_AN_SUBSCRIBE 2 111 #define VIRTIO_SCSI_T_TMF_ABORT_TASK 0 112 #define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1 113 #define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2 114 #define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3 115 #define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4 116 #define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5 117 #define VIRTIO_SCSI_T_TMF_QUERY_TASK 6 118 #define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7 119 #define VIRTIO_SCSI_T_EVENTS_MISSED 0x80000000 120 #define VIRTIO_SCSI_T_NO_EVENT 0 121 #define VIRTIO_SCSI_T_TRANSPORT_RESET 1 122 #define VIRTIO_SCSI_T_ASYNC_NOTIFY 2 123 #define VIRTIO_SCSI_T_PARAM_CHANGE 3 124 #define VIRTIO_SCSI_EVT_RESET_HARD 0 125 #define VIRTIO_SCSI_EVT_RESET_RESCAN 1 126 #define VIRTIO_SCSI_EVT_RESET_REMOVED 2 127 #define VIRTIO_SCSI_S_SIMPLE 0 128 #define VIRTIO_SCSI_S_ORDERED 1 129 #define VIRTIO_SCSI_S_HEAD 2 130 #define VIRTIO_SCSI_S_ACA 3 131 #endif 132