Index: drivers/storage/ide/uniata/id_ata.cpp =================================================================== --- drivers/storage/ide/uniata/id_ata.cpp (revision 69313) +++ drivers/storage/ide/uniata/id_ata.cpp (working copy) @@ -267,6 +267,7 @@ return; \ } \ if(res->Proc) { \ + KdPrint(("PROC io write request @ ch %x, res* %x\n", chan, _port)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -303,6 +304,7 @@ return; \ } \ if(res->Proc) { \ + KdPrint(("PROC io write request @ ch %x, res* %x, offs %x\n", chan, _port, offs)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -337,6 +339,7 @@ return (_type)(-1); \ } \ if(res->Proc) { \ + KdPrint(("PROC io read request @ ch %x, res* %x\n", chan, _port)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -372,6 +375,7 @@ return (_type)(-1); \ } \ if(res->Proc) { \ + KdPrint(("PROC io read request @ ch %x, res* %x, offs %x\n", chan, _port, offs)); \ ASSERT(FALSE); /* We should never get here */ \ } \ if(!res->MemIo) { \ @@ -1564,6 +1568,10 @@ statusByte = AtaCommand(deviceExtension, DeviceNumber, lChannel, Command, (j < 4) ? DEV_BSIZE : 0 /* cyl */, 0, 0, 0, 0, ATA_WAIT_INTR); // Clear interrupt + if (!statusByte) { + KdPrint2((PRINT_PREFIX "IssueIdentify: 0-status, not present\n")); + return FALSE; + } else if (statusByte & IDE_STATUS_DRQ) { // Read status to acknowledge any interrupts generated. KdPrint2((PRINT_PREFIX "IssueIdentify: IDE_STATUS_DRQ (%#x)\n", statusByte)); @@ -1720,10 +1728,17 @@ deviceExtension->FullIdentifyData.VendorAcoustic, deviceExtension->FullIdentifyData.CurrentAcoustic )); - KdPrint2((PRINT_PREFIX "AdvPowerMode %d, cur %d\n", + KdPrint2((PRINT_PREFIX "AdvPowerMode %d\n", deviceExtension->FullIdentifyData.CfAdvPowerMode )); + KdPrint2((PRINT_PREFIX "PowerMngt %d/%d, APM %d/%d\n", + deviceExtension->FullIdentifyData.FeaturesEnabled.PowerMngt, + deviceExtension->FullIdentifyData.FeaturesSupport.PowerMngt, + deviceExtension->FullIdentifyData.FeaturesEnabled.APM, + deviceExtension->FullIdentifyData.FeaturesSupport.APM + )); + // Check out a few capabilities / limitations of the device. if (deviceExtension->FullIdentifyData.RemovableStatus & 1) { // Determine if this drive supports the MSN functions. @@ -1765,6 +1780,20 @@ KdPrint2((PRINT_PREFIX "R-rate %d\n", deviceExtension->FullIdentifyData.NominalMediaRotationRate )); + KdPrint2((PRINT_PREFIX "WC %d/%d, LA %d/%d, Protected %d/%d, WB %d/%d, RB %d/%d, Q %d/%d\n", + deviceExtension->FullIdentifyData.FeaturesEnabled.WriteCache, + deviceExtension->FullIdentifyData.FeaturesSupport.WriteCache, + deviceExtension->FullIdentifyData.FeaturesEnabled.LookAhead, + deviceExtension->FullIdentifyData.FeaturesSupport.LookAhead, + deviceExtension->FullIdentifyData.FeaturesEnabled.Protected, + deviceExtension->FullIdentifyData.FeaturesSupport.Protected, + deviceExtension->FullIdentifyData.FeaturesEnabled.WriteBuffer, + deviceExtension->FullIdentifyData.FeaturesSupport.WriteBuffer, + deviceExtension->FullIdentifyData.FeaturesEnabled.ReadBuffer, + deviceExtension->FullIdentifyData.FeaturesSupport.ReadBuffer, + deviceExtension->FullIdentifyData.FeaturesEnabled.Queued, + deviceExtension->FullIdentifyData.FeaturesSupport.Queued + )); // Read very-old-style drive geometry KdPrint2((PRINT_PREFIX "CHS %#x:%#x:%#x\n", @@ -3168,7 +3197,9 @@ LunExt->MaximumBlockXfer)); } - if(LunExt->IdentifyData.MajorRevision) { + if(LunExt->IdentifyData.MajorRevision + && 0 /* DEBUG !!!! REMOVE ME */ + ) { if(LunExt->opt_ReadCacheEnable) { KdPrint2((PRINT_PREFIX " Try Enable Read Cache\n")); @@ -3193,30 +3224,32 @@ 0, ATA_C_F_DIS_RCACHE, ATA_WAIT_BASE_READY); LunExt->DeviceFlags &= ~DFLAGS_RCACHE_ENABLED; } - if(LunExt->opt_WriteCacheEnable) { - KdPrint2((PRINT_PREFIX " Try Enable Write Cache\n")); - // If supported & allowed, setup write cacheing - statusByte = AtaCommand(deviceExtension, i, lChannel, - IDE_COMMAND_SET_FEATURES, 0, 0, 0, - 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); - // Check for errors. - if (statusByte & IDE_STATUS_ERROR) { - KdPrint2((PRINT_PREFIX - "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", - i)); - LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; + if(LunExt->IdentifyData.FeaturesSupport.WriteCache) { + if(LunExt->opt_WriteCacheEnable) { + KdPrint2((PRINT_PREFIX " Try Enable Write Cache\n")); + // If supported & allowed, setup write cacheing + statusByte = AtaCommand(deviceExtension, i, lChannel, + IDE_COMMAND_SET_FEATURES, 0, 0, 0, + 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_BASE_READY); + // Check for errors. + if (statusByte & IDE_STATUS_ERROR) { + KdPrint2((PRINT_PREFIX + "AtapiHwInitialize: Enable write cacheing on Device %d failed\n", + i)); + LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; + } else { + LunExt->DeviceFlags |= DFLAGS_WCACHE_ENABLED; + } } else { - LunExt->DeviceFlags |= DFLAGS_WCACHE_ENABLED; + KdPrint2((PRINT_PREFIX " Disable Write Cache\n")); + statusByte = AtaCommand(deviceExtension, i, lChannel, + IDE_COMMAND_SET_FEATURES, 0, 0, 0, + 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_BASE_READY); + LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; } - } else { - KdPrint2((PRINT_PREFIX " Disable Write Cache\n")); - statusByte = AtaCommand(deviceExtension, i, lChannel, - IDE_COMMAND_SET_FEATURES, 0, 0, 0, - 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_BASE_READY); - LunExt->DeviceFlags &= ~DFLAGS_WCACHE_ENABLED; } - if(LunExt->IdentifyData.FeaturesSupport.PowerMngt || + if(/*LunExt->IdentifyData.FeaturesSupport.PowerMngt ||*/ LunExt->IdentifyData.FeaturesSupport.APM) { if(LunExt->opt_AdvPowerMode) { Index: drivers/storage/ide/uniata/id_dma.cpp =================================================================== --- drivers/storage/ide/uniata/id_dma.cpp (revision 69313) +++ drivers/storage/ide/uniata/id_dma.cpp (working copy) @@ -1708,12 +1708,6 @@ return; } } - /* try generic DMA, use hpt_timing() */ - if (wdmamode >= 0 && apiomode >= 4) { - if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_DMA)) { - return; - } - } AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); promise_timing(deviceExtension, dev, ATA_PIO0 + apiomode); return; @@ -2356,6 +2350,9 @@ } break; default: + return; + } + if(!timing) { return; } SetPciConfig4(0x60 + (dev<<2), timing); Index: drivers/storage/ide/uniata/id_probe.cpp =================================================================== --- drivers/storage/ide/uniata/id_probe.cpp (revision 69313) +++ drivers/storage/ide/uniata/id_probe.cpp (working copy) @@ -353,6 +353,7 @@ RtlZeroMemory(PciDevMap, maxPciBus*PCI_MAX_DEVICES); for(pass=0; pass<3; pass++) { + no_buses = FALSE; for(busNumber=0 ;busNumberBaseIoAddress1[c]); - KdPrint2((PRINT_PREFIX "IDX_IO1 %x->%x(%s)\n", - IDX_IO1, - chan->RegTranslation[IDX_IO1].Addr, - chan->RegTranslation[IDX_IO1].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_IO2 %x->%x(%s)\n", - IDX_IO2, - chan->RegTranslation[IDX_IO2].Addr, - chan->RegTranslation[IDX_IO2].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_BM_IO %x->%x(%s)\n", - IDX_BM_IO, - chan->RegTranslation[IDX_BM_IO].Addr, - chan->RegTranslation[IDX_BM_IO].MemIo ? "mem" : "io")); - - KdPrint2((PRINT_PREFIX "IDX_SATA_IO %x->%x(%s)\n", - IDX_SATA_IO, - chan->RegTranslation[IDX_SATA_IO].Addr, - chan->RegTranslation[IDX_SATA_IO].MemIo ? "mem" : "io")); + DbgDumpRegTranslation(chan, IDX_IO1); + DbgDumpRegTranslation(chan, IDX_IO2); + DbgDumpRegTranslation(chan, IDX_BM_IO); + DbgDumpRegTranslation(chan, IDX_SATA_IO); if(!(deviceExtension->HwFlags & UNIATA_AHCI)) { #ifdef _DEBUG @@ -2687,10 +2676,11 @@ KdPrint2((PRINT_PREFIX " AHCI HDD at home\n")); return ATA_AT_HOME_HDD; } - if(g_opt_VirtualMachine == VM_BOCHS) { + if(g_opt_VirtualMachine /*== VM_BOCHS || + g_opt_VirtualMachine == VM_VBOX*/) { GetStatus(chan, signatureLow); if(!signatureLow) { - KdPrint2((PRINT_PREFIX " 0-status BOCHS - not present\n")); + KdPrint2((PRINT_PREFIX " 0-status VM - not present\n")); UniataForgetDevice(LunExt); return ATA_AT_HOME_NOBODY; } @@ -2979,7 +2969,8 @@ RetVal = DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags |= DFLAGS_DEVICE_PRESENT; LunExt->DeviceFlags &= ~DFLAGS_ATAPI_DEVICE; - } else { + } else + if(!g_opt_VirtualMachine) { // This can be ATAPI on broken hardware GetBaseStatus(chan, statusByte); if(!at_home && UniataAnybodyHome(HwDeviceExtension, lChannel, deviceNumber)) { @@ -2989,6 +2980,9 @@ KdPrint2((PRINT_PREFIX "CheckDevice: try ATAPI %#x, status %#x\n", deviceNumber, statusByte)); goto try_atapi; + } else { + KdPrint2((PRINT_PREFIX "CheckDevice: VM Device %#x not present\n", + deviceNumber)); } GetBaseStatus(chan, statusByte); } Index: drivers/storage/ide/uniata/tools.h =================================================================== --- drivers/storage/ide/uniata/tools.h (revision 69313) +++ drivers/storage/ide/uniata/tools.h (working copy) @@ -111,6 +111,14 @@ KdPrint(("\n")); \ } +#define DbgDumpRegTranslation(chan, idx) \ + KdPrint2((PRINT_PREFIX \ + " IO_%#x (%#x), %s:\n", \ + idx, \ + chan->RegTranslation[idx].Addr, \ + chan->RegTranslation[idx].Proc ? "Proc" : ( \ + chan->RegTranslation[idx].MemIo ? "Mem" : "IO"))); \ + #define BrutePoint() { ASSERT(0); } #define DbgAllocatePool(x,y) ExAllocatePool(x,y) @@ -120,6 +128,8 @@ #else #define KdDump(a,b) {} + +#define DbgDumpRegTranslation(chan, idx) {} #define DbgAllocatePool(x,y) ExAllocatePool(x,y) #define DbgFreePool(x) ExFreePool(x) Index: drivers/storage/ide/uniata/uniata_ver.h =================================================================== --- drivers/storage/ide/uniata/uniata_ver.h (revision 69313) +++ drivers/storage/ide/uniata/uniata_ver.h (working copy) @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45h9" -#define UNIATA_VER_DOT 0.45.8.9 +#define UNIATA_VER_STR "45i1" +#define UNIATA_VER_DOT 0.45.9.1 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 -#define UNIATA_VER_SUB_MJ 8 -#define UNIATA_VER_SUB_MN 9 -#define UNIATA_VER_DOT_COMMA 0,45,8,9 -#define UNIATA_VER_DOT_STR "0.45.8.9" +#define UNIATA_VER_SUB_MJ 9 +#define UNIATA_VER_SUB_MN 1 +#define UNIATA_VER_DOT_COMMA 0,45,9,1 +#define UNIATA_VER_DOT_STR "0.45.9.1" #define UNIATA_VER_YEAR 2015 #define UNIATA_VER_YEAR_STR "2015"