- Fix a couple of bugs in the uniata ATA code spotted by bearwindows. ICH8/ICH9/ICH10...
authorAleksey Bragin <aleksey@reactos.org>
Fri, 18 Sep 2009 22:25:34 +0000 (22:25 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Fri, 18 Sep 2009 22:25:34 +0000 (22:25 +0000)
svn path=/trunk/; revision=43075

reactos/drivers/storage/ide/uniata/id_probe.cpp

index ab08d84..752c88c 100644 (file)
@@ -1040,6 +1040,13 @@ UniataFindBusMasterController(
 
     ConfigInfo->AlignmentMask = 0x00000003;
 
+    MasterDev = IsMasterDev(&pciData);
+
+    if(MasterDev) {
+        KdPrint2((PRINT_PREFIX "MasterDev (1)\n"));
+        deviceExtension->NumberChannels = 1;
+    }
+
     found = UniataChipDetect(HwDeviceExtension, &pciData, i, ConfigInfo, &simplexOnly);
     KdPrint2((PRINT_PREFIX "ForceSimplex = %d\n", simplexOnly));
     KdPrint2((PRINT_PREFIX "HwFlags = %x\n (0)", deviceExtension->HwFlags));
@@ -1091,14 +1098,6 @@ UniataFindBusMasterController(
         deviceExtension->UseDpc = FALSE;
     }
 
-    MasterDev = IsMasterDev(&pciData);
-
-    if(MasterDev) {
-        KdPrint2((PRINT_PREFIX "MasterDev (1)\n"));
-        deviceExtension->MasterDev = TRUE;
-        deviceExtension->NumberChannels = 1;
-    }
-
     if(MasterDev) {
         if((WinVer_Id() <= WinVer_NT) && AltInit && FirstMasterOk) {
             // this is the 2nd attempt to init this controller by OUR driver
@@ -1242,7 +1241,7 @@ UniataFindBusMasterController(
         deviceExtension->UseDpc = FALSE;
     }
 
-    if(simplexOnly || !MasterDev /*|| (WinVer_Id() > WinVer_NT)*/) {
+    if(simplexOnly && MasterDev /*|| (WinVer_Id() > WinVer_NT)*/) {
         if(deviceExtension->NumberChannels < 2) {
             KdPrint2((PRINT_PREFIX "set NumberChannels = 2\n"));
             deviceExtension->NumberChannels = 2;