ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2007
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
287 discussions
Start a n
N
ew thread
[greatlrd] 26213: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sat Mar 31 00:04:05 2007 New Revision: 26213 URL:
http://svn.reactos.org/svn/reactos?rev=26213&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/unknown.h (with props) trunk/reactos/include/ddk/xmldsodid.h (with props) Added: trunk/reactos/include/ddk/unknown.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/unknown.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/unknown.h (added) +++ trunk/reactos/include/ddk/unknown.h Sat Mar 31 00:04:05 2007 @@ -1,0 +1,55 @@ +#ifndef _UNKNOWN_H_ +#define _UNKNOWN_H_ + +#ifdef __cplusplus +extern "C" { +#include <wdm.h> +} +#else +#include <wdm.h> +#endif + +#include <windef.h> +#define COM_NO_WINDOWS_H +#include <basetyps.h> +#ifdef PUT_GUIDS_HERE +#include <initguid.h> +#endif + +DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); +#if defined(__cplusplus) && _MSC_VER >= 1100 + struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown; +#endif + +#undef INTERFACE +#define INTERFACE IUnknown +DECLARE_INTERFACE(IUnknown) +{ + STDMETHOD(QueryInterface) + ( THIS_ + IN REFIID, + OUT PVOID * + ) PURE; + + STDMETHOD_(ULONG,AddRef) + ( THIS + ) PURE; + + STDMETHOD_(ULONG,Release) + ( THIS + ) PURE; +}; +#undef INTERFACE + +typedef IUnknown *PUNKNOWN; +typedef +HRESULT +(*PFNCREATEINSTANCE) +( + OUT PUNKNOWN * Unknown, + IN REFCLSID ClassId, + IN PUNKNOWN OuterUnknown, + IN POOL_TYPE PoolType +); +#endif + Propchange: trunk/reactos/include/ddk/unknown.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/ddk/xmldsodid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/xmldsodid.h?re…
============================================================================== --- trunk/reactos/include/ddk/xmldsodid.h (added) +++ trunk/reactos/include/ddk/xmldsodid.h Sat Mar 31 00:04:05 2007 @@ -1,0 +1,10 @@ + +#ifndef __XMLDSODID_H__ +#define __XMLDSODID_H__ +#define DISPID_XOBJ_MIN 0x00010000 +#define DISPID_XOBJ_MAX 0x0001FFFF +#define DISPID_XOBJ_BASE DISPID_XOBJ_MIN +#define DISPID_XMLDSO DISPID_XOBJ_BASE +#define DISPID_XMLDSO_DOCUMENT DISPID_XMLDSO + 1 +#define DISPID_XMLDSO_JAVADSOCOMPATIBLE DISPID_XMLDSO_DOCUMENT + 1 +#endif Propchange: trunk/reactos/include/ddk/xmldsodid.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[fireball] 26212: - Fix ScsiPortGetDeviceBase() / ScsiPortSetDeviceBase().
by fireball@svn.reactos.org
Author: fireball Date: Fri Mar 30 23:24:11 2007 New Revision: 26212 URL:
http://svn.reactos.org/svn/reactos?rev=26212&view=rev
Log: - Fix ScsiPortGetDeviceBase() / ScsiPortSetDeviceBase(). Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Fri Mar 30 23:24:11 2007 @@ -306,35 +306,45 @@ ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress) { - PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; - PSCSI_PORT_DEVICE_BASE DeviceBase; - PLIST_ENTRY Entry; - - //DPRINT("ScsiPortFreeDeviceBase() called\n"); - - DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, - SCSI_PORT_DEVICE_EXTENSION, - MiniPortDeviceExtension); - if (IsListEmpty(&DeviceExtension->DeviceBaseListHead)) - return; - - Entry = DeviceExtension->DeviceBaseListHead.Flink; - while (Entry != &DeviceExtension->DeviceBaseListHead) - { - DeviceBase = CONTAINING_RECORD(Entry, - SCSI_PORT_DEVICE_BASE, - List); - if (DeviceBase->MappedAddress == MappedAddress) - { - MmUnmapIoSpace(DeviceBase->MappedAddress, - DeviceBase->NumberOfBytes); - RemoveEntryList(Entry); - ExFreePool(DeviceBase); - - return; - } - - Entry = Entry->Flink; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + PMAPPED_ADDRESS NextMa, LastMa; + + //DPRINT("ScsiPortFreeDeviceBase() called\n"); + + DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1; + + /* Initialize our pointers */ + NextMa = DeviceExtension->MappedAddressList; + LastMa = NextMa; + + while (NextMa) + { + if (NextMa->MappedAddress == MappedAddress) + { + /* Unmap it first */ + MmUnmapIoSpace(MappedAddress, NextMa->NumberOfBytes); + + /* Remove it from the list */ + if (NextMa == DeviceExtension->MappedAddressList) + { + /* Remove the first entry */ + DeviceExtension->MappedAddressList = NextMa->NextMappedAddress; + } + else + { + LastMa->NextMappedAddress = NextMa->NextMappedAddress; + } + + /* Free the resources and quit */ + ExFreePool(NextMa); + + return; + } + else + { + LastMa = NextMa; + NextMa = NextMa->NextMappedAddress; + } } } @@ -369,50 +379,51 @@ IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace) { - PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; - PHYSICAL_ADDRESS TranslatedAddress; - PSCSI_PORT_DEVICE_BASE DeviceBase; - ULONG AddressSpace; - PVOID MappedAddress; - - //DPRINT ("ScsiPortGetDeviceBase() called\n"); - - AddressSpace = (ULONG)InIoSpace; - if (HalTranslateBusAddress(BusType, - SystemIoBusNumber, - IoAddress, - &AddressSpace, - &TranslatedAddress) == FALSE) - return NULL; - - /* i/o space */ - if (AddressSpace != 0) - return((PVOID)TranslatedAddress.u.LowPart); - - MappedAddress = MmMapIoSpace(TranslatedAddress, - NumberOfBytes, - FALSE); - - DeviceBase = ExAllocatePool(NonPagedPool, - sizeof(SCSI_PORT_DEVICE_BASE)); - if (DeviceBase == NULL) - return(MappedAddress); - - DeviceBase->MappedAddress = MappedAddress; - DeviceBase->NumberOfBytes = NumberOfBytes; - DeviceBase->IoAddress = IoAddress; - DeviceBase->SystemIoBusNumber = SystemIoBusNumber; - - DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, - SCSI_PORT_DEVICE_EXTENSION, - MiniPortDeviceExtension); - - InsertHeadList(&DeviceExtension->DeviceBaseListHead, - &DeviceBase->List); - - return(MappedAddress); -} - + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + PHYSICAL_ADDRESS TranslatedAddress; + PMAPPED_ADDRESS DeviceBase; + ULONG AddressSpace; + PVOID MappedAddress; + + //DPRINT ("ScsiPortGetDeviceBase() called\n"); + + DeviceExtension = ((PSCSI_PORT_DEVICE_EXTENSION)HwDeviceExtension) - 1; + + AddressSpace = (ULONG)InIoSpace; + if (HalTranslateBusAddress(BusType, + SystemIoBusNumber, + IoAddress, + &AddressSpace, + &TranslatedAddress) == FALSE) + { + return NULL; + } + + /* i/o space */ + if (AddressSpace != 0) + return((PVOID)TranslatedAddress.u.LowPart); + + MappedAddress = MmMapIoSpace(TranslatedAddress, + NumberOfBytes, + FALSE); + + DeviceBase = ExAllocatePool(NonPagedPool, + sizeof(MAPPED_ADDRESS)); + + if (DeviceBase == NULL) + return MappedAddress; + + DeviceBase->MappedAddress = MappedAddress; + DeviceBase->NumberOfBytes = NumberOfBytes; + DeviceBase->IoAddress = IoAddress; + DeviceBase->BusNumber = SystemIoBusNumber; + + /* Link it to the Device Extension list */ + DeviceBase->NextMappedAddress = DeviceExtension->MappedAddressList; + DeviceExtension->MappedAddressList = DeviceBase; + + return MappedAddress; +} /* * @implemented Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Fri Mar 30 23:24:11 2007 @@ -216,7 +216,7 @@ KTIMER MiniportTimer; KDPC MiniportTimerDpc; - LIST_ENTRY DeviceBaseListHead; + PMAPPED_ADDRESS MappedAddressList; ULONG LunExtensionSize; PSCSI_PORT_LUN_EXTENSION LunExtensionList[LUS_NUMBER];
17 years, 8 months
1
0
0
0
[fireball] 26211: - Further work on ScsiPortInitialize(): old PortConfig section is deleted. - SpiGetPciData() code improved, part of the code is transferred into a new function. Right now a crash is introduced in ScsiPortFreeDeviceBase(), because of the changes in ScsiPortInitialize(): will be fixed by the next commit.
by fireball@svn.reactos.org
Author: fireball Date: Fri Mar 30 23:10:29 2007 New Revision: 26211 URL:
http://svn.reactos.org/svn/reactos?rev=26211&view=rev
Log: - Further work on ScsiPortInitialize(): old PortConfig section is deleted. - SpiGetPciData() code improved, part of the code is transferred into a new function. Right now a crash is introduced in ScsiPortFreeDeviceBase(), because of the changes in ScsiPortInitialize(): will be fixed by the next commit. Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Fri Mar 30 23:10:29 2007 @@ -19,10 +19,11 @@ /* $Id$ * * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: services/storage/scsiport/scsiport.c + * PROJECT: ReactOS Storage Stack + * FILE: drivers/storage/scsiport/scsiport.c * PURPOSE: SCSI port driver * PROGRAMMER: Eric Kohl (ekohl(a)rz-online.de) + * Aleksey Bragin (aleksey reactos org) */ /* INCLUDES *****************************************************************/ @@ -51,10 +52,13 @@ /* GLOBALS *******************************************************************/ static BOOLEAN -SpiGetPciConfigData (IN struct _HW_INITIALIZATION_DATA *HwInitializationData, - IN OUT PPORT_CONFIGURATION_INFORMATION PortConfig, - IN ULONG BusNumber, - IN OUT PPCI_SLOT_NUMBER NextSlotNumber); +SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN struct _HW_INITIALIZATION_DATA *HwInitializationData, + IN OUT PPORT_CONFIGURATION_INFORMATION PortConfig, + IN PUNICODE_STRING RegistryPath, + IN ULONG BusNumber, + IN OUT PPCI_SLOT_NUMBER NextSlotNumber); static NTSTATUS STDCALL ScsiPortCreateClose(IN PDEVICE_OBJECT DeviceObject, @@ -184,6 +188,11 @@ IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN PCONFIGURATION_INFO InternalConfigInfo, IN PUCHAR Buffer); + +static VOID +SpiResourceToConfig(IN PHW_INITIALIZATION_DATA HwInitializationData, + IN PCM_FULL_RESOURCE_DESCRIPTOR ResourceDescriptor, + IN PPORT_CONFIGURATION_INFORMATION PortConfig); /* FUNCTIONS *****************************************************************/ @@ -759,7 +768,7 @@ IN PVOID HwContext) { PDRIVER_OBJECT DriverObject = (PDRIVER_OBJECT)Argument1; - // PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2; + PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2; PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PCONFIGURATION_INFORMATION SystemConfig; PPORT_CONFIGURATION_INFORMATION PortConfig; @@ -770,7 +779,6 @@ BOOLEAN Again; BOOLEAN DeviceFound = FALSE; BOOLEAN FirstConfigCall = TRUE; - ULONG i; ULONG Result; NTSTATUS Status; ULONG MaxBus; @@ -921,7 +929,7 @@ SpiMiniportTimerDpc, PortDeviceObject); -//CreatePortConfig: +CreatePortConfig: Status = SpiCreatePortConfig(DeviceExtension, HwInitializationData, @@ -953,87 +961,61 @@ sizeof(PORT_CONFIGURATION_INFORMATION)); - - - - - - /* Initialize the device base list */ - InitializeListHead (&DeviceExtension->DeviceBaseListHead); - - /* Initialize array of LUNs */ - RtlZeroMemory(DeviceExtension->LunExtensionList, - sizeof(PSCSI_PORT_LUN_EXTENSION) * LUS_NUMBER); - - - RtlZeroMemory (DeviceExtension->PortConfig, - PortConfigSize); - - PortConfig = DeviceExtension->PortConfig; - PortConfig->Length = sizeof(PORT_CONFIGURATION_INFORMATION); - PortConfig->SystemIoBusNumber = BusNumber; - PortConfig->AdapterInterfaceType = HwInitializationData->AdapterInterfaceType; - PortConfig->InterruptMode = - (PortConfig->AdapterInterfaceType == PCIBus) ? LevelSensitive : Latched; - PortConfig->MaximumTransferLength = SP_UNINITIALIZED_VALUE; - PortConfig->NumberOfPhysicalBreaks = SP_UNINITIALIZED_VALUE; - PortConfig->DmaChannel = SP_UNINITIALIZED_VALUE; - PortConfig->DmaPort = SP_UNINITIALIZED_VALUE; -// PortConfig->DmaWidth = -// PortConfig->DmaSpeed = -// PortConfig->AlignmentMask = - PortConfig->NumberOfAccessRanges = HwInitializationData->NumberOfAccessRanges; - PortConfig->NumberOfBuses = MaxBus; - - for (i = 0; i < SCSI_MAXIMUM_BUSES; i++) - PortConfig->InitiatorBusId[i] = 255; - -// PortConfig->ScatterGather = -// PortConfig->Master = -// PortConfig->CachesData = -// PortConfig->AdapterScansDown = - PortConfig->AtdiskPrimaryClaimed = SystemConfig->AtDiskPrimaryAddressClaimed; - PortConfig->AtdiskSecondaryClaimed = SystemConfig->AtDiskSecondaryAddressClaimed; -// PortConfig->Dma32BitAddresses = -// PortConfig->DemandMode = - PortConfig->MapBuffers = HwInitializationData->MapBuffers; - PortConfig->NeedPhysicalAddresses = HwInitializationData->NeedPhysicalAddresses; - PortConfig->TaggedQueuing = HwInitializationData->TaggedQueuing; - PortConfig->AutoRequestSense = HwInitializationData->AutoRequestSense; - PortConfig->MultipleRequestPerLu = HwInitializationData->MultipleRequestPerLu; - PortConfig->ReceiveEvent = HwInitializationData->ReceiveEvent; -// PortConfig->RealModeInitialized = -// PortConfig->BufferAccessScsiPortControlled = - PortConfig->MaximumNumberOfTargets = SCSI_MAXIMUM_TARGETS; -// PortConfig->MaximumNumberOfLogicalUnits = SCSI_MAXIMUM_LOGICAL_UNITS; - - PortConfig->SlotNumber = SlotNumber.u.AsULONG; - - PortConfig->AccessRanges = (ACCESS_RANGE(*)[])(PortConfig + 1); + /* Copy extension sizes into the PortConfig */ + PortConfig->SpecificLuExtensionSize = DeviceExtension->LunExtensionSize; + PortConfig->SrbExtensionSize = DeviceExtension->SrbExtensionSize; + + /* Initialize Access ranges */ + if (HwInitializationData->NumberOfAccessRanges != 0) + { + PortConfig->AccessRanges = (PVOID)(PortConfig+1); + + /* Align to LONGLONG */ + PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) + 7); + PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) & ~7); + + /* Copy the data */ + RtlCopyMemory(PortConfig->AccessRanges, + ConfigInfo.AccessRanges, + HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE)); + } /* Search for matching PCI device */ if ((HwInitializationData->AdapterInterfaceType == PCIBus) && - (HwInitializationData->VendorIdLength > 0) && - (HwInitializationData->VendorId != NULL) && - (HwInitializationData->DeviceIdLength > 0) && - (HwInitializationData->DeviceId != NULL)) - { - /* Get PCI device data */ - DPRINT("VendorId '%.*s' DeviceId '%.*s'\n", - HwInitializationData->VendorIdLength, - HwInitializationData->VendorId, - HwInitializationData->DeviceIdLength, - HwInitializationData->DeviceId); - - if (!SpiGetPciConfigData (HwInitializationData, - PortConfig, - BusNumber, - &SlotNumber)) - { - Status = STATUS_UNSUCCESSFUL; - goto ByeBye; - } - } + (HwInitializationData->VendorIdLength > 0) && + (HwInitializationData->VendorId != NULL) && + (HwInitializationData->DeviceIdLength > 0) && + (HwInitializationData->DeviceId != NULL)) + { + PortConfig->BusInterruptLevel = 0; + + /* Get PCI device data */ + DPRINT("VendorId '%.*s' DeviceId '%.*s'\n", + HwInitializationData->VendorIdLength, + HwInitializationData->VendorId, + HwInitializationData->DeviceIdLength, + HwInitializationData->DeviceId); + + if (!SpiGetPciConfigData(DriverObject, + PortDeviceObject, + HwInitializationData, + PortConfig, + RegistryPath, + BusNumber, + &SlotNumber)) + { + /* Continue to the next bus, nothing here */ + ConfigInfo.BusNumber++; + DeviceExtension->PortConfig = NULL; + ExFreePool(PortConfig); + Again = FALSE; + goto CreatePortConfig; + } + } + + + + /* Note: HwFindAdapter is called once for each bus */ Again = FALSE; @@ -1427,146 +1409,180 @@ /* INTERNAL FUNCTIONS ********************************************************/ +static VOID +SpiResourceToConfig(IN PHW_INITIALIZATION_DATA HwInitializationData, + IN PCM_FULL_RESOURCE_DESCRIPTOR ResourceDescriptor, + IN PPORT_CONFIGURATION_INFORMATION PortConfig) +{ + PACCESS_RANGE AccessRange; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialData; + ULONG RangeNumber; + ULONG Index; + + RangeNumber = 0; + + /* Loop through all entries */ + for (Index = 0; Index < ResourceDescriptor->PartialResourceList.Count; Index++) + { + PartialData = &ResourceDescriptor->PartialResourceList.PartialDescriptors[Index]; + + switch (PartialData->Type) + { + case CmResourceTypePort: + /* Copy access ranges */ + if (RangeNumber < HwInitializationData->NumberOfAccessRanges) + { + AccessRange = &((*(PortConfig->AccessRanges))[RangeNumber]); + + AccessRange->RangeStart = PartialData->u.Port.Start; + AccessRange->RangeLength = PartialData->u.Port.Length; + + AccessRange->RangeInMemory = FALSE; + RangeNumber++; + } + break; + + case CmResourceTypeMemory: + /* Copy access ranges */ + if (RangeNumber < HwInitializationData->NumberOfAccessRanges) + { + AccessRange = &((*(PortConfig->AccessRanges))[RangeNumber]); + + AccessRange->RangeStart = PartialData->u.Memory.Start; + AccessRange->RangeLength = PartialData->u.Memory.Length; + + AccessRange->RangeInMemory = TRUE; + RangeNumber++; + } + break; + + case CmResourceTypeInterrupt: + /* Copy interrupt data */ + PortConfig->BusInterruptLevel = PartialData->u.Interrupt.Level; + PortConfig->BusInterruptVector = PartialData->u.Interrupt.Vector; + + /* Set interrupt mode accordingly to the resource */ + if (PartialData->Flags == CM_RESOURCE_INTERRUPT_LATCHED) + { + PortConfig->InterruptMode = Latched; + } + else if (PartialData->Flags == CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE) + { + PortConfig->InterruptMode = LevelSensitive; + } + break; + + case CmResourceTypeDma: + PortConfig->DmaChannel = PartialData->u.Dma.Channel; + PortConfig->DmaPort = PartialData->u.Dma.Port; + break; + } + } +} static BOOLEAN -SpiGetPciConfigData (IN struct _HW_INITIALIZATION_DATA *HwInitializationData, - IN OUT PPORT_CONFIGURATION_INFORMATION PortConfig, - IN ULONG BusNumber, - IN OUT PPCI_SLOT_NUMBER NextSlotNumber) -{ - PCI_COMMON_CONFIG PciConfig; - PCI_SLOT_NUMBER SlotNumber; - ULONG DataSize; - ULONG DeviceNumber; - ULONG FunctionNumber; - CHAR VendorIdString[8]; - CHAR DeviceIdString[8]; - ULONG i; - ULONG RangeLength; - - DPRINT ("SpiGetPciConfiguration() called\n"); - - if (NextSlotNumber->u.bits.FunctionNumber >= PCI_MAX_FUNCTION) - { - NextSlotNumber->u.bits.FunctionNumber = 0; - NextSlotNumber->u.bits.DeviceNumber++; - } - - if (NextSlotNumber->u.bits.DeviceNumber >= PCI_MAX_DEVICES) - { - NextSlotNumber->u.bits.DeviceNumber = 0; - return FALSE; - } - - for (DeviceNumber = NextSlotNumber->u.bits.DeviceNumber; DeviceNumber < PCI_MAX_DEVICES; DeviceNumber++) - { - SlotNumber.u.bits.DeviceNumber = DeviceNumber; - - for (FunctionNumber = NextSlotNumber->u.bits.FunctionNumber; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++) - { - SlotNumber.u.bits.FunctionNumber = FunctionNumber; - - DataSize = HalGetBusData (PCIConfiguration, - BusNumber, - SlotNumber.u.AsULONG, - &PciConfig, - PCI_COMMON_HDR_LENGTH); - if (DataSize != PCI_COMMON_HDR_LENGTH) - { - if (FunctionNumber == 0) - { - break; - } - else - { - continue; - } - } - - sprintf (VendorIdString, "%04hx", PciConfig.VendorID); - sprintf (DeviceIdString, "%04hx", PciConfig.DeviceID); - - if (!_strnicmp(VendorIdString, HwInitializationData->VendorId, HwInitializationData->VendorIdLength) && - !_strnicmp(DeviceIdString, HwInitializationData->DeviceId, HwInitializationData->DeviceIdLength)) - { - DPRINT ("Found device 0x%04hx 0x%04hx at %1lu %2lu %1lu\n", - PciConfig.VendorID, - PciConfig.DeviceID, - BusNumber, - SlotNumber.u.bits.DeviceNumber, - SlotNumber.u.bits.FunctionNumber); - - PortConfig->BusInterruptLevel = - PortConfig->BusInterruptVector = PciConfig.u.type0.InterruptLine; - PortConfig->SlotNumber = SlotNumber.u.AsULONG; - - /* Initialize access ranges */ - if (PortConfig->NumberOfAccessRanges > 0) - { - if (PortConfig->NumberOfAccessRanges > PCI_TYPE0_ADDRESSES) - PortConfig->NumberOfAccessRanges = PCI_TYPE0_ADDRESSES; - - for (i = 0; i < PortConfig->NumberOfAccessRanges; i++) - { - (*PortConfig->AccessRanges)[i].RangeStart.QuadPart = - PciConfig.u.type0.BaseAddresses[i] & PCI_ADDRESS_IO_ADDRESS_MASK; - if ((*PortConfig->AccessRanges)[i].RangeStart.QuadPart != 0) - { - RangeLength = (ULONG)-1; - HalSetBusDataByOffset (PCIConfiguration, - BusNumber, - SlotNumber.u.AsULONG, - (PVOID)&RangeLength, - 0x10 + (i * sizeof(ULONG)), - sizeof(ULONG)); - - HalGetBusDataByOffset (PCIConfiguration, - BusNumber, - SlotNumber.u.AsULONG, - (PVOID)&RangeLength, - 0x10 + (i * sizeof(ULONG)), - sizeof(ULONG)); - - HalSetBusDataByOffset (PCIConfiguration, - BusNumber, - SlotNumber.u.AsULONG, - (PVOID)&PciConfig.u.type0.BaseAddresses[i], - 0x10 + (i * sizeof(ULONG)), - sizeof(ULONG)); - if (RangeLength != 0) - { - (*PortConfig->AccessRanges)[i].RangeLength = - -(RangeLength & PCI_ADDRESS_IO_ADDRESS_MASK); - (*PortConfig->AccessRanges)[i].RangeInMemory = - !(PciConfig.u.type0.BaseAddresses[i] & PCI_ADDRESS_IO_SPACE); - - DPRINT("RangeStart 0x%lX RangeLength 0x%lX RangeInMemory %s\n", - PciConfig.u.type0.BaseAddresses[i] & PCI_ADDRESS_IO_ADDRESS_MASK, - -(RangeLength & PCI_ADDRESS_IO_ADDRESS_MASK), - (PciConfig.u.type0.BaseAddresses[i] & PCI_ADDRESS_IO_SPACE)?"FALSE":"TRUE"); - } - } - } - } - - NextSlotNumber->u.bits.DeviceNumber = DeviceNumber; - NextSlotNumber->u.bits.FunctionNumber = FunctionNumber + 1; - - return TRUE; - } - - - if (FunctionNumber == 0 && !(PciConfig.HeaderType & PCI_MULTIFUNCTION)) - { - break; - } - } +SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN struct _HW_INITIALIZATION_DATA *HwInitializationData, + IN OUT PPORT_CONFIGURATION_INFORMATION PortConfig, + IN PUNICODE_STRING RegistryPath, + IN ULONG BusNumber, + IN OUT PPCI_SLOT_NUMBER NextSlotNumber) +{ + PCI_COMMON_CONFIG PciConfig; + PCI_SLOT_NUMBER SlotNumber; + ULONG DataSize; + ULONG DeviceNumber; + ULONG FunctionNumber; + CHAR VendorIdString[8]; + CHAR DeviceIdString[8]; + UNICODE_STRING UnicodeStr; + PCM_RESOURCE_LIST ResourceList; + NTSTATUS Status; + + DPRINT ("SpiGetPciConfiguration() called\n"); + + SlotNumber.u.AsULONG = 0; + + /* Loop through all devices */ + for (DeviceNumber = NextSlotNumber->u.bits.DeviceNumber; DeviceNumber < PCI_MAX_DEVICES; DeviceNumber++) + { + SlotNumber.u.bits.DeviceNumber = DeviceNumber; + + /* Loop through all functions */ + for (FunctionNumber = NextSlotNumber->u.bits.FunctionNumber; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++) + { + SlotNumber.u.bits.FunctionNumber = FunctionNumber; + + /* Get PCI config bytes */ + DataSize = HalGetBusData(PCIConfiguration, + BusNumber, + SlotNumber.u.AsULONG, + &PciConfig, + sizeof(ULONG)); + + /* There is nothing there */ + if (DataSize < sizeof(ULONG)) + return FALSE; + + if (PciConfig.VendorID == PCI_INVALID_VENDORID) + break; + + sprintf (VendorIdString, "%04hx", PciConfig.VendorID); + sprintf (DeviceIdString, "%04hx", PciConfig.DeviceID); + + if (_strnicmp(VendorIdString, HwInitializationData->VendorId, HwInitializationData->VendorIdLength) || + _strnicmp(DeviceIdString, HwInitializationData->DeviceId, HwInitializationData->DeviceIdLength)) + { + /* It is not our device */ + continue; + } + + DPRINT("Found device 0x%04hx 0x%04hx at %1lu %2lu %1lu\n", + PciConfig.VendorID, + PciConfig.DeviceID, + BusNumber, + SlotNumber.u.bits.DeviceNumber, + SlotNumber.u.bits.FunctionNumber); + + + RtlInitUnicodeString(&UnicodeStr, L"ScsiAdapter"); + Status = HalAssignSlotResources(RegistryPath, + &UnicodeStr, + DriverObject, + DeviceObject, + PCIBus, + BusNumber, + SlotNumber.u.AsULONG, + &ResourceList); + + if (!NT_SUCCESS(Status)) + break; + + /* Create configuration information */ + SpiResourceToConfig(HwInitializationData, + ResourceList->List, + PortConfig); + + /* Free the resource list */ + ExFreePool(ResourceList); + + /* Set dev & fn numbers */ + NextSlotNumber->u.bits.DeviceNumber = DeviceNumber; + NextSlotNumber->u.bits.FunctionNumber = FunctionNumber + 1; + + /* Save the slot number */ + PortConfig->SlotNumber = SlotNumber.u.AsULONG; + + return TRUE; + } NextSlotNumber->u.bits.FunctionNumber = 0; } - DPRINT ("No device found\n"); - - return FALSE; + NextSlotNumber->u.bits.DeviceNumber = 0; + DPRINT ("No device found\n"); + + return FALSE; }
17 years, 8 months
1
0
0
0
[fireball] 26210: - Revert useless commit: * No need to copy stuff from DDK, it's prohibited (#define _INC_NEWDEV) * #pragma was put there especially, and no reason to remove it was said * pushpack / poppack does not do anything if there are no structs definitions
by fireball@svn.reactos.org
Author: fireball Date: Fri Mar 30 19:39:27 2007 New Revision: 26210 URL:
http://svn.reactos.org/svn/reactos?rev=26210&view=rev
Log: - Revert useless commit: * No need to copy stuff from DDK, it's prohibited (#define _INC_NEWDEV) * #pragma was put there especially, and no reason to remove it was said * pushpack / poppack does not do anything if there are no structs definitions Modified: trunk/reactos/include/ddk/newdev.h Modified: trunk/reactos/include/ddk/newdev.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/newdev.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/newdev.h (original) +++ trunk/reactos/include/ddk/newdev.h Fri Mar 30 19:39:27 2007 @@ -20,10 +20,13 @@ * */ -#ifndef _INC_NEWDEV -#define _INC_NEWDEV +#ifndef __NEWDEV_H +#define __NEWDEV_H -#include <pshpack1.h> +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + #ifdef __cplusplus extern "C" { #endif @@ -41,8 +44,6 @@ LPCSTR FullInfPath, DWORD InstallFlags, PBOOL bRebootRequired OPTIONAL); - - BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW( @@ -62,6 +63,4 @@ } #endif -#include <poppack.h> - #endif /* __NEWDEV_H */
17 years, 8 months
1
0
0
0
[greatlrd] 26209: more compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Fri Mar 30 19:32:34 2007 New Revision: 26209 URL:
http://svn.reactos.org/svn/reactos?rev=26209&view=rev
Log: more compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/nettypes.h (with props) Added: trunk/reactos/include/ddk/nettypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/nettypes.h?rev…
============================================================================== --- trunk/reactos/include/ddk/nettypes.h (added) +++ trunk/reactos/include/ddk/nettypes.h Fri Mar 30 19:32:34 2007 @@ -1,0 +1,32 @@ + +#ifndef _NETTYPES_ +#define _NETTYPES_ + +#define HARDWARE_ADDRESS_LENGTH 6 +#define NETMAN_VARTYPE_ULONG 0 +#define NETMAN_VARTYPE_HARDWARE_ADDRESS 1 +#define NETMAN_VARTYPE_STRING 2 + + +typedef ULONG OFFSET; + +typedef struct _FLAT_STRING +{ + SHORT MaximumLength; + SHORT Length; + char Buffer [1]; +} FLAT_STRING, *PFLAT_STRING; + + +typedef struct _NETWORK_NAME +{ + FLAT_STRING Name; +} NETWORK_NAME, *PNETWORK_NAME; + +typedef struct _HARDWARE_ADDRESS +{ + UCHAR Address [HARDWARE_ADDRESS_LENGTH]; +} HARDWARE_ADDRESS, *PHARDWARE_ADDRESS; + +#endif + Propchange: trunk/reactos/include/ddk/nettypes.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[greatlrd] 26208: moref compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Fri Mar 30 19:24:03 2007 New Revision: 26208 URL:
http://svn.reactos.org/svn/reactos?rev=26208&view=rev
Log: moref compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/amtvuids.h (with props) Added: trunk/reactos/include/ddk/amtvuids.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/amtvuids.h?rev…
============================================================================== --- trunk/reactos/include/ddk/amtvuids.h (added) +++ trunk/reactos/include/ddk/amtvuids.h Fri Mar 30 19:24:03 2007 @@ -1,0 +1,15 @@ + +#ifndef OUR_GUID_ENTRY +#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ +DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8); +#endif + +OUR_GUID_ENTRY(CLSID_CTVTunerFilter, 0x266EEE40, 0x6C63, 0x11CF, 0x8A, 0x3, 0x0, 0xAA, 0x0, 0x6E, 0xCB, 0x65); +OUR_GUID_ENTRY(CLSID_CTVTunerFilterPropertyPage, 0x266EEE41, 0x6C63, 0x11CF, 0x8A, 0x3, 0x0, 0xAA, 0x0, 0x6E, 0xCB, 0x65); +OUR_GUID_ENTRY(IID_AnalogVideoStandard, 0x266EEE44, 0x6C63, 0x11CF, 0x8A, 0x3, 0x0, 0xAA, 0x0, 0x6E, 0xCB, 0x65); +OUR_GUID_ENTRY(IID_TunerInputType, 0x266EEE46, 0x6C63, 0x11CF, 0x8A, 0x3, 0x0, 0xAA, 0x0, 0x6E, 0xCB, 0x65); +OUR_GUID_ENTRY(CLSID_CrossbarFilter, 0x71F96460, 0x78F3, 0x11D0, 0xA1, 0x8C, 0x0, 0xA0, 0xC9, 0x11, 0x89, 0x56); +OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage, 0x71F96461, 0x78F3, 0x11D0, 0xA1, 0x8C, 0x0, 0xA0, 0xC9, 0x11, 0x89, 0x56); +OUR_GUID_ENTRY(CLSID_TVAudioFilter, 0x71F96462, 0x78F3, 0x11D0, 0xA1, 0x8C, 0x0, 0xA0, 0xC9, 0x11, 0x89, 0x56); +OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage, 0x71F96463, 0x78F3, 0x11D0, 0xA1, 0x8C, 0x0, 0xA0, 0xC9, 0x11, 0x89, 0x56); + Propchange: trunk/reactos/include/ddk/amtvuids.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[greatlrd] 26207: moref compatible fix betwin reactos ddk and ms DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Fri Mar 30 19:13:14 2007 New Revision: 26207 URL:
http://svn.reactos.org/svn/reactos?rev=26207&view=rev
Log: moref compatible fix betwin reactos ddk and ms DDK version 3790.1830 Added: trunk/reactos/include/ddk/ntdd1934.h (with props) trunk/reactos/include/ddk/oprghdlr.h (with props) trunk/reactos/include/ddk/stireg.h (with props) Modified: trunk/reactos/include/ddk/d4iface.h Modified: trunk/reactos/include/ddk/d4iface.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/d4iface.h?rev=…
============================================================================== --- trunk/reactos/include/ddk/d4iface.h (original) +++ trunk/reactos/include/ddk/d4iface.h Fri Mar 30 19:13:14 2007 @@ -1,82 +1,47 @@ -/* - * d4iface.h - * - * DOT4 interface - * - * This file is part of the w32api package. - * - * Contributors: - * Created by Casper S. Hornstrup <chorns(a)users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef __D4IFACE_H -#define __D4IFACE_H - -#if __GNUC__ >=3 -#pragma GCC system_header -#endif +#ifndef _DOT4_IFACE_H +#define _DOT4_IFACE_H #ifdef __cplusplus extern "C" { #endif -#define DOT4_MAX_CHANNELS 128 -#define NO_TIMEOUT 0 +typedef unsigned long CHANNEL_HANDLE; +typedef CHANNEL_HANDLE *PCHANNEL_HANDLE; -#define DOT4_CHANNEL 0 -#define HP_MESSAGE_PROCESSOR 1 -#define PRINTER_CHANNEL 2 -#define SCANNER_CHANNEL 4 -#define MIO_COMMAND_PROCESSOR 5 -#define ECHO_CHANNEL 6 -#define FAX_SEND_CHANNEL 7 -#define FAX_RECV_CHANNEL 8 -#define DIAGNOSTIC_CHANNEL 9 -#define HP_RESERVED 10 -#define IMAGE_DOWNLOAD 11 -#define HOST_DATASTORE_UPLOAD 12 -#define HOST_DATASTORE_DOWNLOAD 13 -#define CONFIG_UPLOAD 14 -#define CONFIG_DOWNLOAD 15 - -#define STREAM_TYPE_CHANNEL 1 -#define PACKET_TYPE_CHANNEL 2 - -/* DOT4_ACTIVITY.ulMessage flags */ -#define DOT4_STREAM_RECEIVED 0x100 -#define DOT4_STREAM_CREDITS 0x101 -#define DOT4_MESSAGE_RECEIVED 0x102 -#define DOT4_DISCONNECT 0x103 -#define DOT4_CHANNEL_CLOSED 0x105 - -typedef unsigned long CHANNEL_HANDLE, *PCHANNEL_HANDLE; - -typedef struct _DOT4_ACTIVITY { - ULONG ulMessage; - ULONG ulByteCount; - CHANNEL_HANDLE hChannel; +typedef struct _DOT4_ACTIVITY +{ + ULONG ulMessage; + ULONG ulByteCount; + CHANNEL_HANDLE hChannel; } DOT4_ACTIVITY, *PDOT4_ACTIVITY; -typedef struct _DOT4_WMI_XFER_INFO { - ULONG ulStreamBytesWritten; - ULONG ulStreamBytesRead; - ULONG ulPacketBytesWritten; - ULONG ulPacketBytesRead; -} DOT4_WMI_XFER_INFO, *PDOT4_WMI_XFER_INFO; +#define DOT4_MAX_CHANNELS 128 +#define NO_TIMEOUT 0 +#define STREAM_TYPE_CHANNEL 1 +#define PACKET_TYPE_CHANNEL 2 +#define DOT4_STREAM_RECEIVED 0x100 +#define DOT4_STREAM_CREDITS 0x101 +#define DOT4_MESSAGE_RECEIVED 0x102 +#define DOT4_DISCONNECT 0x103 +#define DOT4_CHANNEL_CLOSED 0x105 +#define DOT4_CHANNEL 0 +#define HP_MESSAGE_PROCESSOR 1 +#define PRINTER_CHANNEL 2 +#define SCANNER_CHANNEL 4 +#define MIO_COMMAND_PROCESSOR 5 +#define ECHO_CHANNEL 6 +#define FAX_SEND_CHANNEL 7 +#define FAX_RECV_CHANNEL 8 +#define DIAGNOSTIC_CHANNEL 9 +#define HP_RESERVED 10 +#define IMAGE_DOWNLOAD 11 +#define HOST_DATASTORE_UPLOAD 12 +#define HOST_DATASTORE_DOWNLOAD 13 +#define CONFIG_UPLOAD 14 +#define CONFIG_DOWNLOAD 15 #ifdef __cplusplus } #endif +#endif -#endif /* __D4IFACE_H */ Added: trunk/reactos/include/ddk/ntdd1934.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntdd1934.h?rev…
============================================================================== --- trunk/reactos/include/ddk/ntdd1934.h (added) +++ trunk/reactos/include/ddk/ntdd1934.h Fri Mar 30 19:13:14 2007 @@ -1,0 +1,47 @@ + +#ifndef _NTDD1394_H_ +#define _NTDD1394_H_ + +#if (_MSC_VER >= 1020) +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _IEEE1394_VDEV_PNP_REQUEST +{ + ULONG fulFlags; + ULONG Reserved; + ULARGE_INTEGER InstanceId; + UCHAR DeviceId; +} IEEE1394_VDEV_PNP_REQUEST,*PIEEE1394_VDEV_PNP_REQUEST; + + +typedef struct _IEEE1394_API_REQUEST +{ + ULONG RequestNumber; + ULONG Flags; + union + { + IEEE1394_VDEV_PNP_REQUEST AddVirtualDevice; + IEEE1394_VDEV_PNP_REQUEST RemoveVirtualDevice; + } u; +} IEEE1394_API_REQUEST, *PIEEE1394_API_REQUEST; + +#define IEEE1394_API_ADD_VIRTUAL_DEVICE 0x00000001 +#define IEEE1394_API_REMOVE_VIRTUAL_DEVICE 0x00000002 +#define IEEE1394_REQUEST_FLAG_UNICODE 0x00000001 +#define IEEE1394_REQUEST_FLAG_PERSISTENT 0x00000002 +#define IEEE1394_REQUEST_FLAG_USE_LOCAL_HOST_EUI 0x00000004 +#define BUS1394_VIRTUAL_DEVICE_LIST_KEY L"Virtual Device List" +#define BUS1394_LOCAL_HOST_INSTANCE_KEY L"LOCAL HOST EUI64" +#define IOCTL_IEEE1394_API_REQUEST CTL_CODE(FILE_DEVICE_UNKNOWN, 0x100, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#ifdef __cplusplus +} +#endif + +#endif + Propchange: trunk/reactos/include/ddk/ntdd1934.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/ddk/oprghdlr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/oprghdlr.h?rev…
============================================================================== --- trunk/reactos/include/ddk/oprghdlr.h (added) +++ trunk/reactos/include/ddk/oprghdlr.h Fri Mar 30 19:13:14 2007 @@ -1,0 +1,43 @@ +#include "wdm.h" + +#ifdef EXPORT + #undef EXPORT +#endif +#define EXPORT __cdecl + + +typedef VOID (EXPORT *PACPI_OP_REGION_CALLBACK)(); + +typedef +NTSTATUS +(EXPORT *PACPI_OP_REGION_HANDLER) (ULONG AccessType, + PVOID OperationRegionObject, + ULONG Address, + ULONG Size, + PULONG Data, + ULONG_PTR Context, + PACPI_OP_REGION_CALLBACK CompletionHandler, + PVOID CompletionContext); + +NTSTATUS +RegisterOpRegionHandler (IN PDEVICE_OBJECT DeviceObject, + IN ULONG AccessType, + IN ULONG RegionSpace, + IN PACPI_OP_REGION_HANDLER Handler, + IN PVOID Context, IN ULONG Flags, + IN OUT PVOID *OperationRegionObject); + +NTSTATUS +DeRegisterOpRegionHandler (IN PDEVICE_OBJECT DeviceObject, + IN PVOID OperationRegionObject); + +#define ACPI_OPREGION_ACCESS_AS_RAW 0x1 +#define ACPI_OPREGION_ACCESS_AS_COOKED 0x2 +#define ACPI_OPREGION_REGION_SPACE_MEMORY 0x0 +#define ACPI_OPREGION_REGION_SPACE_IO 0x1 +#define ACPI_OPREGION_REGION_SPACE_PCI_CONFIG 0x2 +#define ACPI_OPREGION_REGION_SPACE_EC 0x3 +#define ACPI_OPREGION_REGION_SPACE_SMB 0x4 +#define ACPI_OPREGION_READ 0x0 +#define ACPI_OPREGION_WRITE 0x1 +#define ACPI_OPREGION_ACCESS_AT_HIGH_LEVEL 0x1 Propchange: trunk/reactos/include/ddk/oprghdlr.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/include/ddk/stireg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/stireg.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/stireg.h (added) +++ trunk/reactos/include/ddk/stireg.h Fri Mar 30 19:13:14 2007 @@ -1,0 +1,39 @@ +#ifndef _STIREG_ +#define _STIREG_ +#define REGSTR_VAL_TYPE_W L"Type" +#define REGSTR_VAL_VENDOR_NAME_W L"Vendor" +#define REGSTR_VAL_DEVICETYPE_W L"DeviceType" +#define REGSTR_VAL_DEVICESUBTYPE_W L"DeviceSubType" +#define REGSTR_VAL_DEV_NAME_W L"DeviceName" +#define REGSTR_VAL_DRIVER_DESC_W L"DriverDesc" +#define REGSTR_VAL_FRIENDLY_NAME_W L"FriendlyName" +#define REGSTR_VAL_GENERIC_CAPS_W L"Capabilities" +#define REGSTR_VAL_HARDWARE_W L"HardwareConfig" +#define REGSTR_VAL_HARDWARE TEXT("HardwareConfig") +#define REGSTR_VAL_DEVICE_NAME_W L"DriverDesc" +#define REGSTR_VAL_DATA_W L"DeviceData" +#define REGSTR_VAL_GUID_W L"GUID" +#define REGSTR_VAL_GUID TEXT("GUID") +#define REGSTR_VAL_LAUNCH_APPS_W L"LaunchApplications" +#define REGSTR_VAL_LAUNCH_APPS TEXT("LaunchApplications") +#define REGSTR_VAL_LAUNCHABLE_W L"Launchable" +#define REGSTR_VAL_LAUNCHABLE TEXT("Launchable") +#define IS_DIGITAL_CAMERA_STR L"IsDigitalCamera" +#define IS_DIGITAL_CAMERA_VAL 1 +#define SUPPORTS_MSCPLUS_STR L"SupportsMSCPlus" +#define SUPPORTS_MSCPLUS_VAL 1 +#define STI_DEVICE_VALUE_TWAIN_NAME L"TwainDS" +#define STI_DEVICE_VALUE_ISIS_NAME L"ISISDriverName" +#define STI_DEVICE_VALUE_ICM_PROFILE L"ICMProfile" +#define STI_DEVICE_VALUE_DEFAULT_LAUNCHAPP L"DefaultLaunchApp" +#define STI_DEVICE_VALUE_TIMEOUT L"PollTimeout" +#define STI_DEVICE_VALUE_DISABLE_NOTIFICATIONS L"DisableNotifications" +#define REGSTR_VAL_BAUDRATE L"BaudRate" +#define STI_DEVICE_VALUE_TWAIN_NAME_A "TwainDS" +#define STI_DEVICE_VALUE_ISIS_NAME_A "ISISDriverName" +#define STI_DEVICE_VALUE_ICM_PROFILE_A "ICMProfile" +#define STI_DEVICE_VALUE_DEFAULT_LAUNCHAPP_A "DefaultLaunchApp" +#define STI_DEVICE_VALUE_TIMEOUT_A "PollTimeout" +#define STI_DEVICE_VALUE_DISABLE_NOTIFICATIONS_A "DisableNotifications" +#define REGSTR_VAL_BAUDRATE_A "BaudRate" +#endif Propchange: trunk/reactos/include/ddk/stireg.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[greatlrd] 26206: fixing usb.h compatible with DDK version 3790.1830 adding usb200.h compatible with DDK version 3790.1830
by greatlrd@svn.reactos.org
Author: greatlrd Date: Fri Mar 30 18:50:01 2007 New Revision: 26206 URL:
http://svn.reactos.org/svn/reactos?rev=26206&view=rev
Log: fixing usb.h compatible with DDK version 3790.1830 adding usb200.h compatible with DDK version 3790.1830 Added: trunk/reactos/include/ddk/usb200.h (with props) Modified: trunk/reactos/include/ddk/usb.h Modified: trunk/reactos/include/ddk/usb.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usb.h?rev=2620…
============================================================================== --- trunk/reactos/include/ddk/usb.h (original) +++ trunk/reactos/include/ddk/usb.h Fri Mar 30 18:50:01 2007 @@ -1,470 +1,502 @@ -/* - * usb.h - * - * USB support. - * - * This file is part of the w32api package. - * - * Contributors: - * Created by Casper S. Hornstrup <chorns(a)users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef __USB_H -#define __USB_H - -#if __GNUC__ >=3 -#pragma GCC system_header + + +#ifndef __USB_H__ +#define __USB_H__ + +#ifdef __USBDI_H__ +error #endif -#ifdef __USBDI_H -#error usbdi.h cannot be included with usb.h -#else - -#include "usb100.h" - -#ifdef __cplusplus -extern "C" { +#ifdef OSR21_COMPAT +#pragma message("WARNING: OSR21_COMPAT SWITCH NOT SUPPORTED") #endif + +#ifndef _NTDDK_ +#ifndef _WDMDDK_ +typedef PVOID PIRP; +typedef PVOID PMDL; +#endif +#endif + +#define USBDI_VERSION 0x00000500 + +#include "usb200.h" typedef LONG USBD_STATUS; typedef PVOID USBD_PIPE_HANDLE; typedef PVOID USBD_CONFIGURATION_HANDLE; typedef PVOID USBD_INTERFACE_HANDLE; -#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) -#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) -#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) -#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) -#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) -#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) -#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) -#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) -#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) -#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) -#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) -#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) -#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) -#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) -#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) -#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) -#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) -#define USBD_STATUS_XACT_ERROR ((USBD_STATUS)0xC0000011L) -#define USBD_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000012L) -#define USBD_STATUS_DATA_BUFFER_ERROR ((USBD_STATUS)0xC0000013L) -#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) -#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) -#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) -#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) -#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) -#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) -#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) -#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) -#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) -#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) -#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) -#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED \ - ((USBD_STATUS)0xC0000D00L) -#define USBD_STATUS_NOT_SUPPORTED ((USBD_STATUS)0xC0000E00L) -#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \ - ((USBD_STATUS)0xC0000F00L) -#define USBD_STATUS_INSUFFICIENT_RESOURCES \ - ((USBD_STATUS)0xC0001000L) -#define USBD_STATUS_SET_CONFIG_FAILED ((USBD_STATUS)0xC0002000L) -#define USBD_STATUS_BUFFER_TOO_SMALL ((USBD_STATUS)0xC0003000L) -#define USBD_STATUS_INTERFACE_NOT_FOUND ((USBD_STATUS)0xC0004000L) -#define USBD_STATUS_INAVLID_PIPE_FLAGS ((USBD_STATUS)0xC0005000L) -#define USBD_STATUS_TIMEOUT ((USBD_STATUS)0xC0006000L) -#define USBD_STATUS_DEVICE_GONE ((USBD_STATUS)0xC0007000L) -#define USBD_STATUS_STATUS_NOT_MAPPED ((USBD_STATUS)0xC0008000L) -#define USBD_STATUS_CANCELED ((USBD_STATUS)0xC0010000L) -#define USBD_STATUS_ISO_NOT_ACCESSED_BY_HW \ - ((USBD_STATUS)0xC0020000L) -#define USBD_STATUS_ISO_TD_ERROR ((USBD_STATUS)0xC0030000L) -#define USBD_STATUS_ISO_NA_LATE_USBPORT ((USBD_STATUS)0xC0040000L) -#define USBD_STATUS_ISO_NOT_ACCESSED_LATE ((USBD_STATUS)0xC0050000L) - -#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) -#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) -#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) - -/* URB TransferFlags constants */ -#define USBD_TRANSFER_DIRECTION(x) ((x) & USBD_TRANSFER_DIRECTION_IN) -#define USBD_TRANSFER_DIRECTION_OUT 0 -#define USBD_TRANSFER_DIRECTION_BIT 0 -#define USBD_TRANSFER_DIRECTION_IN (1 << USBD_TRANSFER_DIRECTION_BIT) -#define USBD_SHORT_TRANSFER_OK_BIT 1 -#define USBD_SHORT_TRANSFER_OK (1 << USBD_SHORT_TRANSFER_OK_BIT) -#define USBD_START_ISO_TRANSFER_ASAP_BIT 2 -#define USBD_START_ISO_TRANSFER_ASAP (1 << USBD_START_ISO_TRANSFER_ASAP_BIT) -#define USBD_DEFAULT_PIPE_TRANSFER_BIT 3 -#define USBD_DEFAULT_PIPE_TRANSFER (1 << USBD_DEFAULT_PIPE_TRANSFER_BIT) - -#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) - -#define VALID_TRANSFER_FLAGS_MASK \ - (USBD_SHORT_TRANSFER_OK | \ - USBD_TRANSFER_DIRECTION | \ - USBD_START_ISO_TRANSFER_ASAP | \ - USBD_DEFAULT_PIPE_TRANSFER) - -#define USB_DEFAULT_DEVICE_ADDRESS 0 -#define USB_DEFAULT_ENDPOINT_ADDRESS 0 -#define USB_DEFAULT_MAX_PACKET 64 -#define USBD_ISO_START_FRAME_RANGE 1024 -#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF - -typedef enum _USB_CONTROLLER_FLAVOR { - USB_HcGeneric = 0, - OHCI_Generic = 100, - OHCI_Hydra, - OHCI_NEC, - UHCI_Generic = 200, - UHCI_Piix4, - UHCI_Piix3, - UHCI_Ich2_1, - UHCI_Ich2_2, - UHCI_Ich1, - UHCI_VIA = 250, - EHCI_Generic = 1000, - EHCI_NEC = 2000, - EHCI_Lucent = 3000 +typedef enum _USB_CONTROLLER_FLAVOR +{ + USB_HcGeneric = 0, + OHCI_Generic = 100, + OHCI_Hydra, + OHCI_NEC, + UHCI_Generic = 200, + UHCI_Piix4, + UHCI_Piix3, + UHCI_Ich2_1, + UHCI_Ich2_2, + UHCI_Ich1, + UHCI_VIA = 250, + EHCI_Generic = 1000, + EHCI_NEC = 2000, + EHCI_Lucent = 3000 } USB_CONTROLLER_FLAVOR; -struct _URB_HEADER { - USHORT Length; - USHORT Function; - USBD_STATUS Status; - PVOID UsbdDeviceHandle; - ULONG UsbdFlags; -}; - -typedef struct _USBD_VERSION_INFORMATION { - ULONG USBDI_Version; - ULONG Supported_USB_Version; +typedef enum _USBD_PIPE_TYPE +{ + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt +} USBD_PIPE_TYPE; + +typedef struct _USBD_VERSION_INFORMATION +{ + ULONG USBDI_Version; + ULONG Supported_USB_Version; } USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; -struct _URB_HCD_AREA { - PVOID Reserved8[8]; -}; - -struct _URB_BULK_OR_INTERRUPT_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; -}; - -struct _URB_CONTROL_DESCRIPTOR_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved1; - UCHAR Index; - UCHAR DescriptorType; - USHORT LanguageId; - USHORT Reserved2; -}; - -struct _URB_CONTROL_FEATURE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved2; - ULONG Reserved3; - PVOID Reserved4; - PMDL Reserved5; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved0; - USHORT FeatureSelector; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[8]; -}; - -struct _URB_CONTROL_GET_INTERFACE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Interface; - USHORT Reserved2; -}; - -struct _URB_CONTROL_GET_STATUS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Index; - USHORT Reserved2; -}; - -struct _URB_CONTROL_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR SetupPacket[8]; -}; - -struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR RequestTypeReservedBits; - UCHAR Request; - USHORT Value; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_FRAME_LENGTH_CONTROL { - struct _URB_HEADER Hdr; -}; - -struct _URB_GET_CURRENT_FRAME_NUMBER { - struct _URB_HEADER Hdr; - ULONG FrameNumber; -}; - -struct _URB_GET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - ULONG FrameLength; - ULONG FrameNumber; -}; - -typedef struct _USBD_ISO_PACKET_DESCRIPTOR { - ULONG Offset; - ULONG Length; - USBD_STATUS Status; -} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; - -struct _URB_ISOCH_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - ULONG StartFrame; - ULONG NumberOfPackets; - ULONG ErrorCount; - USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; -}; - -typedef enum _USBD_PIPE_TYPE { - UsbdPipeTypeControl, - UsbdPipeTypeIsochronous, - UsbdPipeTypeBulk, - UsbdPipeTypeInterrupt -} USBD_PIPE_TYPE; - -typedef struct _USBD_PIPE_INFORMATION { - USHORT MaximumPacketSize; - UCHAR EndpointAddress; - UCHAR Interval; - USBD_PIPE_TYPE PipeType; - USBD_PIPE_HANDLE PipeHandle; - ULONG MaximumTransferSize; - ULONG PipeFlags; -} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION ; - -#define USBD_PIPE_DIRECTION_IN(pipeInformation) \ - ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) - -typedef struct _USBD_INTERFACE_INFORMATION { - USHORT Length; - UCHAR InterfaceNumber; - UCHAR AlternateSetting; - UCHAR Class; - UCHAR SubClass; - UCHAR Protocol; - UCHAR Reserved; - USBD_INTERFACE_HANDLE InterfaceHandle; - ULONG NumberOfPipes; +typedef struct _USBD_PIPE_INFORMATION +{ + USHORT MaximumPacketSize; + UCHAR EndpointAddress; + UCHAR Interval; + USBD_PIPE_TYPE PipeType; + USBD_PIPE_HANDLE PipeHandle; + ULONG MaximumTransferSize; + ULONG PipeFlags; +} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; + +typedef struct _USBD_DEVICE_INFORMATION +{ + ULONG OffsetNext; + PVOID UsbdDeviceHandle; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; +} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; + +typedef struct _USBD_INTERFACE_INFORMATION +{ + USHORT Length; + UCHAR InterfaceNumber; + UCHAR AlternateSetting; + UCHAR Class; + UCHAR SubClass; + UCHAR Protocol; + UCHAR Reserved; + USBD_INTERFACE_HANDLE InterfaceHandle; + ULONG NumberOfPipes; USBD_PIPE_INFORMATION Pipes[1]; } USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; -struct _URB_SELECT_INTERFACE { - struct _URB_HEADER Hdr; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_SELECT_CONFIGURATION { - struct _URB_HEADER Hdr; - PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_PIPE_REQUEST { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG Reserved; -}; - -struct _URB_SET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - LONG FrameLengthDelta; -}; - -typedef struct _URB { - _ANONYMOUS_UNION union { - struct _URB_HEADER UrbHeader; - struct _URB_SELECT_INTERFACE UrbSelectInterface; - struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; - struct _URB_PIPE_REQUEST UrbPipeRequest; - struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; - struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; - struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; - struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; - struct _URB_CONTROL_TRANSFER UrbControlTransfer; - struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; - struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; - struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; - struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; - struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; - struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; - struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; - struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; - } DUMMYUNIONNAME; +struct _URB_HCD_AREA +{ + PVOID Reserved8[8]; +}; + +struct _URB_HEADER +{ + USHORT Length; + USHORT Function; + USBD_STATUS Status; + PVOID UsbdDeviceHandle; + ULONG UsbdFlags; +}; + +struct _URB_SELECT_INTERFACE +{ + struct _URB_HEADER Hdr; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_SELECT_CONFIGURATION +{ + struct _URB_HEADER Hdr; + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_PIPE_REQUEST +{ + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG Reserved; +}; + +struct _URB_FRAME_LENGTH_CONTROL +{ + struct _URB_HEADER Hdr; +}; + +struct _URB_GET_FRAME_LENGTH +{ + struct _URB_HEADER Hdr; + ULONG FrameLength; + ULONG FrameNumber; +}; + +struct _URB_SET_FRAME_LENGTH +{ + struct _URB_HEADER Hdr; + LONG FrameLengthDelta; +}; + +struct _URB_GET_CURRENT_FRAME_NUMBER +{ + struct _URB_HEADER Hdr; + ULONG FrameNumber; +}; + +struct _URB_CONTROL_DESCRIPTOR_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved1; + UCHAR Index; + UCHAR DescriptorType; + USHORT LanguageId; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_STATUS_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Index; + USHORT Reserved2; +}; + +struct _URB_CONTROL_FEATURE_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved2; + ULONG Reserved3; + PVOID Reserved4; + PMDL Reserved5; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved0; + USHORT FeatureSelector; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR RequestTypeReservedBits; + UCHAR Request; + USHORT Value; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_GET_INTERFACE_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Interface; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_CONFIGURATION_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[8]; +}; + +typedef struct _OS_STRING +{ + UCHAR bLength; + UCHAR bDescriptorType; + WCHAR MicrosoftString[7]; + UCHAR bVendorCode; + UCHAR bPad; +} OS_STRING, *POS_STRING; + + +struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST +{ + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Recipient:5; + UCHAR Reserved1:3; + UCHAR Reserved2; + UCHAR InterfaceNumber; + UCHAR MS_PageIndex; + USHORT MS_FeatureDescriptorIndex; + USHORT Reserved3; +}; + +struct _URB_CONTROL_TRANSFER +{ + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR SetupPacket[8]; +}; + +struct _URB_BULK_OR_INTERRUPT_TRANSFER +{ + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; +}; + +typedef struct _USBD_ISO_PACKET_DESCRIPTOR +{ + ULONG Offset; + ULONG Length; + USBD_STATUS Status; +} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; + +struct _URB_ISOCH_TRANSFER +{ + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + ULONG StartFrame; + ULONG NumberOfPackets; + ULONG ErrorCount; + USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; +}; + +typedef struct _URB +{ + union + { + struct _URB_HEADER + UrbHeader; + struct _URB_SELECT_INTERFACE + UrbSelectInterface; + struct _URB_SELECT_CONFIGURATION + UrbSelectConfiguration; + struct _URB_PIPE_REQUEST + UrbPipeRequest; + struct _URB_FRAME_LENGTH_CONTROL + UrbFrameLengthControl; + struct _URB_GET_FRAME_LENGTH + UrbGetFrameLength; + struct _URB_SET_FRAME_LENGTH + UrbSetFrameLength; + struct _URB_GET_CURRENT_FRAME_NUMBER + UrbGetCurrentFrameNumber; + struct _URB_CONTROL_TRANSFER + UrbControlTransfer; + struct _URB_BULK_OR_INTERRUPT_TRANSFER + UrbBulkOrInterruptTransfer; + struct _URB_ISOCH_TRANSFER + UrbIsochronousTransfer; + struct _URB_CONTROL_DESCRIPTOR_REQUEST + UrbControlDescriptorRequest; + struct _URB_CONTROL_GET_STATUS_REQUEST + UrbControlGetStatusRequest; + struct _URB_CONTROL_FEATURE_REQUEST + UrbControlFeatureRequest; + struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST + UrbControlVendorClassRequest; + struct _URB_CONTROL_GET_INTERFACE_REQUEST + UrbControlGetInterfaceRequest; + struct _URB_CONTROL_GET_CONFIGURATION_REQUEST + UrbControlGetConfigurationRequest; + struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST + UrbOSFeatureDescriptorRequest; + }; } URB, *PURB; -#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) - -#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 -#define URB_FUNCTION_SELECT_INTERFACE 0x0001 -#define URB_FUNCTION_ABORT_PIPE 0x0002 -#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 -#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 -#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 -#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 -#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 -#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 -#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 -#define URB_FUNCTION_ISOCH_TRANSFER 0x000A -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B -#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C -#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D -#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E -#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F -#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 -#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 -#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 -#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 -#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 -#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 -#define URB_FUNCTION_RESERVED_0X0016 0x0016 -#define URB_FUNCTION_VENDOR_DEVICE 0x0017 -#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 -#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 -#define URB_FUNCTION_CLASS_DEVICE 0x001A -#define URB_FUNCTION_CLASS_INTERFACE 0x001B -#define URB_FUNCTION_CLASS_ENDPOINT 0x001C -#define URB_FUNCTION_RESERVE_0X001D 0x001D -#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E -#define URB_FUNCTION_CLASS_OTHER 0x001F -#define URB_FUNCTION_VENDOR_OTHER 0x0020 -#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 -#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 -#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 -#define URB_FUNCTION_GET_CONFIGURATION 0x0026 -#define URB_FUNCTION_GET_INTERFACE 0x0027 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 -#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A -#define URB_FUNCTION_RESERVE_0X002B 0x002B -#define URB_FUNCTION_RESERVE_0X002C 0x002C -#define URB_FUNCTION_RESERVE_0X002D 0x002D -#define URB_FUNCTION_RESERVE_0X002E 0x002E -#define URB_FUNCTION_RESERVE_0X002F 0x002F -#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 -#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 - -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_SHORT_PACKET_OPT 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 - -#define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | \ - USBD_PF_SHORT_PACKET_OPT | \ - USBD_PF_ENABLE_RT_THREAD_ACCESS | \ - USBD_PF_MAP_ADD_TRANSFERS) - -#define OS_STRING_DESCRIPTOR_INDEX 0xEE - -#define MS_GENRE_DESCRIPTOR_INDEX 0x0001 -#define MS_POWER_DESCRIPTOR_INDEX 0x0002 - -#define MS_OS_STRING_SIGNATURE L"MSFT100" - -typedef struct _OS_STRING { - UCHAR bLength; - UCHAR bDescriptorType; - WCHAR MicrosoftString[7]; - UCHAR bVendorCode; - UCHAR bPad; -} OS_STRING, *POS_STRING; - -#ifdef __cplusplus -} -#endif - -#endif /* defined __USBDI_H */ +#define USB_PORTATTR_NO_CONNECTOR 0x00000001 +#define USB_PORTATTR_SHARED_USB2 0x00000002 +#define USB_PORTATTR_MINI_CONNECTOR 0x00000004 +#define USB_PORTATTR_OEM_CONNECTOR 0x00000008 +#define USB_PORTATTR_OWNED_BY_CC 0x01000000 +#define USB_PORTATTR_NO_OVERCURRENT_UI 0x02000000 +#define USB_DEFAULT_DEVICE_ADDRESS 0 +#define USB_DEFAULT_ENDPOINT_ADDRESS 0 +#define USB_DEFAULT_MAX_PACKET 64 +#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) +#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 +#define URB_FUNCTION_SELECT_INTERFACE 0x0001 +#define URB_FUNCTION_ABORT_PIPE 0x0002 +#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 +#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 +#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 +#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 +#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 +#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 +#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 +#define URB_FUNCTION_ISOCH_TRANSFER 0x000A +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B +#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C +#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D +#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E +#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F +#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 +#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 +#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 +#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 +#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 +#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 +#define URB_FUNCTION_RESERVED_0X0016 0x0016 +#define URB_FUNCTION_VENDOR_DEVICE 0x0017 +#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 +#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 +#define URB_FUNCTION_CLASS_DEVICE 0x001A +#define URB_FUNCTION_CLASS_INTERFACE 0x001B +#define URB_FUNCTION_CLASS_ENDPOINT 0x001C +#define URB_FUNCTION_RESERVE_0X001D 0x001D +#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E +#define URB_FUNCTION_CLASS_OTHER 0x001F +#define URB_FUNCTION_VENDOR_OTHER 0x0020 +#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 +#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 +#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 +#define URB_FUNCTION_GET_CONFIGURATION 0x0026 +#define URB_FUNCTION_GET_INTERFACE 0x0027 +#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 +#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 +#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A +#define URB_FUNCTION_RESERVE_0X002B 0x002B +#define URB_FUNCTION_RESERVE_0X002C 0x002C +#define URB_FUNCTION_RESERVE_0X002D 0x002D +#define URB_FUNCTION_RESERVE_0X002E 0x002E +#define URB_FUNCTION_RESERVE_0X002F 0x002F +#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030 +#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031 +#define URB_FUNCTION_RESET_PIPE URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL +#define USBD_TRANSFER_DIRECTION 0x00000001 +#define USBD_SHORT_TRANSFER_OK 0x00000002 +#define USBD_START_ISO_TRANSFER_ASAP 0x00000004 +#define USBD_DEFAULT_PIPE_TRANSFER 0x00000008 +#define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION) + +#define USBD_TRANSFER_DIRECTION_OUT 0 +#define USBD_TRANSFER_DIRECTION_IN 1 +#define VALID_TRANSFER_FLAGS_MASK (USBD_SHORT_TRANSFER_OK | USBD_TRANSFER_DIRECTION | \ + USBD_START_ISO_TRANSFER_ASAP | USBD_DEFAULT_PIPE_TRANSFER) +#define USBD_ISO_START_FRAME_RANGE 1024 +#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) +#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) +#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) +#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) +#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) +#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) +#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) +#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) +#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) +#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) +#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) +#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) +#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) +#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) +#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) +#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) +#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) +#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) +#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) +#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) +#define USBD_STATUS_XACT_ERROR ((USBD_STATUS)0xC0000011L) +#define USBD_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000012L) +#define USBD_STATUS_DATA_BUFFER_ERROR ((USBD_STATUS)0xC0000013L) +#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) +#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) +#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) +#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) +#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) +#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) +#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) +#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) +#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) +#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) +#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) +#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED ((USBD_STATUS)0xC0000D00L) +#define USBD_STATUS_NOT_SUPPORTED ((USBD_STATUS)0xC0000E00L) +#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR ((USBD_STATUS)0xC0000F00L) +#define USBD_STATUS_INSUFFICIENT_RESOURCES ((USBD_STATUS)0xC0001000L) +#define USBD_STATUS_SET_CONFIG_FAILED ((USBD_STATUS)0xC0002000L) +#define USBD_STATUS_BUFFER_TOO_SMALL ((USBD_STATUS)0xC0003000L) +#define USBD_STATUS_INTERFACE_NOT_FOUND ((USBD_STATUS)0xC0004000L) +#define USBD_STATUS_INAVLID_PIPE_FLAGS ((USBD_STATUS)0xC0005000L) +#define USBD_STATUS_TIMEOUT ((USBD_STATUS)0xC0006000L) +#define USBD_STATUS_DEVICE_GONE ((USBD_STATUS)0xC0007000L) +#define USBD_STATUS_STATUS_NOT_MAPPED ((USBD_STATUS)0xC0008000L) +#define USBD_STATUS_CANCELED ((USBD_STATUS)0xC0010000L) +#define USBD_STATUS_ISO_NOT_ACCESSED_BY_HW ((USBD_STATUS)0xC0020000L) +#define USBD_STATUS_ISO_TD_ERROR ((USBD_STATUS)0xC0030000L) +#define USBD_STATUS_ISO_NA_LATE_USBPORT ((USBD_STATUS)0xC0040000L) +#define USBD_STATUS_ISO_NOT_ACCESSED_LATE ((USBD_STATUS)0xC0050000L) +#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF +#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 +#define USBD_PF_SHORT_PACKET_OPT 0x00000002 +#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 +#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 +#define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_SHORT_PACKET_OPT | \ + USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS) +#define OS_STRING_DESCRIPTOR_INDEX 0xEE +#define MS_GENRE_DESCRIPTOR_INDEX 0x0001 +#define MS_POWER_DESCRIPTOR_INDEX 0x0002 +#define MS_OS_STRING_SIGNATURE L"MSFT100" +#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) #endif /* __USB_H */ Added: trunk/reactos/include/ddk/usb200.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usb200.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/usb200.h (added) +++ trunk/reactos/include/ddk/usb200.h Fri Mar 30 18:50:01 2007 @@ -1,0 +1,112 @@ +#ifndef __USB200_H__ +#define __USB200_H__ + +#include "usb100.h" + +#include <PSHPACK1.H> + + +typedef enum _USB_DEVICE_TYPE +{ + Usb11Device = 0, + Usb20Device +} USB_DEVICE_TYPE; + +typedef enum _USB_DEVICE_SPEED +{ + UsbLowSpeed = 0, + UsbFullSpeed, + UsbHighSpeed +} USB_DEVICE_SPEED; + +typedef union _BM_REQUEST_TYPE +{ + struct _BM + { + UCHAR Recipient:2; + UCHAR Reserved:3; + UCHAR Type:2; + UCHAR Dir:1; + }; + UCHAR B; +} BM_REQUEST_TYPE, *PBM_REQUEST_TYPE; + +typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET +{ + BM_REQUEST_TYPE bmRequestType; + UCHAR bRequest; + union _wValue + { + struct + { + UCHAR LowByte; + UCHAR HiByte; + }; + USHORT W; + } wValue; + union _wIndex + { + struct + { + UCHAR LowByte; + UCHAR HiByte; + }; + USHORT W; + } wIndex; + USHORT wLength; +} USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET; + + +C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8); + +typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR +{ + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdUSB; + UCHAR bDeviceClass; + UCHAR bDeviceSubClass; + UCHAR bDeviceProtocol; + UCHAR bMaxPacketSize0; + UCHAR bNumConfigurations; + UCHAR bReserved; +} USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR; + + +typedef union _USB_HIGH_SPEED_MAXPACKET +{ + struct _MP + { + USHORT MaxPacket:11; + USHORT HSmux:2; + USHORT Reserved:3; + }; + USHORT us; +} USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET; + +typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR +{ + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bFirstInterface; + UCHAR bInterfaceCount; + UCHAR bFunctionClass; + UCHAR bFunctionSubClass; + UCHAR bFunctionProtocol; + UCHAR iFunction; +} USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR; + +#define USB_PORT_STATUS_CONNECT 0x0001 +#define USB_PORT_STATUS_ENABLE 0x0002 +#define USB_PORT_STATUS_SUSPEND 0x0004 +#define USB_PORT_STATUS_OVER_CURRENT 0x0008 +#define USB_PORT_STATUS_RESET 0x0010 +#define USB_PORT_STATUS_POWER 0x0100 +#define USB_PORT_STATUS_LOW_SPEED 0x0200 +#define USB_PORT_STATUS_HIGH_SPEED 0x0400 +#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06 +#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B + +#include <POPPACK.H> + +#endif __USB200_H__ Propchange: trunk/reactos/include/ddk/usb200.h ------------------------------------------------------------------------------ svn:eol-style = native
17 years, 8 months
1
0
0
0
[fireball] 26205: - Start ScsiPortInitialize() refactoring: moving code to separate functions, adding support for various registry-defined options / tweaks (like DisableTaggedQueuing). - Fixed a bug with using wrong spinlock (IrpLock instead of SpinLock). - Doesn't fix anything yet, just makes work with the ScsiPortInitialize() more comfortable and initializing needed fields correctly. Also the "PortConfig" filling inside ScsiPortInitialize() will go away once it works fine in the standalone fun
by fireball@svn.reactos.org
Author: fireball Date: Fri Mar 30 17:17:06 2007 New Revision: 26205 URL:
http://svn.reactos.org/svn/reactos?rev=26205&view=rev
Log: - Start ScsiPortInitialize() refactoring: moving code to separate functions, adding support for various registry-defined options / tweaks (like DisableTaggedQueuing). - Fixed a bug with using wrong spinlock (IrpLock instead of SpinLock). - Doesn't fix anything yet, just makes work with the ScsiPortInitialize() more comfortable and initializing needed fields correctly. Also the "PortConfig" filling inside ScsiPortInitialize() will go away once it works fine in the standalone function. Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Fri Mar 30 17:17:06 2007 @@ -148,10 +148,42 @@ IN PSCSI_REQUEST_BLOCK_INFO SrbInfo, OUT PBOOLEAN NeedToCallStartIo); -VOID -STDCALL +VOID STDCALL SpiGetNextRequestFromLun(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, IN PSCSI_PORT_LUN_EXTENSION LunExtension); + +VOID STDCALL +SpiMiniportTimerDpc(IN struct _KDPC *Dpc, + IN PVOID DeviceObject, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2); + +static NTSTATUS +SpiCreatePortConfig(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PHW_INITIALIZATION_DATA HwInitData, + PCONFIGURATION_INFO InternalConfigInfo, + PPORT_CONFIGURATION_INFORMATION ConfigInfo, + BOOLEAN FirstCall); + +NTSTATUS STDCALL +SpQueryDeviceCallout(IN PVOID Context, + IN PUNICODE_STRING PathName, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN PKEY_VALUE_FULL_INFORMATION *BusInformation, + IN CONFIGURATION_TYPE ControllerType, + IN ULONG ControllerNumber, + IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + IN CONFIGURATION_TYPE PeripheralType, + IN ULONG PeripheralNumber, + IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); + +static VOID +SpiParseDeviceInfo(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + IN HANDLE Key, + IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, + IN PCONFIGURATION_INFO InternalConfigInfo, + IN PUCHAR Buffer); /* FUNCTIONS *****************************************************************/ @@ -181,8 +213,8 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { - DPRINT("ScsiPort Driver %s\n", VERSION); - return(STATUS_SUCCESS); + DPRINT("ScsiPort Driver %s\n", VERSION); + return(STATUS_SUCCESS); } @@ -625,6 +657,69 @@ return NULL; return (PVOID)((ULONG_PTR)DeviceExtension->VirtualAddress + Offset); +} + +static VOID +SpiInitOpenKeys(PCONFIGURATION_INFO ConfigInfo, PUNICODE_STRING RegistryPath) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + NTSTATUS Status; + + /* Open the service key */ + InitializeObjectAttributes(&ObjectAttributes, + RegistryPath, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = ZwOpenKey(&ConfigInfo->ServiceKey, + KEY_READ, + &ObjectAttributes); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Unable to open driver's registry key %ws, status 0x%08x\n", RegistryPath, Status); + ConfigInfo->ServiceKey = NULL; + } + + /* If we could open driver's service key, then proceed to the Parameters key */ + if (ConfigInfo->ServiceKey != NULL) + { + RtlInitUnicodeString(&KeyName, L"Parameters"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ConfigInfo->ServiceKey, + (PSECURITY_DESCRIPTOR) NULL); + + /* Try to open it */ + Status = ZwOpenKey(&ConfigInfo->DeviceKey, + KEY_READ, + &ObjectAttributes); + + if (NT_SUCCESS(Status)) + { + /* Yes, Parameters key exist, and it must be used instead of + the Service key */ + ZwClose(ConfigInfo->ServiceKey); + ConfigInfo->ServiceKey = ConfigInfo->DeviceKey; + ConfigInfo->DeviceKey = NULL; + } + } + + /* Open the Device key */ + RtlInitUnicodeString(&KeyName, L"Device"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ConfigInfo->ServiceKey, + NULL); + + /* We don't check for failure here - not needed */ + ZwOpenKey(&ConfigInfo->DeviceKey, + KEY_READ, + &ObjectAttributes); } @@ -668,10 +763,13 @@ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; PCONFIGURATION_INFORMATION SystemConfig; PPORT_CONFIGURATION_INFORMATION PortConfig; + PORT_CONFIGURATION_INFORMATION InitialPortConfig; + CONFIGURATION_INFO ConfigInfo; ULONG DeviceExtensionSize; ULONG PortConfigSize; BOOLEAN Again; BOOLEAN DeviceFound = FALSE; + BOOLEAN FirstConfigCall = TRUE; ULONG i; ULONG Result; NTSTATUS Status; @@ -712,12 +810,30 @@ /* Obtain configuration information */ SystemConfig = IoGetConfigurationInformation(); + /* Zero the internal configuration info structure */ + RtlZeroMemory(&ConfigInfo, sizeof(CONFIGURATION_INFO)); + + /* Allocate space for access ranges */ + if (HwInitializationData->NumberOfAccessRanges) + { + ConfigInfo.AccessRanges = + ExAllocatePool(PagedPool, + HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE)); + + /* Fail if failed */ + if (ConfigInfo.AccessRanges == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Open registry keys */ + SpiInitOpenKeys(&ConfigInfo, (PUNICODE_STRING)Argument2); + + /* Last adapter number = not known */ + ConfigInfo.LastAdapterNumber = SP_UNINITIALIZED_VALUE; + /* Calculate sizes of DeviceExtension and PortConfig */ DeviceExtensionSize = sizeof(SCSI_PORT_DEVICE_EXTENSION) + HwInitializationData->DeviceExtensionSize; - PortConfigSize = sizeof(PORT_CONFIGURATION_INFORMATION) + - HwInitializationData->NumberOfAccessRanges * sizeof(ACCESS_RANGE); - MaxBus = (HwInitializationData->AdapterInterfaceType == PCIBus) ? 8 : 1; DPRINT("MaxBus: %lu\n", MaxBus); @@ -725,56 +841,122 @@ PortDeviceObject = NULL; BusNumber = 0; SlotNumber.u.AsULONG = 0; - while (TRUE) - { - /* Create a unicode device name */ - swprintf (NameBuffer, - L"\\Device\\ScsiPort%lu", - SystemConfig->ScsiPortCount); - RtlInitUnicodeString (&DeviceName, - NameBuffer); - - DPRINT("Creating device: %wZ\n", &DeviceName); - - /* Create the port device */ - Status = IoCreateDevice (DriverObject, - DeviceExtensionSize, - &DeviceName, - FILE_DEVICE_CONTROLLER, - 0, - FALSE, - &PortDeviceObject); - if (!NT_SUCCESS(Status)) - { - DbgPrint ("IoCreateDevice call failed! (Status 0x%lX)\n", Status); - PortDeviceObject = NULL; - goto ByeBye; - } - - DPRINT ("Created device: %wZ (%p)\n", &DeviceName, PortDeviceObject); - - /* Set the buffering strategy here... */ - PortDeviceObject->Flags |= DO_DIRECT_IO; - PortDeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT; - - DeviceExtension = PortDeviceObject->DeviceExtension; - DeviceExtension->Length = DeviceExtensionSize; - DeviceExtension->DeviceObject = PortDeviceObject; - DeviceExtension->PortNumber = SystemConfig->ScsiPortCount; - - DeviceExtension->MiniPortExtensionSize = HwInitializationData->DeviceExtensionSize; - DeviceExtension->LunExtensionSize = HwInitializationData->SpecificLuExtensionSize; - DeviceExtension->SrbExtensionSize = HwInitializationData->SrbExtensionSize; - DeviceExtension->HwStartIo = HwInitializationData->HwStartIo; - DeviceExtension->HwInterrupt = HwInitializationData->HwInterrupt; - -#if 0 - DeviceExtension->AdapterObject = NULL; - DeviceExtension->MapRegisterCount = 0; - DeviceExtension->PhysicalAddress.QuadPart = 0ULL; - DeviceExtension->VirtualAddress = NULL; - DeviceExtension->CommonBufferLength = 0; -#endif + + while (TRUE) + { + /* Create a unicode device name */ + swprintf(NameBuffer, + L"\\Device\\ScsiPort%lu", + SystemConfig->ScsiPortCount); + RtlInitUnicodeString(&DeviceName, NameBuffer); + + DPRINT("Creating device: %wZ\n", &DeviceName); + + /* Create the port device */ + Status = IoCreateDevice(DriverObject, + DeviceExtensionSize, + &DeviceName, + FILE_DEVICE_CONTROLLER, + 0, + FALSE, + &PortDeviceObject); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoCreateDevice call failed! (Status 0x%lX)\n", Status); + PortDeviceObject = NULL; + break; + } + + DPRINT ("Created device: %wZ (%p)\n", &DeviceName, PortDeviceObject); + + /* Set the buffering strategy here... */ + PortDeviceObject->Flags |= DO_DIRECT_IO; + PortDeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT; /* FIXME: Is this really needed? */ + + /* Fill Device Extension */ + DeviceExtension = PortDeviceObject->DeviceExtension; + + DeviceExtension->Length = DeviceExtensionSize; + DeviceExtension->DeviceObject = PortDeviceObject; + DeviceExtension->PortNumber = SystemConfig->ScsiPortCount; + + /* Driver's routines... */ + DeviceExtension->HwStartIo = HwInitializationData->HwStartIo; + DeviceExtension->HwInterrupt = HwInitializationData->HwInterrupt; + DeviceExtension->HwResetBus = HwInitializationData->HwResetBus; + DeviceExtension->HwDmaStarted = HwInitializationData->HwDmaStarted; + + /* Extensions sizes */ + DeviceExtension->MiniPortExtensionSize = HwInitializationData->DeviceExtensionSize; + DeviceExtension->LunExtensionSize = HwInitializationData->SpecificLuExtensionSize; + DeviceExtension->SrbExtensionSize = HwInitializationData->SrbExtensionSize; + + /* Round Srb extension size to the quadword */ + DeviceExtension->SrbExtensionSize = + ~(sizeof(LONGLONG) - 1) & (DeviceExtension->SrbExtensionSize + + sizeof(LONGLONG) - 1); + + /* Fill some numbers (bus count, lun count, etc) */ + DeviceExtension->MaxLunCount = SCSI_MAXIMUM_LOGICAL_UNITS; + DeviceExtension->RequestsNumber = 16; + + /* Initialize the spin lock in the controller extension */ + KeInitializeSpinLock(&DeviceExtension->IrqLock); + KeInitializeSpinLock(&DeviceExtension->SpinLock); + + /* Initialize the DPC object */ + IoInitializeDpcRequest(PortDeviceObject, + ScsiPortDpcForIsr); + + /* Initialize the device timer */ + DeviceExtension->TimerCount = -1; + IoInitializeTimer(PortDeviceObject, + ScsiPortIoTimer, + DeviceExtension); + + /* Initialize miniport timer */ + KeInitializeTimer(&DeviceExtension->MiniportTimer); + KeInitializeDpc(&DeviceExtension->MiniportTimerDpc, + SpiMiniportTimerDpc, + PortDeviceObject); + +//CreatePortConfig: + + Status = SpiCreatePortConfig(DeviceExtension, + HwInitializationData, + &ConfigInfo, + &InitialPortConfig, + FirstConfigCall); + + if (!NT_SUCCESS(Status)) + break; + + /* Allocate and initialize port configuration info */ + PortConfigSize = (sizeof(PORT_CONFIGURATION_INFORMATION) + + HwInitializationData->NumberOfAccessRanges * + sizeof(ACCESS_RANGE) + 7) & ~7; + DeviceExtension->PortConfig = ExAllocatePool(NonPagedPool, PortConfigSize); + + /* Fail if failed */ + if (DeviceExtension->PortConfig == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + PortConfig = DeviceExtension->PortConfig; + + /* Copy information here */ + RtlCopyMemory(PortConfig, + &InitialPortConfig, + sizeof(PORT_CONFIGURATION_INFORMATION)); + + + + + + /* Initialize the device base list */ InitializeListHead (&DeviceExtension->DeviceBaseListHead); @@ -783,29 +965,7 @@ RtlZeroMemory(DeviceExtension->LunExtensionList, sizeof(PSCSI_PORT_LUN_EXTENSION) * LUS_NUMBER); - /* Initialize the spin lock in the controller extension */ - KeInitializeSpinLock (&DeviceExtension->IrpLock); - KeInitializeSpinLock (&DeviceExtension->SpinLock); - - /* Initialize the DPC object */ - IoInitializeDpcRequest (PortDeviceObject, - ScsiPortDpcForIsr); - - /* Initialize the device timer */ - DeviceExtension->TimerState = IDETimerIdle; - DeviceExtension->TimerCount = -1; - IoInitializeTimer (PortDeviceObject, - ScsiPortIoTimer, - DeviceExtension); - - /* Allocate and initialize port configuration info */ - DeviceExtension->PortConfig = ExAllocatePool (NonPagedPool, - PortConfigSize); - if (DeviceExtension->PortConfig == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto ByeBye; - } + RtlZeroMemory (DeviceExtension->PortConfig, PortConfigSize); @@ -1698,7 +1858,8 @@ Srb = IrpStack->Parameters.Scsi.Srb; - /* FIXME: Apply standard flags to Srb->SrbFlags ? */ + /* Apply "default" flags */ + Srb->SrbFlags |= DeviceExtension->SrbFlags; /* Get LUN extension */ LunExtension = SpiGetLunExtension(DeviceExtension, @@ -1819,7 +1980,7 @@ } - KeAcquireSpinLockAtDpcLevel(&DeviceExtension->IrpLock); + KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock); if (!KeSynchronizeExecution(DeviceExtension->Interrupt, ScsiPortStartPacket, @@ -1829,12 +1990,12 @@ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; Irp->IoStatus.Information = 0; - KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock); + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); IoCompleteRequest(Irp, IO_NO_INCREMENT); } - KeReleaseSpinLockFromDpcLevel(&DeviceExtension->IrpLock); + KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); DPRINT("ScsiPortStartIo() done\n"); } @@ -2813,7 +2974,7 @@ KeReleaseSpinLockFromDpcLevel(&DeviceExtension->SpinLock); } - DPRINT("IoCompleting request IRP 0x%08X", Irp); + DPRINT("IoCompleting request IRP 0x%08X\n", Irp); IoCompleteRequest(Irp, IO_DISK_INCREMENT); @@ -3968,6 +4129,618 @@ return Status; } +VOID +STDCALL +SpiMiniportTimerDpc(IN struct _KDPC *Dpc, + IN PVOID DeviceObject, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + DPRINT1("Miniport timer DPC\n"); +} + +static NTSTATUS +SpiCreatePortConfig(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PHW_INITIALIZATION_DATA HwInitData, + PCONFIGURATION_INFO InternalConfigInfo, + PPORT_CONFIGURATION_INFORMATION ConfigInfo, + BOOLEAN ZeroStruct) +{ + UNICODE_STRING UnicodeString; + OBJECT_ATTRIBUTES ObjectAttributes; + PCONFIGURATION_INFORMATION DdkConfigInformation; + HANDLE RootKey, Key; + BOOLEAN Found; + WCHAR DeviceBuffer[16]; + WCHAR StrBuffer[512]; + ULONG Bus; + NTSTATUS Status; + + /* Zero out the struct if told so */ + if (ZeroStruct) + { + /* First zero the portconfig */ + RtlZeroMemory(ConfigInfo, sizeof(PORT_CONFIGURATION_INFORMATION)); + + /* Then access ranges */ + RtlZeroMemory(InternalConfigInfo->AccessRanges, + HwInitData->NumberOfAccessRanges * sizeof(ACCESS_RANGE)); + + /* Initialize the struct */ + ConfigInfo->Length = sizeof(PORT_CONFIGURATION_INFORMATION); + ConfigInfo->AdapterInterfaceType = HwInitData->AdapterInterfaceType; + ConfigInfo->InterruptMode = Latched; + ConfigInfo->DmaChannel = SP_UNINITIALIZED_VALUE; + ConfigInfo->DmaPort = SP_UNINITIALIZED_VALUE; + ConfigInfo->MaximumTransferLength = SP_UNINITIALIZED_VALUE; + ConfigInfo->NumberOfAccessRanges = HwInitData->NumberOfAccessRanges; + ConfigInfo->MaximumNumberOfTargets = 8; + + /* Store parameters */ + ConfigInfo->NeedPhysicalAddresses = HwInitData->NeedPhysicalAddresses; + ConfigInfo->MapBuffers = HwInitData->MapBuffers; + ConfigInfo->AutoRequestSense = HwInitData->AutoRequestSense; + ConfigInfo->ReceiveEvent = HwInitData->ReceiveEvent; + ConfigInfo->TaggedQueuing = HwInitData->TaggedQueuing; + ConfigInfo->MultipleRequestPerLu = HwInitData->MultipleRequestPerLu; + + /* Get the disk usage */ + DdkConfigInformation = IoGetConfigurationInformation(); + ConfigInfo->AtdiskPrimaryClaimed = DdkConfigInformation->AtDiskPrimaryAddressClaimed; + ConfigInfo->AtdiskSecondaryClaimed = DdkConfigInformation->AtDiskSecondaryAddressClaimed; + + /* Initiator bus id is not set */ + for (Bus = 0; Bus < 8; Bus++) + ConfigInfo->InitiatorBusId[Bus] = (CCHAR)SP_UNINITIALIZED_VALUE; + } + + ConfigInfo->NumberOfPhysicalBreaks = 17; + + /* Clear this information */ + InternalConfigInfo->DisableTaggedQueueing = FALSE; + InternalConfigInfo->DisableMultipleLun = FALSE; + + /* Store Bus Number */ + ConfigInfo->SystemIoBusNumber = InternalConfigInfo->BusNumber; + +TryNextAd: + + if (ConfigInfo->AdapterInterfaceType == Internal) + { + /* Open registry key for HW database */ + InitializeObjectAttributes(&ObjectAttributes, + DeviceExtension->DeviceObject->DriverObject->HardwareDatabase, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = ZwOpenKey(&RootKey, + KEY_READ, + &ObjectAttributes); + + if (NT_SUCCESS(Status)) + { + /* Create name for it */ + swprintf(StrBuffer, L"ScsiAdapter\\%lu", + InternalConfigInfo->AdapterNumber); + + RtlInitUnicodeString(&UnicodeString, StrBuffer); + + /* Open device key */ + InitializeObjectAttributes(&ObjectAttributes, + &UnicodeString, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + Status = ZwOpenKey(&Key, + KEY_READ, + &ObjectAttributes); + + ZwClose(RootKey); + + if (NT_SUCCESS(Status)) + { + if (InternalConfigInfo->LastAdapterNumber != InternalConfigInfo->AdapterNumber) + { + DPRINT("Hardware info found at %S\n", StrBuffer); + + /* Parse it */ + SpiParseDeviceInfo(DeviceExtension, + Key, + ConfigInfo, + InternalConfigInfo, + (PUCHAR)StrBuffer); + + InternalConfigInfo->BusNumber = 0; + } + else + { + /* Try the next adapter */ + InternalConfigInfo->AdapterNumber++; + goto TryNextAd; + } + } + else + { + /* Info was not found, exit */ + return STATUS_DEVICE_DOES_NOT_EXIST; + } + } + } + + + /* Look at device params */ + Key = NULL; + if (InternalConfigInfo->Parameter) + { + ExFreePool(InternalConfigInfo->Parameter); + InternalConfigInfo->Parameter = NULL; + } + + if (InternalConfigInfo->ServiceKey != NULL) + { + swprintf(DeviceBuffer, L"Device%lu", InternalConfigInfo->AdapterNumber); + RtlInitUnicodeString(&UnicodeString, DeviceBuffer); + + /* Open the service key */ + InitializeObjectAttributes(&ObjectAttributes, + &UnicodeString, + OBJ_CASE_INSENSITIVE, + InternalConfigInfo->ServiceKey, + NULL); + + Status = ZwOpenKey(&Key, + KEY_READ, + &ObjectAttributes); + } + + /* Parse device key */ + if (InternalConfigInfo->DeviceKey != NULL) + { + SpiParseDeviceInfo(DeviceExtension, + InternalConfigInfo->DeviceKey, + ConfigInfo, + InternalConfigInfo, + (PUCHAR)StrBuffer); + } + + /* Then parse hw info */ + if (Key != NULL) + { + if (InternalConfigInfo->LastAdapterNumber != InternalConfigInfo->AdapterNumber) + { + SpiParseDeviceInfo(DeviceExtension, + Key, + ConfigInfo, + InternalConfigInfo, + (PUCHAR)StrBuffer); + + /* Close the key */ + ZwClose(Key); + } + else + { + /* Adapter not found, go try the next one */ + InternalConfigInfo->AdapterNumber++; + + /* Close the key */ + ZwClose(Key); + + goto TryNextAd; + } + } + + /* Update the last adapter number */ + InternalConfigInfo->LastAdapterNumber = InternalConfigInfo->AdapterNumber; + + /* Do we have this kind of bus at all? */ + Found = FALSE; + Status = IoQueryDeviceDescription(&HwInitData->AdapterInterfaceType, + &InternalConfigInfo->BusNumber, + NULL, + NULL, + NULL, + NULL, + SpQueryDeviceCallout, + &Found); + + /* This bus was not found */ + if (!Found) + { + INTERFACE_TYPE InterfaceType = Eisa; + + /* Check for EISA */ + if (HwInitData->AdapterInterfaceType == Isa) + { + Status = IoQueryDeviceDescription(&InterfaceType, + &InternalConfigInfo->BusNumber, + NULL, + NULL, + NULL, + NULL, + SpQueryDeviceCallout, + &Found); + + /* Return respectively */ + if (Found) + return STATUS_SUCCESS; + else + return STATUS_DEVICE_DOES_NOT_EXIST; + } + else + { + return STATUS_DEVICE_DOES_NOT_EXIST; + } + } + else + { + return STATUS_SUCCESS; + } +} + +static VOID +SpiParseDeviceInfo(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + IN HANDLE Key, + IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, + IN PCONFIGURATION_INFO InternalConfigInfo, + IN PUCHAR Buffer) +{ + PKEY_VALUE_FULL_INFORMATION KeyValueInformation; + PCM_FULL_RESOURCE_DESCRIPTOR FullResource; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; + PCM_SCSI_DEVICE_DATA ScsiDeviceData; + ULONG Length, Count; + ULONG Index = 0, RangeCount = 0; + UNICODE_STRING UnicodeString; + ANSI_STRING AnsiString; + NTSTATUS Status = STATUS_SUCCESS; + + + KeyValueInformation = (PKEY_VALUE_FULL_INFORMATION) Buffer; + + /* Loop through all values in the device node */ + while(TRUE) + { + Status = ZwEnumerateValueKey(Key, + Index, + KeyValueFullInformation, + Buffer, + 512, + &Length); + + if (!NT_SUCCESS(Status)) + return; + + Index++; + + /* Length for DWORD is ok? */ + if (KeyValueInformation->Type == REG_DWORD && + KeyValueInformation->DataLength != sizeof(ULONG)) + { + continue; + } + + /* Get MaximumLogicalUnit */ + if (_wcsnicmp(KeyValueInformation->Name, L"MaximumLogicalUnit", + KeyValueInformation->NameLength/2) == 0) + { + + if (KeyValueInformation->Type != REG_DWORD) + { + DPRINT("Bad data type for MaximumLogicalUnit\n"); + continue; + } + + DeviceExtension->MaxLunCount = *((PUCHAR) + (Buffer + KeyValueInformation->DataOffset)); + + /* Check / reset if needed */ + if (DeviceExtension->MaxLunCount > SCSI_MAXIMUM_LOGICAL_UNITS) + DeviceExtension->MaxLunCount = SCSI_MAXIMUM_LOGICAL_UNITS; + + DPRINT("MaximumLogicalUnit = %d\n", DeviceExtension->MaxLunCount); + } + + /* Get InitiatorTargetId */ + if (_wcsnicmp(KeyValueInformation->Name, L"InitiatorTargetId", + KeyValueInformation->NameLength / 2) == 0) + { + + if (KeyValueInformation->Type != REG_DWORD) + { + DPRINT("Bad data type for InitiatorTargetId\n"); + continue; + } + + ConfigInfo->InitiatorBusId[0] = *((PUCHAR) + (Buffer + KeyValueInformation->DataOffset)); + + /* Check / reset if needed */ + if (ConfigInfo->InitiatorBusId[0] > ConfigInfo->MaximumNumberOfTargets - 1) + ConfigInfo->InitiatorBusId[0] = (CCHAR)-1; + + DPRINT("InitiatorTargetId = %d\n", ConfigInfo->InitiatorBusId[0]); + } + + /* Get ScsiDebug */ + if (_wcsnicmp(KeyValueInformation->Name, L"ScsiDebug", + KeyValueInformation->NameLength/2) == 0) + { + DPRINT("ScsiDebug key not supported\n"); + } + + /* Check for a breakpoint */ + if (_wcsnicmp(KeyValueInformation->Name, L"BreakPointOnEntry", + KeyValueInformation->NameLength/2) == 0) + { + DPRINT1("Breakpoint on entry requested!\n"); + DbgBreakPoint(); + } + + /* Get DisableSynchronousTransfers */ + if (_wcsnicmp(KeyValueInformation->Name, L"DisableSynchronousTransfers", + KeyValueInformation->NameLength/2) == 0) + { + DeviceExtension->SrbFlags |= SRB_FLAGS_DISABLE_SYNCH_TRANSFER; + DPRINT("Synch transfers disabled\n"); + } + + /* Get DisableDisconnects */ + if (_wcsnicmp(KeyValueInformation->Name, L"DisableDisconnects", + KeyValueInformation->NameLength/2) == 0) + { + DeviceExtension->SrbFlags |= SRB_FLAGS_DISABLE_DISCONNECT; + DPRINT("Disconnects disabled\n"); + } + + /* Get DisableTaggedQueuing */ + if (_wcsnicmp(KeyValueInformation->Name, L"DisableTaggedQueuing", + KeyValueInformation->NameLength/2) == 0) + { + InternalConfigInfo->DisableTaggedQueueing = TRUE; + DPRINT("Tagged queueing disabled\n"); + } + + /* Get DisableMultipleRequests */ + if (_wcsnicmp(KeyValueInformation->Name, L"DisableMultipleRequests", + KeyValueInformation->NameLength/2) == 0) + { + InternalConfigInfo->DisableMultipleLun = TRUE; + DPRINT("Multiple requests disabled\n"); + } + + /* Get DriverParameters */ + if (_wcsnicmp(KeyValueInformation->Name, L"DriverParameters", + KeyValueInformation->NameLength/2) == 0) + { + /* Skip if nothing */ + if (KeyValueInformation->DataLength == 0) + continue; + + /* If there was something previously allocated - free it */ + if (InternalConfigInfo->Parameter != NULL) + ExFreePool(InternalConfigInfo->Parameter); + + /* Allocate it */ + InternalConfigInfo->Parameter = ExAllocatePool(NonPagedPool, + KeyValueInformation->DataLength); + + if (InternalConfigInfo->Parameter != NULL) + { + if (KeyValueInformation->Type != REG_SZ) + { + /* Just copy */ + RtlCopyMemory( + InternalConfigInfo->Parameter, + (PCCHAR)KeyValueInformation + KeyValueInformation->DataOffset, + KeyValueInformation->DataLength); + } + else + { + /* If it's a unicode string, convert it to ansi */ + UnicodeString.Length = (USHORT)KeyValueInformation->DataLength; + UnicodeString.MaximumLength = (USHORT)KeyValueInformation->DataLength; + UnicodeString.Buffer = + (PWSTR)((PCCHAR)KeyValueInformation + KeyValueInformation->DataOffset); + + AnsiString.Length = 0; + AnsiString.MaximumLength = (USHORT)KeyValueInformation->DataLength; + AnsiString.Buffer = (PCHAR)InternalConfigInfo->Parameter; + + Status = RtlUnicodeStringToAnsiString(&AnsiString, + &UnicodeString, + FALSE); + + /* In case of error, free the allocated space */ + if (!NT_SUCCESS(Status)) + { + ExFreePool(InternalConfigInfo->Parameter); + InternalConfigInfo->Parameter = NULL; + } + + } + } + + DPRINT("Found driver parameter\n"); + } + + /* Get MaximumSGList */ + if (_wcsnicmp(KeyValueInformation->Name, L"MaximumSGList", + KeyValueInformation->NameLength/2) == 0) + { + if (KeyValueInformation->Type != REG_DWORD) + { + DPRINT("Bad data type for MaximumSGList\n"); + continue; + } + + ConfigInfo->NumberOfPhysicalBreaks = *((PUCHAR)(Buffer + KeyValueInformation->DataOffset)); + + /* Check / fix */ + if (ConfigInfo->NumberOfPhysicalBreaks > SCSI_MAXIMUM_PHYSICAL_BREAKS) + { + ConfigInfo->NumberOfPhysicalBreaks = SCSI_MAXIMUM_PHYSICAL_BREAKS; + } + else if (ConfigInfo->NumberOfPhysicalBreaks < SCSI_MINIMUM_PHYSICAL_BREAKS) + { + ConfigInfo->NumberOfPhysicalBreaks = SCSI_MINIMUM_PHYSICAL_BREAKS; + } + + DPRINT("MaximumSGList = %d\n", ConfigInfo->NumberOfPhysicalBreaks); + } + + /* Get NumberOfRequests */ + if (_wcsnicmp(KeyValueInformation->Name, L"NumberOfRequests", + KeyValueInformation->NameLength/2) == 0) + { + if (KeyValueInformation->Type != REG_DWORD) + { + DPRINT("NumberOfRequests has wrong data type\n"); + continue; + } + + DeviceExtension->RequestsNumber = *((PUCHAR)(Buffer + KeyValueInformation->DataOffset)); + + /* Check / fix */ + if (DeviceExtension->RequestsNumber < 16) + { + DeviceExtension->RequestsNumber = 16; + } + else if (DeviceExtension->RequestsNumber > 512) + { + DeviceExtension->RequestsNumber = 512; + } + + DPRINT("Number Of Requests = %d\n", DeviceExtension->RequestsNumber); + } + + /* Get resource list */ + if (_wcsnicmp(KeyValueInformation->Name, L"ResourceList", + KeyValueInformation->NameLength/2) == 0 || + _wcsnicmp(KeyValueInformation->Name, L"Configuration Data", + KeyValueInformation->NameLength/2) == 0 ) + { + if (KeyValueInformation->Type != REG_FULL_RESOURCE_DESCRIPTOR || + KeyValueInformation->DataLength < sizeof(REG_FULL_RESOURCE_DESCRIPTOR)) + { + DPRINT("Bad data type for ResourceList\n"); + continue; + } + else + { + DPRINT("Found ResourceList\n"); + } + + FullResource = (PCM_FULL_RESOURCE_DESCRIPTOR)(Buffer + KeyValueInformation->DataOffset); + + /* Copy some info from it */ + InternalConfigInfo->BusNumber = FullResource->BusNumber; + ConfigInfo->SystemIoBusNumber = FullResource->BusNumber; + + /* Loop through it */ + for (Count = 0; Count < FullResource->PartialResourceList.Count; Count++) + { + /* Get partial descriptor */ + PartialDescriptor = + &FullResource->PartialResourceList.PartialDescriptors[Count]; + + /* Check datalength */ + if ((ULONG)((PCHAR)(PartialDescriptor + 1) - + (PCHAR)FullResource) > KeyValueInformation->DataLength) + { + DPRINT("Resource data is of incorrect size\n"); + break; + } + + switch (PartialDescriptor->Type) + { + case CmResourceTypePort: + if (RangeCount >= ConfigInfo->NumberOfAccessRanges) + { + DPRINT("Too many access ranges\n"); + continue; + } + + InternalConfigInfo->AccessRanges[RangeCount].RangeInMemory = FALSE; + InternalConfigInfo->AccessRanges[RangeCount].RangeStart = PartialDescriptor->u.Port.Start; + InternalConfigInfo->AccessRanges[RangeCount].RangeLength = PartialDescriptor->u.Port.Length; + RangeCount++; + + break; + + case CmResourceTypeMemory: + if (RangeCount >= ConfigInfo->NumberOfAccessRanges) + { + DPRINT("Too many access ranges\n"); + continue; + } + + InternalConfigInfo->AccessRanges[RangeCount].RangeInMemory = TRUE; + InternalConfigInfo->AccessRanges[RangeCount].RangeStart = PartialDescriptor->u.Memory.Start; + InternalConfigInfo->AccessRanges[RangeCount].RangeLength = PartialDescriptor->u.Memory.Length; + RangeCount++; + + break; + + case CmResourceTypeInterrupt: + ConfigInfo->BusInterruptLevel = + PartialDescriptor->u.Interrupt.Level; + + ConfigInfo->BusInterruptVector = + PartialDescriptor->u.Interrupt.Vector; + break; + + case CmResourceTypeDma: + ConfigInfo->DmaChannel = PartialDescriptor->u.Dma.Channel; + ConfigInfo->DmaPort = PartialDescriptor->u.Dma.Port; + break; + + case CmResourceTypeDeviceSpecific: + if (PartialDescriptor->u.DeviceSpecificData.DataSize < + sizeof(CM_SCSI_DEVICE_DATA) || + (PCHAR) (PartialDescriptor + 1) - (PCHAR)FullResource + + PartialDescriptor->u.DeviceSpecificData.DataSize > + KeyValueInformation->DataLength) + { + DPRINT("Resource data length is incorrect"); + break; + } + + /* Set only one field from it */ + ScsiDeviceData = (PCM_SCSI_DEVICE_DATA) (PartialDescriptor+1); + ConfigInfo->InitiatorBusId[0] = ScsiDeviceData->HostIdentifier; + break; + } + } + } + } +} + + +NTSTATUS +STDCALL +SpQueryDeviceCallout(IN PVOID Context, + IN PUNICODE_STRING PathName, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN PKEY_VALUE_FULL_INFORMATION *BusInformation, + IN CONFIGURATION_TYPE ControllerType, + IN ULONG ControllerNumber, + IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + IN CONFIGURATION_TYPE PeripheralType, + IN ULONG PeripheralNumber, + IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation) +{ + PBOOLEAN Found = (PBOOLEAN)Context; + /* We just set our Found variable to TRUE */ + + *Found = TRUE; + return STATUS_SUCCESS; +} + + + static NTSTATUS SpiStatusSrbToNt(UCHAR SrbStatus) Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport_int.h Fri Mar 30 17:17:06 2007 @@ -45,7 +45,6 @@ #define SCSI_PORT_SCAN_IN_PROGRESS 0x8000 - typedef enum _SCSI_PORT_TIMER_STATES { IDETimerIdle, @@ -54,6 +53,26 @@ IDETimerResetWaitForDrdyAssert } SCSI_PORT_TIMER_STATES; +typedef struct _CONFIGURATION_INFO +{ + /* Identify info */ + ULONG AdapterNumber; + ULONG LastAdapterNumber; + ULONG BusNumber; + + /* Registry related */ + HANDLE BusKey; + HANDLE ServiceKey; + HANDLE DeviceKey; + + /* Features */ + BOOLEAN DisableTaggedQueueing; + BOOLEAN DisableMultipleLun; + + /* Parameters */ + PVOID Parameter; + PACCESS_RANGE AccessRanges; +} CONFIGURATION_INFO, *PCONFIGURATION_INFO; typedef struct _SCSI_PORT_DEVICE_BASE { @@ -178,9 +197,14 @@ ULONG PortNumber; LONG ActiveRequestCounter; + ULONG SrbFlags; ULONG Flags; - KSPIN_LOCK IrpLock; + ULONG BusNum; + ULONG MaxTargedIds; + ULONG MaxLunCount; + + KSPIN_LOCK IrqLock; /* Used when there are 2 irqs */ KSPIN_LOCK SpinLock; PKINTERRUPT Interrupt; PIRP CurrentIrp; @@ -189,6 +213,9 @@ SCSI_PORT_TIMER_STATES TimerState; LONG TimerCount; + KTIMER MiniportTimer; + KDPC MiniportTimerDpc; + LIST_ENTRY DeviceBaseListHead; ULONG LunExtensionSize; @@ -212,6 +239,8 @@ PHW_STARTIO HwStartIo; PHW_INTERRUPT HwInterrupt; + PHW_RESET_BUS HwResetBus; + PHW_DMA_STARTED HwDmaStarted; PSCSI_REQUEST_BLOCK OriginalSrb; SCSI_REQUEST_BLOCK InternalSrb; @@ -236,5 +265,7 @@ BOOLEAN NeedSrbExtensionAlloc; BOOLEAN NeedSrbDataAlloc; + ULONG RequestsNumber; + UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */ } SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION;
17 years, 8 months
1
0
0
0
[greatlrd] 26204: remove VidMemFree and HeapVidMemAllocAligned they are protoypes belong to dmemmgr.h ddrawi.h need be rewiten it is from wine so I add some hacks for now getting it works simluare to ms ddk version. This fix gdi32.dll break in the build
by greatlrd@svn.reactos.org
Author: greatlrd Date: Fri Mar 30 13:53:34 2007 New Revision: 26204 URL:
http://svn.reactos.org/svn/reactos?rev=26204&view=rev
Log: remove VidMemFree and HeapVidMemAllocAligned they are protoypes belong to dmemmgr.h ddrawi.h need be rewiten it is from wine so I add some hacks for now getting it works simluare to ms ddk version. This fix gdi32.dll break in the build Modified: trunk/reactos/include/ddk/ddrawi.h trunk/reactos/include/ddk/winddi.h Modified: trunk/reactos/include/ddk/ddrawi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ddrawi.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/ddrawi.h (original) +++ trunk/reactos/include/ddk/ddrawi.h Fri Mar 30 13:53:34 2007 @@ -207,14 +207,14 @@ - +#ifndef __DD_INCLUDED__ #define VIDMEM_ISLINEAR 0x00000001 #define VIDMEM_ISRECTANGULAR 0x00000002 #define VIDMEM_ISHEAP 0x00000004 #define VIDMEM_ISNONLOCAL 0x00000008 #define VIDMEM_ISWC 0x00000010 #define VIDMEM_ISDISABLED 0x00000020 - +#endif typedef struct _VIDMEMINFO { FLATPTR fpPrimary; @@ -328,9 +328,11 @@ /***************************************************************************** * ddraw->driver callbacks */ +#ifndef __DD_INCLUDED__ #define DDHAL_DRIVER_NOTHANDLED 0 #define DDHAL_DRIVER_HANDLED 1 #define DDHAL_DRIVER_NOCKEYHW 2 +#endif typedef struct _DDHAL_DESTROYDRIVERDATA *LPDDHAL_DESTROYDRIVERDATA; typedef struct _DDHAL_CREATESURFACEDATA *LPDDHAL_CREATESURFACEDATA; @@ -694,10 +696,12 @@ #define DDHAL_CB32_FLIPTOGDISURFACE 0x00000200l #define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l #define DDHAL_PALCB32_SETENTRIES 0x00000002l +#ifndef __DD_INCLUDED__ #define DDHALINFO_ISPRIMARYDISPLAY 0x00000001 #define DDHALINFO_MODEXILLEGAL 0x00000002 #define DDHALINFO_GETDRIVERINFOSET 0x00000004 #define DDHALINFO_GETDRIVERINFO2 0x00000008 +#endif #define DDRAWI_VPORTSTART 0x0001 #define DDRAWI_VPORTSTOP 0x0002 #define DDRAWI_VPORTUPDATE 0x0003 @@ -725,11 +729,13 @@ #define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002 #define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004 #define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008 +#ifndef __DD_INCLUDED__ #define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001 #define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002 #define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004 #define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008 #define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010 +#endif #define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001 #define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002 #define DDHAL_VPORT32_FLIP 0x00000004 @@ -746,8 +752,10 @@ #define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000 #define DDHAL_VPORT32_COLORCONTROL 0x00008000 #define DDHAL_COLOR_COLORCONTROL 0x00000001 +#ifndef __DD_INCLUDED__ #define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001 #define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002 +#endif #define DDHAL_MOCOMP32_GETGUIDS 0x00000001 #define DDHAL_MOCOMP32_GETFORMATS 0x00000002 #define DDHAL_MOCOMP32_CREATE 0x00000004 @@ -1680,9 +1688,11 @@ #define DDRAWICLIP_INMASTERSPRITELIST 0x00000004 #define PFINDEX_UNINITIALIZED (0UL) #define PFINDEX_UNSUPPORTED (~0UL) +#ifndef __DD_INCLUDED__ #define ROP_HAS_SOURCE 0x00000001 #define ROP_HAS_PATTERN 0x00000002 #define ROP_HAS_SOURCEPATTERN ROP_HAS_PATTERN | ROP_HAS_SOURCE +#endif #define DDRAWIVPORT_ON 0x00000001 #define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 #define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 Modified: trunk/reactos/include/ddk/winddi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddi.h?rev=2…
============================================================================== --- trunk/reactos/include/ddk/winddi.h (original) +++ trunk/reactos/include/ddk/winddi.h Fri Mar 30 13:53:34 2007 @@ -2512,15 +2512,7 @@ IN ULONG cjSize, OUT FONTINFO *pfi); -WIN32KAPI -FLATPTR -APIENTRY -HeapVidMemAllocAligned( - IN LPVIDMEM lpVidMem, - IN DWORD dwWidth, - IN DWORD dwHeight, - IN LPSURFACEALIGNMENT lpAlignment, - OUT LPLONG lpNewPitch); + WIN32KAPI LONG @@ -2683,13 +2675,6 @@ APIENTRY STROBJ_vEnumStart( IN STROBJ *pstro); - -WIN32KAPI -VOID -APIENTRY -VidMemFree( - IN LPVMEMHEAP pvmh, - IN FLATPTR ptr); WIN32KAPI BOOL
17 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
...
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200