psi_dale.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:19k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /****************************************************************************
  2.  * Perceptive Solutions, Inc. PCI-2220I device driver for Linux.
  3.  *
  4.  * psi_dalei.h - Linux Host Driver for PCI-2220i EIDE Adapters
  5.  *
  6.  * Copyright (c) 1997-1999 Perceptive Solutions, Inc.
  7.  * All Rights Reserved.
  8.  *
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that redistributions of source
  11.  * code retain the above copyright notice and this comment without
  12.  * modification.
  13.  *
  14.  * Technical updates and product information at:
  15.  *  http://www.psidisk.com
  16.  *
  17.  * Please send questions, comments, bug reports to:
  18.  *  tech@psidisk.com Technical Support
  19.  *
  20.  ****************************************************************************/
  21. /************************************************/
  22. /* Some defines that we like  */
  23. /************************************************/
  24. #define CHAR char
  25. #define UCHAR unsigned char
  26. #define SHORT short
  27. #define USHORT unsigned short
  28. #define BOOL unsigned short
  29. #define LONG long
  30. #define ULONG unsigned long
  31. #define VOID void
  32. /************************************************/
  33. /* Dale PCI setup */
  34. /************************************************/
  35. #define VENDOR_PSI 0x1256
  36. #define DEVICE_DALE_1 0x4401 /* 'D1' */
  37. #define DEVICE_BIGD_1 0x4201 /* 'B1' */
  38. #define DEVICE_BIGD_2 0x4202 /* 'B2' */
  39. /************************************************/
  40. /* Misc konstants */
  41. /************************************************/
  42. #define DALE_MAXDRIVES 4
  43. #define BIGD_MAXDRIVES 8
  44. #define SECTORSXFER 8
  45. #define ATAPI_TRANSFER 8192
  46. #define BYTES_PER_SECTOR 512
  47. #define DEFAULT_TIMING_MODE 5
  48. /************************************************/
  49. /* EEPROM locations */
  50. /************************************************/
  51. #define DALE_FLASH_PAGE_SIZE 128 // number of bytes per page
  52. #define DALE_FLASH_SIZE 65536L
  53. #define DALE_FLASH_BIOS 0x00080000L // BIOS base address
  54. #define DALE_FLASH_SETUP 0x00088000L // SETUP PROGRAM base address offset from BIOS
  55. #define DALE_FLASH_RAID 0x00088400L // RAID signature storage
  56. #define DALE_FLASH_FACTORY 0x00089000L // FACTORY data base address offset from BIOS
  57. #define DALE_FLASH_BIOS_SIZE 32768U // size of FLASH BIOS REGION
  58. /************************************************/
  59. /* DALE Register address offsets */
  60. /************************************************/
  61. #define REG_DATA 0x80
  62. #define REG_ERROR 0x84
  63. #define REG_SECTOR_COUNT 0x88
  64. #define REG_LBA_0 0x8C
  65. #define REG_LBA_8 0x90
  66. #define REG_LBA_16 0x94
  67. #define REG_LBA_24 0x98
  68. #define REG_STAT_CMD 0x9C
  69. #define REG_STAT_SEL 0xA0
  70. #define REG_FAIL 0xB0
  71. #define REG_ALT_STAT 0xB8
  72. #define REG_DRIVE_ADRS 0xBC
  73. #define DALE_DATA_SLOW 0x00040000L
  74. #define DALE_DATA_MODE2 0x00040000L
  75. #define DALE_DATA_MODE3 0x00050000L
  76. #define DALE_DATA_MODE4 0x00060000L
  77. #define DALE_DATA_MODE5 0x00070000L
  78. #define BIGD_DATA_SLOW 0x00000000L
  79. #define BIGD_DATA_MODE0 0x00000000L
  80. #define BIGD_DATA_MODE2 0x00000000L
  81. #define BIGD_DATA_MODE3 0x00000008L
  82. #define BIGD_DATA_MODE4 0x00000010L
  83. #define BIGD_DATA_MODE5 0x00000020L
  84. #define RTR_LOCAL_RANGE 0x000
  85. #define RTR_LOCAL_REMAP 0x004
  86. #define RTR_EXP_RANGE 0x010
  87. #define RTR_EXP_REMAP 0x014
  88. #define RTR_REGIONS 0x018
  89. #define RTR_DM_MASK 0x01C
  90. #define RTR_DM_LOCAL_BASE 0x020
  91. #define RTR_DM_IO_BASE 0x024
  92. #define RTR_DM_PCI_REMAP 0x028
  93. #define RTR_DM_IO_CONFIG 0x02C
  94. #define RTR_MAILBOX 0x040
  95. #define RTR_LOCAL_DOORBELL 0x060
  96. #define RTR_PCI_DOORBELL 0x064
  97. #define RTR_INT_CONTROL_STATUS  0x068
  98. #define RTR_EEPROM_CONTROL_STATUS 0x06C
  99. #define RTR_DMA0_MODE 0x0080
  100. #define RTR_DMA0_PCI_ADDR 0x0084
  101. #define RTR_DMA0_LOCAL_ADDR 0x0088
  102. #define RTR_DMA0_COUNT 0x008C
  103. #define RTR_DMA0_DESC_PTR 0x0090
  104. #define RTR_DMA1_MODE 0x0094
  105. #define RTR_DMA1_PCI_ADDR 0x0098
  106. #define RTR_DMA1_LOCAL_ADDR 0x009C
  107. #define RTR_DMA1_COUNT 0x00A0
  108. #define RTR_DMA1_DESC_PTR 0x00A4
  109. #define RTR_DMA_COMMAND_STATUS 0x00A8
  110. #define RTR_DMA_ARB0 0x00AC
  111. #define RTR_DMA_ARB1 0x00B0
  112. #define RTL_DMA0_MODE 0x00
  113. #define RTL_DMA0_PCI_ADDR 0x04
  114. #define RTL_DMA0_LOCAL_ADDR 0x08
  115. #define RTL_DMA0_COUNT 0x0C
  116. #define RTL_DMA0_DESC_PTR 0x10
  117. #define RTL_DMA1_MODE 0x14
  118. #define RTL_DMA1_PCI_ADDR 0x18
  119. #define RTL_DMA1_LOCAL_ADDR 0x1C
  120. #define RTL_DMA1_COUNT 0x20
  121. #define RTL_DMA1_DESC_PTR 0x24
  122. #define RTL_DMA_COMMAND_STATUS 0x28
  123. #define RTL_DMA_ARB0 0x2C
  124. #define RTL_DMA_ARB1 0x30
  125. /************************************************/
  126. /* Dale Scratchpad locations */
  127. /************************************************/
  128. #define DALE_CHANNEL_DEVICE_0 0 // device channel locations
  129. #define DALE_CHANNEL_DEVICE_1 1
  130. #define DALE_CHANNEL_DEVICE_2 2
  131. #define DALE_CHANNEL_DEVICE_3 3
  132. #define DALE_SCRATCH_DEVICE_0 4 // device type codes
  133. #define DALE_SCRATCH_DEVICE_1 5
  134. #define DALE_SCRATCH_DEVICE_2 6
  135. #define DALE_SCRATCH_DEVICE_3 7
  136. #define DALE_RAID_0_STATUS 8
  137. #define DALE_RAID_1_STATUS 9
  138. #define DALE_TIMING_MODE 12 // bus master timing mode (2, 3, 4, 5)
  139. #define DALE_NUM_DRIVES 13 // number of addressable drives on this board
  140. #define DALE_RAID_ON 14  // RAID status On
  141. #define DALE_LAST_ERROR 15 // Last error code from BIOS
  142. /************************************************/
  143. /* BigD Scratchpad locations */
  144. /************************************************/
  145. #define BIGD_DEVICE_0 0 // device channel locations
  146. #define BIGD_DEVICE_1 1
  147. #define BIGD_DEVICE_2 2
  148. #define BIGD_DEVICE_3 3
  149. #define BIGD_DEVICE_4 4 // device type codes
  150. #define BIGD_DEVICE_5 5
  151. #define BIGD_DEVICE_6 6
  152. #define BIGD_DEVICE_7 7
  153. #define BIGD_ALARM_IMAGE 11 // ~image of alarm fail register
  154. #define BIGD_TIMING_MODE 12 // bus master timing mode (2, 3, 4, 5)
  155. #define BIGD_NUM_DRIVES 13 // number of addressable drives on this board
  156. #define BIGD_RAID_ON 14  // RAID status is on for the whole board
  157. #define BIGD_LAST_ERROR 15 // Last error code from BIOS
  158. #define BIGD_RAID_0_STATUS 16
  159. #define BIGD_RAID_1_STATUS 17
  160. #define BIGD_RAID_2_STATUS 18
  161. #define BIGD_RAID_3_STATUS 19
  162. #define BIGD_RAID_4_STATUS 20
  163. #define BIGD_RAID_5_STATUS 21
  164. #define BIGD_RAID_6_STATUS 22
  165. #define BIGD_RAID_7_STATUS 23
  166. /************************************************/
  167. /* Dale cable select bits */
  168. /************************************************/
  169. #define SEL_NONE 0x00
  170. #define SEL_1 0x01
  171. #define SEL_2 0x02
  172. #define SEL_3 0x04
  173. #define SEL_4 0x08
  174. #define SEL_NEW_SPEED_1 0x20
  175. #define SEL_COPY 0x40
  176. #define SEL_IRQ_OFF 0x80
  177. /************************************************/
  178. /* Device/Geometry controls */
  179. /************************************************/
  180. #define GEOMETRY_NONE   0x0 // No device
  181. #define GEOMETRY_SET 0x1 // Geometry set
  182. #define GEOMETRY_LBA 0x2 // Geometry set in default LBA mode
  183. #define GEOMETRY_PHOENIX 0x3 // Geometry set in Pheonix BIOS compatibility mode
  184. #define DEVICE_NONE 0x0 // No device present
  185. #define DEVICE_INACTIVE 0x1 // device present but not registered active
  186. #define DEVICE_ATAPI 0x2 // ATAPI device (CD_ROM, Tape, Etc...)
  187. #define DEVICE_DASD_NONLBA 0x3 // Non LBA incompatible device
  188. #define DEVICE_DASD_LBA 0x4 // LBA compatible device
  189. /************************************************/
  190. /* BigD fail register bits */
  191. /************************************************/
  192. #define FAIL_NONE 0x00
  193. #define FAIL_0 0x01
  194. #define FAIL_1 0x02
  195. #define FAIL_2 0x04
  196. #define FAIL_MULTIPLE 0x08
  197. #define FAIL_GOOD 0x20
  198. #define FAIL_AUDIBLE 0x40
  199. #define FAIL_ANY 0x80
  200. /************************************************/
  201. /* Setup Structure Definitions */
  202. /************************************************/
  203. typedef struct // device setup parameters
  204. {
  205. UCHAR geometryControl; // geometry control flags
  206. UCHAR device; // device code
  207. USHORT sectors; // number of sectors per track
  208. USHORT heads; // number of heads
  209. USHORT cylinders; // number of cylinders for this device
  210. ULONG blocks; // number of blocks on device
  211. ULONG realCapacity; // number of real blocks on this device for drive changed testing
  212. } SETUP_DEVICE, *PSETUP_DEVICE;
  213. typedef struct // master setup structure
  214. {
  215. USHORT startupDelay;
  216. BOOL promptBIOS;
  217. BOOL fastFormat;
  218. BOOL shareInterrupt;
  219. BOOL rebootRebuild;
  220. USHORT timingMode;
  221. USHORT spare5;
  222. USHORT spare6;
  223. SETUP_DEVICE setupDevice[BIGD_MAXDRIVES];
  224. } SETUP, *PSETUP;
  225. /************************************************/
  226. /* RAID Structure Definitions */
  227. /************************************************/
  228. typedef struct
  229. {
  230. UCHAR signature; // 0x55 our mirror signature
  231. UCHAR status; // current status bits
  232. UCHAR pairIdentifier; // unique identifier for pair
  233. ULONG reconstructPoint; // recontruction point for hot reconstruct
  234. } DISK_MIRROR;
  235. typedef struct DEVICE_RAID1
  236. {
  237. long TotalSectors;
  238. DISK_MIRROR DiskRaid1;
  239. } DEVICE_RAID1, *PDEVICE_RAID1;
  240. #define DISK_MIRROR_POSITION 0x01A8
  241. #define SIGNATURE 0x55
  242. #define MASK_SERIAL_NUMBER 0x0FFE // mask for serial number matching
  243. #define MASK_SERIAL_UNIT 0x0001 // mask for unit portion of serial number
  244. // Status bits
  245. #define UCBF_MIRRORED 0x0010 // drive has a pair
  246. #define UCBF_MATCHED 0x0020 // drive pair is matched
  247. #define UCBF_SURVIVOR 0x0040 // this unit is a survivor of a pair
  248. #define UCBF_REBUILD 0x0080 // rebuild in progress on this device
  249. // SCSI controls for RAID
  250. #define SC_MY_RAID 0xBF // our special CDB command byte for Win95... interface
  251. #define MY_SCSI_QUERY1 0x32 // byte 1 subcommand to query driver for RAID 1 informatation
  252. #define MY_SCSI_REBUILD 0x40 // byte 1 subcommand to reconstruct a mirrored pair
  253. #define MY_SCSI_DEMOFAIL 0x54 // byte 1 subcommand for RAID failure demonstration
  254. #define MY_SCSI_ALARMMUTE 0x60 // byte 1 subcommand to mute any alarm currently on
  255. /************************************************/
  256. /* Timeout konstants   */
  257. /************************************************/
  258. #define TIMEOUT_READY 100 // 100 mSec
  259. #define TIMEOUT_DRQ 300 // 300 mSec
  260. #define TIMEOUT_DATA (3 * HZ) // 3 seconds
  261. /************************************************/
  262. /* Misc. macros   */
  263. /************************************************/
  264. #define ANY2SCSI(up, p)
  265. ((UCHAR *)up)[0] = (((ULONG)(p)) >> 8);
  266. ((UCHAR *)up)[1] = ((ULONG)(p));
  267. #define SCSI2LONG(up)
  268. ( (((long)*(((UCHAR *)up))) << 16)
  269. + (((long)(((UCHAR *)up)[1])) << 8)
  270. + ((long)(((UCHAR *)up)[2])) )
  271. #define XANY2SCSI(up, p)
  272. ((UCHAR *)up)[0] = ((long)(p)) >> 24;
  273. ((UCHAR *)up)[1] = ((long)(p)) >> 16;
  274. ((UCHAR *)up)[2] = ((long)(p)) >> 8;
  275. ((UCHAR *)up)[3] = ((long)(p));
  276. #define XSCSI2LONG(up)
  277. ( (((long)(((UCHAR *)up)[0])) << 24)
  278. + (((long)(((UCHAR *)up)[1])) << 16)
  279. + (((long)(((UCHAR *)up)[2])) <<  8)
  280. + ((long)(((UCHAR *)up)[3])) )
  281. #define SelectSpigot(padapter,spigot) outb_p (spigot, padapter->regStatSel)
  282. #define WriteCommand(padapter,cmd) outb_p (cmd, padapter->regStatCmd)
  283. #define AtapiDevice(padapter,b) outb_p (b, padapter->regLba24);
  284. #define AtapiCountLo(padapter,b) outb_p (b, padapter->regLba8)
  285. #define AtapiCountHi(padapter,b) outb_p (b, padapter->regLba16)
  286. /************************************************/
  287. /* SCSI CDB operation codes  */
  288. /************************************************/
  289. #define SCSIOP_TEST_UNIT_READY 0x00
  290. #define SCSIOP_REZERO_UNIT 0x01
  291. #define SCSIOP_REWIND 0x01
  292. #define SCSIOP_REQUEST_BLOCK_ADDR 0x02
  293. #define SCSIOP_REQUEST_SENSE 0x03
  294. #define SCSIOP_FORMAT_UNIT 0x04
  295. #define SCSIOP_READ_BLOCK_LIMITS 0x05
  296. #define SCSIOP_REASSIGN_BLOCKS 0x07
  297. #define SCSIOP_READ6 0x08
  298. #define SCSIOP_RECEIVE 0x08
  299. #define SCSIOP_WRITE6 0x0A
  300. #define SCSIOP_PRINT 0x0A
  301. #define SCSIOP_SEND 0x0A
  302. #define SCSIOP_SEEK6 0x0B
  303. #define SCSIOP_TRACK_SELECT 0x0B
  304. #define SCSIOP_SLEW_PRINT 0x0B
  305. #define SCSIOP_SEEK_BLOCK 0x0C
  306. #define SCSIOP_PARTITION 0x0D
  307. #define SCSIOP_READ_REVERSE 0x0F
  308. #define SCSIOP_WRITE_FILEMARKS 0x10
  309. #define SCSIOP_FLUSH_BUFFER 0x10
  310. #define SCSIOP_SPACE 0x11
  311. #define SCSIOP_INQUIRY 0x12
  312. #define SCSIOP_VERIFY6 0x13
  313. #define SCSIOP_RECOVER_BUF_DATA 0x14
  314. #define SCSIOP_MODE_SELECT 0x15
  315. #define SCSIOP_RESERVE_UNIT 0x16
  316. #define SCSIOP_RELEASE_UNIT 0x17
  317. #define SCSIOP_COPY 0x18
  318. #define SCSIOP_ERASE 0x19
  319. #define SCSIOP_MODE_SENSE 0x1A
  320. #define SCSIOP_START_STOP_UNIT 0x1B
  321. #define SCSIOP_STOP_PRINT 0x1B
  322. #define SCSIOP_LOAD_UNLOAD 0x1B
  323. #define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
  324. #define SCSIOP_SEND_DIAGNOSTIC 0x1D
  325. #define SCSIOP_MEDIUM_REMOVAL 0x1E
  326. #define SCSIOP_READ_CAPACITY 0x25
  327. #define SCSIOP_READ 0x28
  328. #define SCSIOP_WRITE 0x2A
  329. #define SCSIOP_SEEK 0x2B
  330. #define SCSIOP_LOCATE 0x2B
  331. #define SCSIOP_WRITE_VERIFY 0x2E
  332. #define SCSIOP_VERIFY 0x2F
  333. #define SCSIOP_SEARCH_DATA_HIGH 0x30
  334. #define SCSIOP_SEARCH_DATA_EQUAL 0x31
  335. #define SCSIOP_SEARCH_DATA_LOW 0x32
  336. #define SCSIOP_SET_LIMITS 0x33
  337. #define SCSIOP_READ_POSITION 0x34
  338. #define SCSIOP_SYNCHRONIZE_CACHE 0x35
  339. #define SCSIOP_COMPARE 0x39
  340. #define SCSIOP_COPY_COMPARE 0x3A
  341. #define SCSIOP_WRITE_DATA_BUFF 0x3B
  342. #define SCSIOP_READ_DATA_BUFF 0x3C
  343. #define SCSIOP_CHANGE_DEFINITION 0x40
  344. #define SCSIOP_READ_SUB_CHANNEL 0x42
  345. #define SCSIOP_READ_TOC 0x43
  346. #define SCSIOP_READ_HEADER 0x44
  347. #define SCSIOP_PLAY_AUDIO 0x45
  348. #define SCSIOP_PLAY_AUDIO_MSF 0x47
  349. #define SCSIOP_PLAY_TRACK_INDEX 0x48
  350. #define SCSIOP_PLAY_TRACK_RELATIVE 0x49
  351. #define SCSIOP_PAUSE_RESUME 0x4B
  352. #define SCSIOP_LOG_SELECT 0x4C
  353. #define SCSIOP_LOG_SENSE 0x4D
  354. #define SCSIOP_MODE_SELECT10 0x55
  355. #define SCSIOP_MODE_SENSE10 0x5A
  356. #define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
  357. #define SCSIOP_MECHANISM_STATUS 0xBD
  358. #define SCSIOP_READ_CD 0xBE
  359. // IDE command definitions
  360. #define IDE_COMMAND_ATAPI_RESET 0x08
  361. #define IDE_COMMAND_READ 0x20
  362. #define IDE_COMMAND_WRITE 0x30
  363. #define IDE_COMMAND_RECALIBRATE 0x10
  364. #define IDE_COMMAND_SEEK 0x70
  365. #define IDE_COMMAND_SET_PARAMETERS 0x91
  366. #define IDE_COMMAND_VERIFY 0x40
  367. #define IDE_COMMAND_ATAPI_PACKET 0xA0
  368. #define IDE_COMMAND_ATAPI_IDENTIFY 0xA1
  369. #define IDE_CMD_READ_MULTIPLE 0xC4
  370. #define IDE_CMD_WRITE_MULTIPLE 0xC5
  371. #define IDE_CMD_SET_MULTIPLE 0xC6
  372. #define IDE_COMMAND_IDENTIFY 0xEC
  373. // IDE status definitions
  374. #define IDE_STATUS_ERROR 0x01
  375. #define IDE_STATUS_INDEX 0x02
  376. #define IDE_STATUS_CORRECTED_ERROR 0x04
  377. #define IDE_STATUS_DRQ 0x08
  378. #define IDE_STATUS_DSC 0x10
  379. #define IDE_STATUS_WRITE_FAULT 0x20
  380. #define IDE_STATUS_DRDY 0x40
  381. #define IDE_STATUS_BUSY 0x80
  382. typedef struct _ATAPI_STATUS
  383. {
  384. CHAR check :1;
  385. CHAR reserved1 :1;
  386. CHAR corr :1;
  387. CHAR drq :1;
  388. CHAR dsc :1;
  389. CHAR reserved2 :1;
  390. CHAR drdy :1;
  391. CHAR bsy :1;
  392. } ATAPI_STATUS;
  393. typedef struct _ATAPI_REASON
  394. {
  395. CHAR cod :1;
  396. CHAR io :1;
  397. CHAR reserved1 :6;
  398. } ATAPI_REASON;
  399. typedef struct _ATAPI_ERROR
  400. {
  401. CHAR ili :1;
  402. CHAR eom :1;
  403. CHAR abort :1;
  404. CHAR mcr :1;
  405. CHAR senseKey :4;
  406. } ATAPI_ERROR;
  407. // IDE error definitions
  408. #define IDE_ERROR_AMNF 0x01
  409. #define IDE_ERROR_TKONF 0x02
  410. #define IDE_ERROR_ABRT 0x04
  411. #define IDE_ERROR_MCR 0x08
  412. #define IDE_ERROR_IDFN 0x10
  413. #define IDE_ERROR_MC 0x20
  414. #define IDE_ERROR_UNC 0x40
  415. #define IDE_ERROR_BBK 0x80
  416. // SCSI read capacity structure
  417. typedef struct _READ_CAPACITY_DATA
  418. {
  419. ULONG blks; /* total blocks (converted to little endian) */
  420. ULONG blksiz; /* size of each (converted to little endian) */
  421. } READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
  422. // SCSI inquiry data
  423. typedef struct _INQUIRYDATA
  424. {
  425. UCHAR DeviceType :5;
  426. UCHAR DeviceTypeQualifier :3;
  427. UCHAR DeviceTypeModifier :7;
  428. UCHAR RemovableMedia :1;
  429.     UCHAR Versions;
  430.     UCHAR ResponseDataFormat;
  431.     UCHAR AdditionalLength;
  432.     UCHAR Reserved[2];
  433. UCHAR SoftReset :1;
  434. UCHAR CommandQueue :1;
  435. UCHAR Reserved2 :1;
  436. UCHAR LinkedCommands :1;
  437. UCHAR Synchronous :1;
  438. UCHAR Wide16Bit :1;
  439. UCHAR Wide32Bit :1;
  440. UCHAR RelativeAddressing :1;
  441.     UCHAR VendorId[8];
  442.     UCHAR ProductId[16];
  443.     UCHAR ProductRevisionLevel[4];
  444.     UCHAR VendorSpecific[20];
  445.     UCHAR Reserved3[40];
  446. } INQUIRYDATA, *PINQUIRYDATA;
  447. // IDE IDENTIFY data
  448. #pragma pack (1)
  449. typedef struct _IDENTIFY_DATA
  450. {
  451.     USHORT GeneralConfiguration; //  0
  452.     USHORT NumberOfCylinders; //  1
  453.     USHORT Reserved1; //  2
  454.     USHORT NumberOfHeads; //  3
  455.     USHORT UnformattedBytesPerTrack; //  4
  456.     USHORT UnformattedBytesPerSector; //  5
  457.     USHORT SectorsPerTrack; //  6
  458. USHORT NumBytesISG; //  7 Byte Len - inter-sector gap
  459. USHORT NumBytesSync; //  8          - sync field
  460. USHORT NumWordsVUS; //  9 Len - Vendor Unique Info
  461.     USHORT SerialNumber[10]; // 10
  462.     USHORT BufferType; // 20
  463.     USHORT BufferSectorSize; // 21
  464.     USHORT NumberOfEccBytes; // 22
  465.     USHORT FirmwareRevision[4]; // 23
  466.     USHORT ModelNumber[20]; // 27
  467. USHORT NumSectorsPerInt :8; // 47 Multiple Mode - Sec/Blk
  468. USHORT Reserved2 :8; // 47
  469. USHORT DoubleWordMode; // 48 flag for double word mode capable
  470. USHORT VendorUnique1 :8; // 49
  471. USHORT SupportDMA :1; // 49 DMA supported
  472. USHORT SupportLBA :1; // 49 LBA supported
  473. USHORT SupportIORDYDisable :1; // 49 IORDY can be disabled
  474. USHORT SupportIORDY :1; // 49 IORDY supported
  475. USHORT ReservedPsuedoDMA :1; // 49 reserved for pseudo DMA mode support
  476. USHORT Reserved3 :3; // 49
  477. USHORT Reserved4; // 50
  478. USHORT Reserved5 :8; // 51 Transfer Cycle Timing - PIO
  479. USHORT PIOCycleTime :8; // 51 Transfer Cycle Timing - PIO
  480. USHORT Reserved6 :8; // 52                       - DMA
  481. USHORT DMACycleTime :8; // 52                       - DMA
  482. USHORT Valid_54_58 :1; // 53 words 54 - 58 are valid
  483. USHORT Valid_64_70 :1; // 53 words 64 - 70 are valid
  484. USHORT Reserved7 :14; // 53
  485. USHORT LogNumCyl; // 54 Current Translation - Num Cyl
  486. USHORT LogNumHeads; // 55                       Num Heads
  487. USHORT LogSectorsPerTrack; // 56                       Sec/Trk
  488. ULONG LogTotalSectors; // 57                       Total Sec
  489. USHORT CurrentNumSecPerInt :8; // 59 current setting for number of sectors per interrupt
  490. USHORT ValidNumSecPerInt :1; // 59 Current setting is valid for number of sectors per interrupt
  491. USHORT Reserved8 :7; // 59
  492. ULONG LBATotalSectors; // 60 LBA Mode - Sectors
  493. USHORT DMASWordFlags; // 62
  494. USHORT DMAMWordFlags; // 63
  495. USHORT AdvancedPIOSupport  :8; // 64 Flow control PIO transfer modes supported
  496. USHORT Reserved9 :8; // 64
  497. USHORT MinMultiDMACycle; // 65 minimum multiword DMA transfer cycle time per word
  498. USHORT RecomendDMACycle; // 66 Manufacturer's recommende multiword DMA transfer cycle time
  499. USHORT MinPIOCycleWithoutFlow; // 67 Minimum PIO transfer cycle time without flow control
  500. USHORT MinPIOCylceWithFlow; // 68 Minimum PIO transfer cycle time with IORDY flow control
  501. USHORT ReservedSpace[256-69]; // 69
  502. } IDENTIFY_DATA, *PIDENTIFY_DATA;
  503. // ATAPI configuration bits
  504. typedef struct _ATAPI_GENERAL_0
  505. {
  506. USHORT CmdPacketSize :2; // Command packet size
  507. USHORT Reserved1 :3;
  508. USHORT CmdDrqType :2;
  509. USHORT Removable :1;
  510. USHORT DeviceType :5;
  511. USHORT Reserved2 :1;
  512. USHORT ProtocolType :2;
  513. } ATAPI_GENERAL_0;
  514. #pragma pack ()