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_ATA_H__ 20 #define __LINUX_ATA_H__ 21 #include <linux/types.h> 22 #define ATA_DMA_BOUNDARY 0xffffUL 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define ATA_DMA_MASK 0xffffffffULL 25 enum { 26 ATA_MAX_DEVICES = 2, 27 ATA_MAX_PRD = 256, 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 ATA_SECT_SIZE = 512, 30 ATA_ID_WORDS = 256, 31 ATA_ID_SERNO_OFS = 10, 32 ATA_ID_FW_REV_OFS = 23, 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 ATA_ID_PROD_OFS = 27, 35 ATA_ID_OLD_PIO_MODES = 51, 36 ATA_ID_FIELD_VALID = 53, 37 ATA_ID_MWDMA_MODES = 63, 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 ATA_ID_PIO_MODES = 64, 40 ATA_ID_EIDE_DMA_MIN = 65, 41 ATA_ID_EIDE_PIO = 67, 42 ATA_ID_EIDE_PIO_IORDY = 68, 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 ATA_ID_UDMA_MODES = 88, 45 ATA_ID_MAJOR_VER = 80, 46 ATA_ID_PIO4 = (1 << 1), 47 ATA_PCI_CTL_OFS = 2, 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 ATA_SERNO_LEN = 20, 50 ATA_UDMA0 = (1 << 0), 51 ATA_UDMA1 = ATA_UDMA0 | (1 << 1), 52 ATA_UDMA2 = ATA_UDMA1 | (1 << 2), 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 ATA_UDMA3 = ATA_UDMA2 | (1 << 3), 55 ATA_UDMA4 = ATA_UDMA3 | (1 << 4), 56 ATA_UDMA5 = ATA_UDMA4 | (1 << 5), 57 ATA_UDMA6 = ATA_UDMA5 | (1 << 6), 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 ATA_UDMA7 = ATA_UDMA6 | (1 << 7), 60 ATA_UDMA_MASK_40C = ATA_UDMA2, 61 ATA_PRD_SZ = 8, 62 ATA_PRD_TBL_SZ = (ATA_MAX_PRD * ATA_PRD_SZ), 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 ATA_PRD_EOT = (1 << 31), 65 ATA_DMA_TABLE_OFS = 4, 66 ATA_DMA_STATUS = 2, 67 ATA_DMA_CMD = 0, 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 ATA_DMA_WR = (1 << 3), 70 ATA_DMA_START = (1 << 0), 71 ATA_DMA_INTR = (1 << 2), 72 ATA_DMA_ERR = (1 << 1), 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 ATA_DMA_ACTIVE = (1 << 0), 75 ATA_HOB = (1 << 7), 76 ATA_NIEN = (1 << 1), 77 ATA_LBA = (1 << 6), 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 ATA_DEV1 = (1 << 4), 80 ATA_DEVICE_OBS = (1 << 7) | (1 << 5), 81 ATA_DEVCTL_OBS = (1 << 3), 82 ATA_BUSY = (1 << 7), 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 ATA_DRDY = (1 << 6), 85 ATA_DF = (1 << 5), 86 ATA_DRQ = (1 << 3), 87 ATA_ERR = (1 << 0), 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 ATA_SRST = (1 << 2), 90 ATA_ICRC = (1 << 7), 91 ATA_UNC = (1 << 6), 92 ATA_IDNF = (1 << 4), 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 ATA_ABORTED = (1 << 2), 95 ATA_REG_DATA = 0x00, 96 ATA_REG_ERR = 0x01, 97 ATA_REG_NSECT = 0x02, 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 ATA_REG_LBAL = 0x03, 100 ATA_REG_LBAM = 0x04, 101 ATA_REG_LBAH = 0x05, 102 ATA_REG_DEVICE = 0x06, 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 ATA_REG_STATUS = 0x07, 105 ATA_REG_FEATURE = ATA_REG_ERR, 106 ATA_REG_CMD = ATA_REG_STATUS, 107 ATA_REG_BYTEL = ATA_REG_LBAM, 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 ATA_REG_BYTEH = ATA_REG_LBAH, 110 ATA_REG_DEVSEL = ATA_REG_DEVICE, 111 ATA_REG_IRQ = ATA_REG_NSECT, 112 ATA_CMD_CHK_POWER = 0xE5, 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 ATA_CMD_STANDBY = 0xE2, 115 ATA_CMD_IDLE = 0xE3, 116 ATA_CMD_EDD = 0x90, 117 ATA_CMD_FLUSH = 0xE7, 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 ATA_CMD_FLUSH_EXT = 0xEA, 120 ATA_CMD_ID_ATA = 0xEC, 121 ATA_CMD_ID_ATAPI = 0xA1, 122 ATA_CMD_READ = 0xC8, 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 ATA_CMD_READ_EXT = 0x25, 125 ATA_CMD_WRITE = 0xCA, 126 ATA_CMD_WRITE_EXT = 0x35, 127 ATA_CMD_WRITE_FUA_EXT = 0x3D, 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 ATA_CMD_FPDMA_READ = 0x60, 130 ATA_CMD_FPDMA_WRITE = 0x61, 131 ATA_CMD_PIO_READ = 0x20, 132 ATA_CMD_PIO_READ_EXT = 0x24, 133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 ATA_CMD_PIO_WRITE = 0x30, 135 ATA_CMD_PIO_WRITE_EXT = 0x34, 136 ATA_CMD_READ_MULTI = 0xC4, 137 ATA_CMD_READ_MULTI_EXT = 0x29, 138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139 ATA_CMD_WRITE_MULTI = 0xC5, 140 ATA_CMD_WRITE_MULTI_EXT = 0x39, 141 ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE, 142 ATA_CMD_SET_FEATURES = 0xEF, 143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 ATA_CMD_PACKET = 0xA0, 145 ATA_CMD_VERIFY = 0x40, 146 ATA_CMD_VERIFY_EXT = 0x42, 147 ATA_CMD_STANDBYNOW1 = 0xE0, 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 149 ATA_CMD_IDLEIMMEDIATE = 0xE1, 150 ATA_CMD_INIT_DEV_PARAMS = 0x91, 151 ATA_CMD_READ_NATIVE_MAX = 0xF8, 152 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, 153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 154 ATA_CMD_READ_LOG_EXT = 0x2f, 155 ATA_LOG_SATA_NCQ = 0x10, 156 SETFEATURES_XFER = 0x03, 157 XFER_UDMA_7 = 0x47, 158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 159 XFER_UDMA_6 = 0x46, 160 XFER_UDMA_5 = 0x45, 161 XFER_UDMA_4 = 0x44, 162 XFER_UDMA_3 = 0x43, 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 164 XFER_UDMA_2 = 0x42, 165 XFER_UDMA_1 = 0x41, 166 XFER_UDMA_0 = 0x40, 167 XFER_MW_DMA_2 = 0x22, 168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 169 XFER_MW_DMA_1 = 0x21, 170 XFER_MW_DMA_0 = 0x20, 171 XFER_SW_DMA_2 = 0x12, 172 XFER_SW_DMA_1 = 0x11, 173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 174 XFER_SW_DMA_0 = 0x10, 175 XFER_PIO_4 = 0x0C, 176 XFER_PIO_3 = 0x0B, 177 XFER_PIO_2 = 0x0A, 178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 179 XFER_PIO_1 = 0x09, 180 XFER_PIO_0 = 0x08, 181 XFER_PIO_SLOW = 0x00, 182 SETFEATURES_WC_ON = 0x02, 183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 184 SETFEATURES_WC_OFF = 0x82, 185 ATAPI_PKT_DMA = (1 << 0), 186 ATAPI_DMADIR = (1 << 2), 187 ATAPI_CDB_LEN = 16, 188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 189 ATA_CBL_NONE = 0, 190 ATA_CBL_PATA40 = 1, 191 ATA_CBL_PATA80 = 2, 192 ATA_CBL_PATA_UNK = 3, 193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 194 ATA_CBL_SATA = 4, 195 SCR_STATUS = 0, 196 SCR_ERROR = 1, 197 SCR_CONTROL = 2, 198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 199 SCR_ACTIVE = 3, 200 SCR_NOTIFICATION = 4, 201 SERR_DATA_RECOVERED = (1 << 0), 202 SERR_COMM_RECOVERED = (1 << 1), 203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 204 SERR_DATA = (1 << 8), 205 SERR_PERSISTENT = (1 << 9), 206 SERR_PROTOCOL = (1 << 10), 207 SERR_INTERNAL = (1 << 11), 208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 209 SERR_PHYRDY_CHG = (1 << 16), 210 SERR_DEV_XCHG = (1 << 26), 211 ATA_TFLAG_LBA48 = (1 << 0), 212 ATA_TFLAG_ISADDR = (1 << 1), 213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 214 ATA_TFLAG_DEVICE = (1 << 2), 215 ATA_TFLAG_WRITE = (1 << 3), 216 ATA_TFLAG_LBA = (1 << 4), 217 ATA_TFLAG_FUA = (1 << 5), 218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 219 ATA_TFLAG_POLLING = (1 << 6), 220 }; 221 enum ata_tf_protocols { 222 ATA_PROT_UNKNOWN, 223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 224 ATA_PROT_NODATA, 225 ATA_PROT_PIO, 226 ATA_PROT_DMA, 227 ATA_PROT_NCQ, 228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 229 ATA_PROT_ATAPI, 230 ATA_PROT_ATAPI_NODATA, 231 ATA_PROT_ATAPI_DMA, 232 }; 233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 234 enum ata_ioctls { 235 ATA_IOC_GET_IO32 = 0x309, 236 ATA_IOC_SET_IO32 = 0x324, 237 }; 238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 239 struct ata_prd { 240 u32 addr; 241 u32 flags_len; 242 }; 243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 244 struct ata_taskfile { 245 unsigned long flags; 246 u8 protocol; 247 u8 ctl; 248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 249 u8 hob_feature; 250 u8 hob_nsect; 251 u8 hob_lbal; 252 u8 hob_lbam; 253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 254 u8 hob_lbah; 255 u8 feature; 256 u8 nsect; 257 u8 lbal; 258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 259 u8 lbam; 260 u8 lbah; 261 u8 device; 262 u8 command; 263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 264 }; 265 #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) 266 #define ata_id_is_cfa(id) ((id)[0] == 0x848A) 267 #define ata_id_is_sata(id) ((id)[93] == 0) 268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 269 #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) 270 #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) 271 #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) 272 #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) 273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 274 #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) 275 #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) 276 #define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) 277 #define ata_id_has_hpa(id) ((id)[82] & (1 << 10)) 278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 279 #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) 280 #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) 281 #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 282 #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 284 #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) 285 #define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) 286 #define ata_id_removeable(id) ((id)[0] & (1 << 7)) 287 #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 289 #define ata_id_u32(id,n) (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) 290 #define ata_id_u64(id,n) ( ((u64) (id)[(n) + 3] << 48) | ((u64) (id)[(n) + 2] << 32) | ((u64) (id)[(n) + 1] << 16) | ((u64) (id)[(n) + 0]) ) 291 #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) 292 #endif 293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 294