984{
988
990
997
998 ULONG VendorID = deviceExtension->
DevID & 0xffff;
999
1000
1003
1004 LONG statusByte = 0;
1005
1006
1007
1009
1011
1014 wdmamode = udmamode = -1;
1015 }
1016
1017
1021 } else
1024 udmamode = -1;
1026 } else
1029 wdmamode = udmamode = -1;
1031 } else {
1033 wdmamode = udmamode = -1;
1034 apiomode = 0;
1035 }
1036
1041 ));
1043 } else
1047 ));
1048 udmamode = -1;
1050 } else
1053 wdmamode = udmamode = -1;
1055 } else {
1057 wdmamode = udmamode = -1;
1058 apiomode = 0;
1059 }
1060
1061
1062
1063
1066
1069
1070 }
1073 return;
1074 }
1075
1076
1080 ) {
1081
1082
1083
1084
1085
1087
1089
1090
1092
1096 return;
1097 }
1098 udmamode =
min(udmamode, 6);
1099
1100 } else {
1104 udmamode = 2;
1106 } else {
1107 udmamode =
min(udmamode, 6);
1108 }
1109 }
1110 }
1111 if(udmamode >= 0) {
1113 } else
1114 if(wdmamode >= 0) {
1116 } else
1117 if(apiomode >= 0) {
1119 } else {
1121 }
1122
1124 return;
1125 }
1126
1129 goto try_generic_dma;
1130 }
1131
1135 } else {
1137 udmamode = 2;
1139 }
1140 }
1141
1143 apiomode,
1144 wdmamode,
1145 udmamode));
1146
1147 switch(VendorID) {
1149
1150
1151
1152 static const USHORT reg4a = 0xa6;
1154
1156
1157 static const USHORT reg4x2 = 0x0301;
1158
1159 for(
i=udmamode;
i>=0;
i--) {
1161set_old_acard:
1165 return;
1166 }
1167
1168 }
1169 if (wdmamode >= 2 && apiomode >= 4) {
1171 goto set_old_acard;
1172 }
1173 }
1174 } else {
1175
1176 static const UCHAR reg4x = 0x31;
1177
1178 for(
i=udmamode;
i>=0;
i--) {
1180set_new_acard:
1184 return;
1185 }
1186
1187 }
1188 if (wdmamode >= 2 && apiomode >= 4) {
1190 goto set_new_acard;
1191 }
1192 }
1193 }
1194
1195 break; }
1197
1198
1199
1200 static const UCHAR ali_udma[] = {0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x0f};
1201 static const ULONG ali_pio[] =
1202 { 0x006d0003, 0x00580002, 0x00440001, 0x00330001,
1203 0x00310001, 0x00440001};
1204
1205 if ((ChipFlags &
ALIOLD) &&
1206 (udmamode >= 0 || wdmamode >= 0)) {
1209
1212 udmamode = wdmamode = -1;
1213 break;
1214 }
1215 }
1216 for(
i=udmamode;
i>=0;
i--) {
1219
1221 word54 &= ~(0x000f000f << (
dev * 4));
1222 word54 |= (((ali_udma[
i]<<16) | 5) << (
dev * 4));
1226 return;
1227 }
1228 }
1229
1231 if (wdmamode >= 2 && apiomode >= 4) {
1235 return;
1236 }
1237 }
1239
1240 for(
i=apiomode;
i>=0;
i--) {
1244 return;
1245 }
1246 }
1247 return;
1248 break; }
1252
1253
1254
1257 (Channel == 0)) {
1259 return;
1260 }
1261 if((ChipFlags &
VIABAR) &&
1262 (Channel < 2)) {
1264 return;
1265 }
1266 }
1267
1268 static const UCHAR via_modes[6][7] = {
1269 { 0xc2, 0xc1, 0xc0, 0x00, 0x00, 0x00, 0x00 },
1270 { 0xee, 0xec, 0xea, 0xe9, 0xe8, 0x00, 0x00 },
1271 { 0xf7, 0xf6, 0xf4, 0xf2, 0xf1, 0xf0, 0x00 },
1272 { 0xf7, 0xf7, 0xf6, 0xf4, 0xf2, 0xf1, 0xf0 },
1273 { 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6, 0xc7 },
1274 { 0xee, 0xe8, 0xe6, 0xe4, 0xe2, 0xe1, 0xe0 }};
1275 static const UCHAR via_pio[] =
1276 { 0xa8, 0x65, 0x42, 0x22, 0x20, 0x42, 0x22, 0x20,
1277 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
1281
1284 reg2 = 0xab;
1285 }
1286
1287 reg_val = &via_modes[ChipType][0];
1288
1291 reg2 += 0x10;
1292 }
1293
1294 for(
i = udmamode;
i>=0;
i--) {
1298 return;
1299 }
1300 }
1301 if(!(ChipFlags &
VIABAR)) {
1302
1303 for(
i = wdmamode;
i>=0;
i--) {
1307 return;
1308 }
1309 }
1310 }
1311
1312 if((apiomode >= 0) && (ChipType !=
VIA133)) {
1314 }
1317 }
1319 return;
1320
1321 break; }
1323
1324
1325
1326dma_cs55xx:
1327 if(apiomode >= 4)
1328 apiomode = 4;
1329
1331#ifdef __REACTOS__
1332 static const ULONG cyr_piotiming[] =
1333 { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 };
1334 static const ULONG cyr_wdmatiming[] = { 0x00077771, 0x00012121, 0x00002020 };
1335 static const ULONG cyr_udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 };
1336#else
1337 ULONG cyr_piotiming[] =
1338 { 0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010 };
1339 ULONG cyr_wdmatiming[] = { 0x00077771, 0x00012121, 0x00002020 };
1340 ULONG cyr_udmatiming[] = { 0x00921250, 0x00911140, 0x00911030 };
1341#endif
1343
1344 for(
i=udmamode;
i>=0;
i--) {
1347 return;
1348 }
1349 }
1350 for(
i=wdmamode;
i>=0;
i--) {
1353 return;
1354 }
1355 }
1358 return;
1359 }
1360 } else
1362#ifdef __REACTOS__
1363 static const UCHAR cyr_piotiming_old[] = { 11, 6, 3, 2, 1 };
1364#else
1365 UCHAR cyr_piotiming_old[] =
1366 { 11, 6, 3, 2, 1 };
1367#endif
1369
1370 for(
i=wdmamode;
i>=0;
i--) {
1372 return;
1373 }
1374 }
1376 timing = (6-apiomode) | (cyr_piotiming_old[
i]);
1377
1379
1381
1383 return;
1384 }
1385 } else
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403 for(
i=udmamode;
i>=0;
i--) {
1405 return;
1406 }
1407 }
1408 for(
i=wdmamode;
i>=0;
i--) {
1410 return;
1411 }
1412 }
1414 return;
1415 }
1416 }
1417 return;
1418
1419 break; }
1421
1422
1423
1424 if(!ChipType) {
1425#ifdef __REACTOS__
1426 static const ULONG nat_piotiming[] =
1427 { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010, 0x00803020,
1428 0x20102010, 0x00100010, 0x00100010, 0x00100010, 0x00100010 };
1429 static const ULONG nat_dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 };
1430 static const ULONG nat_udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 };
1431#else
1432 ULONG nat_piotiming[] =
1433 { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010,
1434 0x00803020, 0x20102010, 0x00100010,
1435 0x00100010, 0x00100010, 0x00100010 };
1436 ULONG nat_dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 };
1437 ULONG nat_udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 };
1438#endif
1439
1440 if(apiomode >= 4)
1441 apiomode = 4;
1442 for(
i=udmamode;
i>=0;
i--) {
1446 return;
1447 }
1448 }
1449 for(
i=wdmamode;
i>=0;
i--) {
1453 return;
1454 }
1455 }
1459 return;
1460 }
1461 } else {
1462 goto dma_cs55xx;
1463 }
1464
1465 break; }
1467
1468
1469
1470 if (wdmamode >= 2 && apiomode >= 4) {
1473 return;
1474 }
1475 }
1476
1477 break;
1479
1480
1481
1482 for(
i=udmamode;
i>=0;
i--) {
1484 return;
1485 }
1486 }
1487 for(
i=wdmamode;
i>=0;
i--) {
1489 return;
1490 }
1491 }
1492
1493 if (wdmamode >= 0 && apiomode >= 4) {
1495 return;
1496 }
1497 }
1499 return;
1500 break;
1502
1503
1504
1505 if (wdmamode >= 2 && apiomode >= 4) {
1507 return;
1508 }
1509 }
1510
1511 break;
1513
1514
1515
1516 for(
i=udmamode;
i>=0;
i--) {
1519 return;
1520 }
1521 }
1522
1523 for(
i=wdmamode;
i>=0;
i--) {
1526 return;
1527 }
1528 }
1529
1530 if (wdmamode >= 0 && apiomode >= 4) {
1532 return;
1533 }
1534 }
1537 return;
1538 break; }
1540
1541
1542
1543
1556#ifdef __REACTOS__
1557 static const UCHAR intel_timings[] =
1558 { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23 };
1559 static const UCHAR intel_utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 };
1560#else
1561 UCHAR intel_timings[] = { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23,
1562 0x23, 0x23, 0x23, 0x23, 0x23, 0x23 };
1563 UCHAR intel_utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 };
1564#endif
1565 const UCHAR needed_pio[3] = {
1567 };
1568
1573 for(
i=wdmamode;
i>=0;
i--) {
1577 break;
1578 }
1579 }
1580 if(!udma_ok) {
1583 } else {
1584
1585
1586 if (apiomode < needed_pio[wdmamode]) {
1587
1588 control |= 8;
1589 }
1590 }
1593 control |= 0x03;
1594 } else {
1595 control |= 0x02;
1596 }
1597
1598
1599 if (!isAtapi) {
1600 control |= 4;
1601 }
1602
1603
1606 reg4x |= intel_timings[
idx] << 8;
1608 return;
1609 }
1610
1615
1616 for(
i=udmamode;
i>=0;
i--) {
1618 tim |= (0x1 << 31);
1619 tim &= ~(0x7 << 16);
1621
1625 break;
1626 }
1627 }
1628 if(!udma_ok) {
1629 for(
i=wdmamode;
i>=0;
i--) {
1631 tim &= ~(0x1 << 31);
1632 tim &= ~(0x3 << 8);
1634
1639 break;
1640 }
1641 }
1642 }
1643 if(!udma_ok) {
1646 }
1647 tim &= ~(0x7);
1648 tim |= (apiomode & 0x7);
1650
1651 return;
1652 }
1653
1655
1657
1659
1660
1661 reg54 |= 0x400;
1662
1663
1664
1665
1666
1667
1668
1669 for(
i=udmamode;
i>=0;
i--) {
1671
1672
1674
1676
1678 } else {
1680 (((
USHORT)(intel_utimings[
i])) << (
dev<<2) ) );
1681 }
1682
1683
1684 reg54 &= ~(0x1001 <<
dev);
1686 reg54 |= (0x1 <<
dev);
1687 }
1688
1690 reg54 |= (0x1000 <<
dev);
1691 }
1693
1698 return;
1699 }
1700 break;
1701 }
1702 }
1703
1704 if(!udma_ok) {
1708 }
1710 for(
i=wdmamode;
i>=0;
i--) {
1716 return;
1717 }
1718 break;
1719 }
1720 }
1721 }
1722
1723 if(!udma_ok) {
1726 }
1727
1730
1731
1732 reg40 &= ~0x00ff00ff;
1733 reg40 |= 0x40774077;
1734
1735 mask40 = 0x000000ff;
1736
1738 mask40 = 0x00003300;
1739 new40 = ((
USHORT)(intel_timings[
idx]) << 8);
1740 } else {
1741 mask44 = 0x0f;
1742 new44 = ((intel_timings[
idx] & 0x30) >> 2) |
1743 (intel_timings[
idx] & 0x03);
1744 }
1745
1746 if (Channel) {
1747 mask40 <<= 16;
1748 new40 <<= 16;
1749 mask44 <<= 4;
1750 new44 <<= 4;
1751 }
1752
1756
1757 return;
1758 break; }
1760
1761
1762
1763
1764 UCHAR sel66 = Channel ? 0x08: 0x02;
1765
1766 if(ChipType <
PRTX) {
1767 if (isAtapi) {
1768 udmamode =
1769 wdmamode = -1;
1770 }
1771 }
1772 for(
i=udmamode;
i>=0;
i--) {
1773
1774 if(ChipType ==
PRNEW) {
1778 sel66);
1779 } else {
1782 ~sel66);
1783 }
1784 }
1785
1788 return;
1789 }
1790 }
1791 if(ChipType ==
PRNEW) {
1794 ~sel66);
1795 }
1796 for(
i=wdmamode;
i>=0;
i--) {
1799 return;
1800 }
1801 }
1804 return;
1805 break; }
1807
1810 goto l_ATA_SILICON_IMAGE_ID;
1811 }
1812
1813
1814
1815
1816
1818
1819
1820
1821
1822 static const ULONG sw_dma_modes[] = { 0x70, 0x21, 0x20 };
1823 static const ULONG sw_pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20, 0x34, 0x22, 0x20,
1824 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
1830
1831 for(
i=udmamode;
i>=0;
i--) {
1834 reg56 &= ~(0xf << (
dev * 4));
1838
1840 reg44 = (reg44 & ~(0xff << bit_offset)) |
1841 (sw_dma_modes[2] << bit_offset);
1843
1845 reg40 = (reg40 & ~(0xff << bit_offset)) |
1846 (sw_pio_modes[8+
i] << bit_offset);
1848 return;
1849 }
1850 }
1851
1852 for(
i=wdmamode;
i>=0;
i--) {
1854
1856
1858 reg44 = (reg44 & ~(0xff << bit_offset)) |
1859 (sw_dma_modes[wdmamode] << bit_offset);
1861
1863 reg40 = (reg40 & ~(0xff << bit_offset)) |
1864 (sw_pio_modes[5+
i] << bit_offset);
1866 return;
1867 }
1868 }
1870
1872
1873
1875
1877 reg4a = (reg4a & ~(0xf << (
dev*4))) |
1878 (apiomode << (
dev*4));
1880 }
1881
1882
1884 reg40 = (reg40 & ~(0xff << bit_offset)) |
1885 (sw_pio_modes[apiomode] << bit_offset);
1887 return;
1888 break; }
1890l_ATA_SILICON_IMAGE_ID:
1891
1892
1893
1895
1896 static const UCHAR sil_modes[7] =
1897 { 0xf, 0xb, 0x7, 0x5, 0x3, 0x2, 0x1 };
1898 static const USHORT sil_wdma_modes[3] =
1899 { 0x2208, 0x10c2, 0x10c1 };
1900 static const USHORT sil_pio_modes[6] =
1901 { 0x328a, 0x2283, 0x1104, 0x10c3, 0x10c1, 0x10c1 };
1902
1905 UCHAR mreg = Channel ? 0x84 : 0x80;
1908
1911
1912
1913 for(
i = udmamode;
i>=0;
i--) {
1914
1918 return;
1919 }
1920 }
1921
1922 for(
i = wdmamode;
i>=0;
i--) {
1923
1927 return;
1928 }
1929 }
1930
1932
1935 return;
1936
1937 } else {
1938
1939 static const UCHAR cmd_modes[2][6] = {
1940 { 0x31, 0x21, 0x011, 0x25, 0x15, 0x05 },
1941 { 0xc2, 0x82, 0x042, 0x8a, 0x4a, 0x0a } };
1942 static const UCHAR cmd_wdma_modes[] = { 0x87, 0x32, 0x3f };
1943 static const UCHAR cmd_pio_modes[] = { 0xa9, 0x57, 0x44, 0x32, 0x3f };
1945
1946 udmamode =
min(udmamode, 5);
1947
1948 for(
i = udmamode;
i>=0;
i--) {
1950
1956 return;
1957 }
1958 }
1959
1961
1962 for(
i = wdmamode;
i>=0;
i--) {
1963
1967 return;
1968 }
1969 }
1970
1972
1975 return;
1976
1977 }
1978 return;
1979 break; }
1981
1982
1983
1985 static const ULONG sis_modes_new133[] =
1986 { 0x28269008, 0x0c266008, 0x04263008, 0x0c0a3008, 0x05093008,
1987 0x22196008, 0x0c0a3008, 0x05093008, 0x050939fc, 0x050936ac,
1988 0x0509347c, 0x0509325c, 0x0509323c, 0x0509322c, 0x0509321c};
1989 static const ULONG sis_modes_old133[] =
1990 { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031,
1991 0x8f31, 0x8a31, 0x8731, 0x8531, 0x8331, 0x8231, 0x8131 };
1992 static const ULONG sis_modes_old[] =
1993 { 0x0c0b, 0x0607, 0x0404, 0x0303, 0x0301, 0x0404, 0x0303, 0x0301,
1994 0xf301, 0xd301, 0xb301, 0xa301, 0x9301, 0x8301 };
1995 static const ULONG sis_modes_new100[] =
1996 { 0x00cb, 0x0067, 0x0044, 0x0033, 0x0031, 0x0044, 0x0033, 0x0031,
1997 0x8b31, 0x8731, 0x8531, 0x8431, 0x8231, 0x8131 };
1998
2003
2004 switch(ChipType) {
2006 sis_modes = (
PULONG)(&sis_modes_new133[0]);
2009 reg = (reg57 & 0x40 ? 0x70 : 0x40) + (
dev * 4);
2010 break;
2012 sis_modes = (
PULONG)(&sis_modes_old133[0]);
2015 break;
2017 sis_modes = (
PULONG)(&sis_modes_new100[0]);
2020 break;
2024 sis_modes = (
PULONG)(&sis_modes_old[0]);
2027 break;
2028 }
2029
2030 offs = 5+3;
2031 for(
i=udmamode;
i>=0;
i--) {
2035 } else {
2037 }
2038 return;
2039 }
2040 }
2041
2042 offs = 5;
2043 for(
i=wdmamode;
i>=0;
i--) {
2047 } else {
2049 }
2050 return;
2051 }
2052 }
2056 } else {
2058 }
2059 return;
2060 break; }
2061 case 0x16ca:
2062
2063 if (wdmamode >= 0 &&
2067 } else {
2069 }
2070 return;
2072
2074 int a_speed = 3 << (
dev * 4);
2075 int u_flag = 1 <<
dev;
2076 int u_speed = 0;
2077 int pio = 1;
2081
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095 for(
i=udmamode;
i>=0;
i--) {
2098 reg4a &= ~a_speed;
2100 pio = 4;
2101 goto setup_drive_ite;
2102 }
2103 }
2104
2105 for(
i=wdmamode;
i>=0;
i--) {
2109 pio = 3;
2110 return;
2111 }
2112 }
2116
2117 pio = apiomode;
2118
2119setup_drive_ite:
2120
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137 drive_enables |= 0x4000;
2138
2139 drive_enables &= (0xc000 | (0x06 << (
DeviceNumber*4)));
2140 if (pio > 1) {
2141
2143 }
2144
2146 } else
2148 static const UCHAR udmatiming[] =
2149 { 0x44, 0x42, 0x31, 0x21, 0x11, 0xa2, 0x91 };
2150 static const UCHAR chtiming[] =
2151 { 0xaa, 0xa3, 0xa1, 0x33, 0x31, 0x88, 0x32, 0x31 };
2154
2155 for(
i=udmamode;
i>=0;
i--) {
2159 return;
2160 }
2161 }
2162
2163 for(
i=wdmamode;
i>=0;
i--) {
2165
2168 if(reg54 < chtiming[
i+5]) {
2170 }
2171 return;
2172 }
2173 }
2177 if(reg54 < chtiming[apiomode]) {
2179 }
2180 return;
2181 } else
2183
2184 static const UCHAR udmatiming[] =
2185 { 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10 };
2186 static const UCHAR timings[] =
2187 { 0x00, 0x00, 0x10, 0x21, 0x23, 0x10, 0x21, 0x23,
2188 0x23, 0x23, 0x23, 0x23, 0x23, 0x02, 0x02 };
2192
2197 USHORT mask40=0, new40=0;
2198 UCHAR mask44=0, new44=0;
2199
2204
2205 if(!(reg54 & (0x10 <<
dev))) {
2206
2207 udmamode =
min(udmamode, 2);
2208 }
2209
2210 for(
i=udmamode;
i>=0;
i--) {
2214 (
a & ~(0x3 << (
dev*4))) |
2215 (udmatiming[
i] << (
dev*4)) );
2219 break;
2220 }
2221 }
2222
2223 for(
i=wdmamode; !
ok &&
i>=0;
i--) {
2225
2228 break;
2229 }
2230 }
2231
2234 timing = timings[apiomode];
2235 }
2236
2237 if(!udma_ok) {
2240 }
2242 reg54 |= (0x1 <<
dev);
2243 } else {
2244 reg54 &= ~(0x1 <<
dev);
2245 }
2247 reg54 |= (0x1000 <<
dev);
2248 } else {
2249 reg54 &= ~(0x1000 <<
dev);
2250 }
2252
2253 reg40 &= 0xff00;
2254 reg40 |= 0x4033;
2255
2257 reg40 |= (isAtapi ? 0x04 : 0x00);
2258 mask40 = 0x3300;
2260 } else {
2261 reg40 |= (isAtapi ? 0x40 : 0x00);
2262 mask44 = 0x0f;
2263 new44 = ((
timing & 0x30) >> 2) |
2265 }
2268 return;
2269 }
2270
2271 return;
2272 break; }
2273 case 0x3388:
2274
2275 if (wdmamode >= 0 &&
2279 } else {
2281 }
2282 return;
2284
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296 if(apiomode >= 4)
2297 apiomode = 4;
2298 for(
i=udmamode;
i>=0;
i--) {
2300 return;
2301 }
2302 }
2303 for(
i=wdmamode;
i>=0;
i--) {
2305 return;
2306 }
2307 }
2309 return;
2310 }
2311 return;
2312 break; }
2313 }
2314
2315try_generic_dma:
2316
2317
2318
2319
2320 if (isAtapi) {
2322 udmamode =
2323 wdmamode = -1;
2324 }
2325
2326
2327
2328 if ((udmamode >= 0 || wdmamode >= 0) &&
2333
2334
2337 return;
2338 }
2339 }
2340
2341#if 0
2342
2343 if ((wdmamode >= 0 && apiomode >= 4) && deviceExtension->BaseIoAddressBM[lChannel]) {
2345 return;
2346 }
2347 }
2348#endif
2349
2354 }
2355 return;
2356}
static const unsigned char reg_size[]
#define GetStatus(BaseIoAddress, Status)
#define ATA_SILICON_IMAGE_ID
#define ATA_SERVERWORKS_ID
VOID DDKFASTAPI AtapiWritePortEx1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port, IN ULONG offs, IN UCHAR data)
#define ChangePciConfig1(offs, _op)
#define SetPciConfig4(offs, op)
#define ChangePciConfig4(offs, _op)
#define BM_STATUS_DRIVE_0_DMA
#define GetPciConfig1(offs, op)
#define ChangePciConfig2(offs, _op)
#define GetPciConfig4(offs, op)
#define BM_STATUS_DRIVE_1_DMA
#define SetPciConfig2(offs, op)
#define GetPciConfig2(offs, op)
UCHAR DDKFASTAPI AtapiReadPortEx1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port, IN ULONG offs)
#define GetDmaStatus(de, c)
#define SetPciConfig1(offs, op)
GLboolean GLboolean GLboolean GLboolean a
VOID NTAPI hpt_timing(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG dev, IN CHAR mode)
VOID NTAPI via82c_timing(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG dev, IN CHAR mode)
BOOLEAN NTAPI AtaSetTransferMode(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG DeviceNumber, IN ULONG lChannel, IN PHW_LU_EXTENSION LunExt, IN ULONG mode)
VOID NTAPI promise_timing(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG dev, IN CHAR mode)
__inline BOOLEAN UniataIsSATARangeAvailable(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG lChannel)
struct _HW_LU_EXTENSION * lun[IDE_MAX_LUN_PER_CHAN]
IDENTIFY_DATA2 IdentifyData
UCHAR LimitedTransferMode
#define IDENTIFY_CABLE_ID_VALID
#define ATAPI_DEVICE(chan, dev)
UCHAR DDKFASTAPI UniataIsIdle(IN struct _HW_DEVICE_EXTENSION *deviceExtension, IN UCHAR Status)
UCHAR DDKFASTAPI SelectDrive(IN struct _HW_CHANNEL *chan, IN ULONG DeviceNumber)
__inline BOOLEAN ata_is_sata(PIDENTIFY_DATA ident)