1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef _LINUX_HDREG_H 2 #ifndef _LINUX_HDREG_H 3 #define _LINUX_HDREG_H 3 #define _LINUX_HDREG_H 4 4 5 #include <linux/types.h> 5 #include <linux/types.h> 6 6 7 /* 7 /* 8 * Command Header sizes for IOCTL commands 8 * Command Header sizes for IOCTL commands 9 */ 9 */ 10 10 11 #define HDIO_DRIVE_CMD_HDR_SIZE (4 * s 11 #define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8)) 12 #define HDIO_DRIVE_HOB_HDR_SIZE (8 * s 12 #define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8)) 13 #define HDIO_DRIVE_TASK_HDR_SIZE (8 * s 13 #define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8)) 14 14 15 #define IDE_DRIVE_TASK_NO_DATA 0 15 #define IDE_DRIVE_TASK_NO_DATA 0 16 #ifndef __KERNEL__ 16 #ifndef __KERNEL__ 17 #define IDE_DRIVE_TASK_INVALID -1 17 #define IDE_DRIVE_TASK_INVALID -1 18 #define IDE_DRIVE_TASK_SET_XFER 1 18 #define IDE_DRIVE_TASK_SET_XFER 1 19 #define IDE_DRIVE_TASK_IN 2 19 #define IDE_DRIVE_TASK_IN 2 20 #define IDE_DRIVE_TASK_OUT 3 20 #define IDE_DRIVE_TASK_OUT 3 21 #endif 21 #endif 22 #define IDE_DRIVE_TASK_RAW_WRITE 4 22 #define IDE_DRIVE_TASK_RAW_WRITE 4 23 23 24 /* 24 /* 25 * Define standard taskfile in/out register 25 * Define standard taskfile in/out register 26 */ 26 */ 27 #define IDE_TASKFILE_STD_IN_FLAGS 0xFE 27 #define IDE_TASKFILE_STD_IN_FLAGS 0xFE 28 #define IDE_HOB_STD_IN_FLAGS 0x3C 28 #define IDE_HOB_STD_IN_FLAGS 0x3C 29 #ifndef __KERNEL__ 29 #ifndef __KERNEL__ 30 #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE 30 #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE 31 #define IDE_HOB_STD_OUT_FLAGS 0x3C 31 #define IDE_HOB_STD_OUT_FLAGS 0x3C 32 32 33 typedef unsigned char task_ioreg_t; 33 typedef unsigned char task_ioreg_t; 34 typedef unsigned long sata_ioreg_t; 34 typedef unsigned long sata_ioreg_t; 35 #endif 35 #endif 36 36 37 typedef union ide_reg_valid_s { 37 typedef union ide_reg_valid_s { 38 unsigned all 38 unsigned all : 16; 39 struct { 39 struct { 40 unsigned data 40 unsigned data : 1; 41 unsigned error_feature 41 unsigned error_feature : 1; 42 unsigned sector 42 unsigned sector : 1; 43 unsigned nsector 43 unsigned nsector : 1; 44 unsigned lcyl 44 unsigned lcyl : 1; 45 unsigned hcyl 45 unsigned hcyl : 1; 46 unsigned select 46 unsigned select : 1; 47 unsigned status_command 47 unsigned status_command : 1; 48 48 49 unsigned data_hob 49 unsigned data_hob : 1; 50 unsigned error_feature_hob 50 unsigned error_feature_hob : 1; 51 unsigned sector_hob 51 unsigned sector_hob : 1; 52 unsigned nsector_hob 52 unsigned nsector_hob : 1; 53 unsigned lcyl_hob 53 unsigned lcyl_hob : 1; 54 unsigned hcyl_hob 54 unsigned hcyl_hob : 1; 55 unsigned select_hob 55 unsigned select_hob : 1; 56 unsigned control_hob 56 unsigned control_hob : 1; 57 } b; 57 } b; 58 } ide_reg_valid_t; 58 } ide_reg_valid_t; 59 59 60 typedef struct ide_task_request_s { 60 typedef struct ide_task_request_s { 61 __u8 io_ports[8]; 61 __u8 io_ports[8]; 62 __u8 hob_ports[8]; /* bytes 62 __u8 hob_ports[8]; /* bytes 6 and 7 are unused */ 63 ide_reg_valid_t out_flags; 63 ide_reg_valid_t out_flags; 64 ide_reg_valid_t in_flags; 64 ide_reg_valid_t in_flags; 65 int data_phase; 65 int data_phase; 66 int req_cmd; 66 int req_cmd; 67 unsigned long out_size; 67 unsigned long out_size; 68 unsigned long in_size; 68 unsigned long in_size; 69 } ide_task_request_t; 69 } ide_task_request_t; 70 70 71 typedef struct ide_ioctl_request_s { 71 typedef struct ide_ioctl_request_s { 72 ide_task_request_t *task_request; 72 ide_task_request_t *task_request; 73 unsigned char *out_buffer; 73 unsigned char *out_buffer; 74 unsigned char *in_buffer; 74 unsigned char *in_buffer; 75 } ide_ioctl_request_t; 75 } ide_ioctl_request_t; 76 76 77 struct hd_drive_cmd_hdr { 77 struct hd_drive_cmd_hdr { 78 __u8 command; 78 __u8 command; 79 __u8 sector_number; 79 __u8 sector_number; 80 __u8 feature; 80 __u8 feature; 81 __u8 sector_count; 81 __u8 sector_count; 82 }; 82 }; 83 83 84 #ifndef __KERNEL__ 84 #ifndef __KERNEL__ 85 typedef struct hd_drive_task_hdr { 85 typedef struct hd_drive_task_hdr { 86 __u8 data; 86 __u8 data; 87 __u8 feature; 87 __u8 feature; 88 __u8 sector_count; 88 __u8 sector_count; 89 __u8 sector_number; 89 __u8 sector_number; 90 __u8 low_cylinder; 90 __u8 low_cylinder; 91 __u8 high_cylinder; 91 __u8 high_cylinder; 92 __u8 device_head; 92 __u8 device_head; 93 __u8 command; 93 __u8 command; 94 } task_struct_t; 94 } task_struct_t; 95 95 96 typedef struct hd_drive_hob_hdr { 96 typedef struct hd_drive_hob_hdr { 97 __u8 data; 97 __u8 data; 98 __u8 feature; 98 __u8 feature; 99 __u8 sector_count; 99 __u8 sector_count; 100 __u8 sector_number; 100 __u8 sector_number; 101 __u8 low_cylinder; 101 __u8 low_cylinder; 102 __u8 high_cylinder; 102 __u8 high_cylinder; 103 __u8 device_head; 103 __u8 device_head; 104 __u8 control; 104 __u8 control; 105 } hob_struct_t; 105 } hob_struct_t; 106 #endif 106 #endif 107 107 108 #define TASKFILE_NO_DATA 0x0000 108 #define TASKFILE_NO_DATA 0x0000 109 109 110 #define TASKFILE_IN 0x0001 110 #define TASKFILE_IN 0x0001 111 #define TASKFILE_MULTI_IN 0x0002 111 #define TASKFILE_MULTI_IN 0x0002 112 112 113 #define TASKFILE_OUT 0x0004 113 #define TASKFILE_OUT 0x0004 114 #define TASKFILE_MULTI_OUT 0x0008 114 #define TASKFILE_MULTI_OUT 0x0008 115 #define TASKFILE_IN_OUT 0x0010 115 #define TASKFILE_IN_OUT 0x0010 116 116 117 #define TASKFILE_IN_DMA 0x0020 117 #define TASKFILE_IN_DMA 0x0020 118 #define TASKFILE_OUT_DMA 0x0040 118 #define TASKFILE_OUT_DMA 0x0040 119 #define TASKFILE_IN_DMAQ 0x0080 119 #define TASKFILE_IN_DMAQ 0x0080 120 #define TASKFILE_OUT_DMAQ 0x0100 120 #define TASKFILE_OUT_DMAQ 0x0100 121 121 122 #ifndef __KERNEL__ 122 #ifndef __KERNEL__ 123 #define TASKFILE_P_IN 0x0200 123 #define TASKFILE_P_IN 0x0200 124 #define TASKFILE_P_OUT 0x0400 124 #define TASKFILE_P_OUT 0x0400 125 #define TASKFILE_P_IN_DMA 0x0800 125 #define TASKFILE_P_IN_DMA 0x0800 126 #define TASKFILE_P_OUT_DMA 0x1000 126 #define TASKFILE_P_OUT_DMA 0x1000 127 #define TASKFILE_P_IN_DMAQ 0x2000 127 #define TASKFILE_P_IN_DMAQ 0x2000 128 #define TASKFILE_P_OUT_DMAQ 0x4000 128 #define TASKFILE_P_OUT_DMAQ 0x4000 129 #define TASKFILE_48 0x8000 129 #define TASKFILE_48 0x8000 130 #define TASKFILE_INVALID 0x7fff 130 #define TASKFILE_INVALID 0x7fff 131 #endif 131 #endif 132 132 133 #ifndef __KERNEL__ 133 #ifndef __KERNEL__ 134 /* ATA/ATAPI Commands pre T13 Spec */ 134 /* ATA/ATAPI Commands pre T13 Spec */ 135 #define WIN_NOP 0x00 135 #define WIN_NOP 0x00 136 /* 136 /* 137 * 0x01->0x02 Reserved 137 * 0x01->0x02 Reserved 138 */ 138 */ 139 #define CFA_REQ_EXT_ERROR_CODE 0x03 / 139 #define CFA_REQ_EXT_ERROR_CODE 0x03 /* CFA Request Extended Error Code */ 140 /* 140 /* 141 * 0x04->0x07 Reserved 141 * 0x04->0x07 Reserved 142 */ 142 */ 143 #define WIN_SRST 0x08 / 143 #define WIN_SRST 0x08 /* ATAPI soft reset command */ 144 #define WIN_DEVICE_RESET 0x08 144 #define WIN_DEVICE_RESET 0x08 145 /* 145 /* 146 * 0x09->0x0F Reserved 146 * 0x09->0x0F Reserved 147 */ 147 */ 148 #define WIN_RECAL 0x10 148 #define WIN_RECAL 0x10 149 #define WIN_RESTORE WIN_RE 149 #define WIN_RESTORE WIN_RECAL 150 /* 150 /* 151 * 0x10->0x1F Reserved 151 * 0x10->0x1F Reserved 152 */ 152 */ 153 #define WIN_READ 0x20 / 153 #define WIN_READ 0x20 /* 28-Bit */ 154 #define WIN_READ_ONCE 0x21 / 154 #define WIN_READ_ONCE 0x21 /* 28-Bit without retries */ 155 #define WIN_READ_LONG 0x22 / 155 #define WIN_READ_LONG 0x22 /* 28-Bit */ 156 #define WIN_READ_LONG_ONCE 0x23 / 156 #define WIN_READ_LONG_ONCE 0x23 /* 28-Bit without retries */ 157 #define WIN_READ_EXT 0x24 / 157 #define WIN_READ_EXT 0x24 /* 48-Bit */ 158 #define WIN_READDMA_EXT 0x25 / 158 #define WIN_READDMA_EXT 0x25 /* 48-Bit */ 159 #define WIN_READDMA_QUEUED_EXT 0x26 / 159 #define WIN_READDMA_QUEUED_EXT 0x26 /* 48-Bit */ 160 #define WIN_READ_NATIVE_MAX_EXT 0x27 / 160 #define WIN_READ_NATIVE_MAX_EXT 0x27 /* 48-Bit */ 161 /* 161 /* 162 * 0x28 162 * 0x28 163 */ 163 */ 164 #define WIN_MULTREAD_EXT 0x29 / 164 #define WIN_MULTREAD_EXT 0x29 /* 48-Bit */ 165 /* 165 /* 166 * 0x2A->0x2F Reserved 166 * 0x2A->0x2F Reserved 167 */ 167 */ 168 #define WIN_WRITE 0x30 / 168 #define WIN_WRITE 0x30 /* 28-Bit */ 169 #define WIN_WRITE_ONCE 0x31 / 169 #define WIN_WRITE_ONCE 0x31 /* 28-Bit without retries */ 170 #define WIN_WRITE_LONG 0x32 / 170 #define WIN_WRITE_LONG 0x32 /* 28-Bit */ 171 #define WIN_WRITE_LONG_ONCE 0x33 / 171 #define WIN_WRITE_LONG_ONCE 0x33 /* 28-Bit without retries */ 172 #define WIN_WRITE_EXT 0x34 / 172 #define WIN_WRITE_EXT 0x34 /* 48-Bit */ 173 #define WIN_WRITEDMA_EXT 0x35 / 173 #define WIN_WRITEDMA_EXT 0x35 /* 48-Bit */ 174 #define WIN_WRITEDMA_QUEUED_EXT 0x36 / 174 #define WIN_WRITEDMA_QUEUED_EXT 0x36 /* 48-Bit */ 175 #define WIN_SET_MAX_EXT 0x37 / 175 #define WIN_SET_MAX_EXT 0x37 /* 48-Bit */ 176 #define CFA_WRITE_SECT_WO_ERASE 0x38 / 176 #define CFA_WRITE_SECT_WO_ERASE 0x38 /* CFA Write Sectors without erase */ 177 #define WIN_MULTWRITE_EXT 0x39 / 177 #define WIN_MULTWRITE_EXT 0x39 /* 48-Bit */ 178 /* 178 /* 179 * 0x3A->0x3B Reserved 179 * 0x3A->0x3B Reserved 180 */ 180 */ 181 #define WIN_WRITE_VERIFY 0x3C / 181 #define WIN_WRITE_VERIFY 0x3C /* 28-Bit */ 182 /* 182 /* 183 * 0x3D->0x3F Reserved 183 * 0x3D->0x3F Reserved 184 */ 184 */ 185 #define WIN_VERIFY 0x40 / 185 #define WIN_VERIFY 0x40 /* 28-Bit - Read Verify Sectors */ 186 #define WIN_VERIFY_ONCE 0x41 / 186 #define WIN_VERIFY_ONCE 0x41 /* 28-Bit - without retries */ 187 #define WIN_VERIFY_EXT 0x42 / 187 #define WIN_VERIFY_EXT 0x42 /* 48-Bit */ 188 /* 188 /* 189 * 0x43->0x4F Reserved 189 * 0x43->0x4F Reserved 190 */ 190 */ 191 #define WIN_FORMAT 0x50 191 #define WIN_FORMAT 0x50 192 /* 192 /* 193 * 0x51->0x5F Reserved 193 * 0x51->0x5F Reserved 194 */ 194 */ 195 #define WIN_INIT 0x60 195 #define WIN_INIT 0x60 196 /* 196 /* 197 * 0x61->0x5F Reserved 197 * 0x61->0x5F Reserved 198 */ 198 */ 199 #define WIN_SEEK 0x70 / 199 #define WIN_SEEK 0x70 /* 0x70-0x7F Reserved */ 200 200 201 #define CFA_TRANSLATE_SECTOR 0x87 / 201 #define CFA_TRANSLATE_SECTOR 0x87 /* CFA Translate Sector */ 202 #define WIN_DIAGNOSE 0x90 202 #define WIN_DIAGNOSE 0x90 203 #define WIN_SPECIFY 0x91 / 203 #define WIN_SPECIFY 0x91 /* set drive geometry translation */ 204 #define WIN_DOWNLOAD_MICROCODE 0x92 204 #define WIN_DOWNLOAD_MICROCODE 0x92 205 #define WIN_STANDBYNOW2 0x94 205 #define WIN_STANDBYNOW2 0x94 206 #define WIN_STANDBY2 0x96 206 #define WIN_STANDBY2 0x96 207 #define WIN_SETIDLE2 0x97 207 #define WIN_SETIDLE2 0x97 208 #define WIN_CHECKPOWERMODE2 0x98 208 #define WIN_CHECKPOWERMODE2 0x98 209 #define WIN_SLEEPNOW2 0x99 209 #define WIN_SLEEPNOW2 0x99 210 /* 210 /* 211 * 0x9A VENDOR 211 * 0x9A VENDOR 212 */ 212 */ 213 #define WIN_PACKETCMD 0xA0 / 213 #define WIN_PACKETCMD 0xA0 /* Send a packet command. */ 214 #define WIN_PIDENTIFY 0xA1 / 214 #define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */ 215 #define WIN_QUEUED_SERVICE 0xA2 215 #define WIN_QUEUED_SERVICE 0xA2 216 #define WIN_SMART 0xB0 / 216 #define WIN_SMART 0xB0 /* self-monitoring and reporting */ 217 #define CFA_ERASE_SECTORS 0xC0 217 #define CFA_ERASE_SECTORS 0xC0 218 #define WIN_MULTREAD 0xC4 / 218 #define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/ 219 #define WIN_MULTWRITE 0xC5 / 219 #define WIN_MULTWRITE 0xC5 /* write sectors using multiple mode */ 220 #define WIN_SETMULT 0xC6 / 220 #define WIN_SETMULT 0xC6 /* enable/disable multiple mode */ 221 #define WIN_READDMA_QUEUED 0xC7 / 221 #define WIN_READDMA_QUEUED 0xC7 /* read sectors using Queued DMA transfers */ 222 #define WIN_READDMA 0xC8 / 222 #define WIN_READDMA 0xC8 /* read sectors using DMA transfers */ 223 #define WIN_READDMA_ONCE 0xC9 / 223 #define WIN_READDMA_ONCE 0xC9 /* 28-Bit - without retries */ 224 #define WIN_WRITEDMA 0xCA / 224 #define WIN_WRITEDMA 0xCA /* write sectors using DMA transfers */ 225 #define WIN_WRITEDMA_ONCE 0xCB / 225 #define WIN_WRITEDMA_ONCE 0xCB /* 28-Bit - without retries */ 226 #define WIN_WRITEDMA_QUEUED 0xCC / 226 #define WIN_WRITEDMA_QUEUED 0xCC /* write sectors using Queued DMA transfers */ 227 #define CFA_WRITE_MULTI_WO_ERASE 0xCD / 227 #define CFA_WRITE_MULTI_WO_ERASE 0xCD /* CFA Write multiple without erase */ 228 #define WIN_GETMEDIASTATUS 0xDA 228 #define WIN_GETMEDIASTATUS 0xDA 229 #define WIN_ACKMEDIACHANGE 0xDB / 229 #define WIN_ACKMEDIACHANGE 0xDB /* ATA-1, ATA-2 vendor */ 230 #define WIN_POSTBOOT 0xDC 230 #define WIN_POSTBOOT 0xDC 231 #define WIN_PREBOOT 0xDD 231 #define WIN_PREBOOT 0xDD 232 #define WIN_DOORLOCK 0xDE / 232 #define WIN_DOORLOCK 0xDE /* lock door on removable drives */ 233 #define WIN_DOORUNLOCK 0xDF / 233 #define WIN_DOORUNLOCK 0xDF /* unlock door on removable drives */ 234 #define WIN_STANDBYNOW1 0xE0 234 #define WIN_STANDBYNOW1 0xE0 235 #define WIN_IDLEIMMEDIATE 0xE1 / 235 #define WIN_IDLEIMMEDIATE 0xE1 /* force drive to become "ready" */ 236 #define WIN_STANDBY 0xE2 / 236 #define WIN_STANDBY 0xE2 /* Set device in Standby Mode */ 237 #define WIN_SETIDLE1 0xE3 237 #define WIN_SETIDLE1 0xE3 238 #define WIN_READ_BUFFER 0xE4 / 238 #define WIN_READ_BUFFER 0xE4 /* force read only 1 sector */ 239 #define WIN_CHECKPOWERMODE1 0xE5 239 #define WIN_CHECKPOWERMODE1 0xE5 240 #define WIN_SLEEPNOW1 0xE6 240 #define WIN_SLEEPNOW1 0xE6 241 #define WIN_FLUSH_CACHE 0xE7 241 #define WIN_FLUSH_CACHE 0xE7 242 #define WIN_WRITE_BUFFER 0xE8 / 242 #define WIN_WRITE_BUFFER 0xE8 /* force write only 1 sector */ 243 #define WIN_WRITE_SAME 0xE9 / 243 #define WIN_WRITE_SAME 0xE9 /* read ata-2 to use */ 244 /* SET_FEATURES 0x22 or 0xDD */ 244 /* SET_FEATURES 0x22 or 0xDD */ 245 #define WIN_FLUSH_CACHE_EXT 0xEA / 245 #define WIN_FLUSH_CACHE_EXT 0xEA /* 48-Bit */ 246 #define WIN_IDENTIFY 0xEC / 246 #define WIN_IDENTIFY 0xEC /* ask drive to identify itself */ 247 #define WIN_MEDIAEJECT 0xED 247 #define WIN_MEDIAEJECT 0xED 248 #define WIN_IDENTIFY_DMA 0xEE / 248 #define WIN_IDENTIFY_DMA 0xEE /* same as WIN_IDENTIFY, but DMA */ 249 #define WIN_SETFEATURES 0xEF / 249 #define WIN_SETFEATURES 0xEF /* set special drive features */ 250 #define EXABYTE_ENABLE_NEST 0xF0 250 #define EXABYTE_ENABLE_NEST 0xF0 251 #define WIN_SECURITY_SET_PASS 0xF1 251 #define WIN_SECURITY_SET_PASS 0xF1 252 #define WIN_SECURITY_UNLOCK 0xF2 252 #define WIN_SECURITY_UNLOCK 0xF2 253 #define WIN_SECURITY_ERASE_PREPARE 0xF3 253 #define WIN_SECURITY_ERASE_PREPARE 0xF3 254 #define WIN_SECURITY_ERASE_UNIT 0xF4 254 #define WIN_SECURITY_ERASE_UNIT 0xF4 255 #define WIN_SECURITY_FREEZE_LOCK 0xF5 255 #define WIN_SECURITY_FREEZE_LOCK 0xF5 256 #define WIN_SECURITY_DISABLE 0xF6 256 #define WIN_SECURITY_DISABLE 0xF6 257 #define WIN_READ_NATIVE_MAX 0xF8 / 257 #define WIN_READ_NATIVE_MAX 0xF8 /* return the native maximum address */ 258 #define WIN_SET_MAX 0xF9 258 #define WIN_SET_MAX 0xF9 259 #define DISABLE_SEAGATE 0xFB 259 #define DISABLE_SEAGATE 0xFB 260 260 261 /* WIN_SMART sub-commands */ 261 /* WIN_SMART sub-commands */ 262 262 263 #define SMART_READ_VALUES 0xD0 263 #define SMART_READ_VALUES 0xD0 264 #define SMART_READ_THRESHOLDS 0xD1 264 #define SMART_READ_THRESHOLDS 0xD1 265 #define SMART_AUTOSAVE 0xD2 265 #define SMART_AUTOSAVE 0xD2 266 #define SMART_SAVE 0xD3 266 #define SMART_SAVE 0xD3 267 #define SMART_IMMEDIATE_OFFLINE 0xD4 267 #define SMART_IMMEDIATE_OFFLINE 0xD4 268 #define SMART_READ_LOG_SECTOR 0xD5 268 #define SMART_READ_LOG_SECTOR 0xD5 269 #define SMART_WRITE_LOG_SECTOR 0xD6 269 #define SMART_WRITE_LOG_SECTOR 0xD6 270 #define SMART_WRITE_THRESHOLDS 0xD7 270 #define SMART_WRITE_THRESHOLDS 0xD7 271 #define SMART_ENABLE 0xD8 271 #define SMART_ENABLE 0xD8 272 #define SMART_DISABLE 0xD9 272 #define SMART_DISABLE 0xD9 273 #define SMART_STATUS 0xDA 273 #define SMART_STATUS 0xDA 274 #define SMART_AUTO_OFFLINE 0xDB 274 #define SMART_AUTO_OFFLINE 0xDB 275 275 276 /* Password used in TF4 & TF5 executing SMART 276 /* Password used in TF4 & TF5 executing SMART commands */ 277 277 278 #define SMART_LCYL_PASS 0x4F 278 #define SMART_LCYL_PASS 0x4F 279 #define SMART_HCYL_PASS 0xC2 279 #define SMART_HCYL_PASS 0xC2 280 280 281 /* WIN_SETFEATURES sub-commands */ 281 /* WIN_SETFEATURES sub-commands */ 282 #define SETFEATURES_EN_8BIT 0x01 /* Ena 282 #define SETFEATURES_EN_8BIT 0x01 /* Enable 8-Bit Transfers */ 283 #define SETFEATURES_EN_WCACHE 0x02 /* Ena 283 #define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */ 284 #define SETFEATURES_DIS_DEFECT 0x04 /* Dis 284 #define SETFEATURES_DIS_DEFECT 0x04 /* Disable Defect Management */ 285 #define SETFEATURES_EN_APM 0x05 /* Ena 285 #define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */ 286 #define SETFEATURES_EN_SAME_R 0x22 /* for 286 #define SETFEATURES_EN_SAME_R 0x22 /* for a region ATA-1 */ 287 #define SETFEATURES_DIS_MSN 0x31 /* Dis 287 #define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */ 288 #define SETFEATURES_DIS_RETRY 0x33 /* Dis 288 #define SETFEATURES_DIS_RETRY 0x33 /* Disable Retry */ 289 #define SETFEATURES_EN_AAM 0x42 /* Ena 289 #define SETFEATURES_EN_AAM 0x42 /* Enable Automatic Acoustic Management */ 290 #define SETFEATURES_RW_LONG 0x44 /* Set 290 #define SETFEATURES_RW_LONG 0x44 /* Set Length of VS bytes */ 291 #define SETFEATURES_SET_CACHE 0x54 /* Set 291 #define SETFEATURES_SET_CACHE 0x54 /* Set Cache segments to SC Reg. Val */ 292 #define SETFEATURES_DIS_RLA 0x55 /* Dis 292 #define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */ 293 #define SETFEATURES_EN_RI 0x5D /* Ena 293 #define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */ 294 #define SETFEATURES_EN_SI 0x5E /* Ena 294 #define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */ 295 #define SETFEATURES_DIS_RPOD 0x66 /* Dis 295 #define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */ 296 #define SETFEATURES_DIS_ECC 0x77 /* Dis 296 #define SETFEATURES_DIS_ECC 0x77 /* Disable ECC byte count */ 297 #define SETFEATURES_DIS_8BIT 0x81 /* Dis 297 #define SETFEATURES_DIS_8BIT 0x81 /* Disable 8-Bit Transfers */ 298 #define SETFEATURES_DIS_WCACHE 0x82 /* Dis 298 #define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */ 299 #define SETFEATURES_EN_DEFECT 0x84 /* Ena 299 #define SETFEATURES_EN_DEFECT 0x84 /* Enable Defect Management */ 300 #define SETFEATURES_DIS_APM 0x85 /* Dis 300 #define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */ 301 #define SETFEATURES_EN_ECC 0x88 /* Ena 301 #define SETFEATURES_EN_ECC 0x88 /* Enable ECC byte count */ 302 #define SETFEATURES_EN_MSN 0x95 /* Ena 302 #define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */ 303 #define SETFEATURES_EN_RETRY 0x99 /* Ena 303 #define SETFEATURES_EN_RETRY 0x99 /* Enable Retry */ 304 #define SETFEATURES_EN_RLA 0xAA /* Ena 304 #define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */ 305 #define SETFEATURES_PREFETCH 0xAB /* Set 305 #define SETFEATURES_PREFETCH 0xAB /* Sets drive prefetch value */ 306 #define SETFEATURES_EN_REST 0xAC /* ATA 306 #define SETFEATURES_EN_REST 0xAC /* ATA-1 */ 307 #define SETFEATURES_4B_RW_LONG 0xBB /* Set 307 #define SETFEATURES_4B_RW_LONG 0xBB /* Set Length of 4 bytes */ 308 #define SETFEATURES_DIS_AAM 0xC2 /* Dis 308 #define SETFEATURES_DIS_AAM 0xC2 /* Disable Automatic Acoustic Management */ 309 #define SETFEATURES_EN_RPOD 0xCC /* Ena 309 #define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */ 310 #define SETFEATURES_DIS_RI 0xDD /* Dis 310 #define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt ATAPI */ 311 #define SETFEATURES_EN_SAME_M 0xDD /* for 311 #define SETFEATURES_EN_SAME_M 0xDD /* for a entire device ATA-1 */ 312 #define SETFEATURES_DIS_SI 0xDE /* Dis 312 #define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt ATAPI */ 313 313 314 /* WIN_SECURITY sub-commands */ 314 /* WIN_SECURITY sub-commands */ 315 315 316 #define SECURITY_SET_PASSWORD 0xBA 316 #define SECURITY_SET_PASSWORD 0xBA 317 #define SECURITY_UNLOCK 0xBB 317 #define SECURITY_UNLOCK 0xBB 318 #define SECURITY_ERASE_PREPARE 0xBC 318 #define SECURITY_ERASE_PREPARE 0xBC 319 #define SECURITY_ERASE_UNIT 0xBD 319 #define SECURITY_ERASE_UNIT 0xBD 320 #define SECURITY_FREEZE_LOCK 0xBE 320 #define SECURITY_FREEZE_LOCK 0xBE 321 #define SECURITY_DISABLE_PASSWORD 0xBF 321 #define SECURITY_DISABLE_PASSWORD 0xBF 322 #endif /* __KERNEL__ */ 322 #endif /* __KERNEL__ */ 323 323 324 struct hd_geometry { 324 struct hd_geometry { 325 unsigned char heads; 325 unsigned char heads; 326 unsigned char sectors; 326 unsigned char sectors; 327 unsigned short cylinders; 327 unsigned short cylinders; 328 unsigned long start; 328 unsigned long start; 329 }; 329 }; 330 330 331 /* hd/ide ctl's that pass (arg) ptrs to user s 331 /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */ 332 #define HDIO_GETGEO 0x0301 /* get 332 #define HDIO_GETGEO 0x0301 /* get device geometry */ 333 #define HDIO_GET_UNMASKINTR 0x0302 /* get 333 #define HDIO_GET_UNMASKINTR 0x0302 /* get current unmask setting */ 334 #define HDIO_GET_MULTCOUNT 0x0304 /* get 334 #define HDIO_GET_MULTCOUNT 0x0304 /* get current IDE blockmode setting */ 335 #define HDIO_GET_QDMA 0x0305 /* get 335 #define HDIO_GET_QDMA 0x0305 /* get use-qdma flag */ 336 336 337 #define HDIO_SET_XFER 0x0306 /* set 337 #define HDIO_SET_XFER 0x0306 /* set transfer rate via proc */ 338 338 339 #define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBS 339 #define HDIO_OBSOLETE_IDENTITY 0x0307 /* OBSOLETE, DO NOT USE: returns 142 bytes */ 340 #define HDIO_GET_KEEPSETTINGS 0x0308 /* get 340 #define HDIO_GET_KEEPSETTINGS 0x0308 /* get keep-settings-on-reset flag */ 341 #define HDIO_GET_32BIT 0x0309 /* get 341 #define HDIO_GET_32BIT 0x0309 /* get current io_32bit setting */ 342 #define HDIO_GET_NOWERR 0x030a /* get 342 #define HDIO_GET_NOWERR 0x030a /* get ignore-write-error flag */ 343 #define HDIO_GET_DMA 0x030b /* get 343 #define HDIO_GET_DMA 0x030b /* get use-dma flag */ 344 #define HDIO_GET_NICE 0x030c /* get 344 #define HDIO_GET_NICE 0x030c /* get nice flags */ 345 #define HDIO_GET_IDENTITY 0x030d /* get 345 #define HDIO_GET_IDENTITY 0x030d /* get IDE identification info */ 346 #define HDIO_GET_WCACHE 0x030e /* get 346 #define HDIO_GET_WCACHE 0x030e /* get write cache mode on|off */ 347 #define HDIO_GET_ACOUSTIC 0x030f /* get 347 #define HDIO_GET_ACOUSTIC 0x030f /* get acoustic value */ 348 #define HDIO_GET_ADDRESS 0x0310 /* */ 348 #define HDIO_GET_ADDRESS 0x0310 /* */ 349 349 350 #define HDIO_GET_BUSSTATE 0x031a /* get 350 #define HDIO_GET_BUSSTATE 0x031a /* get the bus state of the hwif */ 351 #define HDIO_TRISTATE_HWIF 0x031b /* exe 351 #define HDIO_TRISTATE_HWIF 0x031b /* execute a channel tristate */ 352 #define HDIO_DRIVE_RESET 0x031c /* exe 352 #define HDIO_DRIVE_RESET 0x031c /* execute a device reset */ 353 #define HDIO_DRIVE_TASKFILE 0x031d /* exe 353 #define HDIO_DRIVE_TASKFILE 0x031d /* execute raw taskfile */ 354 #define HDIO_DRIVE_TASK 0x031e /* exe 354 #define HDIO_DRIVE_TASK 0x031e /* execute task and special drive command */ 355 #define HDIO_DRIVE_CMD 0x031f /* exe 355 #define HDIO_DRIVE_CMD 0x031f /* execute a special drive command */ 356 #define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TAS 356 #define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK 357 357 358 /* hd/ide ctl's that pass (arg) non-ptr values 358 /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */ 359 #define HDIO_SET_MULTCOUNT 0x0321 /* cha 359 #define HDIO_SET_MULTCOUNT 0x0321 /* change IDE blockmode */ 360 #define HDIO_SET_UNMASKINTR 0x0322 /* per 360 #define HDIO_SET_UNMASKINTR 0x0322 /* permit other irqs during I/O */ 361 #define HDIO_SET_KEEPSETTINGS 0x0323 /* kee 361 #define HDIO_SET_KEEPSETTINGS 0x0323 /* keep ioctl settings on reset */ 362 #define HDIO_SET_32BIT 0x0324 /* cha 362 #define HDIO_SET_32BIT 0x0324 /* change io_32bit flags */ 363 #define HDIO_SET_NOWERR 0x0325 /* cha 363 #define HDIO_SET_NOWERR 0x0325 /* change ignore-write-error flag */ 364 #define HDIO_SET_DMA 0x0326 /* cha 364 #define HDIO_SET_DMA 0x0326 /* change use-dma flag */ 365 #define HDIO_SET_PIO_MODE 0x0327 /* rec 365 #define HDIO_SET_PIO_MODE 0x0327 /* reconfig interface to new speed */ 366 #ifndef __KERNEL__ 366 #ifndef __KERNEL__ 367 #define HDIO_SCAN_HWIF 0x0328 /* reg 367 #define HDIO_SCAN_HWIF 0x0328 /* register and (re)scan interface */ 368 #define HDIO_UNREGISTER_HWIF 0x032a /* unr 368 #define HDIO_UNREGISTER_HWIF 0x032a /* unregister interface */ 369 #endif 369 #endif 370 #define HDIO_SET_NICE 0x0329 /* set 370 #define HDIO_SET_NICE 0x0329 /* set nice flags */ 371 #define HDIO_SET_WCACHE 0x032b /* cha 371 #define HDIO_SET_WCACHE 0x032b /* change write cache enable-disable */ 372 #define HDIO_SET_ACOUSTIC 0x032c /* cha 372 #define HDIO_SET_ACOUSTIC 0x032c /* change acoustic behavior */ 373 #define HDIO_SET_BUSSTATE 0x032d /* set 373 #define HDIO_SET_BUSSTATE 0x032d /* set the bus state of the hwif */ 374 #define HDIO_SET_QDMA 0x032e /* cha 374 #define HDIO_SET_QDMA 0x032e /* change use-qdma flag */ 375 #define HDIO_SET_ADDRESS 0x032f /* cha 375 #define HDIO_SET_ADDRESS 0x032f /* change lba addressing modes */ 376 376 377 /* bus states */ 377 /* bus states */ 378 enum { 378 enum { 379 BUSSTATE_OFF = 0, 379 BUSSTATE_OFF = 0, 380 BUSSTATE_ON, 380 BUSSTATE_ON, 381 BUSSTATE_TRISTATE 381 BUSSTATE_TRISTATE 382 }; 382 }; 383 383 384 /* hd/ide ctl's that pass (arg) ptrs to user s 384 /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */ 385 /* 0x330 is reserved - used to be HDIO_GETGEO_ 385 /* 0x330 is reserved - used to be HDIO_GETGEO_BIG */ 386 /* 0x331 is reserved - used to be HDIO_GETGEO_ 386 /* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */ 387 /* 0x338 is reserved - used to be HDIO_SET_IDE 387 /* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */ 388 /* 0x339 is reserved - used to be HDIO_SET_SCS 388 /* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */ 389 389 390 #define __NEW_HD_DRIVE_ID 390 #define __NEW_HD_DRIVE_ID 391 391 392 #ifndef __KERNEL__ 392 #ifndef __KERNEL__ 393 /* 393 /* 394 * Structure returned by HDIO_GET_IDENTITY, as 394 * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec. 395 * 395 * 396 * If you change something here, please rememb 396 * If you change something here, please remember to update fix_driveid() in 397 * ide/probe.c. 397 * ide/probe.c. 398 */ 398 */ 399 struct hd_driveid { 399 struct hd_driveid { 400 unsigned short config; /* lot 400 unsigned short config; /* lots of obsolete bit flags */ 401 unsigned short cyls; /* Obs 401 unsigned short cyls; /* Obsolete, "physical" cyls */ 402 unsigned short reserved2; /* res 402 unsigned short reserved2; /* reserved (word 2) */ 403 unsigned short heads; /* Obs 403 unsigned short heads; /* Obsolete, "physical" heads */ 404 unsigned short track_bytes; /* unf 404 unsigned short track_bytes; /* unformatted bytes per track */ 405 unsigned short sector_bytes; /* unf 405 unsigned short sector_bytes; /* unformatted bytes per sector */ 406 unsigned short sectors; /* Obs 406 unsigned short sectors; /* Obsolete, "physical" sectors per track */ 407 unsigned short vendor0; /* ven 407 unsigned short vendor0; /* vendor unique */ 408 unsigned short vendor1; /* ven 408 unsigned short vendor1; /* vendor unique */ 409 unsigned short vendor2; /* Ret 409 unsigned short vendor2; /* Retired vendor unique */ 410 unsigned char serial_no[20]; /* 0 = 410 unsigned char serial_no[20]; /* 0 = not_specified */ 411 unsigned short buf_type; /* Ret 411 unsigned short buf_type; /* Retired */ 412 unsigned short buf_size; /* Ret 412 unsigned short buf_size; /* Retired, 512 byte increments 413 * 0 = 413 * 0 = not_specified 414 */ 414 */ 415 unsigned short ecc_bytes; /* for 415 unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */ 416 unsigned char fw_rev[8]; /* 0 = 416 unsigned char fw_rev[8]; /* 0 = not_specified */ 417 unsigned char model[40]; /* 0 = 417 unsigned char model[40]; /* 0 = not_specified */ 418 unsigned char max_multsect; /* 0=n 418 unsigned char max_multsect; /* 0=not_implemented */ 419 unsigned char vendor3; /* ven 419 unsigned char vendor3; /* vendor unique */ 420 unsigned short dword_io; /* 0=n 420 unsigned short dword_io; /* 0=not_implemented; 1=implemented */ 421 unsigned char vendor4; /* ven 421 unsigned char vendor4; /* vendor unique */ 422 unsigned char capability; /* (up 422 unsigned char capability; /* (upper byte of word 49) 423 * 3: 423 * 3: IORDYsup 424 * 2: 424 * 2: IORDYsw 425 * 1: 425 * 1: LBA 426 * 0: 426 * 0: DMA 427 */ 427 */ 428 unsigned short reserved50; /* res 428 unsigned short reserved50; /* reserved (word 50) */ 429 unsigned char vendor5; /* Obs 429 unsigned char vendor5; /* Obsolete, vendor unique */ 430 unsigned char tPIO; /* Obs 430 unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */ 431 unsigned char vendor6; /* Obs 431 unsigned char vendor6; /* Obsolete, vendor unique */ 432 unsigned char tDMA; /* Obs 432 unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */ 433 unsigned short field_valid; /* (wo 433 unsigned short field_valid; /* (word 53) 434 * 2: 434 * 2: ultra_ok word 88 435 * 1: 435 * 1: eide_ok words 64-70 436 * 0: 436 * 0: cur_ok words 54-58 437 */ 437 */ 438 unsigned short cur_cyls; /* Obs 438 unsigned short cur_cyls; /* Obsolete, logical cylinders */ 439 unsigned short cur_heads; /* Obs 439 unsigned short cur_heads; /* Obsolete, l heads */ 440 unsigned short cur_sectors; /* Obs 440 unsigned short cur_sectors; /* Obsolete, l sectors per track */ 441 unsigned short cur_capacity0; /* Obs 441 unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */ 442 unsigned short cur_capacity1; /* Obs 442 unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */ 443 unsigned char multsect; /* cur 443 unsigned char multsect; /* current multiple sector count */ 444 unsigned char multsect_valid; /* whe 444 unsigned char multsect_valid; /* when (bit0==1) multsect is ok */ 445 unsigned int lba_capacity; /* Obs 445 unsigned int lba_capacity; /* Obsolete, total number of sectors */ 446 unsigned short dma_1word; /* Obs 446 unsigned short dma_1word; /* Obsolete, single-word dma info */ 447 unsigned short dma_mword; /* mul 447 unsigned short dma_mword; /* multiple-word dma info */ 448 unsigned short eide_pio_modes; /* bit 448 unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */ 449 unsigned short eide_dma_min; /* min 449 unsigned short eide_dma_min; /* min mword dma cycle time (ns) */ 450 unsigned short eide_dma_time; /* rec 450 unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */ 451 unsigned short eide_pio; /* min 451 unsigned short eide_pio; /* min cycle time (ns), no IORDY */ 452 unsigned short eide_pio_iordy; /* min 452 unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */ 453 unsigned short words69_70[2]; /* res 453 unsigned short words69_70[2]; /* reserved words 69-70 454 * fut 454 * future command overlap and queuing 455 */ 455 */ 456 unsigned short words71_74[4]; /* res 456 unsigned short words71_74[4]; /* reserved words 71-74 457 * for 457 * for IDENTIFY PACKET DEVICE command 458 */ 458 */ 459 unsigned short queue_depth; /* (wo 459 unsigned short queue_depth; /* (word 75) 460 * 15: 460 * 15:5 reserved 461 * 4: 461 * 4:0 Maximum queue depth -1 462 */ 462 */ 463 unsigned short words76_79[4]; /* res 463 unsigned short words76_79[4]; /* reserved words 76-79 */ 464 unsigned short major_rev_num; /* (wo 464 unsigned short major_rev_num; /* (word 80) */ 465 unsigned short minor_rev_num; /* (wo 465 unsigned short minor_rev_num; /* (word 81) */ 466 unsigned short command_set_1; /* (wo 466 unsigned short command_set_1; /* (word 82) supported 467 * 15: 467 * 15: Obsolete 468 * 14: 468 * 14: NOP command 469 * 13: 469 * 13: READ_BUFFER 470 * 12: 470 * 12: WRITE_BUFFER 471 * 11: 471 * 11: Obsolete 472 * 10: 472 * 10: Host Protected Area 473 * 9: 473 * 9: DEVICE Reset 474 * 8: 474 * 8: SERVICE Interrupt 475 * 7: 475 * 7: Release Interrupt 476 * 6: 476 * 6: look-ahead 477 * 5: 477 * 5: write cache 478 * 4: 478 * 4: PACKET Command 479 * 3: 479 * 3: Power Management Feature Set 480 * 2: 480 * 2: Removable Feature Set 481 * 1: 481 * 1: Security Feature Set 482 * 0: 482 * 0: SMART Feature Set 483 */ 483 */ 484 unsigned short command_set_2; /* (wo 484 unsigned short command_set_2; /* (word 83) 485 * 15: 485 * 15: Shall be ZERO 486 * 14: 486 * 14: Shall be ONE 487 * 13: 487 * 13: FLUSH CACHE EXT 488 * 12: 488 * 12: FLUSH CACHE 489 * 11: 489 * 11: Device Configuration Overlay 490 * 10: 490 * 10: 48-bit Address Feature Set 491 * 9: 491 * 9: Automatic Acoustic Management 492 * 8: 492 * 8: SET MAX security 493 * 7: 493 * 7: reserved 1407DT PARTIES 494 * 6: 494 * 6: SetF sub-command Power-Up 495 * 5: 495 * 5: Power-Up in Standby Feature Set 496 * 4: 496 * 4: Removable Media Notification 497 * 3: 497 * 3: APM Feature Set 498 * 2: 498 * 2: CFA Feature Set 499 * 1: 499 * 1: READ/WRITE DMA QUEUED 500 * 0: 500 * 0: Download MicroCode 501 */ 501 */ 502 unsigned short cfsse; /* (wo 502 unsigned short cfsse; /* (word 84) 503 * cmd 503 * cmd set-feature supported extensions 504 * 15: 504 * 15: Shall be ZERO 505 * 14: 505 * 14: Shall be ONE 506 * 13: 506 * 13:6 reserved 507 * 5: 507 * 5: General Purpose Logging 508 * 4: 508 * 4: Streaming Feature Set 509 * 3: 509 * 3: Media Card Pass Through 510 * 2: 510 * 2: Media Serial Number Valid 511 * 1: 511 * 1: SMART selt-test supported 512 * 0: 512 * 0: SMART error logging 513 */ 513 */ 514 unsigned short cfs_enable_1; /* (wo 514 unsigned short cfs_enable_1; /* (word 85) 515 * com 515 * command set-feature enabled 516 * 15: 516 * 15: Obsolete 517 * 14: 517 * 14: NOP command 518 * 13: 518 * 13: READ_BUFFER 519 * 12: 519 * 12: WRITE_BUFFER 520 * 11: 520 * 11: Obsolete 521 * 10: 521 * 10: Host Protected Area 522 * 9: 522 * 9: DEVICE Reset 523 * 8: 523 * 8: SERVICE Interrupt 524 * 7: 524 * 7: Release Interrupt 525 * 6: 525 * 6: look-ahead 526 * 5: 526 * 5: write cache 527 * 4: 527 * 4: PACKET Command 528 * 3: 528 * 3: Power Management Feature Set 529 * 2: 529 * 2: Removable Feature Set 530 * 1: 530 * 1: Security Feature Set 531 * 0: 531 * 0: SMART Feature Set 532 */ 532 */ 533 unsigned short cfs_enable_2; /* (wo 533 unsigned short cfs_enable_2; /* (word 86) 534 * com 534 * command set-feature enabled 535 * 15: 535 * 15: Shall be ZERO 536 * 14: 536 * 14: Shall be ONE 537 * 13: 537 * 13: FLUSH CACHE EXT 538 * 12: 538 * 12: FLUSH CACHE 539 * 11: 539 * 11: Device Configuration Overlay 540 * 10: 540 * 10: 48-bit Address Feature Set 541 * 9: 541 * 9: Automatic Acoustic Management 542 * 8: 542 * 8: SET MAX security 543 * 7: 543 * 7: reserved 1407DT PARTIES 544 * 6: 544 * 6: SetF sub-command Power-Up 545 * 5: 545 * 5: Power-Up in Standby Feature Set 546 * 4: 546 * 4: Removable Media Notification 547 * 3: 547 * 3: APM Feature Set 548 * 2: 548 * 2: CFA Feature Set 549 * 1: 549 * 1: READ/WRITE DMA QUEUED 550 * 0: 550 * 0: Download MicroCode 551 */ 551 */ 552 unsigned short csf_default; /* (wo 552 unsigned short csf_default; /* (word 87) 553 * com 553 * command set-feature default 554 * 15: 554 * 15: Shall be ZERO 555 * 14: 555 * 14: Shall be ONE 556 * 13: 556 * 13:6 reserved 557 * 5: 557 * 5: General Purpose Logging enabled 558 * 4: 558 * 4: Valid CONFIGURE STREAM executed 559 * 3: 559 * 3: Media Card Pass Through enabled 560 * 2: 560 * 2: Media Serial Number Valid 561 * 1: 561 * 1: SMART selt-test supported 562 * 0: 562 * 0: SMART error logging 563 */ 563 */ 564 unsigned short dma_ultra; /* (wo 564 unsigned short dma_ultra; /* (word 88) */ 565 unsigned short trseuc; /* tim 565 unsigned short trseuc; /* time required for security erase */ 566 unsigned short trsEuc; /* tim 566 unsigned short trsEuc; /* time required for enhanced erase */ 567 unsigned short CurAPMvalues; /* cur 567 unsigned short CurAPMvalues; /* current APM values */ 568 unsigned short mprc; /* mas 568 unsigned short mprc; /* master password revision code */ 569 unsigned short hw_config; /* har 569 unsigned short hw_config; /* hardware config (word 93) 570 * 15: 570 * 15: Shall be ZERO 571 * 14: 571 * 14: Shall be ONE 572 * 13: 572 * 13: 573 * 12: 573 * 12: 574 * 11: 574 * 11: 575 * 10: 575 * 10: 576 * 9: 576 * 9: 577 * 8: 577 * 8: 578 * 7: 578 * 7: 579 * 6: 579 * 6: 580 * 5: 580 * 5: 581 * 4: 581 * 4: 582 * 3: 582 * 3: 583 * 2: 583 * 2: 584 * 1: 584 * 1: 585 * 0: 585 * 0: Shall be ONE 586 */ 586 */ 587 unsigned short acoustic; /* (wo 587 unsigned short acoustic; /* (word 94) 588 * 15: 588 * 15:8 Vendor's recommended value 589 * 7: 589 * 7:0 current value 590 */ 590 */ 591 unsigned short msrqs; /* min 591 unsigned short msrqs; /* min stream request size */ 592 unsigned short sxfert; /* str 592 unsigned short sxfert; /* stream transfer time */ 593 unsigned short sal; /* str 593 unsigned short sal; /* stream access latency */ 594 unsigned int spg; /* str 594 unsigned int spg; /* stream performance granularity */ 595 unsigned long long lba_capacity_2;/* 4 595 unsigned long long lba_capacity_2;/* 48-bit total number of sectors */ 596 unsigned short words104_125[22];/* re 596 unsigned short words104_125[22];/* reserved words 104-125 */ 597 unsigned short last_lun; /* (wo 597 unsigned short last_lun; /* (word 126) */ 598 unsigned short word127; /* (wo 598 unsigned short word127; /* (word 127) Feature Set 599 * Rem 599 * Removable Media Notification 600 * 15: 600 * 15:2 reserved 601 * 1: 601 * 1:0 00 = not supported 602 * 602 * 01 = supported 603 * 603 * 10 = reserved 604 * 604 * 11 = reserved 605 */ 605 */ 606 unsigned short dlf; /* (wo 606 unsigned short dlf; /* (word 128) 607 * dev 607 * device lock function 608 * 15: 608 * 15:9 reserved 609 * 8 609 * 8 security level 1:max 0:high 610 * 7: 610 * 7:6 reserved 611 * 5 611 * 5 enhanced erase 612 * 4 612 * 4 expire 613 * 3 613 * 3 frozen 614 * 2 614 * 2 locked 615 * 1 615 * 1 en/disabled 616 * 0 616 * 0 capability 617 */ 617 */ 618 unsigned short csfo; /* (w 618 unsigned short csfo; /* (word 129) 619 * cur 619 * current set features options 620 * 15: 620 * 15:4 reserved 621 * 3: 621 * 3: auto reassign 622 * 2: 622 * 2: reverting 623 * 1: 623 * 1: read-look-ahead 624 * 0: 624 * 0: write cache 625 */ 625 */ 626 unsigned short words130_155[26];/* re 626 unsigned short words130_155[26];/* reserved vendor words 130-155 */ 627 unsigned short word156; /* res 627 unsigned short word156; /* reserved vendor word 156 */ 628 unsigned short words157_159[3];/* res 628 unsigned short words157_159[3];/* reserved vendor words 157-159 */ 629 unsigned short cfa_power; /* (wo 629 unsigned short cfa_power; /* (word 160) CFA Power Mode 630 * 15 630 * 15 word 160 supported 631 * 14 631 * 14 reserved 632 * 13 632 * 13 633 * 12 633 * 12 634 * 11: 634 * 11:0 635 */ 635 */ 636 unsigned short words161_175[15];/* Re 636 unsigned short words161_175[15];/* Reserved for CFA */ 637 unsigned short words176_205[30];/* Cu 637 unsigned short words176_205[30];/* Current Media Serial Number */ 638 unsigned short words206_254[49];/* re 638 unsigned short words206_254[49];/* reserved words 206-254 */ 639 unsigned short integrity_word; /* (wo 639 unsigned short integrity_word; /* (word 255) 640 * 15: 640 * 15:8 Checksum 641 * 7: 641 * 7:0 Signature 642 */ 642 */ 643 }; 643 }; 644 #endif /* __KERNEL__ */ 644 #endif /* __KERNEL__ */ 645 645 646 /* 646 /* 647 * IDE "nice" flags. These are used on a per d 647 * IDE "nice" flags. These are used on a per drive basis to determine 648 * when to be nice and give more bandwidth to 648 * when to be nice and give more bandwidth to the other devices which 649 * share the same IDE bus. 649 * share the same IDE bus. 650 */ 650 */ 651 #define IDE_NICE_DSC_OVERLAP (0) /* per 651 #define IDE_NICE_DSC_OVERLAP (0) /* per the DSC overlap protocol */ 652 #define IDE_NICE_ATAPI_OVERLAP (1) /* not 652 #define IDE_NICE_ATAPI_OVERLAP (1) /* not supported yet */ 653 #define IDE_NICE_1 (3) /* whe 653 #define IDE_NICE_1 (3) /* when probably won't affect us much */ 654 #ifndef __KERNEL__ 654 #ifndef __KERNEL__ 655 #define IDE_NICE_0 (2) /* whe 655 #define IDE_NICE_0 (2) /* when sure that it won't affect us */ 656 #define IDE_NICE_2 (4) /* whe 656 #define IDE_NICE_2 (4) /* when we know it's on our expense */ 657 #endif 657 #endif 658 658 659 #endif /* _LINUX_HDREG_H */ 659 #endif /* _LINUX_HDREG_H */ 660 660
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.