Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _LINUX_HDREG_H
0003 #define _LINUX_HDREG_H
0004 
0005 #include <linux/types.h>
0006 
0007 /*
0008  * Command Header sizes for IOCTL commands
0009  */
0010 
0011 #define HDIO_DRIVE_CMD_HDR_SIZE     (4 * sizeof(__u8))
0012 #define HDIO_DRIVE_HOB_HDR_SIZE     (8 * sizeof(__u8))
0013 #define HDIO_DRIVE_TASK_HDR_SIZE    (8 * sizeof(__u8))
0014 
0015 #define IDE_DRIVE_TASK_NO_DATA      0
0016 #ifndef __KERNEL__
0017 #define IDE_DRIVE_TASK_INVALID      -1
0018 #define IDE_DRIVE_TASK_SET_XFER     1
0019 #define IDE_DRIVE_TASK_IN       2
0020 #define IDE_DRIVE_TASK_OUT      3
0021 #endif
0022 #define IDE_DRIVE_TASK_RAW_WRITE    4
0023 
0024 /*
0025  * Define standard taskfile in/out register
0026  */
0027 #define IDE_TASKFILE_STD_IN_FLAGS   0xFE
0028 #define IDE_HOB_STD_IN_FLAGS        0x3C
0029 #ifndef __KERNEL__
0030 #define IDE_TASKFILE_STD_OUT_FLAGS  0xFE
0031 #define IDE_HOB_STD_OUT_FLAGS       0x3C
0032 
0033 typedef unsigned char task_ioreg_t;
0034 typedef unsigned long sata_ioreg_t;
0035 #endif
0036 
0037 typedef union ide_reg_valid_s {
0038     unsigned all                : 16;
0039     struct {
0040         unsigned data           : 1;
0041         unsigned error_feature      : 1;
0042         unsigned sector         : 1;
0043         unsigned nsector        : 1;
0044         unsigned lcyl           : 1;
0045         unsigned hcyl           : 1;
0046         unsigned select         : 1;
0047         unsigned status_command     : 1;
0048 
0049         unsigned data_hob       : 1;
0050         unsigned error_feature_hob  : 1;
0051         unsigned sector_hob     : 1;
0052         unsigned nsector_hob        : 1;
0053         unsigned lcyl_hob       : 1;
0054         unsigned hcyl_hob       : 1;
0055         unsigned select_hob     : 1;
0056         unsigned control_hob        : 1;
0057     } b;
0058 } ide_reg_valid_t;
0059 
0060 typedef struct ide_task_request_s {
0061     __u8        io_ports[8];
0062     __u8        hob_ports[8]; /* bytes 6 and 7 are unused */
0063     ide_reg_valid_t out_flags;
0064     ide_reg_valid_t in_flags;
0065     int     data_phase;
0066     int     req_cmd;
0067     unsigned long   out_size;
0068     unsigned long   in_size;
0069 } ide_task_request_t;
0070 
0071 typedef struct ide_ioctl_request_s {
0072     ide_task_request_t  *task_request;
0073     unsigned char       *out_buffer;
0074     unsigned char       *in_buffer;
0075 } ide_ioctl_request_t;
0076 
0077 struct hd_drive_cmd_hdr {
0078     __u8 command;
0079     __u8 sector_number;
0080     __u8 feature;
0081     __u8 sector_count;
0082 };
0083 
0084 #ifndef __KERNEL__
0085 typedef struct hd_drive_task_hdr {
0086     __u8 data;
0087     __u8 feature;
0088     __u8 sector_count;
0089     __u8 sector_number;
0090     __u8 low_cylinder;
0091     __u8 high_cylinder;
0092     __u8 device_head;
0093     __u8 command;
0094 } task_struct_t;
0095 
0096 typedef struct hd_drive_hob_hdr {
0097     __u8 data;
0098     __u8 feature;
0099     __u8 sector_count;
0100     __u8 sector_number;
0101     __u8 low_cylinder;
0102     __u8 high_cylinder;
0103     __u8 device_head;
0104     __u8 control;
0105 } hob_struct_t;
0106 #endif
0107 
0108 #define TASKFILE_NO_DATA        0x0000
0109 
0110 #define TASKFILE_IN         0x0001
0111 #define TASKFILE_MULTI_IN       0x0002
0112 
0113 #define TASKFILE_OUT            0x0004
0114 #define TASKFILE_MULTI_OUT      0x0008
0115 #define TASKFILE_IN_OUT         0x0010
0116 
0117 #define TASKFILE_IN_DMA         0x0020
0118 #define TASKFILE_OUT_DMA        0x0040
0119 #define TASKFILE_IN_DMAQ        0x0080
0120 #define TASKFILE_OUT_DMAQ       0x0100
0121 
0122 #ifndef __KERNEL__
0123 #define TASKFILE_P_IN           0x0200
0124 #define TASKFILE_P_OUT          0x0400
0125 #define TASKFILE_P_IN_DMA       0x0800
0126 #define TASKFILE_P_OUT_DMA      0x1000
0127 #define TASKFILE_P_IN_DMAQ      0x2000
0128 #define TASKFILE_P_OUT_DMAQ     0x4000
0129 #define TASKFILE_48         0x8000
0130 #define TASKFILE_INVALID        0x7fff
0131 #endif
0132 
0133 #ifndef __KERNEL__
0134 /* ATA/ATAPI Commands pre T13 Spec */
0135 #define WIN_NOP             0x00
0136 /*
0137  *  0x01->0x02 Reserved
0138  */
0139 #define CFA_REQ_EXT_ERROR_CODE      0x03 /* CFA Request Extended Error Code */
0140 /*
0141  *  0x04->0x07 Reserved
0142  */
0143 #define WIN_SRST            0x08 /* ATAPI soft reset command */
0144 #define WIN_DEVICE_RESET        0x08
0145 /*
0146  *  0x09->0x0F Reserved
0147  */
0148 #define WIN_RECAL           0x10
0149 #define WIN_RESTORE         WIN_RECAL
0150 /*
0151  *  0x10->0x1F Reserved
0152  */
0153 #define WIN_READ            0x20 /* 28-Bit */
0154 #define WIN_READ_ONCE           0x21 /* 28-Bit without retries */
0155 #define WIN_READ_LONG           0x22 /* 28-Bit */
0156 #define WIN_READ_LONG_ONCE      0x23 /* 28-Bit without retries */
0157 #define WIN_READ_EXT            0x24 /* 48-Bit */
0158 #define WIN_READDMA_EXT         0x25 /* 48-Bit */
0159 #define WIN_READDMA_QUEUED_EXT      0x26 /* 48-Bit */
0160 #define WIN_READ_NATIVE_MAX_EXT     0x27 /* 48-Bit */
0161 /*
0162  *  0x28
0163  */
0164 #define WIN_MULTREAD_EXT        0x29 /* 48-Bit */
0165 /*
0166  *  0x2A->0x2F Reserved
0167  */
0168 #define WIN_WRITE           0x30 /* 28-Bit */
0169 #define WIN_WRITE_ONCE          0x31 /* 28-Bit without retries */
0170 #define WIN_WRITE_LONG          0x32 /* 28-Bit */
0171 #define WIN_WRITE_LONG_ONCE     0x33 /* 28-Bit without retries */
0172 #define WIN_WRITE_EXT           0x34 /* 48-Bit */
0173 #define WIN_WRITEDMA_EXT        0x35 /* 48-Bit */
0174 #define WIN_WRITEDMA_QUEUED_EXT     0x36 /* 48-Bit */
0175 #define WIN_SET_MAX_EXT         0x37 /* 48-Bit */
0176 #define CFA_WRITE_SECT_WO_ERASE     0x38 /* CFA Write Sectors without erase */
0177 #define WIN_MULTWRITE_EXT       0x39 /* 48-Bit */
0178 /*
0179  *  0x3A->0x3B Reserved
0180  */
0181 #define WIN_WRITE_VERIFY        0x3C /* 28-Bit */
0182 /*
0183  *  0x3D->0x3F Reserved
0184  */
0185 #define WIN_VERIFY          0x40 /* 28-Bit - Read Verify Sectors */
0186 #define WIN_VERIFY_ONCE         0x41 /* 28-Bit - without retries */
0187 #define WIN_VERIFY_EXT          0x42 /* 48-Bit */
0188 /*
0189  *  0x43->0x4F Reserved
0190  */
0191 #define WIN_FORMAT          0x50
0192 /*
0193  *  0x51->0x5F Reserved
0194  */
0195 #define WIN_INIT            0x60
0196 /*
0197  *  0x61->0x5F Reserved
0198  */
0199 #define WIN_SEEK            0x70 /* 0x70-0x7F Reserved */
0200 
0201 #define CFA_TRANSLATE_SECTOR        0x87 /* CFA Translate Sector */
0202 #define WIN_DIAGNOSE            0x90
0203 #define WIN_SPECIFY         0x91 /* set drive geometry translation */
0204 #define WIN_DOWNLOAD_MICROCODE      0x92
0205 #define WIN_STANDBYNOW2         0x94
0206 #define WIN_STANDBY2            0x96
0207 #define WIN_SETIDLE2            0x97
0208 #define WIN_CHECKPOWERMODE2     0x98
0209 #define WIN_SLEEPNOW2           0x99
0210 /*
0211  *  0x9A VENDOR
0212  */
0213 #define WIN_PACKETCMD           0xA0 /* Send a packet command. */
0214 #define WIN_PIDENTIFY           0xA1 /* identify ATAPI device   */
0215 #define WIN_QUEUED_SERVICE      0xA2
0216 #define WIN_SMART           0xB0 /* self-monitoring and reporting */
0217 #define CFA_ERASE_SECTORS       0xC0
0218 #define WIN_MULTREAD            0xC4 /* read sectors using multiple mode*/
0219 #define WIN_MULTWRITE           0xC5 /* write sectors using multiple mode */
0220 #define WIN_SETMULT         0xC6 /* enable/disable multiple mode */
0221 #define WIN_READDMA_QUEUED      0xC7 /* read sectors using Queued DMA transfers */
0222 #define WIN_READDMA         0xC8 /* read sectors using DMA transfers */
0223 #define WIN_READDMA_ONCE        0xC9 /* 28-Bit - without retries */
0224 #define WIN_WRITEDMA            0xCA /* write sectors using DMA transfers */
0225 #define WIN_WRITEDMA_ONCE       0xCB /* 28-Bit - without retries */
0226 #define WIN_WRITEDMA_QUEUED     0xCC /* write sectors using Queued DMA transfers */
0227 #define CFA_WRITE_MULTI_WO_ERASE    0xCD /* CFA Write multiple without erase */
0228 #define WIN_GETMEDIASTATUS      0xDA
0229 #define WIN_ACKMEDIACHANGE      0xDB /* ATA-1, ATA-2 vendor */
0230 #define WIN_POSTBOOT            0xDC
0231 #define WIN_PREBOOT             0xDD
0232 #define WIN_DOORLOCK            0xDE /* lock door on removable drives */
0233 #define WIN_DOORUNLOCK          0xDF /* unlock door on removable drives */
0234 #define WIN_STANDBYNOW1         0xE0
0235 #define WIN_IDLEIMMEDIATE       0xE1 /* force drive to become "ready" */
0236 #define WIN_STANDBY         0xE2 /* Set device in Standby Mode */
0237 #define WIN_SETIDLE1            0xE3
0238 #define WIN_READ_BUFFER         0xE4 /* force read only 1 sector */
0239 #define WIN_CHECKPOWERMODE1     0xE5
0240 #define WIN_SLEEPNOW1           0xE6
0241 #define WIN_FLUSH_CACHE         0xE7
0242 #define WIN_WRITE_BUFFER        0xE8 /* force write only 1 sector */
0243 #define WIN_WRITE_SAME          0xE9 /* read ata-2 to use */
0244     /* SET_FEATURES 0x22 or 0xDD */
0245 #define WIN_FLUSH_CACHE_EXT     0xEA /* 48-Bit */
0246 #define WIN_IDENTIFY            0xEC /* ask drive to identify itself    */
0247 #define WIN_MEDIAEJECT          0xED
0248 #define WIN_IDENTIFY_DMA        0xEE /* same as WIN_IDENTIFY, but DMA */
0249 #define WIN_SETFEATURES         0xEF /* set special drive features */
0250 #define EXABYTE_ENABLE_NEST     0xF0
0251 #define WIN_SECURITY_SET_PASS       0xF1
0252 #define WIN_SECURITY_UNLOCK     0xF2
0253 #define WIN_SECURITY_ERASE_PREPARE  0xF3
0254 #define WIN_SECURITY_ERASE_UNIT     0xF4
0255 #define WIN_SECURITY_FREEZE_LOCK    0xF5
0256 #define WIN_SECURITY_DISABLE        0xF6
0257 #define WIN_READ_NATIVE_MAX     0xF8 /* return the native maximum address */
0258 #define WIN_SET_MAX         0xF9
0259 #define DISABLE_SEAGATE         0xFB
0260 
0261 /* WIN_SMART sub-commands */
0262 
0263 #define SMART_READ_VALUES       0xD0
0264 #define SMART_READ_THRESHOLDS       0xD1
0265 #define SMART_AUTOSAVE          0xD2
0266 #define SMART_SAVE          0xD3
0267 #define SMART_IMMEDIATE_OFFLINE     0xD4
0268 #define SMART_READ_LOG_SECTOR       0xD5
0269 #define SMART_WRITE_LOG_SECTOR      0xD6
0270 #define SMART_WRITE_THRESHOLDS      0xD7
0271 #define SMART_ENABLE            0xD8
0272 #define SMART_DISABLE           0xD9
0273 #define SMART_STATUS            0xDA
0274 #define SMART_AUTO_OFFLINE      0xDB
0275 
0276 /* Password used in TF4 & TF5 executing SMART commands */
0277 
0278 #define SMART_LCYL_PASS         0x4F
0279 #define SMART_HCYL_PASS         0xC2
0280 
0281 /* WIN_SETFEATURES sub-commands */
0282 #define SETFEATURES_EN_8BIT 0x01    /* Enable 8-Bit Transfers */
0283 #define SETFEATURES_EN_WCACHE   0x02    /* Enable write cache */
0284 #define SETFEATURES_DIS_DEFECT  0x04    /* Disable Defect Management */
0285 #define SETFEATURES_EN_APM  0x05    /* Enable advanced power management */
0286 #define SETFEATURES_EN_SAME_R   0x22    /* for a region ATA-1 */
0287 #define SETFEATURES_DIS_MSN 0x31    /* Disable Media Status Notification */
0288 #define SETFEATURES_DIS_RETRY   0x33    /* Disable Retry */
0289 #define SETFEATURES_EN_AAM  0x42    /* Enable Automatic Acoustic Management */
0290 #define SETFEATURES_RW_LONG 0x44    /* Set Length of VS bytes */
0291 #define SETFEATURES_SET_CACHE   0x54    /* Set Cache segments to SC Reg. Val */
0292 #define SETFEATURES_DIS_RLA 0x55    /* Disable read look-ahead feature */
0293 #define SETFEATURES_EN_RI   0x5D    /* Enable release interrupt */
0294 #define SETFEATURES_EN_SI   0x5E    /* Enable SERVICE interrupt */
0295 #define SETFEATURES_DIS_RPOD    0x66    /* Disable reverting to power on defaults */
0296 #define SETFEATURES_DIS_ECC 0x77    /* Disable ECC byte count */
0297 #define SETFEATURES_DIS_8BIT    0x81    /* Disable 8-Bit Transfers */
0298 #define SETFEATURES_DIS_WCACHE  0x82    /* Disable write cache */
0299 #define SETFEATURES_EN_DEFECT   0x84    /* Enable Defect Management */
0300 #define SETFEATURES_DIS_APM 0x85    /* Disable advanced power management */
0301 #define SETFEATURES_EN_ECC  0x88    /* Enable ECC byte count */
0302 #define SETFEATURES_EN_MSN  0x95    /* Enable Media Status Notification */
0303 #define SETFEATURES_EN_RETRY    0x99    /* Enable Retry */
0304 #define SETFEATURES_EN_RLA  0xAA    /* Enable read look-ahead feature */
0305 #define SETFEATURES_PREFETCH    0xAB    /* Sets drive prefetch value */
0306 #define SETFEATURES_EN_REST 0xAC    /* ATA-1 */
0307 #define SETFEATURES_4B_RW_LONG  0xBB    /* Set Length of 4 bytes */
0308 #define SETFEATURES_DIS_AAM 0xC2    /* Disable Automatic Acoustic Management */
0309 #define SETFEATURES_EN_RPOD 0xCC    /* Enable reverting to power on defaults */
0310 #define SETFEATURES_DIS_RI  0xDD    /* Disable release interrupt ATAPI */
0311 #define SETFEATURES_EN_SAME_M   0xDD    /* for a entire device ATA-1 */
0312 #define SETFEATURES_DIS_SI  0xDE    /* Disable SERVICE interrupt ATAPI */
0313 
0314 /* WIN_SECURITY sub-commands */
0315 
0316 #define SECURITY_SET_PASSWORD       0xBA
0317 #define SECURITY_UNLOCK         0xBB
0318 #define SECURITY_ERASE_PREPARE      0xBC
0319 #define SECURITY_ERASE_UNIT     0xBD
0320 #define SECURITY_FREEZE_LOCK        0xBE
0321 #define SECURITY_DISABLE_PASSWORD   0xBF
0322 #endif /* __KERNEL__ */
0323 
0324 struct hd_geometry {
0325       unsigned char heads;
0326       unsigned char sectors;
0327       unsigned short cylinders;
0328       unsigned long start;
0329 };
0330 
0331 /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
0332 #define HDIO_GETGEO     0x0301  /* get device geometry */
0333 #define HDIO_GET_UNMASKINTR 0x0302  /* get current unmask setting */
0334 #define HDIO_GET_MULTCOUNT  0x0304  /* get current IDE blockmode setting */
0335 #define HDIO_GET_QDMA       0x0305  /* get use-qdma flag */
0336 
0337 #define HDIO_SET_XFER       0x0306  /* set transfer rate via proc */
0338 
0339 #define HDIO_OBSOLETE_IDENTITY  0x0307  /* OBSOLETE, DO NOT USE: returns 142 bytes */
0340 #define HDIO_GET_KEEPSETTINGS   0x0308  /* get keep-settings-on-reset flag */
0341 #define HDIO_GET_32BIT      0x0309  /* get current io_32bit setting */
0342 #define HDIO_GET_NOWERR     0x030a  /* get ignore-write-error flag */
0343 #define HDIO_GET_DMA        0x030b  /* get use-dma flag */
0344 #define HDIO_GET_NICE       0x030c  /* get nice flags */
0345 #define HDIO_GET_IDENTITY   0x030d  /* get IDE identification info */
0346 #define HDIO_GET_WCACHE     0x030e  /* get write cache mode on|off */
0347 #define HDIO_GET_ACOUSTIC   0x030f  /* get acoustic value */
0348 #define HDIO_GET_ADDRESS    0x0310  /* */
0349 
0350 #define HDIO_GET_BUSSTATE   0x031a  /* get the bus state of the hwif */
0351 #define HDIO_TRISTATE_HWIF  0x031b  /* execute a channel tristate */
0352 #define HDIO_DRIVE_RESET    0x031c  /* execute a device reset */
0353 #define HDIO_DRIVE_TASKFILE 0x031d  /* execute raw taskfile */
0354 #define HDIO_DRIVE_TASK     0x031e  /* execute task and special drive command */
0355 #define HDIO_DRIVE_CMD      0x031f  /* execute a special drive command */
0356 #define HDIO_DRIVE_CMD_AEB  HDIO_DRIVE_TASK
0357 
0358 /* hd/ide ctl's that pass (arg) non-ptr values are numbered 0x032n/0x033n */
0359 #define HDIO_SET_MULTCOUNT  0x0321  /* change IDE blockmode */
0360 #define HDIO_SET_UNMASKINTR 0x0322  /* permit other irqs during I/O */
0361 #define HDIO_SET_KEEPSETTINGS   0x0323  /* keep ioctl settings on reset */
0362 #define HDIO_SET_32BIT      0x0324  /* change io_32bit flags */
0363 #define HDIO_SET_NOWERR     0x0325  /* change ignore-write-error flag */
0364 #define HDIO_SET_DMA        0x0326  /* change use-dma flag */
0365 #define HDIO_SET_PIO_MODE   0x0327  /* reconfig interface to new speed */
0366 #ifndef __KERNEL__
0367 #define HDIO_SCAN_HWIF      0x0328  /* register and (re)scan interface */
0368 #define HDIO_UNREGISTER_HWIF    0x032a  /* unregister interface */
0369 #endif
0370 #define HDIO_SET_NICE       0x0329  /* set nice flags */
0371 #define HDIO_SET_WCACHE     0x032b  /* change write cache enable-disable */
0372 #define HDIO_SET_ACOUSTIC   0x032c  /* change acoustic behavior */
0373 #define HDIO_SET_BUSSTATE   0x032d  /* set the bus state of the hwif */
0374 #define HDIO_SET_QDMA       0x032e  /* change use-qdma flag */
0375 #define HDIO_SET_ADDRESS    0x032f  /* change lba addressing modes */
0376 
0377 /* bus states */
0378 enum {
0379     BUSSTATE_OFF = 0,
0380     BUSSTATE_ON,
0381     BUSSTATE_TRISTATE
0382 };
0383 
0384 /* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x033n/0x033n */
0385 /* 0x330 is reserved - used to be HDIO_GETGEO_BIG */
0386 /* 0x331 is reserved - used to be HDIO_GETGEO_BIG_RAW */
0387 /* 0x338 is reserved - used to be HDIO_SET_IDE_SCSI */
0388 /* 0x339 is reserved - used to be HDIO_SET_SCSI_IDE */
0389 
0390 #define __NEW_HD_DRIVE_ID
0391 
0392 #ifndef __KERNEL__
0393 /*
0394  * Structure returned by HDIO_GET_IDENTITY, as per ANSI NCITS ATA6 rev.1b spec.
0395  *
0396  * If you change something here, please remember to update fix_driveid() in
0397  * ide/probe.c.
0398  */
0399 struct hd_driveid {
0400     unsigned short  config;     /* lots of obsolete bit flags */
0401     unsigned short  cyls;       /* Obsolete, "physical" cyls */
0402     unsigned short  reserved2;  /* reserved (word 2) */
0403     unsigned short  heads;      /* Obsolete, "physical" heads */
0404     unsigned short  track_bytes;    /* unformatted bytes per track */
0405     unsigned short  sector_bytes;   /* unformatted bytes per sector */
0406     unsigned short  sectors;    /* Obsolete, "physical" sectors per track */
0407     unsigned short  vendor0;    /* vendor unique */
0408     unsigned short  vendor1;    /* vendor unique */
0409     unsigned short  vendor2;    /* Retired vendor unique */
0410     unsigned char   serial_no[20];  /* 0 = not_specified */
0411     unsigned short  buf_type;   /* Retired */
0412     unsigned short  buf_size;   /* Retired, 512 byte increments
0413                      * 0 = not_specified
0414                      */
0415     unsigned short  ecc_bytes;  /* for r/w long cmds; 0 = not_specified */
0416     unsigned char   fw_rev[8];  /* 0 = not_specified */
0417     unsigned char   model[40];  /* 0 = not_specified */
0418     unsigned char   max_multsect;   /* 0=not_implemented */
0419     unsigned char   vendor3;    /* vendor unique */
0420     unsigned short  dword_io;   /* 0=not_implemented; 1=implemented */
0421     unsigned char   vendor4;    /* vendor unique */
0422     unsigned char   capability; /* (upper byte of word 49)
0423                      *  3:  IORDYsup
0424                      *  2:  IORDYsw
0425                      *  1:  LBA
0426                      *  0:  DMA
0427                      */
0428     unsigned short  reserved50; /* reserved (word 50) */
0429     unsigned char   vendor5;    /* Obsolete, vendor unique */
0430     unsigned char   tPIO;       /* Obsolete, 0=slow, 1=medium, 2=fast */
0431     unsigned char   vendor6;    /* Obsolete, vendor unique */
0432     unsigned char   tDMA;       /* Obsolete, 0=slow, 1=medium, 2=fast */
0433     unsigned short  field_valid;    /* (word 53)
0434                      *  2:  ultra_ok    word  88
0435                      *  1:  eide_ok     words 64-70
0436                      *  0:  cur_ok      words 54-58
0437                      */
0438     unsigned short  cur_cyls;   /* Obsolete, logical cylinders */
0439     unsigned short  cur_heads;  /* Obsolete, l heads */
0440     unsigned short  cur_sectors;    /* Obsolete, l sectors per track */
0441     unsigned short  cur_capacity0;  /* Obsolete, l total sectors on drive */
0442     unsigned short  cur_capacity1;  /* Obsolete, (2 words, misaligned int)     */
0443     unsigned char   multsect;   /* current multiple sector count */
0444     unsigned char   multsect_valid; /* when (bit0==1) multsect is ok */
0445     unsigned int    lba_capacity;   /* Obsolete, total number of sectors */
0446     unsigned short  dma_1word;  /* Obsolete, single-word dma info */
0447     unsigned short  dma_mword;  /* multiple-word dma info */
0448     unsigned short  eide_pio_modes; /* bits 0:mode3 1:mode4 */
0449     unsigned short  eide_dma_min;   /* min mword dma cycle time (ns) */
0450     unsigned short  eide_dma_time;  /* recommended mword dma cycle time (ns) */
0451     unsigned short  eide_pio;       /* min cycle time (ns), no IORDY  */
0452     unsigned short  eide_pio_iordy; /* min cycle time (ns), with IORDY */
0453     unsigned short  words69_70[2];  /* reserved words 69-70
0454                      * future command overlap and queuing
0455                      */
0456     unsigned short  words71_74[4];  /* reserved words 71-74
0457                      * for IDENTIFY PACKET DEVICE command
0458                      */
0459     unsigned short  queue_depth;    /* (word 75)
0460                      * 15:5 reserved
0461                      *  4:0 Maximum queue depth -1
0462                      */
0463     unsigned short  words76_79[4];  /* reserved words 76-79 */
0464     unsigned short  major_rev_num;  /* (word 80) */
0465     unsigned short  minor_rev_num;  /* (word 81) */
0466     unsigned short  command_set_1;  /* (word 82) supported
0467                      * 15:  Obsolete
0468                      * 14:  NOP command
0469                      * 13:  READ_BUFFER
0470                      * 12:  WRITE_BUFFER
0471                      * 11:  Obsolete
0472                      * 10:  Host Protected Area
0473                      *  9:  DEVICE Reset
0474                      *  8:  SERVICE Interrupt
0475                      *  7:  Release Interrupt
0476                      *  6:  look-ahead
0477                      *  5:  write cache
0478                      *  4:  PACKET Command
0479                      *  3:  Power Management Feature Set
0480                      *  2:  Removable Feature Set
0481                      *  1:  Security Feature Set
0482                      *  0:  SMART Feature Set
0483                      */
0484     unsigned short  command_set_2;  /* (word 83)
0485                      * 15:  Shall be ZERO
0486                      * 14:  Shall be ONE
0487                      * 13:  FLUSH CACHE EXT
0488                      * 12:  FLUSH CACHE
0489                      * 11:  Device Configuration Overlay
0490                      * 10:  48-bit Address Feature Set
0491                      *  9:  Automatic Acoustic Management
0492                      *  8:  SET MAX security
0493                      *  7:  reserved 1407DT PARTIES
0494                      *  6:  SetF sub-command Power-Up
0495                      *  5:  Power-Up in Standby Feature Set
0496                      *  4:  Removable Media Notification
0497                      *  3:  APM Feature Set
0498                      *  2:  CFA Feature Set
0499                      *  1:  READ/WRITE DMA QUEUED
0500                      *  0:  Download MicroCode
0501                      */
0502     unsigned short  cfsse;      /* (word 84)
0503                      * cmd set-feature supported extensions
0504                      * 15:  Shall be ZERO
0505                      * 14:  Shall be ONE
0506                      * 13:6 reserved
0507                      *  5:  General Purpose Logging
0508                      *  4:  Streaming Feature Set
0509                      *  3:  Media Card Pass Through
0510                      *  2:  Media Serial Number Valid
0511                      *  1:  SMART selt-test supported
0512                      *  0:  SMART error logging
0513                      */
0514     unsigned short  cfs_enable_1;   /* (word 85)
0515                      * command set-feature enabled
0516                      * 15:  Obsolete
0517                      * 14:  NOP command
0518                      * 13:  READ_BUFFER
0519                      * 12:  WRITE_BUFFER
0520                      * 11:  Obsolete
0521                      * 10:  Host Protected Area
0522                      *  9:  DEVICE Reset
0523                      *  8:  SERVICE Interrupt
0524                      *  7:  Release Interrupt
0525                      *  6:  look-ahead
0526                      *  5:  write cache
0527                      *  4:  PACKET Command
0528                      *  3:  Power Management Feature Set
0529                      *  2:  Removable Feature Set
0530                      *  1:  Security Feature Set
0531                      *  0:  SMART Feature Set
0532                      */
0533     unsigned short  cfs_enable_2;   /* (word 86)
0534                      * command set-feature enabled
0535                      * 15:  Shall be ZERO
0536                      * 14:  Shall be ONE
0537                      * 13:  FLUSH CACHE EXT
0538                      * 12:  FLUSH CACHE
0539                      * 11:  Device Configuration Overlay
0540                      * 10:  48-bit Address Feature Set
0541                      *  9:  Automatic Acoustic Management
0542                      *  8:  SET MAX security
0543                      *  7:  reserved 1407DT PARTIES
0544                      *  6:  SetF sub-command Power-Up
0545                      *  5:  Power-Up in Standby Feature Set
0546                      *  4:  Removable Media Notification
0547                      *  3:  APM Feature Set
0548                      *  2:  CFA Feature Set
0549                      *  1:  READ/WRITE DMA QUEUED
0550                      *  0:  Download MicroCode
0551                      */
0552     unsigned short  csf_default;    /* (word 87)
0553                      * command set-feature default
0554                      * 15:  Shall be ZERO
0555                      * 14:  Shall be ONE
0556                      * 13:6 reserved
0557                      *  5:  General Purpose Logging enabled
0558                      *  4:  Valid CONFIGURE STREAM executed
0559                      *  3:  Media Card Pass Through enabled
0560                      *  2:  Media Serial Number Valid
0561                      *  1:  SMART selt-test supported
0562                      *  0:  SMART error logging
0563                      */
0564     unsigned short  dma_ultra;  /* (word 88) */
0565     unsigned short  trseuc;     /* time required for security erase */
0566     unsigned short  trsEuc;     /* time required for enhanced erase */
0567     unsigned short  CurAPMvalues;   /* current APM values */
0568     unsigned short  mprc;       /* master password revision code */
0569     unsigned short  hw_config;  /* hardware config (word 93)
0570                      * 15:  Shall be ZERO
0571                      * 14:  Shall be ONE
0572                      * 13:
0573                      * 12:
0574                      * 11:
0575                      * 10:
0576                      *  9:
0577                      *  8:
0578                      *  7:
0579                      *  6:
0580                      *  5:
0581                      *  4:
0582                      *  3:
0583                      *  2:
0584                      *  1:
0585                      *  0:  Shall be ONE
0586                      */
0587     unsigned short  acoustic;   /* (word 94)
0588                      * 15:8 Vendor's recommended value
0589                      *  7:0 current value
0590                      */
0591     unsigned short  msrqs;      /* min stream request size */
0592     unsigned short  sxfert;     /* stream transfer time */
0593     unsigned short  sal;        /* stream access latency */
0594     unsigned int    spg;        /* stream performance granularity */
0595     unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
0596     unsigned short  words104_125[22];/* reserved words 104-125 */
0597     unsigned short  last_lun;   /* (word 126) */
0598     unsigned short  word127;    /* (word 127) Feature Set
0599                      * Removable Media Notification
0600                      * 15:2 reserved
0601                      *  1:0 00 = not supported
0602                      *  01 = supported
0603                      *  10 = reserved
0604                      *  11 = reserved
0605                      */
0606     unsigned short  dlf;        /* (word 128)
0607                      * device lock function
0608                      * 15:9 reserved
0609                      *  8   security level 1:max 0:high
0610                      *  7:6 reserved
0611                      *  5   enhanced erase
0612                      *  4   expire
0613                      *  3   frozen
0614                      *  2   locked
0615                      *  1   en/disabled
0616                      *  0   capability
0617                      */
0618     unsigned short  csfo;       /*  (word 129)
0619                      * current set features options
0620                      * 15:4 reserved
0621                      *  3:  auto reassign
0622                      *  2:  reverting
0623                      *  1:  read-look-ahead
0624                      *  0:  write cache
0625                      */
0626     unsigned short  words130_155[26];/* reserved vendor words 130-155 */
0627     unsigned short  word156;    /* reserved vendor word 156 */
0628     unsigned short  words157_159[3];/* reserved vendor words 157-159 */
0629     unsigned short  cfa_power;  /* (word 160) CFA Power Mode
0630                      * 15 word 160 supported
0631                      * 14 reserved
0632                      * 13
0633                      * 12
0634                      * 11:0
0635                      */
0636     unsigned short  words161_175[15];/* Reserved for CFA */
0637     unsigned short  words176_205[30];/* Current Media Serial Number */
0638     unsigned short  words206_254[49];/* reserved words 206-254 */
0639     unsigned short  integrity_word; /* (word 255)
0640                      * 15:8 Checksum
0641                      *  7:0 Signature
0642                      */
0643 };
0644 #endif /* __KERNEL__ */
0645 
0646 /*
0647  * IDE "nice" flags. These are used on a per drive basis to determine
0648  * when to be nice and give more bandwidth to the other devices which
0649  * share the same IDE bus.
0650  */
0651 #define IDE_NICE_DSC_OVERLAP    (0) /* per the DSC overlap protocol */
0652 #define IDE_NICE_ATAPI_OVERLAP  (1) /* not supported yet */
0653 #define IDE_NICE_1      (3) /* when probably won't affect us much */
0654 #ifndef __KERNEL__
0655 #define IDE_NICE_0      (2) /* when sure that it won't affect us */
0656 #define IDE_NICE_2      (4) /* when we know it's on our expense */
0657 #endif
0658 
0659 #endif  /* _LINUX_HDREG_H */