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));
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)
1002 #endif //UNIATA_CORE 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) {
1144 #endif //UNIATA_CORE 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;
1266 #endif //UNIATA_CORE 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));
1500 #endif //USE_OWN_DMA 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;
1534 #endif //USE_OWN_DMA 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;
1567 #endif //USE_OWN_DMA 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 &&
1760 #else //UNIATA_INIT_ON_PROBE 1786 #endif //UNIATA_INIT_ON_PROBE 1797 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
1806 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
1815 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
1821 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
1829 #endif //UNIATA_CORE 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
1909 #endif //UNIATA_CORE 1919 ConfigInfo->NumberOfBuses++;
1967 if (!resourceList) {
1986 resourceList->
Count = 1;
2042 WCHAR devname_str[33];
2065 #ifndef UNIATA_USE_XXableInterrupts 2071 #endif //UNIATA_USE_XXableInterrupts 2086 L"\\Device\\uniata%d_2ch",
i);
2087 devname_str[devname.
Length] = 0;
2090 devname.
Buffer = devname_str;
2129 &(
BMList[
i].Isr2InterruptObject),
2183 #endif //UNIATA_CORE 2191 if((portBase ==
IO_WD1) &&
2196 if((portBase ==
IO_WD2) &&
2245 UCHAR statusByte, statusByte2;
2258 static CONST ULONG InterruptLevels[5] = {14, 15, 11, 10, 0};
2262 if (!deviceExtension) {
2276 chan = &(deviceExtension->
chan[0]);
2281 = ConfigInfo->AdapterInterfaceType;
2291 if (ArgumentString) {
2306 #endif //UNIATA_CORE 2325 ConfigInfo->AdapterInterfaceType,
2326 ConfigInfo->SystemIoBusNumber,
2327 (*ConfigInfo->AccessRanges)[0].RangeStart,
2328 (*ConfigInfo->AccessRanges)[0].RangeLength,
2329 (
BOOLEAN) !((*ConfigInfo->AccessRanges)[0].RangeInMemory));
2337 KdPrint2((
PRINT_PREFIX " preconfig, portBase=%x, len=%x\n", portBase, (*ConfigInfo->AccessRanges)[0].RangeLength));
2342 while (AdapterAddresses[*adapterCount] != 0) {
2345 #endif //UNIATA_CORE 2348 deviceExtension->
DevIndex = (*adapterCount);
2360 if (preConfig ==
FALSE) {
2362 ULONG portBase_reg = 0;
2366 portBase = AdapterAddresses[*adapterCount];
2374 if(portBase_reg && irq_reg) {
2376 portBase = portBase_reg;
2384 ConfigInfo->AdapterInterfaceType,
2385 ConfigInfo->SystemIoBusNumber,
2412 if (BaseIoAddress1) {
2417 ConfigInfo->AdapterInterfaceType,
2418 ConfigInfo->SystemIoBusNumber,
2424 ConfigInfo->AdapterInterfaceType,
2425 ConfigInfo->SystemIoBusNumber,
2451 KdPrint2((
PRINT_PREFIX "AtapiFindIsaController: Status %x vs AltStatus %x missmatch, abort init ?\n", statusByte, statusByte2));
2453 if(BaseIoAddress2) {
2455 (
PCHAR)BaseIoAddress2);
2456 BaseIoAddress2 =
NULL;
2461 ConfigInfo->AdapterInterfaceType,
2462 ConfigInfo->SystemIoBusNumber,
2467 BaseIoAddress2 =
NULL;
2475 KdPrint2((
PRINT_PREFIX " abort: Status %x vs AltStatus %x missmatch\n", statusByte, statusByte2));
2508 "AtapiFindIsaController: First access to status %#x\n",
2513 goto retryIdentifier;
2528 "AtapiFindIsaController: Identifier read back from Slave (%#x)\n",
2535 if (preConfig ==
FALSE) {
2543 (*ConfigInfo->AccessRanges)[0].RangeStart =
2547 (*ConfigInfo->AccessRanges)[0].RangeLength =
ATA_IOSIZE;
2548 (*ConfigInfo->AccessRanges)[0].RangeInMemory =
FALSE;
2550 if(BaseIoAddress2) {
2554 (*ConfigInfo->AccessRanges)[1].RangeInMemory =
FALSE;
2564 (*ConfigInfo->AccessRanges)[1].RangeLength = 0;
2570 ConfigInfo->BusInterruptLevel =
irq;
2572 ConfigInfo->BusInterruptLevel = InterruptLevels[*adapterCount - 1];
2575 if (ConfigInfo->AdapterInterfaceType ==
MicroChannel) {
2578 ConfigInfo->InterruptMode =
Latched;
2582 ConfigInfo->NumberOfBuses = 1;
2586 ConfigInfo->MaximumTransferLength = 0x10000;
2607 "AtapiFindIsaController: Found IDE at %#x\n",
2612 if (preConfig ==
FALSE) {
2614 if (*adapterCount - 1 < 2) {
2621 #endif //UNIATA_CORE 2643 "AtapiFindIsaController: look for devices\n"));
2650 "AtapiFindIsaController: detected\n"));
2655 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
2659 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
2666 if (*adapterCount == 1) {
2667 ConfigInfo->AtdiskPrimaryClaimed =
TRUE;
2669 }
else if (*adapterCount == 2) {
2670 ConfigInfo->AtdiskSecondaryClaimed =
TRUE;
2682 ConfigInfo->NumberOfBuses++;
2684 "AtapiFindIsaController: return SP_RETURN_FOUND\n"));
2689 if(BaseIoAddress1) {
2691 (
PCHAR)BaseIoAddress1);
2692 BaseIoAddress1 =
NULL;
2694 if(BaseIoAddress2) {
2696 (
PCHAR)BaseIoAddress2);
2697 BaseIoAddress2 =
NULL;
2699 for(
i=0;
i<2;
i++) {
2701 "AtapiFindIsaController: cleanup AccessRanges %d\n",
i));
2703 (*ConfigInfo->AccessRanges)[
i].RangeLength = 0;
2704 (*ConfigInfo->AccessRanges)[
i].RangeInMemory =
FALSE;
2713 #endif //UNIATA_CORE 2719 *(adapterCount) = 0;
2722 "AtapiFindIsaController: return SP_RETURN_NOT_FOUND\n"));
2753 "AtapiReadArgumentString: Crash dump\n"));
2775 UCHAR signatureHigh;
2814 signatureLow = (
UCHAR)(SIG >> 16);
2815 signatureHigh = (
UCHAR)(SIG >> 24);
2845 if(signatureLow != 0x55) {
2846 if(signatureLow == 0xff || signatureLow == 0) {
2857 if(signatureLow != signatureHigh) {
2858 KdPrint2((
PRINT_PREFIX " nobody home! last chance failed %#x != %#x\n", signatureLow, signatureHigh));
2869 if(signatureLow != 0xAA) {
2911 LunExt = chan->
lun[deviceNumber];
2953 "CheckDevice: bad status %x\n", statusByte));
2958 "CheckDevice: BUSY\n"));
2978 "CheckDevice: status after hard reset %x\n", statusByte));
2983 "CheckDevice: no dev ?\n"));
2990 "CheckDevice: try enable SATA Phy\n"));
3002 signatureLow = signatureHigh = 0;
3109 if(deviceExtension->
DWordIO) {
3135 deviceNumber, statusByte));
3178 skipSetParameters =
FALSE;
3179 ULONG waitCount = 10000;
3200 for (
i = 0;
i < max_ldev;
i++) {
3213 "FindDevices: returning %d (AHCI)\n",
3215 return deviceResponded;
3218 for (
i = 0;
i < max_ldev;
i++) {
3219 LunExt = chan->
lun[
i];
3258 skipSetParameters =
TRUE;
3262 if (skipSetParameters)
3275 "FindDevices: Resetting controller before SetDriveParameters.\n"));
3297 "FindDevices: Status before SetDriveParameters: (%#x) (%#x)\n",
3307 "FindDevices: Set drive parameters for device %d failed\n",
3323 deviceResponded =
TRUE;
3340 if(deviceResponded) {
3341 for (
i = 0;
i < max_ldev;
i++) {
3342 LunExt = chan->
lun[
i];
3345 "FindDevices: select %d dev to clear INTR\n",
i));
3349 "FindDevices: statusByte=%#x\n", statusByte));
3351 for (
i = 0;
i < max_ldev;
i++) {
3352 LunExt = chan->
lun[
i];
3357 "FindDevices: select %d dev on exit\n",
i));
3371 "FindDevices: returning %d\n",
3374 return deviceResponded;
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
struct _CM_RESOURCE_LIST * PCM_RESOURCE_LIST
IDENTIFY_DATA2 IdentifyData
ULONG NTAPI UniataSataReadPort4(IN PHW_CHANNEL chan, IN ULONG io_port_ndx, IN ULONG pm_port)
#define PCI_TYPE0_ADDRESSES
#define AtapiSoftReset(BaseIoAddress, DeviceNumber)
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID UniataExpectChannelInterrupt(IN struct _HW_CHANNEL *chan, IN BOOLEAN Expecting)
#define ATA_AT_HOME_ATAPI
#define CHAN_NOT_SPECIFIED_CHECK_CABLE
#define STATUS_INSUFFICIENT_RESOURCES
#define PCI_DEV_SUBCLASS_IDE
#define BM_STATUS_SIMPLEX_ONLY
#define GetStatus(BaseIoAddress, Status)
#define GetDmaStatus(de, c)
#define CHAN_NOT_SPECIFIED
NTSTATUS NTAPI UniataClaimLegacyPCIIDE(ULONG i)
__inline ULONG UniataAhciReadChannelPort4(IN PHW_CHANNEL chan, IN ULONG io_port_ndx)
#define PCI_ENABLE_IO_SPACE
PBUSMASTER_CONTROLLER_INFORMATION BMList
CM_FULL_RESOURCE_DESCRIPTOR List[1]
NTSTATUS NTAPI UniataConnectIntr2(IN PVOID HwDeviceExtension)
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
UCHAR NTAPI UniataSataPhyEnable(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG pm_port, IN BOOLEAN doReset)
#define CTRFLAGS_NO_SLAVE
#define UNIATA_RAID_CONTROLLER
INTERFACE_TYPE OrigAdapterInterfaceType
enum _BUS_DATA_TYPE BUS_DATA_TYPE
NTSTATUS NTAPI UniataChipDetect(IN PVOID HwDeviceExtension, IN PPCI_COMMON_CONFIG pciData, IN ULONG DeviceNumber, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN BOOLEAN *simplexOnly)
#define IDX_IO2_AltStatus
ULONG NTAPI AtapiFindDev(IN PVOID HwDeviceExtension, IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG dev_id, IN ULONG RevID)
#define ATA_AT_HOME_NOBODY
BOOLEAN NTAPI UniataCheckPCISubclass(BOOLEAN known, ULONG RaidFlags, UCHAR SubClass)
struct _BUSMASTER_CONTROLLER_INFORMATION * PBUSMASTER_CONTROLLER_INFORMATION
#define ScsiPortConvertPhysicalAddressToUlong(Address)
#define ATA_PCCARD_ALTOFFSET
UCHAR DDKFASTAPI SelectDrive(IN struct _HW_CHANNEL *chan, IN ULONG DeviceNumber)
struct _IDE_REGISTERS_2 * PIDE_REGISTERS_2
#define IDE_COMMAND_IDENTIFY
#define REORDER_COST_SWITCH_RW_HDD
#define DFLAGS_ATAPI_DEVICE
struct _IDE_BUSMASTER_REGISTERS * PIDE_BUSMASTER_REGISTERS
ULONG NTAPI UniataAhciSoftReset(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG DeviceNumber)
ULONG NTAPI AtapiParseArgumentString(IN PCHAR String, IN PCHAR KeyWord)
#define PCI_DEV_SUBCLASS_ATA
VOID NTAPI UniataForgetDevice(PHW_LU_EXTENSION LunExt)
ULONG NTAPI UniataFindCompatBusMasterController2(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
BOOLEAN NTAPI UniataAllocateLunExt(PHW_DEVICE_EXTENSION deviceExtension, ULONG NewNumberChannels)
PVOID NTAPI ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
#define GetBaseStatus(BaseIoAddress, Status)
#define SStatus_DET_Dev_NoPhy
#define sprintf(buf, format,...)
VOID NTAPI ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
CM_PARTIAL_RESOURCE_LIST PartialResourceList
PDRIVER_OBJECT SavedDriverObject
_Must_inspect_result_ _In_ ULONG Flags
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
#define IDE_DEFAULT_MAX_CHAN
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
_In_ ULONG _In_ ULONG Offset
VOID NTAPI UniataDumpATARegs(IN struct _HW_CHANNEL *chan)
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 IDX_IO1_i_DriveSelect
struct _HW_LU_EXTENSION HW_LU_EXTENSION
BOOLEAN NTAPI SetDriveParameters(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG Channel)
ULONG NTAPI CheckDevice(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG deviceNumber, IN BOOLEAN ResetDev)
#define PCIBUSNUM_NOT_SPECIFIED
ULONG NTAPI AtapiFindIsaController(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
struct _HW_DEVICE_EXTENSION HW_DEVICE_EXTENSION
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
enum _KINTERRUPT_MODE KINTERRUPT_MODE
#define offsetof(TYPE, MEMBER)
VOID NTAPI IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
static PDRIVER_OBJECT DriverObject
struct _ISR2_DEVICE_EXTENSION * PISR2_DEVICE_EXTENSION
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
#define IDE_COMMAND_ATAPI_IDENTIFY
NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(PUNICODE_STRING, PUNICODE_STRING, PDRIVER_OBJECT, PDEVICE_OBJECT, INTERFACE_TYPE, ULONG, ULONG, PCM_RESOURCE_LIST *)
NTSTATUS NTAPI UniataDisconnectIntr2(IN PVOID HwDeviceExtension)
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
BOOLEAN NTAPI AtapiCheckIOInterference(IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, ULONG portBase)
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
__inline BOOLEAN UniataIsSATARangeAvailable(IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG lChannel)
UCHAR DDKFASTAPI WaitOnBaseBusyLong(IN struct _HW_CHANNEL *chan)
#define REORDER_MCOST_SWITCH_RW_HDD
#define IDX_ATAPI_IO1_i_Status
#define BMLIST_TERMINATOR
BOOLEAN NTAPI UniataSataClearErr(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN BOOLEAN do_connect, IN ULONG pm_port)
VOID NTAPI AtapiSetupLunPtrs(IN PHW_CHANNEL chan, IN PHW_DEVICE_EXTENSION deviceExtension, IN ULONG c)
#define IDX_IO1_o_BlockNumber
#define DFLAGS_TAPE_DEVICE
#define UNIATA_ALLOCATE_NEW_LUNS
#define IDX_ATAPI_IO1_o_ByteCountHigh
UCHAR DDKFASTAPI AtapiReadPort1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port)
ULONG NTAPI AtapiRegCheckDevValue(IN PVOID HwDeviceExtension, IN ULONG chan, IN ULONG dev, IN PCWSTR Name, IN ULONG Default)
VOID NTAPI AtapiDisableInterrupts(IN PVOID HwDeviceExtension, IN ULONG c)
#define PCI_INVALID_VENDORID
ULONG NTAPI AtapiReadArgumentString(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
static CONST ULONG StdIsaPorts[]
#define NT_SUCCESS(StatCode)
SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress(IN ULONG_PTR UlongAddress)
GLenum GLuint GLenum GLsizei length
BOOLEAN NTAPI IssueIdentify(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG Channel, IN UCHAR Command)
_In_ USHORT _In_ UCHAR _In_ USHORT SubVendorID
union _PCI_SLOT_NUMBER::@3659 u
#define PCI_ENABLE_BUS_MASTER
#define PCI_IDE_PROGIF_NATIVE_ALL
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)
#define DEVNUM_NOT_SPECIFIED
#define SP_RETURN_NOT_FOUND
VOID NTAPI UniataInitMapBase(IN struct _HW_CHANNEL *chan, IN PIDE_REGISTERS_1 BaseIoAddress1, IN PIDE_REGISTERS_2 BaseIoAddress2)
#define Ata_is_supported_dev(pciData)
struct _HW_DEVICE_EXTENSION * DeviceExtension
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define DFLAGS_REMOVABLE_DRIVE
#define STATUS_UNSUCCESSFUL
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
BOOLEAN NTAPI AtapiReadChipConfig(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG channel)
VOID NTAPI AtapiDmaAlloc(IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN ULONG lChannel)
VOID DDKFASTAPI AtapiHardReset(IN struct _HW_CHANNEL *chan, IN BOOLEAN DisableInterrupts, IN ULONG Delay)
VOID NTAPI UniataEnumBusMasterController(IN PVOID DriverObject, PVOID Argument2)
#define PCI_DEV_CLASS_STORAGE
#define ExAllocatePool(type, size)
#define DFLAGS_LBA_ENABLED
struct _BUSMASTER_CONTROLLER_INFORMATION BUSMASTER_CONTROLLER_INFORMATION
ULONG NTAPI UniataFindCompatBusMasterController1(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
_In_ USHORT _In_ UCHAR _In_ USHORT _In_ USHORT SubSystemID
BOOLEAN AtdiskPrimaryClaimed
IORES RegTranslation[IDX_MAX_REG]
VOID NTAPI UniataFreeLunExt(PHW_DEVICE_EXTENSION deviceExtension)
VOID NTAPI AtapiEnableInterrupts(IN PVOID HwDeviceExtension, IN ULONG c)
#define IDX_IO1_i_CylinderHigh
#define PCI_DEV_SUBCLASS_RAID
PHW_DEVICE_EXTENSION HwDeviceExtension
INTERFACE_TYPE InterfaceType
struct _HW_DEVICE_EXTENSION * PHW_DEVICE_EXTENSION
VOID DDKFASTAPI AtapiWritePort1(IN PHW_CHANNEL chan, IN ULONGIO_PTR port, IN UCHAR data)
BOOLEAN AtdiskSecondaryClaimed
#define DFLAGS_DEVICE_PRESENT
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IDX_IO1_o_CylinderLow
UNICODE_STRING SavedRegPath
#define PCI_DEV_SUBCLASS_SATA
#define PCISLOTNUM_NOT_SPECIFIED
#define UNIATA_SATA_IGNORE_CONNECT
#define Ata_is_ahci_dev(pciData)
ULONG NTAPI UniataFindBusMasterController(IN PVOID HwDeviceExtension, IN PVOID Context, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
BOOLEAN NTAPI AtapiInterrupt2(IN PKINTERRUPT Interrupt, 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)
USHORT NTAPI UniataEnableIoPCI(IN ULONG busNumber, IN ULONG slotNumber, IN OUT PPCI_COMMON_CONFIG pciData)
#define FILE_DEVICE_UNKNOWN
#define PCI_ENABLE_MEMORY_SPACE
#define AtapiStallExecution(dt)
#define REORDER_MCOST_SEEK_BACK_HDD
#define SStatus_IPM_NoDev
BOOLEAN NTAPI ScsiPortValidateRange(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
#define UNIATA_NO_DPC_ATAPI
#define DFLAGS_DWORDIO_ENABLED
VOID NTAPI UniataInitMapBM(IN struct _HW_DEVICE_EXTENSION *deviceExtension, IN struct _IDE_BUSMASTER_REGISTERS *BaseIoAddressBM_0, IN BOOLEAN MemIo)
struct _PCI_SLOT_NUMBER::@3659::@3660 bits
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)
#define WaitOnBusy(BaseIoAddress, Status)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTHALAPI ULONG NTAPI HalGetBusData(BUS_DATA_TYPE, ULONG, ULONG, PVOID, ULONG)
#define RtlZeroMemory(Destination, Length)
BOOLEAN NTAPI AtapiChipInit(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG c)
BUSMASTER_CONTROLLER_INFORMATION_BASE const BusMasterAdapters[]
__inline ULONG Ata_is_dev_listed(IN PBUSMASTER_CONTROLLER_INFORMATION_BASE BusMasterAdapters, ULONG VendorId, ULONG DeviceId, ULONG RevId, ULONG lim)
#define IDE_MAX_LUN_PER_CHAN
#define IDE_DRIVE_SELECT_2
ULONG MaximumDmaTransferLength
UCHAR NTAPI AtapiDmaDone(IN PVOID HwDeviceExtension, IN ULONG DeviceNumber, IN ULONG lChannel, IN PSCSI_REQUEST_BLOCK Srb)
ULONG NTAPI HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
#define PCI_ADDRESS_IO_SPACE
#define IsBusMaster(pciData)
#define IsMasterDev(pciData)
#define IDX_IO1_i_CylinderLow
#define UNIATA_FIND_DEV_UNHIDE
ULONG NTAPI UniataEnumBusMasterController__()
static SERVICE_STATUS status
ULONG g_opt_VirtualMachine
ULONG NTAPI UniataAnybodyHome(IN PVOID HwDeviceExtension, IN ULONG lChannel, IN ULONG deviceNumber)
ULONG AtapiReadyWaitDelay
#define IDX_IO1_i_BlockNumber
#define IDX_ATAPI_IO1_i_DriveSelect
struct _HW_LU_EXTENSION * lun[IDE_MAX_LUN_PER_CHAN]
ULONG const NUM_BUSMASTER_ADAPTERS
VOID NTAPI AtapiDoNothing(VOID)
BOOLEAN NTAPI FindDevices(IN PVOID HwDeviceExtension, IN ULONG Flags, IN ULONG Channel)
ULONG g_opt_WaitBusyResetCount
struct _PORT_CONFIGURATION_INFORMATION_COMMON * PPORT_CONFIGURATION_INFORMATION_COMMON
INTERFACE_TYPE AdapterInterfaceType
struct _IDE_REGISTERS_1 * PIDE_REGISTERS_1
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)
#define PCI_COMMON_HDR_LENGTH