| 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_HDREG_H | 
|  | 20 | #define _LINUX_HDREG_H | 
|  | 21 | #include <linux/types.h> | 
|  | 22 | #define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8)) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8)) | 
|  | 24 | #define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8)) | 
|  | 25 | #define IDE_DRIVE_TASK_NO_DATA 0 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 26 | #define IDE_DRIVE_TASK_INVALID - 1 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define IDE_DRIVE_TASK_SET_XFER 1 | 
|  | 28 | #define IDE_DRIVE_TASK_IN 2 | 
|  | 29 | #define IDE_DRIVE_TASK_OUT 3 | 
|  | 30 | #define IDE_DRIVE_TASK_RAW_WRITE 4 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define IDE_TASKFILE_STD_IN_FLAGS 0xFE | 
|  | 32 | #define IDE_HOB_STD_IN_FLAGS 0x3C | 
|  | 33 | #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE | 
|  | 34 | #define IDE_HOB_STD_OUT_FLAGS 0x3C | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | typedef unsigned char task_ioreg_t; | 
|  | 36 | typedef unsigned long sata_ioreg_t; | 
|  | 37 | typedef union ide_reg_valid_s { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | unsigned all : 16; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | struct { | 
|  | 40 | unsigned data : 1; | 
|  | 41 | unsigned error_feature : 1; | 
|  | 42 | unsigned sector : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | unsigned nsector : 1; | 
|  | 44 | unsigned lcyl : 1; | 
|  | 45 | unsigned hcyl : 1; | 
|  | 46 | unsigned select : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | unsigned status_command : 1; | 
|  | 48 | unsigned data_hob : 1; | 
|  | 49 | unsigned error_feature_hob : 1; | 
|  | 50 | unsigned sector_hob : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 51 | unsigned nsector_hob : 1; | 
|  | 52 | unsigned lcyl_hob : 1; | 
|  | 53 | unsigned hcyl_hob : 1; | 
|  | 54 | unsigned select_hob : 1; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | unsigned control_hob : 1; | 
|  | 56 | } b; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 57 | } ide_reg_valid_t; | 
|  | 58 | typedef struct ide_task_request_s { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | __u8 io_ports[8]; | 
|  | 60 | __u8 hob_ports[8]; | 
|  | 61 | ide_reg_valid_t out_flags; | 
|  | 62 | ide_reg_valid_t in_flags; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | int data_phase; | 
|  | 64 | int req_cmd; | 
|  | 65 | unsigned long out_size; | 
|  | 66 | unsigned long in_size; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | } ide_task_request_t; | 
|  | 68 | typedef struct ide_ioctl_request_s { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 69 | ide_task_request_t * task_request; | 
|  | 70 | unsigned char * out_buffer; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | unsigned char * in_buffer; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | } ide_ioctl_request_t; | 
|  | 73 | struct hd_drive_cmd_hdr { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | __u8 command; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | __u8 sector_number; | 
|  | 76 | __u8 feature; | 
|  | 77 | __u8 sector_count; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 78 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | typedef struct hd_drive_task_hdr { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | __u8 data; | 
|  | 81 | __u8 feature; | 
|  | 82 | __u8 sector_count; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | __u8 sector_number; | 
|  | 84 | __u8 low_cylinder; | 
|  | 85 | __u8 high_cylinder; | 
|  | 86 | __u8 device_head; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __u8 command; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | } task_struct_t; | 
|  | 89 | typedef struct hd_drive_hob_hdr { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | __u8 data; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | __u8 feature; | 
|  | 92 | __u8 sector_count; | 
|  | 93 | __u8 sector_number; | 
|  | 94 | __u8 low_cylinder; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | __u8 high_cylinder; | 
|  | 96 | __u8 device_head; | 
|  | 97 | __u8 control; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | } hob_struct_t; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | #define TASKFILE_NO_DATA 0x0000 | 
|  | 100 | #define TASKFILE_IN 0x0001 | 
|  | 101 | #define TASKFILE_MULTI_IN 0x0002 | 
|  | 102 | #define TASKFILE_OUT 0x0004 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 103 | #define TASKFILE_MULTI_OUT 0x0008 | 
|  | 104 | #define TASKFILE_IN_OUT 0x0010 | 
|  | 105 | #define TASKFILE_IN_DMA 0x0020 | 
|  | 106 | #define TASKFILE_OUT_DMA 0x0040 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 107 | #define TASKFILE_IN_DMAQ 0x0080 | 
|  | 108 | #define TASKFILE_OUT_DMAQ 0x0100 | 
|  | 109 | #define TASKFILE_P_IN 0x0200 | 
|  | 110 | #define TASKFILE_P_OUT 0x0400 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | #define TASKFILE_P_IN_DMA 0x0800 | 
|  | 112 | #define TASKFILE_P_OUT_DMA 0x1000 | 
|  | 113 | #define TASKFILE_P_IN_DMAQ 0x2000 | 
|  | 114 | #define TASKFILE_P_OUT_DMAQ 0x4000 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | #define TASKFILE_48 0x8000 | 
|  | 116 | #define TASKFILE_INVALID 0x7fff | 
|  | 117 | #define WIN_NOP 0x00 | 
|  | 118 | #define CFA_REQ_EXT_ERROR_CODE 0x03 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 119 | #define WIN_SRST 0x08 | 
|  | 120 | #define WIN_DEVICE_RESET 0x08 | 
|  | 121 | #define WIN_RECAL 0x10 | 
|  | 122 | #define WIN_RESTORE WIN_RECAL | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | #define WIN_READ 0x20 | 
|  | 124 | #define WIN_READ_ONCE 0x21 | 
|  | 125 | #define WIN_READ_LONG 0x22 | 
|  | 126 | #define WIN_READ_LONG_ONCE 0x23 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 127 | #define WIN_READ_EXT 0x24 | 
|  | 128 | #define WIN_READDMA_EXT 0x25 | 
|  | 129 | #define WIN_READDMA_QUEUED_EXT 0x26 | 
|  | 130 | #define WIN_READ_NATIVE_MAX_EXT 0x27 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 131 | #define WIN_MULTREAD_EXT 0x29 | 
|  | 132 | #define WIN_WRITE 0x30 | 
|  | 133 | #define WIN_WRITE_ONCE 0x31 | 
|  | 134 | #define WIN_WRITE_LONG 0x32 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 135 | #define WIN_WRITE_LONG_ONCE 0x33 | 
|  | 136 | #define WIN_WRITE_EXT 0x34 | 
|  | 137 | #define WIN_WRITEDMA_EXT 0x35 | 
|  | 138 | #define WIN_WRITEDMA_QUEUED_EXT 0x36 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 139 | #define WIN_SET_MAX_EXT 0x37 | 
|  | 140 | #define CFA_WRITE_SECT_WO_ERASE 0x38 | 
|  | 141 | #define WIN_MULTWRITE_EXT 0x39 | 
|  | 142 | #define WIN_WRITE_VERIFY 0x3C | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 143 | #define WIN_VERIFY 0x40 | 
|  | 144 | #define WIN_VERIFY_ONCE 0x41 | 
|  | 145 | #define WIN_VERIFY_EXT 0x42 | 
|  | 146 | #define WIN_FORMAT 0x50 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 147 | #define WIN_INIT 0x60 | 
|  | 148 | #define WIN_SEEK 0x70 | 
|  | 149 | #define CFA_TRANSLATE_SECTOR 0x87 | 
|  | 150 | #define WIN_DIAGNOSE 0x90 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 151 | #define WIN_SPECIFY 0x91 | 
|  | 152 | #define WIN_DOWNLOAD_MICROCODE 0x92 | 
|  | 153 | #define WIN_STANDBYNOW2 0x94 | 
|  | 154 | #define WIN_STANDBY2 0x96 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 155 | #define WIN_SETIDLE2 0x97 | 
|  | 156 | #define WIN_CHECKPOWERMODE2 0x98 | 
|  | 157 | #define WIN_SLEEPNOW2 0x99 | 
|  | 158 | #define WIN_PACKETCMD 0xA0 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 159 | #define WIN_PIDENTIFY 0xA1 | 
|  | 160 | #define WIN_QUEUED_SERVICE 0xA2 | 
|  | 161 | #define WIN_SMART 0xB0 | 
|  | 162 | #define CFA_ERASE_SECTORS 0xC0 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 163 | #define WIN_MULTREAD 0xC4 | 
|  | 164 | #define WIN_MULTWRITE 0xC5 | 
|  | 165 | #define WIN_SETMULT 0xC6 | 
|  | 166 | #define WIN_READDMA_QUEUED 0xC7 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 167 | #define WIN_READDMA 0xC8 | 
|  | 168 | #define WIN_READDMA_ONCE 0xC9 | 
|  | 169 | #define WIN_WRITEDMA 0xCA | 
|  | 170 | #define WIN_WRITEDMA_ONCE 0xCB | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 171 | #define WIN_WRITEDMA_QUEUED 0xCC | 
|  | 172 | #define CFA_WRITE_MULTI_WO_ERASE 0xCD | 
|  | 173 | #define WIN_GETMEDIASTATUS 0xDA | 
|  | 174 | #define WIN_ACKMEDIACHANGE 0xDB | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 175 | #define WIN_POSTBOOT 0xDC | 
|  | 176 | #define WIN_PREBOOT 0xDD | 
|  | 177 | #define WIN_DOORLOCK 0xDE | 
|  | 178 | #define WIN_DOORUNLOCK 0xDF | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 179 | #define WIN_STANDBYNOW1 0xE0 | 
|  | 180 | #define WIN_IDLEIMMEDIATE 0xE1 | 
|  | 181 | #define WIN_STANDBY 0xE2 | 
|  | 182 | #define WIN_SETIDLE1 0xE3 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 183 | #define WIN_READ_BUFFER 0xE4 | 
|  | 184 | #define WIN_CHECKPOWERMODE1 0xE5 | 
|  | 185 | #define WIN_SLEEPNOW1 0xE6 | 
|  | 186 | #define WIN_FLUSH_CACHE 0xE7 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 187 | #define WIN_WRITE_BUFFER 0xE8 | 
|  | 188 | #define WIN_WRITE_SAME 0xE9 | 
|  | 189 | #define WIN_FLUSH_CACHE_EXT 0xEA | 
|  | 190 | #define WIN_IDENTIFY 0xEC | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 191 | #define WIN_MEDIAEJECT 0xED | 
|  | 192 | #define WIN_IDENTIFY_DMA 0xEE | 
|  | 193 | #define WIN_SETFEATURES 0xEF | 
|  | 194 | #define EXABYTE_ENABLE_NEST 0xF0 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 195 | #define WIN_SECURITY_SET_PASS 0xF1 | 
|  | 196 | #define WIN_SECURITY_UNLOCK 0xF2 | 
|  | 197 | #define WIN_SECURITY_ERASE_PREPARE 0xF3 | 
|  | 198 | #define WIN_SECURITY_ERASE_UNIT 0xF4 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 199 | #define WIN_SECURITY_FREEZE_LOCK 0xF5 | 
|  | 200 | #define WIN_SECURITY_DISABLE 0xF6 | 
|  | 201 | #define WIN_READ_NATIVE_MAX 0xF8 | 
|  | 202 | #define WIN_SET_MAX 0xF9 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 203 | #define DISABLE_SEAGATE 0xFB | 
|  | 204 | #define SMART_READ_VALUES 0xD0 | 
|  | 205 | #define SMART_READ_THRESHOLDS 0xD1 | 
|  | 206 | #define SMART_AUTOSAVE 0xD2 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 207 | #define SMART_SAVE 0xD3 | 
|  | 208 | #define SMART_IMMEDIATE_OFFLINE 0xD4 | 
|  | 209 | #define SMART_READ_LOG_SECTOR 0xD5 | 
|  | 210 | #define SMART_WRITE_LOG_SECTOR 0xD6 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 211 | #define SMART_WRITE_THRESHOLDS 0xD7 | 
|  | 212 | #define SMART_ENABLE 0xD8 | 
|  | 213 | #define SMART_DISABLE 0xD9 | 
|  | 214 | #define SMART_STATUS 0xDA | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 215 | #define SMART_AUTO_OFFLINE 0xDB | 
|  | 216 | #define SMART_LCYL_PASS 0x4F | 
|  | 217 | #define SMART_HCYL_PASS 0xC2 | 
|  | 218 | #define SETFEATURES_EN_8BIT 0x01 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 219 | #define SETFEATURES_EN_WCACHE 0x02 | 
|  | 220 | #define SETFEATURES_DIS_DEFECT 0x04 | 
|  | 221 | #define SETFEATURES_EN_APM 0x05 | 
|  | 222 | #define SETFEATURES_EN_SAME_R 0x22 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 223 | #define SETFEATURES_DIS_MSN 0x31 | 
|  | 224 | #define SETFEATURES_DIS_RETRY 0x33 | 
|  | 225 | #define SETFEATURES_EN_AAM 0x42 | 
|  | 226 | #define SETFEATURES_RW_LONG 0x44 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 227 | #define SETFEATURES_SET_CACHE 0x54 | 
|  | 228 | #define SETFEATURES_DIS_RLA 0x55 | 
|  | 229 | #define SETFEATURES_EN_RI 0x5D | 
|  | 230 | #define SETFEATURES_EN_SI 0x5E | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 231 | #define SETFEATURES_DIS_RPOD 0x66 | 
|  | 232 | #define SETFEATURES_DIS_ECC 0x77 | 
|  | 233 | #define SETFEATURES_DIS_8BIT 0x81 | 
|  | 234 | #define SETFEATURES_DIS_WCACHE 0x82 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 235 | #define SETFEATURES_EN_DEFECT 0x84 | 
|  | 236 | #define SETFEATURES_DIS_APM 0x85 | 
|  | 237 | #define SETFEATURES_EN_ECC 0x88 | 
|  | 238 | #define SETFEATURES_EN_MSN 0x95 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 239 | #define SETFEATURES_EN_RETRY 0x99 | 
|  | 240 | #define SETFEATURES_EN_RLA 0xAA | 
|  | 241 | #define SETFEATURES_PREFETCH 0xAB | 
|  | 242 | #define SETFEATURES_EN_REST 0xAC | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 243 | #define SETFEATURES_4B_RW_LONG 0xBB | 
|  | 244 | #define SETFEATURES_DIS_AAM 0xC2 | 
|  | 245 | #define SETFEATURES_EN_RPOD 0xCC | 
|  | 246 | #define SETFEATURES_DIS_RI 0xDD | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 247 | #define SETFEATURES_EN_SAME_M 0xDD | 
|  | 248 | #define SETFEATURES_DIS_SI 0xDE | 
|  | 249 | #define SECURITY_SET_PASSWORD 0xBA | 
|  | 250 | #define SECURITY_UNLOCK 0xBB | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 251 | #define SECURITY_ERASE_PREPARE 0xBC | 
|  | 252 | #define SECURITY_ERASE_UNIT 0xBD | 
|  | 253 | #define SECURITY_FREEZE_LOCK 0xBE | 
|  | 254 | #define SECURITY_DISABLE_PASSWORD 0xBF | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 255 | struct hd_geometry { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 256 | unsigned char heads; | 
|  | 257 | unsigned char sectors; | 
|  | 258 | unsigned short cylinders; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 259 | unsigned long start; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 260 | }; | 
|  | 261 | #define HDIO_GETGEO 0x0301 | 
|  | 262 | #define HDIO_GET_UNMASKINTR 0x0302 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 263 | #define HDIO_GET_MULTCOUNT 0x0304 | 
|  | 264 | #define HDIO_GET_QDMA 0x0305 | 
|  | 265 | #define HDIO_SET_XFER 0x0306 | 
|  | 266 | #define HDIO_OBSOLETE_IDENTITY 0x0307 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 267 | #define HDIO_GET_KEEPSETTINGS 0x0308 | 
|  | 268 | #define HDIO_GET_32BIT 0x0309 | 
|  | 269 | #define HDIO_GET_NOWERR 0x030a | 
|  | 270 | #define HDIO_GET_DMA 0x030b | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 271 | #define HDIO_GET_NICE 0x030c | 
|  | 272 | #define HDIO_GET_IDENTITY 0x030d | 
|  | 273 | #define HDIO_GET_WCACHE 0x030e | 
|  | 274 | #define HDIO_GET_ACOUSTIC 0x030f | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 275 | #define HDIO_GET_ADDRESS 0x0310 | 
|  | 276 | #define HDIO_GET_BUSSTATE 0x031a | 
|  | 277 | #define HDIO_TRISTATE_HWIF 0x031b | 
|  | 278 | #define HDIO_DRIVE_RESET 0x031c | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 279 | #define HDIO_DRIVE_TASKFILE 0x031d | 
|  | 280 | #define HDIO_DRIVE_TASK 0x031e | 
|  | 281 | #define HDIO_DRIVE_CMD 0x031f | 
|  | 282 | #define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 283 | #define HDIO_SET_MULTCOUNT 0x0321 | 
|  | 284 | #define HDIO_SET_UNMASKINTR 0x0322 | 
|  | 285 | #define HDIO_SET_KEEPSETTINGS 0x0323 | 
|  | 286 | #define HDIO_SET_32BIT 0x0324 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 287 | #define HDIO_SET_NOWERR 0x0325 | 
|  | 288 | #define HDIO_SET_DMA 0x0326 | 
|  | 289 | #define HDIO_SET_PIO_MODE 0x0327 | 
|  | 290 | #define HDIO_SCAN_HWIF 0x0328 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 291 | #define HDIO_UNREGISTER_HWIF 0x032a | 
|  | 292 | #define HDIO_SET_NICE 0x0329 | 
|  | 293 | #define HDIO_SET_WCACHE 0x032b | 
|  | 294 | #define HDIO_SET_ACOUSTIC 0x032c | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 295 | #define HDIO_SET_BUSSTATE 0x032d | 
|  | 296 | #define HDIO_SET_QDMA 0x032e | 
|  | 297 | #define HDIO_SET_ADDRESS 0x032f | 
|  | 298 | enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 299 | BUSSTATE_OFF = 0, | 
|  | 300 | BUSSTATE_ON, | 
|  | 301 | BUSSTATE_TRISTATE | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 302 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 303 | #define __NEW_HD_DRIVE_ID | 
|  | 304 | struct hd_driveid { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 305 | unsigned short config; | 
|  | 306 | unsigned short cyls; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 307 | unsigned short reserved2; | 
|  | 308 | unsigned short heads; | 
|  | 309 | unsigned short track_bytes; | 
|  | 310 | unsigned short sector_bytes; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 311 | unsigned short sectors; | 
|  | 312 | unsigned short vendor0; | 
|  | 313 | unsigned short vendor1; | 
|  | 314 | unsigned short vendor2; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 315 | unsigned char serial_no[20]; | 
|  | 316 | unsigned short buf_type; | 
|  | 317 | unsigned short buf_size; | 
|  | 318 | unsigned short ecc_bytes; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 319 | unsigned char fw_rev[8]; | 
|  | 320 | unsigned char model[40]; | 
|  | 321 | unsigned char max_multsect; | 
|  | 322 | unsigned char vendor3; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 323 | unsigned short dword_io; | 
|  | 324 | unsigned char vendor4; | 
|  | 325 | unsigned char capability; | 
|  | 326 | unsigned short reserved50; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 327 | unsigned char vendor5; | 
|  | 328 | unsigned char tPIO; | 
|  | 329 | unsigned char vendor6; | 
|  | 330 | unsigned char tDMA; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 331 | unsigned short field_valid; | 
|  | 332 | unsigned short cur_cyls; | 
|  | 333 | unsigned short cur_heads; | 
|  | 334 | unsigned short cur_sectors; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 335 | unsigned short cur_capacity0; | 
|  | 336 | unsigned short cur_capacity1; | 
|  | 337 | unsigned char multsect; | 
|  | 338 | unsigned char multsect_valid; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 339 | unsigned int lba_capacity; | 
|  | 340 | unsigned short dma_1word; | 
|  | 341 | unsigned short dma_mword; | 
|  | 342 | unsigned short eide_pio_modes; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 343 | unsigned short eide_dma_min; | 
|  | 344 | unsigned short eide_dma_time; | 
|  | 345 | unsigned short eide_pio; | 
|  | 346 | unsigned short eide_pio_iordy; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 347 | unsigned short words69_70[2]; | 
|  | 348 | unsigned short words71_74[4]; | 
|  | 349 | unsigned short queue_depth; | 
|  | 350 | unsigned short words76_79[4]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 351 | unsigned short major_rev_num; | 
|  | 352 | unsigned short minor_rev_num; | 
|  | 353 | unsigned short command_set_1; | 
|  | 354 | unsigned short command_set_2; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 355 | unsigned short cfsse; | 
|  | 356 | unsigned short cfs_enable_1; | 
|  | 357 | unsigned short cfs_enable_2; | 
|  | 358 | unsigned short csf_default; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 359 | unsigned short dma_ultra; | 
|  | 360 | unsigned short trseuc; | 
|  | 361 | unsigned short trsEuc; | 
|  | 362 | unsigned short CurAPMvalues; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 363 | unsigned short mprc; | 
|  | 364 | unsigned short hw_config; | 
|  | 365 | unsigned short acoustic; | 
|  | 366 | unsigned short msrqs; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 367 | unsigned short sxfert; | 
|  | 368 | unsigned short sal; | 
|  | 369 | unsigned int spg; | 
|  | 370 | unsigned long long lba_capacity_2; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 371 | unsigned short words104_125[22]; | 
|  | 372 | unsigned short last_lun; | 
|  | 373 | unsigned short word127; | 
|  | 374 | unsigned short dlf; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 375 | unsigned short csfo; | 
|  | 376 | unsigned short words130_155[26]; | 
|  | 377 | unsigned short word156; | 
|  | 378 | unsigned short words157_159[3]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 379 | unsigned short cfa_power; | 
|  | 380 | unsigned short words161_175[15]; | 
|  | 381 | unsigned short words176_205[30]; | 
|  | 382 | unsigned short words206_254[49]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 383 | unsigned short integrity_word; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 384 | }; | 
|  | 385 | #define IDE_NICE_DSC_OVERLAP (0) | 
|  | 386 | #define IDE_NICE_ATAPI_OVERLAP (1) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 387 | #define IDE_NICE_1 (3) | 
|  | 388 | #define IDE_NICE_0 (2) | 
|  | 389 | #define IDE_NICE_2 (4) | 
|  | 390 | #endif |