111 CmdOrig = pciData->Command;
126 if(CmdOrig == pciData->Command) {
132 sizeof(pciData->Command));
145 return pciData->Command;
166 if(ConfigInfo->NumberOfAccessRanges <= rid)
174 (*ConfigInfo->AccessRanges)[rid].RangeInMemory
177 if(!(*ConfigInfo->AccessRanges)[rid].RangeInMemory) {
178 io_start = (pciData->u.type0.BaseAddresses[rid] & ~0x07) +
offset;
183 (*ConfigInfo->AccessRanges)[rid+1].RangeStart =
185 (*ConfigInfo->AccessRanges)[rid+1].RangeLength =
length;
187 (*ConfigInfo->AccessRanges)[rid].RangeStart =
189 (*ConfigInfo->AccessRanges)[rid].RangeLength =
length;
192 (*ConfigInfo->AccessRanges)[rid].RangeInMemory =
FALSE;
195 (*ConfigInfo->AccessRanges)[rid].RangeInMemory =
TRUE;
202 if((*ConfigInfo->AccessRanges)[rid].RangeInMemory) {
217 (
BOOLEAN)!(*ConfigInfo->AccessRanges)[rid].RangeInMemory)
317 UCHAR vendorString[5];
318 UCHAR deviceString[5];
341 UCHAR IrqForCompat = 10;
343 vendorStrPtr = vendorString;
344 deviceStrPtr = deviceString;
353 if(!deviceExtension) {
368 for(busNumber=0 ;busNumber<
maxPciBus && !no_buses; busNumber++) {
369 for(slotNumber=0; slotNumber<
PCI_MAX_DEVICES && !no_buses; slotNumber++) {
370 NeedPciAltInit =
FALSE;
375 if(PciDevMap[busNumber*
PCI_MAX_DEVICES + slotNumber] & (1 << funcNumber)) {
382 slotData.
u.
bits.DeviceNumber = slotNumber;
383 slotData.
u.
bits.FunctionNumber = funcNumber;
401 if(busDataRead == 2) {
402 NeedPciAltInit =
TRUE;
407 NeedPciAltInit =
TRUE;
411 VendorID = pciData.VendorID;
413 BaseClass = pciData.BaseClass;
414 SubClass = pciData.SubClass;
415 dev_id = VendorID | (
DeviceID << 16);
429 if((VendorID == 0x80ee &&
DeviceID == 0xcafe) ||
430 (VendorID == 0x80ee &&
DeviceID == 0xbeef)) {
431 KdPrint2((
PRINT_PREFIX "-- BusID: %#x:%#x:%#x - VirtualBox Guest Service\n",busNumber,slotNumber,funcNumber));
436 if((VendorID == 0x15ad) ||
449 if(VendorID == 0x1234 &&
DeviceID == 0x1111) {
471 KdPrint2((
PRINT_PREFIX "DevId = %8.8X Class = %4.4X/%4.4X, ProgIf %2.2X\n", dev_id, BaseClass, SubClass, pciData.ProgIf ));
476 if(pciData.u.type0.InterruptPin == 14 ||
477 pciData.u.type0.InterruptPin == 15 ||
478 pciData.u.type0.InterruptLine == 14 ||
479 pciData.u.type0.InterruptLine == 15) {
484 if(deviceExtension) {
487 deviceExtension->
DevID = dev_id;
488 deviceExtension->
RevID = pciData.RevisionID;
551 if(pciData.u.type0.BaseAddresses[
i] & ~0x7) {
556 if(
StdIsaPorts[
i] == (pciData.u.type0.BaseAddresses[
i] & ~0x7)) {
585 if((IrqForCompat & 0xffffff00)
587 (IrqForCompat == 0xff)) {
597 sizeof(pciData.ProgIf));
610 if(!(pciData.u.type0.InterruptLine) ||
611 (pciData.u.type0.InterruptLine == 0xff)) {
613 pciData.u.type0.InterruptLine = IrqForCompat;
615 &(pciData.u.type0.InterruptLine),
617 sizeof(pciData.u.type0.InterruptLine));
620 pciData.u.type0.InterruptLine));
621 IrqForCompat = pciData.u.type0.InterruptLine;
630 if((pciData.u.type0.InterruptLine != IrqForCompat) ||
631 (pciData.u.type0.InterruptLine == 0xff) ||
632 !pciData.u.type0.InterruptLine) {
634 pciData.u.type0.InterruptLine = 0xff;
637 &(pciData.u.type0.InterruptLine),
639 sizeof(pciData.u.type0.InterruptLine));
641 pciData.ProgIf &= ~PCI_IDE_PROGIF_NATIVE_ALL;
645 sizeof(pciData.ProgIf));
687 newBMListPtr->
Known = known;
699 PciDevMap[busNumber*
PCI_MAX_DEVICES + slotNumber] |= (1 << funcNumber);
726 if(deviceExtension) {
822 KdPrint2((
PRINT_PREFIX " scanning range Bus %x-%x, Slot %x-%x\n", busNumber, busNumber2-1, slotNumber, slotNumber2-1));
824 for( ; busNumber < busNumber2 ; busNumber++ ) {
825 for( ; slotNumber < slotNumber2 ; slotNumber++) {
828 slotData.
u.
bits.DeviceNumber = slotNumber;
829 slotData.
u.
bits.FunctionNumber = funcNumber;
853 *_slotData = slotData;
856 busNumber, slotNumber, funcNumber,
857 pciData.VendorID, pciData.DeviceID, pciData.RevisionID));
892 slotData.
u.
bits.FunctionNumber = funcNumber;
908 VendorID = pciData.VendorID;
911 if(dev_id != (VendorID | (
DeviceID << 16)) )
913 if(RevID >= pciData.RevisionID)
1005 ULONG SystemIoBusNumber;
1035#ifdef UNIATA_INIT_ON_PROBE
1070 if(ConfigInfo->AdapterInterfaceType ==
Isa) {
1075 if(
i & 0x80000000) {
1083 if(
BMList[
i].slotNumber == ConfigInfo->SlotNumber &&
1107 if (!deviceExtension) {
1146 VendorID = pciData.VendorID;
1148 BaseClass = pciData.BaseClass;
1149 SubClass = pciData.SubClass;
1150 RevID = pciData.RevisionID;
1151 dev_id = VendorID | (
DeviceID << 16);
1157 deviceExtension->
DevID = dev_id;
1158 deviceExtension->
RevID = RevID;
1164 "UATA%8.8x/%1.1x@%8.8x", dev_id, channel, slotNumber);
1174 if(VendorID !=
BMList[
i].nVendorId ||
1186 ConfigInfo->AlignmentMask = 0x00000003;
1279 if((channel==0) && ConfigInfo->AtdiskPrimaryClaimed) {
1283 if((channel==1) && ConfigInfo->AtdiskSecondaryClaimed) {
1311 if(pciData.u.type0.BaseAddresses[
j] & ~0x7) {
1323 (
AtapiGetIoRange(HwDeviceExtension, ConfigInfo, &pciData, SystemIoBusNumber,
1324 4, bm_offset, MasterDev ? 0x08 : 0x10));
1325 if(BaseIoAddressBM_0) {
1328 (*ConfigInfo->AccessRanges)[4].RangeInMemory ?
TRUE :
FALSE);
1331 if((*ConfigInfo->AccessRanges)[4].RangeInMemory) {
1343 if(deviceExtension->
BusMaster && !MasterDev) {
1372 if (dev_id == 0xc6931080 && slotData.
u.
bits.FunctionNumber > 1) {
1393 if(simplexOnly && MasterDev) {
1397 if(BaseIoAddressBM_0) {
1400 (*ConfigInfo->AccessRanges)[4].RangeInMemory ?
TRUE :
FALSE);
1412 if(!ConfigInfo->InitiatorBusId[0]) {
1414 KdPrint2((
PRINT_PREFIX "set ConfigInfo->InitiatorBusId[0] = %#x\n", ConfigInfo->InitiatorBusId[0]));
1417 ConfigInfo->MaximumNumberOfTargets = (
UCHAR)(deviceExtension->
NumberLuns);
1441 if (ConfigInfo->AdapterInterfaceType ==
MicroChannel) {
1442 ConfigInfo->InterruptMode2 =
1445 ConfigInfo->InterruptMode2 =
1446 ConfigInfo->InterruptMode =
Latched;
1448 ConfigInfo->BusInterruptLevel = 14;
1449 ConfigInfo->BusInterruptLevel2 = 15;
1452 if (ConfigInfo->AdapterInterfaceType ==
MicroChannel) {
1455 ConfigInfo->InterruptMode =
Latched;
1457 ConfigInfo->BusInterruptLevel = (channel == 0 ? 14 : 15);
1461 ConfigInfo->SlotNumber = slotNumber;
1462 ConfigInfo->SystemIoBusNumber = SystemIoBusNumber;
1466 if(!ConfigInfo->BusInterruptVector ||
1467 (ConfigInfo->BusInterruptVector != pciData.u.type0.InterruptLine)) {
1469 ConfigInfo->BusInterruptVector = pciData.u.type0.InterruptLine;
1470 if(!ConfigInfo->BusInterruptVector) {
1472 ConfigInfo->BusInterruptVector = 10;
1476 ConfigInfo->MultipleRequestPerLu =
TRUE;
1477 ConfigInfo->AutoRequestSense =
TRUE;
1478 ConfigInfo->TaggedQueuing =
TRUE;
1481 (ConfigInfo->Length >=
sizeof(_ConfigInfo->
comm) +
sizeof(_ConfigInfo->
nt4))) {
1493 (ConfigInfo->Length >=
sizeof(_ConfigInfo->
comm) +
sizeof(_ConfigInfo->
nt4) +
sizeof(_ConfigInfo->
w2k))) {
1495 deviceExtension->
Host64));
1509 deviceExtension->
Channel = channel;
1512 = ConfigInfo->AdapterInterfaceType;
1516 KdPrint2((
PRINT_PREFIX "chan[%d] InterruptMode: %d, Level %d, Level2 %d, Vector %d, Vector2 %d\n",
1518 ConfigInfo->InterruptMode,
1519 ConfigInfo->BusInterruptLevel,
1520 ConfigInfo->BusInterruptLevel2,
1521 ConfigInfo->BusInterruptVector,
1522 ConfigInfo->BusInterruptVector2
1531 ConfigInfo->NeedPhysicalAddresses =
FALSE;
1533 ConfigInfo->NeedPhysicalAddresses =
TRUE;
1540 ConfigInfo->Dma32BitAddresses =
TRUE;
1551 if(ConfigInfo->AdapterInterfaceType ==
Isa
1554 ConfigInfo->AdapterInterfaceType =
PCIBus;
1556 if(ConfigInfo->AdapterInterfaceType ==
PCIBus
1559 ConfigInfo->SlotNumber = slotNumber;
1560 ConfigInfo->SystemIoBusNumber = SystemIoBusNumber;
1565 ConfigInfo->Master =
TRUE;
1568 ConfigInfo->ScatterGather =
TRUE;
1570 ConfigInfo->MapBuffers =
TRUE;
1571 ConfigInfo->CachesData =
TRUE;
1579 chan = &deviceExtension->
chan[
c];
1597 (*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeStart =
1599 (*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeLength =
ATA_IOSIZE;
1601 (*ConfigInfo->AccessRanges)[channel * 2 + 1].RangeStart =
1603 (*ConfigInfo->AccessRanges)[channel * 2 + 1].RangeLength =
ATA_ALTIOSIZE;
1606 !(*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeStart.QuadPart &&
1607 !(*ConfigInfo->AccessRanges)[channel * 2 + 1].RangeStart.QuadPart) {
1609 AtapiGetIoRange(HwDeviceExtension, ConfigInfo, &pciData, SystemIoBusNumber,
1611 AtapiGetIoRange(HwDeviceExtension, ConfigInfo, &pciData, SystemIoBusNumber,
1615 IoBasePort1 = (*ConfigInfo->AccessRanges)[channel * 2 + 0].RangeStart;
1616 IoBasePort2 = (*ConfigInfo->AccessRanges)[channel * 2 + 1].RangeStart;
1662 MasterDev ? ConfigInfo->AdapterInterfaceType :
PCIBus ,
1663 MasterDev ? ConfigInfo->SystemIoBusNumber : SystemIoBusNumber ,
1687 MasterDev ? ConfigInfo->AdapterInterfaceType :
PCIBus ,
1688 MasterDev ? ConfigInfo->SystemIoBusNumber : SystemIoBusNumber ,
1718#ifdef UNIATA_INIT_ON_PROBE
1726 skip_find_dev =
FALSE;
1728 if ((statusByte & 0xf8) == 0xf8 ||
1729 (statusByte == 0xa5)) {
1735 if ((statusByte & 0xf8) == 0xf8 ||
1736 (statusByte == 0xa5)) {
1739 skip_find_dev =
TRUE;
1745 if (!skip_find_dev &&
1797 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
1806 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
1815 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
1821 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
1837 if(BaseIoAddress1[0])
1840 if(BaseIoAddress2[0])
1844 if(BaseIoAddress1[1])
1847 if(BaseIoAddress2[1])
1851 if(BaseIoAddressBM_0)
1855 if(deviceExtension->BaseIoAHCI_0.Addr) {
1857 deviceExtension->BaseIoAHCI_0.pAddr);
1866 deviceExtension->ActiveDpcChan =
1887 (*ConfigInfo->AccessRanges)[4].RangeLength = 0;
1889 (*ConfigInfo->AccessRanges)[5].RangeLength = 0;
1898 KdPrint2((
PRINT_PREFIX "final chan[%d] InterruptMode: %d, Level %d, Level2 %d, Vector %d, Vector2 %d\n",
1900 ConfigInfo->InterruptMode,
1901 ConfigInfo->BusInterruptLevel,
1902 ConfigInfo->BusInterruptLevel2,
1903 ConfigInfo->BusInterruptVector,
1904 ConfigInfo->BusInterruptVector2
1919 ConfigInfo->NumberOfBuses++;
1970 if (!resourceList) {
1988 oldResList = resourceList;
1997 resourceList->
Count = 1;
2058 WCHAR devname_str[33];
2081#ifndef UNIATA_USE_XXableInterrupts
2102 L"\\Device\\uniata%d_2ch",
i);
2103 devname_str[devname.
Length] = 0;
2106 devname.
Buffer = devname_str;
2145 &(
BMList[
i].Isr2InterruptObject),
2207 if((portBase ==
IO_WD1) &&
2212 if((portBase ==
IO_WD2) &&
2261 UCHAR statusByte, statusByte2;
2274 static CONST ULONG InterruptLevels[5] = {14, 15, 11, 10, 0};
2278 if (!deviceExtension) {
2292 chan = &(deviceExtension->
chan[0]);
2297 = ConfigInfo->AdapterInterfaceType;
2307 if (ArgumentString) {
2341 ConfigInfo->AdapterInterfaceType,
2342 ConfigInfo->SystemIoBusNumber,
2343 (*ConfigInfo->AccessRanges)[0].RangeStart,
2344 (*ConfigInfo->AccessRanges)[0].RangeLength,
2345 (
BOOLEAN) !((*ConfigInfo->AccessRanges)[0].RangeInMemory));
2353 KdPrint2((
PRINT_PREFIX " preconfig, portBase=%x, len=%x\n", portBase, (*ConfigInfo->AccessRanges)[0].RangeLength));
2358 while (AdapterAddresses[*adapterCount] != 0) {
2364 deviceExtension->
DevIndex = (*adapterCount);
2376 if (preConfig ==
FALSE) {
2378 ULONG portBase_reg = 0;
2382 portBase = AdapterAddresses[*adapterCount];
2390 if(portBase_reg && irq_reg) {
2392 portBase = portBase_reg;
2400 ConfigInfo->AdapterInterfaceType,
2401 ConfigInfo->SystemIoBusNumber,
2428 if (BaseIoAddress1) {
2433 ConfigInfo->AdapterInterfaceType,
2434 ConfigInfo->SystemIoBusNumber,
2440 ConfigInfo->AdapterInterfaceType,
2441 ConfigInfo->SystemIoBusNumber,
2467 KdPrint2((
PRINT_PREFIX "AtapiFindIsaController: Status %x vs AltStatus %x missmatch, abort init ?\n", statusByte, statusByte2));
2469 if(BaseIoAddress2) {
2471 (
PCHAR)BaseIoAddress2);
2472 BaseIoAddress2 =
NULL;
2477 ConfigInfo->AdapterInterfaceType,
2478 ConfigInfo->SystemIoBusNumber,
2483 BaseIoAddress2 =
NULL;
2491 KdPrint2((
PRINT_PREFIX " abort: Status %x vs AltStatus %x missmatch\n", statusByte, statusByte2));
2524 "AtapiFindIsaController: First access to status %#x\n",
2529 goto retryIdentifier;
2544 "AtapiFindIsaController: Identifier read back from Slave (%#x)\n",
2551 if (preConfig ==
FALSE) {
2559 (*ConfigInfo->AccessRanges)[0].RangeStart =
2563 (*ConfigInfo->AccessRanges)[0].RangeLength =
ATA_IOSIZE;
2564 (*ConfigInfo->AccessRanges)[0].RangeInMemory =
FALSE;
2566 if(BaseIoAddress2) {
2570 (*ConfigInfo->AccessRanges)[1].RangeInMemory =
FALSE;
2580 (*ConfigInfo->AccessRanges)[1].RangeLength = 0;
2586 ConfigInfo->BusInterruptLevel =
irq;
2588 ConfigInfo->BusInterruptLevel = InterruptLevels[*adapterCount - 1];
2591 if (ConfigInfo->AdapterInterfaceType ==
MicroChannel) {
2594 ConfigInfo->InterruptMode =
Latched;
2598 ConfigInfo->NumberOfBuses = 1;
2602 ConfigInfo->MaximumTransferLength = 0x10000;
2623 "AtapiFindIsaController: Found IDE at %#x\n",
2628 if (preConfig ==
FALSE) {
2630 if (*adapterCount - 1 < 2) {
2659 "AtapiFindIsaController: look for devices\n"));
2666 "AtapiFindIsaController: detected\n"));
2671 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
2675 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
2682 if (*adapterCount == 1) {
2683 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
2685 }
else if (*adapterCount == 2) {
2686 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
2698 ConfigInfo->NumberOfBuses++;
2700 "AtapiFindIsaController: return SP_RETURN_FOUND\n"));
2705 if(BaseIoAddress1) {
2707 (
PCHAR)BaseIoAddress1);
2708 BaseIoAddress1 =
NULL;
2710 if(BaseIoAddress2) {
2712 (
PCHAR)BaseIoAddress2);
2713 BaseIoAddress2 =
NULL;
2715 for(
i=0;
i<2;
i++) {
2717 "AtapiFindIsaController: cleanup AccessRanges %d\n",
i));
2719 (*ConfigInfo->AccessRanges)[
i].RangeLength = 0;
2720 (*ConfigInfo->AccessRanges)[
i].RangeInMemory =
FALSE;
2735 *(adapterCount) = 0;
2738 "AtapiFindIsaController: return SP_RETURN_NOT_FOUND\n"));
2769 "AtapiReadArgumentString: Crash dump\n"));
2791 UCHAR signatureHigh;
2830 signatureLow = (
UCHAR)(SIG >> 16);
2831 signatureHigh = (
UCHAR)(SIG >> 24);
2861 if(signatureLow != 0x55) {
2862 if(signatureLow == 0xff || signatureLow == 0) {
2873 if(signatureLow != signatureHigh) {
2874 KdPrint2((
PRINT_PREFIX " nobody home! last chance failed %#x != %#x\n", signatureLow, signatureHigh));
2885 if(signatureLow != 0xAA) {
2927 LunExt = chan->
lun[deviceNumber];
2969 "CheckDevice: bad status %x\n", statusByte));
2974 "CheckDevice: BUSY\n"));
2994 "CheckDevice: status after hard reset %x\n", statusByte));
2999 "CheckDevice: no dev ?\n"));
3006 "CheckDevice: try enable SATA Phy\n"));
3018 signatureLow = signatureHigh = 0;
3125 if(deviceExtension->
DWordIO) {
3151 deviceNumber, statusByte));
3194 skipSetParameters =
FALSE;
3195 ULONG waitCount = 10000;
3216 for (
i = 0;
i < max_ldev;
i++) {
3219 chan->
lun[
i]->DeviceFlags &= ~DFLAGS_HIDDEN;
3229 "FindDevices: returning %d (AHCI)\n",
3231 return deviceResponded;
3234 for (
i = 0;
i < max_ldev;
i++) {
3235 LunExt = chan->
lun[
i];
3274 skipSetParameters =
TRUE;
3278 if (skipSetParameters)
3291 "FindDevices: Resetting controller before SetDriveParameters.\n"));
3313 "FindDevices: Status before SetDriveParameters: (%#x) (%#x)\n",
3323 "FindDevices: Set drive parameters for device %d failed\n",
3339 deviceResponded =
TRUE;
3356 if(deviceResponded) {
3357 for (
i = 0;
i < max_ldev;
i++) {
3358 LunExt = chan->
lun[
i];
3361 "FindDevices: select %d dev to clear INTR\n",
i));
3365 "FindDevices: statusByte=%#x\n", statusByte));
3367 for (
i = 0;
i < max_ldev;
i++) {
3368 LunExt = chan->
lun[
i];
3373 "FindDevices: select %d dev on exit\n",
i));
3387 "FindDevices: returning %d\n",
3390 return deviceResponded;
#define DFLAGS_ATAPI_DEVICE
#define GetBaseStatus(BaseIoAddress, Status)
struct _IDE_REGISTERS_2 * PIDE_REGISTERS_2
#define IDE_COMMAND_ATAPI_IDENTIFY
#define IDE_COMMAND_IDENTIFY
#define GetStatus(BaseIoAddress, Status)
#define DFLAGS_TAPE_DEVICE
#define DFLAGS_REMOVABLE_DRIVE
#define WaitOnBusy(BaseIoAddress, Status)
#define DFLAGS_DEVICE_PRESENT
struct _IDE_REGISTERS_1 * PIDE_REGISTERS_1
#define AtapiSoftReset(BaseIoAddress, DeviceNumber)
ULONG NTAPI AtapiParseArgumentString(IN PCHAR String, IN PCHAR KeyWord)
struct _HW_LU_EXTENSION HW_LU_EXTENSION
BOOLEAN NTAPI SetDriveParameters(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG Channel)
struct _HW_DEVICE_EXTENSION * PHW_DEVICE_EXTENSION
struct _HW_DEVICE_EXTENSION HW_DEVICE_EXTENSION
BOOLEAN NTAPI IssueIdentify(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG Channel, IN UCHAR Command)
BUSMASTER_CONTROLLER_INFORMATION_BASE const BusMasterAdapters[]
#define UNIATA_RAID_CONTROLLER
#define NUM_BUSMASTER_ADAPTERS
__inline ULONG Ata_is_dev_listed(IN PBUSMASTER_CONTROLLER_INFORMATION_BASE BusMasterAdapters, ULONG VendorId, ULONG DeviceId, ULONG RevId, ULONG lim)
#define UNIATA_NO_DPC_ATAPI
struct _BUSMASTER_CONTROLLER_INFORMATION BUSMASTER_CONTROLLER_INFORMATION
#define IDE_MAX_LUN_PER_CHAN
#define IDE_DEFAULT_MAX_CHAN
#define Ata_is_supported_dev(pciData)
#define Ata_is_ahci_dev(pciData)
#define BMLIST_TERMINATOR
struct _BUSMASTER_CONTROLLER_INFORMATION * PBUSMASTER_CONTROLLER_INFORMATION
BOOLEAN NTAPI ScsiPortValidateRange(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress(IN ULONG_PTR UlongAddress)
VOID NTAPI ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
PVOID NTAPI ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
BOOLEAN NTAPI UniataAllocateLunExt(PHW_DEVICE_EXTENSION deviceExtension, ULONG NewNumberChannels)
#define SStatus_DET_Dev_NoPhy
UCHAR NTAPI AtapiDmaDone(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG lChannel, IN PSCSI_REQUEST_BLOCK Srb)
#define REORDER_MCOST_SWITCH_RW_HDD
#define PCI_DEV_SUBCLASS_SATA
NTSTATUS NTAPI UniataChipDetect(IN PVOID HwDeviceExtension, IN PPCI_COMMON_CONFIG pciData, IN ULONG DeviceNumber, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN BOOLEAN *simplexOnly)
#define IsMasterDev(pciData)
VOID NTAPI AtapiSetupLunPtrs(IN PHW_CHANNEL chan, IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG c)
#define REORDER_COST_SWITCH_RW_HDD
ULONG g_opt_WaitBusyResetCount
#define ATA_PCCARD_ALTOFFSET
VOID NTAPI UniataForgetDevice(PHW_LU_EXTENSION LunExt)
UCHAR DDKFASTAPI AtapiReadPort1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port)
struct _ISR2_DEVICE_EXTENSION * PISR2_DEVICE_EXTENSION
#define PCIBUSNUM_NOT_SPECIFIED
#define SStatus_IPM_NoDev
struct _IDE_BUSMASTER_REGISTERS * PIDE_BUSMASTER_REGISTERS
#define PCI_DEV_SUBCLASS_ATA
#define PCI_IDE_PROGIF_NATIVE_ALL
#define BM_STATUS_SIMPLEX_ONLY
#define IsBusMaster(pciData)
#define REORDER_MCOST_SEEK_BACK_HDD
VOID NTAPI AtapiDmaAlloc(IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN ULONG lChannel)
ULONG g_opt_VirtualMachine
UNICODE_STRING SavedRegPath
#define UNIATA_ALLOCATE_NEW_LUNS
#define PCI_DEV_SUBCLASS_IDE
#define PCI_DEV_CLASS_STORAGE
#define PCISLOTNUM_NOT_SPECIFIED
BOOLEAN NTAPI AtapiReadChipConfig(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG channel)
BOOLEAN NTAPI AtapiInterrupt2(IN PKINTERRUPT Interrupt, IN PVOID HwDeviceExtension)
VOID DDKFASTAPI AtapiWritePort1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port, IN UCHAR data)
#define PCI_DEV_SUBCLASS_RAID
#define CTRFLAGS_NO_SLAVE
VOID NTAPI UniataFreeLunExt(PHW_DEVICE_EXTENSION deviceExtension)
BOOLEAN NTAPI AtapiChipInit(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG c)
#define GetDmaStatus(de, c)
#define NT_SUCCESS(StatCode)
#define ScsiPortConvertPhysicalAddressToUlong(Address)
#define SP_RETURN_NOT_FOUND
struct _PORT_CONFIGURATION_INFORMATION_COMMON * PPORT_CONFIGURATION_INFORMATION_COMMON
NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(PUNICODE_STRING, PUNICODE_STRING, PDRIVER_OBJECT, PDEVICE_OBJECT, INTERFACE_TYPE, ULONG, ULONG, PCM_RESOURCE_LIST *)
NTHALAPI ULONG NTAPI HalGetBusData(BUS_DATA_TYPE, ULONG, ULONG, PVOID, ULONG)
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
#define ExAllocatePool(type, size)
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
ULONG NTAPI HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
#define IDX_IO1_o_BlockNumber
#define IDX_ATAPI_IO1_o_ByteCountHigh
#define IDX_IO1_i_BlockNumber
#define IDX_IO1_i_DriveSelect
#define IDX_IO1_i_CylinderLow
#define IDX_ATAPI_IO1_i_Status
#define IDX_IO1_i_CylinderHigh
#define IDE_DRIVE_SELECT_2
#define IDX_ATAPI_IO1_i_DriveSelect
#define IDX_IO1_o_CylinderLow
struct _CM_RESOURCE_LIST * PCM_RESOURCE_LIST
BOOLEAN AtdiskSecondaryClaimed
ULONG NTAPI UniataFindCompatBusMasterController1(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
ULONG NTAPI UniataFindCompatBusMasterController2(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
VOID NTAPI AtapiDoNothing(VOID)
BOOLEAN NTAPI UniataCheckPCISubclass(BOOLEAN known, ULONG RaidFlags, UCHAR SubClass)
ULONG NTAPI AtapiFindDev(IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG dev_id, IN ULONG RevID)
ULONG NTAPI UniataEnumBusMasterController__()
ULONG NTAPI CheckDevice(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG deviceNumber, IN BOOLEAN ResetDev)
ULONG NTAPI UniataFindBusMasterController(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
NTSTATUS NTAPI UniataClaimLegacyPCIIDE(ULONG i)
NTSTATUS NTAPI UniataConnectIntr2(IN PVOID HwDeviceExtension)
ULONG NTAPI ScsiPortGetBusDataByOffset(IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
static CONST ULONG StdIsaPorts[]
ULONG NTAPI AtapiFindListedDev(IN PBUSMASTER_CONTROLLER_INFORMATION_BASE BusMasterAdapters, IN ULONG lim, IN PVOID HwDeviceExtension, IN ULONG BusNumber, IN ULONG SlotNumber, OUT PCI_SLOT_NUMBER *_slotData)
ULONGIO_PTR NTAPI AtapiGetIoRange(IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN PPCI_COMMON_CONFIG pciData, IN ULONG SystemIoBusNumber, IN ULONG rid, IN ULONG offset, IN ULONG length)
PDRIVER_OBJECT SavedDriverObject
BOOLEAN AtdiskPrimaryClaimed
NTSTATUS NTAPI UniataDisconnectIntr2(IN PVOID HwDeviceExtension)
USHORT NTAPI UniataEnableIoPCI(IN ULONG busNumber, IN ULONG slotNumber, IN OUT PPCI_COMMON_CONFIG pciData)
ULONG NTAPI AtapiReadArgumentString(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
BOOLEAN NTAPI AtapiCheckIOInterference(IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, ULONG portBase)
VOID NTAPI UniataEnumBusMasterController(IN PVOID DriverObject, PVOID Argument2)
PBUSMASTER_CONTROLLER_INFORMATION BMList
ULONG NTAPI AtapiFindIsaController(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
ULONG NTAPI UniataAnybodyHome(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG deviceNumber)
UCHAR NTAPI UniataSataPhyEnable(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG pm_port, IN BOOLEAN doReset)
BOOLEAN NTAPI UniataSataClearErr(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN BOOLEAN do_connect, IN ULONG pm_port)
ULONG NTAPI UniataAhciSoftReset(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG DeviceNumber)
ULONG NTAPI UniataSataReadPort4(IN PHW_CHANNEL chan, IN ULONG io_port_ndx, IN ULONG pm_port)
#define UNIATA_SATA_IGNORE_CONNECT
__inline ULONG UniataAhciReadChannelPort4(IN PHW_CHANNEL chan, IN ULONG io_port_ndx)
__inline BOOLEAN UniataIsSATARangeAvailable(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG lChannel)
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
Returns a pointer to the I/O manager's global configuration information structure.
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
#define sprintf(buf, format,...)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
VOID NTAPI IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
#define FILE_DEVICE_UNKNOWN
#define offsetof(TYPE, MEMBER)
enum _KINTERRUPT_MODE KINTERRUPT_MODE
enum _BUS_DATA_TYPE BUS_DATA_TYPE
CM_PARTIAL_RESOURCE_LIST PartialResourceList
INTERFACE_TYPE InterfaceType
CM_FULL_RESOURCE_DESCRIPTOR List[1]
IORES RegTranslation[IDX_MAX_REG]
struct _HW_LU_EXTENSION * lun[IDE_MAX_LUN_PER_CHAN]
struct _HW_DEVICE_EXTENSION * DeviceExtension
INTERFACE_TYPE AdapterInterfaceType
ULONG MaximumDmaTransferLength
INTERFACE_TYPE OrigAdapterInterfaceType
IDENTIFY_DATA2 IdentifyData
ULONG AtapiReadyWaitDelay
PHW_DEVICE_EXTENSION HwDeviceExtension
struct _PCI_SLOT_NUMBER::@4018::@4019 bits
union _PCI_SLOT_NUMBER::@4018 u
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
#define DFLAGS_LBA_ENABLED
ULONG NTAPI AtapiRegCheckDevValue(IN PVOID HwDeviceExtension, IN ULONG chan, IN ULONG dev, IN PCWSTR Name, IN ULONG Default)
VOID NTAPI UniataDumpATARegs(IN struct _HW_CHANNEL *chan)
#define UNIATA_FIND_DEV_UNHIDE
#define IDX_IO2_AltStatus
VOID NTAPI UniataInitMapBase(IN struct _HW_CHANNEL *chan, IN PIDE_REGISTERS_1 BaseIoAddress1, IN PIDE_REGISTERS_2 BaseIoAddress2)
#define AtapiStallExecution(dt)
UCHAR DDKFASTAPI SelectDrive(IN struct _HW_CHANNEL *chan, IN ULONG DeviceNumber)
#define CHAN_NOT_SPECIFIED_CHECK_CABLE
#define ATA_AT_HOME_NOBODY
#define DEVNUM_NOT_SPECIFIED
#define DFLAGS_DWORDIO_ENABLED
VOID NTAPI UniataInitMapBM(IN struct _HW_DEVICE_EXTENSION *deviceExtension, IN struct _IDE_BUSMASTER_REGISTERS *BaseIoAddressBM_0, IN BOOLEAN MemIo)
#define ATA_AT_HOME_ATAPI
VOID NTAPI AtapiEnableInterrupts(IN PVOID HwDeviceExtension, IN ULONG c)
VOID UniataExpectChannelInterrupt(IN struct _HW_CHANNEL *chan, IN BOOLEAN Expecting)
#define CHAN_NOT_SPECIFIED
UCHAR DDKFASTAPI WaitOnBaseBusyLong(IN struct _HW_CHANNEL *chan)
VOID NTAPI AtapiDisableInterrupts(IN PVOID HwDeviceExtension, IN ULONG c)
VOID DDKFASTAPI AtapiHardReset(IN struct _HW_CHANNEL *chan, IN BOOLEAN DisableInterrupts, IN ULONG Delay)
_In_ WDFDEVICE _In_ PPNP_BUS_INFORMATION BusInformation
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
#define PCI_INVALID_VENDORID
#define PCI_ENABLE_BUS_MASTER
#define PCI_TYPE0_ADDRESSES
#define PCI_ENABLE_IO_SPACE
#define PCI_ADDRESS_IO_SPACE
#define PCI_ENABLE_MEMORY_SPACE
#define PCI_COMMON_HDR_LENGTH
_In_ USHORT _In_ UCHAR _In_ USHORT _In_ USHORT SubSystemID
_In_ USHORT _In_ UCHAR _In_ USHORT SubVendorID