]> git.saurik.com Git - apple/xnu.git/blob - iokit/Families/IOATAStandard/IOATAStandardData.cpp
7a9074b5e298b1c77a9868c59bd13fa1f58ecd30
[apple/xnu.git] / iokit / Families / IOATAStandard / IOATAStandardData.cpp
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 *
24 * IOATAData.cpp
25 *
26 */
27
28 #include <IOKit/ata/IOATAStandardInterface.h>
29 #include <IOKit/ata/ata-standard/ATAStandardPrivate.h>
30
31 static void *x;
32 #define id ((ATAIdentify *)x)
33
34 EndianTable AppleIdentifyEndianTable[] =
35 {
36 { sizeof(id->generalConfiguration), sizeof(UInt16) },
37 { sizeof(id->logicalCylinders), sizeof(UInt16) },
38 { sizeof(id->reserved_1), sizeof(UInt16) },
39 { sizeof(id->logicalHeads), sizeof(UInt16) },
40 { sizeof(id->reserved_2), sizeof(UInt16) },
41 { sizeof(id->logicalSectorsPerTrack), sizeof(UInt16) },
42 { sizeof(id->reserved_3), sizeof(UInt16) },
43 { sizeof(id->serialNumber), sizeof(UInt8) },
44 { sizeof(id->reserved_4), sizeof(UInt16) },
45 { sizeof(id->firmwareRevision), sizeof(UInt8) },
46 { sizeof(id->modelNumber), sizeof(UInt8) },
47 { sizeof(id->multipleModeSectors), sizeof(UInt16) },
48 { sizeof(id->reserved_5), sizeof(UInt16) },
49 { sizeof(id->capabilities1), sizeof(UInt16) },
50 { sizeof(id->capabilities2), sizeof(UInt16) },
51 { sizeof(id->pioMode), sizeof(UInt16) },
52 { sizeof(id->reserved_6), sizeof(UInt16) },
53 { sizeof(id->validFields), sizeof(UInt16) },
54 { sizeof(id->currentLogicalCylinders), sizeof(UInt16) },
55 { sizeof(id->currentLogicalHeads), sizeof(UInt16) },
56 { sizeof(id->currentLogicalSectorsPerTrack), sizeof(UInt16) },
57 { sizeof(id->currentAddressableSectors), sizeof(UInt32) },
58 { sizeof(id->currentMultipleModeSectors), sizeof(UInt16) },
59 { sizeof(id->userAddressableSectors), sizeof(UInt32) },
60 { sizeof(id->reserved_7), sizeof(UInt16) },
61 { sizeof(id->dmaModes), sizeof(UInt16) },
62 { sizeof(id->advancedPIOModes), sizeof(UInt16) },
63 { sizeof(id->minDMACycleTime), sizeof(UInt16) },
64 { sizeof(id->recDMACycleTime), sizeof(UInt16) },
65 { sizeof(id->minPIOCycleTimeNoIORDY), sizeof(UInt16) },
66 { sizeof(id->minPIOCyclcTimeIORDY), sizeof(UInt16) },
67 { sizeof(id->reserved_8), sizeof(UInt16) },
68 { sizeof(id->busReleaseLatency), sizeof(UInt16) },
69 { sizeof(id->serviceLatency), sizeof(UInt16) },
70 { sizeof(id->reserved_9), sizeof(UInt16) },
71 { sizeof(id->queueDepth), sizeof(UInt16) },
72 { sizeof(id->reserved_10), sizeof(UInt16) },
73 { sizeof(id->versionMajor), sizeof(UInt16) },
74 { sizeof(id->versionMinor), sizeof(UInt16) },
75 { sizeof(id->commandSetsSupported1), sizeof(UInt16) },
76 { sizeof(id->commandSetsSupported2), sizeof(UInt16) },
77 { sizeof(id->commandSetsSupported3), sizeof(UInt16) },
78 { sizeof(id->commandSetsEnabled1), sizeof(UInt16) },
79 { sizeof(id->commandSetsEnabled2), sizeof(UInt16) },
80 { sizeof(id-> commandSetsDefault), sizeof(UInt16) },
81 { sizeof(id->ultraDMAModes), sizeof(UInt16) },
82 { sizeof(id->securityEraseTime), sizeof(UInt16) },
83 { sizeof(id-> securityEnhancedEraseTime), sizeof(UInt16) },
84 { sizeof(id-> currentAdvPowerMgtValue), sizeof(UInt16) },
85 { sizeof(id->reserved_11), sizeof(UInt16) },
86 { sizeof(id->removableMediaSupported), sizeof(UInt16) },
87 { sizeof(id->securityStatus), sizeof(UInt16) },
88 { sizeof(id->reserved_12), sizeof(UInt16) },
89 { 0, 0 }
90 };
91
92 ATAModeTable ApplePIOModes[] =
93 {
94 { 165, 600 }, /* Mode 0 */
95 { 125, 383 }, /* 1 */
96 { 100, 240 }, /* 2 */
97 { 80, 180 }, /* 3 */
98 { 70, 120 } /* 4 */
99 };
100 UInt32 AppleNumPIOModes = (sizeof(ApplePIOModes)/sizeof(ATAModeTable));
101
102 ATAModeTable AppleDMAModes[] =
103 {
104 { 215, 480 }, /* Mode 0 */
105 { 80, 150 }, /* 1 */
106 { 70, 120 } /* 2 */
107 };
108 UInt32 AppleNumDMAModes = (sizeof(AppleDMAModes)/sizeof(ATAModeTable));
109
110 ATAModeTable AppleUltraModes[] =
111 {
112 { 0, 114 }, /* Mode 0 */
113 { 0, 75 }, /* 1 */
114 { 0, 55 }, /* 2 */
115 { 100, 45 }, /* 3 */
116 { 100, 25 } /* 4 */
117 };
118 UInt32 AppleNumUltraModes = (sizeof(AppleUltraModes)/sizeof(ATAModeTable));
119