1 /*++
2 
3 Copyright (c) 2002-2016 Alexandr A. Telyatnikov (Alter)
4 
5 Module Name:
6     bm_devs.h
7 
8 Abstract:
9     This file contains common definitions for list of PCI IDE controllers
10 
11 Author:
12     Alexander A. Telyatnikov (Alter)
13 
14 Environment:
15     kernel and user mode
16 
17 Notes:
18 
19     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 Revision History:
31 
32 Licence:
33     GPLv2
34 
35 --*/
36 
37 #ifndef __IDE_BUSMASTER_DEVICES_H__
38 #define __IDE_BUSMASTER_DEVICES_H__
39 
40 #pragma pack(push, 8)
41 
42 #define IDE_MAX_CHAN          16
43 #define IDE_DEFAULT_MAX_CHAN  2
44 // Thanks to SATA Port Multipliers:
45 //#define IDE_MAX_LUN_PER_CHAN  SATA_MAX_PM_UNITS
46 #define IDE_MAX_LUN_PER_CHAN  2
47 
48 #define IDE_MAX_LUN           (AHCI_MAX_PORT*IDE_MAX_LUN_PER_CHAN)
49 
50 #define MAX_QUEUE_STAT        8
51 
52 // define PIO timings in nanoseconds
53 #define         PIO0_TIMING             600
54 
55 //#define UniataGetPioTiming(LunExt)      ((LunExt->TransferMode <= ATA_PIO0) ? PIO0_TIMING : 0)
56 #define UniataGetPioTiming(LunExt)      0 //ktp
57 
58 /*#ifdef USER_MODE
59 #define PVEN_STR    PCSTR
60 #else // USER_MODE
61 #define PVEN_STR    PCHAR
62 #endif // USER_MODE*/
63 #define PVEN_STR    PCSTR
64 
65 typedef struct _BUSMASTER_CONTROLLER_INFORMATION_BASE {
66     ULONG   nVendorId;
67     ULONG   nDeviceId;
68     ULONG   nRevId;
69     ULONG   MaxTransferMode;
70     ULONG   RaidFlags;
71     PVEN_STR FullDevName;
72 } BUSMASTER_CONTROLLER_INFORMATION_BASE, *PBUSMASTER_CONTROLLER_INFORMATION_BASE;
73 
74 typedef struct _BUSMASTER_CONTROLLER_INFORMATION {
75     PVEN_STR VendorId;
76     ULONG   VendorIdLength;
77     ULONG   nVendorId;
78     PVEN_STR DeviceId;
79     ULONG   DeviceIdLength;
80     ULONG   nDeviceId;
81     ULONG   nRevId;
82     ULONG   MaxTransferMode;
83     PVEN_STR FullDevName;
84     ULONG   RaidFlags;
85     CHAR    VendorIdStr[4];
86     CHAR    DeviceIdStr[4];
87     ULONG   slotNumber;
88     ULONG   busNumber;
89     CHAR    channel;
90 //    CHAR    numOfChannes;
91     CHAR    MasterDev;
92     BOOLEAN Known;
93 #ifndef USER_MODE
94     UCHAR   ChanInitOk;             // 0x01 - primary,  0x02 - secondary, 0x80 - PciIde claimed
95     BOOLEAN Isr2Enable;
96     union {
97         PDEVICE_OBJECT Isr2DevObj;
98         PDEVICE_OBJECT PciIdeDevObj;
99     };
100     KIRQL      Isr2Irql;
101     KAFFINITY  Isr2Affinity;
102     ULONG      Isr2Vector;
103     PKINTERRUPT Isr2InterruptObject;
104     CHAR    AltInitMasterDev;       // 0xff - uninitialized,  0x00 - normal,  0x01 - change ISA to PCI
105     CHAR    NeedAltInit;            // 0x01 - try change ISA to PCI
106 #endif // USER_MODE
107 
108 } BUSMASTER_CONTROLLER_INFORMATION, *PBUSMASTER_CONTROLLER_INFORMATION;
109 
110 /* defines for known chipset PCI id's */
111 #define ATA_ACARD_ID		0x1191
112 #define ATA_ATP850		0x00021191
113 #define ATA_ATP850A		0x00041191
114 #define ATA_ATP850R		0x00051191
115 #define ATA_ATP860A		0x00061191
116 #define ATA_ATP860R		0x00071191
117 #define ATA_ATP865A		0x00081191
118 #define ATA_ATP865R		0x00091191
119 
120 #define ATA_ACER_LABS_ID	0x10b9
121 #define ATA_ALI_1533            0x153310b9
122 #define ATA_ALI_5228            0x522810b9
123 #define ATA_ALI_5229            0x522910b9
124 #define ATA_ALI_5281            0x528110b9
125 #define ATA_ALI_5287            0x528710b9
126 #define ATA_ALI_5288            0x528810b9
127 #define ATA_ALI_5289            0x528910b9
128 
129 #define ATA_AMD_ID              0x1022
130 #define ATA_AMD755              0x74011022
131 #define ATA_AMD756              0x74091022
132 #define ATA_AMD766              0x74111022
133 #define ATA_AMD768              0x74411022
134 #define ATA_AMD8111             0x74691022
135 #define ATA_AMD5536             0x209a1022
136 #define ATA_AMD_HUDSON2_S1	0x78001022
137 #define ATA_AMD_HUDSON2_S2	0x78011022
138 #define ATA_AMD_HUDSON2_S3	0x78021022
139 #define ATA_AMD_HUDSON2_S4	0x78031022
140 #define ATA_AMD_HUDSON2_S5	0x78041022
141 #define ATA_AMD_HUDSON2		0x780c1022
142 
143 #define ATA_ADAPTEC_ID          0x9005
144 #define ATA_ADAPTEC_1420        0x02419005
145 #define ATA_ADAPTEC_1430        0x02439005
146 
147 #define ATA_ATI_ID              0x1002
148 #define ATA_ATI_IXP200          0x43491002
149 #define ATA_ATI_IXP300          0x43691002
150 #define ATA_ATI_IXP300_S1       0x436e1002
151 #define ATA_ATI_IXP400          0x43761002
152 #define ATA_ATI_IXP400_S1       0x43791002
153 #define ATA_ATI_IXP400_S2       0x437a1002
154 #define ATA_ATI_IXP600          0x438c1002
155 #define ATA_ATI_IXP600_S1       0x43801002
156 #define ATA_ATI_IXP700          0x439c1002
157 #define ATA_ATI_IXP700_S1       0x43901002
158 #define	ATA_ATI_IXP700_S2	0x43911002
159 #define	ATA_ATI_IXP700_S3	0x43921002
160 #define	ATA_ATI_IXP700_S4	0x43931002
161 #define	ATA_ATI_IXP800_S1	0x43941002
162 #define	ATA_ATI_IXP800_S2	0x43951002
163 #define	ATA_ATI_4385            0x43851002
164 
165 #define ATA_CENATEK_ID          0x16ca
166 #define ATA_CENATEK_ROCKET      0x000116ca
167 
168 #define ATA_CYRIX_ID		0x1078
169 #define ATA_CYRIX_5530		0x01021078
170 
171 #define ATA_CYPRESS_ID		0x1080
172 #define ATA_CYPRESS_82C693	0xc6931080
173 
174 #define ATA_DEC_21150		0x00221011
175 #define ATA_DEC_21150_1		0x00231011
176 
177 #define ATA_HIGHPOINT_ID	0x1103
178 #define ATA_HPT366		0x00041103
179 #define ATA_HPT372		0x00051103
180 #define ATA_HPT302		0x00061103
181 #define ATA_HPT371		0x00071103
182 #define ATA_HPT374		0x00081103
183 
184 #define ATA_INTEL_ID		0x8086
185 #define ATA_I960RM		0x09628086
186 #define ATA_I82371FB		0x12308086
187 #define ATA_I82371SB		0x70108086
188 #define ATA_I82371AB		0x71118086
189 #define ATA_I82443MX		0x71998086
190 #define ATA_I82451NX		0x84ca8086
191 #define ATA_I82372FB		0x76018086
192 #define ATA_I82801AB		0x24218086
193 #define ATA_I82801AA		0x24118086
194 #define ATA_I82801BA		0x244a8086
195 #define ATA_I82801BA_1		0x244b8086
196 #define ATA_I82801CA		0x248a8086
197 #define ATA_I82801CA_1		0x248b8086
198 #define ATA_I82801DB		0x24cb8086
199 #define ATA_I82801DB_1		0x24ca8086
200 #define ATA_I82801EB		0x24db8086
201 #define ATA_I82801EB_S1         0x24d18086
202 #define ATA_I82801EB_R1         0x24df8086
203 #define ATA_I6300ESB            0x25a28086
204 #define ATA_I6300ESB_S1         0x25a38086
205 #define ATA_I6300ESB_R1         0x25b08086
206 #define ATA_I63XXESB2           0x269e8086
207 #define ATA_I63XXESB2_S1        0x26808086
208 #define ATA_I63XXESB2_S2        0x26818086
209 #define ATA_I63XXESB2_R1        0x26828086
210 #define ATA_I63XXESB2_R2        0x26838086
211 #define ATA_I82801FB		0x266f8086
212 #define ATA_I82801FB_S1		0x26518086
213 #define ATA_I82801FB_R1		0x26528086
214 #define ATA_I82801FB_M          0x26538086
215 #define ATA_I82801GB            0x27df8086
216 #define ATA_I82801GB_S1         0x27c08086
217 #define ATA_I82801GB_AH         0x27c18086
218 #define ATA_I82801GB_R1         0x27c38086
219 #define ATA_I82801GBM_S1        0x27c48086
220 #define ATA_I82801GBM_AH        0x27c58086
221 #define ATA_I82801GBM_R1        0x27c68086
222 #define ATA_I82801HB_S1         0x28208086
223 #define ATA_I82801HB_AH6        0x28218086
224 #define ATA_I82801HB_R1         0x28228086
225 #define ATA_I82801HB_AH4        0x28248086
226 #define ATA_I82801HB_S2         0x28258086
227 #define ATA_I82801HBM           0x28508086
228 #define ATA_I82801HBM_S1        0x28288086
229 #define ATA_I82801HBM_S2        0x28298086
230 #define ATA_I82801HBM_S3        0x282a8086
231 #define ATA_I82801IB_S1         0x29208086
232 #define ATA_I82801IB_AH2        0x29218086
233 #define ATA_I82801IB_AH6        0x29228086
234 #define ATA_I82801IB_AH4        0x29238086
235 #define ATA_I82801IB_R1         0x29258086
236 #define ATA_I82801IB_S2         0x29268086
237 #define ATA_I82801IBM_S1        0x29288086
238 #define ATA_I82801IBM_AH        0x29298086
239 #define ATA_I82801IBM_R1        0x292a8086
240 #define ATA_I82801IBM_S2        0x292d8086
241 #define ATA_I82801JIB_S1        0x3a208086
242 #define ATA_I82801JIB_AH        0x3a228086
243 #define ATA_I82801JIB_R1        0x3a258086
244 #define ATA_I82801JIB_S2        0x3a268086
245 #define ATA_I82801JD_S1         0x3a008086
246 #define ATA_I82801JD_AH         0x3a028086
247 #define ATA_I82801JD_R1         0x3a058086
248 #define ATA_I82801JD_S2         0x3a068086
249 /*
250 #define ATA_I82801JI_S1         0x3a208086
251 #define ATA_I82801JI_AH         0x3a228086
252 #define ATA_I82801JI_R1         0x3a258086
253 #define ATA_I82801JI_S2         0x3a268086
254 */
255 #define ATA_5Series_S1          0x3b208086
256 #define ATA_5Series_S2          0x3b218086
257 #define ATA_5Series_AH1         0x3b228086
258 #define ATA_5Series_AH2         0x3b238086
259 #define ATA_5Series_R1          0x3b258086
260 #define ATA_5Series_S3          0x3b268086
261 #define ATA_5Series_S4          0x3b288086
262 #define ATA_5Series_AH3         0x3b298086
263 #define ATA_5Series_R2          0x3b2c8086
264 #define ATA_5Series_S5          0x3b2d8086
265 #define ATA_5Series_S6          0x3b2e8086
266 #define ATA_5Series_AH4         0x3b2f8086
267 
268 #define ATA_CPT_S1              0x1c008086
269 #define ATA_CPT_S2              0x1c018086
270 #define ATA_CPT_AH1             0x1c028086
271 #define ATA_CPT_AH2             0x1c038086
272 #define ATA_CPT_R1              0x1c048086
273 #define ATA_CPT_R2              0x1c058086
274 #define ATA_CPT_S3              0x1c088086
275 #define ATA_CPT_S4              0x1c098086
276 
277 #define ATA_PBG_S1		0x1d008086
278 #define ATA_PBG_AH1		0x1d028086
279 #define ATA_PBG_R1		0x1d048086
280 #define ATA_PBG_R2		0x1d068086
281 #define ATA_PBG_R3		0x28268086
282 #define ATA_PBG_S2		0x1d088086
283 
284 #define ATA_PPT_S1		0x1e008086
285 #define ATA_PPT_S2		0x1e018086
286 #define ATA_PPT_AH1		0x1e028086
287 #define ATA_PPT_AH2		0x1e038086
288 #define ATA_PPT_R1		0x1e048086
289 #define ATA_PPT_R2		0x1e058086
290 #define ATA_PPT_R3		0x1e068086
291 #define ATA_PPT_R4		0x1e078086
292 #define ATA_PPT_S3		0x1e088086
293 #define ATA_PPT_S4		0x1e098086
294 #define ATA_PPT_R5		0x1e0e8086
295 #define ATA_PPT_R6		0x1e0f8086
296 
297 #define ATA_LPT_S1		0x8c008086
298 #define ATA_LPT_S2		0x8c018086
299 #define ATA_LPT_AH1		0x8c028086
300 #define ATA_LPT_AH2		0x8c038086
301 #define ATA_LPT_R1		0x8c048086
302 #define ATA_LPT_R2		0x8c058086
303 #define ATA_LPT_R3		0x8c068086
304 #define ATA_LPT_R4		0x8c078086
305 #define ATA_LPT_S3		0x8c088086
306 #define ATA_LPT_S4		0x8c098086
307 #define ATA_LPT_R5		0x8c0e8086
308 #define ATA_LPT_R6		0x8c0f8086
309 
310 #define ATA_I31244              0x32008086
311 #define ATA_ISCH                0x811a8086
312 #define ATA_DH89XXCC            0x23238086
313 
314 #define ATA_COLETOCRK_AH1       0x23a38086
315 #define ATA_COLETOCRK_S1        0x23a18086
316 #define ATA_COLETOCRK_S2        0x23a68086
317 
318 #define ATA_JMICRON_ID          0x197b
319 #define ATA_JMB360              0x2360197b
320 #define ATA_JMB361              0x2361197b
321 #define ATA_JMB362              0x2362197b
322 #define ATA_JMB363              0x2363197b
323 #define ATA_JMB365              0x2365197b
324 #define ATA_JMB366              0x2366197b
325 #define ATA_JMB368              0x2368197b
326 
327 #define ATA_MARVELL_ID          0x11ab
328 #define ATA_M88SX5040           0x504011ab
329 #define ATA_M88SX5041           0x504111ab
330 #define ATA_M88SX5080           0x508011ab
331 #define ATA_M88SX5081           0x508111ab
332 #define ATA_M88SX6041           0x604111ab
333 #define ATA_M88SX6042           0x604211ab
334 #define ATA_M88SX6081           0x608111ab
335 #define ATA_M88SX7042           0x704211ab
336 #define ATA_M88SE6101           0x610111ab
337 #define ATA_M88SE6102           0x610211ab
338 #define ATA_M88SE6111           0x611111ab
339 #define ATA_M88SE6121           0x612111ab
340 #define ATA_M88SE6141           0x614111ab
341 #define ATA_M88SE6145           0x614511ab
342 #define ATA_M88SE9123           0x91231b4b
343 #define ATA_MARVELL2_ID         0x1b4b
344 
345 #define ATA_MICRON_ID           0x1042
346 #define ATA_MICRON_RZ1000       0x10001042
347 #define ATA_MICRON_RZ1001       0x10011042
348 
349 #define ATA_NATIONAL_ID		0x100b
350 #define ATA_SC1100		0x0502100b
351 
352 #define ATA_NETCELL_ID          0x169c
353 #define ATA_NETCELL_SR          0x0044169c
354 
355 #define ATA_NVIDIA_ID		0x10de
356 #define ATA_NFORCE1		0x01bc10de
357 #define ATA_NFORCE2		0x006510de
358 #define ATA_NFORCE2_PRO         0x008510de
359 #define ATA_NFORCE2_PRO_S1      0x008e10de
360 #define ATA_NFORCE3		0x00d510de
361 #define ATA_NFORCE3_PRO		0x00e510de
362 #define ATA_NFORCE3_PRO_S1	0x00e310de
363 #define ATA_NFORCE3_PRO_S2	0x00ee10de
364 #define ATA_NFORCE_MCP04        0x003510de
365 #define ATA_NFORCE_MCP04_S1     0x003610de
366 #define ATA_NFORCE_MCP04_S2     0x003e10de
367 #define ATA_NFORCE_CK804        0x005310de
368 #define ATA_NFORCE_CK804_S1     0x005410de
369 #define ATA_NFORCE_CK804_S2     0x005510de
370 #define ATA_NFORCE_MCP51        0x026510de
371 #define ATA_NFORCE_MCP51_S1     0x026610de
372 #define ATA_NFORCE_MCP51_S2     0x026710de
373 #define ATA_NFORCE_MCP55        0x036e10de
374 #define ATA_NFORCE_MCP55_S1     0x037e10de
375 #define ATA_NFORCE_MCP55_S2     0x037f10de
376 #define ATA_NFORCE_MCP61        0x03ec10de
377 #define ATA_NFORCE_MCP61_S1     0x03e710de
378 #define ATA_NFORCE_MCP61_S2     0x03f610de
379 #define ATA_NFORCE_MCP61_S3     0x03f710de
380 #define ATA_NFORCE_MCP65        0x044810de
381 #define ATA_NFORCE_MCP65_A0     0x044c10de
382 #define ATA_NFORCE_MCP65_A1     0x044d10de
383 #define ATA_NFORCE_MCP65_A2     0x044e10de
384 #define ATA_NFORCE_MCP65_A3     0x044f10de
385 #define ATA_NFORCE_MCP65_A4     0x045c10de
386 #define ATA_NFORCE_MCP65_A5     0x045d10de
387 #define ATA_NFORCE_MCP65_A6     0x045e10de
388 #define ATA_NFORCE_MCP65_A7     0x045f10de
389 #define ATA_NFORCE_MCP67        0x056010de
390 #define ATA_NFORCE_MCP67_A0     0x055010de
391 #define ATA_NFORCE_MCP67_A1     0x055110de
392 #define ATA_NFORCE_MCP67_A2     0x055210de
393 #define ATA_NFORCE_MCP67_A3     0x055310de
394 #define ATA_NFORCE_MCP67_A4     0x055410de
395 #define ATA_NFORCE_MCP67_A5     0x055510de
396 #define ATA_NFORCE_MCP67_A6     0x055610de
397 #define ATA_NFORCE_MCP67_A7     0x055710de
398 #define ATA_NFORCE_MCP67_A8     0x055810de
399 #define ATA_NFORCE_MCP67_A9     0x055910de
400 #define ATA_NFORCE_MCP67_AA     0x055A10de
401 #define ATA_NFORCE_MCP67_AB     0x055B10de
402 #define ATA_NFORCE_MCP67_AC     0x058410de
403 #define ATA_NFORCE_MCP73        0x056c10de
404 #define ATA_NFORCE_MCP73_A0     0x07f010de
405 #define ATA_NFORCE_MCP73_A1     0x07f110de
406 #define ATA_NFORCE_MCP73_A2     0x07f210de
407 #define ATA_NFORCE_MCP73_A3     0x07f310de
408 #define ATA_NFORCE_MCP73_A4     0x07f410de
409 #define ATA_NFORCE_MCP73_A5     0x07f510de
410 #define ATA_NFORCE_MCP73_A6     0x07f610de
411 #define ATA_NFORCE_MCP73_A7     0x07f710de
412 #define ATA_NFORCE_MCP73_A8     0x07f810de
413 #define ATA_NFORCE_MCP73_A9     0x07f910de
414 #define ATA_NFORCE_MCP73_AA     0x07fa10de
415 #define ATA_NFORCE_MCP73_AB     0x07fb10de
416 #define ATA_NFORCE_MCP77        0x075910de
417 #define ATA_NFORCE_MCP77_A0     0x0ad010de
418 #define ATA_NFORCE_MCP77_A1     0x0ad110de
419 #define ATA_NFORCE_MCP77_A2     0x0ad210de
420 #define ATA_NFORCE_MCP77_A3     0x0ad310de
421 #define ATA_NFORCE_MCP77_A4     0x0ad410de
422 #define ATA_NFORCE_MCP77_A5     0x0ad510de
423 #define ATA_NFORCE_MCP77_A6     0x0ad610de
424 #define ATA_NFORCE_MCP77_A7     0x0ad710de
425 #define ATA_NFORCE_MCP77_A8     0x0ad810de
426 #define ATA_NFORCE_MCP77_A9     0x0ad910de
427 #define ATA_NFORCE_MCP77_AA     0x0ada10de
428 #define ATA_NFORCE_MCP77_AB     0x0adb10de
429 #define ATA_NFORCE_MCP79_A0     0x0ab410de
430 #define ATA_NFORCE_MCP79_A1     0x0ab510de
431 #define ATA_NFORCE_MCP79_A2     0x0ab610de
432 #define ATA_NFORCE_MCP79_A3     0x0ab710de
433 #define ATA_NFORCE_MCP79_A4     0x0ab810de
434 #define ATA_NFORCE_MCP79_A5     0x0ab910de
435 #define ATA_NFORCE_MCP79_A6     0x0aba10de
436 #define ATA_NFORCE_MCP79_A7     0x0abb10de
437 #define ATA_NFORCE_MCP79_A8     0x0abc10de
438 #define ATA_NFORCE_MCP79_A9     0x0abd10de
439 #define ATA_NFORCE_MCP79_AA     0x0abe10de
440 #define ATA_NFORCE_MCP79_AB     0x0abf10de
441 #define ATA_NFORCE_MCP89_A0     0x0d8410de
442 #define ATA_NFORCE_MCP89_A1     0x0d8510de
443 #define ATA_NFORCE_MCP89_A2     0x0d8610de
444 #define ATA_NFORCE_MCP89_A3     0x0d8710de
445 #define ATA_NFORCE_MCP89_A4     0x0d8810de
446 #define ATA_NFORCE_MCP89_A5     0x0d8910de
447 #define ATA_NFORCE_MCP89_A6     0x0d8a10de
448 #define ATA_NFORCE_MCP89_A7     0x0d8b10de
449 #define ATA_NFORCE_MCP89_A8     0x0d8c10de
450 #define ATA_NFORCE_MCP89_A9     0x0d8d10de
451 #define ATA_NFORCE_MCP89_AA     0x0d8e10de
452 #define ATA_NFORCE_MCP89_AB     0x0d8f10de
453 
454 #define ATA_PROMISE_ID		0x105a
455 #define ATA_PDC20246		0x4d33105a
456 #define ATA_PDC20262		0x4d38105a
457 #define ATA_PDC20263		0x0d38105a
458 #define ATA_PDC20265		0x0d30105a
459 #define ATA_PDC20267		0x4d30105a
460 #define ATA_PDC20268		0x4d68105a
461 #define ATA_PDC20269		0x4d69105a
462 #define ATA_PDC20270		0x6268105a
463 #define ATA_PDC20271		0x6269105a
464 #define ATA_PDC20275		0x1275105a
465 #define ATA_PDC20276		0x5275105a
466 #define ATA_PDC20277		0x7275105a
467 #define ATA_PDC20318		0x3318105a
468 #define ATA_PDC20319		0x3319105a
469 #define ATA_PDC20371		0x3371105a
470 #define ATA_PDC20375		0x3375105a
471 #define ATA_PDC20376		0x3376105a
472 #define ATA_PDC20377		0x3377105a
473 #define ATA_PDC20378		0x3373105a
474 #define ATA_PDC20379		0x3372105a
475 #define ATA_PDC20571            0x3571105a
476 #define ATA_PDC20575            0x3d75105a
477 #define ATA_PDC20579            0x3574105a
478 #define ATA_PDC20771            0x3570105a
479 #define ATA_PDC40518            0x3d18105a
480 #define ATA_PDC40519            0x3519105a
481 #define ATA_PDC40718            0x3d17105a
482 #define ATA_PDC40719            0x3515105a
483 #define ATA_PDC40775            0x3d73105a
484 #define ATA_PDC40779            0x3577105a
485 #define ATA_PDC20617		0x6617105a
486 #define ATA_PDC20618		0x6626105a
487 #define ATA_PDC20619		0x6629105a
488 #define ATA_PDC20620		0x6620105a
489 #define ATA_PDC20621		0x6621105a
490 #define ATA_PDC20622		0x6622105a
491 #define ATA_PDC20624            0x6624105a
492 #define ATA_PDC81518            0x8002105a
493 
494 #define ATA_SERVERWORKS_ID	0x1166
495 #define ATA_ROSB4_ISA		0x02001166
496 #define ATA_ROSB4		0x02111166
497 #define ATA_CSB5		0x02121166
498 #define ATA_CSB6		0x02131166
499 #define ATA_CSB6_1		0x02171166
500 #define ATA_HT1000              0x02141166
501 #define ATA_HT1000_S1           0x024b1166
502 #define ATA_HT1000_S2           0x024a1166
503 #define ATA_K2			0x02401166
504 #define ATA_FRODO4		0x02411166
505 #define ATA_FRODO8		0x02421166
506 
507 #define ATA_SILICON_IMAGE_ID	0x1095
508 #define ATA_SII3114		0x31141095
509 #define ATA_SII3512		0x35121095
510 #define ATA_SII3112		0x31121095
511 #define ATA_SII3112_1		0x02401095
512 #define ATA_SII3124		0x31241095
513 #define ATA_SII3132		0x31321095
514 #define ATA_SII3132_1		0x02421095
515 #define ATA_SII3132_2		0x02441095
516 #define ATA_SII0680		0x06801095
517 #define ATA_CMD646		0x06461095
518 #define ATA_CMD648		0x06481095
519 #define ATA_CMD649		0x06491095
520 
521 #define ATA_SIS_ID		0x1039
522 #define ATA_SISSOUTH		0x00081039
523 #define ATA_SIS5511		0x55111039
524 #define ATA_SIS5513		0x55131039
525 #define ATA_SIS5517		0x55171039
526 #define ATA_SIS5518		0x55181039
527 #define ATA_SIS5571		0x55711039
528 #define ATA_SIS5591		0x55911039
529 #define ATA_SIS5596		0x55961039
530 #define ATA_SIS5597		0x55971039
531 #define ATA_SIS5598		0x55981039
532 #define ATA_SIS5600		0x56001039
533 #define ATA_SIS530		0x05301039
534 #define ATA_SIS540		0x05401039
535 #define ATA_SIS550		0x05501039
536 #define ATA_SIS620		0x06201039
537 #define ATA_SIS630		0x06301039
538 #define ATA_SIS635		0x06351039
539 #define ATA_SIS633		0x06331039
540 #define ATA_SIS640		0x06401039
541 #define ATA_SIS645		0x06451039
542 #define ATA_SIS646		0x06461039
543 #define ATA_SIS648		0x06481039
544 #define ATA_SIS650		0x06501039
545 #define ATA_SIS651		0x06511039
546 #define ATA_SIS652		0x06521039
547 #define ATA_SIS655		0x06551039
548 #define ATA_SIS658		0x06581039
549 #define ATA_SIS661		0x06611039
550 #define ATA_SIS730		0x07301039
551 #define ATA_SIS733		0x07331039
552 #define ATA_SIS735		0x07351039
553 #define ATA_SIS740		0x07401039
554 #define ATA_SIS745		0x07451039
555 #define ATA_SIS746		0x07461039
556 #define ATA_SIS748		0x07481039
557 #define ATA_SIS750		0x07501039
558 #define ATA_SIS751		0x07511039
559 #define ATA_SIS752		0x07521039
560 #define ATA_SIS755		0x07551039
561 #define ATA_SIS961		0x09611039
562 #define ATA_SIS962		0x09621039
563 #define ATA_SIS963		0x09631039
564 #define ATA_SIS964		0x09641039
565 #define ATA_SIS965              0x09651039
566 #define ATA_SIS964_1		0x01801039
567 #define ATA_SIS180              0x01801039
568 #define ATA_SIS181              0x01811039
569 #define ATA_SIS182              0x01821039
570 
571 #define ATA_VIA_ID		0x1106
572 #define ATA_VIA82C571		0x05711106
573 #define ATA_VIA82C586		0x05861106
574 #define ATA_VIA82C596		0x05961106
575 #define ATA_VIA82C686		0x06861106
576 #define ATA_VIA8231		0x82311106
577 #define ATA_VIA8233		0x30741106
578 #define ATA_VIA8233A		0x31471106
579 #define ATA_VIA8233C		0x31091106
580 #define ATA_VIA8235		0x31771106
581 #define ATA_VIA8237		0x32271106
582 #define ATA_VIA8237A            0x05911106
583 #define ATA_VIA8237S		0x53371106
584 #define ATA_VIA8237_5372	0x53721106
585 #define ATA_VIA8237_7372	0x73721106
586 #define ATA_VIA8251             0x33491106
587 #define ATA_VIA8361		0x31121106
588 #define ATA_VIA8363		0x03051106
589 #define ATA_VIA8371		0x03911106
590 #define ATA_VIA8662		0x31021106
591 #define ATA_VIA6410		0x31641106
592 #define ATA_VIA6420		0x31491106
593 #define ATA_VIA6421             0x32491106
594 
595 #define ATA_VIACX700IDE         0x05811106
596 #define ATA_VIACX700            0x83241106
597 #define ATA_VIASATAIDE          0x53241106
598 #define ATA_VIAVX800            0x83531106
599 #define ATA_VIASATAIDE2         0xc4091106
600 #define ATA_VIAVX855            0x84091106
601 #define ATA_VIASATAIDE3         0x90011106
602 #define ATA_VIAVX900            0x84101106
603 
604 #define ATA_ITE_ID		0x1283
605 #define ATA_IT8172G		0x81721283
606 #define ATA_IT8211F             0x82111283
607 #define ATA_IT8212F             0x82121283
608 #define ATA_IT8213F             0x82131283
609 
610 #define ATA_OPTI_ID             0x1045
611 #define ATA_OPTI82C621          0xc6211045
612 #define ATA_OPTI82C625          0xd5681045
613 
614 #define ATA_HINT_ID	        0x3388
615 #define ATA_HINTEIDE_ID	        0x80133388
616 
617 /* chipset setup related defines          */
618 /* Used in HW_DEVICE_EXTENSION.InitMethod */
619 
620 #define CHIPTYPE_MASK   0x000000ff
621 #define CHIPFLAG_MASK   0xffffff00
622 
623 #define UNIATA_RAID_CONTROLLER  0x80000000
624 #define UNIATA_SIMPLEX_ONLY     0x40000000 /* contoller cannot perform operations
625                                               on both channels on the same time */
626 #define UNIATA_NO_SLAVE         0x20000000
627 #define UNIATA_SATA             0x10000000
628 #define UNIATA_NO_DPC           0x08000000
629 #define UNIATA_NO_DPC_ATAPI     0x04000000
630 #define UNIATA_AHCI             0x02000000
631 #define UNIATA_NO80CHK          0x01000000
632 #define UNIATA_CHAN_TIMINGS     0x00800000 /* controller has common timing settings for master/slave */
633 #define UNIATA_AHCI_ALT_SIG     0x00400000 /* Some weird controllers do not return signature in
634 			                      FIS receive area. Read it from PxSIG register */
635 
636 #define ATPOLD		0x0100
637 
638 #define ALIOLD		0x0100
639 #define ALINEW		0x0200
640 
641 #define HPT366		0
642 #define HPT370		1
643 #define HPT372		2
644 #define HPT374		3
645 #define HPTOLD		0x0100
646 
647 #define PROLD		0
648 #define PRNEW		1
649 #define PRTX		2
650 #define PRMIO		3
651 #define PRTX4		0x0100
652 #define PRSX4K		0x0200
653 #define PRSX6K		0x0400
654 #define PRSATA		0x0800
655 #define PRCMBO		0x1000
656 #define PRG2		0x2000
657 #define PRCMBO2		(PRCMBO | PRG2)
658 #define PRSATA2		(PRSATA | PRG2)
659 
660 #define SWKS33		0
661 #define SWKS66		1
662 #define SWKS100		2
663 #define SWKSMIO		3
664 
665 #define SIIOLD          0
666 #define SIICMD          1
667 #define SIIMIO          2
668 #define ATI700          3
669 
670 #define SIIINTR	        0x0100
671 #define SIIENINTR       0x0200
672 #define SII4CH          0x0400
673 #define SIISETCLK       0x0800
674 #define SIIBUG          0x1000
675 #define SIINOSATAIRQ    0x2000
676 
677 //#define SIS_SOUTH	1
678 #define SISSATA		2
679 #define SIS133NEW	3
680 #define SIS133OLD	4
681 #define SIS100NEW	5
682 #define SIS100OLD	6
683 #define SIS66		7
684 #define SIS33		8
685 
686 #define SIS_BASE        0x0100
687 #define SIS_SOUTH       0x0200
688 
689 #define INTEL_STD       0
690 #define INTEL_IDX       1
691 
692 #define ICH4_FIX        0x0100
693 #define ICH5            0x0200
694 #define I6CH            0x0400
695 #define I6CH2           0x0800
696 //#define I1CH            0x1000  // obsolete
697 #define ICH7            0x1000
698 
699 #define NV4OFF          0x0100
700 #define NVQ             0x0200
701 #define NVGEN           0x0400
702 
703 #define VIANEW		5
704 #define VIA33		4
705 #define VIA66		1
706 #define VIA100		2
707 #define VIA133		3
708 #define AMDNVIDIA	0
709 #define AMDCABLE	0x0100
710 #define AMDBUG		0x0200
711 #define VIABAR		0x0400
712 #define VIACLK		0x0800
713 #define VIABUG		0x1000
714 #define VIASOUTH	0x2000
715 #define VIAAST		0x4000
716 #define VIAPRQ		0x8000
717 #define VIASATA         0x10000
718 
719 #define CYRIX_OLD       0
720 #define CYRIX_3x        1
721 #define CYRIX_NEW       2
722 #define CYRIX_35        3
723 
724 #define ITE_33          0
725 #define ITE_133         1
726 #define ITE_133_NEW     2
727 
728 #ifdef USER_MODE
729 /*  #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
730     { (PVEN_STR) #idlo, 4, 0x##idlo, (PVEN_STR) #idhi, 4, 0x##idhi, rev, mode, (PVEN_STR)name, flags}*/
731   #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
732     { 0x##idlo, 0x##idhi, rev, mode, flags, name}
733 #else
734 /*  #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
735     { (PVEN_STR) #idlo, 4, 0x##idlo, (PVEN_STR) #idhi, 4, 0x##idhi, rev, mode, NULL, flags}*/
736   #define PCI_DEV_HW_SPEC_BM(idhi, idlo, rev, mode, name, flags) \
737     { 0x##idlo, 0x##idhi, rev, mode, flags, name}
738 #endif
739 
740 #define BMLIST_TERMINATOR   (0xffffffffL)
741 
742 extern BUSMASTER_CONTROLLER_INFORMATION_BASE const BusMasterAdapters[];
743 
744 #define NUM_BUSMASTER_ADAPTERS _NUM_BUSMASTER_ADAPTERS
745 // _NUM_BUSMASTER_ADAPTERS = (sizeof(BusMasterAdapters) / sizeof(BUSMASTER_CONTROLLER_INFORMATION_BASE))
746 extern ULONG const NUM_BUSMASTER_ADAPTERS;
747 
748 /*
749     Looks for device with specified Device/Vendor and Revision
750     in specified device list and returnts its index.
751     If no matching record found, -1 is returned
752 */
753 __inline
754 ULONG
Ata_is_dev_listed(IN PBUSMASTER_CONTROLLER_INFORMATION_BASE BusMasterAdapters,ULONG VendorId,ULONG DeviceId,ULONG RevId,ULONG lim)755 Ata_is_dev_listed(
756     IN PBUSMASTER_CONTROLLER_INFORMATION_BASE BusMasterAdapters,
757     ULONG VendorId,
758     ULONG DeviceId,
759     ULONG RevId, // min suitable revision
760     ULONG lim
761     )
762 {
763     for(ULONG k=0; k<lim; k++) {
764         if(BusMasterAdapters[k].nVendorId == 0xffff &&
765            BusMasterAdapters[k].nDeviceId == 0xffff &&
766            BusMasterAdapters[k].nRevId    == 0xff) {
767             if(lim != BMLIST_TERMINATOR)
768                 continue;
769             return BMLIST_TERMINATOR;
770         }
771         if(BusMasterAdapters[k].nVendorId == VendorId &&
772            (BusMasterAdapters[k].nDeviceId == DeviceId || DeviceId == 0xffff) &&
773            (!RevId || BusMasterAdapters[k].nRevId <= RevId) )
774             return k;
775     }
776     return BMLIST_TERMINATOR;
777 }
778 
779 #define Ata_is_supported_dev(pciData) \
780     ((pciData)->BaseClass == PCI_DEV_CLASS_STORAGE && \
781      (pciData)->SubClass == PCI_DEV_SUBCLASS_IDE)
782 
783 #define Ata_is_ahci_dev(pciData) \
784     ((pciData)->BaseClass == PCI_DEV_CLASS_STORAGE && \
785      (pciData)->SubClass == PCI_DEV_SUBCLASS_SATA && \
786      (pciData)->ProgIf == PCI_DEV_PROGIF_AHCI_1_0 && \
787      ((pciData)->u.type0.BaseAddresses[5] & ~0x7))
788 
789 
790 #pragma pack(pop)
791 
792 #endif //__IDE_BUSMASTER_DEVICES_H__
793