From 562f9f003d163470eaab98517f0770dc328f292b Mon Sep 17 00:00:00 2001 From: Wei Mao Date: Fri, 4 Aug 2017 07:15:57 -0700 Subject: Build clean SysVad sample w/ RS2 WDK --- audio/sysvad/common.cpp | 1309 ++++++++++++++++++++++++++--------------------- 1 file changed, 722 insertions(+), 587 deletions(-) (limited to 'audio/sysvad/common.cpp') diff --git a/audio/sysvad/common.cpp b/audio/sysvad/common.cpp index d046d336..2aadb5e6 100644 --- a/audio/sysvad/common.cpp +++ b/audio/sysvad/common.cpp @@ -8,7 +8,7 @@ Module Name: Abstract: - Implementation of the AdapterCommon class. + Implementation of the AdapterCommon class. --*/ @@ -29,7 +29,7 @@ Abstract: #include "bthhfpminipairs.h" // # of sec before sync request is cancelled. -#define BTH_HFP_SYNC_REQ_TIMEOUT_IN_SEC 60 +#define BTH_HFP_SYNC_REQ_TIMEOUT_IN_SEC 60 #define BTH_HFP_NOTIFICATION_MAX_ERROR_COUNT 5 #endif // SYSVAD_BTH_BYPASS @@ -50,18 +50,18 @@ class BthHfpDevice; // Forward declaration. /////////////////////////////////////////////////////////////////////////////// // CAdapterCommon -// -class CAdapterCommon : +// +class CAdapterCommon : public IAdapterCommon, public IAdapterPowerManagement, - public CUnknown + public CUnknown { private: PSERVICEGROUP m_pServiceGroupWave; PDEVICE_OBJECT m_pDeviceObject; PDEVICE_OBJECT m_pPhysicalDeviceObject; - WDFDEVICE m_WdfDevice; // Wdf device. - DEVICE_POWER_STATE m_PowerState; + WDFDEVICE m_WdfDevice; // Wdf device. + DEVICE_POWER_STATE m_PowerState; PCSYSVADHW m_pHW; // Virtual SYSVAD HW object PPORTCLSETWHELPER m_pPortClsEtwHelper; @@ -82,21 +82,21 @@ class CAdapterCommon : IMP_IAdapterPowerManagement; //===================================================================== - // IAdapterCommon methods + // IAdapterCommon methods STDMETHODIMP_(NTSTATUS) Init - ( + ( _In_ PDEVICE_OBJECT DeviceObject ); STDMETHODIMP_(PDEVICE_OBJECT) GetDeviceObject(void); - + STDMETHODIMP_(PDEVICE_OBJECT) GetPhysicalDeviceObject(void); - + STDMETHODIMP_(WDFDEVICE) GetWdfDevice(void); STDMETHODIMP_(void) SetWaveServiceGroup - ( + ( _In_ PSERVICEGROUP ServiceGroup ); @@ -142,26 +142,26 @@ class CAdapterCommon : STDMETHODIMP_(void) MixerReset(void); STDMETHODIMP_(LONG) MixerVolumeRead - ( + ( _In_ ULONG Index, _In_ ULONG Channel ); STDMETHODIMP_(void) MixerVolumeWrite - ( + ( _In_ ULONG Index, _In_ ULONG Channel, - _In_ LONG Value + _In_ LONG Value ); STDMETHODIMP_(LONG) MixerPeakMeterRead - ( + ( _In_ ULONG Index, _In_ ULONG Channel ); - STDMETHODIMP_(NTSTATUS) WriteEtwEvent - ( + STDMETHODIMP_(NTSTATUS) WriteEtwEvent + ( _In_ EPcMiniportEngineEvent miniportEventType, _In_ ULONGLONG ullData1, _In_ ULONGLONG ullData2, @@ -169,13 +169,13 @@ class CAdapterCommon : _In_ ULONGLONG ullData4 ); - STDMETHODIMP_(VOID) SetEtwHelper - ( + STDMETHODIMP_(VOID) SetEtwHelper + ( PPORTCLSETWHELPER _pPortClsEtwHelper ); - + STDMETHODIMP_(NTSTATUS) InstallSubdevice - ( + ( _In_opt_ PIRP Irp, _In_ PWSTR Name, _In_ REFGUID PortClassId, @@ -191,12 +191,12 @@ class CAdapterCommon : _Out_opt_ PUNKNOWN * OutPortUnknown, _Out_opt_ PUNKNOWN * OutMiniportUnknown ); - + STDMETHODIMP_(NTSTATUS) UnregisterSubdevice ( _In_opt_ PUNKNOWN UnknownPort ); - + STDMETHODIMP_(NTSTATUS) ConnectTopologies ( _In_ PUNKNOWN UnknownTopology, @@ -204,7 +204,7 @@ class CAdapterCommon : _In_ PHYSICALCONNECTIONTABLE* PhysicalConnections, _In_ ULONG PhysicalConnectionCount ); - + STDMETHODIMP_(NTSTATUS) DisconnectTopologies ( _In_ PUNKNOWN UnknownTopology, @@ -212,10 +212,10 @@ class CAdapterCommon : _In_ PHYSICALCONNECTIONTABLE* PhysicalConnections, _In_ ULONG PhysicalConnectionCount ); - + STDMETHODIMP_(NTSTATUS) InstallEndpointFilters ( - _In_opt_ PIRP Irp, + _In_opt_ PIRP Irp, _In_ PENDPOINT_MINIPAIR MiniportPair, _In_opt_ PVOID DeviceContext, _Out_opt_ PUNKNOWN * UnknownTopology, @@ -223,7 +223,7 @@ class CAdapterCommon : _Out_opt_ PUNKNOWN * UnknownMiniportTopology, _Out_opt_ PUNKNOWN * UnknownMiniportWave ); - + STDMETHODIMP_(NTSTATUS) RemoveEndpointFilters ( _In_ PENDPOINT_MINIPAIR MiniportPair, @@ -248,23 +248,23 @@ class CAdapterCommon : #ifdef SYSVAD_BTH_BYPASS STDMETHODIMP_(NTSTATUS) InitBthScoBypass(); - + STDMETHODIMP_(VOID) CleanupBthScoBypass(); #endif // SYSVAD_BTH_BYPASS STDMETHODIMP_(VOID) Cleanup(); - + //===================================================================== // friends friend NTSTATUS NewAdapterCommon - ( + ( _Out_ PUNKNOWN * Unknown, _In_ REFCLSID, _In_opt_ PUNKNOWN UnknownOuter, _When_((PoolType & NonPagedPoolMustSucceed) != 0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) - _In_ POOL_TYPE PoolType + _In_ POOL_TYPE PoolType ); #ifdef SYSVAD_BTH_BYPASS @@ -282,12 +282,12 @@ class CAdapterCommon : BOOL m_BthHfpEnableCleanup; // Do cleanup if true. private: - static + static DRIVER_NOTIFICATION_CALLBACK_ROUTINE EvtBthHfpScoBypassInterfaceChange; - - static + + static EVT_WDF_WORKITEM EvtBthHfpScoBypassInterfaceWorkItem; - + protected: BthHfpDevice * BthHfpDeviceFind ( @@ -323,7 +323,7 @@ class CAdapterCommon : _In_ PUNKNOWN UnknownPort, _In_ PUNKNOWN UnknownMiniport ); - + NTSTATUS RemoveCachedSubdevice ( _In_ PWSTR Name @@ -450,33 +450,33 @@ struct BthHfpEventCallback // This class represents a the Bluetooth Hands-Free Profile SCO Bypass device. // There is one class for each interface (id = symbolic-link-name). // -class BthHfpDevice : +class BthHfpDevice : IBthHfpDeviceCommon, - public CUnknown + public CUnknown { private: eBthHfpState m_State; - + CAdapterCommon * m_Adapter; WDFIOTARGET m_WdfIoTarget; - + LIST_ENTRY m_ListEntry; UNICODE_STRING m_SymbolicLinkName; - + // // The Topo Filter Desc and Topo Pins structures referenced from - // the Miniports structure are deep copies: they start as copies of the - // static structures and are modified to allow per-SCO-Device pin - // categories based on the info obtained from + // the Miniports structure are deep copies: they start as copies of the + // static structures and are modified to allow per-SCO-Device pin + // categories based on the info obtained from // IOCTL_BTHHFP_DEVICE_GET_DESCRIPTOR2 // PENDPOINT_MINIPAIR m_SpeakerMiniports; PENDPOINT_MINIPAIR m_MicMiniports; - + PUNKNOWN m_UnknownSpeakerTopology; PUNKNOWN m_UnknownSpeakerWave; PUNKNOWN m_UnknownMicTopology; - PUNKNOWN m_UnknownMicWave; + PUNKNOWN m_UnknownMicWave; PBTHHFP_DESCRIPTOR2 m_Descriptor; PKSPROPERTY_VALUES m_VolumePropValues; @@ -486,7 +486,7 @@ class BthHfpDevice : BOOL m_ConnectionStatus; LONG m_ConnectionStatusLong; }; // unnamed. - + union{ NTSTATUS m_StreamStatus; LONG m_StreamStatusLong; @@ -495,11 +495,11 @@ class BthHfpDevice : KEVENT m_StreamStatusEvent; // - // Set to TRUE when the HF (remote device) wants to disable the + // Set to TRUE when the HF (remote device) wants to disable the // NR + EC of the AG (local system). // LONG m_NRECDisableStatusLong; - + WDFREQUEST m_StreamReq; WDFREQUEST m_SpeakerVolumeReq; WDFREQUEST m_MicVolumeReq; @@ -525,7 +525,7 @@ class BthHfpDevice : NTSTATUS Init ( - _In_ CAdapterCommon * Adapter, + _In_ CAdapterCommon * Adapter, _In_ PUNICODE_STRING SymbolicLinkName ); @@ -548,7 +548,7 @@ class BthHfpDevice : } static - BthHfpDevice * + BthHfpDevice * GetBthHfpDevice ( _In_ PLIST_ENTRY le @@ -560,69 +560,69 @@ class BthHfpDevice : public: //===================================================================== // - // IBthHfpDeviceCommon functions. + // IBthHfpDeviceCommon functions. // STDMETHODIMP_(BOOL) IsVolumeSupported(); - + STDMETHODIMP_(PKSPROPERTY_VALUES) GetVolumeSettings ( - _Out_ PULONG Size + _Out_ PULONG Size ); - + STDMETHODIMP_(LONG) GetSpeakerVolume(); - + STDMETHODIMP_(NTSTATUS) SetSpeakerVolume ( _In_ ULONG Volume ); - + STDMETHODIMP_(LONG) GetMicVolume(); - + STDMETHODIMP_(NTSTATUS) SetMicVolume ( _In_ ULONG Volume ); - + STDMETHODIMP_(BOOL) GetConnectionStatus(); - + STDMETHODIMP_(NTSTATUS) Connect(); - + STDMETHODIMP_(NTSTATUS) Disconnect(); - + STDMETHODIMP_(BOOL) GetStreamStatus(); - + STDMETHODIMP_(NTSTATUS) StreamOpen(); - + STDMETHODIMP_(NTSTATUS) StreamClose(); - + STDMETHODIMP_(GUID) GetContainerId(); - + STDMETHODIMP_(VOID) SetSpeakerVolumeHandler ( _In_opt_ PFNEVENTNOTIFICATION EventHandler, _In_opt_ PVOID EventHandlerContext ); - + STDMETHODIMP_(VOID) SetSpeakerConnectionStatusHandler ( _In_opt_ PFNEVENTNOTIFICATION EventHandler, _In_opt_ PVOID EventHandlerContext ); - + STDMETHODIMP_(VOID) SetMicVolumeHandler ( _In_opt_ PFNEVENTNOTIFICATION EventHandler, _In_opt_ PVOID EventHandlerContext ); - + STDMETHODIMP_(VOID) SetMicConnectionStatusHandler ( _In_opt_ PFNEVENTNOTIFICATION EventHandler, _In_opt_ PVOID EventHandlerContext ); - + STDMETHODIMP_(BOOL) IsNRECSupported(); - + STDMETHODIMP_(BOOL) GetNRECDisableStatus(); private: @@ -640,7 +640,7 @@ class BthHfpDevice : _When_(InLength == 0 && OutLength == 0, _In_opt_) PVOID Buffer ); - + NTSTATUS SendIoCtrlAsynchronously ( _In_ WDFREQUEST Request, @@ -650,51 +650,51 @@ class BthHfpDevice : _In_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine, _In_ WDFCONTEXT Context ); - + NTSTATUS GetBthHfpDescriptor ( _Out_ PBTHHFP_DESCRIPTOR2 * Descriptor ); - + NTSTATUS EnableBthHfpNrecDisableStatusNotification(); - + NTSTATUS GetBthHfpVolumePropertyValues ( _In_ ULONG Length, _Out_ PKSPROPERTY_VALUES * PropValues ); - + NTSTATUS SetBthHfpSpeakerVolume ( - _In_ LONG Volume + _In_ LONG Volume ); - + NTSTATUS GetBthHfpSpeakerVolume ( - _Out_ LONG * Volume + _Out_ LONG * Volume ); - + NTSTATUS EnableBthHfpSpeakerVolumeStatusNotification(); - + NTSTATUS SetBthHfpMicVolume ( - _In_ LONG Volume + _In_ LONG Volume ); - + NTSTATUS GetBthHfpMicVolume ( - _Out_ LONG * Volume + _Out_ LONG * Volume ); - + NTSTATUS EnableBthHfpMicVolumeStatusNotification(); - + NTSTATUS GetBthHfpConnectionStatus ( - _Out_ BOOL * ConnectionStatus + _Out_ BOOL * ConnectionStatus ); - + NTSTATUS EnableBthHfpConnectionStatusNotification(); - + static NTSTATUS CreateCustomEndpointMinipair ( @@ -717,24 +717,24 @@ class BthHfpDevice : ( _In_ PENDPOINT_MINIPAIR CustomMinipair ); - + NTSTATUS GetBthHfpCodecId ( _Out_ UCHAR * CodecId ); NTSTATUS SetBthHfpConnect(); - + NTSTATUS SetBthHfpDisconnect(); NTSTATUS SetBthHfpStreamOpen(); NTSTATUS SetBthHfpStreamClose(); - + NTSTATUS EnableBthHfpStreamStatusNotification(); - + NTSTATUS StopBthHfpStreamStatusNotification(); - + // // WDF I/O Target callback. // @@ -750,12 +750,12 @@ class BthHfpDevice : // // Status notifications callbacks. // - static + static EVT_WDF_REQUEST_COMPLETION_ROUTINE EvtBthHfpDeviceStreamStatusCompletion; - static + static EVT_WDF_REQUEST_COMPLETION_ROUTINE EvtBthHfpDeviceNotificationStatusCompletion; - + static EVT_WDF_WORKITEM EvtBthHfpDeviceNotificationStatusWorkItem; }; @@ -805,14 +805,14 @@ NTSTATUS SysvadIoSetDeviceInterfacePropertyDataMultiple #pragma code_seg("PAGE") NTSTATUS NewAdapterCommon -( +( _Out_ PUNKNOWN * Unknown, _In_ REFCLSID, _In_opt_ PUNKNOWN UnknownOuter, _When_((PoolType & NonPagedPoolMustSucceed) != 0, __drv_reportError("Must succeed pool allocations are forbidden. " "Allocation failures cause a system crash")) - _In_ POOL_TYPE PoolType + _In_ POOL_TYPE PoolType ) /*++ @@ -822,7 +822,7 @@ Routine Description: Arguments: - Unknown - + Unknown - UnknownOuter - @@ -842,7 +842,7 @@ Return Value: // // This sample supports only one instance of this object. - // (b/c of CSaveData's static members and Bluetooth HFP logic). + // (b/c of CSaveData's static members and Bluetooth HFP logic). // if (InterlockedCompareExchange(&CAdapterCommon::m_AdapterInstances, 1, 0) != 0) { @@ -850,7 +850,7 @@ Return Value: DPF(D_ERROR, ("NewAdapterCommon failed, only one instance is allowed")); goto Done; } - + // // Allocate an adapter object. // @@ -862,22 +862,22 @@ Return Value: goto Done; } - // + // // Success. // *Unknown = PUNKNOWN((PADAPTERCOMMON)(p)); - (*Unknown)->AddRef(); - ntStatus = STATUS_SUCCESS; + (*Unknown)->AddRef(); + ntStatus = STATUS_SUCCESS; -Done: +Done: return ntStatus; } // NewAdapterCommon //============================================================================= #pragma code_seg("PAGE") CAdapterCommon::~CAdapterCommon -( - void +( + void ) /*++ @@ -901,12 +901,12 @@ Return Value: delete m_pHW; m_pHW = NULL; } - + CSaveData::DestroyWorkItems(); SAFE_RELEASE(m_pPortClsEtwHelper); SAFE_RELEASE(m_pServiceGroupWave); - + if (m_WdfDevice) { WdfObjectDelete(m_WdfDevice); @@ -915,11 +915,11 @@ Return Value: InterlockedDecrement(&CAdapterCommon::m_AdapterInstances); ASSERT(CAdapterCommon::m_AdapterInstances == 0); -} // ~CAdapterCommon +} // ~CAdapterCommon //============================================================================= #pragma code_seg("PAGE") -STDMETHODIMP_(PDEVICE_OBJECT) +STDMETHODIMP_(PDEVICE_OBJECT) CAdapterCommon::GetDeviceObject ( void @@ -939,13 +939,13 @@ Return Value: --*/ { PAGED_CODE(); - + return m_pDeviceObject; } // GetDeviceObject //============================================================================= #pragma code_seg("PAGE") -STDMETHODIMP_(PDEVICE_OBJECT) +STDMETHODIMP_(PDEVICE_OBJECT) CAdapterCommon::GetPhysicalDeviceObject ( void @@ -965,13 +965,13 @@ Return Value: --*/ { PAGED_CODE(); - + return m_pPhysicalDeviceObject; } // GetPhysicalDeviceObject //============================================================================= #pragma code_seg("PAGE") -STDMETHODIMP_(WDFDEVICE) +STDMETHODIMP_(WDFDEVICE) CAdapterCommon::GetWdfDevice ( void @@ -993,7 +993,7 @@ Return Value: --*/ { PAGED_CODE(); - + return m_WdfDevice; } // GetWdfDevice @@ -1001,8 +1001,8 @@ Return Value: #pragma code_seg("PAGE") NTSTATUS CAdapterCommon::Init -( - _In_ PDEVICE_OBJECT DeviceObject +( + _In_ PDEVICE_OBJECT DeviceObject ) /*++ @@ -1053,7 +1053,7 @@ Return Value: Done); // - // Create a WDF miniport to represent the adapter. Note that WDF miniports + // Create a WDF miniport to represent the adapter. Note that WDF miniports // are NOT audio miniports. An audio adapter is associated with a single WDF // miniport. This driver uses WDF to simplify the handling of the Bluetooth // SCO HFP Bypass interface. @@ -1070,7 +1070,7 @@ Return Value: Done); // Initialize HW. - // + // m_pHW = new (NonPagedPoolNx, SYSVAD_POOLTAG) CSYSVADHW; if (!m_pHW) { @@ -1078,7 +1078,7 @@ Return Value: ntStatus = STATUS_INSUFFICIENT_RESOURCES; } IF_FAILED_JUMP(ntStatus, Done); - + m_pHW->MixerReset(); // @@ -1097,8 +1097,8 @@ Done: #pragma code_seg("PAGE") STDMETHODIMP_(void) CAdapterCommon::MixerReset -( - void +( + void ) /*++ @@ -1115,7 +1115,7 @@ Return Value: --*/ { PAGED_CODE(); - + if (m_pHW) { m_pHW->MixerReset(); @@ -1125,60 +1125,60 @@ Return Value: //============================================================================= /* Here are the definitions of the standard miniport events. -Event type : eMINIPORT_IHV_DEFINED +Event type : eMINIPORT_IHV_DEFINED Parameter 1 : Defined and used by IHVs Parameter 2 : Defined and used by IHVs Parameter 3 :Defined and used by IHVs Parameter 4 :Defined and used by IHVs Event type: eMINIPORT_BUFFER_COMPLETE -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received Parameter 3: Data length completed Parameter 4:0 Event type: eMINIPORT_PIN_STATE -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received -Parameter 3: Pin State 0->KS_STOP, 1->KS_ACQUIRE, 2->KS_PAUSE, 3->KS_RUN +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 3: Pin State 0->KS_STOP, 1->KS_ACQUIRE, 2->KS_PAUSE, 3->KS_RUN Parameter 4:0 Event type: eMINIPORT_GET_STREAM_POS -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received Parameter 3: 0 Parameter 4:0 Event type: eMINIPORT_SET_WAVERT_BUFFER_WRITE_POS -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received Parameter 3: the arget WaveRtBufferWritePosition received from portcls Parameter 4:0 Event type: eMINIPORT_GET_PRESENTATION_POS -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received Parameter 3: Presentation position Parameter 4:0 -Event type: eMINIPORT_PROGRAM_DMA -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Event type: eMINIPORT_PROGRAM_DMA +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received Parameter 3: Starting WaveRt buffer offset Parameter 4: Data length Event type: eMINIPORT_GLITCH_REPORT -Parameter 1: Current linear buffer position -Parameter 2: the previous WaveRtBufferWritePosition that the drive received -Parameter 3: major glitch code: 1:WaveRT buffer is underrun, - 2:decoder errors, +Parameter 1: Current linear buffer position +Parameter 2: the previous WaveRtBufferWritePosition that the drive received +Parameter 3: major glitch code: 1:WaveRT buffer is underrun, + 2:decoder errors, 3:receive the same wavert buffer two in a row in event driven mode Parameter 4: minor code for the glitch cause Event type: eMINIPORT_LAST_BUFFER_RENDERED -Parameter 1: Current linear buffer position -Parameter 2: the very last WaveRtBufferWritePosition that the driver received +Parameter 1: Current linear buffer position +Parameter 2: the very last WaveRtBufferWritePosition that the driver received Parameter 3: 0 Parameter 4: 0 @@ -1186,7 +1186,7 @@ Parameter 4: 0 #pragma code_seg() STDMETHODIMP CAdapterCommon::WriteEtwEvent -( +( _In_ EPcMiniportEngineEvent miniportEventType, _In_ ULONGLONG ullData1, _In_ ULONGLONG ullData2, @@ -1207,12 +1207,12 @@ CAdapterCommon::WriteEtwEvent #pragma code_seg("PAGE") STDMETHODIMP_(void) CAdapterCommon::SetEtwHelper -( +( PPORTCLSETWHELPER _pPortClsEtwHelper ) { PAGED_CODE(); - + SAFE_RELEASE(m_pPortClsEtwHelper); m_pPortClsEtwHelper = _pPortClsEtwHelper; @@ -1227,9 +1227,9 @@ CAdapterCommon::SetEtwHelper #pragma code_seg("PAGE") STDMETHODIMP CAdapterCommon::NonDelegatingQueryInterface -( +( _In_ REFIID Interface, - _COM_Outptr_ PVOID * Object + _COM_Outptr_ PVOID * Object ) /*++ @@ -1239,7 +1239,7 @@ Routine Description: Arguments: - Interface - + Interface - Object - @@ -1283,8 +1283,8 @@ Return Value: #pragma code_seg("PAGE") STDMETHODIMP_(void) CAdapterCommon::SetWaveServiceGroup -( - _In_ PSERVICEGROUP ServiceGroup +( + _In_ PSERVICEGROUP ServiceGroup ) /*++ @@ -1301,7 +1301,7 @@ Return Value: { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::SetWaveServiceGroup]")); - + SAFE_RELEASE(m_pServiceGroupWave); m_pServiceGroupWave = ServiceGroup; @@ -1551,7 +1551,7 @@ Return Value: //============================================================================= #pragma code_seg() STDMETHODIMP_(ULONG) -CAdapterCommon::MixerMuxRead() +CAdapterCommon::MixerMuxRead() /*++ Routine Description: @@ -1613,7 +1613,7 @@ Return Value: #pragma code_seg() STDMETHODIMP_(LONG) CAdapterCommon::MixerVolumeRead -( +( _In_ ULONG Index, _In_ ULONG Channel ) @@ -1647,7 +1647,7 @@ Return Value: #pragma code_seg() STDMETHODIMP_(void) CAdapterCommon::MixerVolumeWrite -( +( _In_ ULONG Index, _In_ ULONG Channel, _In_ LONG Value @@ -1682,7 +1682,7 @@ Return Value: #pragma code_seg() STDMETHODIMP_(LONG) CAdapterCommon::MixerPeakMeterRead -( +( _In_ ULONG Index, _In_ ULONG Channel ) @@ -1716,8 +1716,8 @@ Return Value: #pragma code_seg() STDMETHODIMP_(void) CAdapterCommon::PowerChangeState -( - _In_ POWER_STATE NewState +( + _In_ POWER_STATE NewState ) /*++ @@ -1726,7 +1726,7 @@ Routine Description: Arguments: - NewState - The requested, new power state for the device. + NewState - The requested, new power state for the device. Return Value: @@ -1737,29 +1737,29 @@ Note: To assist the driver, PortCls will pause any active audio streams prior to calling this method to place the device in a sleep state. After calling this method, PortCls - will unpause active audio streams, to wake the device up. Miniports can opt for + will unpause active audio streams, to wake the device up. Miniports can opt for additional notification by utilizing the IPowerNotify interface. - The miniport driver must perform the requested change to the device's power state - before it returns from the PowerChangeState call. If the miniport driver needs to - save or restore any device state before a power-state change, the miniport driver + The miniport driver must perform the requested change to the device's power state + before it returns from the PowerChangeState call. If the miniport driver needs to + save or restore any device state before a power-state change, the miniport driver should support the IPowerNotify interface, which allows it to receive advance warning - of any such change. Before returning from a successful PowerChangeState call, the + of any such change. Before returning from a successful PowerChangeState call, the miniport driver should cache the new power state. - While the miniport driver is in one of the sleep states (any state other than + While the miniport driver is in one of the sleep states (any state other than PowerDeviceD0), it must avoid writing to the hardware. The miniport driver must cache any hardware accesses that need to be deferred until the device powers up again. If - the power state is changing from one of the sleep states to PowerDeviceD0, the + the power state is changing from one of the sleep states to PowerDeviceD0, the miniport driver should perform any deferred hardware accesses after it has powered up - the device. If the power state is changing from PowerDeviceD0 to a sleep state, the + the device. If the power state is changing from PowerDeviceD0 to a sleep state, the miniport driver can perform any necessary hardware accesses during the PowerChangeState call before it powers down the device. While powered down, a miniport driver is never asked to create a miniport driver object or stream object. PortCls always places the device in the PowerDeviceD0 state before calling the miniport driver's NewStream method. - + --*/ { DPF_ENTER(("[CAdapterCommon::PowerChangeState]")); @@ -1791,15 +1791,15 @@ Note: m_PowerState = NewState.DeviceState; DPF - ( - D_VERBOSE, - ("Entering D%u", ULONG(m_PowerState) - ULONG(PowerDeviceD0)) + ( + D_VERBOSE, + ("Entering D%u", ULONG(m_PowerState) - ULONG(PowerDeviceD0)) ); break; - + default: - + DPF(D_VERBOSE, ("Unknown Device Power State")); break; } @@ -1810,20 +1810,20 @@ Note: #pragma code_seg() STDMETHODIMP_(NTSTATUS) CAdapterCommon::QueryDeviceCapabilities -( - _Inout_updates_bytes_(sizeof(DEVICE_CAPABILITIES)) PDEVICE_CAPABILITIES PowerDeviceCaps +( + _Inout_updates_bytes_(sizeof(DEVICE_CAPABILITIES)) PDEVICE_CAPABILITIES PowerDeviceCaps ) /*++ Routine Description: - Called at startup to get the caps for the device. This structure provides - the system with the mappings between system power state and device power - state. This typically will not need modification by the driver. + Called at startup to get the caps for the device. This structure provides + the system with the mappings between system power state and device power + state. This typically will not need modification by the driver. Arguments: - PowerDeviceCaps - The device's capabilities. + PowerDeviceCaps - The device's capabilities. Return Value: @@ -1842,14 +1842,14 @@ Return Value: #pragma code_seg() STDMETHODIMP_(NTSTATUS) CAdapterCommon::QueryPowerChangeState -( - _In_ POWER_STATE NewStateQuery +( + _In_ POWER_STATE NewStateQuery ) /*++ Routine Description: - Query to see if the device can change to this power state + Query to see if the device can change to this power state Arguments: @@ -1954,7 +1954,7 @@ Done: #pragma code_seg("PAGE") STDMETHODIMP_(NTSTATUS) CAdapterCommon::InstallSubdevice -( +( _In_opt_ PIRP Irp, _In_ PWSTR Name, _In_ REFGUID PortClassId, @@ -1975,34 +1975,34 @@ CAdapterCommon::InstallSubdevice Routine Description: - This function creates and registers a subdevice consisting of a port - driver, a minport driver and a set of resources bound together. It will - also optionally place a pointer to an interface on the port driver in a - specified location before initializing the port driver. This is done so - that a common ISR can have access to the port driver during - initialization, when the ISR might fire. + This function creates and registers a subdevice consisting of a port + driver, a minport driver and a set of resources bound together. It will + also optionally place a pointer to an interface on the port driver in a + specified location before initializing the port driver. This is done so + that a common ISR can have access to the port driver during + initialization, when the ISR might fire. Arguments: Irp - pointer to the irp object. Name - name of the miniport. Passes to PcRegisterSubDevice - + PortClassId - port class id. Passed to PcNewPort. MiniportClassId - miniport class id. Passed to PcNewMiniport. - MiniportCreate - pointer to a miniport creation function. If NULL, + MiniportCreate - pointer to a miniport creation function. If NULL, PcNewMiniport is used. - + DeviceContext - deviceType specific. - MiniportPair - endpoint configuration info. + MiniportPair - endpoint configuration info. ResourceList - pointer to the resource list. PortInterfaceId - GUID that represents the port interface. - + OutPortInterface - pointer to store the port interface OutPortUnknown - pointer to store the unknown port interface. @@ -2045,9 +2045,9 @@ Return Value: { if (MiniportCreate) { - ntStatus = + ntStatus = MiniportCreate - ( + ( &miniport, MiniportClassId, NULL, @@ -2059,10 +2059,10 @@ Return Value: } else { - ntStatus = + ntStatus = PcNewMiniport ( - (PMINIPORT *) &miniport, + (PMINIPORT *) &miniport, MiniportClassId ); } @@ -2078,14 +2078,14 @@ Return Value: // still succeed. // #pragma warning(disable:6387) - ntStatus = + ntStatus = port->Init - ( + ( m_pDeviceObject, Irp, miniport, adapterCommon, - ResourceList + ResourceList ); #pragma warning (pop) @@ -2093,12 +2093,12 @@ Return Value: { // Register the subdevice (port/miniport combination). // - ntStatus = + ntStatus = PcRegisterSubdevice - ( + ( m_pDeviceObject, Name, - port + port ); } } @@ -2109,31 +2109,31 @@ Return Value: { if (OutPortUnknown) { - ntStatus = + ntStatus = port->QueryInterface - ( + ( IID_IUnknown, - (PVOID *)OutPortUnknown + (PVOID *)OutPortUnknown ); } if (OutPortInterface) { - ntStatus = + ntStatus = port->QueryInterface - ( + ( PortInterfaceId, - (PVOID *) OutPortInterface + (PVOID *) OutPortInterface ); } if (OutMiniportUnknown) { - ntStatus = + ntStatus = miniport->QueryInterface - ( + ( IID_IUnknown, - (PVOID *)OutMiniportUnknown + (PVOID *)OutMiniportUnknown ); } @@ -2179,10 +2179,10 @@ Return Value: DPF_ENTER(("[CAdapterCommon::UnregisterSubdevice]")); ASSERT(m_pDeviceObject != NULL); - + NTSTATUS ntStatus = STATUS_SUCCESS; PUNREGISTERSUBDEVICE unregisterSubdevice = NULL; - + if (NULL == UnknownPort) { return ntStatus; @@ -2191,7 +2191,7 @@ Return Value: // // Get the IUnregisterSubdevice interface. // - ntStatus = UnknownPort->QueryInterface( + ntStatus = UnknownPort->QueryInterface( IID_IUnregisterSubdevice, (PVOID *)&unregisterSubdevice); @@ -2209,7 +2209,7 @@ Return Value: // unregisterSubdevice->Release(); } - + return ntStatus; } @@ -2239,9 +2239,9 @@ Return Value: { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::ConnectTopologies]")); - + ASSERT(m_pDeviceObject != NULL); - + NTSTATUS ntStatus = STATUS_SUCCESS; // @@ -2251,13 +2251,13 @@ Return Value: // for (ULONG i = 0; i < PhysicalConnectionCount && NT_SUCCESS(ntStatus); i++) { - + switch(PhysicalConnections[i].eType) { case CONNECTIONTYPE_TOPOLOGY_OUTPUT: ntStatus = PcRegisterPhysicalConnection - ( + ( m_pDeviceObject, UnknownTopology, PhysicalConnections[i].ulTopology, @@ -2272,7 +2272,7 @@ Return Value: case CONNECTIONTYPE_WAVE_OUTPUT: ntStatus = PcRegisterPhysicalConnection - ( + ( m_pDeviceObject, UnknownWave, PhysicalConnections[i].ulWave, @@ -2285,7 +2285,7 @@ Return Value: } break; } - } + } // // Cleanup in case of error. @@ -2326,9 +2326,9 @@ Return Value: { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::DisconnectTopologies]")); - + ASSERT(m_pDeviceObject != NULL); - + NTSTATUS ntStatus = STATUS_SUCCESS; NTSTATUS ntStatus2 = STATUS_SUCCESS; PUNREGISTERPHYSICALCONNECTION unregisterPhysicalConnection = NULL; @@ -2336,12 +2336,12 @@ Return Value: // // Get the IUnregisterPhysicalConnection interface // - ntStatus = UnknownTopology->QueryInterface( + ntStatus = UnknownTopology->QueryInterface( IID_IUnregisterPhysicalConnection, (PVOID *)&unregisterPhysicalConnection); - + if (NT_SUCCESS(ntStatus)) - { + { for (ULONG i = 0; i < PhysicalConnectionCount; i++) { switch(PhysicalConnections[i].eType) @@ -2382,9 +2382,9 @@ Return Value: { ntStatus = ntStatus2; } - } + } } - + // // Release the IUnregisterPhysicalConnection interface. // @@ -2576,7 +2576,7 @@ CAdapterCommon::Cleanup() STDMETHODIMP_(NTSTATUS) CAdapterCommon::InstallEndpointFilters ( - _In_opt_ PIRP Irp, + _In_opt_ PIRP Irp, _In_ PENDPOINT_MINIPAIR MiniportPair, _In_opt_ PVOID DeviceContext, _Out_opt_ PUNKNOWN * UnknownTopology, @@ -2587,7 +2587,7 @@ CAdapterCommon::InstallEndpointFilters { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::InstallEndpointFilters]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; PUNKNOWN unknownTopology = NULL; PUNKNOWN unknownWave = NULL; @@ -2606,7 +2606,7 @@ CAdapterCommon::InstallEndpointFilters { *UnknownWave = NULL; } - + if (UnknownMiniportTopology) { *UnknownMiniportTopology = NULL; @@ -2627,7 +2627,7 @@ CAdapterCommon::InstallEndpointFilters ntStatus = InstallSubdevice(Irp, MiniportPair->TopoName, // make sure this name matches with SYSVAD..szPname in the inf's [Strings] section CLSID_PortTopology, - CLSID_PortTopology, + CLSID_PortTopology, MiniportPair->TopoCreateCallback, MiniportPair->TopoInterfacePropertyCount, MiniportPair->TopoInterfaceProperties, @@ -2655,7 +2655,7 @@ CAdapterCommon::InstallEndpointFilters ntStatus = InstallSubdevice(Irp, MiniportPair->WaveName, // make sure this name matches with SYSVAD..szPname in the inf's [Strings] section CLSID_PortWaveRT, - CLSID_PortWaveRT, + CLSID_PortWaveRT, MiniportPair->WaveCreateCallback, MiniportPair->WaveInterfacePropertyCount, MiniportPair->WaveInterfaceProperties, @@ -2663,7 +2663,7 @@ CAdapterCommon::InstallEndpointFilters MiniportPair, NULL, IID_IPortWaveRT, - NULL, + NULL, &unknownWave, &unknownMiniWave ); @@ -2698,7 +2698,7 @@ CAdapterCommon::InstallEndpointFilters unknownTopology->AddRef(); *UnknownTopology = unknownTopology; } - + if (UnknownWave != NULL && unknownWave != NULL) { unknownWave->AddRef(); @@ -2724,14 +2724,14 @@ CAdapterCommon::InstallEndpointFilters UnregisterSubdevice(unknownTopology); RemoveCachedSubdevice(MiniportPair->TopoName); } - + if (bWaveCreated && unknownWave != NULL) { UnregisterSubdevice(unknownWave); RemoveCachedSubdevice(MiniportPair->WaveName); } } - + SAFE_RELEASE(unknownMiniTopo); SAFE_RELEASE(unknownTopology); SAFE_RELEASE(unknownMiniWave); @@ -2752,9 +2752,9 @@ CAdapterCommon::RemoveEndpointFilters { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::RemoveEndpointFilters]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + if (UnknownTopology != NULL && UnknownWave != NULL) { ntStatus = DisconnectTopologies( @@ -2769,7 +2769,7 @@ CAdapterCommon::RemoveEndpointFilters } } - + RemoveCachedSubdevice(MiniportPair->WaveName); ntStatus = UnregisterSubdevice(UnknownWave); @@ -2790,7 +2790,7 @@ CAdapterCommon::RemoveEndpointFilters // All Done. // ntStatus = STATUS_SUCCESS; - + return ntStatus; } @@ -2808,8 +2808,8 @@ CAdapterCommon::GetFilters { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::GetFilters]")); - - NTSTATUS ntStatus = STATUS_SUCCESS; + + NTSTATUS ntStatus = STATUS_SUCCESS; PUNKNOWN unknownTopologyPort = NULL; PUNKNOWN unknownTopologyMiniport = NULL; PUNKNOWN unknownWavePort = NULL; @@ -2866,7 +2866,7 @@ CAdapterCommon::SetIdlePowerManagement PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::SetIdlePowerManagement]")); - NTSTATUS ntStatus = STATUS_SUCCESS; + NTSTATUS ntStatus = STATUS_SUCCESS; IUnknown *pUnknown = NULL; PPORTCLSPOWER pPortClsPower = NULL; // refcounting disable requests. Each miniport is responsible for calling this in pairs, @@ -2878,7 +2878,7 @@ CAdapterCommon::SetIdlePowerManagement ntStatus = GetFilters(MiniportPair, NULL, NULL, &pUnknown, NULL); if (NT_SUCCESS(ntStatus)) { - ntStatus = + ntStatus = pUnknown->QueryInterface ( IID_IPortClsPower, @@ -2935,15 +2935,15 @@ Routine Description: Arguments: WorkItem - WDF work-item object. - + --*/ { PAGED_CODE(); DPF_ENTER(("[EvtBthHfpScoBypassInterfaceWorkItem]")); CAdapterCommon * This; - - if (WorkItem == NULL) + + if (WorkItem == NULL) { return; } @@ -2955,7 +2955,7 @@ Arguments: { PLIST_ENTRY le = NULL; BthHfpWorkTask * task = NULL; - + // // Retrieve a taask. // @@ -2967,7 +2967,7 @@ Arguments: InitializeListHead(le); } ExReleaseFastMutex(&This->m_BthHfpFastMutex); - + if (task == NULL) { break; @@ -2975,7 +2975,7 @@ Arguments: ASSERT(task->Device != NULL); _Analysis_assume_(task->Device != NULL); - + // // Process the task. // @@ -3023,7 +3023,7 @@ Routine Description: Arguments: SymbolicLinkName - interface's symbolic link. - + Return Value: BthHfpDevice pointer or NULL. @@ -3032,17 +3032,17 @@ Return Value: { PAGED_CODE(); DPF_ENTER(("[CAdapterCommon::BthHfpDeviceFind]")); - + PLIST_ENTRY le = NULL; BthHfpDevice * bthDevice = NULL; ExAcquireFastMutex(&m_BthHfpFastMutex); - + for (le = m_BthHfpDevices.Flink; le != &m_BthHfpDevices; le = le->Flink) { BthHfpDevice * tmpBthDevice = BthHfpDevice::GetBthHfpDevice(le); ASSERT(tmpBthDevice != NULL); - + PUNICODE_STRING unicodeStr = tmpBthDevice->GetSymbolicLinkName(); ASSERT(unicodeStr != NULL); @@ -3055,7 +3055,7 @@ Return Value: break; } } - + ExReleaseFastMutex(&m_BthHfpFastMutex); return bthDevice; @@ -3077,7 +3077,7 @@ Routine Description: Arguments: SymbolicLinkName - new interface's symbolic link. - + Return Value: NT status code. @@ -3090,7 +3090,7 @@ Return Value: NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDevice * bthDevice = NULL; BthHfpWorkTask * bthWorkTask = NULL; - + DPF(D_VERBOSE, ("BthHfpScoInterfaceArrival: SymbolicLinkName %wZ", SymbolicLinkName)); // @@ -3106,7 +3106,7 @@ Return Value: ntStatus = STATUS_SUCCESS; goto Done; } - + // // Alloc a new structure for this Bluetooth hands-free device. // @@ -3117,9 +3117,9 @@ Return Value: ntStatus = STATUS_INSUFFICIENT_RESOURCES; goto Done; } - + DPF(D_VERBOSE, ("BthHfpScoInterfaceArrival: created BthHfpDevice 0x%p ", bthDevice)); - + // // Basic initialization of the Bluetooth Hands-Free Profile interface. // The audio miniport creation is done later by the BthHfpDevice.Start() @@ -3139,7 +3139,7 @@ Return Value: ntStatus = STATUS_INSUFFICIENT_RESOURCES; goto Done; } - + // bthWorkTask->L.Size is set to sizeof(BthHfpWorkTask) in the Look Aside List configuration #pragma warning(suppress: 6386) RtlZeroMemory(bthWorkTask, sizeof(*bthWorkTask)); @@ -3147,9 +3147,9 @@ Return Value: InitializeListHead(&bthWorkTask->ListEntry); // Note that bthDevice has one reference at this point. bthWorkTask->Device = bthDevice; - + ExAcquireFastMutex(&m_BthHfpFastMutex); - + // // Insert this new Bluetooth HFP device in our list. // @@ -3165,13 +3165,13 @@ Return Value: // Schedule a work-item if not already running. // WdfWorkItemEnqueue(m_BthHfpWorkItem); - + ExReleaseFastMutex(&m_BthHfpFastMutex); Done: if (!NT_SUCCESS(ntStatus)) { - // Release the last ref, this will delete the BthHfpDevice + // Release the last ref, this will delete the BthHfpDevice SAFE_RELEASE(bthDevice); if (bthWorkTask != NULL) @@ -3180,7 +3180,7 @@ Done: bthWorkTask = NULL; } } - + return ntStatus; } @@ -3200,7 +3200,7 @@ Routine Description: Arguments: SymbolicLinkName - interface's symbolic link to remove. - + Return Value: NT status code. @@ -3213,7 +3213,7 @@ Return Value: NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDevice * bthDevice = NULL; BthHfpWorkTask * bthWorkTask = NULL; - + DPF(D_VERBOSE, ("BthHfpScoInterfaceRemoval: SymbolicLinkName %wZ", SymbolicLinkName)); // @@ -3227,7 +3227,7 @@ Return Value: ntStatus = STATUS_SUCCESS; goto Done; } - + // // Init a work task. // @@ -3238,7 +3238,7 @@ Return Value: ntStatus = STATUS_INSUFFICIENT_RESOURCES; goto Done; } - + // bthWorkTask->L.Size is set to sizeof(BthHfpWorkTask) in the Look Aside List configuration #pragma warning(suppress: 6386) RtlZeroMemory(bthWorkTask, sizeof(*bthWorkTask)); @@ -3248,7 +3248,7 @@ Return Value: bthWorkTask->Device = bthDevice; ExAcquireFastMutex(&m_BthHfpFastMutex); - + // // Remove this Bluetooth device from our list and release the associated reference. // @@ -3265,7 +3265,7 @@ Return Value: // Schedule a work-item if not already running. // WdfWorkItemEnqueue(m_BthHfpWorkItem); - + ExReleaseFastMutex(&m_BthHfpFastMutex); // @@ -3280,7 +3280,7 @@ Done: // Release the ref we got in find. SAFE_RELEASE(bthDevice); } - + return ntStatus; } @@ -3298,9 +3298,9 @@ Routine Description: This callback is invoked when a new HFP SCO Bypass interface is added or removed. Arguments: - NotificationPointer - Interface change notification + NotificationPointer - Interface change notification Context - CAdapterCommon ptr. - + Return Value: NT status code. @@ -3309,32 +3309,32 @@ Return Value: { PAGED_CODE(); DPF_ENTER(("[EvtBthHfpScoBypassInterfaceChange]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; CAdapterCommon * This = NULL; PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification = (PDEVICE_INTERFACE_CHANGE_NOTIFICATION) NotificationPointer; - + // // Make sure this is the interface class we extect. Any other class guid // is an error, but let it go since it is not fatal to the machine. // - if (!IsEqualGUID(Notification->InterfaceClassGuid, GUID_DEVINTERFACE_BLUETOOTH_HFP_SCO_HCIBYPASS)) + if (!IsEqualGUID(Notification->InterfaceClassGuid, GUID_DEVINTERFACE_BLUETOOTH_HFP_SCO_HCIBYPASS)) { DPF(D_VERBOSE, ("EvtBthHfpScoBypassInterfaceChange: bad interface ClassGuid")); ASSERTMSG("EvtBthHfpScoBypassInterfaceChange: bad interface ClassGuid ", FALSE); - + goto Done; } This = (CAdapterCommon *)Context; ASSERT(This != NULL); _Analysis_assume_(This != NULL); - + // - // Take action based on the event. Any other event type is an error, + // Take action based on the event. Any other event type is an error, // but let it go since it is not fatal to the machine. // - if (IsEqualGUID(Notification->Event, GUID_DEVICE_INTERFACE_ARRIVAL)) + if (IsEqualGUID(Notification->Event, GUID_DEVICE_INTERFACE_ARRIVAL)) { ntStatus = This->BthHfpScoInterfaceArrival(Notification->SymbolicLinkName); } @@ -3342,13 +3342,13 @@ Return Value: { ntStatus = This->BthHfpScoInterfaceRemoval(Notification->SymbolicLinkName); } - else + else { DPF(D_VERBOSE, ("EvtBthHfpScoBypassInterfaceChange: bad " "GUID_DEVINTERFACE_BLUETOOTH_HFP_SCO_HCIBYPASS event")); ASSERTMSG("EvtBthHfpScoBypassInterfaceChange: bad " "GUID_DEVINTERFACE_BLUETOOTH_HFP_SCO_HCIBYPASS event ", FALSE); - + goto Done; } @@ -3379,7 +3379,7 @@ Return Value: WDF_WORKITEM_CONFIG wiConfig; WDF_OBJECT_ATTRIBUTES attributes; BthHfpWorkItemContext * wiContext; - + // // Init spin-lock, linked lists, work-item, event, etc. // Init all members to default values. This basic init should not fail. @@ -3396,7 +3396,7 @@ Return Value: POOL_NX_ALLOCATION, m_BhtHfpWorkTaskPoolElementSize, MINADAPTER_POOLTAG, - 0); + 0); // // Enable Bluetooth HFP SCO-Bypass Cleanup. // Do any allocation/initialization that can fail after this point. @@ -3421,7 +3421,7 @@ Return Value: wiContext = GetBthHfpWorkItemContext(m_BthHfpWorkItem); wiContext->Adapter = this; // weak ref. - + // // Register for bluetooth heandsfree profile interface changes. // @@ -3470,7 +3470,7 @@ Routine Description: { return; } - + // // Unregister for bluetooth heandsfree profile interface changes. // @@ -3489,20 +3489,20 @@ Routine Description: WdfObjectDelete(m_BthHfpWorkItem); m_BthHfpWorkItem = NULL; } - + ASSERT(IsListEmpty(&m_BthHfpWorkTasks)); - + // - // Stop and delete all BthHfpDevices. We are the only thread accessing this list, + // Stop and delete all BthHfpDevices. We are the only thread accessing this list, // so there is no need to acquire the mutex. // while (!IsListEmpty(&m_BthHfpDevices)) { BthHfpDevice * bthDevice = NULL; PLIST_ENTRY le = NULL; - + le = RemoveHeadList(&m_BthHfpDevices); - + bthDevice = BthHfpDevice::GetBthHfpDevice(le); InitializeListHead(le); @@ -3512,9 +3512,9 @@ Routine Description: // This should be the last reference. bthDevice->Release(); } - + ASSERT(IsListEmpty(&m_BthHfpDevices)); - + // // General cleanup. // @@ -3531,9 +3531,9 @@ Routine Description: #pragma code_seg("PAGE") STDMETHODIMP BthHfpDevice::NonDelegatingQueryInterface -( +( _In_ REFIID Interface, - _COM_Outptr_ PVOID * Object + _COM_Outptr_ PVOID * Object ) /*++ @@ -3543,7 +3543,7 @@ Routine Description: Arguments: - Interface - + Interface - Object - @@ -3580,7 +3580,7 @@ Return Value: } // NonDelegatingQueryInterface //============================================================================= -// Dummy stubs to override the default WDF behavior of closing the target +// Dummy stubs to override the default WDF behavior of closing the target // on query remove. This driver closes and deletes the supporting objects // when the target removes the BTH HFP SCO Bypass interface. // @@ -3588,13 +3588,13 @@ Return Value: #pragma code_seg("PAGE") NTSTATUS BthHfpDevice::EvtBthHfpTargetQueryRemove -( +( _In_ WDFIOTARGET IoTarget ) { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::EvtBthHfpTargetQueryRemove]")); - + UNREFERENCED_PARAMETER(IoTarget); return STATUS_SUCCESS; } @@ -3602,25 +3602,25 @@ BthHfpDevice::EvtBthHfpTargetQueryRemove #pragma code_seg("PAGE") VOID BthHfpDevice::EvtBthHfpTargetRemoveCanceled -( +( _In_ WDFIOTARGET IoTarget ) { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::EvtBthHfpTargetRemoveCanceled]")); - + UNREFERENCED_PARAMETER(IoTarget); } #pragma code_seg("PAGE") VOID BthHfpDevice::EvtBthHfpTargetRemoveComplete -( +( _In_ WDFIOTARGET IoTarget ) { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::EvtBthHfpTargetRemoveComplete]")); - + UNREFERENCED_PARAMETER(IoTarget); } @@ -3629,7 +3629,7 @@ BthHfpDevice::EvtBthHfpTargetRemoveComplete NTSTATUS BthHfpDevice::Init ( - _In_ CAdapterCommon * Adapter, + _In_ CAdapterCommon * Adapter, _In_ PUNICODE_STRING SymbolicLinkName ) { @@ -3644,7 +3644,7 @@ BthHfpDevice::Init WDF_WORKITEM_CONFIG wiConfig; AddRef(); // first ref. - + // // Basic init of all the class' members. // @@ -3662,13 +3662,13 @@ BthHfpDevice::Init m_Descriptor = NULL; m_VolumePropValues = NULL; - // Notification updates. + // Notification updates. m_SpeakerVolumeLevel = 0; m_MicVolumeLevel = 0; m_ConnectionStatusLong = FALSE; m_StreamStatusLong = STATUS_INVALID_DEVICE_STATE; // Sco stream is not open. m_NRECDisableStatusLong = FALSE; - + m_StreamReq = NULL; m_SpeakerVolumeReq = NULL; m_MicVolumeReq = NULL; @@ -3677,21 +3677,21 @@ BthHfpDevice::Init m_WorkItem = NULL; m_ReqCollection = NULL; - + m_nStreams = 0; KeInitializeEvent(&m_StreamStatusEvent, NotificationEvent, TRUE); InitializeListHead(&m_ListEntry); KeInitializeSpinLock(&m_Lock); - + RtlZeroMemory(&m_SymbolicLinkName, sizeof(m_SymbolicLinkName)); - + RtlZeroMemory(&m_SpeakerVolumeCallback, sizeof(m_SpeakerVolumeCallback)); RtlZeroMemory(&m_SpeakerConnectionStatusCallback, sizeof(m_SpeakerConnectionStatusCallback)); RtlZeroMemory(&m_MicVolumeCallback, sizeof(m_MicVolumeCallback)); RtlZeroMemory(&m_MicConnectionStatusCallback, sizeof(m_MicConnectionStatusCallback)); - + // // Allocate a notification WDF work-item. // @@ -3719,12 +3719,12 @@ BthHfpDevice::Init ntStatus = WdfCollectionCreate( &attributes, &m_ReqCollection); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Init: WdfCollectionCreate failed: 0x%x", ntStatus)), Done); - + // // Open the target interface. // @@ -3741,18 +3741,18 @@ BthHfpDevice::Init WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME( &openParams, SymbolicLinkName, - STANDARD_RIGHTS_ALL); - + STANDARD_RIGHTS_ALL); + openParams.EvtIoTargetQueryRemove = EvtBthHfpTargetQueryRemove; openParams.EvtIoTargetRemoveCanceled = EvtBthHfpTargetRemoveCanceled; openParams.EvtIoTargetRemoveComplete = EvtBthHfpTargetRemoveComplete; - + ntStatus = WdfIoTargetOpen(m_WdfIoTarget, &openParams); IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Init: WdfIoTargetOpen(%wZ) failed: 0x%x", SymbolicLinkName, ntStatus)), Done); - + // // Make a copy of the symbolic link name. // @@ -3765,20 +3765,20 @@ BthHfpDevice::Init { ntStatus = STATUS_INSUFFICIENT_RESOURCES; } - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Init: ExAllocatePoolWithTag failed, out of memory")), Done); - + RtlCopyUnicodeString(&m_SymbolicLinkName, SymbolicLinkName); // // Allocate the WDF requests for status notifications. // - + // - // IOCTL_BTHHFP_DEVICE_GET_NRECDISABLE_STATUS_UPDATE + // IOCTL_BTHHFP_DEVICE_GET_NRECDISABLE_STATUS_UPDATE // WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, BthHfpDeviceNotificationReqContext); attributes.ParentObject = m_Adapter->GetWdfDevice(); @@ -3794,7 +3794,7 @@ BthHfpDevice::Init // Init context. reqCtx = GetBthHfpDeviceNotificationReqContext(m_NRECDisableStatusReq); reqCtx->BthHfpDevice = this; // weak ref. - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3804,7 +3804,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3814,9 +3814,9 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + // - // IOCTL_BTHHFP_SPEAKER_GET_VOLUME_STATUS_UPDATE + // IOCTL_BTHHFP_SPEAKER_GET_VOLUME_STATUS_UPDATE // WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, BthHfpDeviceNotificationReqContext); attributes.ParentObject = m_Adapter->GetWdfDevice(); @@ -3832,7 +3832,7 @@ BthHfpDevice::Init // Init context. reqCtx = GetBthHfpDeviceNotificationReqContext(m_SpeakerVolumeReq); reqCtx->BthHfpDevice = this; // weak ref. - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3842,7 +3842,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3852,7 +3852,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + // // IOCTL_BTHHFP_MIC_GET_VOLUME_STATUS_UPDATE // @@ -3866,11 +3866,11 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfRequestCreate(Mic-Volume) failed, 0x%x", ntStatus)), Done); - + // Init context. reqCtx = GetBthHfpDeviceNotificationReqContext(m_MicVolumeReq); reqCtx->BthHfpDevice = this; // weak ref. - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3880,7 +3880,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3890,7 +3890,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + // // IOCTL_BTHHFP_DEVICE_GET_CONNECTION_STATUS_UPDATE // @@ -3904,11 +3904,11 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfRequestCreate(Connection-Status) failed, 0x%x", ntStatus)), Done); - + // Init context. reqCtx = GetBthHfpDeviceNotificationReqContext(m_ConnectionReq); reqCtx->BthHfpDevice = this; // weak ref. - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3918,7 +3918,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3928,7 +3928,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + // // IOCTL_BTHHFP_STREAM_GET_STATUS_UPDATE // @@ -3942,11 +3942,11 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfRequestCreate(Stream-Status) failed, 0x%x", ntStatus)), Done); - + // Init context. reqCtx = GetBthHfpDeviceNotificationReqContext(m_StreamReq); reqCtx->BthHfpDevice = this; // weak ref. - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3956,7 +3956,7 @@ BthHfpDevice::Init ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), Done); - + ntStatus = WdfMemoryCreatePreallocated( WDF_NO_OBJECT_ATTRIBUTES, &reqCtx->Buffer, @@ -3965,14 +3965,14 @@ BthHfpDevice::Init IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Init: WdfMemoryCreatePreallocated failed, 0x%x", ntStatus)), - Done); - + Done); + // // This remote device is now in running state. No need to use interlock operations // b/c at this time this is the only thread accessing this info. // m_State = eBthHfpStateRunning; - + // // Init successful. // @@ -3985,8 +3985,8 @@ Done: //============================================================================= #pragma code_seg("PAGE") BthHfpDevice::~BthHfpDevice -( - void +( + void ) /*++ @@ -4007,7 +4007,7 @@ Return Value: ASSERT(m_State != eBthHfpStateRunning); ASSERT(IsListEmpty(&m_ListEntry)); - + // // Release ref to remote stack. // @@ -4058,7 +4058,7 @@ Return Value: WdfObjectDelete(ctx->MemIn); ctx->MemIn = NULL; } - + if (ctx->MemOut != NULL) { WdfObjectDelete(ctx->MemOut); @@ -4069,7 +4069,7 @@ Return Value: WdfObjectDelete(m_SpeakerVolumeReq); m_SpeakerVolumeReq = NULL; } - + if (m_MicVolumeReq != NULL) { BthHfpDeviceNotificationReqContext * ctx; @@ -4081,7 +4081,7 @@ Return Value: WdfObjectDelete(ctx->MemIn); ctx->MemIn = NULL; } - + if (ctx->MemOut != NULL) { WdfObjectDelete(ctx->MemOut); @@ -4092,7 +4092,7 @@ Return Value: WdfObjectDelete(m_MicVolumeReq); m_MicVolumeReq = NULL; } - + if (m_ConnectionReq != NULL) { BthHfpDeviceNotificationReqContext * ctx; @@ -4104,7 +4104,7 @@ Return Value: WdfObjectDelete(ctx->MemIn); ctx->MemIn = NULL; } - + if (ctx->MemOut != NULL) { WdfObjectDelete(ctx->MemOut); @@ -4115,7 +4115,7 @@ Return Value: WdfObjectDelete(m_ConnectionReq); m_ConnectionReq = NULL; } - + if (m_StreamReq != NULL) { BthHfpDeviceNotificationReqContext * ctx; @@ -4127,7 +4127,7 @@ Return Value: WdfObjectDelete(ctx->MemIn); ctx->MemIn = NULL; } - + if (ctx->MemOut != NULL) { WdfObjectDelete(ctx->MemOut); @@ -4159,13 +4159,13 @@ Return Value: ASSERT(m_UnknownSpeakerTopology == NULL); SAFE_RELEASE(m_UnknownSpeakerTopology); - + ASSERT(m_UnknownSpeakerWave == NULL); SAFE_RELEASE(m_UnknownSpeakerWave); - + ASSERT(m_UnknownMicTopology == NULL); SAFE_RELEASE(m_UnknownMicTopology); - + ASSERT(m_UnknownMicWave == NULL); SAFE_RELEASE(m_UnknownMicWave); @@ -4175,10 +4175,10 @@ Return Value: ASSERT(m_SpeakerConnectionStatusCallback.Handler == NULL); ASSERT(m_MicVolumeCallback.Handler == NULL); ASSERT(m_MicConnectionStatusCallback.Handler == NULL); -} // ~CAdapterCommon +} // ~CAdapterCommon // -// IBthHfpDeviceCommon implementation. +// IBthHfpDeviceCommon implementation. // //============================================================================= @@ -4188,7 +4188,7 @@ BthHfpDevice::IsVolumeSupported() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::IsVolumeSupported]")); - + return m_Descriptor->SupportsVolume; } @@ -4197,16 +4197,16 @@ BthHfpDevice::IsVolumeSupported() PKSPROPERTY_VALUES BthHfpDevice::GetVolumeSettings ( - _Out_ PULONG Size + _Out_ PULONG Size ) { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetVolumeSettings]")); ASSERT(Size != NULL); - + *Size = m_Descriptor->VolumePropertyValuesSize; - + return m_VolumePropValues; } @@ -4217,7 +4217,7 @@ BthHfpDevice::GetSpeakerVolume() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetSpeakerVolume]")); - + return InterlockedCompareExchange(&m_SpeakerVolumeLevel, 0, 0); } @@ -4231,7 +4231,7 @@ BthHfpDevice::SetSpeakerVolume { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetSpeakerVolume]")); - + return SetBthHfpSpeakerVolume(Volume); } @@ -4242,7 +4242,7 @@ BthHfpDevice::GetMicVolume() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetMicVolume]")); - + return InterlockedCompareExchange(&m_MicVolumeLevel, 0, 0); } @@ -4256,7 +4256,7 @@ BthHfpDevice::SetMicVolume { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetMicVolume]")); - + return SetBthHfpMicVolume(Volume); } @@ -4267,7 +4267,7 @@ BthHfpDevice::GetConnectionStatus() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetConnectionStatus]")); - + return (BOOL)InterlockedCompareExchange(&m_ConnectionStatusLong, 0, 0); } @@ -4333,7 +4333,7 @@ BthHfpDevice::Connect() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::Connect]")); - + return SetBthHfpConnect(); } @@ -4344,7 +4344,7 @@ BthHfpDevice::Disconnect() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::Disconnect]")); - + return SetBthHfpDisconnect(); } @@ -4374,12 +4374,12 @@ BthHfpDevice::StreamOpen() LONG nStreams = 0; ASSERT(m_nStreams >= 0); - + nStreams = InterlockedIncrement(&m_nStreams); if (nStreams == 1) { BOOLEAN streamOpen = FALSE; - + ntStatus = SetBthHfpStreamOpen(); if (NT_SUCCESS(ntStatus)) { @@ -4416,19 +4416,19 @@ BthHfpDevice::StreamClose() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::StreamClose]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; LONG nStreams = 0; ASSERT(m_nStreams > 0); - + nStreams = InterlockedDecrement(&m_nStreams); if (nStreams == 0) { ntStatus = SetBthHfpStreamClose(); - + StopBthHfpStreamStatusNotification(); - + m_StreamStatus = STATUS_INVALID_DEVICE_STATE; } @@ -4442,7 +4442,7 @@ BthHfpDevice::GetContainerId() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetContainerId]")); - + return m_Descriptor->ContainerId; } @@ -4459,7 +4459,7 @@ BthHfpDevice::SetSpeakerVolumeHandler DPF_ENTER(("[BthHfpDevice::SetSpeakerVolumeHandler]")); ASSERT(EventHandler == NULL || m_SpeakerVolumeCallback.Handler == NULL); - + m_SpeakerVolumeCallback.Handler = EventHandler; // weak ref. m_SpeakerVolumeCallback.Context = EventHandlerContext; } @@ -4475,9 +4475,9 @@ BthHfpDevice::SetSpeakerConnectionStatusHandler { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetSpeakerConnectionStatusHandler]")); - + ASSERT(EventHandler == NULL || m_SpeakerConnectionStatusCallback.Handler == NULL); - + m_SpeakerConnectionStatusCallback.Handler = EventHandler; // weak ref. m_SpeakerConnectionStatusCallback.Context = EventHandlerContext; } @@ -4493,9 +4493,9 @@ BthHfpDevice::SetMicVolumeHandler { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetMicVolumeHandler]")); - + ASSERT(EventHandler == NULL || m_MicVolumeCallback.Handler == NULL); - + m_MicVolumeCallback.Handler = EventHandler; // weak ref. m_MicVolumeCallback.Context = EventHandlerContext; } @@ -4511,9 +4511,9 @@ BthHfpDevice::SetMicConnectionStatusHandler { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetMicConnectionStatusHandler]")); - + ASSERT(EventHandler == NULL || m_MicConnectionStatusCallback.Handler == NULL); - + m_MicConnectionStatusCallback.Handler = EventHandler; // weak ref. m_MicConnectionStatusCallback.Context = EventHandlerContext; } @@ -4525,7 +4525,7 @@ BthHfpDevice::IsNRECSupported() { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::IsNRECSupported]")); - + return m_Descriptor->SupportsNREC; } @@ -4547,7 +4547,7 @@ BthHfpDevice::GetNRECDisableStatus() //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::SendIoCtrlAsynchronously ( _In_ WDFREQUEST Request, @@ -4567,7 +4567,7 @@ Routine Description: --*/ { DPF_ENTER(("[BthHfpDevice::SendIoCtrlAsynchronously]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BOOLEAN fSent = FALSE; @@ -4601,7 +4601,7 @@ Routine Description: { ntStatus = STATUS_INVALID_DEVICE_STATE; } - + DPF(D_ERROR, ("SendIoCtrlAsynchronously: WdfRequestSend(0x%x) failed, 0x%x", IoControlCode, ntStatus)); goto Done; } @@ -4618,7 +4618,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SendIoCtrlSynchronously ( _In_opt_ WDFREQUEST Request, @@ -4640,7 +4640,7 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SendIoCtrlSynchronously]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; PWDF_MEMORY_DESCRIPTOR memInPtr = NULL; PWDF_MEMORY_DESCRIPTOR memOutPtr = NULL; @@ -4662,14 +4662,14 @@ Routine Description: WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&memOut, Buffer, OutLength); memOutPtr = &memOut; } - + WDF_REQUEST_SEND_OPTIONS_INIT( - &reqOpts, - WDF_REQUEST_SEND_OPTION_TIMEOUT | + &reqOpts, + WDF_REQUEST_SEND_OPTION_TIMEOUT | WDF_REQUEST_SEND_OPTION_SYNCHRONOUS); reqOpts.Timeout = WDF_REL_TIMEOUT_IN_SEC(BTH_HFP_SYNC_REQ_TIMEOUT_IN_SEC); - + ntStatus = WdfIoTargetSendIoctlSynchronously( m_WdfIoTarget, Request, @@ -4678,7 +4678,7 @@ Routine Description: memOutPtr, &reqOpts, NULL); // bytes returned. - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_VERBOSE, ("SendIoCtrlSynchronously: WdfIoTargetSendIoctlSynchronously(0x%x) failed, 0x%x", IoControlCode, ntStatus)), @@ -4705,7 +4705,7 @@ Routine Description: Arguments: WorkItem - WDF work-item object. - + --*/ { DPF_ENTER(("[BthHfpDevice::EvtBthHfpDeviceNotificationStatusWorkItem]")); @@ -4713,8 +4713,8 @@ Arguments: NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDevice * This; KIRQL oldIrql; - - if (WorkItem == NULL) + + if (WorkItem == NULL) { return; } @@ -4724,11 +4724,11 @@ Arguments: for (;;) { - BOOL resend = TRUE; + BOOL resend = TRUE; WDFREQUEST req = NULL; BthHfpDeviceNotificationReqContext * reqCtx; WDF_REQUEST_COMPLETION_PARAMS params; - + // // Retrieve a task. // @@ -4750,10 +4750,10 @@ Arguments: // WDF_REQUEST_COMPLETION_PARAMS_INIT(¶ms); WdfRequestGetCompletionParams(req, ¶ms); - + reqCtx = GetBthHfpDeviceNotificationReqContext(req); ASSERT(reqCtx != NULL); - + // // Handle this notification. // @@ -4766,7 +4766,7 @@ Arguments: InterlockedExchange(&This->m_NRECDisableStatusLong, (LONG)reqCtx->Buffer.BoolStatus); } break; - + case IOCTL_BTHHFP_SPEAKER_GET_VOLUME_STATUS_UPDATE: { LONG oldVolume; @@ -4783,7 +4783,7 @@ Arguments: } } break; - + case IOCTL_BTHHFP_MIC_GET_VOLUME_STATUS_UPDATE: { LONG oldVolume; @@ -4814,7 +4814,7 @@ Arguments: This->m_SpeakerConnectionStatusCallback.Handler( This->m_SpeakerConnectionStatusCallback.Context); } - + if (This->m_MicConnectionStatusCallback.Handler != NULL) { This->m_MicConnectionStatusCallback.Handler( @@ -4827,7 +4827,7 @@ Arguments: default: // This should never happen. resend = FALSE; - DPF(D_ERROR, ("EvtBthHfpDeviceNotificationStatusWorkItem: invalid request ctrl 0x%x", + DPF(D_ERROR, ("EvtBthHfpDeviceNotificationStatusWorkItem: invalid request ctrl 0x%x", params.Parameters.Ioctl.IoControlCode)); break; } @@ -4836,19 +4836,19 @@ Arguments: if (resend) { WDF_REQUEST_REUSE_PARAMS reuseParams; - + WDF_REQUEST_REUSE_PARAMS_INIT( - &reuseParams, + &reuseParams, WDF_REQUEST_REUSE_NO_FLAGS, STATUS_SUCCESS); - + ntStatus = WdfRequestReuse(req, &reuseParams); if (!NT_SUCCESS(ntStatus)) { DPF(D_ERROR, ("EvtBthHfpDeviceNotificationStatusWorkItem: WdfRequestReuse failed, 0x%x", ntStatus)); break; } - + // Resend status notification request. reqCtx->Buffer.bImmediate = FALSE; @@ -4859,11 +4859,11 @@ Arguments: reqCtx->MemOut, EvtBthHfpDeviceNotificationStatusCompletion, This); - + if (!NT_SUCCESS(ntStatus)) { DPF(D_ERROR, ("EvtBthHfpDeviceNotificationStatusWorkItem: SendIoCtrlAsynchronously" - "(0x%x) failed, 0x%x", + "(0x%x) failed, 0x%x", params.Parameters.Ioctl.IoControlCode, ntStatus)); break; } @@ -4873,7 +4873,7 @@ Arguments: //============================================================================= #pragma code_seg() -void +void BthHfpDevice::EvtBthHfpDeviceNotificationStatusCompletion ( _In_ WDFREQUEST Request, @@ -4883,15 +4883,15 @@ BthHfpDevice::EvtBthHfpDeviceNotificationStatusCompletion ) { DPF_ENTER(("[BthHfpDevice::EvtBthHfpDeviceNotificationStatusCompletion]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; BthHfpDevice * This = NULL; KIRQL oldIrql; - + UNREFERENCED_PARAMETER(Target); UNREFERENCED_PARAMETER(Context); - + ctx = GetBthHfpDeviceNotificationReqContext(Request); This = ctx->BthHfpDevice; ASSERT(This != NULL); @@ -4920,7 +4920,7 @@ BthHfpDevice::EvtBthHfpDeviceNotificationStatusCompletion ctx->Errors = 0; } - // + // // Let the work-item thread process this request. // KeAcquireSpinLock(&This->m_Lock, &oldIrql); @@ -4938,7 +4938,7 @@ Done:; //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::GetBthHfpDescriptor ( _Out_ PBTHHFP_DESCRIPTOR2 * Descriptor @@ -4954,15 +4954,15 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetBthHfpDescriptor]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; WDFREQUEST req = NULL; PBTHHFP_DESCRIPTOR2 descriptor = NULL; ULONG length = 0; ULONG_PTR information = 0; - WDF_REQUEST_REUSE_PARAMS reuseParams; + WDF_REQUEST_REUSE_PARAMS reuseParams; WDF_OBJECT_ATTRIBUTES attributes; - + *Descriptor = NULL; // @@ -4988,30 +4988,30 @@ Routine Description: NULL, NULL, NULL); - + if (ntStatus != STATUS_BUFFER_TOO_SMALL) { if (NT_SUCCESS(ntStatus)) { ntStatus = STATUS_INVALID_DEVICE_STATE; } - + DPF(D_ERROR, ("GetBthHfpDescriptor: SendIoCtrlSynchronously(IOCTL_BTHHFP_DEVICE_GET_DESCRIPTOR2): failed, 0x%x", ntStatus)); goto Done; } - + ntStatus = STATUS_SUCCESS; information = WdfRequestGetInformation(req); if (information == 0 || information > ULONG_MAX) { - ntStatus = STATUS_INVALID_DEVICE_STATE; + ntStatus = STATUS_INVALID_DEVICE_STATE; DPF(D_ERROR, ("GetBthHfpDescriptor: IOCTL_BTHHFP_DEVICE_GET_DESCRIPTOR2 buffer too big (%Id): 0x%x", information, ntStatus)); goto Done; } length = (ULONG)information; - + // // Allocate memory needed to hold the info. // @@ -5029,16 +5029,16 @@ Routine Description: // Get the Bth HFP SCO Bypass descriptor. // WDF_REQUEST_REUSE_PARAMS_INIT( - &reuseParams, + &reuseParams, WDF_REQUEST_REUSE_NO_FLAGS, STATUS_SUCCESS); - + ntStatus = WdfRequestReuse(req, &reuseParams); IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("GetBthHfpDescriptor: WdfRequestReuse failed, 0x%x", ntStatus)), Done); - + ntStatus = SendIoCtrlSynchronously( req, IOCTL_BTHHFP_DEVICE_GET_DESCRIPTOR2, @@ -5055,14 +5055,14 @@ Routine Description: // *Descriptor = descriptor; ntStatus = STATUS_SUCCESS; - + Done: if (!NT_SUCCESS(ntStatus)) { if (descriptor != NULL) { ExFreePoolWithTag(descriptor, MINADAPTER_POOLTAG); - } + } } if (req != NULL) @@ -5070,25 +5070,25 @@ Done: WdfObjectDelete(req); req = NULL; } - + return ntStatus; } //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::EnableBthHfpNrecDisableStatusNotification() /*++ Routine Description: - This function registers for Bluetooth Hands-Free Profile SCO Bypass NREC-Disable - status change notification. + This function registers for Bluetooth Hands-Free Profile SCO Bypass NREC-Disable + status change notification. --*/ { DPF_ENTER(("[BthHfpDevice::EnableBthHfpNrecDisableStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; @@ -5097,8 +5097,8 @@ Routine Description: // // This is a notification request. // - ctx->Buffer.bImmediate = FALSE; - + ctx->Buffer.bImmediate = FALSE; + // // Get the Bth HFP SCO Bypass NREC-Disable status (async). // @@ -5109,7 +5109,7 @@ Routine Description: ctx->MemOut, EvtBthHfpDeviceNotificationStatusCompletion, this); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("EnableBthHfpNrecDisableStatusNotification: SendIoCtrlAsynchronously(IOCTL_BTHHFP_DEVICE_GET_NRECDISABLE_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5119,7 +5119,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5127,7 +5127,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::GetBthHfpVolumePropertyValues ( _In_ ULONG Length, @@ -5144,10 +5144,10 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetBthHfpVolumePropertyValues]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; PKSPROPERTY_VALUES propValues = NULL; - + *PropValues = NULL; // @@ -5168,11 +5168,11 @@ Routine Description: // ntStatus = SendIoCtrlSynchronously( NULL, - IOCTL_BTHHFP_DEVICE_GET_VOLUMEPROPERTYVALUES, - 0, - Length, + IOCTL_BTHHFP_DEVICE_GET_VOLUMEPROPERTYVALUES, + 0, + Length, propValues); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("GetBthHfpVolumePropertyValues: SendIoCtrlSynchronously(IOCTL_BTHHFP_DEVICE_GET_VOLUMEPROPERTYVALUES) failed, 0x%x", ntStatus)), @@ -5183,25 +5183,25 @@ Routine Description: // *PropValues = propValues; ntStatus = STATUS_SUCCESS; - + Done: if (!NT_SUCCESS(ntStatus)) { if (propValues != NULL) { ExFreePoolWithTag(propValues, MINADAPTER_POOLTAG); - } + } } - + return ntStatus; } //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpSpeakerVolume ( - _In_ LONG Volume + _In_ LONG Volume ) /*++ @@ -5214,9 +5214,9 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpSpeakerVolume]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + // // Get the Bth HFP SCO Bypass speaker volume. // @@ -5226,7 +5226,7 @@ Routine Description: sizeof(Volume), 0, &Volume); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("SetBthHfpSpeakerVolume: SendIoCtrlSynchronously(IOCTL_BTHHFP_SPEAKER_SET_VOLUME) failed, 0x%x", ntStatus)), @@ -5236,7 +5236,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5244,10 +5244,10 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::GetBthHfpSpeakerVolume ( - _Out_ LONG * Volume + _Out_ LONG * Volume ) /*++ @@ -5260,14 +5260,14 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetBthHfpSpeakerVolume]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationBuffer buffer = {0}; *Volume = 0; - + buffer.bImmediate = TRUE; - + // // Get the Bth HFP SCO Bypass speaker volume. // @@ -5277,7 +5277,7 @@ Routine Description: sizeof(buffer.bImmediate), sizeof(buffer.Volume), &buffer); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("GetBthHfpSpeakerVolume: SendIoCtrlSynchronously(IOCTL_BTHHFP_SPEAKER_GET_VOLUME_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5288,7 +5288,7 @@ Routine Description: // *Volume = buffer.Volume; ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5296,19 +5296,19 @@ Done: //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::EnableBthHfpSpeakerVolumeStatusNotification() /*++ Routine Description: - This function registers for Bluetooth Hands-Free Profile SCO Bypass speaker - volume change notification. + This function registers for Bluetooth Hands-Free Profile SCO Bypass speaker + volume change notification. --*/ { DPF_ENTER(("[BthHfpDevice::EnableBthHfpSpeakerVolumeStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; @@ -5317,8 +5317,8 @@ Routine Description: // // This is a notification request. // - ctx->Buffer.bImmediate = FALSE; - + ctx->Buffer.bImmediate = FALSE; + // // Register for speaker volume updates. // @@ -5329,7 +5329,7 @@ Routine Description: ctx->MemOut, EvtBthHfpDeviceNotificationStatusCompletion, this); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("EnableBthHfpSpeakerVolumeStatusNotification: SendIoCtrlAsynchronously(IOCTL_BTHHFP_SPEAKER_GET_VOLUME_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5339,7 +5339,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5347,10 +5347,10 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpMicVolume ( - _In_ LONG Volume + _In_ LONG Volume ) /*++ @@ -5363,9 +5363,9 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpMicVolume]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + // // Get the Bth HFP SCO Bypass mic volume. // @@ -5375,7 +5375,7 @@ Routine Description: sizeof(Volume), 0, &Volume); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("SetBthHfpMicVolume: SendIoCtrlSynchronously(IOCTL_BTHHFP_MIC_SET_VOLUME) failed, 0x%x", ntStatus)), @@ -5385,7 +5385,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5393,10 +5393,10 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::GetBthHfpMicVolume ( - _Out_ LONG * Volume + _Out_ LONG * Volume ) /*++ @@ -5409,14 +5409,14 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetBthHfpMicVolume]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationBuffer buffer = {0}; - + *Volume = 0; - + buffer.bImmediate = TRUE; - + // // Get the Bth HFP SCO Bypass mic volume. // @@ -5426,7 +5426,7 @@ Routine Description: sizeof(buffer.bImmediate), sizeof(buffer.Volume), &buffer); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("GetBthHfpMicVolume: SendIoCtrlSynchronously(IOCTL_BTHHFP_MIC_GET_VOLUME_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5437,7 +5437,7 @@ Routine Description: // *Volume = buffer.Volume; ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5445,29 +5445,29 @@ Done: //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::EnableBthHfpMicVolumeStatusNotification() /*++ Routine Description: - This function registers for Bluetooth Hands-Free Profile SCO Bypass mic - volume change notification. + This function registers for Bluetooth Hands-Free Profile SCO Bypass mic + volume change notification. --*/ { DPF_ENTER(("[BthHfpDevice::EnableBthHfpMicVolumeStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; ctx = GetBthHfpDeviceNotificationReqContext(m_MicVolumeReq); - + // // This is a notification request. // - ctx->Buffer.bImmediate = FALSE; - + ctx->Buffer.bImmediate = FALSE; + // // Register for mic volume updates. // @@ -5478,7 +5478,7 @@ Routine Description: ctx->MemOut, EvtBthHfpDeviceNotificationStatusCompletion, this); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("EnableBthHfpMicVolumeStatusNotification: SendIoCtrlAsynchronously(IOCTL_BTHHFP_MIC_GET_VOLUME_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5488,7 +5488,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5496,10 +5496,10 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::GetBthHfpConnectionStatus ( - _Out_ BOOL * ConnectionStatus + _Out_ BOOL * ConnectionStatus ) /*++ @@ -5512,12 +5512,12 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::GetBthHfpConnectionStatus]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BOOL bValue = TRUE; // In: bImmediate, Out: value. - + *ConnectionStatus = 0; - + // // Get the Bth HFP SCO Bypass connection status. // @@ -5527,7 +5527,7 @@ Routine Description: sizeof(bValue), sizeof(bValue), &bValue); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("GetBthHfpConnectionStatus: SendIoCtrlSynchronously(IOCTL_BTHHFP_DEVICE_GET_CONNECTION_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5538,7 +5538,7 @@ Routine Description: // *ConnectionStatus = bValue; ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5546,29 +5546,29 @@ Done: //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::EnableBthHfpConnectionStatusNotification() /*++ Routine Description: - This function registers for Bluetooth Hands-Free Profile SCO Bypass - connection status notification. + This function registers for Bluetooth Hands-Free Profile SCO Bypass + connection status notification. --*/ { DPF_ENTER(("[BthHfpDevice::EnableBthHfpConnectionStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; ctx = GetBthHfpDeviceNotificationReqContext(m_ConnectionReq); - + // // Make sure this obj is alive while the IRP is active. // - ctx->Buffer.bImmediate = FALSE; - + ctx->Buffer.bImmediate = FALSE; + // // Get the Bth HFP SCO Bypass connection status. // @@ -5579,7 +5579,7 @@ Routine Description: ctx->MemOut, EvtBthHfpDeviceNotificationStatusCompletion, this); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("EnableBthHfpConnectionStatusNotification: SendIoCtrlAsynchronously(IOCTL_BTHHFP_DEVICE_GET_CONNECTION_STATUS_UPDATE) failed, 0x%x", ntStatus)), @@ -5589,7 +5589,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5597,7 +5597,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpConnect() /*++ @@ -5605,18 +5605,18 @@ Routine Description: This function synchronously requests a Bluetooth Hands-Free Profile level connection to the paired Bluetooth device. - - This request initiates the Service Level Connection establishment procedure - and completes without waiting for the connection procedure to complete. + + This request initiates the Service Level Connection establishment procedure + and completes without waiting for the connection procedure to complete. Connection status can be determined using IOCTL_BTHHFP_GET_CONNECTION_STATUS_UPDATE. --*/ { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpConnect]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + ntStatus = SendIoCtrlSynchronously( NULL, IOCTL_BTHHFP_DEVICE_REQUEST_CONNECT, @@ -5633,7 +5633,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5641,7 +5641,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpDisconnect() /*++ @@ -5650,17 +5650,17 @@ Routine Description: This function synchronously requests a Bluetooth Hands-Free Profile level connection to the paired Bluetooth device. - This request initiates disconnection of the Service Level Connection and - completes without waiting for the disconnection to complete. Connection + This request initiates disconnection of the Service Level Connection and + completes without waiting for the disconnection to complete. Connection status can be determined using IOCTL_BTHHFP_GET_CONNECTION_STATUS_UPDATE. --*/ { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpDisconnect]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + ntStatus = SendIoCtrlSynchronously( NULL, IOCTL_BTHHFP_DEVICE_REQUEST_DISCONNECT, @@ -5677,7 +5677,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5685,7 +5685,7 @@ Done: //============================================================================= #pragma code_seg() -void +void BthHfpDevice::EvtBthHfpDeviceStreamStatusCompletion ( _In_ WDFREQUEST Request, @@ -5697,18 +5697,18 @@ BthHfpDevice::EvtBthHfpDeviceStreamStatusCompletion Routine Description: - Completion callback for the Bluetooth Hands-Free Profile SCO Bypass - stream status notification. + Completion callback for the Bluetooth Hands-Free Profile SCO Bypass + stream status notification. --*/ { DPF_ENTER(("[BthHfpDevice::EvtBthHfpDeviceStreamStatusCompletion]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * reqCtx = NULL; BthHfpDevice * This = NULL; NTSTATUS ntResult = STATUS_SUCCESS; - + UNREFERENCED_PARAMETER(Target); UNREFERENCED_PARAMETER(Context); @@ -5724,15 +5724,15 @@ Routine Description: { ntResult = STATUS_INVALID_DEVICE_STATE; } - else + else { ntResult = reqCtx->Buffer.NtStatus; } InterlockedExchange(&This->m_StreamStatusLong, (LONG)ntResult); - + // - // Let the stop routine know we are done. Stop routine will + // Let the stop routine know we are done. Stop routine will // re-init the request. // KeSetEvent(&This->m_StreamStatusEvent, IO_NO_INCREMENT, FALSE); @@ -5740,29 +5740,29 @@ Routine Description: //============================================================================= #pragma code_seg() -NTSTATUS +NTSTATUS BthHfpDevice::EnableBthHfpStreamStatusNotification() /*++ Routine Description: - This function registers for Bluetooth Hands-Free Profile SCO Bypass - stream status notification. + This function registers for Bluetooth Hands-Free Profile SCO Bypass + stream status notification. --*/ { DPF_ENTER(("[BthHfpDevice::EnableBthHfpStreamStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * ctx = NULL; ASSERT(m_nStreams > 0); - + ctx = GetBthHfpDeviceNotificationReqContext(m_StreamReq); - ctx->Buffer.bImmediate = FALSE; + ctx->Buffer.bImmediate = FALSE; KeClearEvent(&m_StreamStatusEvent); - + // // Get the Bth HFP SCO Bypass connection status. // @@ -5773,7 +5773,7 @@ Routine Description: ctx->MemOut, EvtBthHfpDeviceStreamStatusCompletion, this); - + if (!NT_SUCCESS(ntStatus)) { KeSetEvent(&m_StreamStatusEvent, IO_NO_INCREMENT, FALSE); @@ -5785,7 +5785,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5793,13 +5793,13 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::StopBthHfpStreamStatusNotification() /*++ Routine Description: - This function stops the Bluetooth Hands-Free Profile SCO Bypass + This function stops the Bluetooth Hands-Free Profile SCO Bypass connection status notification. The function waits for the request to be done before returning. @@ -5807,26 +5807,26 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::StopBthHfpStreamStatusNotification]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; BthHfpDeviceNotificationReqContext * reqCtx = NULL; - WDF_REQUEST_REUSE_PARAMS reuseParams; - + WDF_REQUEST_REUSE_PARAMS reuseParams; + WdfRequestCancelSentRequest(m_StreamReq); KeWaitForSingleObject(&m_StreamStatusEvent, Executive, KernelMode, FALSE, NULL); reqCtx = GetBthHfpDeviceNotificationReqContext(m_StreamReq); ASSERT(reqCtx != NULL); UNREFERENCED_VAR(reqCtx); - - // + + // // Re-init the request for later. // WDF_REQUEST_REUSE_PARAMS_INIT( - &reuseParams, + &reuseParams, WDF_REQUEST_REUSE_NO_FLAGS, STATUS_SUCCESS); - + ntStatus = WdfRequestReuse(m_StreamReq, &reuseParams); if (!NT_SUCCESS(ntStatus)) { @@ -5838,7 +5838,7 @@ Routine Description: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpStreamOpen() /*++ @@ -5851,9 +5851,9 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpStreamOpen]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + ntStatus = SendIoCtrlSynchronously( NULL, IOCTL_BTHHFP_STREAM_OPEN, @@ -5867,7 +5867,7 @@ Routine Description: DPF(D_VERBOSE, ("SetBthHfpStreamOpen: the stream channel is already open")); ntStatus = STATUS_SUCCESS; } - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("SetBthHfpStreamOpen: SendIoCtrlSynchronously(IOCTL_BTHHFP_STREAM_OPEN) failed, 0x%x", ntStatus)), @@ -5877,7 +5877,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5885,7 +5885,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -NTSTATUS +NTSTATUS BthHfpDevice::SetBthHfpStreamClose() /*++ @@ -5897,9 +5897,9 @@ Routine Description: { PAGED_CODE(); DPF_ENTER(("[BthHfpDevice::SetBthHfpStreamClose]")); - + NTSTATUS ntStatus = STATUS_SUCCESS; - + ntStatus = SendIoCtrlSynchronously( NULL, IOCTL_BTHHFP_STREAM_CLOSE, @@ -5916,7 +5916,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done: return ntStatus; @@ -5924,7 +5924,7 @@ Done: //============================================================================= #pragma code_seg("PAGE") -VOID +VOID BthHfpDevice::Start() /*++ @@ -5966,9 +5966,9 @@ Routine Description: // Volume settings. ntStatus = GetBthHfpVolumePropertyValues( - m_Descriptor->VolumePropertyValuesSize, + m_Descriptor->VolumePropertyValuesSize, &volumePropValues); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: GetBthHfpVolumePropertyValues: failed to retrieve KSPROPERTY_VALUES, 0x%x", ntStatus)), @@ -5991,9 +5991,9 @@ Routine Description: ntStatus, DPF(D_ERROR, ("Start: GetBthHfpMicVolume: failed, 0x%x", ntStatus)), Done); - + m_MicVolumeLevel = volume; - } + } // // Get connection status. @@ -6031,8 +6031,8 @@ Routine Description: // Customize the topology/wave descriptors for this instance // ntStatus = CreateCustomEndpointMinipair( - g_BthHfpRenderEndpoints[bthMiniportsIndex], - &m_Descriptor->FriendlyName, + g_BthHfpRenderEndpoints[bthMiniportsIndex], + &m_Descriptor->FriendlyName, &m_Descriptor->OutputPinCategory, &m_SpeakerMiniports); IF_FAILED_ACTION_JUMP( @@ -6041,7 +6041,7 @@ Routine Description: Done); ntStatus = CreateCustomEndpointMinipair( - g_BthHfpCaptureEndpoints[bthMiniportsIndex], + g_BthHfpCaptureEndpoints[bthMiniportsIndex], &m_Descriptor->FriendlyName, &m_Descriptor->InputPinCategory, &m_MicMiniports); @@ -6065,7 +6065,7 @@ Routine Description: &m_UnknownSpeakerTopology, &m_UnknownSpeakerWave, NULL, NULL ); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: InstallEndpointRenderFilters (Bth HFP SCO-Bypass): failed, 0x%x", ntStatus)), @@ -6078,7 +6078,7 @@ Routine Description: &m_UnknownMicTopology, &m_UnknownMicWave, NULL, NULL ); - + IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: InstallEndpointCaptureFilters (Bth HFP SCO-Bypass): failed, 0x%x", ntStatus)), @@ -6087,28 +6087,28 @@ Routine Description: // // Pend status notifications. // - + // NREC disable AudioGateway (AG) status. ntStatus = EnableBthHfpNrecDisableStatusNotification(); IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: EnableBthHfpNrecDisableStatusNotification: failed, 0x%x", ntStatus)), Done); - + // Volume speaker status. ntStatus = EnableBthHfpSpeakerVolumeStatusNotification(); IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: EnableBthHfpSpeakerVolumeStatusNotification: failed, 0x%x", ntStatus)), Done); - + // Volume mic status. ntStatus = EnableBthHfpMicVolumeStatusNotification(); IF_FAILED_ACTION_JUMP( ntStatus, DPF(D_ERROR, ("Start: EnableBthHfpMicVolumeStatusNotification: failed, 0x%x", ntStatus)), Done); - + // Connection status. ntStatus = EnableBthHfpConnectionStatusNotification(); IF_FAILED_ACTION_JUMP( @@ -6120,7 +6120,7 @@ Routine Description: // All done. // ntStatus = STATUS_SUCCESS; - + Done:; if (!NT_SUCCESS(ntStatus)) { @@ -6314,10 +6314,10 @@ BthHfpDevice::DeleteCustomEndpointMinipair ExFreePoolWithTag(pCustomMinipair, SYSVAD_POOLTAG); } } - + //============================================================================= #pragma code_seg("PAGE") -VOID +VOID BthHfpDevice::Stop() /*++ @@ -6326,7 +6326,7 @@ Routine Description: Asynchronously called to stop the audio device. After returning from this function, there are no more async notifications pending (volume, connection, etc.). - + --*/ { PAGED_CODE(); @@ -6338,7 +6338,7 @@ Routine Description: state = (eBthHfpState) InterlockedExchange((PLONG)&m_State, eBthHfpStateStopping); ASSERT(state == eBthHfpStateRunning || state == eBthHfpStateFailed); UNREFERENCED_VAR(state); - + // // Stop async notifications. // @@ -6348,7 +6348,7 @@ Routine Description: // Wait for work-item. // WdfWorkItemFlush(m_WorkItem); - + // // Remove the topology and wave render filters. // @@ -6358,7 +6358,7 @@ Routine Description: m_SpeakerMiniports, m_UnknownSpeakerTopology, m_UnknownSpeakerWave); - + if (!NT_SUCCESS(ntStatus)) { DPF(D_ERROR, ("RemoveEndpointFilters (Bth HFP SCO-Bypass Speaker): failed, 0x%x", ntStatus)); @@ -6374,7 +6374,7 @@ Routine Description: m_MicMiniports, m_UnknownMicTopology, m_UnknownMicWave); - + if (!NT_SUCCESS(ntStatus)) { DPF(D_ERROR, ("RemoveEndpointFilters (Bth HFP SCO-Bypass Capture): failed, 0x%x", ntStatus)); @@ -6404,4 +6404,139 @@ Routine Description: #endif // SYSVAD_BTH_BYPASS +// +// The following are copied from: +// \Program Files\Windows Kits\10\Include\10.0.15063.0\km\stdunk.h +// + +#ifdef _NEW_DELETE_OPERATORS_ + +// Note: Since VS2015 Update 2 overloaded operator new and operator delete may not +// be declared inline (Level 1 (/W1) on-by-default, warning C4595). +// See https://msdn.microsoft.com/en-us/library/mt656697.aspx +// +// To mitigate this issue, add "#define _NEW_DELETE_OPERATORS_" before "#include " +// and implement non-inline operator new and operator delete locally. + +/***************************************************************************** + * ::new() + ***************************************************************************** + * New function for creating objects with a specified allocation tag. + */ +// PVOID operator new +// ( +// size_t iSize, +// _When_((poolType & NonPagedPoolMustSucceed) != 0, +// __drv_reportError("Must succeed pool allocations are forbidden. " +// "Allocation failures cause a system crash")) +// POOL_TYPE poolType +// ) +// { +// PVOID result = ExAllocatePoolWithTag(poolType,iSize,'wNcP'); +// +// if (result) +// { +// RtlZeroMemory(result,iSize); +// } +// +// return result; +// } + +/***************************************************************************** + * ::new() + ***************************************************************************** + * New function for creating objects with a specified allocation tag. + */ +PVOID operator new +( + size_t iSize, + _When_((poolType & NonPagedPoolMustSucceed) != 0, + __drv_reportError("Must succeed pool allocations are forbidden. " + "Allocation failures cause a system crash")) + POOL_TYPE poolType, + ULONG tag +) +{ + PVOID result = ExAllocatePoolWithTag(poolType,iSize,tag); + + if (result) + { + RtlZeroMemory(result,iSize); + } + + return result; +} + +/***************************************************************************** + * ::delete() + ***************************************************************************** + * Delete function. + */ +// void __cdecl operator delete +// ( +// PVOID pVoid +// ) +// { +// if (pVoid) +// { +// ExFreePool(pVoid); +// } +// } + +/***************************************************************************** + * ::delete() + ***************************************************************************** + * Delete function. + */ +// void __cdecl operator delete +// ( +// PVOID pVoid, +// ULONG tag +// ) +// { +// if (pVoid) +// { +// ExFreePoolWithTag(pVoid,tag); +// } +// } + +void __cdecl operator delete +( + _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, + _In_ size_t cbSize +) +{ + UNREFERENCED_PARAMETER(cbSize); + + if (pVoid) + { + ExFreePool(pVoid); + } +} + +void __cdecl operator delete[] +( + _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid +) +{ + if (pVoid) + { + ExFreePool(pVoid); + } +} +// void __cdecl operator delete[] +// ( +// _Pre_maybenull_ __drv_freesMem(Mem) PVOID pVoid, +// _In_ size_t cbSize +// ) +// { +// UNREFERENCED_PARAMETER(cbSize); + +// if (pVoid) +// { +// ExFreePool(pVoid); +// } +// } + +#endif //!_NEW_DELETE_OPERATORS_ -- cgit v1.3.1 From 96b567f49ef5c445d09f4fef0752da83024c6968 Mon Sep 17 00:00:00 2001 From: Wei Mao Date: Mon, 18 Sep 2017 01:33:03 -0700 Subject: Include headers from current folder --- .../PhoneAudioSample/PhoneAudioSample.vcxproj | 26 +- audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj | 26 +- audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj | 24 +- .../TabletAudioSample/TabletAudioSample.vcxproj | 26 +- audio/sysvad/common.cpp | 2 + bluetooth/serialhcibus/WDK/SerialBusWdk.vcxproj | 26 +- general/filehistory/exe/fhsetup.vcxproj | 26 +- general/perfcounters/kcs/kcs.vcxproj | 4 +- .../SystemTraceControl/SystemTraceControl.vcxproj | 8 +- hid/hidusbfx2/sys/driver.c | 10 +- hid/hidusbfx2/sys/hid.c | 112 +- hid/hidusbfx2/sys/usb.c | 26 +- network/radio/HidSwitchDriverSample/driver.c | 10 +- network/radio/HidSwitchDriverSample/hid.c | 10 +- network/radio/HidSwitchDriverSample/usb.c | 12 +- network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj | 6 +- network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c | 1112 ++++++++++---------- network/wlan/WDI/PLATFORM/NDIS6/WDI_Common.c | 540 +++++----- print/XPSDrvSmpl/src/common/pshndlr.cpp | 6 +- print/XPSDrvSmpl/src/common/ptquerybld.cpp | 13 +- print/XPSDrvSmpl/src/common/wmpthndlr.cpp | 4 +- print/XPSDrvSmpl/src/filters/color/cmimg.cpp | 2 +- print/XPSDrvSmpl/src/filters/color/dictionary.cpp | 2 +- print/XPSDrvSmpl/src/filters/color/profman.cpp | 2 +- print/XPSDrvSmpl/src/filters/common/ptmanage.cpp | 22 +- print/XPSDrvSmpl/src/filters/nup/nupsax.cpp | 6 +- print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp | 2 +- print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp | 3 +- sd/sdiomars/mars.vcxproj | 26 +- security/elam/elamsample.c | 2 +- sensors/Activity/Device.h | 4 +- sensors/CustomSensors/Device.h | 4 +- sensors/CustomSensors/HardwareSimulator.h | 2 +- sensors/Fusion/Device.h | 4 - sensors/Pedometer/Device.h | 2 +- sensors/Pedometer/HardwareSimulator.h | 2 +- .../SensorsComboDriver/SensorsComboDriver.vcxproj | 6 +- sensors/SimpleDeviceOrientationSensor/Device.h | 2 +- .../HardwareSimulator.h | 2 +- smartcrd/pscr/Pscr.vcxproj | 26 +- storage/class/classpnp/src/srblib.c | 2 +- storage/miniports/lsi_u3/src/lsi_u3.inf | Bin 5998 -> 6022 bytes storage/msdsm/src/intrface.c | 56 +- usb/UcmCxUcsi/UcmCxUcsi.vcxproj | 3 +- .../sys/kmdf_enumswitches.vcxproj | 26 +- usb/kmdf_fx2/driver/osrusbfx2.vcxproj | 26 +- usb/umdf2_fx2/driver/osrusbfx2um.vcxproj | 26 +- usb/umdf_filter_kmdf/kmdf_driver/osrusbfx2.vcxproj | 26 +- wpd/WpdHelloWorldDriver/WpdHelloWorldDriver.inx | 1 + .../WpdMultiTransportDriver.inx | 1 + .../WpdServiceSampleDriver.inx | 1 + wpd/WpdWudfSampleDriver/WpdWudfSampleDriver.inx | Bin 4018 -> 4074 bytes 52 files changed, 1154 insertions(+), 1164 deletions(-) (limited to 'audio/sysvad/common.cpp') diff --git a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj index f140a088..cf608ab0 100644 --- a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj +++ b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj @@ -83,19 +83,19 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. true Level4 %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE @@ -105,19 +105,19 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. true Level4 %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE @@ -127,19 +127,19 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. true Level4 %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE @@ -149,19 +149,19 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. true Level4 %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);.. + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..;. %(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION %(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE @@ -301,4 +301,4 @@ - \ No newline at end of file + diff --git a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj index 563f6375..9737729a 100644 --- a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj +++ b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj @@ -134,18 +134,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -158,18 +158,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -182,18 +182,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -206,18 +206,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -247,4 +247,4 @@ - \ No newline at end of file + diff --git a/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj index 68fd57b6..ee3db3f6 100644 --- a/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj +++ b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj @@ -134,18 +134,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -158,18 +158,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -182,18 +182,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib @@ -206,18 +206,18 @@ true Level4 %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(PreprocessorDefinitions);_WINDLL;_USRDLL;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\ + %(AdditionalIncludeDirectories);$(DDK_INC_PATH);..\inc;..\..\;. %(AdditionalDependencies);Kernel32.lib;ole32.lib;oleaut32.lib;advapi32.lib;user32.lib;uuid.lib;AudioBaseProcessingObjectV140.lib;audiomediatypecrt.lib;AudioEng.lib diff --git a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj index 8efc42cf..48c5665e 100644 --- a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj +++ b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj @@ -185,7 +185,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. 4595;%(DisableSpecificWarnings) @@ -193,12 +193,12 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. @@ -208,7 +208,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. 4595;%(DisableSpecificWarnings) @@ -216,12 +216,12 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. @@ -231,7 +231,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. 4595;%(DisableSpecificWarnings) @@ -239,12 +239,12 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. @@ -254,7 +254,7 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. 4595;%(DisableSpecificWarnings) @@ -262,12 +262,12 @@ %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. %(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS %(PreprocessorDefinitions);_USE_SingleComponentMultiFxStates - %(AdditionalIncludeDirectories);..\EndpointsCommon + %(AdditionalIncludeDirectories);..\EndpointsCommon;. @@ -296,4 +296,4 @@ - \ No newline at end of file + diff --git a/audio/sysvad/common.cpp b/audio/sysvad/common.cpp index 2aadb5e6..a4c8f5e2 100644 --- a/audio/sysvad/common.cpp +++ b/audio/sysvad/common.cpp @@ -4281,6 +4281,7 @@ BthHfpDevice::GetBthHfpCodecId(_Out_ UCHAR * CodecId) ASSERT(CodecId != NULL); +#if !defined(NTDDI_WIN10_RS3) typedef enum _HFP_BYPASS_CODEC_ID_VERSION { REQ_HFP_BYPASS_CODEC_ID_V1 = 1, } HFP_BYPASS_CODEC_ID_VERSION, *PHFP_BYPASS_CODEC_ID_VERSION; @@ -4288,6 +4289,7 @@ BthHfpDevice::GetBthHfpCodecId(_Out_ UCHAR * CodecId) typedef struct _HFP_BYPASS_CODEC_ID_V1 { UCHAR CodecId; } HFP_BYPASS_CODEC_ID_V1, *PHFP_BYPASS_CODEC_ID_V1; +#endif NTSTATUS ntStatus = STATUS_SUCCESS; diff --git a/bluetooth/serialhcibus/WDK/SerialBusWdk.vcxproj b/bluetooth/serialhcibus/WDK/SerialBusWdk.vcxproj index 1aa3a43c..6319ca83 100644 --- a/bluetooth/serialhcibus/WDK/SerialBusWdk.vcxproj +++ b/bluetooth/serialhcibus/WDK/SerialBusWdk.vcxproj @@ -103,11 +103,11 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES true Level4 @@ -115,7 +115,7 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES @@ -124,11 +124,11 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES true Level4 @@ -136,7 +136,7 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES @@ -145,11 +145,11 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES true Level4 @@ -157,7 +157,7 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES @@ -166,11 +166,11 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES true Level4 @@ -178,7 +178,7 @@ - %(AdditionalIncludeDirectories);..\ + %(AdditionalIncludeDirectories);..\;. %(PreprocessorDefinitions);RESHUB_USE_HELPER_ROUTINES @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/general/filehistory/exe/fhsetup.vcxproj b/general/filehistory/exe/fhsetup.vcxproj index fdb347e1..e6e78377 100644 --- a/general/filehistory/exe/fhsetup.vcxproj +++ b/general/filehistory/exe/fhsetup.vcxproj @@ -97,15 +97,15 @@ Level4 Sync %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(AdditionalDependencies);shell32.lib;shlwapi.lib;Ole32.lib;Oleaut32.lib;User32.lib;fhsvcctl.lib @@ -117,15 +117,15 @@ Level4 Sync %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(AdditionalDependencies);shell32.lib;shlwapi.lib;Ole32.lib;Oleaut32.lib;User32.lib;fhsvcctl.lib @@ -137,15 +137,15 @@ Level4 Sync %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(AdditionalDependencies);shell32.lib;shlwapi.lib;Ole32.lib;Oleaut32.lib;User32.lib;fhsvcctl.lib @@ -157,15 +157,15 @@ Level4 Sync %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(PreprocessorDefinitions);UNICODE;_UNICODE - %(AdditionalIncludeDirectories);$(SDK_INC_PATH) + %(AdditionalIncludeDirectories);$(SDK_INC_PATH);. %(AdditionalDependencies);shell32.lib;shlwapi.lib;Ole32.lib;Oleaut32.lib;User32.lib;fhsvcctl.lib @@ -187,4 +187,4 @@ - \ No newline at end of file + diff --git a/general/perfcounters/kcs/kcs.vcxproj b/general/perfcounters/kcs/kcs.vcxproj index 5f30eb23..e97abb07 100644 --- a/general/perfcounters/kcs/kcs.vcxproj +++ b/general/perfcounters/kcs/kcs.vcxproj @@ -151,7 +151,7 @@ $([System.IO.Path]::GetDirectoryName($(ProjectDir)\$(IntDir))) - + @@ -170,4 +170,4 @@ - \ No newline at end of file + diff --git a/general/tracing/SystemTraceControl/SystemTraceControl.vcxproj b/general/tracing/SystemTraceControl/SystemTraceControl.vcxproj index 7669ebaa..1d635e7e 100644 --- a/general/tracing/SystemTraceControl/SystemTraceControl.vcxproj +++ b/general/tracing/SystemTraceControl/SystemTraceControl.vcxproj @@ -26,22 +26,22 @@ Application true - v140 + WindowsApplicationForDrivers10.0 Application false - v140 + WindowsApplicationForDrivers10.0 Application true - v140 + WindowsApplicationForDrivers10.0 Application false - v140 + WindowsApplicationForDrivers10.0 diff --git a/hid/hidusbfx2/sys/driver.c b/hid/hidusbfx2/sys/driver.c index 825c803f..5ec4a441 100644 --- a/hid/hidusbfx2/sys/driver.c +++ b/hid/hidusbfx2/sys/driver.c @@ -26,7 +26,7 @@ Revision History: --*/ -#include +#include "hidusbfx2.h" #if defined(EVENT_TRACING) // @@ -110,7 +110,7 @@ Return Value: if (!NT_SUCCESS(status)) { TraceEvents(TRACE_LEVEL_ERROR, DBG_INIT, "WdfDriverCreate failed with status 0x%x\n", status); - + WPP_CLEANUP(DriverObject); } @@ -160,7 +160,7 @@ Return Value: "HidFx2EvtDeviceAdd called\n"); // - // Tell framework this is a filter driver. Filter drivers by default are + // Tell framework this is a filter driver. Filter drivers by default are // not power policy owners. This works well for this driver because // HIDclass driver is the power policy owner for HID minidrivers. // @@ -202,7 +202,7 @@ Return Value: } devContext = GetDeviceContext(hDevice); - + WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&queueConfig, WdfIoQueueDispatchParallel); queueConfig.EvtIoInternalDeviceControl = HidFx2EvtInternalDeviceControl; @@ -246,7 +246,7 @@ Return Value: } // - // Create a timer to handle debouncing of switchpack + // Create a timer to handle debouncing of switchpack // WDF_TIMER_CONFIG_INIT( &timerConfig, diff --git a/hid/hidusbfx2/sys/hid.c b/hid/hidusbfx2/sys/hid.c index 362ed515..423e1131 100644 --- a/hid/hidusbfx2/sys/hid.c +++ b/hid/hidusbfx2/sys/hid.c @@ -28,7 +28,7 @@ Revision History: #define USE_HARDCODED_HID_REPORT_DESCRIPTOR -#include +#include "hidusbfx2.h" #if defined(EVENT_TRACING) #include "hid.tmh" @@ -53,7 +53,7 @@ HidFx2EvtInternalDeviceControl( Routine Description: - This event is called when the framework receives + This event is called when the framework receives IRP_MJ_INTERNAL DEVICE_CONTROL requests from the system. Arguments: @@ -90,7 +90,7 @@ Return Value: TraceEvents(TRACE_LEVEL_INFORMATION, DBG_IOCTL, "%s, Queue:0x%p, Request:0x%p\n", DbgHidInternalIoctlString(IoControlCode), - Queue, + Queue, Request ); @@ -139,14 +139,14 @@ Return Value: if(!NT_SUCCESS(status)){ TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "WdfRequestForwardToIoQueue failed with status: 0x%x\n", status); - + WdfRequestComplete(Request, status); } return; // -// This feature is only supported on WinXp and later. Compiling in W2K +// This feature is only supported on WinXp and later. Compiling in W2K // build environment will fail without this conditional preprocessor statement. // case IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST: @@ -154,16 +154,16 @@ Return Value: // // Hidclass sends this IOCTL for devices that have opted-in for Selective // Suspend feature. This feature is enabled by adding a registry value - // "SelectiveSuspendEnabled" = 1 in the hardware key through inf file - // (see hidusbfx2.inf). Since hidclass is the power policy owner for - // this stack, it controls when to send idle notification and when to - // cancel it. This IOCTL is passed to USB stack. USB stack pends it. + // "SelectiveSuspendEnabled" = 1 in the hardware key through inf file + // (see hidusbfx2.inf). Since hidclass is the power policy owner for + // this stack, it controls when to send idle notification and when to + // cancel it. This IOCTL is passed to USB stack. USB stack pends it. // USB stack completes the request when it determines that the device is - // idle. Hidclass's idle notification callback get called that requests a - // wait-wake Irp and subsequently powers down the device. - // The device is powered-up either when a handle is opened for the PDOs + // idle. Hidclass's idle notification callback get called that requests a + // wait-wake Irp and subsequently powers down the device. + // The device is powered-up either when a handle is opened for the PDOs // exposed by hidclass, or when usb stack completes wait - // wake request. In the first case, hidclass cancels the notification + // wake request. In the first case, hidclass cancels the notification // request (pended with usb stack), cancels wait-wake Irp and powers up // the device. In the second case, an external wake event triggers completion // of wait-wake irp and powering up of device. @@ -173,10 +173,10 @@ Return Value: if (!NT_SUCCESS(status)) { TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "SendIdleNotification failed with status: 0x%x\n", status); - + WdfRequestComplete(Request, status); - } - + } + return; case IOCTL_HID_SET_FEATURE: @@ -187,7 +187,7 @@ Return Value: status = HidFx2SetFeature(Request); WdfRequestComplete(Request, status); return; - + case IOCTL_HID_GET_FEATURE: // // Get a HID class feature report from a top-level collection of @@ -248,7 +248,7 @@ Routine Description Arguments: - Request - Wdf Request + Request - Wdf Request Return Value: @@ -268,7 +268,7 @@ Return Value: TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "HidFx2SetFeature Enter\n"); device = WdfIoQueueGetDevice(WdfRequestGetIoQueue(Request)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(Request, ¶ms); @@ -276,7 +276,7 @@ Return Value: // IOCTL_HID_SET_FEATURE & IOCTL_HID_GET_FEATURE are not METHOD_NIEHTER // IOCTLs. So you cannot retreive UserBuffer from the IRP using Wdf // function. As a result we have to escape out to WDM to get the UserBuffer - // directly from the IRP. + // directly from the IRP. // if (params.Parameters.DeviceIoControl.InputBufferLength < sizeof(HID_XFER_PACKET)) { status = STATUS_BUFFER_TOO_SMALL; @@ -321,15 +321,15 @@ Return Value: if (transferPacket->reportId == SEVEN_SEGMENT_REPORT_ID) { status = SendVendorCommand( - device, + device, HIDFX2_SET_7SEGMENT_DISPLAY, - &featureUsage + &featureUsage ); } else if (transferPacket->reportId == BARGRAPH_REPORT_ID) { status = SendVendorCommand( - device, + device, HIDFX2_SET_BARGRAPH_DISPLAY, &featureUsage ); @@ -360,7 +360,7 @@ Routine Description Arguments: - Request - Wdf Request + Request - Wdf Request BytesReturned - Size of buffer returned for the request @@ -383,7 +383,7 @@ Return Value: *BytesReturned = 0; device = WdfIoQueueGetDevice(WdfRequestGetIoQueue(Request)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(Request, ¶ms); @@ -391,7 +391,7 @@ Return Value: // IOCTL_HID_SET_FEATURE & IOCTL_HID_GET_FEATURE are not METHOD_NIEHTER // IOCTLs. So you cannot retreive UserBuffer from the IRP using Wdf // function. As a result we have to escape out to WDM to get the UserBuffer - // directly from the IRP. + // directly from the IRP. // if (params.Parameters.DeviceIoControl.OutputBufferLength < sizeof(HID_XFER_PACKET)) { status = STATUS_BUFFER_TOO_SMALL; @@ -431,15 +431,15 @@ Return Value: if (transferPacket->reportId == SEVEN_SEGMENT_REPORT_ID) { status = GetVendorData( - device, + device, HIDFX2_READ_7SEGMENT_DISPLAY, - &featureReport->FeatureData + &featureReport->FeatureData ); } else if (transferPacket->reportId == BARGRAPH_REPORT_ID) { status = GetVendorData( - device, + device, HIDFX2_READ_BARGRAPH_DISPLAY, &featureReport->FeatureData ); @@ -473,7 +473,7 @@ Routine Description Arguments: - Request - Wdf Request + Request - Wdf Request Return Value: @@ -487,7 +487,7 @@ Return Value: WDF_MEMORY_DESCRIPTOR memDesc; WDF_USB_CONTROL_SETUP_PACKET controlSetupPacket; WDF_REQUEST_SEND_OPTIONS sendOptions; - + PAGED_CODE(); TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "SendVendorCommand Enter\n"); @@ -495,7 +495,7 @@ Return Value: pDevContext = GetDeviceContext(Device); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_IOCTL, - "SendVendorCommand: Command:0x%x, data: 0x%x\n", + "SendVendorCommand: Command:0x%x, data: 0x%x\n", VendorCommand, *CommandData); // @@ -503,7 +503,7 @@ Return Value: // // Send the I/O with a timeout. We do that because we send the // I/O in the context of the user thread and if it gets stuck, it would - // prevent the user process from existing. + // prevent the user process from existing. // WDF_REQUEST_SEND_OPTIONS_INIT(&sendOptions, WDF_REQUEST_SEND_OPTION_TIMEOUT); @@ -535,7 +535,7 @@ Return Value: TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "SendtVendorCommand: Failed to set Segment Display state - 0x%x \n", status); - } + } TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "SendVendorCommand Exit\n"); @@ -557,7 +557,7 @@ Routine Description Arguments: - Request - Wdf Request + Request - Wdf Request Return Value: @@ -571,7 +571,7 @@ Return Value: WDF_MEMORY_DESCRIPTOR memDesc; WDF_USB_CONTROL_SETUP_PACKET controlSetupPacket; WDF_REQUEST_SEND_OPTIONS sendOptions; - + PAGED_CODE(); TraceEvents(TRACE_LEVEL_VERBOSE, DBG_IOCTL, "GetVendorData Enter\n"); @@ -579,7 +579,7 @@ Return Value: pDevContext = GetDeviceContext(Device); TraceEvents(TRACE_LEVEL_INFORMATION, DBG_IOCTL, - "GetVendorData: Command:0x%x, data: 0x%x\n", + "GetVendorData: Command:0x%x, data: 0x%x\n", VendorCommand, *CommandData); // @@ -587,7 +587,7 @@ Return Value: // // Send the I/O with a timeout. We do that because we send the // I/O in the context of the user thread and if it gets stuck, it would - // prevent the user process from existing. + // prevent the user process from existing. // WDF_REQUEST_SEND_OPTIONS_INIT(&sendOptions, WDF_REQUEST_SEND_OPTION_TIMEOUT); @@ -619,11 +619,11 @@ Return Value: TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "GetVendorData: Failed to get state - 0x%x \n", status); - } + } else { TraceEvents(TRACE_LEVEL_INFORMATION, DBG_IOCTL, - "GetVendorData: Command:0x%x, data after command: 0x%x\n", + "GetVendorData: Command:0x%x, data after command: 0x%x\n", VendorCommand, *CommandData); } @@ -642,7 +642,7 @@ HidFx2GetHidDescriptor( Routine Description: - Finds the HID descriptor and copies it into the buffer provided by the + Finds the HID descriptor and copies it into the buffer provided by the Request. Arguments: @@ -668,7 +668,7 @@ Return Value: // // This IOCTL is METHOD_NEITHER so WdfRequestRetrieveOutputMemory - // will correctly retrieve buffer from Irp->UserBuffer. + // will correctly retrieve buffer from Irp->UserBuffer. // Remember that HIDCLASS provides the buffer in the Irp->UserBuffer // field irrespective of the ioctl buffer type. However, framework is very // strict about type checking. You cannot get Irp->UserBuffer by using @@ -683,7 +683,7 @@ Return Value: } // - // Use hardcoded "HID Descriptor" + // Use hardcoded "HID Descriptor" // bytesToCopy = G_DefaultHidDescriptor.bLength; @@ -691,9 +691,9 @@ Return Value: status = STATUS_INVALID_DEVICE_STATE; TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "G_DefaultHidDescriptor is zero, 0x%x\n", status); - return status; + return status; } - + status = WdfMemoryCopyFromBuffer(memory, 0, // Offset (PVOID) &G_DefaultHidDescriptor, @@ -749,7 +749,7 @@ Return Value: // // This IOCTL is METHOD_NEITHER so WdfRequestRetrieveOutputMemory - // will correctly retrieve buffer from Irp->UserBuffer. + // will correctly retrieve buffer from Irp->UserBuffer. // Remember that HIDCLASS provides the buffer in the Irp->UserBuffer // field irrespective of the ioctl buffer type. However, framework is very // strict about type checking. You cannot get Irp->UserBuffer by using @@ -772,9 +772,9 @@ Return Value: status = STATUS_INVALID_DEVICE_STATE; TraceEvents(TRACE_LEVEL_ERROR, DBG_IOCTL, "G_DefaultHidDescriptor's reportLenght is zero, 0x%x\n", status); - return status; + return status; } - + status = WdfMemoryCopyFromBuffer(memory, 0, (PVOID) G_DefaultReportDescriptor, @@ -828,7 +828,7 @@ Return Value: // // This IOCTL is METHOD_NEITHER so WdfRequestRetrieveOutputMemory - // will correctly retrieve buffer from Irp->UserBuffer. + // will correctly retrieve buffer from Irp->UserBuffer. // Remember that HIDCLASS provides the buffer in the Irp->UserBuffer // field irrespective of the ioctl buffer type. However, framework is very // strict about type checking. You cannot get Irp->UserBuffer by using @@ -890,7 +890,7 @@ Return Value: BOOLEAN sendStatus = FALSE; WDF_REQUEST_SEND_OPTIONS options; WDFIOTARGET nextLowerDriver; - WDFDEVICE device; + WDFDEVICE device; PIO_STACK_LOCATION currentIrpStack = NULL; IO_STACK_LOCATION nextIrpStack; @@ -900,7 +900,7 @@ Return Value: // // Convert the request to corresponding USB Idle notification request // - if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < + if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO)) { status = STATUS_BUFFER_TOO_SMALL; @@ -909,7 +909,7 @@ Return Value: return status; } - ASSERT(sizeof(HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO) + ASSERT(sizeof(HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO) == sizeof(USB_IDLE_CALLBACK_INFO)); #pragma warning(suppress :4127) // conditional expression is constant warning @@ -925,15 +925,15 @@ Return Value: // prepare next stack location // RtlZeroMemory(&nextIrpStack, sizeof(IO_STACK_LOCATION)); - + nextIrpStack.MajorFunction = currentIrpStack->MajorFunction; nextIrpStack.Parameters.DeviceIoControl.InputBufferLength = currentIrpStack->Parameters.DeviceIoControl.InputBufferLength; nextIrpStack.Parameters.DeviceIoControl.Type3InputBuffer = currentIrpStack->Parameters.DeviceIoControl.Type3InputBuffer; - nextIrpStack.Parameters.DeviceIoControl.IoControlCode = + nextIrpStack.Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION; - nextIrpStack.DeviceObject = + nextIrpStack.DeviceObject = WdfIoTargetWdmGetTargetDeviceObject(WdfDeviceGetIoTarget(device)); // @@ -954,7 +954,7 @@ Return Value: ); nextLowerDriver = WdfDeviceGetIoTarget(device); - + sendStatus = WdfRequestSend( Request, nextLowerDriver, diff --git a/hid/hidusbfx2/sys/usb.c b/hid/hidusbfx2/sys/usb.c index 50f1a03b..676d92d6 100644 --- a/hid/hidusbfx2/sys/usb.c +++ b/hid/hidusbfx2/sys/usb.c @@ -26,7 +26,7 @@ Revision History: --*/ -#include +#include "hidusbfx2.h" #if defined(EVENT_TRACING) #include "usb.tmh" @@ -84,7 +84,7 @@ Return Value: "HidFx2EvtDevicePrepareHardware Enter\n"); devContext = GetDeviceContext(Device); - + // // Create a WDFUSBDEVICE object. WdfUsbTargetDeviceCreate obtains the // USB device descriptor and the first USB configuration descriptor from @@ -95,8 +95,8 @@ Return Value: // object. The driver cannot change this parent, and the ParentObject // member or the WDF_OBJECT_ATTRIBUTES structure must be NULL. // - // We only create device the first time PrepareHardware is called. If - // the device is restarted by pnp manager for resource rebalance, we + // We only create device the first time PrepareHardware is called. If + // the device is restarted by pnp manager for resource rebalance, we // will use the same device handle but then select the interfaces again // because the USB stack could reconfigure the device on restart. // @@ -104,7 +104,7 @@ Return Value: status = WdfUsbTargetDeviceCreate(Device, WDF_NO_OBJECT_ATTRIBUTES, &devContext->UsbDevice); - + if (!NT_SUCCESS(status)) { TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP, "WdfUsbTargetDeviceCreate failed 0x%x\n", status); @@ -113,7 +113,7 @@ Return Value: // // TODO: If you are fetching configuration descriptor from device for - // selecting a configuration or to parse other descriptors, call + // selecting a configuration or to parse other descriptors, call // HidFx2ValidateConfigurationDescriptor // to do basic validation on the descriptors before you access them. // @@ -332,7 +332,7 @@ Return Value: ); return; } - + switchState = WdfMemoryGetBuffer(Buffer, NULL); currentSwitchState = *switchState; @@ -812,8 +812,8 @@ Return Value: // USBD_ValidateConfigurationDescriptor validates that all descriptors are completely contained within the configuration descriptor buffer. // It also checks for interface numbers, number of endpoints in an interface etc. // Please refer to msdn documentation for this function for more information. - // - + // + status = USBD_ValidateConfigurationDescriptor( ConfigDesc, BufferLength , ValidationLevel , Offset , POOL_TAG ); if (!(NT_SUCCESS (status)) ){ return status; @@ -821,10 +821,10 @@ Return Value: // // TODO: You should validate the correctness of other descriptors which are not taken care by USBD_ValidateConfigurationDescriptor - // Check that all such descriptors have size >= sizeof(the descriptor they point to) - // Check for any association between them if required - // - + // Check that all such descriptors have size >= sizeof(the descriptor they point to) + // Check for any association between them if required + // + return status; } diff --git a/network/radio/HidSwitchDriverSample/driver.c b/network/radio/HidSwitchDriverSample/driver.c index 54e80dae..61cc97fc 100644 --- a/network/radio/HidSwitchDriverSample/driver.c +++ b/network/radio/HidSwitchDriverSample/driver.c @@ -1,4 +1,4 @@ -#include +#include "RadioSwitchHidUsbFx2.h" #pragma warning(disable:28252) #pragma warning(disable:28253) #include "driver.tmh" @@ -39,7 +39,7 @@ NTSTATUS DriverEntry (_In_ PDRIVER_OBJECT pDriverObject, _In_ PUNICODE_STRING ps &config, // Driver Config Info WDF_NO_HANDLE ); - if (!NT_SUCCESS(status)) + if (!NT_SUCCESS(status)) { TraceErr(DBG_INIT, "(%!FUNC!)WdfDriverCreate failed with status %!STATUS!\n", status); WPP_CLEANUP(pDriverObject); @@ -64,7 +64,7 @@ void HidFx2EvtDriverContextCleanup(_In_ WDFOBJECT hDriver) -//HidFx2EvtDeviceAdd is called by the framework in response to AddDevicecall from the PnP manager. +//HidFx2EvtDeviceAdd is called by the framework in response to AddDevicecall from the PnP manager. //We create and initialize a WDF device object to represent a new instance of device. // NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDeviceInit) @@ -111,7 +111,7 @@ NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDev } pDevContext = GetDeviceContext(hDevice); - + WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&queueConfig, WdfIoQueueDispatchParallel); queueConfig.EvtIoInternalDeviceControl = HidFx2EvtInternalDeviceControl; @@ -136,7 +136,7 @@ NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDev return status; } - // Create a timer to handle debouncing of switchpack + // Create a timer to handle debouncing of switchpack WDF_TIMER_CONFIG_INIT(&timerConfig, HidFx2EvtTimerFunction); timerConfig.AutomaticSerialization = FALSE; diff --git a/network/radio/HidSwitchDriverSample/hid.c b/network/radio/HidSwitchDriverSample/hid.c index 27fcefea..2421b88f 100644 --- a/network/radio/HidSwitchDriverSample/hid.c +++ b/network/radio/HidSwitchDriverSample/hid.c @@ -1,4 +1,4 @@ -#include +#include "RadioSwitchHidUsbFx2.h" #include "hid.tmh" // Radio Management Collection - Scenario 1 control collection (Button only) @@ -223,7 +223,7 @@ NTSTATUS HidFx2GetInput(_In_ WDFREQUEST hRequest) TraceVerbose(DBG_IOCTL, "(%!FUNC!) Enter\n"); hDevice = WdfIoQueueGetDevice(WdfRequestGetIoQueue(hRequest)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(hRequest, ¶ms); @@ -296,7 +296,7 @@ NTSTATUS HidFx2SetOutput(_In_ WDFREQUEST hRequest) TraceVerbose(DBG_IOCTL, "(%!FUNC!) Enter\n"); hDevice = WdfIoQueueGetDevice(WdfRequestGetIoQueue(hRequest)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(hRequest, ¶ms); @@ -335,7 +335,7 @@ NTSTATUS HidFx2SetOutput(_In_ WDFREQUEST hRequest) TraceErr(DBG_IOCTL, "(%!FUNC!) Incorrect report ID, %!STATUS!\n", status); return status; } - + pOutputReport = (PHIDFX2_IO_REPORT)pTransferPacket->reportBuffer; if (pOutputReport->bData == 0) @@ -471,7 +471,7 @@ NTSTATUS HidFx2GetHidDescriptor(_In_ WDFDEVICE hDevice, _In_ WDFREQUEST hRequest TraceErr(DBG_IOCTL, "(%!FUNC!) c_DefaultHidDescriptor is zero, %!STATUS!\n", status); return status; } - + } else // WdfRequestRetrieveOutputMemory failed { diff --git a/network/radio/HidSwitchDriverSample/usb.c b/network/radio/HidSwitchDriverSample/usb.c index bacd1bce..84cf7faa 100644 --- a/network/radio/HidSwitchDriverSample/usb.c +++ b/network/radio/HidSwitchDriverSample/usb.c @@ -1,4 +1,4 @@ -#include +#include "RadioSwitchHidUsbFx2.h" #include "usb.tmh" @@ -39,7 +39,7 @@ HidFx2EvtDevicePrepareHardware( // The parent of each USB device object is the driver's framework driver object. The driver cannot change this parent, and the ParentObject // member or the WDF_OBJECT_ATTRIBUTES structure must be NULL. // - // We only create device the first time PrepareHardware is called. If the device is restarted by pnp manager for resource rebalance, we + // We only create device the first time PrepareHardware is called. If the device is restarted by pnp manager for resource rebalance, we // will use the same device handle but then select the interfaces again because the USB stack could reconfigure the device on restart. if (pDevContext->hUsbDevice == NULL) { @@ -162,7 +162,7 @@ void HidFx2EvtUsbInterruptPipeReadComplete( } - // Make sure that there is data in the read packet. + // Make sure that there is data in the read packet. // Depending on the device specification, it is possible for it to return a 0 length read in certain conditions. if (cNumBytesTransferred == 0) { @@ -269,7 +269,7 @@ void HidFx2EvtTimerFunction(_In_ WDFTIMER hTimer) WdfRequestCompleteWithInformation(hRequest, status, cBytesReturned); - } + } else if (status != STATUS_NO_MORE_ENTRIES) { TraceErr(DBG_IOCTL, "(%!FUNC!) WdfIoQueueRetrieveNextRequest status %!STATUS!\n", status); @@ -340,7 +340,7 @@ NTSTATUS HidFx2GetSwitchState(_In_ WDFDEVICE hDevice, _Out_ unsigned char *pbSwi // EvtDeviceD0Entry event callback must perform any operations that are necessary before the specified device is used. // Called every time the hardware needs to be initialized/reinitialized. -// This function is not marked pageable because this function is in the device power up path. +// This function is not marked pageable because this function is in the device power up path. // This function runs at PASSIVE_LEVEL, even though it is not paged. // NTSTATUS HidFx2EvtDeviceD0Entry(_In_ WDFDEVICE hDevice, _In_ WDF_POWER_DEVICE_STATE previousState) @@ -412,7 +412,7 @@ stopped, when it is removed, and when it is powered off. The device is still in D0 when this callback is invoked, which means that the driver can still touch hardware in this routine. -EvtDeviceD0Exit event callback must perform any operations that are necessary before the specified device is moved out of the D0 state. +EvtDeviceD0Exit event callback must perform any operations that are necessary before the specified device is moved out of the D0 state. If the driver needs to save hardware state before the device is powered down, then that should be done here. This function runs at PASSIVE_LEVEL, though it is generally not paged. A driver can optionally make this function pageable if DO_POWER_PAGABLE is set. diff --git a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj index c6089236..af48c0a4 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj +++ b/network/wlan/WDI/PLATFORM/NDIS6/SDIO/sdio.vcxproj @@ -577,6 +577,8 @@ $(OutDir)$(TargetName)$(TargetExt) $(SolutionDir)COMMON\$(Configuration)\$(Platform)\common.lib;$(SolutionDir)PLATFORM\NdisComm\$(Configuration)\$(Platform)\NdisComm.lib;$(SolutionDir)\LIB\x64\hal.lib;$(SolutionDir)\LIB\x64\rtklibcom.lib;$(WindowsSDK_LibraryPath_x64)km\x64\ndis.lib;$(WindowsSDK_LibraryPath_x64)km\x64\ntoskrnl.lib;$(WindowsSDK_LibraryPath_x64)km\x64\sdbus.lib;$(WindowsSDK_LibraryPath_x64)km\x64\wlan\1.0\TlvGeneratorParser.lib; + + $(AdditionalOptions) /IGNORE:4099 true @@ -636,7 +638,7 @@ - @@ -748,4 +750,4 @@ - \ No newline at end of file + diff --git a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c index d1005a4b..ec5cddd6 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c +++ b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Cmds.c @@ -28,7 +28,7 @@ wdi_task_WriteResult( { NdisMoveMemory((u1Byte *)hdr + sizeof(*hdr), tlv, tlvlen); } - + hTask->OutputBufferLength = tlvlen; } @@ -40,7 +40,7 @@ wdi_ScanCb( ) { ADAPTER *pAdapter = (ADAPTER *)pCtx; - + RT_TRACE_F(COMP_MLME, DBG_LOUD, ("%s\n", CustomScan_ScanStateTxt(state))); if(CUSTOM_SCAN_STATE_PRE_DESTROY == state) @@ -59,13 +59,13 @@ wdi_P2PDiscoveryCb( ADAPTER *pAdapter = (ADAPTER *)pCtx; RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; P2P_INFO *info = GET_P2P_INFO(pAdapter); - + RT_TRACE_F(COMP_P2P, DBG_LOUD, ("%s\n", CustomScan_ScanStateTxt(state))); if(CUSTOM_SCAN_STATE_COMPLETED == state) { WDI_TASK_P2P_DISCOVER_PARAMETERS *param = hTask->tlvParser.parsedTlv.paramP2pDiscover; - + MGNT_INFO *mgnt = &pAdapter->MgntInfo; u4Byte it = 0; @@ -118,18 +118,18 @@ wdi_ConstructScanReq( u2Byte duration = (u2Byte)(SCAN_ACTIVE == scanType ? param->DwellTime.ActiveChannelDwellTime : param->DwellTime.PassiveChannelDwellTime); FunctionIn(COMP_SCAN); - + if(param->Optional.BandChannelList_IsPresent) { u4Byte itBand = 0; u4Byte itChnl = 0; - + for(itBand = 0; itBand < param->BandChannelList.ElementCount; itBand++) { for(itChnl = 0; itChnl < param->BandChannelList.pElements[itBand].ChannelList.ElementCount; itChnl++) { u1Byte chnl = (u1Byte)param->BandChannelList.pElements[itBand].ChannelList.pElements[itChnl]; - + CustomScan_AddScanChnl(req, chnl, 1, scanType, duration, 0, NULL); } } @@ -138,7 +138,7 @@ wdi_ConstructScanReq( { RT_CHANNEL_DOMAIN domain = GetDefaultAdapter(pAdapter)->MgntInfo.ChannelPlan; RT_CHANNEL_PLAN *plan = NULL; - + RtActChannelList(pAdapter, RT_CHNL_LIST_ACTION_GET_CHANNEL_PLAN, &domain, &plan); CustomScan_AddChnlPlanChnls(req, plan, scanType, duration, 0, NULL); @@ -163,7 +163,7 @@ wdi_ConstructP2PSpecificChnlReq( { RT_SCAN_TYPE scanType = WDI_P2P_SCAN_TYPE_PASSIVE == param->DiscoverMode.ScanType ? SCAN_PASSIVE : SCAN_ACTIVE; u2Byte duration = (u2Byte)(SCAN_ACTIVE == scanType ? param->DwellTime.ActiveChannelDwellTime : param->DwellTime.PassiveChannelDwellTime); - + if(param->Optional.DiscoveryChannelSettings_IsPresent) { u4Byte itSettings = 0; @@ -171,15 +171,15 @@ wdi_ConstructP2PSpecificChnlReq( u4Byte itChnl = 0; RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("channel setting present\n")); - + for(itSettings = 0; itSettings < param->DiscoveryChannelSettings.ElementCount; itSettings++) { WDI_P2P_DISCOVERY_CHANNEL_SETTINGS_CONTAINER *setting = param->DiscoveryChannelSettings.pElements + itSettings; - + for(itBand = 0; itBand < setting->BandChannelList.ElementCount; itBand++) { WDI_BAND_CHANNEL_LIST_CONTAINER *band = setting->BandChannelList.pElements + itBand; - + for(itChnl = 0; itChnl < band->ChannelList.ElementCount; itChnl++) { WDI_CHANNEL_NUMBER *chnl = band->ChannelList.pElements + itChnl; @@ -206,7 +206,7 @@ wdi_ConstructP2PScanPhaseReq( u2Byte duration = (u2Byte)(SCAN_ACTIVE == scanType ? param->DwellTime.ActiveChannelDwellTime : param->DwellTime.PassiveChannelDwellTime); RT_CHANNEL_DOMAIN domain = GetDefaultAdapter(pAdapter)->MgntInfo.ChannelPlan; RT_CHANNEL_PLAN *plan = NULL; - + RtActChannelList(pAdapter, RT_CHNL_LIST_ACTION_GET_CHANNEL_PLAN, &domain, &plan); CustomScan_AddChnlPlanChnls(req, plan, scanType, duration, MGN_6M, NULL); @@ -254,7 +254,7 @@ wdi_Construct_FakeInvitationRsp( OCTET_STRING osWFDIE, osProbeRspPkt; FunctionIn(COMP_OID_SET); - + // MAC Header p2p_add_ActionFrameMacHdr(fbuf, info->DeviceAddress, dev->mac, info->DeviceAddress); @@ -267,11 +267,11 @@ wdi_Construct_FakeInvitationRsp( // WFD IE, from probe rsp if(dev->rxFrames[P2P_FID_PROBE_RSP] && dev->rxFrames[P2P_FID_PROBE_RSP]->frameLen) { - FillOctetString(osProbeRspPkt, - dev->rxFrames[P2P_FID_PROBE_RSP]->frame, + FillOctetString(osProbeRspPkt, + dev->rxFrames[P2P_FID_PROBE_RSP]->frame, dev->rxFrames[P2P_FID_PROBE_RSP]->frameLen ); - + osWFDIE = PacketGetElement(osProbeRspPkt, EID_Vendor, OUI_SUB_WIFI_DISPLAY, OUI_SUB_DONT_CARE); if(osWFDIE.Length > 0) @@ -284,7 +284,7 @@ wdi_Construct_FakeInvitationRsp( FrameBuf_Dump(fbuf, 0, DBG_LOUD, __FUNCTION__); FunctionOut(COMP_OID_SET); - + return TRUE; } @@ -299,13 +299,13 @@ wdi_Construct_FakePdRsp( { P2P_INFO *info = GET_P2P_INFO(pAdapter); OCTET_STRING osPdReq, osTmpIe; - + FunctionIn(COMP_OID_SET); if(dev->txFrames[P2P_FID_PD_REQ] && dev->txFrames[P2P_FID_PD_REQ]->frameLen) { - FillOctetString(osPdReq, - dev->txFrames[P2P_FID_PD_REQ]->frame, + FillOctetString(osPdReq, + dev->txFrames[P2P_FID_PD_REQ]->frame, dev->txFrames[P2P_FID_PD_REQ]->frameLen ); } @@ -314,7 +314,7 @@ wdi_Construct_FakePdRsp( RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("no corresp. pd req\n")); FillOctetString(osPdReq, NULL, 0); } - + // MAC Header p2p_add_ActionFrameMacHdr(fbuf, info->DeviceAddress, dev->mac, dev->mac); @@ -323,14 +323,14 @@ wdi_Construct_FakePdRsp( // WPS IE, getting from the original PD request if(osPdReq.Length) - { + { osTmpIe = PacketGetElement(osPdReq, EID_Vendor, OUI_SUB_SimpleConfig, OUI_SUB_DONT_CARE); if(osTmpIe.Length) { PacketMakeElement(&fbuf->os, EID_Vendor, osTmpIe); } } - + // WFD IE if(osPdReq.Length) { @@ -338,9 +338,9 @@ wdi_Construct_FakePdRsp( if(osTmpIe.Length) { PacketMakeElement(&fbuf->os, EID_Vendor, osTmpIe); - } + } } - + RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("a fake pd rsp constructed\n")); FrameBuf_Dump(fbuf, 0, DBG_LOUD, __FUNCTION__); @@ -365,7 +365,7 @@ wdi_IndicateRxP2pRspActionFrame( u1Byte *buf = NULL; ULONG buflen = 0; - + NDIS_STATUS_INDICATION *indic = NULL; WDI_MESSAGE_HEADER *wdiHdr = NULL; @@ -384,7 +384,7 @@ wdi_IndicateRxP2pRspActionFrame( } FrameBuf_Init(GEN_TEMP_BUFFER_SIZE, 0, (u1Byte *)pGenBuf->Buffer.Ptr, &fbuf); - + if(WDI_P2P_ACTION_FRAME_PROVISION_DISCOVERY_RESPONSE == ctx->rspType) ft = P2P_FID_PD_RSP; else if(WDI_P2P_ACTION_FRAME_GO_NEGOTIATION_RESPONSE == ctx->rspType) @@ -407,10 +407,10 @@ wdi_IndicateRxP2pRspActionFrame( { dev = p2p_DevList_Get(&info->devList, ctx->da, P2P_DEV_TYPE_DEV); } - + if(NULL == dev) { - RT_TRACE_F(COMP_OID_SET, DBG_WARNING, + RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("dev not found: bGo: %u, mac: %02X:%02X:%02X:%02X:%02X:%02X\n", ctx->bGo, ctx->da[0], ctx->da[1], ctx->da[2], ctx->da[3], ctx->da[4], ctx->da[5] )); @@ -459,9 +459,9 @@ wdi_IndicateRxP2pRspActionFrame( // gen TLV if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationP2pActionFrameReceived( - ¶m, - sizeof(*indic) + sizeof(*wdiHdr), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(*indic) + sizeof(*wdiHdr), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("gen tlv failed\n")); @@ -471,7 +471,7 @@ wdi_IndicateRxP2pRspActionFrame( // fill ptrs indic = (NDIS_STATUS_INDICATION *)buf; wdiHdr = (WDI_MESSAGE_HEADER *)(buf + sizeof(*indic)); - + // indication data PlatformZeroMemory(indic, sizeof(*indic)); indic->Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION; @@ -492,7 +492,7 @@ wdi_IndicateRxP2pRspActionFrame( // indicate NdisMIndicateStatusEx(pAdapter->pNdisCommon->hNdisAdapter, indic); - + // cleanup FreeGenerated((UINT8 *)buf); @@ -504,7 +504,7 @@ wdi_IndicateRxP2pRspActionFrame( } p2p_DevList_Unlock(&info->devList); - + FunctionOut(COMP_OID_SET); return; @@ -534,12 +534,12 @@ wdi_SendP2pActionFrameStateCb( } if(OFF_CHNL_TX_STATE_COMPLETE == state) - { + { RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("complete\n")); bHandled = TRUE; break; } - + if(OFF_CHNL_TX_STATE_FRAME_SENT == state) { RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("frame sent\n")); @@ -563,11 +563,11 @@ wdi_SendP2pReqActionFrameStateCb( ADAPTER *pAdapter = ctx->pAdapter; wdi_SendP2pActionFrameStateCb(req, state, pCtx); - + if(OFF_CHNL_TX_STATE_COMPLETE == state) { P2P_INFO *info = GET_P2P_INFO(pAdapter); - + WDI_CMD_P2pSendRequestActionFrameComplete(pAdapter, ctx); RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("restore StateBeforeScan to initialized\n")); @@ -581,7 +581,7 @@ wdi_SendP2pReqActionFrameStateCb( ) { wdi_IndicateRxP2pRspActionFrame(pAdapter, ctx); - } + } } else if(OFF_CHNL_TX_STATE_RETRY == state) { @@ -592,17 +592,17 @@ wdi_SendP2pReqActionFrameStateCb( if(pAdapter->bInHctTest) { - // Not to skip probing under HCT test, because it wastes time + // Not to skip probing under HCT test, because it wastes time // sending action frame to peer on its Listen Channel when peer // is not doing extended listen bSkip = FALSE; } - + if(bSkip) { WDI_SendAction_SkipProbeTemporarilly(req); } - + RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("retry with token: %u, reqType: %u, skip probe: %u\n", newToken, ctx->reqType, bSkip)); bSkip = !bSkip; @@ -626,13 +626,13 @@ wdi_SendP2pRspActionFrameStateCb( RT_TRACE_F(COMP_P2P, DBG_LOUD, ("state = %d\n", state)); wdi_SendP2pActionFrameStateCb(req, state, pCtx); - + if(OFF_CHNL_TX_STATE_COMPLETE == state) { WDI_CMD_P2pSendResponseActionFrameComplete(pAdapter, ctx); - // restore Dialog Token in P2PInfo since we are sending - // response action frame, self dialog token shall not be + // restore Dialog Token in P2PInfo since we are sending + // response action frame, self dialog token shall not be // modified RT_TRACE_F(COMP_P2P, DBG_LOUD, ("restore token from %u to %u\n", info->DialogToken, ctx->oldToken)); info->DialogToken = ctx->oldToken; @@ -643,7 +643,7 @@ wdi_SendP2pRspActionFrameStateCb( if(WDI_P2P_ACTION_FRAME_GO_NEGOTIATION_CONFIRM == ctx->rspType) { wdi_IndicateRxP2pRspActionFrame(pAdapter, ctx); - } + } } else if(OFF_CHNL_TX_STATE_RETRY == state) { @@ -664,7 +664,7 @@ wdi_SendActionFrameStateCb( BOOLEAN bHandled = FALSE; N63C_SEND_ACTION_CTX *ctx = (N63C_SEND_ACTION_CTX *)pCtx; ADAPTER *pAdapter = ctx->pAdapter; - + RT_TRACE(COMP_OID_SET, DBG_TRACE, ("wdi_SendActionFrameStateCb (0x%x)\n", state)); do @@ -677,12 +677,12 @@ wdi_SendActionFrameStateCb( } if(OFF_CHNL_TX_STATE_COMPLETE == state) - { + { RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("complete\n")); bHandled = TRUE; break; } - + if(OFF_CHNL_TX_STATE_FRAME_SENT == state) { RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("frame sent\n")); @@ -700,7 +700,7 @@ wdi_SendActionFrameStateCb( { WDI_SendAction_SkipProbeTemporarilly(req); } - + RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("retry with token: %u, reqType: %u, skip probe: %u\n", newToken, ctx->reqType, bSkip)); bSkip = !bSkip; @@ -728,7 +728,7 @@ wdi_SendReqActionFrameStateCb( RT_TRACE(COMP_OID_SET, DBG_TRACE, ("wdi_SendReqActionFrameStateCb (0x%x)\n", state)); wdi_SendActionFrameStateCb(req, state, pCtx); - + if(OFF_CHNL_TX_STATE_COMPLETE == state) { WDI_CMD_SendReqActionFrameComplete(pAdapter, ctx); @@ -750,11 +750,11 @@ wdi_SendRspActionFrameStateCb( { WDI_SEND_ACTION_CTX *ctx = (WDI_SEND_ACTION_CTX *)pCtx; ADAPTER *pAdapter = ctx->pAdapter; - + RT_TRACE(COMP_OID_SET, DBG_TRACE, ("wdi_SendRspActionFrameStateCb (0x%x)\n", state)); wdi_SendActionFrameStateCb(req, state, pCtx); - + if(OFF_CHNL_TX_STATE_COMPLETE == state) { WDI_CMD_SendRspActionFrameComplete(pAdapter, ctx); @@ -780,8 +780,8 @@ Wdi_Task_Scan( BOOLEAN bScanByRoam = FALSE; PMGNT_INFO pMgntInfo =&(pAdapter->MgntInfo); - RT_TRACE(COMP_OID_SET, DBG_LOUD, - ("==> Wdi_Task_Scan(): Input InformationBuffer (%d)\n", + RT_TRACE(COMP_OID_SET, DBG_LOUD, + ("==> Wdi_Task_Scan(): Input InformationBuffer (%d)\n", pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength)); ScanRequest.dot11BSSType = dot11_BSS_type_infrastructure; @@ -793,21 +793,21 @@ Wdi_Task_Scan( CopyMem(ScanRequest.dot11BSSID, param->BSSID.Address, ETHERNET_ADDRESS_LENGTH); RT_PRINT_ADDR(COMP_SCAN, DBG_LOUD, ("ScanRequest \n"), ScanRequest.dot11BSSID); - RT_TRACE(COMP_OID_SET, DBG_LOUD, ("WIFI_TLV_SSID\n")); + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("WIFI_TLV_SSID\n")); MgntClearSsidsToScan(pAdapter); - + for(itSsidl = 0; itSsidl < param->SSIDList.ElementCount; itSsidl++) { WdiSsid = param->SSIDList.pElements[itSsidl]; - + RT_PRINT_STR(COMP_MLME, DBG_LOUD, "===> Wdi_Task_Scan(): ", WdiSsid.pElements, WdiSsid.ElementCount); - + Ssid.Octet = WdiSsid.pElements; - Ssid.Length = (u2Byte)WdiSsid.ElementCount; - + Ssid.Length = (u2Byte)WdiSsid.ElementCount; + RT_PRINT_STR(COMP_MLME, DBG_LOUD, "===> Wdi_Task_Scan(): SSid ", Ssid.Octet, Ssid.Length); - + MgntAddSsidsToScan(pAdapter, Ssid); } RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Scan Type\n")); @@ -827,11 +827,11 @@ Wdi_Task_Scan( if(param->Optional.VendorIEs_IsPresent) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("WIFI_TLV_VENDORIE\n")); - - MgntActSet_AdditionalProbeReqIE(pAdapter, + + MgntActSet_AdditionalProbeReqIE(pAdapter, (u1Byte *)param->VendorIEs.pElements, (u4Byte)param->VendorIEs.ElementCount); - } + } // Sinda, 20150512 // Skip all scan triggered by Roam. @@ -857,7 +857,7 @@ Wdi_Task_Scan( { if(param->Optional.VendorIEs_IsPresent) { - MgntActSet_AdditionalProbeReqIE(pAdapter, + MgntActSet_AdditionalProbeReqIE(pAdapter, (u1Byte *)param->VendorIEs.pElements, (u4Byte)param->VendorIEs.ElementCount); } @@ -865,11 +865,11 @@ Wdi_Task_Scan( if(NULL != (req = CustomScan_AllocReq(GET_CUSTOM_SCAN_INFO(pAdapter), NULL, NULL))) { wdi_ConstructScanReq(pAdapter, param, req); - + CustomScan_SetTimeBound(req, param->DwellTime.MaximumScanTime); CustomScan_SetupCbCtx(req, wdi_ScanCb, pAdapter); CustomScan_SetRepeatCount(req, param->ScanModeParameters.ScanRepeatCount); - + CustomScan_IssueReq(GET_CUSTOM_SCAN_INFO(pAdapter), req, CUSTOM_SCAN_SRC_TYPE_SYS, "sys"); } } @@ -878,7 +878,7 @@ Wdi_Task_Scan( WDI_IndicateScanComplete(pAdapter, RT_STATUS_FAILURE); } } - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("<== Wdi_Task_Scan()\n")); return status; } @@ -897,15 +897,15 @@ Wdi_Task_Connect( WDI_TASK_CONNECT_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramConnect; PWDI_CONNECT_BSS_ENTRY_CONTAINER connectBssEntry = NULL; PMGNT_INFO pMgntInfo=&pAdapter->MgntInfo; - - PWDI_MESSAGE_HEADER pWdiHeader + + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pInputBuffer; - //Save PMKID + //Save PMKID u4Byte ulIndex, i, j; BOOLEAN blInserted; u1Byte bssidcount=0; - int NumPreferredBSSID = Params->PreferredBSSEntryList.ElementCount; + int NumPreferredBSSID = Params->PreferredBSSEntryList.ElementCount; RT_TRACE(COMP_MLME, DBG_LOUD, ("==> Wdi_Task_Connect()\n")); @@ -918,26 +918,26 @@ Wdi_Task_Connect( N6_ASSIGN_OBJECT_HEADER( SsidList.Header, - NDIS_OBJECT_TYPE_DEFAULT, - DOT11_SSID_LIST_REVISION_1, + NDIS_OBJECT_TYPE_DEFAULT, + DOT11_SSID_LIST_REVISION_1, sizeof(DOT11_SSID_LIST) ); - // Clear all entries + // Clear all entries for( ulIndex=0; ulIndexPMKIDList[ulIndex].bUsed = FALSE; } pSecInfo->PMKIDCount = 0; - - FtResetEntryList(pAdapter); + + FtResetEntryList(pAdapter); // TODO: Choose corresponding adapter before assigning parameters for(bssidcount=0;bssidcountPreferredBSSEntryList.pElements[bssidcount]; if( connectBssEntry->Optional.PMKID_IsPresent == TRUE ) - { + { // 2. Insert or cover with new PMKID. blInserted = FALSE; for(j=0 ; jOptional.FTInitialAssocParameters_IsPresent) { FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_MDE, connectBssEntry->BSSID.Address, @@ -986,12 +986,12 @@ Wdi_Task_Connect( connectBssEntry->FTReAssocParameters.MDE.pElements, connectBssEntry->FTReAssocParameters.MDE.ElementCount); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters MDE:\n", connectBssEntry->FTReAssocParameters.MDE.pElements, connectBssEntry->FTReAssocParameters.MDE.ElementCount); - + FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_FTE, connectBssEntry->BSSID.Address, connectBssEntry->FTReAssocParameters.FTE.pElements, connectBssEntry->FTReAssocParameters.FTE.ElementCount); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters FTE:\n", connectBssEntry->FTReAssocParameters.FTE.pElements, connectBssEntry->FTReAssocParameters.FTE.ElementCount); - + FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_PMKR0_NAME, connectBssEntry->BSSID.Address, connectBssEntry->FTReAssocParameters.PMKR0Name.pmkname.Name, sizeof(WDI_TYPE_PMK_NAME)); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters PMKR0:\n", @@ -1019,14 +1019,14 @@ Wdi_Task_Connect( // TODO: HiddenNetwork / MFPEnabled / HostFIPSModeEnabled pMgntInfo->bRoamRequest = Params->ConnectParameters.ConnectionSettings.RoamRequest; RT_TRACE( COMP_MLME, DBG_LOUD, ("bRoamRequest %d\n", pMgntInfo->bRoamRequest) ); - + pMgntInfo->SafeModeEnabled = Params->ConnectParameters.ConnectionSettings.HostFIPSModeEnabled; - + if(pMgntInfo->SafeModeEnabled && !pMgntInfo->pHTInfo->bEnableHT) - pMgntInfo->pStaQos->QosCapability = QOS_DISABLE; + pMgntInfo->pStaQos->QosCapability = QOS_DISABLE; else - pMgntInfo->pStaQos->QosCapability = pMgntInfo->pStaQos->QosCapabilityBackup; - + pMgntInfo->pStaQos->QosCapability = pMgntInfo->pStaQos->QosCapabilityBackup; + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_task_connect(): bExcludeUnencrypted %d HostFIPSModeEnabled %d QosCapability 0x%x QosCapabilityBackup 0x%x enableHT %d\n", pMgntInfo->bExcludeUnencrypted, pMgntInfo->SafeModeEnabled, pMgntInfo->pStaQos->QosCapability, pMgntInfo->pStaQos->QosCapabilityBackup, pMgntInfo->pHTInfo->bEnableHT)); //3 DesiredSSIDList @@ -1040,9 +1040,9 @@ Wdi_Task_Connect( RT_PRINT_STR(COMP_MLME, DBG_LOUD, ("Desired SSID \n"), SsidList.SSIDs[i].ucSSID, SsidList.SSIDs[i].uSSIDLength); } pNdisCommon->dot11DesiredSSIDList = SsidList; - + //3 Authentication Algorithm - N6CSet_DOT11_AUTHENTICATION_ALOGORITHM(pAdapter, Params->ConnectParameters.AuthenticationAlgorithms.pElements[0]); + N6CSet_DOT11_AUTHENTICATION_ALOGORITHM(pAdapter, Params->ConnectParameters.AuthenticationAlgorithms.pElements[0]); RT_TRACE_F(COMP_SEC, DBG_LOUD, ("AuthenticationAlgorithms count = %d\n", Params->ConnectParameters.AuthenticationAlgorithms.ElementCount)); //3 Unicast Cipher Algorithm @@ -1052,20 +1052,20 @@ Wdi_Task_Connect( //3 Multicast Cipher Algorithm N6CSet_DOT11_MULTICAST_CIPHER_ALGORITHM(pAdapter, Params->ConnectParameters.MulticastCipherAlgorithms.pElements[0]); RT_TRACE_F(COMP_SEC, DBG_LOUD, ("MulticastCipherAlgorithms count = %d\n", Params->ConnectParameters.MulticastCipherAlgorithms.ElementCount)); - - + + //3 Additional Association Request IEs if(Params->ConnectParameters.Optional.AssociationRequestVendorIE_IsPresent) { if(Params->ConnectParameters.AssociationRequestVendorIE.ElementCount > 0) { RT_TRACE(COMP_MLME, DBG_LOUD, ("Wdi_Task_Connect(): set association request additional IE\n")); - MgntActSet_AdditionalAssocReqIE(pAdapter, - Params->ConnectParameters.AssociationRequestVendorIE.pElements, + MgntActSet_AdditionalAssocReqIE(pAdapter, + Params->ConnectParameters.AssociationRequestVendorIE.pElements, Params->ConnectParameters.AssociationRequestVendorIE.ElementCount ); - - RT_PRINT_DATA(COMP_MLME, DBG_TRACE, ("Wdi_Task_Connect(): AssociationRequestVendorIE\n"), + + RT_PRINT_DATA(COMP_MLME, DBG_TRACE, ("Wdi_Task_Connect(): AssociationRequestVendorIE\n"), Params->ConnectParameters.AssociationRequestVendorIE.pElements, Params->ConnectParameters.AssociationRequestVendorIE.ElementCount); } @@ -1084,11 +1084,11 @@ Wdi_Task_Connect( { RT_TRACE(COMP_MLME, DBG_LOUD, ("Wdi_Task_Connect(): set disallowed BSSIDs\n")); MgntActSet_ExcludedMacAddressList( - pAdapter, - (pu1Byte)Params->ConnectParameters.DisallowedBSSIDs.pElements, + pAdapter, + (pu1Byte)Params->ConnectParameters.DisallowedBSSIDs.pElements, Params->ConnectParameters.DisallowedBSSIDs.ElementCount ); - + for(; i < Params->ConnectParameters.DisallowedBSSIDs.ElementCount; i++) { RT_PRINT_ADDR(COMP_MLME, DBG_TRACE, ("Wdi_Task_Connect(): disallowed BSSID:"), @@ -1120,7 +1120,7 @@ Wdi_Task_Connect( PTLV_WDI_STRUCT pTlvData = NULL; ULONG BytesProcessed = 0; ULONG Prefix = sizeof(WDI_MESSAGE_HEADER); - + pTlvData = (PTLV_WDI_STRUCT)((pu1Byte)pOidHandle->pInputBuffer + sizeof(WDI_MESSAGE_HEADER)); // WDI_CONNECT_BSS_ENTRY @@ -1130,20 +1130,20 @@ Wdi_Task_Connect( DOT11_SSID_LIST SsidList; u1Byte NumSsid = 0; PRT_SECURITY_T pSecInfo = &(pAdapter->MgntInfo.SecurityInfo); - + InputBufferLength = pTlvData->Length; N6_ASSIGN_OBJECT_HEADER( SsidList.Header, - NDIS_OBJECT_TYPE_DEFAULT, - DOT11_SSID_LIST_REVISION_1, + NDIS_OBJECT_TYPE_DEFAULT, + DOT11_SSID_LIST_REVISION_1, sizeof(DOT11_SSID_LIST) ); SsidList.uNumOfEntries = NumSsid; pTlvData = (PTLV_WDI_STRUCT)((pu1Byte)pTlvData->Value); - + while(BytesProcessed < InputBufferLength) { // Parse Type @@ -1154,7 +1154,7 @@ Wdi_Task_Connect( RT_TRACE(COMP_MLME, DBG_LOUD, ("unknown TLV 0x%x\n", pTlvData->Type)); } break; - + case WDI_TLV_CONNECTION_SETTINGS: { u1Byte RoamRequest = 0; @@ -1168,7 +1168,7 @@ Wdi_Task_Connect( ExcludeUnencrypted = *(pu1Byte)(pTlvData->Value + 2); MFPEnabled = *(pu1Byte)(pTlvData->Value + 3); HostFIPSModeEnabled = *(pu1Byte)(pTlvData->Value + 4); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("WDI_TLV_CONNECTION_SETTINGS\n")); RT_TRACE(COMP_MLME, DBG_LOUD, ("RoamRequest = %d, HiddenNetwork = %d, ExcludeUnencrypted = %d, MFPEnabled = %d, HostFIPSModeEnabled = %d\n", RoamRequest, HiddenNetwork, ExcludeUnencrypted, MFPEnabled, HostFIPSModeEnabled)); @@ -1208,7 +1208,7 @@ Wdi_Task_Connect( case WDI_TLV_MULTICAST_CIPHER_ALGO_LIST: { u4Byte AlgorithmId = (*((pu4Byte)(pTlvData->Value))); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("WDI_TLV_MULTICAST_CIPHER_ALGO_LIST\n")); switch( AlgorithmId ) @@ -1222,7 +1222,7 @@ Wdi_Task_Connect( pSecInfo->GroupEncAlgorithm = RT_ENC_ALG_WEP40; RT_TRACE( COMP_SEC, DBG_LOUD, ("Wdi_Task_Connect(): DOT11_CIPHER_ALGO_WEP\n") ); break; - + case WDI_CIPHER_ALGO_WEP40: pSecInfo->GroupEncAlgorithm = RT_ENC_ALG_WEP40; RT_TRACE( COMP_SEC, DBG_LOUD, ("Wdi_Task_Connect(): DOT11_CIPHER_ALGO_WEP40\n") ); @@ -1239,8 +1239,8 @@ Wdi_Task_Connect( break; case DOT11_CIPHER_ALGO_WAPI_SMS4: //For WAPI IHV service support add by ylb 20111114 - pSecInfo->GroupEncAlgorithm = RT_ENC_ALG_SMS4; - RT_TRACE( COMP_SEC, DBG_LOUD, ("Wdi_Task_Connect(): DOT11_CIPHER_ALGO_WAPI_SMS4\n") ); + pSecInfo->GroupEncAlgorithm = RT_ENC_ALG_SMS4; + RT_TRACE( COMP_SEC, DBG_LOUD, ("Wdi_Task_Connect(): DOT11_CIPHER_ALGO_WAPI_SMS4\n") ); break; case WDI_CIPHER_ALGO_WEP104: pSecInfo->GroupEncAlgorithm = RT_ENC_ALG_WEP104; @@ -1263,7 +1263,7 @@ Wdi_Task_Connect( case WDI_TLV_UNICAST_CIPHER_ALGO_LIST: { u4Byte AlgorithmId = (*((pu4Byte)(pTlvData->Value))); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("WDI_TLV_UNICAST_CIPHER_ALGO_LIST\n")); N6CSet_DOT11_UNICAST_CIPHER_ALGORITHM(pAdapter, (DOT11_CIPHER_ALGORITHM)AlgorithmId); @@ -1293,7 +1293,7 @@ Wdi_Task_Connect( RT_TRACE(COMP_MLME, DBG_LOUD, ("WDI_TLV_ALLOWED_BSSIDS_LIST\n")); } break; - + } // Parse Length @@ -1302,7 +1302,7 @@ Wdi_Task_Connect( // Parse Content BytesProcessed += (4 + pTlvData->Length); - + pTlvData = (PTLV_WDI_STRUCT)((pu1Byte)pOidHandle->pInputBuffer + Prefix + 4 + BytesProcessed); } @@ -1322,12 +1322,12 @@ Wdi_Task_Connect( { pMgntInfo->Ssid.Octet = pNdisCommon->dot11DesiredSSIDList.SSIDs[0].ucSSID; pMgntInfo->Ssid.Length = (u2Byte)pNdisCommon->dot11DesiredSSIDList.SSIDs[0].uSSIDLength; - + pMgntInfo->bDisconnectRequest = FALSE; RT_TRACE(COMP_MLME, DBG_LOUD, ("This is roam request, go to roam flow\n")); MgntLinkStatusSetRoamingState(pAdapter, 0, RT_ROAMING_BY_DEAUTH, ROAMINGSTATE_SCANNING); DrvIFIndicateRoamingStart(pAdapter); - + if( MgntRoamRetry(pAdapter, FALSE) == FALSE ) ndisStatus = NDIS_STATUS_FAILURE; else @@ -1349,7 +1349,7 @@ Wdi_Task_Disconnect( WDI_TASK_DISCONNECT_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramDisconnect; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -1358,7 +1358,7 @@ Wdi_Task_Disconnect( { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N6CSet_DOT11_DISCONNECT_REQUEST returns: 0x%08X\n", status)); break; - } + } }while(FALSE); // M4 indication is not required since bWaitComplete in RT_SUPPORT_TASKs is FALSE @@ -1389,12 +1389,12 @@ Wdi_Task_CreatePort( NDIS_OID_REQUEST *req = NULL; WDI_TASK_CREATE_PORT_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramCreatePort; - + FunctionIn(COMP_OID_SET); do { - RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("NdisPortNumber:%d OpModeMask: 0x%08X\n", + RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("NdisPortNumber:%d OpModeMask: 0x%08X\n", param->CreatePortParameters.NdisPortNumber, param->CreatePortParameters.OpModeMask)); @@ -1412,19 +1412,19 @@ Wdi_Task_CreatePort( ) // TODO: OpModeMask is a bitmap with combination of possible op modes { status = N62C_OID_DOT11_CREATE_MAC(pAdapter, req); - + if(NDIS_STATUS_SUCCESS != status && NDIS_STATUS_PENDING != status) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N62C_OID_DOT11_CREATE_MAC returns error: 0x%08X\n", status)); Wdi_Xlat_FreeOid(req); } - + break; } else {// cases which we don't need to create mac DOT11_MAC_INFO *macInfo = req->DATA.METHOD_INFORMATION.InformationBuffer; - + status = NDIS_STATUS_SUCCESS; macInfo->uNdisPortNumber = 0; @@ -1436,7 +1436,7 @@ Wdi_Task_CreatePort( } }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; } @@ -1452,9 +1452,9 @@ Wdi_Task_DeletePort( NDIS_OID_REQUEST *req = NULL; PADAPTER pTargetAdapter = NULL; WDI_TASK_DELETE_PORT_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramDeletePort; - + FunctionIn(COMP_OID_SET); - + do { if(NULL == (req = Wdi_Xlat_AllocDeleteMacOid(pOidHandle, param))) @@ -1462,36 +1462,36 @@ Wdi_Task_DeletePort( status = NDIS_STATUS_RESOURCES; break; } - + // delete mac if(0 != param->DeletePortParameters.PortNumber) { //Delete group peer. WDI_DeleteGroupPeer(pAdapter, param->DeletePortParameters.PortNumber); - + status = N62C_OID_DOT11_DELETE_MAC(pAdapter, req); - + if(NDIS_STATUS_SUCCESS != status && NDIS_STATUS_PENDING != status) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N62C_OID_DOT11_DELETE_MAC returns error: 0x%08X\n", status)); Wdi_Xlat_FreeOid(req); } - + break; } else {// cases which we don't need to delete mac status = NDIS_STATUS_SUCCESS; - + //Delete group peer. WDI_DeleteGroupPeer(pAdapter, param->DeletePortParameters.PortNumber); - + WDI_CMD_DeletePortComplete(pAdapter, req, status); break; } - + }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; } @@ -1513,16 +1513,16 @@ Wdi_Task_SetApCipherKeyMappingKey( if(!pEntry) return NDIS_STATUS_INVALID_DATA; - + CopyMem(pEntry->perSTAKeyInfo.PTK, pKeyMaterial, keyLen); // Added by Annie, 2005-07-12. - + if(WDI_CIPHER_ALGO_TKIP == cipherAlgo) { pEntry->perSTAKeyInfo.TempEncKey = pEntry->perSTAKeyInfo.PTK+TKIP_ENC_KEY_POS; - pEntry->perSTAKeyInfo.TxMICKey = pEntry->perSTAKeyInfo.PTK+(TKIP_MIC_KEY_POS); + pEntry->perSTAKeyInfo.TxMICKey = pEntry->perSTAKeyInfo.PTK+(TKIP_MIC_KEY_POS); pEntry->perSTAKeyInfo.RxMICKey = pEntry->perSTAKeyInfo.PTK+(TKIP_MIC_KEY_POS+TKIP_MIC_KEY_LEN); - //Add for AP mode HW enc,by CCW + //Add for AP mode HW enc,by CCW ucIndex = AP_FindFreeEntry(pAdapter , pEntry->MacAddr); if(ucIndex == TOTAL_CAM_ENTRY) { @@ -1531,12 +1531,12 @@ Wdi_Task_SetApCipherKeyMappingKey( } //set key - AP_Setkey(pAdapter , + AP_Setkey(pAdapter , pEntry->perSTAKeyInfo.pWLanSTA->MacAddr, - ucIndex, // Entey index + ucIndex, // Entey index CAM_TKIP, - 0, // Parise key - pEntry->perSTAKeyInfo.TempEncKey); + 0, // Parise key + pEntry->perSTAKeyInfo.TempEncKey); pEntry->keyindex = ucIndex; } @@ -1544,28 +1544,28 @@ Wdi_Task_SetApCipherKeyMappingKey( { // AES mode AP-WPA AES,CCW AESCCMP_BLOCK blockKey; AUTH_PKEY_MGNT_TAG *pKeyMgnt = &pEntry->perSTAKeyInfo; - + RT_TRACE(COMP_SEC, DBG_LOUD, ("===>CCMP Set Station Key.\n")); RT_PRINT_ADDR(COMP_SEC, DBG_LOUD, "===> Peer Address : ", addr); - - //Add for AP mode HW enc,by CCW + + //Add for AP mode HW enc,by CCW ucIndex = AP_FindFreeEntry(pAdapter, pEntry->MacAddr); if(ucIndex == TOTAL_CAM_ENTRY) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("[Warning]: Cam Entry is FULL!!!\n")); return NDIS_STATUS_INVALID_DATA; } - - //Set Key + + //Set Key PlatformMoveMemory(blockKey.x , pEntry->perSTAKeyInfo.PTK, 16); AES_SetKey(blockKey.x, AESCCMP_BLK_SIZE * 8, (u4Byte *)pEntry->perSTAKeyInfo.AESKeyBuf); //set hw key - AP_Setkey(pAdapter , + AP_Setkey(pAdapter , pEntry->perSTAKeyInfo.pWLanSTA->MacAddr, - ucIndex, // Entey index + ucIndex, // Entey index CAM_AES, - 0, // Parise key - pEntry->perSTAKeyInfo.PTK); + 0, // Parise key + pEntry->perSTAKeyInfo.PTK); pEntry->keyindex = ucIndex; } @@ -1599,7 +1599,7 @@ Wdi_Task_SetApCipherDefaultKey( else if(WDI_CIPHER_ALGO_CCMP == cipherAlgo) { AESCCMP_BLOCK blockKey; - + PlatformMoveMemory(blockKey.x, pGlInfo->GTK, 16); pMgntInfo->SecurityInfo.GroupTransmitKeyIdx = (u1Byte)keyId; AES_SetKey(blockKey.x, AESCCMP_BLK_SIZE * 8, (u4Byte *)pGlInfo->AESGTK); @@ -1618,7 +1618,7 @@ Wdi_Task_Set_Radio_State( PRT_NDIS6_COMMON pNdisCommon = pAdapter->pNdisCommon; ULONG InputBufferLength = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; WDI_SET_RADIO_STATE_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetRadioState; - + RT_TRACE(COMP_MLME, DBG_LOUD, ("==> Wdi_Task_Set_Radio_State()\n")); if( Params->SoftwareRadioState == TRUE ) @@ -1657,8 +1657,8 @@ Wdi_Task_Roam( u4Byte ulIndex, i, j; BOOLEAN blInserted; u1Byte bssidcount=0; - int NumPreferredBSSID = Params->PreferredBSSEntryList.ElementCount; - + int NumPreferredBSSID = Params->PreferredBSSEntryList.ElementCount; + RT_TRACE(COMP_MLME, DBG_LOUD, ("==> Wdi_Task_Roam()\n")); @@ -1671,28 +1671,28 @@ Wdi_Task_Roam( N6_ASSIGN_OBJECT_HEADER( SsidList.Header, - NDIS_OBJECT_TYPE_DEFAULT, - DOT11_SSID_LIST_REVISION_1, + NDIS_OBJECT_TYPE_DEFAULT, + DOT11_SSID_LIST_REVISION_1, sizeof(DOT11_SSID_LIST) ); // TODO: Choose corresponding adapter before assigning parameters - - // Clear all entries + + // Clear all entries for( ulIndex=0; ulIndexPMKIDList[ulIndex].bUsed = FALSE; } pSecInfo->PMKIDCount = 0; - - FtResetEntryList(pAdapter); + + FtResetEntryList(pAdapter); // TODO: Choose corresponding adapter before assigning parameters for(bssidcount=0;bssidcountPreferredBSSEntryList.pElements[bssidcount]; if( connectBssEntry->Optional.PMKID_IsPresent == TRUE ) - { + { // 2. Insert or cover with new PMKID. blInserted = FALSE; for(j=0 ; jOptional.FTInitialAssocParameters_IsPresent) { FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_MDE, connectBssEntry->BSSID.Address, @@ -1741,12 +1741,12 @@ Wdi_Task_Roam( connectBssEntry->FTReAssocParameters.MDE.pElements, connectBssEntry->FTReAssocParameters.MDE.ElementCount); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters MDE:\n", connectBssEntry->FTReAssocParameters.MDE.pElements, connectBssEntry->FTReAssocParameters.MDE.ElementCount); - + FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_FTE, connectBssEntry->BSSID.Address, connectBssEntry->FTReAssocParameters.FTE.pElements, connectBssEntry->FTReAssocParameters.FTE.ElementCount); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters FTE:\n", connectBssEntry->FTReAssocParameters.FTE.pElements, connectBssEntry->FTReAssocParameters.FTE.ElementCount); - + FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_PMKR0_NAME, connectBssEntry->BSSID.Address, connectBssEntry->FTReAssocParameters.PMKR0Name.pmkname.Name, sizeof(WDI_TYPE_PMK_NAME)); RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "FTReAssocParameters PMKR0:\n", @@ -1768,26 +1768,26 @@ Wdi_Task_Roam( RT_PRINT_DATA( COMP_MLME, DBG_LOUD, "PMKID: ", pSecInfo->PMKIDList[ulIndex].PMKID, connectBssEntry->PMKID.ElementCount); } } - + pAdapter->MgntInfo.bExcludeUnencrypted = Params->ConnectParameters.ConnectionSettings.ExcludeUnencrypted; // TODO: HiddenNetwork / MFPEnabled / HostFIPSModeEnabled pMgntInfo->SafeModeEnabled = Params->ConnectParameters.ConnectionSettings.HostFIPSModeEnabled; - + if(pMgntInfo->SafeModeEnabled && !pMgntInfo->pHTInfo->bEnableHT) - pMgntInfo->pStaQos->QosCapability = QOS_DISABLE; + pMgntInfo->pStaQos->QosCapability = QOS_DISABLE; else - pMgntInfo->pStaQos->QosCapability = pMgntInfo->pStaQos->QosCapabilityBackup; - + pMgntInfo->pStaQos->QosCapability = pMgntInfo->pStaQos->QosCapabilityBackup; + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_task_roam(): bExcludeUnencrypted %d HostFIPSModeEnabled %d QosCapability 0x%x\n", pMgntInfo->bExcludeUnencrypted, pMgntInfo->SafeModeEnabled, pMgntInfo->pStaQos->QosCapability)); - + //3 RoamNeededReason if( Params->ConnectParameters.ConnectionSettings.RoamRequest == TRUE ) { AssocStatus = Params->ConnectParameters.ConnectionSettings.RoamNeededReason; RT_TRACE_F(COMP_MLME, DBG_LOUD, ("RoamNeededReason %d\n", AssocStatus)); } - + //3 DesiredSSIDList SsidList.uNumOfEntries = Params->ConnectParameters.SSIDList.ElementCount; @@ -1809,19 +1809,19 @@ Wdi_Task_Roam( //3 Multicast Cipher Algorithm N6CSet_DOT11_MULTICAST_CIPHER_ALGORITHM(pAdapter, Params->ConnectParameters.MulticastCipherAlgorithms.pElements[0]); - + //3 Additional Association Request IEs if(Params->ConnectParameters.Optional.AssociationRequestVendorIE_IsPresent) { if(Params->ConnectParameters.AssociationRequestVendorIE.ElementCount > 0) { RT_TRACE(COMP_MLME, DBG_LOUD, ("Wdi_Task_Roam(): set association request additional IE\n")); - MgntActSet_AdditionalAssocReqIE(pAdapter, - Params->ConnectParameters.AssociationRequestVendorIE.pElements, + MgntActSet_AdditionalAssocReqIE(pAdapter, + Params->ConnectParameters.AssociationRequestVendorIE.pElements, Params->ConnectParameters.AssociationRequestVendorIE.ElementCount ); - - RT_PRINT_DATA(COMP_MLME, DBG_TRACE, ("Wdi_Task_Roam(): AssociationRequestVendorIE\n"), + + RT_PRINT_DATA(COMP_MLME, DBG_TRACE, ("Wdi_Task_Roam(): AssociationRequestVendorIE\n"), Params->ConnectParameters.AssociationRequestVendorIE.pElements, Params->ConnectParameters.AssociationRequestVendorIE.ElementCount); } @@ -1840,11 +1840,11 @@ Wdi_Task_Roam( { RT_TRACE(COMP_MLME, DBG_LOUD, ("Wdi_Task_Roam(): set disallowed BSSIDs\n")); MgntActSet_ExcludedMacAddressList( - pAdapter, - (pu1Byte)Params->ConnectParameters.DisallowedBSSIDs.pElements, + pAdapter, + (pu1Byte)Params->ConnectParameters.DisallowedBSSIDs.pElements, Params->ConnectParameters.DisallowedBSSIDs.ElementCount ); - + for(; i < Params->ConnectParameters.DisallowedBSSIDs.ElementCount; i++) { RT_PRINT_ADDR(COMP_MLME, DBG_TRACE, ("Wdi_Task_Roam(): disallowed BSSID:"), @@ -1871,7 +1871,7 @@ Wdi_Task_Roam( } } } - + if( pMgntInfo->bMediaConnect || pMgntInfo->bIbssStarter) { if( pMgntInfo->mIbss ){ @@ -1885,7 +1885,7 @@ Wdi_Task_Roam( MgntDisconnectAP(pAdapter, disas_lv_ss); } } - + RT_TRACE(COMP_MLME, DBG_LOUD, ("pMgntInfo->PrepareRoamState %d\n", pMgntInfo->PrepareRoamState)); switch(pMgntInfo->PrepareRoamState) { @@ -1909,13 +1909,13 @@ Wdi_Task_Roam( RT_TRACE(COMP_MLME, DBG_WARNING, ("No matched roaming state\n")); break; } - + pMgntInfo->bPrepareRoaming = FALSE; pMgntInfo->PrepareRoamState = RT_PREPARE_ROAM_NONE; pMgntInfo->PrepareRoamingCount = 0; - + DrvIFIndicateRoamingStart(pAdapter); - + if( MgntRoamRetry(pAdapter, FALSE) == FALSE ) ndisStatus = NDIS_STATUS_FAILURE; else @@ -1937,7 +1937,7 @@ WdiSimpleSetProperty( PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); PRT_NDIS6_COMMON pNdisCommon = pAdapter->pNdisCommon; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; // We complete the OID. Need to populate some fields @@ -1955,11 +1955,11 @@ WdiSimpleSetProperty( return ndisStatus; } -// +// // Translate from RT_PS_MODE to WDI_POWER_SAVE_LEVEL // 2005.02.15, by rcnjko. // -int +int TranslatePsToWdiPs( IN POWER_LEVEL_CONFIG PowerMode ) @@ -1969,20 +1969,20 @@ TranslatePsToWdiPs( switch(PowerMode) { case POWER_SAVING_NO_POWER_SAVING: - WdiPsMode = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; - break; + WdiPsMode = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; + break; case POWER_SAVING_FAST_PSP: - WdiPsMode = WDI_POWER_SAVE_LEVEL_FAST_PSP; - break; + WdiPsMode = WDI_POWER_SAVE_LEVEL_FAST_PSP; + break; case POWER_SAVING_MAX_PSP: - WdiPsMode = WDI_POWER_SAVE_LEVEL_MAX_PSP; - break; + WdiPsMode = WDI_POWER_SAVE_LEVEL_MAX_PSP; + break; case POWER_SAVING_MAXIMUM_LEVEL: - WdiPsMode = WDI_POWER_SAVE_LEVEL_MAXIMUM_LEVEL; - break; + WdiPsMode = WDI_POWER_SAVE_LEVEL_MAXIMUM_LEVEL; + break; default: RT_TRACE(COMP_DBG, DBG_SERIOUS, ("TranslatePsToWdiPs(): Unknown PowerMode: 0x%X !!!\n", PowerMode)); - WdiPsMode = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; + WdiPsMode = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; break; } @@ -2041,15 +2041,15 @@ Wdi_Set_Add_Cipher_Keys( cpMacAddr(MacAddress, CipherKey.PeerMacAddress.Address); bDefaultKey = FALSE; - RT_PRINT_ADDR(COMP_SCAN, DBG_LOUD, "WDI_TLV_PEER_MAC_ADDRESS(): ", MacAddress); + RT_PRINT_ADDR(COMP_SCAN, DBG_LOUD, "WDI_TLV_PEER_MAC_ADDRESS(): ", MacAddress); } if(CipherKey.Optional.CipherKeyID_IsPresent) { KeyIndex = CipherKey.CipherKeyID.CipherKeyID; - RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_CIPHER_KEY_ID 0x%x\n", KeyIndex)); + RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_CIPHER_KEY_ID 0x%x\n", KeyIndex)); } - + { cipherAlgo = CipherKey.CipherKeyTypeInfo.CipherAlgorithm; direction = CipherKey.CipherKeyTypeInfo.Direction; @@ -2061,7 +2061,7 @@ Wdi_Set_Add_Cipher_Keys( switch(cipherAlgo) { case WDI_CIPHER_ALGO_WEP: - rtEncAlgo = RT_ENC_ALG_WEP; + rtEncAlgo = RT_ENC_ALG_WEP; break; case WDI_CIPHER_ALGO_WEP40: @@ -2070,59 +2070,59 @@ Wdi_Set_Add_Cipher_Keys( case WDI_CIPHER_ALGO_WEP104: rtEncAlgo = RT_ENC_ALG_WEP104; - break; - - case WDI_CIPHER_ALGO_TKIP: + break; + + case WDI_CIPHER_ALGO_TKIP: rtEncAlgo = RT_ENC_ALG_TKIP; break; - case WDI_CIPHER_ALGO_CCMP: - rtEncAlgo = RT_ENC_ALG_AESCCMP; + case WDI_CIPHER_ALGO_CCMP: + rtEncAlgo = RT_ENC_ALG_AESCCMP; break; - case WDI_CIPHER_ALGO_BIP: + case WDI_CIPHER_ALGO_BIP: break; default: break; - } - } + } + } - if(CipherKey.Optional.ReceiveSequenceCount_IsPresent) + if(CipherKey.Optional.ReceiveSequenceCount_IsPresent) { PlatformMoveMemory(&KeyRSC, CipherKey.ReceiveSequenceCount.ReceiveSequenceCount, 6); -// RT_TRACE(COMP_SEC, DBG_LOUD, ("WIFI_TLV_CIPHER_KEY_RECEIVE_SEQUENCE_COUNT 0x%"i64fmt"x\n", KeyRSC)); +// RT_TRACE(COMP_SEC, DBG_LOUD, ("WIFI_TLV_CIPHER_KEY_RECEIVE_SEQUENCE_COUNT 0x%"i64fmt"x\n", KeyRSC)); } if(CipherKey.Optional.CCMPKey_IsPresent) - { + { KeyLen = CipherKey.CCMPKey.ElementCount; pKeyMaterial = CipherKey.CCMPKey.pElements; - bValidKeyRSC = TRUE; + bValidKeyRSC = TRUE; RT_PRINT_DATA(COMP_SEC, DBG_LOUD,("WDI_TLV_CIPHER_KEY_CCMP_KEY\n"),pKeyMaterial,KeyLen); } if(CipherKey.Optional.TKIPInfo_IsPresent) - { + { // Tkip Enc Key(16) + STA Rx MIC Key(8) + STA Tx MIC Key(8). RT_PRINT_DATA(COMP_SEC, DBG_LOUD, ("TKIPKey \n"), CipherKey.TKIPInfo.TKIPKey.pElements, CipherKey.TKIPInfo.TKIPKey.ElementCount); RT_PRINT_DATA(COMP_SEC, DBG_LOUD, ("TKIPMIC \n"), CipherKey.TKIPInfo.TKIPMIC.pElements, CipherKey.TKIPInfo.TKIPMIC.ElementCount); - + PlatformMoveMemory(pTkipKeyMaterial, CipherKey.TKIPInfo.TKIPKey.pElements, CipherKey.TKIPInfo.TKIPKey.ElementCount); - PlatformMoveMemory(pTkipKeyMaterial+CipherKey.TKIPInfo.TKIPKey.ElementCount, CipherKey.TKIPInfo.TKIPMIC.pElements, CipherKey.TKIPInfo.TKIPMIC.ElementCount); - - RT_PRINT_DATA(COMP_SEC, DBG_LOUD, ("pTkipKeyMaterial \n"), pTkipKeyMaterial, TKIP_KEY_LEN); - - pKeyMaterial = pTkipKeyMaterial; - KeyLen = CipherKey.TKIPInfo.TKIPKey.ElementCount + CipherKey.TKIPInfo.TKIPMIC.ElementCount; - - bValidKeyRSC = TRUE; - RT_PRINT_DATA(COMP_SEC, DBG_LOUD,("WDI_TLV_CIPHER_KEY_TKIP_KEY_INFO\n"),pKeyMaterial,KeyLen); + PlatformMoveMemory(pTkipKeyMaterial+CipherKey.TKIPInfo.TKIPKey.ElementCount, CipherKey.TKIPInfo.TKIPMIC.pElements, CipherKey.TKIPInfo.TKIPMIC.ElementCount); + + RT_PRINT_DATA(COMP_SEC, DBG_LOUD, ("pTkipKeyMaterial \n"), pTkipKeyMaterial, TKIP_KEY_LEN); + + pKeyMaterial = pTkipKeyMaterial; + KeyLen = CipherKey.TKIPInfo.TKIPKey.ElementCount + CipherKey.TKIPInfo.TKIPMIC.ElementCount; + + bValidKeyRSC = TRUE; + RT_PRINT_DATA(COMP_SEC, DBG_LOUD,("WDI_TLV_CIPHER_KEY_TKIP_KEY_INFO\n"),pKeyMaterial,KeyLen); } if(CipherKey.Optional.BIPKey_IsPresent) - { + { if( CipherKey.BIPKey.ElementCount == BIP_KEY_LEN) { PlatformMoveMemory( pSecInfo->BIPKeyBuffer ,CipherKey.BIPKey.pElements, CipherKey.BIPKey.ElementCount); @@ -2135,13 +2135,13 @@ Wdi_Set_Add_Cipher_Keys( { ndisStatus = NDIS_STATUS_INVALID_DATA; } - - return ndisStatus; - } - + + return ndisStatus; + } + if(CipherKey.Optional.WEPKey_IsPresent) - { - if(rtEncAlgo == RT_ENC_ALG_WEP) + { + if(rtEncAlgo == RT_ENC_ALG_WEP) { if (CipherKey.WEPKey.ElementCount == NATIVE_802_11_WEP40_KEY_LENGTH) { @@ -2154,13 +2154,13 @@ Wdi_Set_Add_Cipher_Keys( RT_TRACE( COMP_SEC, DBG_LOUD, ("Wdi_Set_Add_Cipher_Keys(): DOT11_CIPHER_ALGO_WEP104\n") ); } } - + KeyLen = CipherKey.WEPKey.ElementCount; pKeyMaterial = CipherKey.WEPKey.pElements; - RT_PRINT_DATA(COMP_SEC, DBG_LOUD,("WDI_TLV_CIPHER_KEY_WEP_KEY\n"),pKeyMaterial,KeyLen); - } - + RT_PRINT_DATA(COMP_SEC, DBG_LOUD,("WDI_TLV_CIPHER_KEY_WEP_KEY\n"),pKeyMaterial,KeyLen); + } + RT_TRACE(COMP_SEC, DBG_LOUD,("==>CipherType %s\n", (WDI_CIPHER_KEY_TYPE_PAIRWISE_KEY == cipherType)?"WDI_CIPHER_KEY_TYPE_PAIRWISE_KEY":( (WDI_CIPHER_KEY_TYPE_GROUP_KEY == cipherType)?"WDI_CIPHER_KEY_TYPE_GROUP_KEY":"WDI_CIPHER_KEY_TYPE_IGTK"))); if(0 == i && !ACTING_AS_AP(pAdapter)) { @@ -2169,12 +2169,12 @@ Wdi_Set_Add_Cipher_Keys( pSecInfo->PairwiseEncAlgorithm = rtEncAlgo; } else if(WDI_CIPHER_KEY_TYPE_GROUP_KEY == cipherType) - { - pSecInfo->GroupEncAlgorithm = rtEncAlgo; + { + pSecInfo->GroupEncAlgorithm = rtEncAlgo; } RT_TRACE(COMP_SEC, DBG_LOUD,("==> pSecInfo->PairwiseEncAlgorithm=0x%x\n",pSecInfo->PairwiseEncAlgorithm)); - - } + + } { if( ACTING_AS_AP(pAdapter)) { @@ -2201,7 +2201,7 @@ Wdi_Set_Add_Cipher_Keys( KeyRSC); } else - { + { for(i=0;i<4;i++){ // Save for Reconnent for Ad-hoc ,by CCW // PlatformMoveMemory( pNdisCommon->RegDefaultKeyBuf[i], pKeyMaterial, KeyLen); @@ -2222,13 +2222,13 @@ Wdi_Set_Add_Cipher_Keys( PlatformMoveMemory( pNdisCommon->RegDefaultKeyBuf[i], pKeyMaterial, KeyLen); pNdisCommon->RegDefaultKey[i].Length = (u2Byte)KeyLen; } - else if(rtEncAlgo == RT_ENC_ALG_WEP104) + else if(rtEncAlgo == RT_ENC_ALG_WEP104) { PlatformMoveMemory( pNdisCommon->RegDefaultKeyWBuf[i], pKeyMaterial, KeyLen); pNdisCommon->RegDefaultKeyW[i].Length =(u2Byte)KeyLen; } - } + } } } else @@ -2253,21 +2253,21 @@ Wdi_Set_Add_Cipher_Keys( PlatformMoveMemory( pNdisCommon->RegDefaultKeyBuf[i], pKeyMaterial, KeyLen); pNdisCommon->RegDefaultKey[i].Length = (u2Byte)KeyLen; } - else if(rtEncAlgo == RT_ENC_ALG_WEP104) + else if(rtEncAlgo == RT_ENC_ALG_WEP104) { PlatformMoveMemory( pNdisCommon->RegDefaultKeyWBuf[i], pKeyMaterial, KeyLen); pNdisCommon->RegDefaultKeyW[i].Length =(u2Byte)KeyLen; } } PlatformRequestPreAuthentication( pAdapter, PRE_AUTH_INDICATION_REASON_ASSOCIATION ); - + } else { // TODO: [WDI] security for Ad-hoc mode - + } - } + } } } @@ -2295,7 +2295,7 @@ Wdi_Set_Delete_Cipher_Keys( WDI_SET_DELETE_CIPHER_KEYS_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetDeleteDefaultCipherKeys; WDI_SET_DELETE_CIPHER_KEYS_CONTAINER CipherKeyInfo = {0}; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; BOOLEAN bDefaultKey = TRUE; @@ -2305,7 +2305,7 @@ Wdi_Set_Delete_Cipher_Keys( ULONG cipherAlgo = 0; ULONG direction = WDI_CIPHER_KEY_DIRECTION_BOTH; u1Byte static_key = TRUE; - ULONG cipherType = WDI_CIPHER_KEY_TYPE_PAIRWISE_KEY; + ULONG cipherType = WDI_CIPHER_KEY_TYPE_PAIRWISE_KEY; u4Byte i = 0; @@ -2323,17 +2323,17 @@ Wdi_Set_Delete_Cipher_Keys( CipherKeyInfo = Params->CipherKeyInfo.pElements[i]; if(CipherKeyInfo.Optional.PeerMacAddress_IsPresent) { - RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_PEER_MAC_ADDRESS\n")); + RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_PEER_MAC_ADDRESS\n")); cpMacAddr(MacAddress, CipherKeyInfo.PeerMacAddress.Address); bDefaultKey = FALSE; } if(CipherKeyInfo.Optional.CipherKeyID_IsPresent) { - RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_CIPHER_KEY_ID\n")); + RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_CIPHER_KEY_ID\n")); KeyIndex = CipherKeyInfo.CipherKeyID.CipherKeyID; } - + { cipherAlgo = CipherKeyInfo.CipherKeyTypeInfo.CipherAlgorithm; direction = CipherKeyInfo.CipherKeyTypeInfo.Direction; @@ -2345,7 +2345,7 @@ Wdi_Set_Delete_Cipher_Keys( switch(cipherAlgo) { case WDI_CIPHER_ALGO_WEP: - rtEncAlgo = RT_ENC_ALG_WEP; + rtEncAlgo = RT_ENC_ALG_WEP; break; case WDI_CIPHER_ALGO_WEP40: @@ -2354,40 +2354,40 @@ Wdi_Set_Delete_Cipher_Keys( case WDI_CIPHER_ALGO_WEP104: rtEncAlgo = RT_ENC_ALG_WEP104; - break; - - case WDI_CIPHER_ALGO_TKIP: + break; + + case WDI_CIPHER_ALGO_TKIP: rtEncAlgo = RT_ENC_ALG_TKIP; break; - case WDI_CIPHER_ALGO_CCMP: - rtEncAlgo = RT_ENC_ALG_AESCCMP; + case WDI_CIPHER_ALGO_CCMP: + rtEncAlgo = RT_ENC_ALG_AESCCMP; break; - case WDI_CIPHER_ALGO_BIP: + case WDI_CIPHER_ALGO_BIP: break; default: break; - } - } + } + } RT_TRACE(COMP_SEC, DBG_LOUD, ("[WDI] [Property] WDI_SET_DELETE_CIPHER_KEYS: delete Key\n")); { // - // 061028, rcnjko: WDK said we shall ignore AlgorithmId if bDelete is set, - // so we use GroupEncAlgorithm instead. + // 061028, rcnjko: WDK said we shall ignore AlgorithmId if bDelete is set, + // so we use GroupEncAlgorithm instead. // if( KeyIndex > 3 && KeyIndex < 6 ) { // 802.11w BIP key Key index 5 or 6 - + PlatformZeroMemory(pSecInfo->BIPKeyBuffer, MAX_KEY_LEN); } else if( !pAdapter->MgntInfo.bRSNAPSKMode) { MgntActSet_802_11_REMOVE_KEY( - pAdapter, + pAdapter, rtEncAlgo, KeyIndex, MacAddress, @@ -2403,18 +2403,18 @@ Wdi_Set_Delete_Cipher_Keys( RT_TRACE( COMP_OID_SET, DBG_WARNING, (" <- [WDI] Property WIFI_SET_DELETE_CIPHER_KEYS, MgntActSet_RSNA_REMOVE_DEAULT_KEY return FALSE !!!\n")); return NDIS_STATUS_INVALID_DATA; } - } + } } - } + } } else if(WDI_TLV_DELETE_CIPHER_KEY_INFO== pTlvData->Type) - { + { InputBufferLength = pTlvData->Length; pTlvData = (PTLV_WDI_STRUCT)((pu1Byte)pTlvData->Value); Prefix += 4; - + while(BytesProcessed < InputBufferLength) { // Parse Type @@ -2425,7 +2425,7 @@ Wdi_Set_Delete_Cipher_Keys( RT_TRACE(COMP_SEC, DBG_LOUD, ("unknown TLV 0x%x\n", pTlvData->Type)); } break; - + case WDI_TLV_PEER_MAC_ADDRESS: { RT_TRACE(COMP_SEC, DBG_LOUD, ("WDI_TLV_PEER_MAC_ADDRESS\n")); @@ -2462,26 +2462,26 @@ Wdi_Set_Delete_Cipher_Keys( // Parse Content BytesProcessed += (4 + pTlvData->Length); - + pTlvData = (PTLV_WDI_STRUCT)((pu1Byte)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer + Prefix + BytesProcessed); } RT_TRACE(COMP_SEC, DBG_LOUD, ("[WDI] [Property] WDI_SET_DELETE_CIPHER_KEYS: delete Key\n")); // - // 061028, rcnjko: WDK said we shall ignore AlgorithmId if bDelete is set, - // so we use GroupEncAlgorithm instead. + // 061028, rcnjko: WDK said we shall ignore AlgorithmId if bDelete is set, + // so we use GroupEncAlgorithm instead. // rtEncAlgo = pSecInfo->GroupEncAlgorithm; if( KeyIndex > 3 && KeyIndex < 6 ) { // 802.11w BIP key Key index 5 or 6 - + PlatformZeroMemory(pSecInfo->BIPKeyBuffer, MAX_KEY_LEN); } else if( !pAdapter->MgntInfo.bRSNAPSKMode) { MgntActSet_802_11_REMOVE_KEY( - pAdapter, + pAdapter, rtEncAlgo, KeyIndex, MacAddress, @@ -2523,7 +2523,7 @@ Wdi_Set_Default_Key_ID( // Set default key id: 0 ~ 3. KeyId &= 0x3; - // The following code will cause 8187 failed to link to AP. + // The following code will cause 8187 failed to link to AP. pSecInfo->DefaultTransmitKeyIdx = (u1Byte)KeyId; pNdisCommon->RegDefaultKeyId = (u1Byte)KeyId; @@ -2542,9 +2542,9 @@ Wdi_Set_Receive_Packet_Filter( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; ULONG BytesRead = 0, BytesNeeded = 0; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - ULONG InputBufferLength + ULONG InputBufferLength = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength;; WDI_SET_RECEIVE_PACKET_FILTER_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetReceivePacketFilter; @@ -2562,7 +2562,7 @@ Wdi_Set_Receive_Packet_Filter( pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength, &BytesRead, &BytesNeeded); - + return ndisStatus; } @@ -2581,7 +2581,7 @@ Wdi_Set_Network_List_Offload( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); PRT_NDIS6_COMMON pNdisCommon = pDefaultAdapter->pNdisCommon; - PRT_NLO_INFO pNLOInfo = &(pDefaultAdapter->MgntInfo.NLOInfo); + PRT_NLO_INFO pNLOInfo = &(pDefaultAdapter->MgntInfo.NLOInfo); u4Byte ChannelIndex = 0; u4Byte Index = 0; u4Byte ItemCnt = 0; @@ -2601,7 +2601,7 @@ Wdi_Set_Network_List_Offload( pNLOInfo->FastScanPeriod = 0; pNLOInfo->SlowScanPeriod = 0; pNdisCommon->ScanPeriod = 0; - + RT_TRACE( COMP_POWER, DBG_LOUD , (" ===>SsidOffload_IsPresent == 0 \n") ); return NDIS_STATUS_SUCCESS; } @@ -2633,12 +2633,12 @@ Wdi_Set_Network_List_Offload( for( i=0 ; iUnicastAlgorithms.ElementCount ; ++i, ++Index) { - // Copy SSID - CopySsid( pNLOInfo->dDot11OffloadNetworkList[Index].ssidbuf, + // Copy SSID + CopySsid( pNLOInfo->dDot11OffloadNetworkList[Index].ssidbuf, pNLOInfo->dDot11OffloadNetworkList[Index].ssidlen, pOffloadItem->SsidToScan.pElements, pOffloadItem->SsidToScan.ElementCount); - + RT_TRACE(COMP_POWER, DBG_LOUD, ("The %u OFFLOAD NETWORK SSID: %s\n", Index+1, pNLOInfo->dDot11OffloadNetworkList[Index].ssidbuf)); pAlgorithmItem = &(pOffloadItem->UnicastAlgorithms.pElements[i]); @@ -2658,15 +2658,15 @@ Wdi_Set_Network_List_Offload( pNLOInfo->dDot11OffloadNetworkList[Index].bPrivacy = TRUE; pNLOInfo->dDot11OffloadNetworkList[Index].chiper = 0x0; break; - case WDI_CIPHER_ALGO_TKIP : - if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA || + case WDI_CIPHER_ALGO_TKIP : + if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA || pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA_PSK ) { pNLOInfo->dDot11OffloadNetworkList[Index].SecLvl = RT_SEC_LVL_WPA; pNLOInfo->dDot11OffloadNetworkList[Index].bPrivacy = TRUE; pNLOInfo->dDot11OffloadNetworkList[Index].chiper = WPA_TKIP; } - else if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA || + else if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA || pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA_PSK ) { pNLOInfo->dDot11OffloadNetworkList[Index].SecLvl = RT_SEC_LVL_WPA2; @@ -2682,14 +2682,14 @@ Wdi_Set_Network_List_Offload( } break; case WDI_CIPHER_ALGO_CCMP : - if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA || + if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA || pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_WPA_PSK ) { pNLOInfo->dDot11OffloadNetworkList[Index].SecLvl = RT_SEC_LVL_WPA; pNLOInfo->dDot11OffloadNetworkList[Index].bPrivacy = TRUE; pNLOInfo->dDot11OffloadNetworkList[Index].chiper = WPA_AES; } - else if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA || + else if( pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA || pAlgorithmItem->AuthAlgorithm == WDI_AUTH_ALGO_RSNA_PSK ) { pNLOInfo->dDot11OffloadNetworkList[Index].SecLvl = RT_SEC_LVL_WPA2; @@ -2711,29 +2711,29 @@ Wdi_Set_Network_List_Offload( RT_TRACE( COMP_POWER, DBG_LOUD , (" ===> Unknow UnicastCipher : %x\n", pAlgorithmItem->CipherAlgorithm) ); break; } - + RT_TRACE(COMP_POWER , DBG_LOUD , (" Seclvl : %d\n", pNLOInfo->dDot11OffloadNetworkList[Index].SecLvl) ); RT_TRACE(COMP_POWER , DBG_LOUD , (" bPrivacy : %d\n", pNLOInfo->dDot11OffloadNetworkList[Index].bPrivacy) ); RT_TRACE(COMP_POWER , DBG_LOUD , (" chiper : %d\n", pNLOInfo->dDot11OffloadNetworkList[Index].chiper) ); RT_TRACE( COMP_POWER, DBG_LOUD, (" Channel Hint:\n")); - - // Save channel info + + // Save channel info // DOT11_MAX_CHANNEL_HINTS 4 for( ChannelIndex = 0 ; ChannelIndex < pOffloadItem->ChannellHintList.ElementCount ; ChannelIndex++ ) { pNLOInfo->dDot11OffloadNetworkList[Index].channelNumberHit[ChannelIndex] = pChannelItem[ChannelIndex].ChannelNumber; RT_TRACE( COMP_POWER, DBG_LOUD, (" %u", pNLOInfo->dDot11OffloadNetworkList[Index].channelNumberHit[ChannelIndex])); } - + RT_TRACE( COMP_POWER, DBG_LOUD, ("\n")); - - // Show Entry information !! + + // Show Entry information !! RT_TRACE( COMP_POWER, DBG_LOUD , (" ===> Show NLO info Index (%x):\n", Index) ); RT_PRINT_STR(COMP_POWER, DBG_LOUD, (" SSID"), pNLOInfo->dDot11OffloadNetworkList[Index].ssidbuf, pNLOInfo->dDot11OffloadNetworkList[Index].ssidlen); RT_TRACE( COMP_POWER , DBG_LOUD , (" chiper : %x \n", pNLOInfo->dDot11OffloadNetworkList[Index].chiper) ); } - } + } } else { @@ -2757,9 +2757,9 @@ Wdi_Set_Privacy_Exemption_List( ULONG BytesRead = 0, BytesNeeded = 0; PRT_NDIS6_COMMON pNdisCommon = pAdapter->pNdisCommon; PNDIS_OID_REQUEST pNdisRequest = pOidHandle->pNdisRequest; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - ULONG InputBufferLength + ULONG InputBufferLength = pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; WDI_SET_PRIVACY_EXEMPTION_LIST_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetPrivacyExemptionList; WDI_PRIVACY_EXEMPTION_LIST_CONTAINER PrivacyList = {0}; @@ -2780,34 +2780,34 @@ Wdi_Set_Privacy_Exemption_List( for(i = 0; i < Params->PrivacyExemptionEntry.ElementCount; i++) { PrivacyList = Params->PrivacyExemptionEntry.pElements[i]; - pNdisCommon->PrivacyExemptionEntries[i].usEtherType = + pNdisCommon->PrivacyExemptionEntries[i].usEtherType = PrivacyList.EtherType; - pNdisCommon->PrivacyExemptionEntries[i].usExemptionActionType = - PrivacyList.ExemptionActionType; - pNdisCommon->PrivacyExemptionEntries[i].usExemptionPacketType = - PrivacyList.ExemptionPacketType; + pNdisCommon->PrivacyExemptionEntries[i].usExemptionActionType = + PrivacyList.ExemptionActionType; + pNdisCommon->PrivacyExemptionEntries[i].usExemptionPacketType = + PrivacyList.ExemptionPacketType; } - RT_PRINT_DATA(COMP_OID_SET, DBG_LOUD, - "Privacy exempt list:", - pNdisCommon->PrivacyExemptionEntries, - (int)(pNdisCommon->PrivacyExemptionEntrieNum * sizeof(DOT11_PRIVACY_EXEMPTION))); + RT_PRINT_DATA(COMP_OID_SET, DBG_LOUD, + "Privacy exempt list:", + pNdisCommon->PrivacyExemptionEntries, + (int)(pNdisCommon->PrivacyExemptionEntrieNum * sizeof(DOT11_PRIVACY_EXEMPTION))); } - + return ndisStatus; } NDIS_STATUS -Wdi_Set_Power_State( +Wdi_Set_Power_State( IN PADAPTER pAdapter, IN PRT_OID_HANDLER pOidHandle ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + ndisStatus = N6SdioWdi_Mgnt_SetPower(pAdapter, pOidHandle); return ndisStatus; @@ -2815,15 +2815,15 @@ Wdi_Set_Power_State( NDIS_STATUS -Wdi_Abort_Task( +Wdi_Abort_Task( IN PADAPTER pAdapter, IN PRT_OID_HANDLER pOidHandle ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER) pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - ULONG InputBufferLength + ULONG InputBufferLength = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; WDI_TASK_ABORT_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramAbort; @@ -2875,7 +2875,7 @@ Wdi_Set_Add_Wol_Pattern( u1Byte Index, ptnIndex; RT_TRACE(COMP_OID_SET, DBG_LOUD, ("==> Wdi_Set_Add_Wol_Pattern()\n")); - + pWdiHeader->Status = NDIS_STATUS_SUCCESS; pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.BytesWritten = sizeof(WDI_MESSAGE_HEADER); @@ -2895,20 +2895,20 @@ Wdi_Set_Add_Wol_Pattern( for(Index = 0; Index < Params->WakePacketPattern.ElementCount; Index++, pPatternElements++) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET OID_PM_ADD_WOL_PATTERN[%d]:\n", Index)); - + if(pPatternElements->PacketPattern.ElementCount <= MAX_WOL_PATTERN_SIZE) { PlatformMoveMemory(WoLBitMapPatternContent, pPatternElements->PacketPattern.pElements, pPatternElements->PacketPattern.ElementCount); - RT_PRINT_DATA( COMP_OID_SET | COMP_POWER, DBG_LOUD, ("WoLBitMapPatternContent...\n"), + RT_PRINT_DATA( COMP_OID_SET | COMP_POWER, DBG_LOUD, ("WoLBitMapPatternContent...\n"), WoLBitMapPatternContent, sizeof(WoLBitMapPatternContent)); } if(pPatternElements->PacketPatternMask.ElementCount <= MAX_WOL_BIT_MASK_SIZE) { - PlatformMoveMemory(WoLBitMapPatternMask, pPatternElements->PacketPatternMask.pElements, pPatternElements->PacketPatternMask.ElementCount); - RT_PRINT_DATA( COMP_OID_SET | COMP_POWER, DBG_LOUD, ("WoLBitMapPatternMask...\n"), + PlatformMoveMemory(WoLBitMapPatternMask, pPatternElements->PacketPatternMask.pElements, pPatternElements->PacketPatternMask.ElementCount); + RT_PRINT_DATA( COMP_OID_SET | COMP_POWER, DBG_LOUD, ("WoLBitMapPatternMask...\n"), WoLBitMapPatternMask, sizeof(WoLBitMapPatternMask)); } - + //Find the index of the first empty entry. for(Index = 0; Index < MAX_SUPPORT_WOL_PATTERN_NUM(pAdapter); Index++) { @@ -2921,12 +2921,12 @@ Wdi_Set_Add_Wol_Pattern( if(pPmWoLPatternInfo[Index].PatternId == 0) break; } - + if(Index >= MAX_SUPPORT_WOL_PATTERN_NUM(pAdapter)) { ndisStatus = NDIS_STATUS_RESOURCES; RT_TRACE(COMP_POWER, DBG_LOUD, - ("SET OID_PNP_ADD_WOL_PATTERN: Return status(%#X). The number of wake up pattern is more than %d or the pattern Id is exist.\n", + ("SET OID_PNP_ADD_WOL_PATTERN: Return status(%#X). The number of wake up pattern is more than %d or the pattern Id is exist.\n", ndisStatus, MAX_SUPPORT_WOL_PATTERN_NUM(pAdapter))); return ndisStatus; } @@ -2946,9 +2946,9 @@ Wdi_Set_Add_Wol_Pattern( //Skip IPv4/IPv6 TCP SYN pattern because it will hit HW bug for the CRC. // We offload this pattern to FW. pPmWoLPatternInfo[Index].PatternType = eUnicastPattern; - RT_TRACE(COMP_OID_SET, DBG_LOUD, + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("OID_PM_ADD_WOL_PATTERN: IPv4/IPv6 TCP SYN pattern.\n")); - + } else if(PlatformCompareMemory(WoLBitMapPatternContent, MULTICAST_ADDR, sizeof(MULTICAST_ADDR)) == 0) { //Multicast @@ -2962,12 +2962,12 @@ Wdi_Set_Add_Wol_Pattern( { pPmWoLPatternInfo[Index].PatternType = eDontCareDA; } - + { - GetWOLWakeUpPattern(pAdapter, - (pu1Byte)&WoLBitMapPatternMask, - pPatternElements->PacketPatternMask.ElementCount, - (pu1Byte)&WoLBitMapPatternContent, + GetWOLWakeUpPattern(pAdapter, + (pu1Byte)&WoLBitMapPatternMask, + pPatternElements->PacketPatternMask.ElementCount, + (pu1Byte)&WoLBitMapPatternContent, pPatternElements->PacketPattern.ElementCount, Index, FALSE @@ -2976,7 +2976,7 @@ Wdi_Set_Add_Wol_Pattern( pPSC->WoLPatternNum++; } } - + } //2 Wake Packet Magic Packet @@ -3019,7 +3019,7 @@ Wdi_Set_Add_Wol_Pattern( if(Params->WakePacketEapolRequestIdPatternId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET OID_PM_ADD_WOL_PATTERN: Support EapolRequestIdMessage.\n")); - + if(!pPSC->EapolRequestIdMessagePatternId) { pPSC->EapolRequestIdMessagePatternId = Params->WakePacketEapolRequestIdPatternId; @@ -3047,7 +3047,7 @@ Wdi_Set_Remove_Wol_Pattern( PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); PRT_POWER_SAVE_CONTROL pPSC = GET_POWER_SAVE_CONTROL(pMgntInfo); PRT_PM_WOL_PATTERN_INFO pPmWoLPatternInfo = &(pPSC->PmWoLPatternInfo[0]); - + u4Byte RemovePatternId = Params->PatternId; RT_TRACE(COMP_OID_SET, DBG_LOUD, ("==> Wdi_Set_Remove_Wol_Pattern()\n")); @@ -3059,41 +3059,41 @@ Wdi_Set_Remove_Wol_Pattern( if(RemovePatternId == pPSC->MagicPacketPatternId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET_OID_PM_REMOVE_WOL_PATTERN: Remove MagicPacket.\n")); - + pPSC->MagicPacketPatternId = 0; pPSC->WoLPktNoPtnNum--; } else if(RemovePatternId == pPSC->EapolRequestIdMessagePatternId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET_OID_PM_REMOVE_WOL_PATTERN: Remove EapolRequestIdMessage.\n")); - + pPSC->EapolRequestIdMessagePatternId = 0; pPSC->WoLPktNoPtnNum--; } else if(RemovePatternId == pPSC->IPv4TcpSynPatternId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET_OID_PM_REMOVE_WOL_PATTERN: Remove IPv4TcpSyn.\n")); - + pPSC->IPv4TcpSynPatternId = 0; pPSC->WoLPktNoPtnNum--; } else if(RemovePatternId == pPSC->IPv6TcpSynPatternId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET_OID_PM_REMOVE_WOL_PATTERN: Remove IPv6TcpSyn.\n")); - + pPSC->IPv6TcpSynPatternId = 0; pPSC->WoLPktNoPtnNum--; } else { u1Byte Index; - + for(Index = 0; Index < MAX_SUPPORT_WOL_PATTERN_NUM(pAdapter); Index++) { if(pPmWoLPatternInfo[Index].PatternId == RemovePatternId) break; } - + if(Index >= MAX_SUPPORT_WOL_PATTERN_NUM(pAdapter)) { RT_TRACE(COMP_OID_SET, DBG_LOUD,("SET OID_PM_REMOVE_WOL_PATTERN: Cannot find the wake up pattern Id(%08X).\n", RemovePatternId)); @@ -3106,9 +3106,9 @@ Wdi_Set_Remove_Wol_Pattern( pPmWoLPatternInfo[Index].CrcRemainder = 0xffff; pPmWoLPatternInfo[Index].IsPatternMatch = 0; pPmWoLPatternInfo[Index].IsSupportedByFW = 0; - - pAdapter->HalFunc.SetHwRegHandler(pAdapter, HW_VAR_WF_MASK, (pu1Byte)(&Index)); - pAdapter->HalFunc.SetHwRegHandler(pAdapter, HW_VAR_WF_CRC, (pu1Byte)(&Index)); + + pAdapter->HalFunc.SetHwRegHandler(pAdapter, HW_VAR_WF_MASK, (pu1Byte)(&Index)); + pAdapter->HalFunc.SetHwRegHandler(pAdapter, HW_VAR_WF_CRC, (pu1Byte)(&Index)); pPmWoLPatternInfo[Index].HwWFMIndex = 0xff; // reset the value after clear HW/CAM entry. pPSC->WoLPatternNum--; @@ -3139,7 +3139,7 @@ Wdi_Set_Multicast_List( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; ULONG BytesRead = 0, BytesNeeded = 0; PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - ULONG InputBufferLength = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; + ULONG InputBufferLength = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; WDI_SET_MULTICAST_LIST_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSetMulticastList; WDI_MAC_ADDRESS Address = {0}; DOT11_MAC_ADDRESS MulticastList[MAX_MCAST_LIST_NUM]; @@ -3155,7 +3155,7 @@ Wdi_Set_Multicast_List( Address = param->MulticastList.pElements[i]; CopyMem(MulticastList[i], Address.Address, sizeof(DOT11_MAC_ADDRESS)); RT_PRINT_ADDR(COMP_OID_SET, DBG_TRACE, ("Wdi_Set_Multicast_List MulticastList\n"), MulticastList[i]); - RT_PRINT_ADDR(COMP_OID_SET, DBG_TRACE, ("Wdi_Set_Multicast_List Address.Address\n"), Address.Address); + RT_PRINT_ADDR(COMP_OID_SET, DBG_TRACE, ("Wdi_Set_Multicast_List Address.Address\n"), Address.Address); } ndisStatus = N6CSet_DOT11_MULTICAST_LIST(pAdapter, @@ -3168,7 +3168,7 @@ Wdi_Set_Multicast_List( { // Shall we need to clear multicast list since parameter was empty? } - + return ndisStatus; } @@ -3183,9 +3183,9 @@ Wdi_Set_Add_Pm_Protocol_Offload( PRT_POWER_SAVE_CONTROL pPSC = GET_POWER_SAVE_CONTROL(pMgntInfo); PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER) pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; WDI_SET_ADD_PM_PROTOCOL_OFFLOAD_PARAMETERS_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetAddProtocolOffload; - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("==> Wdi_Set_Add_Pm_Protocol_Offload()\n")); - + pWdiHeader->Status = NDIS_STATUS_SUCCESS; pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.BytesWritten = sizeof(WDI_MESSAGE_HEADER); @@ -3193,21 +3193,21 @@ Wdi_Set_Add_Pm_Protocol_Offload( //2 DOT11 RSN REKey Offload if(Params->DOT11RSNREKeyOffload.ProtocolOffloadId) { - RT_TRACE(COMP_OID_SET, DBG_LOUD, ("ProtocolOffloadId = %d\n", + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("ProtocolOffloadId = %d\n", Params->DOT11RSNREKeyOffload.ProtocolOffloadId)); - - pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eGTKOffloadIdx] + + pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eGTKOffloadIdx] = Params->DOT11RSNREKeyOffload.ProtocolOffloadId; - + //Copy kck, kek - PlatformMoveMemory(&(pMgntInfo->PMDot11RSNRekeyPara.KCK), - Params->DOT11RSNREKeyOffload.KCK_CONTENT, 32); + PlatformMoveMemory(&(pMgntInfo->PMDot11RSNRekeyPara.KCK), + Params->DOT11RSNREKeyOffload.KCK_CONTENT, 32); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KCK_CONTENT:\n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KCK_CONTENT:\n"), pMgntInfo->PMDot11RSNRekeyPara.KCK, 16); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KEK_CONTENT:\n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("KEK_CONTENT:\n"), pMgntInfo->PMDot11RSNRekeyPara.KEK, 16); - + pMgntInfo->PMDot11RSNRekeyPara.KeyReplayCounter = Params->DOT11RSNREKeyOffload.ReplayCounter; if(pPSC->RegGTKOffloadEnable) @@ -3218,18 +3218,18 @@ Wdi_Set_Add_Pm_Protocol_Offload( //2 ipv4 ARP Offload if(Params->ipv4ARPOffload.ProtocolOffloadId) { - pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eARPOffloadIdx] + pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eARPOffloadIdx] = Params->ipv4ARPOffload.ProtocolOffloadId; //Copy RemoteIPv4Address, HostIPv4Address & MacAddress - PlatformMoveMemory(&(pMgntInfo->PMIPV4ARPPara.RemoteIPv4Address), - Params->ipv4ARPOffload.RemoteIPV4Address, 14); - - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("RemoteIPv4Address:\n"), + PlatformMoveMemory(&(pMgntInfo->PMIPV4ARPPara.RemoteIPv4Address), + Params->ipv4ARPOffload.RemoteIPV4Address, 14); + + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("RemoteIPv4Address:\n"), pMgntInfo->PMIPV4ARPPara.RemoteIPv4Address, 4); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("HostIPv4Address:\n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("HostIPv4Address:\n"), pMgntInfo->PMIPV4ARPPara.HostIPv4Address, 4); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("MacAddress:\n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("MacAddress:\n"), pMgntInfo->PMIPV4ARPPara.MacAddress, 6); if(pPSC->RegARPOffloadEnable) @@ -3241,7 +3241,7 @@ Wdi_Set_Add_Pm_Protocol_Offload( if(Params->ipv6ARPOffload.ProtocolOffloadId) { RT_TRACE(COMP_OID_SET, DBG_LOUD, ("SET OID_PM_ADD_PROTOCOL_OFFLOAD. (NS IPv6)\n")); - + if((pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx1] != 0) && (pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx2] != 0)) { @@ -3252,43 +3252,43 @@ Wdi_Set_Add_Pm_Protocol_Offload( { u1Byte IPv6NSIndex = 0; RT_PM_IPV6_NS_PARAMETERS *NsParams; - + if( pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx1] == 0) { - pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx1] + pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx1] = Params->ipv6ARPOffload.ProtocolOffloadId; IPv6NSIndex = 0; RT_TRACE( COMP_OID_SET, DBG_LOUD, ("==> eNSOffloadIdx1: \n")); } else { - pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx2] + pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx2] = Params->ipv6ARPOffload.ProtocolOffloadId; IPv6NSIndex = 1; RT_TRACE( COMP_OID_SET, DBG_LOUD, ("==> eNSOffloadIdx2: \n")); } NsParams = &(pMgntInfo->PMIPV6NSPara[IPv6NSIndex]); - - PlatformMoveMemory(NsParams->RemoteIPv6Address, + + PlatformMoveMemory(NsParams->RemoteIPv6Address, Params->ipv6ARPOffload.RemoteIPV6Address, 16); - PlatformMoveMemory(NsParams->SolicitedNodeIPv6Address, + PlatformMoveMemory(NsParams->SolicitedNodeIPv6Address, Params->ipv6ARPOffload.SolicitdNodeIPv6Address, 16); - PlatformMoveMemory(NsParams->MacAddress, + PlatformMoveMemory(NsParams->MacAddress, Params->ipv6ARPOffload.MacAddress.Address, 6); - PlatformMoveMemory(NsParams->TargetIPv6Addresses[0], + PlatformMoveMemory(NsParams->TargetIPv6Addresses[0], Params->ipv6ARPOffload.TargetIPV6Address1, 16); - PlatformMoveMemory(NsParams->TargetIPv6Addresses[1], + PlatformMoveMemory(NsParams->TargetIPv6Addresses[1], Params->ipv6ARPOffload.TargetIPV6Address2, 16); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM RemoteIPv6Address: \n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM RemoteIPv6Address: \n"), NsParams->RemoteIPv6Address, 16); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM SolicitedNodeIPv6Address: \n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM SolicitedNodeIPv6Address: \n"), NsParams->SolicitedNodeIPv6Address, 16); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM MacAddress: \n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM MacAddress: \n"), NsParams->MacAddress, 6); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM TargetIPv6Addresses[0]: \n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM TargetIPv6Addresses[0]: \n"), NsParams->TargetIPv6Addresses[0], 16); - RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM TargetIPv6Addresses[1]: \n"), + RT_PRINT_DATA( COMP_OID_SET, DBG_LOUD, ("SET PM TargetIPv6Addresses[1]: \n"), NsParams->TargetIPv6Addresses[1], 16); if(pPSC->RegNSOffloadEnable) @@ -3297,7 +3297,7 @@ Wdi_Set_Add_Pm_Protocol_Offload( } RT_TRACE(COMP_OID_SET, DBG_LOUD, ("<== Wdi_Set_Add_Pm_Protocol_Offload()\n")); - + return ndisStatus; } @@ -3313,9 +3313,9 @@ Wdi_Set_Remove_Pm_Protocol_Offload( WDI_SET_REMOVE_PM_PROTOCOL_OFFLOAD_PARAMETERS *Params = pOidHandle->tlvParser.parsedTlv.paramSetRemoveProtocolOffload; u4Byte MatchId, ProtocolOffloadId = Params->RemovePMOffload; - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("==> Wdi_Set_Remove_Pm_Protocol_Offload()\n")); - + pWdiHeader->Status = NDIS_STATUS_SUCCESS; pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.BytesWritten = sizeof(WDI_MESSAGE_HEADER); @@ -3324,19 +3324,19 @@ Wdi_Set_Remove_Pm_Protocol_Offload( if(ProtocolOffloadId == pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[MatchId]) { RT_TRACE(COMP_POWER, DBG_LOUD, ("Find match protocol offload ID idx (%d)\n", MatchId)); - + if(MatchId == eGTKOffloadIdx) { - PlatformZeroMemory(&(pMgntInfo->PMDot11RSNRekeyPara), sizeof(RT_PM_DOT11_RSN_REKEY_PARAMETERS)); + PlatformZeroMemory(&(pMgntInfo->PMDot11RSNRekeyPara), sizeof(RT_PM_DOT11_RSN_REKEY_PARAMETERS)); RT_TRACE( COMP_OID_SET, DBG_LOUD, ("==>REMOVE eGTKOffloadIdx\n")); } else if(MatchId == eARPOffloadIdx) { - PlatformZeroMemory(&(pMgntInfo->PMIPV4ARPPara), sizeof(RT_PM_IPV4_ARP_PARAMETERS)); + PlatformZeroMemory(&(pMgntInfo->PMIPV4ARPPara), sizeof(RT_PM_IPV4_ARP_PARAMETERS)); RT_TRACE( COMP_OID_SET, DBG_LOUD, ("==>REMOVE eARPOffloadIdx\n")); } else if(MatchId == eNSOffloadIdx1 ) - { + { // Disable eNSOffloadIdx1 , set ID = 0 !! pMgntInfo->PowerSaveControl.PMProtocolOffloadIDs[eNSOffloadIdx1] = 0; RT_TRACE( COMP_OID_SET, DBG_LOUD, ("==>REMOVE eNSOffloadIdx1\n")); @@ -3351,7 +3351,7 @@ Wdi_Set_Remove_Pm_Protocol_Offload( } RT_TRACE(COMP_OID_SET, DBG_LOUD, ("<== Wdi_Set_Remove_Pm_Protocol_Offload()\n")); - + return ndisStatus; } @@ -3365,10 +3365,10 @@ Wdi_Set_Connection_Quality( ULONG BytesRead = 0, BytesNeeded = 0; PMGNT_INFO pMgntInfo=&(pAdapter->MgntInfo); PRT_POWER_SAVE_CONTROL pPSC = GET_POWER_SAVE_CONTROL(pMgntInfo); - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - ULONG InputBufferLength - = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; + ULONG InputBufferLength + = pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InputBufferLength; WDI_SET_CONNECTION_QUALITY_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSetConnectionQuality; pWdiHeader->Status = NDIS_STATUS_SUCCESS; @@ -3385,18 +3385,18 @@ Wdi_Set_Connection_Quality( pPSC->ConnectionQuality = param->Quality; RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_Set_Connection_Quality ConnectionQuality 0x%x\n", pPSC->ConnectionQuality)); - + if(param->Optional.LowLatencyParameters_IsPresent) { pPSC->MaximumOffChannelOperationTime = param->LowLatencyParameters.MaximumOffChannelOperationTime; - pPSC->RoamingNeededLinkQualityThreshold = param->LowLatencyParameters.RoamingNeededLinkQualityThreshold; + pPSC->RoamingNeededLinkQualityThreshold = param->LowLatencyParameters.RoamingNeededLinkQualityThreshold; RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_Set_Connection_Quality MaximumOffChannelOperationTime 0x%x\n", pPSC->MaximumOffChannelOperationTime)); - RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_Set_Connection_Quality RoamingNeededLinkQualityThreshold 0x%x\n", pPSC->RoamingNeededLinkQualityThreshold)); + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Wdi_Set_Connection_Quality RoamingNeededLinkQualityThreshold 0x%x\n", pPSC->RoamingNeededLinkQualityThreshold)); } } - - + + return ndisStatus; } @@ -3413,23 +3413,23 @@ Wdi_Get_Auto_Power_Save( WDI_GET_AUTO_POWER_SAVE_RESULTS adapterPowerSave = {0}; PUCHAR pOutput = NULL; ULONG length = 0; - - PWDI_MESSAGE_HEADER pOidHeader + + PWDI_MESSAGE_HEADER pOidHeader = (PWDI_MESSAGE_HEADER)pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; - adapterPowerSave.AutoPowerSaveParameters.EnableAutoPSM = + adapterPowerSave.AutoPowerSaveParameters.EnableAutoPSM = pMgntInfo->bInAutoPowerSavemode; - adapterPowerSave.AutoPowerSaveParameters.BeaconInterval = + adapterPowerSave.AutoPowerSaveParameters.BeaconInterval = pMgntInfo->dot11BeaconPeriod; - adapterPowerSave.AutoPowerSaveParameters.ListenInterval = + adapterPowerSave.AutoPowerSaveParameters.ListenInterval = (UINT8)pMgntInfo->ListenInterval; if(pMgntInfo->ListenIntervalInDX) { - adapterPowerSave.AutoPowerSaveParameters.ListenIntervalInDx = - (UINT8)pMgntInfo->ListenIntervalInDX; + adapterPowerSave.AutoPowerSaveParameters.ListenIntervalInDx = + (UINT8)pMgntInfo->ListenIntervalInDX; } else { @@ -3446,13 +3446,13 @@ Wdi_Get_Auto_Power_Save( else { adapterPowerSave.AutoPowerSaveParameters.PowerMode = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; - adapterPowerSave.AutoPowerSaveParameters.PowerModeinDx = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; + adapterPowerSave.AutoPowerSaveParameters.PowerModeinDx = WDI_POWER_SAVE_LEVEL_NO_POWER_SAVE; } //2 Todo adapterPowerSave.AutoPowerSaveParameters.Reason = 0; - - adapterPowerSave.AutoPowerSaveParameters.MillisecondsSinceStart = + + adapterPowerSave.AutoPowerSaveParameters.MillisecondsSinceStart = (PlatformGetCurrentTime() - pDefAdapter->DriverUpTime) / 1000; if (pPSC->bLeisurePs && pMgntInfo->dot11PowerSaveMode != eActive) @@ -3461,21 +3461,21 @@ Wdi_Get_Auto_Power_Save( (PlatformGetCurrentTime() - pPSC->LastLPSEnterTime) / 1000; } else if (pPSC->LastLPSEnterTime) - { + { adapterPowerSave.AutoPowerSaveParameters.MillisecondsInPowerSave = (pPSC->LastLPSLeaveTime - pPSC->LastLPSEnterTime) / 1000; - } + } else { adapterPowerSave.AutoPowerSaveParameters.MillisecondsInPowerSave = 0; } //2 Todo - adapterPowerSave.AutoPowerSaveParameters.ReceivedMulticastPackets = - adapterPowerSave.AutoPowerSaveParameters.SentMulticastPackets = - adapterPowerSave.AutoPowerSaveParameters.ReceivedUnicastPackets = + adapterPowerSave.AutoPowerSaveParameters.ReceivedMulticastPackets = + adapterPowerSave.AutoPowerSaveParameters.SentMulticastPackets = + adapterPowerSave.AutoPowerSaveParameters.ReceivedUnicastPackets = adapterPowerSave.AutoPowerSaveParameters.SentUnicastPacket = 0; - + ndisStatus = GenerateWdiGetAutoPowerSave( //pAdapterCapabilities, &adapterPowerSave, @@ -3495,7 +3495,7 @@ Wdi_Get_Auto_Power_Save( return ndisStatus; } - if (pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.OutputBufferLength >= + if (pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.OutputBufferLength >= (length + sizeof(WDI_MESSAGE_HEADER))) { PlatformMoveMemory( @@ -3508,9 +3508,9 @@ Wdi_Get_Auto_Power_Save( { ndisStatus = NDIS_STATUS_BUFFER_TOO_SHORT; pOidHandle->pNdisRequest->DATA.METHOD_INFORMATION.BytesNeeded += (length + sizeof(WDI_MESSAGE_HEADER)); - RT_TRACE(COMP_INIT, DBG_WARNING, ("[Error] GenerateWdiGetAdapterCapabilities() failed with status(%x)\n", ndisStatus)); + RT_TRACE(COMP_INIT, DBG_WARNING, ("[Error] GenerateWdiGetAdapterCapabilities() failed with status(%x)\n", ndisStatus)); } - + if(pOutput) { FreeGenerated(pOutput); @@ -3518,7 +3518,7 @@ Wdi_Get_Auto_Power_Save( } pOidHeader->Status = ndisStatus; - + return ndisStatus; } @@ -3532,10 +3532,10 @@ Wdi_IHV_Request( PTLV_WDI_STRUCT pTlvData = NULL; ULONG BytesWritten = 0, BytesRead = 0, BytesNeeded = 0; PNDIS_OID_REQUEST pNdisRequest = pOidHandle->pNdisRequest; - PWDI_MESSAGE_HEADER pWdiHeader + PWDI_MESSAGE_HEADER pWdiHeader = (PWDI_MESSAGE_HEADER)pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; //20150915-KenSun -//Temp Workaround for setting a private OID +//Temp Workaround for setting a private OID #if 1 PCCX_NIC_SPECIFIC_EXTENSION ccxData; PIHV_CCX_TLV pTlv = NULL; @@ -3589,9 +3589,9 @@ Wdi_IHV_Request( //Because WDI would always pass 2046 in pNdisRequest->DATA.METHOD_INFORMATION.OutputBufferLength //which is not the same value that passed in RTK Appilcations. (All RTK appilcation pass 0 outputbufferlength when issuing a SET OID request) //Therefore, we cannot use it as refence. -//For interfacing with WDI, we have to make sure BytesWriiten is sizeof(WDI_MESSAGE_HEADER) when dealing with a SET method request. +//For interfacing with WDI, we have to make sure BytesWriiten is sizeof(WDI_MESSAGE_HEADER) when dealing with a SET method request. // -#if 1 +#if 1 ccxData = (PCCX_NIC_SPECIFIC_EXTENSION)pTlvData->Value; if(ccxData->event == CCX_EVENT_OID) { @@ -3631,7 +3631,7 @@ Wdi_Get_Statistics( WDI_MAC_STATISTICS_CONTAINER MacStatistics[2]; WDI_PHY_STATISTICS_CONTAINER PhyStatistics[WDI_802_11_MAX_NUM_PHY_TYPES]; PNDIS_OID_REQUEST pNdisRequest = pOidHandle->pNdisRequest; - PWDI_MESSAGE_HEADER pOidHeader + PWDI_MESSAGE_HEADER pOidHeader = (PWDI_MESSAGE_HEADER)pNdisRequest->DATA.METHOD_INFORMATION.InformationBuffer; FunctionIn(COMP_OID_QUERY); @@ -3652,7 +3652,7 @@ Wdi_Get_Statistics( MacStatistics[0].CCMPFormatErrors = pAdapter->RxStats.NumRxCCMPDecryptErrorsUnicast; MacStatistics[0].CCMPReplays = pAdapter->RxStats.NumRxCCMPReplayUnicast; MacStatistics[0].CCMPDecryptErrors = pAdapter->RxStats.NumRxCCMPDecryptErrorsUnicast; - MacStatistics[0].WEPUndecryptableCount = pAdapter->RxStats.NumRxWEPUndecryptableUnicast; + MacStatistics[0].WEPUndecryptableCount = pAdapter->RxStats.NumRxWEPUndecryptableUnicast; MacStatistics[0].WEPICVErrorCount = pAdapter->RxStats.NumRxWEPICVErrorUnicast; MacStatistics[0].DecryptSuccessCount = pAdapter->RxStats.NumRxDecryptSuccessUnicast; MacStatistics[0].DecryptFailureCount = pAdapter->RxStats.NumRxDecryptFailureUnicast; @@ -3668,11 +3668,11 @@ Wdi_Get_Statistics( MacStatistics[1].CCMPFormatErrors = pAdapter->RxStats.NumRxCCMPDecryptErrorsMulticast + pAdapter->RxStats.NumRxCCMPDecryptErrorsBroadcast; MacStatistics[1].CCMPReplays = pAdapter->RxStats.NumRxCCMPReplayMulticast; MacStatistics[1].CCMPDecryptErrors = pAdapter->RxStats.NumRxCCMPDecryptErrorsMulticast + pAdapter->RxStats.NumRxCCMPDecryptErrorsBroadcast; - MacStatistics[1].WEPUndecryptableCount = pAdapter->RxStats.NumRxWEPUndecryptableMulticast + pAdapter->RxStats.NumRxWEPUndecryptableBroadcast; + MacStatistics[1].WEPUndecryptableCount = pAdapter->RxStats.NumRxWEPUndecryptableMulticast + pAdapter->RxStats.NumRxWEPUndecryptableBroadcast; MacStatistics[1].WEPICVErrorCount = pAdapter->RxStats.NumRxWEPICVErrorMulticast + pAdapter->RxStats.NumRxWEPICVErrorBroadcast; MacStatistics[1].DecryptSuccessCount = pAdapter->RxStats.NumRxDecryptSuccessMulticast + pAdapter->RxStats.NumRxDecryptSuccessBroadcast; MacStatistics[1].DecryptFailureCount = pAdapter->RxStats.NumRxDecryptFailureMulticast + pAdapter->RxStats.NumRxDecryptFailureBroadcast; - + Params.PeerMACStatistics.ElementCount = 2; Params.PeerMACStatistics.pElements = MacStatistics; @@ -3704,24 +3704,24 @@ Wdi_Get_Statistics( PhyStatistics[0].PhyType = WDI_PHY_TYPE_VHT; break; - + } PhyStatistics[0].TransmittedFrameCount = pAdapter->TxStats.NumTxOkTotal; PhyStatistics[0].GroupTransmittedFrameCount = pAdapter->TxStats.NumTxMulticast + pAdapter->TxStats.NumTxBroadcast; - PhyStatistics[0].FailedCount = pAdapter->TxStats.NumTxErrTotal; - PhyStatistics[0].RetryCount = pAdapter->TxStats.NumTxRetryCount; + PhyStatistics[0].FailedCount = pAdapter->TxStats.NumTxErrTotal; + PhyStatistics[0].RetryCount = pAdapter->TxStats.NumTxRetryCount; PhyStatistics[0].MultipleRetryCount = 0; // TODO PhyStatistics[0].MaxTXLifetimeExceededCount = 0; // TODO - PhyStatistics[0].TransmittedFragmentCount = pAdapter->TxStats.NumTxOkTotal; + PhyStatistics[0].TransmittedFragmentCount = pAdapter->TxStats.NumTxOkTotal; PhyStatistics[0].RTSSuccessCount = 0; // TODO PhyStatistics[0].RTSFailureCount = 0; // TODO PhyStatistics[0].ACKFailureCount = 0; // TODO PhyStatistics[0].ReceivedFrameCount = pAdapter->RxStats.NumRxFramgment; - PhyStatistics[0].GroupReceivedFrameCount = pAdapter->RxStats.NumRxFramgment; + PhyStatistics[0].GroupReceivedFrameCount = pAdapter->RxStats.NumRxFramgment; PhyStatistics[0].PromiscuousReceivedFrameCount = 0; // TODO PhyStatistics[0].MaxRXLifetimeExceededCount = 0; // TODO PhyStatistics[0].FrameDuplicateCount = 0; // TODO - PhyStatistics[0].ReceivedFragmentCount = pAdapter->RxStats.NumRxFramgment; + PhyStatistics[0].ReceivedFragmentCount = pAdapter->RxStats.NumRxFramgment; PhyStatistics[0].PromiscuousReceivedFragmentCount = 0; // TODO PhyStatistics[0].FCSErrorCount = pAdapter->RxStats.NumRxErrTotalUnicast + pAdapter->RxStats.NumRxErrTotalMulticast; Params.PhyStatistics.ElementCount = 1; @@ -3730,7 +3730,7 @@ Wdi_Get_Statistics( else { u1Byte count = 0; - + PlatformZeroMemory(&MacStatistics[0], sizeof(WDI_MAC_STATISTICS_CONTAINER)*2); cpMacAddr(MacStatistics[0].MACAddress.Address, BroadcastAddress); Params.PeerMACStatistics.ElementCount = 1; @@ -3761,7 +3761,7 @@ Wdi_Get_Statistics( return ndisStatus; } - if (pNdisRequest->DATA.METHOD_INFORMATION.OutputBufferLength >= + if (pNdisRequest->DATA.METHOD_INFORMATION.OutputBufferLength >= (length + sizeof(WDI_MESSAGE_HEADER))) { PlatformMoveMemory( @@ -3774,9 +3774,9 @@ Wdi_Get_Statistics( { ndisStatus = NDIS_STATUS_BUFFER_TOO_SHORT; pNdisRequest->DATA.METHOD_INFORMATION.BytesNeeded += (length + sizeof(WDI_MESSAGE_HEADER)); - RT_TRACE(COMP_INIT, DBG_WARNING, ("[Error] GenerateWdiGetStatistics() failed with status(%x)\n", ndisStatus)); + RT_TRACE(COMP_INIT, DBG_WARNING, ("[Error] GenerateWdiGetStatistics() failed with status(%x)\n", ndisStatus)); } - + if(pOutput) { FreeGenerated(pOutput); @@ -3784,9 +3784,9 @@ Wdi_Get_Statistics( } pOidHeader->Status = ndisStatus; - + FunctionOut(COMP_OID_QUERY); - + return ndisStatus; } @@ -3798,7 +3798,7 @@ WDI_OID_TASK_OPEN( ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Not Support WDI_OID_TASK_OPEN\n")); return ndisStatus; @@ -3813,7 +3813,7 @@ WDI_OID_TASK_CLOSE( { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("Not Support WDI_OID_TASK_CLOSE\n")); return ndisStatus; @@ -3837,7 +3837,7 @@ WDI_OID_TASK_P2P_DISCOVER( { NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_TASK_P2P_DISCOVER_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramP2pDiscover; - + FunctionIn(COMP_OID_SET); do @@ -3846,7 +3846,7 @@ WDI_OID_TASK_P2P_DISCOVER( P2P_INFO *info = GET_P2P_INFO(pAdapter); FRAME_BUF *buf = NULL; - + // additional ie if(param->Optional.VendorIEs_IsPresent) { @@ -3856,20 +3856,20 @@ WDI_OID_TASK_P2P_DISCOVER( ); } - RT_TRACE_F(COMP_P2P, DBG_LOUD, ("DiscoveryType = %d, ScanType = %d\n", + RT_TRACE_F(COMP_P2P, DBG_LOUD, ("DiscoveryType = %d, ScanType = %d\n", param->DiscoverMode.DiscoveryType, param->DiscoverMode.ScanType)); // construct req if(NULL != (req = CustomScan_AllocReq(GET_CUSTOM_SCAN_INFO(pAdapter), NULL, NULL))) { static u1Byte bcst[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - + buf = CustomScan_GetProbeReqBuf(req); if(param->SSIDList.ElementCount) { WDI_SSID *ssid = ¶m->SSIDList.pElements[0]; - + RT_PRINT_STR(COMP_OID_SET, DBG_LOUD, "to probe with ssid", ssid->pElements, ssid->ElementCount); P2P_Construct_ProbeReqEx(buf, info, bcst, (u1Byte)ssid->ElementCount, (u1Byte *)ssid->pElements); } @@ -3892,10 +3892,10 @@ WDI_OID_TASK_P2P_DISCOVER( if(WDI_P2P_SCAN_TYPE_PASSIVE == param->DiscoverMode.ScanType) CustomScan_ForcePassiveScan(req); - + CustomScan_SetTimeBound(req, param->DwellTime.MaximumScanTime); CustomScan_SetupCbCtx(req, wdi_P2PDiscoveryCb, pAdapter); - + CustomScan_IssueReq(GET_CUSTOM_SCAN_INFO(pAdapter), req, CUSTOM_SCAN_SRC_TYPE_P2P, "wdi-p2p-discovery"); } }while(FALSE); @@ -3936,7 +3936,7 @@ WDI_OID_TASK_DOT11_RESET( WDI_TASK_DOT11_RESET_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramDot11Reset; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -3959,7 +3959,7 @@ WDI_OID_TASK_DOT11_RESET( N63CResetNetworkListOffload(pAdapter); - // MAC Address Randomization + // MAC Address Randomization if(param->Optional.ResetMACAddress_IsPresent && pAdapter->MgntInfo.RegSupportMACRandom) { cpMacAddr( pAdapter->CurrentAddress, param->ResetMACAddress.Address); @@ -3968,7 +3968,7 @@ WDI_OID_TASK_DOT11_RESET( } // cleanup - if(req && NDIS_STATUS_SUCCESS != status) + if(req && NDIS_STATUS_SUCCESS != status) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -3996,7 +3996,7 @@ WDI_OID_TASK_P2P_SEND_REQUEST_ACTION_FRAME( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_TASK_P2P_SEND_REQUEST_ACTION_FRAME_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramP2pSendRequestActionFrame; VOID *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -4026,7 +4026,7 @@ WDI_OID_TASK_P2P_SEND_REQUEST_ACTION_FRAME( break; } }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; @@ -4042,12 +4042,12 @@ WDI_OID_TASK_P2P_SEND_RESPONSE_ACTION_FRAME( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_TASK_P2P_SEND_RESPONSE_ACTION_FRAME_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramP2pSendResponseActionFrame; VOID *req = NULL; - + FunctionIn(COMP_OID_SET); do { - // termincate any ongoing scan for sending rsp + // termincate any ongoing scan for sending rsp WDI_SendAction_TerminateReq(pAdapter); if(WDI_P2P_ACTION_FRAME_GO_NEGOTIATION_RESPONSE == param->ResponseParams.ResponseFrameType) @@ -4079,7 +4079,7 @@ WDI_OID_TASK_P2P_SEND_RESPONSE_ACTION_FRAME( break; } }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; @@ -4103,7 +4103,7 @@ WDI_OID_TASK_CREATE_PORT( { NDIS_STATUS status = NDIS_STATUS_SUCCESS; PORT_HELPER *pPortHelper = pAdapter->pPortCommonInfo->pPortHelper; - + status = Wdi_Task_CreatePort(pAdapter, pOidHandle); if(NDIS_STATUS_PENDING == status) @@ -4113,7 +4113,7 @@ WDI_OID_TASK_CREATE_PORT( PlatformReleaseSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); status = NDIS_STATUS_SUCCESS; } - + return status; } @@ -4128,7 +4128,7 @@ WDI_OID_TASK_DELETE_PORT( PORT_HELPER *pPortHelper = pAdapter->pPortCommonInfo->pPortHelper; status = Wdi_Task_DeletePort(pAdapter, pOidHandle); - + if(NDIS_STATUS_PENDING == status) {// WDI always return success regardless of our status here, so we need to record pended req here PlatformAcquireSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); @@ -4151,7 +4151,7 @@ WDI_OID_TASK_START_AP( WDI_TASK_START_AP_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramStartAp; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -4171,7 +4171,7 @@ WDI_OID_TASK_START_AP( Wdi_Xlat_FreeOid(req); req = NULL; - + // Start AP if(NULL == (req = Wdi_Xlat_AllocStartApReqOid(pOidHandle, param))) { @@ -4187,13 +4187,13 @@ WDI_OID_TASK_START_AP( RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N63C_OID_DOT11_WFD_START_GO_REQUEST returns: 0x%08X\n", status)); break; } - + }while(FALSE); // M4 indication is not required since bWaitComplete in RT_SUPPORT_TASKs is FALSE // cleanup - if(req) + if(req) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -4209,17 +4209,17 @@ WDI_OID_TASK_STOP_AP( ) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; - + FunctionIn(COMP_OID_SET); if(RT_AP_TYPE_VWIFI_AP == MgntActQuery_ApType(pAdapter)) { status = N6CSet_DOT11_DISCONNECT_REQUEST(pAdapter, NULL, 0, 0, 0); - + if(NDIS_STATUS_SUCCESS != status) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N6CSet_DOT11_DISCONNECT_REQUEST returns: 0x%08X\n", status)); - } + } } else { @@ -4242,14 +4242,14 @@ WDI_OID_TASK_SEND_AP_ASSOCIATION_RESPONSE( WDI_TASK_SEND_AP_ASSOCIATION_RESPONSE_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSendApAssociationResponse; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); do { MGNT_INFO *pMgntInfo = NULL; RT_WLAN_STA *pEntry = NULL; - + pMgntInfo = &pAdapter->MgntInfo; if(NULL == (req = Wdi_Xlat_AllocIncomingAssociationDecisionOid(pOidHandle, param))) @@ -4263,7 +4263,7 @@ WDI_OID_TASK_SEND_AP_ASSOCIATION_RESPONSE( status = NDIS_STATUS_INVALID_STATE; break; } - + if(NDIS_STATUS_SUCCESS != (status = N62C_OID_DOT11_INCOMING_ASSOCIATION_DECISION(pAdapter, req))) { RT_TRACE_F(COMP_MLME, DBG_WARNING, ("N62C_OID_DOT11_INCOMING_ASSOCIATION_DECISION returns: 0x%08X\n", status)); @@ -4273,21 +4273,21 @@ WDI_OID_TASK_SEND_AP_ASSOCIATION_RESPONSE( pOidHandle->pvCtx = req; AP_SendAsocRsp( - pAdapter, - pEntry, - TRUE == param->IncomingRequestInfo.AssocRequestParams.IsReassociationRequest, - FALSE, + pAdapter, + pEntry, + TRUE == param->IncomingRequestInfo.AssocRequestParams.IsReassociationRequest, + FALSE, param->AssocResponseParameters.ReasonCode ); // If succeeded, WDI_CMD_SendApAssociationResponseComplete is called from DrvIFIndicateIncommingAssociationComplete - + }while(FALSE); // cleanup if(NDIS_STATUS_SUCCESS != status) { - if(req) + if(req) Wdi_Xlat_FreeOid(req); } @@ -4299,7 +4299,7 @@ WDI_OID_TASK_SEND_AP_ASSOCIATION_RESPONSE( NDIS_STATUS -WDI_OID_TASK_CHANGE_OPERATION_MODE( +WDI_OID_TASK_CHANGE_OPERATION_MODE( IN PADAPTER pAdapter, IN PRT_OID_HANDLER pOidHandle ) @@ -4308,7 +4308,7 @@ WDI_OID_TASK_CHANGE_OPERATION_MODE( WDI_TASK_CHANGE_OPERATION_MODE_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramChangeOperationMode; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -4318,7 +4318,7 @@ WDI_OID_TASK_CHANGE_OPERATION_MODE( status = NDIS_STATUS_RESOURCES; break; } - + if(NDIS_STATUS_SUCCESS != (status = N6C_OID_DOT11_CURRENT_OPERATION_MODE(pAdapter, req))) { RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N6C_OID_DOT11_CURRENT_OPERATION_MODE returns: 0x%08X\n", status)); @@ -4327,11 +4327,11 @@ WDI_OID_TASK_CHANGE_OPERATION_MODE( // Indicate completed successfully WDI_CMD_ChangeOpModeComplete(pAdapter, req, status); - + }while(FALSE); // cleanup - if(req && NDIS_STATUS_SUCCESS != status) + if(req && NDIS_STATUS_SUCCESS != status) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -4348,9 +4348,9 @@ WDI_OID_TASK_SEND_REQUEST_ACTION_FRAME( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_TASK_SEND_REQUEST_ACTION_FRAME_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSendRequestActionFrame; VOID *req = NULL; - + FunctionIn(COMP_OID_SET); - + do { req = WDI_SendAction_Req(pAdapter, param, wdi_SendReqActionFrameStateCb); @@ -4361,7 +4361,7 @@ WDI_OID_TASK_SEND_REQUEST_ACTION_FRAME( status = NDIS_STATUS_FAILURE; } }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; @@ -4376,7 +4376,7 @@ WDI_OID_TASK_SEND_RESPONSE_ACTION_FRAME( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_TASK_SEND_RESPONSE_ACTION_FRAME_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSendResponseActionFrame; VOID *req = NULL; - + FunctionIn(COMP_OID_SET); do @@ -4389,7 +4389,7 @@ WDI_OID_TASK_SEND_RESPONSE_ACTION_FRAME( status = NDIS_STATUS_FAILURE; } }while(FALSE); - + FunctionOut(COMP_OID_SET); return status; @@ -4404,7 +4404,7 @@ WDI_OID_SET_P2P_LISTEN_STATE( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_SET_P2P_LISTEN_STATE_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSetP2pListenState; NDIS_OID_REQUEST *req = NULL; - + FunctionIn(COMP_OID_SET); if( param == NULL ) @@ -4453,7 +4453,7 @@ WDI_OID_SET_P2P_LISTEN_STATE( // TODO: }while(FALSE); - if(req) + if(req) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -4518,7 +4518,7 @@ WDI_OID_GET_AUTO_POWER_SAVE( ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + return Wdi_Get_Auto_Power_Save(pAdapter, pOidHandle); } @@ -4539,7 +4539,7 @@ WDI_OID_GET_ADAPTER_CAPABILITIES( ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + ndisStatus = N6SdioWdi_AdapterCapabilities( pAdapter, pOidHandle @@ -4688,7 +4688,7 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_SET_ADVERTISEMENT_INFORMATION_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSetAdvertisementInformation; NDIS_OID_REQUEST *req = NULL; - + if( param == NULL ) return NDIS_STATUS_FAILURE; @@ -4706,8 +4706,8 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( if(param->AdditionalIEs.AdditionalBeaconIEs.ElementCount) { P2P_AddIe_Set( - &info->AdditionalIEs, P2P_ADD_IE_BEACON, - param->AdditionalIEs.AdditionalBeaconIEs.ElementCount, + &info->AdditionalIEs, P2P_ADD_IE_BEACON, + param->AdditionalIEs.AdditionalBeaconIEs.ElementCount, param->AdditionalIEs.AdditionalBeaconIEs.pElements); RT_PRINT_DATA(COMP_P2P, DBG_LOUD, "WDI_OID_SET_ADVERTISEMENT_INFORMATION(): AdditionalBeaconIEs\n", param->AdditionalIEs.AdditionalBeaconIEs.pElements, param->AdditionalIEs.AdditionalBeaconIEs.ElementCount); @@ -4716,8 +4716,8 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( if(param->AdditionalIEs.AdditionalProbeResponseIEs.ElementCount) { P2P_AddIe_Set( - &info->AdditionalIEs, P2P_ADD_IE_PROBE_RESPONSE, - param->AdditionalIEs.AdditionalProbeResponseIEs.ElementCount, + &info->AdditionalIEs, P2P_ADD_IE_PROBE_RESPONSE, + param->AdditionalIEs.AdditionalProbeResponseIEs.ElementCount, param->AdditionalIEs.AdditionalProbeResponseIEs.pElements); RT_PRINT_DATA(COMP_P2P, DBG_LOUD, "WDI_OID_SET_ADVERTISEMENT_INFORMATION(): AdditionalProbeResponseIEs\n", param->AdditionalIEs.AdditionalProbeResponseIEs.pElements, param->AdditionalIEs.AdditionalProbeResponseIEs.ElementCount); @@ -4728,14 +4728,14 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( if(param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.ElementCount) { P2P_AddIe_Set( - &info->AdditionalIEs, P2P_ADD_IE_DEFAULT_REQUEST, - param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.ElementCount, + &info->AdditionalIEs, P2P_ADD_IE_DEFAULT_REQUEST, + param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.ElementCount, param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.pElements); RT_PRINT_DATA(COMP_P2P, DBG_LOUD, "WDI_OID_SET_ADVERTISEMENT_INFORMATION(): AdditionalProbeRequestDefaultIEs\n", param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.pElements, param->AdditionalIEs.AdditionalProbeRequestDefaultIEs.ElementCount); } } - + // device info if(param->Optional.DeviceInformation_IsPresent) { @@ -4753,7 +4753,7 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( Wdi_Xlat_FreeOid(req); req = NULL; } - + // dev cap if(param->Optional.DeviceCapability_IsPresent) { @@ -4807,12 +4807,12 @@ WDI_OID_SET_ADVERTISEMENT_INFORMATION( Wdi_Xlat_FreeOid(req); req = NULL; } - + // TODO: adv svc }while(FALSE); - if(req) + if(req) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -4845,7 +4845,7 @@ WDI_OID_GET_NEXT_ACTION_FRAME_DIALOG_TOKEN( ULONG tlvlen = 0; UINT8 *tlv = NULL; - + FunctionIn(COMP_OID_SET); do @@ -4887,7 +4887,7 @@ WDI_OID_GET_NEXT_ACTION_FRAME_DIALOG_TOKEN( } GenerateWdiGetNextActionFrameDialogToken( - ¶m, 0, + ¶m, 0, &pAdapter->pPortCommonInfo->WdiData.TlvContext, &tlvlen, &tlv); @@ -4903,11 +4903,11 @@ WDI_OID_GET_NEXT_ACTION_FRAME_DIALOG_TOKEN( tlv, tlvlen); pNdisRequest->DATA.METHOD_INFORMATION.BytesWritten += tlvlen; - + }while(FALSE); // cleanup; - if(req) + if(req) Wdi_Xlat_FreeOid(req); if(tlv) @@ -4929,7 +4929,7 @@ WDI_OID_SET_P2P_WPS_ENABLED( NDIS_STATUS status = NDIS_STATUS_SUCCESS; WDI_SET_P2P_WPS_ENABLED_PARAMETERS *param = pOidHandle->tlvParser.parsedTlv.paramSetP2pWpsEnabled; NDIS_OID_REQUEST *req = NULL; - + if( param == NULL ) return NDIS_STATUS_FAILURE; @@ -4945,10 +4945,10 @@ WDI_OID_SET_P2P_WPS_ENABLED( RT_TRACE_F(COMP_OID_SET, DBG_WARNING, ("N62C_OID_DOT11_WPS_ENABLED returns: 0x%08X\n", status)); break; } - + }while(FALSE); - if(req) + if(req) Wdi_Xlat_FreeOid(req); FunctionOut(COMP_OID_SET); @@ -4985,7 +4985,7 @@ WDI_OID_SET_FAST_BSS_TRANSITION_PARAMETERS( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; WDI_SET_FAST_BSS_TRANSITION_PARAMETERS_COMMAND *param = pOidHandle->tlvParser.parsedTlv.paramSetFastBssTransitionParametersCommand; u1Byte targetAddr[6] = {0}; - + if( param == NULL ) return NDIS_STATUS_FAILURE; @@ -5008,7 +5008,7 @@ WDI_OID_SET_FAST_BSS_TRANSITION_PARAMETERS( RT_PRINT_DATA(COMP_MLME, DBG_LOUD, "RSNIE:\n", param->RSNIE.pElements, param->RSNIE.ElementCount); } - + if(param->Optional.MDE_IsPresent) { FtUpdateEntryInfo(pAdapter, FT_ENTRY_ACTION_UPDATE_MDE, targetAddr, @@ -5048,8 +5048,8 @@ WDI_OID_SET_FAST_BSS_TRANSITION_PARAMETERS( // // Description: // Prepare indication data for WDI create port. -// Also add data path (via AddDataPathPeer()) as -// it was copied from the original code in +// Also add data path (via AddDataPathPeer()) as +// it was copied from the original code in // WdiSimpleTask(). // // Note: @@ -5066,12 +5066,12 @@ WDI_CMD_CreatePortComplete( { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; DOT11_MAC_INFO *macInfo = NULL; - + UINT8 *tlv = NULL; ULONG len = 0; WDI_INDICATION_CREATE_PORT_COMPLETE_PARAMETERS param = {0}; - + macInfo = (DOT11_MAC_INFO *)req->DATA.METHOD_INFORMATION.InformationBuffer; FunctionIn(COMP_OID_SET); @@ -5108,7 +5108,7 @@ WDI_CMD_CreatePortComplete( PlatformAcquireSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); pAdapter->pNdisCommon->PendedRequest = NULL; PlatformReleaseSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); - + FunctionOut(COMP_OID_SET); return TRUE; @@ -5122,7 +5122,7 @@ WDI_CMD_DeletePortComplete( ) { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5149,7 +5149,7 @@ WDI_CMD_DeletePortComplete( // Free pended oid PlatformAcquireSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); pAdapter->pNdisCommon->PendedRequest = NULL; - PlatformReleaseSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); + PlatformReleaseSpinLock(pAdapter, RT_PENDED_OID_SPINLOCK); FunctionOut(COMP_OID_SET); @@ -5164,7 +5164,7 @@ WDI_CMD_ResetComplete( ) { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5177,7 +5177,7 @@ WDI_CMD_ResetComplete( // generate TLV //GenerateWdiIndicationDot11ResetComplete(¶m, 0, &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + // copy tlv wdi_task_WriteResult(hTask, tlv, len, status); @@ -5201,7 +5201,7 @@ WDI_CMD_ChangeOpModeComplete( ) { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5237,7 +5237,7 @@ WDI_CMD_P2PDiscoverComplete( ) { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5255,7 +5255,7 @@ WDI_CMD_P2PDiscoverComplete( // generate TLV //GenerateWdiIndicationDot11ResetComplete(¶m, 0, &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + // copy tlv wdi_task_WriteResult(hTask, tlv, len, status); @@ -5278,10 +5278,10 @@ WDI_CMD_P2pSendRequestActionFrameComplete( { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; OFF_CHNL_TX_STATUS_FLAG txStatusFlag; - + u4Byte ieOffset = FRAME_OFFSET_P2P_PUB_ACT_ELEMENTS; NDIS_STATUS status = NDIS_STATUS_SUCCESS; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5300,7 +5300,7 @@ WDI_CMD_P2pSendRequestActionFrameComplete( FRAME_BUF *buf = OffChnlTx_GetTxFrameBuf(ctx->req); RT_ASSERT(buf, ("%s(): buf is NULL!!!n", __FUNCTION__)); - + cpMacAddr(param.SendActionFrameResult.FrameParameters.PeerDeviceAddress.Address, (FrameBuf_Head(buf) + FRAME_OFFSET_ADDRESS1)); param.SendActionFrameResult.FrameParameters.DialogToken = ctx->token; param.SendActionFrameResult.FrameIEs.ElementCount = FrameBuf_Length(buf) - ieOffset; @@ -5308,13 +5308,13 @@ WDI_CMD_P2pSendRequestActionFrameComplete( RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("token: %u\n", param.SendActionFrameResult.FrameParameters.DialogToken)); } - + // generate TLV GenerateWdiIndicationP2pSendRequestActionFrameComplete( - ¶m, 0, - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, 0, + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + // copy tlv wdi_task_WriteResult(hTask, tlv, len, status); @@ -5337,10 +5337,10 @@ WDI_CMD_P2pSendResponseActionFrameComplete( { RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; OFF_CHNL_TX_STATUS_FLAG txStatusFlag; - + u4Byte ieOffset = FRAME_OFFSET_P2P_PUB_ACT_ELEMENTS; NDIS_STATUS status = NDIS_STATUS_SUCCESS; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5351,13 +5351,13 @@ WDI_CMD_P2pSendResponseActionFrameComplete( status = (TEST_FLAG(txStatusFlag.perTxAttemptFlag, OFF_CHNL_TX_PER_TX_ATTEMPT_FLAG_FRAME_SENT) ? NDIS_STATUS_SUCCESS : NDIS_STATUS_FAILURE); FunctionIn(COMP_OID_SET); - + if(NDIS_STATUS_SUCCESS == status) { FRAME_BUF *buf = OffChnlTx_GetTxFrameBuf(ctx->req); RT_ASSERT(buf, ("%s(): buf is NULL!!!n", __FUNCTION__)); - + cpMacAddr(param.SendActionFrameResult.FrameParameters.PeerDeviceAddress.Address, (FrameBuf_Head(buf) + FRAME_OFFSET_ADDRESS1)); param.SendActionFrameResult.FrameParameters.DialogToken = ctx->token; param.SendActionFrameResult.FrameIEs.ElementCount = FrameBuf_Length(buf) - ieOffset; @@ -5365,13 +5365,13 @@ WDI_CMD_P2pSendResponseActionFrameComplete( RT_TRACE_F(COMP_OID_SET, DBG_LOUD, ("token: %u\n", param.SendActionFrameResult.FrameParameters.DialogToken)); } - + // generate TLV GenerateWdiIndicationP2pSendResponseActionFrameComplete( - ¶m, 0, - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, 0, + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + // copy tlv wdi_task_WriteResult(hTask, tlv, len, status); @@ -5391,11 +5391,11 @@ WDI_CMD_SendReqActionFrameComplete( IN PADAPTER pAdapter, IN const WDI_SEND_ACTION_CTX *ctx ) -{ +{ NDIS_STATUS status = NDIS_STATUS_SUCCESS; RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; OFF_CHNL_TX_STATUS_FLAG txStatusFlag = {0}; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5413,13 +5413,13 @@ WDI_CMD_SendReqActionFrameComplete( { RT_TRACE(COMP_MLME, DBG_WARNING, ("Action Req frame send failure.\n")); } - + #if 0 //GenerateWdiIndicationSendRequestActionFrameComplete( - // ¶m, 0, - // &pAdapter->pPortCommonInfo->WdiData.TlvContext, + // ¶m, 0, + // &pAdapter->pPortCommonInfo->WdiData.TlvContext, // &len, &tlv); - + wdi_task_WriteResult(hTask, tlv, len, status); FreeGenerated(tlv); @@ -5434,11 +5434,11 @@ WDI_CMD_SendRspActionFrameComplete( IN PADAPTER pAdapter, IN const WDI_SEND_ACTION_CTX *ctx ) -{ +{ NDIS_STATUS status = NDIS_STATUS_SUCCESS; RT_OID_HANDLER *hTask = &pAdapter->pPortCommonInfo->WdiData.TaskHandle; OFF_CHNL_TX_STATUS_FLAG txStatusFlag = {0}; - + UINT8 *tlv = NULL; ULONG len = 0; @@ -5453,13 +5453,13 @@ WDI_CMD_SendRspActionFrameComplete( { RT_TRACE(COMP_MLME, DBG_WARNING, ("Action Rsp frame send failure.\n")); } - + #if 0 GenerateWdiIndicationSendRequestActionFrameComplete( - ¶m, 0, - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, 0, + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + wdi_task_WriteResult(hTask, tlv, len, status); FreeGenerated(tlv); @@ -5487,11 +5487,13 @@ WDI_CMD_SendApAssociationResponseComplete( FunctionIn(COMP_MLME); // prepare structure, ref N62CAPIndicateIncomAssocComplete +#if !defined(NTDDI_WIN10_RS3) param.Optional.ActivePhyList_IsPresent = FALSE; +#endif cpMacAddr(param.AssocResponseResult.PeerMACAddress.Address, sta->MacAddr); - param.AssocResponseResult.IsReassociationRequest = + param.AssocResponseResult.IsReassociationRequest = Type_Reasoc_Rsp == GET_80211_HDR_TYPE(sta->AP_SendAsocResp) ? TRUE : FALSE; - param.AssocResponseResult.IsReAssociationResponse = + param.AssocResponseResult.IsReAssociationResponse = param.AssocResponseResult.IsReassociationRequest; if(RT_802_11AuthModeOpen == sta->AuthMode) param.AssocResponseResult.AuthAlgorithm = WDI_AUTH_ALGO_80211_OPEN; @@ -5509,7 +5511,7 @@ WDI_CMD_SendApAssociationResponseComplete( param.AssocResponseResult.AuthAlgorithm = WDI_AUTH_ALGO_WPA_NONE; else if(RT_802_11AuthModeWPA2PSK == sta->AuthMode) param.AssocResponseResult.AuthAlgorithm = WDI_AUTH_ALGO_WPA_PSK; - else + else param.AssocResponseResult.AuthAlgorithm = WDI_AUTH_ALGO_80211_OPEN; if(RT_ENC_ALG_NO_CIPHER == sta->perSTAKeyInfo.PairwiseCipherSuite[0]) @@ -5543,7 +5545,7 @@ WDI_CMD_SendApAssociationResponseComplete( param.AssocResponseResult.UnicastCipherAlgorithm = WDI_CIPHER_ALGO_NONE; param.AssocResponseFrame.ElementCount = MMPDU_BODY_LEN(sta->AP_SendAsocRespLength); - param.AssocResponseFrame.pElements = MMPDU_BODY(sta->AP_SendAsocResp); + param.AssocResponseFrame.pElements = MMPDU_BODY(sta->AP_SendAsocResp); if(pAdapter->MgntInfo.beaconframe.Length) { @@ -5555,13 +5557,13 @@ WDI_CMD_SendApAssociationResponseComplete( param.BeaconIEs.ElementCount = 0; param.BeaconIEs.pElements = NULL; } - + // generate TLV GenerateWdiIndicationSendApAssociationResponseComplete( - ¶m, 0, - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, 0, + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &len, &tlv); - + // copy tlv wdi_task_WriteResult(hTask, tlv, len, status); @@ -5569,7 +5571,7 @@ WDI_CMD_SendApAssociationResponseComplete( FreeGenerated(tlv); ndisStatus = WDI_AddDatapathPeer(pAdapter, sta->MacAddr); - + // Free the OID Wdi_Xlat_FreeOid(req); @@ -5577,7 +5579,7 @@ WDI_CMD_SendApAssociationResponseComplete( OidHandle_Complete(pAdapter, OIDHANDLE_TYPE_TASK); if( ndisStatus != NDIS_STATUS_SUCCESS ) - { + { RT_TRACE(COMP_MLME, DBG_WARNING, ("WDI_CMD_SendApAssociationResponseComplete: fail to create peer, so disconnect with this AP[%2x:%2x:%2x:%2x:%2x:%2x]\n", sta->MacAddr[0], sta->MacAddr[1], sta->MacAddr[2], sta->MacAddr[3], sta->MacAddr[4], sta->MacAddr[5])); // 1. Send disassoc frame to the STA. @@ -5612,7 +5614,7 @@ WDI_CMD_PreIndicateRxP2pActionFrameCb( ADAPTER *pAdapter = pP2PInfo->pAdapter; FunctionIn(COMP_OID_SET); - + if(P2P_EVENT_RECEIVED_PROVISION_DISCOVERY_RESPONSE == EventID || P2P_EVENT_RECEIVED_INVITATION_RESPONSE == EventID || P2P_EVENT_RECEIVED_GO_NEGOTIATION_RESPONSE == EventID @@ -5621,7 +5623,7 @@ WDI_CMD_PreIndicateRxP2pActionFrameCb( { WDI_SendAction_TerminateReq(pAdapter); } - + FunctionOut(COMP_OID_SET); return; @@ -5732,7 +5734,7 @@ WDI_CANCEL_OID_TASK_SEND_RESPONSE_ACTION_FRAME( return NDIS_STATUS_SUCCESS; } -NDIS_STATUS +NDIS_STATUS WDI_PRE_M4_OID_TASK_SCAN( IN PADAPTER pAdapter, IN PRT_OID_HANDLER pOidHandle diff --git a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Common.c b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Common.c index 1b478b21..bfb1cce8 100644 --- a/network/wlan/WDI/PLATFORM/NDIS6/WDI_Common.c +++ b/network/wlan/WDI/PLATFORM/NDIS6/WDI_Common.c @@ -24,7 +24,7 @@ wdi_UnsolicitedIndication( NDIS_OID_REQUEST *req = NULL; RT_TRACE(COMP_MLME, DBG_LOUD, ("==>wdi_UnsolicitedIndication(): status indication code = %x, length=%d\n", Indication, Length)); - + indic = (NDIS_STATUS_INDICATION *)pInput; wdiHdr = (WDI_MESSAGE_HEADER *)(pInput + sizeof(*indic)); @@ -59,12 +59,12 @@ wdi_UnsolicitedIndication( pAdapter->pNdisCommon->hNdisAdapter, indic ); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("<== wdi_UnsolicitedIndication()\n")); } // -// The following helper functions are used to determined if a +// The following helper functions are used to determined if a // BSS has the capability of specific wireless mode. // 2005.01.13, by rcnjko. // @@ -106,7 +106,7 @@ WDIWithWirelessG( { return FALSE; } - + // Check supported rates. for(i = 0; i < pRtBss->bdSupportRateEXLen; i++) { @@ -119,12 +119,12 @@ WDIWithWirelessG( } // Check if it contains ERP information element. - // Some AP, WAG-302, will not always claim OFDM rates in their ProbeRsp or Beacon + // Some AP, WAG-302, will not always claim OFDM rates in their ProbeRsp or Beacon // but it is in G mode. 2005.08.23, by rcnjko. if(pRtBss->bERPInfoValid) { return TRUE; - } + } return FALSE; } @@ -158,7 +158,7 @@ WDIWithWirelessA( //// // This routine determine if we should report the BSS scanned -// to upper layer. +// to upper layer. // 2005.01.13, by rcnjko. // BOOLEAN @@ -169,19 +169,19 @@ WDIFilterRtBss( { PRT_NDIS6_COMMON pNdisCommon = Adapter->pNdisCommon; BOOLEAN bAcceptable = TRUE; - BOOLEAN bHasB, bHasG, bHasA; + BOOLEAN bHasB, bHasG, bHasA; // Determine the capability of wireless mode of the BSS. bHasB = WDIWithWirelessB(pRtBss); bHasG = WDIWithWirelessG(pRtBss); bHasA = WDIWithWirelessA(pRtBss); - - // - // 1. Maybe we may need to use a table in the future. + + // + // 1. Maybe we may need to use a table in the future. // 2. Currently, we only consider B/G case. if( bHasB && !bHasG && !bHasA ) { // The BSS is pure B. - if( pNdisCommon->RegWirelessMode4ScanList == WIRELESS_MODE_G || + if( pNdisCommon->RegWirelessMode4ScanList == WIRELESS_MODE_G || pNdisCommon->RegWirelessMode4ScanList == WIRELESS_MODE_A ) { // We are pure A or pure G. bAcceptable = FALSE; @@ -219,7 +219,7 @@ wdiext_IndicateP2PDeviceFound( // get info of last rx frame if(RTIsListEmpty(&dev->rxFrameQ)) return; - + if(!pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest) return; @@ -280,13 +280,13 @@ wdiext_IndicateP2PDeviceFound( // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationBssEntryList( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) return; - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, (PVOID)req->RequestId, NDIS_STATUS_WDI_INDICATION_BSS_ENTRY_LIST, @@ -302,7 +302,7 @@ wdiext_IndicateP2PDeviceFound( VOID wdiext_IndicateP2PActionFrameReceived( - IN VOID *pvP2PInfo, + IN VOID *pvP2PInfo, IN u4Byte eid, IN MEMORY_BUFFER *info ) @@ -346,22 +346,22 @@ wdiext_IndicateP2PActionFrameReceived( param.FrameInfo.FrameParams.ActionFrameType = WDI_P2P_ACTION_FRAME_INVITATION_RESPONSE; else return; - + cpMacAddr(param.FrameInfo.FrameParams.PeerDeviceAddress.Address, evtData->Packet.Buffer + FRAME_OFFSET_ADDRESS2); param.FrameInfo.FrameParams.DialogToken = *(evtData->Packet.Buffer + FRAME_OFFSET_P2P_PUB_ACT_DIALOG_TOKEN); param.FrameInfo.FrameIEs.ElementCount = evtData->Packet.Length - ieOffset; param.FrameInfo.FrameIEs.pElements = evtData->Packet.Buffer + ieOffset; } - + // gen TLV if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationP2pActionFrameReceived( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) return; - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_P2P_ACTION_FRAME_RECEIVED, @@ -371,7 +371,7 @@ wdiext_IndicateP2PActionFrameReceived( // cleanup FreeGenerated((UINT8 *)buf); - + FunctionOut(COMP_OID_SET); return; @@ -394,7 +394,7 @@ wdiext_IndicateBSSEntry( WDI_MESSAGE_HEADER *reqWdiHdr = NULL; u4Byte devSpecCtx = 0x07060504; LARGE_INTEGER CurrentTime; - + if(!pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest) return; @@ -417,7 +417,7 @@ wdiext_IndicateBSSEntry( RT_TRACE(COMP_MLME, DBG_LOUD, ("Indicate actual scan result of BSS list\n")); MgntActQuery_802_11_BSSID_LIST(pAdapter, &RtBssList, TRUE); #endif - } + } req = pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest; reqWdiHdr = (WDI_MESSAGE_HEADER *)req->DATA.METHOD_INFORMATION.InformationBuffer; @@ -468,7 +468,7 @@ wdiext_IndicateBSSEntry( else { FunctionOut(COMP_MLME); - return; + return; } // WDI_SIGNAL_INFO_CONTAINER SignalInfo @@ -487,23 +487,23 @@ wdiext_IndicateBSSEntry( entry.DeviceSpecificContext.pElements = (UINT8 *)&devSpecCtx; NdisGetCurrentSystemTime(&CurrentTime); - + // WDI_AGE_INFO_CONTAINER EntryAgeInfo entry.EntryAgeInfo.HostTimeStamp = CurrentTime.QuadPart;// [SDIO-482] in JIRA entry.EntryAgeInfo.CachedInformation = 0; // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationBssEntryList( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { FunctionOut(COMP_MLME); return; } - - wdi_UnsolicitedIndication(pAdapter, + + wdi_UnsolicitedIndication(pAdapter, FALSE, (PVOID)req->RequestId, NDIS_STATUS_WDI_INDICATION_BSS_ENTRY_LIST, @@ -516,7 +516,7 @@ wdiext_IndicateBSSEntry( } FunctionOut(COMP_MLME); - + return; } @@ -539,7 +539,7 @@ wdiext_IndicateBSSEntryBySSID( u4Byte devSpecCtx = 0x07060504; BOOL bWildCardSSID = TRUE; LARGE_INTEGER CurrentTime; - + if(!pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest) return; @@ -565,7 +565,7 @@ wdiext_IndicateBSSEntryBySSID( RT_TRACE(COMP_MLME, DBG_LOUD, ("Indicate actual scan result of BSS list\n")); MgntActQuery_802_11_BSSID_LIST(pAdapter, &RtBssList, TRUE); #endif - } + } req = pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest; reqWdiHdr = (WDI_MESSAGE_HEADER *)req->DATA.METHOD_INFORMATION.InformationBuffer; @@ -626,7 +626,7 @@ wdiext_IndicateBSSEntryBySSID( else { FunctionOut(COMP_MLME); - return; + return; } // WDI_SIGNAL_INFO_CONTAINER SignalInfo @@ -645,23 +645,23 @@ wdiext_IndicateBSSEntryBySSID( entry.DeviceSpecificContext.pElements = (UINT8 *)&devSpecCtx; NdisGetCurrentSystemTime(&CurrentTime); - + // WDI_AGE_INFO_CONTAINER EntryAgeInfo entry.EntryAgeInfo.HostTimeStamp = CurrentTime.QuadPart;// [SDIO-482] in JIRA entry.EntryAgeInfo.CachedInformation = 0; // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationBssEntryList( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { FunctionOut(COMP_MLME); return; } - - wdi_UnsolicitedIndication(pAdapter, + + wdi_UnsolicitedIndication(pAdapter, FALSE, (PVOID)req->RequestId, NDIS_STATUS_WDI_INDICATION_BSS_ENTRY_LIST, @@ -674,7 +674,7 @@ wdiext_IndicateBSSEntryBySSID( } FunctionOut(COMP_MLME); - + return; } @@ -720,7 +720,7 @@ wdiext_IndicateAssociationResult( else AssocComeBackTime = 0; } - else + else AssocComeBackTime = 0; if(pMgntInfo->dot11CurrentChannelNumber < 36) BandID = WDI_BAND_ID_2400; @@ -736,7 +736,7 @@ wdiext_IndicateAssociationResult( case WIRELESS_MODE_A: PhyType = WDI_PHY_TYPE_OFDM; break; - + case WIRELESS_MODE_G: PhyType = WDI_PHY_TYPE_ERP; break; @@ -757,7 +757,7 @@ wdiext_IndicateAssociationResult( PhyType = WDI_PHY_TYPE_VHT; break; - + } PlatformZeroMemory(&AsocResult, sizeof(WDI_ASSOCIATION_RESULT_CONTAINER)); @@ -787,12 +787,14 @@ wdiext_IndicateAssociationResult( AsocResult.Optional.BeaconProbeResponse_IsPresent = TRUE; AsocResult.BeaconProbeResponse.ElementCount = MMPDU_BODY_LEN(pMgntInfo->AsocInfo.BeaconLength); AsocResult.BeaconProbeResponse.pElements = MMPDU_BODY(pMgntInfo->AsocInfo.Beacon); +#if 0 AsocResult.Optional.ActivePhyTypeList_IsPresent = TRUE; +#endif AsocResult.ActivePhyTypeList.ElementCount = 1; AsocResult.ActivePhyTypeList.pElements = &PhyType; ndisStatus = GenerateWdiIndicationAssociationResult( - &AsocResultList, + &AsocResultList, sizeof(NDIS_STATUS_INDICATION)+sizeof(WDI_MESSAGE_HEADER), &pAdapter->pPortCommonInfo->WdiData.TlvContext, &length, @@ -802,10 +804,10 @@ wdiext_IndicateAssociationResult( RT_TRACE(COMP_MLME, DBG_LOUD, ("GenerateWdiIndicationAssociationResult(): return length %d\n", length)); RT_PRINT_DATA(COMP_MLME, DBG_TRACE, ("buffer\n"), pOutput, length); RT_TRACE(COMP_MLME, DBG_LOUD, ("SendUnsolictedIndication(): EthertypeEncapTable_IsPresent %d\n", AsocResult.Optional.EthertypeEncapTable_IsPresent)); - + ndisStatus = WDI_AddDatapathPeer(pAdapter, AsocResult.BSSID.Address); - - wdi_UnsolicitedIndication(pAdapter, + + wdi_UnsolicitedIndication(pAdapter, FALSE, (PVOID)pAdapter->pPortCommonInfo->WdiData.TaskHandle.pNdisRequest->RequestId, NDIS_STATUS_WDI_INDICATION_ASSOCIATION_RESULT, @@ -833,7 +835,7 @@ wdiext_IndicateAssociationResult( // RT_STATUS wdiext_IndicateFtAssocNeeded( - IN PADAPTER pAdapter + IN PADAPTER pAdapter ) { RT_STATUS rtStatus = RT_STATUS_SUCCESS; @@ -851,18 +853,18 @@ wdiext_IndicateFtAssocNeeded( { RT_TRACE_F(COMP_INDIC, DBG_WARNING, ("Too short of AuthSeq2Length = %d\n", pMgntInfo->AsocInfo.AuthSeq1Length)); rtStatus = RT_STATUS_INVALID_DATA; - break; + break; } if(pMgntInfo->AsocInfo.AuthSeq2Length < sMacHdrLng) { RT_TRACE_F(COMP_INDIC, DBG_WARNING, ("Too short of AuthSeq2Length = %d\n", pMgntInfo->AsocInfo.AuthSeq2Length)); rtStatus = RT_STATUS_INVALID_DATA; - break; + break; } cpMacAddr(param.BssId.Address, pMgntInfo->Bssid); - + param.AuthRequest.ElementCount = MMPDU_BODY_LEN(pMgntInfo->AsocInfo.AuthSeq1Length); param.AuthRequest.pElements = MMPDU_BODY(pMgntInfo->AsocInfo.AuthSeq1); @@ -870,21 +872,21 @@ wdiext_IndicateFtAssocNeeded( param.AuthResponse.pElements = MMPDU_BODY(pMgntInfo->AsocInfo.AuthSeq2); // Gen tlv - if(NDIS_STATUS_SUCCESS != (ndisStatus = + if(NDIS_STATUS_SUCCESS != (ndisStatus = GenerateWdiIndicationFtAssocParamsNeeded( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &indicBufLen, &((UINT8 *)pIndicBuf)))) { RT_TRACE_F(COMP_INDIC, DBG_SERIOUS, ("Fail (ndisStatus = 0x%08X) from GenerateWdiIndicationFtAssocParamsNeeded()\n", ndisStatus)); rtStatus = RT_STATUS_OS_API_FAILED; - break; + break; } RT_PRINT_DATA(COMP_INDIC, DBG_LOUD, "NDIS_STATUS_WDI_INDICATION_FT_ASSOC_PARAMS_NEEDED:\n", pIndicBuf, indicBufLen); - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_FT_ASSOC_PARAMS_NEEDED, @@ -930,8 +932,8 @@ wdiext_IndicateDisassociation( param.Optional.NeedPeerStateCleanup_IsPresent = FALSE; cpMacAddr(param.DisconnectIndicationParameters.MacAddress.Address, addr); - param.DisconnectIndicationParameters.DisassociationWABIReason = bDisassoc - ? WDI_ASSOC_STATUS_PEER_DISASSOCIATED + param.DisconnectIndicationParameters.DisassociationWABIReason = bDisassoc + ? WDI_ASSOC_STATUS_PEER_DISASSOCIATED : WDI_ASSOC_STATUS_PEER_DEAUTHENTICATED; if(frameLen) @@ -947,23 +949,23 @@ wdiext_IndicateDisassociation( param.DeauthFrame.pElements = frame + sMacHdrLng; } } - + // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationDisassociation( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) return; - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_DISASSOCIATION, NDIS_STATUS_SUCCESS, buf, buflen); - + // cleanup FreeGenerated((UINT8 *)buf); @@ -987,24 +989,24 @@ wdiext_IndicateRadioStatus( Params.RadioState.HardwareState = (pMgntInfo->RfOffReason&RF_CHANGE_BY_HW)?0:1; RT_TRACE(COMP_RF, DBG_LOUD, ("wdiext_IndicateRadioStatus(): Params.RadioState.SoftwareState is %d, Params.RadioState.HardwareState is %d\n", Params.RadioState.SoftwareState, Params.RadioState.HardwareState)); - + ndisStatus = GenerateWdiIndicationRadioStatus( &Params, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), &pAdapter->pPortCommonInfo->WdiData.TlvContext, &length, &pOutput); if(NDIS_STATUS_SUCCESS == ndisStatus) { - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, TRUE, NULL, NDIS_STATUS_WDI_INDICATION_RADIO_STATUS, NDIS_STATUS_SUCCESS, pOutput, length); - + FreeGenerated(pOutput); pOutput = NULL; } @@ -1023,7 +1025,7 @@ wdiext_IndicateLinkStateChanged( PUCHAR pOutput = NULL; ULONG length = 0; NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - + if (pMgntInfo->mAssoc || pMgntInfo->mIbss) { Params.LinkStateChangeParameters.LinkQuality = GetSignalQuality(pAdapter); @@ -1044,7 +1046,7 @@ wdiext_IndicateLinkStateChanged( RT_TRACE(COMP_MLME, DBG_LOUD, ("wdiext_IndicateLinkStateChanged(): Params.LinkStateChangeParameters.TxLinkSpeed is %d\n", Params.LinkStateChangeParameters.TxLinkSpeed)); RT_TRACE(COMP_MLME, DBG_LOUD, ("wdiext_IndicateLinkStateChanged(): Params.LinkStateChangeParameters.RxLinkSpeed is %d\n", Params.LinkStateChangeParameters.RxLinkSpeed)); - + ndisStatus = GenerateWdiIndicationLinkStateChange( &Params, sizeof(NDIS_STATUS_INDICATION)+sizeof(WDI_MESSAGE_HEADER), @@ -1080,7 +1082,7 @@ wdiext_IndicateRoamingNeeded( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; pMgntInfo->bPrepareRoaming = TRUE; - + Params.RoamingReason = IndicationReason; RT_TRACE_F(COMP_MLME, DBG_LOUD, ("Params.RoamingReason %d\n", Params.RoamingReason)); @@ -1143,20 +1145,20 @@ wdiext_IndicateP2POpChnl( // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationP2pGroupOperatingChannel( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) return; - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, (PVOID)req->RequestId, NDIS_STATUS_WDI_INDICATION_P2P_GROUP_OPERATING_CHANNEL, NDIS_STATUS_SUCCESS, buf, buflen); - + // cleanup FreeGenerated((UINT8 *)buf); @@ -1173,7 +1175,7 @@ wdi_FindGroupPeerByPort( PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); PRT_PEER_ENTRY pPeerEntry = NULL; u1Byte i; - + for(i = 0; i < MP_DEFAULT_NUMBER_OF_PORT; i++) { pPeerEntry = &pDefaultAdapter->RxPeerTable[i]; @@ -1185,7 +1187,7 @@ wdi_FindGroupPeerByPort( } } } - + return NULL; } @@ -1198,24 +1200,24 @@ wdi_FindPeerByAddr( PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); PRT_PEER_ENTRY pPeerEntry = NULL; u1Byte i = 0, count = 0; - + count = pDefaultAdapter->RxPeerUsedCount; for(i = MP_DEFAULT_NUMBER_OF_PORT; i < MAX_PEER_NUM; i++) { if( count == 0 ) break; - + pPeerEntry = &pDefaultAdapter->RxPeerTable[i]; if( pPeerEntry->bUsed == TRUE ) { - count--; + count--; if( PlatformCompareMemory(pPeerEntry->PeerAddr, pAddr, 6) == 0 ) { return (PVOID)pPeerEntry; } } } - + return NULL; } @@ -1230,18 +1232,18 @@ wdi_GetAvailablePeer( PRT_PEER_ENTRY pCurPeerEntry = NULL, pPeerEntry = NULL; u1Byte i = 0, UnusedIndex = 0, count = 0; BOOLEAN bFound = FALSE; - + FunctionIn(COMP_MLME); - + count = pDefaultAdapter->RxPeerUsedCount; - + for(i = MP_DEFAULT_NUMBER_OF_PORT; i < MAX_PEER_NUM; i++) { if( (count == 0) && (bFound == TRUE) ) break; - + pPeerEntry = &pDefaultAdapter->RxPeerTable[i]; - + if( (pPeerEntry->bUsed == FALSE) && (bFound == FALSE) ) { bFound = TRUE; @@ -1252,32 +1254,32 @@ wdi_GetAvailablePeer( count--; if( PlatformCompareMemory(pPeerEntry->PeerAddr, pAddr, 6) == 0 ) { - RT_TRACE(COMP_MLME, DBG_WARNING, ("wdi_GetAvailablePeer: The addres [%2x:%2x:%2x:%2x:%2x:%2x] had associated with specified Peer %d\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], pPeerEntry->uPeerId)); + RT_TRACE(COMP_MLME, DBG_WARNING, ("wdi_GetAvailablePeer: The addres [%2x:%2x:%2x:%2x:%2x:%2x] had associated with specified Peer %d\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], pPeerEntry->uPeerId)); FunctionOut(COMP_MLME); return (PVOID)pPeerEntry; } } } - + if( (i == MAX_PEER_NUM) && (bFound == FALSE) ) { - RT_TRACE(COMP_MLME, DBG_WARNING, ("wdi_GetAvailablePeer: Peer is already full, so cannot find an unused peer to associate [%2x:%2x:%2x:%2x:%2x:%2x]\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5])); + RT_TRACE(COMP_MLME, DBG_WARNING, ("wdi_GetAvailablePeer: Peer is already full, so cannot find an unused peer to associate [%2x:%2x:%2x:%2x:%2x:%2x]\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5])); FunctionOut(COMP_MLME); return NULL; } - + pDefaultAdapter->RxPeerUsedCount++; - + pCurPeerEntry = &pDefaultAdapter->RxPeerTable[UnusedIndex]; pCurPeerEntry->bUsed = TRUE; pCurPeerEntry->uPeerId = UnusedIndex; pCurPeerEntry->uPortId = (u2Byte)PortId; PlatformMoveMemory(pCurPeerEntry->PeerAddr, pAddr, 6); - RT_TRACE(COMP_MLME, DBG_LOUD, ("wdi_GetAvailablePeer: Port %d associate the addres [%2x:%2x:%2x:%2x:%2x:%2x] at Peer %d\n", (u2Byte)PortId, pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], UnusedIndex)); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("wdi_GetAvailablePeer: Port %d associate the addres [%2x:%2x:%2x:%2x:%2x:%2x] at Peer %d\n", (u2Byte)PortId, pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], UnusedIndex)); + FunctionOut(COMP_MLME); - + return (PVOID)pCurPeerEntry; } @@ -1299,17 +1301,17 @@ wdi_NotifyPeerData( WDI_EXTENDED_TID ExtendTid = (WDI_EXTENDED_TID)ExTid; KIRQL Irql = 0; BOOLEAN bLackResource = FALSE; - + PlatformAcquireSpinLock(pAdapter, RT_RX_CONTROL_SPINLOCK); if( (pNdisCommon->bRxControlState != RT_RX_STOP) && (pDefaultNdisCommon->bRxDataPathState != RT_RX_PAUSE) ) - { + { pNdisCommon->bRxControlState = RT_RX_NOTIFYING; PlatformReleaseSpinLock(pAdapter, RT_RX_CONTROL_SPINLOCK); - + PlatformAcquireSpinLock(pAdapter, RT_RX_SPINLOCK); bLackResource = RxCheckResource(pAdapter)?FALSE:TRUE; PlatformReleaseSpinLock(pAdapter, RT_RX_SPINLOCK); - + if( bLackResource ) RT_TRACE(COMP_RECV, DBG_WARNING, ("wdi_NotifyPeerData(): RFD is less than lower bound (%d)\n", RFD_LOWER_BOUND)); @@ -1349,7 +1351,7 @@ wdi_NotifyPeerData( } pTempAdapter = GetNextExtAdapter(pTempAdapter); }while(pTempAdapter != NULL ); - + PlatformReleaseSpinLock(pAdapter, RT_RX_CONTROL_SPINLOCK); RT_TRACE(COMP_INIT, DBG_WARNING, ("Driver call RxStopConfirm for Rx manager\n")); pWdi->WdiDataApi.RxStopConfirm(pWdi->DataPathHandle); @@ -1395,23 +1397,23 @@ WDI_Initialize( // WorkAround for 0x9F BSOD pMChars->ResetHandlerEx = N6SdioReset; - + RtlZeroMemory(&WdiChar, sizeof(WdiChar)); WdiChar.WdiVersion = WDI_VERSION_LATEST; WdiChar.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_WDI_CHARACTERISTICS, WdiChar.Header.Size = NDIS_SIZEOF_MINIPORT_WDI_CHARACTERISTICS_REVISION_1; - WdiChar.Header.Revision = NDIS_MINIPORT_DRIVER_WDI_CHARACTERISTICS_REVISION_1; + WdiChar.Header.Revision = NDIS_MINIPORT_DRIVER_WDI_CHARACTERISTICS_REVISION_1; WdiChar.AllocateAdapterHandler = N6SdioWdi_AllocateAdapter; WdiChar.FreeAdapterHandler = N6SdioWdi_FreeAdapter; - WdiChar.OpenAdapterHandler = N6SdioWdi_OpenAdapter; - WdiChar.CloseAdapterHandler = N6SdioWdi_CloseAdapter; + WdiChar.OpenAdapterHandler = N6SdioWdi_OpenAdapter; + WdiChar.CloseAdapterHandler = N6SdioWdi_CloseAdapter; WdiChar.TalTxRxInitializeHandler = N6SdioWdi_TalTxRxInitialize; WdiChar.TalTxRxDeinitializeHandler = N6SdioWdi_TalTxRxDeinitialize; - WdiChar.HangDiagnoseHandler = N6SdioWdi_HangDiagnose; + WdiChar.HangDiagnoseHandler = N6SdioWdi_HangDiagnose; // Optional handler WdiChar.StartOperationHandler = N6SdioWdi_StartOperation; @@ -1432,7 +1434,7 @@ WDI_Initialize( VOID -WDI_DeInitialize( +WDI_DeInitialize( IN NDIS_HANDLE DriverHandle ) { @@ -1440,7 +1442,7 @@ WDI_DeInitialize( } VOID -WDI_InitRxQueue( +WDI_InitRxQueue( IN PADAPTER pAdapter ) { @@ -1463,14 +1465,14 @@ WDI_InitRxQueue( } VOID -WDI_DeInitRxQueue( +WDI_DeInitRxQueue( IN PADAPTER pAdapter ) { PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); u2Byte index = 0; PNET_BUFFER_LIST pNetBufferList=NULL; - + RT_TRACE(COMP_INIT, DBG_LOUD, ("[WDI], WDI_DeInitRxQueue() ==> \n")); PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); for(index=0; indexpPortCommonInfo->WdiData); - + if( pWdi->TaskHandle.Status & RT_OID_HANDLER_STATUS_SET ) { OidHandle_Complete(pAdapter, OIDHANDLE_TYPE_TASK); @@ -1541,11 +1543,11 @@ WdiExt_IndicateApAssocReqReceived( PlatformZeroMemory(¶m, sizeof(param)); - cpMacAddr(param.IncomingRequestInfo.AssocRequestParams.PeerMacAddress.Address, + cpMacAddr(param.IncomingRequestInfo.AssocRequestParams.PeerMacAddress.Address, assocReq + FRAME_OFFSET_ADDRESS2 ); - param.IncomingRequestInfo.AssocRequestParams.IsReassociationRequest = + param.IncomingRequestInfo.AssocRequestParams.IsReassociationRequest = (Type_Reasoc_Req == GET_80211_HDR_TYPE(assocReq)) ? TRUE : FALSE; FillOctetString(osAssocReq, assocReq, (u2Byte)assocReqLen); @@ -1561,20 +1563,20 @@ WdiExt_IndicateApAssocReqReceived( // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationApAssociationRequestReceived( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) return; - wdi_UnsolicitedIndication(pAdapter, + wdi_UnsolicitedIndication(pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_AP_ASSOCIATION_REQUEST_RECEIVED, NDIS_STATUS_SUCCESS, buf, buflen); - + // cleanup FreeGenerated((UINT8 *)buf); @@ -1593,16 +1595,16 @@ WdiExt_IndicateApAssocRspSent( if(FALSE == OidHandle_VerifyTask(pAdapter, OID_WDI_TASK_SEND_AP_ASSOCIATION_RESPONSE)) { - RT_TRACE(COMP_OID_SET, DBG_WARNING, + RT_TRACE(COMP_OID_SET, DBG_WARNING, ("WdiExt_IndicateApAssocRspSent(): skip indication because OidHandle_VerifyTask() returns FALSE\n")); return; } - + if(task->pvCtx) { if(WDI_CMD_SendApAssociationResponseComplete( - pAdapter, - (NDIS_OID_REQUEST *)task->pvCtx, + pAdapter, + (NDIS_OID_REQUEST *)task->pvCtx, StatusCode_success == status ? RT_STATUS_SUCCESS : RT_STATUS_FAILURE)) {// set pvCtx to NULL only when it is freed in WDI_CMD_SendApAssociationResponseComplete task->pvCtx = NULL; @@ -1621,18 +1623,18 @@ WDIAllocateMetaData( { PWDI_DATA_STRUCT pWdi = &(pAdapter->pPortCommonInfo->WdiData); PWDI_FRAME_METADATA pWdiFrameMeta = NULL; - + pWdiFrameMeta = pWdi->WdiDataApi.AllocateWiFiFrameMetaData(pWdi->DataPathHandle); if( pWdiFrameMeta == NULL ) return RT_STATUS_FAILURE; pWdiFrameMeta->u.rxMetaData.PayloadType = WDI_FRAME_MSDU; pWdiFrameMeta->pNBL = pNBL; - + RT_TRACE(COMP_RECV, DBG_TRACE, ("PayloadType %d\n", pWdiFrameMeta->u.rxMetaData.PayloadType)); MP_SET_PACKET_RFD_RESERVED_0(pNBL, pWdiFrameMeta); - + return RT_STATUS_SUCCESS; } @@ -1673,7 +1675,7 @@ WDI_InsertDataInQueue( FillOctetString(osMpdu, pRfd->Buffer.VirtualAddress + pRfd->FragOffset, pRfd->FragLength); PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + /**************************************************************************************************** * 20150707 Sinda * We insert frames in queue as below rules @@ -1694,12 +1696,12 @@ WDI_InsertDataInQueue( else PeerId = pPeerEntry->uPeerId; } - + if(pPeerEntry->bUsed == TRUE) { RT_TRACE(COMP_RECV, DBG_TRACE, ("WDI_InsertDataInQueue: Port %d, PeerId %d\n", PortNumber, PeerId)); for (pCurrNetBufferList = pNBL; pCurrNetBufferList != NULL; pCurrNetBufferList = pNextNetBufferList) - { + { pNextNetBufferList = NET_BUFFER_LIST_NEXT_NBL(pCurrNetBufferList); NET_BUFFER_LIST_NEXT_NBL(pCurrNetBufferList) = NULL; N6CAddNblWaitQueue(&pDefaultAdapter->RxPeerQueue[PeerId], pCurrNetBufferList, FALSE); @@ -1808,7 +1810,7 @@ WDI_IndicateBssListBySSID( } VOID -WDI_IndicateConnectionComplete( +WDI_IndicateConnectionComplete( PADAPTER pAdapter, RT_STATUS status ) @@ -1817,7 +1819,7 @@ WDI_IndicateConnectionComplete( if(FALSE == OidHandle_VerifyTask(pAdapter, OID_WDI_TASK_CONNECT)) return; - + OidHandle_Complete(pAdapter, OIDHANDLE_TYPE_TASK); } @@ -1827,7 +1829,7 @@ WDI_IndicateAssociationComplete( PADAPTER pAdapter, RT_STATUS status ) -{ +{ if( status == RT_STATUS_SUCCESS ) { wdiext_IndicateAssociationResult(pAdapter); @@ -1837,17 +1839,17 @@ WDI_IndicateAssociationComplete( VOID -WDI_IndicateDisassociation( +WDI_IndicateDisassociation( PADAPTER pAdapter, u2Byte reason, pu1Byte pAddr ) { PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); - + if(ACTING_AS_AP(pAdapter)) {// AP mode - RT_WLAN_STA *sta = pMgntInfo->pCurrentSta; + RT_WLAN_STA *sta = pMgntInfo->pCurrentSta; RT_ASSERT(sta, ("%s(): sta is NULL!!!\n", __FUNCTION__)); @@ -1856,7 +1858,7 @@ WDI_IndicateDisassociation( RT_TRACE_F(COMP_AP, DBG_SERIOUS, ("pMgntInfo->pCurrentSta is NULL!\n")); return; } - + wdiext_IndicateDisassociation(pAdapter, sta->MacAddr, 0, NULL, TRUE, reason); } else @@ -1876,17 +1878,17 @@ WDI_IndicateNLODiscovery( ) { WDI_INDICATION_NLO_DISCOVERY_PARAMETERS param; - PWDI_BSS_ENTRY_CONTAINER pEntry; + PWDI_BSS_ENTRY_CONTAINER pEntry; PRT_NLO_INFO pNLOInfo = &(pAdapter->MgntInfo.NLOInfo); PRT_WLAN_BSS pRtBss = NULL; - RT_802_11_BSSID_LIST RtBssList = {0}; + RT_802_11_BSSID_LIST RtBssList = {0}; u4Byte i = 0; u4Byte j = 0; - u4Byte nBss = 0; + u4Byte nBss = 0; ULONG buflen = 0; - pu1Byte buf = NULL; - pu1Byte pBssList = NULL; + pu1Byte buf = NULL; + pu1Byte pBssList = NULL; u4Byte devSpecCtx = 0x07060504; BOOLEAN Hit = FALSE; LARGE_INTEGER CurrentTime; @@ -1898,15 +1900,15 @@ WDI_IndicateNLODiscovery( // zero PlatformZeroMemory(¶m, sizeof(param)); - + //Get scan list RtBssList.NumberOfItems = 0; RtBssList.pbssidentry = pAdapter->bssDescList; - + MgntActQuery_802_11_BSSID_LIST(pAdapter, &RtBssList, FALSE); - PlatformAllocateMemoryWithZero(pAdapter, (PVOID *)&pEntry, sizeof(WDI_BSS_ENTRY_CONTAINER)*RtBssList.NumberOfItems); - + PlatformAllocateMemoryWithZero(pAdapter, (PVOID *)&pEntry, sizeof(WDI_BSS_ENTRY_CONTAINER)*RtBssList.NumberOfItems); + param.DeviceDescriptor.pElements = pEntry; nBss = 0; @@ -1922,14 +1924,14 @@ WDI_IndicateNLODiscovery( } pRtBss = &(RtBssList.pbssidentry[i]); - + // Determine if we shall report the BSS found by RegWirelessMode4ScanList. if(!WDIFilterRtBss(pAdapter, pRtBss)) { // Skip this BSS. continue; } - + for( j=0 ; jNumDot11OffloadNetwork ; ++j ) { // Compare to check whether it is what we desired or not @@ -1942,7 +1944,7 @@ WDI_IndicateNLODiscovery( if( !Hit ) // This BSS is not we desired. continue; - + // WIFI_MAC_ADDRESS_CONTAINER BSSID cpMacAddr(pEntry->BSSID.Address, pRtBss->bdBssIdBuf); @@ -1963,7 +1965,7 @@ WDI_IndicateNLODiscovery( { RT_TRACE(COMP_POWER, DBG_LOUD, ("Unknown BssPacketType: %u\n", pRtBss->BssPacketType)); FunctionOut(COMP_POWER); - return; + return; } // WDI_SIGNAL_INFO_CONTAINER SignalInfo @@ -1975,9 +1977,9 @@ WDI_IndicateNLODiscovery( pEntry->ChannelInfo.ChannelNumber = (UINT32)pRtBss->ChannelNumber; pEntry->ChannelInfo.BandId = (pRtBss->ChannelNumber < 36) ? WDI_BAND_ID_2400 : WDI_BAND_ID_5000; RT_TRACE(COMP_POWER, DBG_LOUD, ("pRtBss->ChannelNumber=%d, ", pRtBss->ChannelNumber)); - RT_TRACE(COMP_POWER, DBG_LOUD, ("%x:%x:%x:%x:%x:%x, ", - pEntry->BSSID.Address[0], pEntry->BSSID.Address[1], - pEntry->BSSID.Address[2], pEntry->BSSID.Address[3], + RT_TRACE(COMP_POWER, DBG_LOUD, ("%x:%x:%x:%x:%x:%x, ", + pEntry->BSSID.Address[0], pEntry->BSSID.Address[1], + pEntry->BSSID.Address[2], pEntry->BSSID.Address[3], pEntry->BSSID.Address[4], pEntry->BSSID.Address[5])); RT_TRACE(COMP_POWER, DBG_LOUD, ("SSID: %s\n", pRtBss->bdSsIdBuf)); @@ -1988,7 +1990,7 @@ WDI_IndicateNLODiscovery( // Get current timestamp NdisGetCurrentSystemTime(&CurrentTime); - + // WDI_AGE_INFO_CONTAINER EntryAgeInfo pEntry->EntryAgeInfo.HostTimeStamp = CurrentTime.QuadPart; // [SDIO-482] in JIRA pEntry->EntryAgeInfo.CachedInformation = 0; @@ -2007,17 +2009,17 @@ WDI_IndicateNLODiscovery( // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationNloDiscovery( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { RT_TRACE(COMP_POWER, DBG_LOUD, ("WDI_IndicateNLODiscovery(): GenerateWdiIndicationNloDiscovery Failed\n")); FunctionOut(COMP_POWER); return; } - - wdi_UnsolicitedIndication( pAdapter, + + wdi_UnsolicitedIndication( pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_NLO_DISCOVERY, @@ -2026,8 +2028,8 @@ WDI_IndicateNLODiscovery( buflen); // cleanup - FreeGenerated((UINT8 *)buf); - + FreeGenerated((UINT8 *)buf); + FunctionOut(COMP_POWER); } @@ -2042,7 +2044,7 @@ WDI_IndicateCurrentPhyStatus( VOID -WDI_IndicateP2PEvent( +WDI_IndicateP2PEvent( VOID *pvP2PInfo, u4Byte EventID, MEMORY_BUFFER *pInformation @@ -2051,7 +2053,7 @@ WDI_IndicateP2PEvent( { P2P_INFO *pP2PInfo = (P2P_INFO *)pvP2PInfo; RT_OID_HANDLER *task = &pP2PInfo->pAdapter->pPortCommonInfo->WdiData.TaskHandle; - + if(P2P_EVENT_DEV_FOUND == EventID) { wdiext_IndicateP2PDeviceFound(pP2PInfo->pAdapter, pInformation->Buffer); @@ -2060,8 +2062,8 @@ WDI_IndicateP2PEvent( || P2P_EVENT_RECEIVED_GO_NEGOTIATION_REQUEST == EventID || P2P_EVENT_RECEIVED_INVITATION_REQUEST == EventID ) - {// rx req action - WDI_CMD_PreIndicateRxP2pActionFrameCb(pvP2PInfo, EventID, pInformation); + {// rx req action + WDI_CMD_PreIndicateRxP2pActionFrameCb(pvP2PInfo, EventID, pInformation); wdiext_IndicateP2PActionFrameReceived(pvP2PInfo, EventID, pInformation); WDI_CMD_PostIndicateRxP2pActionFrameCb(pvP2PInfo, EventID, pInformation); } @@ -2072,10 +2074,10 @@ WDI_IndicateP2PEvent( ) {// rx rsp action WDI_CMD_PreIndicateRxP2pActionFrameCb(pvP2PInfo, EventID, pInformation); - + // indicate in the corresp. OffChnlTx complete cb //wdiext_IndicateP2PActionFrameReceived(pvP2PInfo, EventID, pInformation); - + WDI_CMD_PostIndicateRxP2pActionFrameCb(pvP2PInfo, EventID, pInformation); } else if(P2P_EVENT_GO_OPERATING_CHANNEL == EventID) @@ -2083,7 +2085,7 @@ WDI_IndicateP2PEvent( wdiext_IndicateP2POpChnl(pP2PInfo->pAdapter, pP2PInfo); } - return; + return; } @@ -2105,7 +2107,7 @@ WDI_CompleteCreateDeleteMac( } VOID -WDI_IndicateLinkStateChanged( +WDI_IndicateLinkStateChanged( PADAPTER pAdapter, BOOLEAN bForceLinkQuality, u1Byte ucLinkQuality @@ -2122,14 +2124,14 @@ WDI_IndicateActionFrame( { NDIS_STATUS_INDICATION *indic = NULL; WDI_MESSAGE_HEADER *wdiHdr = NULL; - + u1Byte *buf = NULL; ULONG buflen = 0; WDI_INDICATION_ACTION_FRAME_RECEIVED_PARAMETERS param = {0}; RT_TRACE(COMP_OID_SET, DBG_WARNING, ("WDI_IndicateActionFrame +\n")); - + // TODO: fill the valid info into param PlatformMoveMemory(param.SourceAddress.Address,Frame_pSaddr(*posMpdu),6); @@ -2137,13 +2139,13 @@ WDI_IndicateActionFrame( param.ActionFrameBody.ElementCount = posMpdu->Length; // TODO: double check here to make sure channel correct - param.ChannelInfo.ChannelNumber = RT_GetChannelNumber(pAdapter); + param.ChannelInfo.ChannelNumber = RT_GetChannelNumber(pAdapter); param.ChannelInfo.BandId = WDI_BAND_ID_2400; if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationActionFrameReceived( - ¶m, - sizeof(*indic) + sizeof(*wdiHdr), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(*indic) + sizeof(*wdiHdr), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { RT_TRACE(COMP_OID_SET, DBG_WARNING, ("ActionFrame generate tlv failed\n")); @@ -2173,7 +2175,7 @@ WDI_IndicateActionFrame( NdisMIndicateStatusEx(pAdapter->pNdisCommon->hNdisAdapter, indic); FreeGenerated((UINT8 *)buf); - + return RT_STATUS_SUCCESS; } @@ -2184,12 +2186,12 @@ WDI_IndicateWakeReason( IN pu1Byte pBuffer, IN u2Byte BufferLen ) -{ +{ WDI_INDICATION_WAKE_REASON_PARAMETERS param; PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); PRT_POWER_SAVE_CONTROL pPSC = GET_POWER_SAVE_CONTROL(pMgntInfo); - pu1Byte pWakePktbuf = NULL; + pu1Byte pWakePktbuf = NULL; BOOLEAN bIndicate = TRUE; u1Byte *buf = NULL; ULONG buflen = 0; @@ -2207,7 +2209,7 @@ WDI_IndicateWakeReason( RT_TRACE(COMP_POWER, DBG_SERIOUS, ("WDI_IndicateWakeReason(): Unknown pPSC->WakeUpReason(%#x)\n", pPSC->WakeUpReason)); } - param.WakeEventCode = WDI_WAKE_REASON_CODE_PACKET; + param.WakeEventCode = WDI_WAKE_REASON_CODE_PACKET; param.WakePacketPatternId = pPSC->MagicPacketPatternId; PlatformAllocateMemoryWithZero(pAdapter, (PVOID *)&pWakePktbuf, BufferLen); @@ -2241,47 +2243,47 @@ WDI_IndicateWakeReason( bIndicate = FALSE; } } - + if(bIndicate) { RT_TRACE(COMP_POWER, DBG_LOUD, ("WDI_IndicateWakeReason(): WakeEventCode(%#X)\n", param.WakeEventCode)); // Gen tlv if(NDIS_STATUS_SUCCESS != GenerateWdiIndicationWakeReasonFromIhv( - ¶m, - sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), - &pAdapter->pPortCommonInfo->WdiData.TlvContext, + ¶m, + sizeof(NDIS_STATUS_INDICATION) + sizeof(WDI_MESSAGE_HEADER), + &pAdapter->pPortCommonInfo->WdiData.TlvContext, &buflen, &((UINT8 *)buf))) { RT_TRACE(COMP_POWER, DBG_LOUD, ("WDI_IndicateWakeReason(): GenerateWdiIndicationWakeReasonFromIhv Failed\n")); return; } - - wdi_UnsolicitedIndication(pAdapter, + + wdi_UnsolicitedIndication(pAdapter, FALSE, NULL, NDIS_STATUS_WDI_INDICATION_WAKE_REASON, NDIS_STATUS_SUCCESS, buf, buflen); - + // cleanup FreeGenerated((UINT8 *)buf); - } - + } + } VOID -WDI_IndicateRoamingNeeded( +WDI_IndicateRoamingNeeded( PADAPTER pAdapter, RT_PREPARE_ROAM_TYPE IndicationReason ) { PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo); - + pMgntInfo->PrepareRoamState = IndicationReason; - + switch(IndicationReason) { case RT_PREPARE_ROAM_DEAUTH_DISASSOC: @@ -2299,7 +2301,7 @@ WDI_IndicateRoamingNeeded( } VOID -WDI_IndicateRoamingComplete( +WDI_IndicateRoamingComplete( PADAPTER pAdapter ) { @@ -2307,11 +2309,11 @@ WDI_IndicateRoamingComplete( if(FALSE == OidHandle_VerifyTask(pAdapter, OID_WDI_TASK_ROAM)) return; - + OidHandle_Complete(pAdapter, OIDHANDLE_TYPE_TASK); } -VOID +VOID WDI_AddGroupPeer( IN PADAPTER pAdapter, IN u2Byte PortNumber @@ -2319,44 +2321,44 @@ WDI_AddGroupPeer( { PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); PWDI_DATA_STRUCT pWdi = &(pAdapter->pPortCommonInfo->WdiData); - WDI_MAC_ADDRESS PeerAddr = {0}; + WDI_MAC_ADDRESS PeerAddr = {0}; PRT_PEER_ENTRY pPeerEntry = NULL; u1Byte i = 0; - + FunctionIn(COMP_INIT); - + PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); for(i = 0; i < MP_DEFAULT_NUMBER_OF_PORT; i++) { pPeerEntry = &pDefaultAdapter->RxPeerTable[i]; if( pPeerEntry->bUsed == FALSE ) { - RT_TRACE(COMP_INIT, DBG_LOUD, ("WDI_AddGroupPeer: create group peer %d for port %d\n", i, PortNumber)); + RT_TRACE(COMP_INIT, DBG_LOUD, ("WDI_AddGroupPeer: create group peer %d for port %d\n", i, PortNumber)); break; } } - + if( i == MP_DEFAULT_NUMBER_OF_PORT ) { - RT_TRACE(COMP_INIT, DBG_WARNING, ("WDI_AddGroupPeer: there is no available group peer for port %d\n", PortNumber)); + RT_TRACE(COMP_INIT, DBG_WARNING, ("WDI_AddGroupPeer: there is no available group peer for port %d\n", PortNumber)); FunctionOut(COMP_INIT); PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); return ; } - + pPeerEntry->bUsed = TRUE; pPeerEntry->uPeerId = i; pPeerEntry->uPortId = PortNumber; PlatformMoveMemory(pPeerEntry->PeerAddr, MAC_BROADCAST_ADDR, 6); PlatformMoveMemory(PeerAddr.Address, pPeerEntry->PeerAddr, 6); pWdi->WdiDataApi.PeerCreateIndication(pWdi->DataPathHandle, (WDI_PORT_ID)pPeerEntry->uPortId, (WDI_PEER_ID)pPeerEntry->uPeerId, PeerAddr); - + PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + FunctionOut(COMP_INIT); } -VOID +VOID WDI_DeleteGroupPeer( IN PADAPTER pAdapter, IN u2Byte PortNumber @@ -2368,15 +2370,15 @@ WDI_DeleteGroupPeer( WDI_PEER_ID PeerId = 0; PRT_PEER_ENTRY pPeerEntry = NULL; u1Byte i; - + FunctionIn(COMP_INIT); PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + pPeerEntry = (PRT_PEER_ENTRY)wdi_FindGroupPeerByPort(pAdapter, PortNumber); if( pPeerEntry == NULL ) { - RT_TRACE(COMP_INIT, DBG_WARNING, ("wdi_FindPeerByAddr: Cannot find group peer of port %d\n", PortNumber)); + RT_TRACE(COMP_INIT, DBG_WARNING, ("wdi_FindPeerByAddr: Cannot find group peer of port %d\n", PortNumber)); FunctionOut(COMP_INIT); PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); return ; @@ -2385,23 +2387,23 @@ WDI_DeleteGroupPeer( { PeerId = (WDI_PEER_ID)pPeerEntry->uPeerId; pPeerEntry->bUsed = FALSE; - - PlatformZeroMemory(pPeerEntry->PeerAddr, 6); - + + PlatformZeroMemory(pPeerEntry->PeerAddr, 6); + pWdi->WdiDataApi.PeerDeleteIndication(pWdi->DataPathHandle, (WDI_PORT_ID)PortNumber, PeerId, &ndisStatus); - + WDI_FreeRxFrame(pAdapter, (PNET_BUFFER_LIST)N6CGetHeadNblWaitQueue(pDefaultAdapter->RxPeerQueue[PeerId])); RTInitializeSListHead(&pDefaultAdapter->RxPeerQueue[PeerId]); - + RT_TRACE(COMP_INIT, DBG_LOUD, ("WDI_DeleteGroupPeer: delete group peer %d of port %d, Status: %d\n", PeerId, PortNumber, ndisStatus)); } - + PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + FunctionOut(COMP_INIT); } -NDIS_STATUS +NDIS_STATUS WDI_AddDatapathPeer( IN PADAPTER pAdapter, IN pu1Byte pAddr) @@ -2412,28 +2414,28 @@ WDI_AddDatapathPeer( WDI_PORT_ID PortId = (WDI_PORT_ID)pAdapter->pNdis62Common->PortNumber; WDI_MAC_ADDRESS PeerAddr = {0}; PRT_PEER_ENTRY pPeerEntry = NULL; - + FunctionIn(COMP_MLME); - + PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + pPeerEntry = (PRT_PEER_ENTRY)wdi_GetAvailablePeer(pAdapter, pAddr); if( pPeerEntry != NULL ) - { + { PlatformMoveMemory(PeerAddr.Address, pPeerEntry->PeerAddr, 6); pWdi->WdiDataApi.PeerCreateIndication(pWdi->DataPathHandle, (WDI_PORT_ID)pPeerEntry->uPortId, (WDI_PEER_ID)pPeerEntry->uPeerId, PeerAddr); - + PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + FunctionOut(COMP_MLME); - + return NDIS_STATUS_SUCCESS; } - + PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + FunctionOut(COMP_MLME); - + return NDIS_STATUS_FAILURE; } @@ -2448,11 +2450,11 @@ void WDI_DeleteDatapathPeer( NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; WDI_PEER_ID PeerId = 0; PRT_PEER_ENTRY pPeerEntry = NULL; - + FunctionIn(COMP_MLME); - + PlatformAcquireSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + pPeerEntry = (PRT_PEER_ENTRY)wdi_FindPeerByAddr(pAdapter, pAddr); if( pPeerEntry == NULL ) { @@ -2461,23 +2463,23 @@ void WDI_DeleteDatapathPeer( PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); return ; } - RT_TRACE(COMP_INIT, DBG_LOUD, ("WDI_DeleteDatapathPeer: Find the addres [%2x:%2x:%2x:%2x:%2x:%2x] associated at Peer %d\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], pPeerEntry->uPeerId)); - + RT_TRACE(COMP_INIT, DBG_LOUD, ("WDI_DeleteDatapathPeer: Find the addres [%2x:%2x:%2x:%2x:%2x:%2x] associated at Peer %d\n", pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], pPeerEntry->uPeerId)); + pDefaultAdapter->RxPeerUsedCount--; PeerId = (WDI_PEER_ID)pPeerEntry->uPeerId; PortId = (WDI_PORT_ID)pPeerEntry->uPortId; pPeerEntry->bUsed = FALSE; - PlatformZeroMemory(pPeerEntry->PeerAddr, 6); - + PlatformZeroMemory(pPeerEntry->PeerAddr, 6); + pWdi->WdiDataApi.PeerDeleteIndication(pWdi->DataPathHandle, PortId, PeerId, &ndisStatus); - + WDI_FreeRxFrame(pAdapter, (PNET_BUFFER_LIST)N6CGetHeadNblWaitQueue(pDefaultAdapter->RxPeerQueue[PeerId])); RTInitializeSListHead(&pDefaultAdapter->RxPeerQueue[PeerId]); - + PlatformReleaseSpinLock(pAdapter, RT_RX_QUEUE_SPINLOCK); - + RT_TRACE(COMP_MLME, DBG_LOUD, ("WDI_DeleteDatapathPeer: delete peer %d, Status: %d\n", PeerId, ndisStatus)); - + FunctionOut(COMP_MLME); } @@ -2491,7 +2493,7 @@ WDI_FetchNBLByPort( PADAPTER pDefaultAdapter = GetDefaultAdapter(pAdapter); u2Byte index = 0; PRT_SINGLE_LIST_ENTRY pFirst = NULL, pTemp = NULL; - + *ppNetBufferList = NULL; RT_TRACE(COMP_RECV, DBG_LOUD, ("WDI_FetchNBLByPort: fetch frames of all peers at port %d\n", Port_ID)); @@ -2505,7 +2507,7 @@ WDI_FetchNBLByPort( { if(N6CIsNblWaitQueueEmpty(pDefaultAdapter->RxPeerQueue[index])) continue; - + pTemp = RTGetHeadSList(&pDefaultAdapter->RxPeerQueue[index]); if( pFirst == NULL ) { @@ -2518,7 +2520,7 @@ WDI_FetchNBLByPort( RTInitializeSListHead(&pDefaultAdapter->RxPeerQueue[index]); } } - + if( pFirst != NULL ) { *ppNetBufferList = RT_GET_NBL_FROM_QUEUE_LINK(pFirst); @@ -2534,7 +2536,7 @@ WDI_FetchNBLByPort( { if(N6CIsNblWaitQueueEmpty(pDefaultAdapter->RxPeerQueue[index])) continue; - + pTemp = RTGetHeadSList(&pDefaultAdapter->RxPeerQueue[index]); if( pFirst == NULL ) { @@ -2547,7 +2549,7 @@ WDI_FetchNBLByPort( RTInitializeSListHead(&pDefaultAdapter->RxPeerQueue[index]); } } - + if( pFirst != NULL ) { *ppNetBufferList = RT_GET_NBL_FROM_QUEUE_LINK(pFirst); @@ -2577,11 +2579,11 @@ WDI_FreeRxFrame( FunctionOut(COMP_RECV); return; } - + do - { + { //Get next NBL - pNextNBL = NET_BUFFER_LIST_NEXT_NBL(pNetBufferList); + pNextNBL = NET_BUFFER_LIST_NEXT_NBL(pNetBufferList); //Get RFD from NBL pRfd = MP_GET_PACKET_RFD(pNetBufferList); @@ -2617,22 +2619,22 @@ WDI_FreeRxFrame( //Assign NextNBL pointer pNetBufferList = pNextNBL; }while(pNetBufferList!=NULL); - + if (Count == 0) { NdisSetEvent(&pNdisCommon->AllPacketReturnedEvent); - if(pAdapter->MgntInfo.NdisVersion >= RT_NDIS_VERSION_6_20) - { + if(pAdapter->MgntInfo.NdisVersion >= RT_NDIS_VERSION_6_20) + { PADAPTER pTempAdapter = GetFirstExtAdapter(pAdapter); while(pTempAdapter != NULL) { NdisSetEvent(&pTempAdapter->pNdisCommon->AllPacketReturnedEvent); - pTempAdapter = GetNextExtAdapter(pTempAdapter); - } + pTempAdapter = GetNextExtAdapter(pTempAdapter); + } } } - + FunctionOut(COMP_RECV); } @@ -2641,7 +2643,7 @@ WDI_IndicateTKIPMICFailure( PADAPTER pAdapter ) { - PMGNT_INFO pMgntInfo; + PMGNT_INFO pMgntInfo; pMgntInfo = &(pAdapter->MgntInfo); PUCHAR pOutput = NULL; ULONG length = 0; @@ -2650,13 +2652,13 @@ WDI_IndicateTKIPMICFailure( FunctionIn(COMP_SEC); - + Params.FailureInfo.DefaultKeyFailure = FALSE; Params.FailureInfo.KeyIndex=0; //WDI_TKIPFailureParam.PeerMacAddress=pMgntInfo->Bssid; cpMacAddr(Params.FailureInfo.PeerMacAddress.Address, pMgntInfo->Bssid); - - + + ndisStatus = GenerateWdiIndicationTkipMicFailure( &Params, @@ -2696,7 +2698,7 @@ WDI_TxCreditCheck( GLWdiTxRxStatistics.monitorTxPauseReason = pWdi->txPauseReason; // First check if we have pause indication before. - // not to acquire tx lock frequently, so we do not acquire tx lock when read, but remember + // not to acquire tx lock frequently, so we do not acquire tx lock when read, but remember // we should acquire tx lock when need to change the pause reason. if(pWdi->txPauseReason) { @@ -2704,26 +2706,26 @@ WDI_TxCreditCheck( txCredit = *Get_NUM_IDLE_TCB(pAdapter); preTxPauseReason = pWdi->txPauseReason; - + RT_TRACE(COMP_INIT, DBG_LOUD, ("[WDI], WDI_TxCreditCheck(): txCredit=%d\n", txCredit)); - + if(txCredit > (pAdapter->RT_TCB_NUM/4)) { GLWdiTxRxStatistics.numTxResourceAvailable++; - + if( (preTxPauseReason&WDI_TX_PAUSE_REASON_CREDIT) == WDI_TX_PAUSE_REASON_CREDIT) { - RT_TRACE(COMP_INIT, DBG_LOUD, ("[WDI], WDI_TxCreditCheck(): TxPauseReason = 0x%x!!!\n", preTxPauseReason)); + RT_TRACE(COMP_INIT, DBG_LOUD, ("[WDI], WDI_TxCreditCheck(): TxPauseReason = 0x%x!!!\n", preTxPauseReason)); GLWdiTxRxStatistics.numWdiTxRestartIndicate++; RT_TRACE(COMP_INIT, DBG_LOUD, ("[WDI], WDI_TxCreditCheck(): TxSendRestart: %d times!!!\n", GLWdiTxRxStatistics.numWdiTxRestartIndicate)); - + pWdi->txPauseReason &= ~WDI_TX_PAUSE_REASON_CREDIT; PlatformReleaseSpinLock(pAdapter, RT_TX_SPINLOCK); // Before indicate to WDI, release the tx lock. - pWdi->WdiDataApi.TxSendRestartIndication(pWdi->DataPathHandle, - WDI_PORT_ANY, + pWdi->WdiDataApi.TxSendRestartIndication(pWdi->DataPathHandle, + WDI_PORT_ANY, WDI_PEER_ANY, WDI_EXT_TID_UNKNOWN, WDI_TX_PAUSE_REASON_CREDIT); @@ -2749,10 +2751,10 @@ WDI_IndicateFWStalled( PWDI_DATA_STRUCT pWdi = &(pAdapter->pPortCommonInfo->WdiData); NDIS_STATUS_INDICATION statusIndication = {0}; WDI_MESSAGE_HEADER WdiHeader = {0}; - + if(!pWdi->bWdiLEPLDR) return; - + RT_TRACE(COMP_OID_SET, DBG_LOUD, ("==> WDI_IndicateFWStalled\n")); N6_ASSIGN_OBJECT_HEADER( @@ -2818,7 +2820,7 @@ WDI_IndicateGeneralEvent( ) { RT_STATUS rtStatus = RT_STATUS_SUCCESS; - + switch(Event) { default: diff --git a/print/XPSDrvSmpl/src/common/pshndlr.cpp b/print/XPSDrvSmpl/src/common/pshndlr.cpp index 989837be..90acda70 100644 --- a/print/XPSDrvSmpl/src/common/pshndlr.cpp +++ b/print/XPSDrvSmpl/src/common/pshndlr.cpp @@ -133,7 +133,7 @@ CPSHandler::CPSHandler( cstrNSPrefix.Delete(iIndex, 1) > 0) { CStringXDW cstrOrgNamespaces; - cstrOrgNamespaces.Format(szNSSelection, cstrNSPrefix, FRAMEWORK_URI); + cstrOrgNamespaces.Format(szNSSelection, static_cast(cstrNSPrefix), FRAMEWORK_URI); hr = m_pPrintDocument->setProperty(CComBSTR(szSelectNS), CComVariant(cstrOrgNamespaces)); } @@ -1259,7 +1259,7 @@ Note: The annotation for pbstrValue is intended to express that the BSTR may be NULL when S_FALSE is returned, but not when S_OK is returned. - + In any case, when a failure HRESULT is returned, all out parameter annotations are ignored. @@ -1593,7 +1593,7 @@ CPSHandler::GetPrefixFromURI( // Construct the Root Query string // CStringXDW cstrRootQuery; - cstrRootQuery.Format(szPTRootQuery, szTmpNS, m_bstrDocumentType); + cstrRootQuery.Format(szPTRootQuery, szTmpNS, static_cast(m_bstrDocumentType)); // // Find the PrintSchema element so we can retrieve the private namespace prefix diff --git a/print/XPSDrvSmpl/src/common/ptquerybld.cpp b/print/XPSDrvSmpl/src/common/ptquerybld.cpp index 885af0b2..2b3bd749 100644 --- a/print/XPSDrvSmpl/src/common/ptquerybld.cpp +++ b/print/XPSDrvSmpl/src/common/ptquerybld.cpp @@ -236,7 +236,7 @@ CPTQueryBuilder::AddFeature( if (SUCCEEDED(hr)) { CStringXDW cstrFeatureQuery; - cstrFeatureQuery.Format(szPTQFeature, m_bstrFrameworkNS, bstrKeyword); + cstrFeatureQuery.Format(szPTQFeature, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); hr = m_bstrQuery.Append(cstrFeatureQuery); } @@ -305,7 +305,7 @@ CPTQueryBuilder::AddProperty( if (SUCCEEDED(hr)) { CStringXDW cstrPropertyQuery; - cstrPropertyQuery.Format(szPTQProperty, m_bstrFrameworkNS, bstrKeyword); + cstrPropertyQuery.Format(szPTQProperty, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); hr = m_bstrQuery.Append(cstrPropertyQuery); } @@ -369,7 +369,7 @@ CPTQueryBuilder::AddScoredProperty( if (SUCCEEDED(hr)) { CStringXDW cstrScoredPropertyQuery; - cstrScoredPropertyQuery.Format(szPTQScoredProperty, m_bstrFrameworkNS, bstrKeyword); + cstrScoredPropertyQuery.Format(szPTQScoredProperty, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); hr = m_bstrQuery.Append(cstrScoredPropertyQuery); } @@ -437,7 +437,7 @@ CPTQueryBuilder::AddParamRef( if (SUCCEEDED(hr)) { CStringXDW cstrParamRefQuery; - cstrParamRefQuery.Format(szPTQParamRef, m_bstrFrameworkNS, bstrKeyword); + cstrParamRefQuery.Format(szPTQParamRef, static_cast(m_bstrFrameworkNS), static_cast(bstrKeyword)); hr = m_bstrQuery.Append(cstrParamRefQuery); } @@ -490,13 +490,14 @@ CPTQueryBuilder::AddOption( { CStringXDW cstrQueryRoot(m_bstrQuery); CStringXDW cstrOptionQuery; - cstrOptionQuery.Format(szPTQOptionSH, m_bstrFrameworkNS); + cstrOptionQuery.Format(szPTQOptionSH, static_cast(m_bstrFrameworkNS)); if (SUCCEEDED(hr = m_bstrQuery.Append(cstrOptionQuery)) && SUCCEEDED(hr = m_bstrQuery.Append(szPTQOrNodes)) && SUCCEEDED(hr = m_bstrQuery.Append(cstrQueryRoot))) { - cstrOptionQuery.Format(szPTQOptionLH, m_bstrFrameworkNS, bstrKeywordNS, m_bstrFrameworkNS); + cstrOptionQuery.Format(szPTQOptionLH, static_cast(m_bstrFrameworkNS), + static_cast(bstrKeywordNS), static_cast(m_bstrFrameworkNS)); hr = m_bstrQuery.Append(cstrOptionQuery); } } diff --git a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp b/print/XPSDrvSmpl/src/common/wmpthndlr.cpp index dcb1eff7..49792d6a 100644 --- a/print/XPSDrvSmpl/src/common/wmpthndlr.cpp +++ b/print/XPSDrvSmpl/src/common/wmpthndlr.cpp @@ -1123,7 +1123,7 @@ CWMPTHandler::GetTxtPropTypeAndValue( case FontColor: { cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", pWmData->txtData.bstrFontColor); + cstrValue.Format(L"%s", static_cast(pWmData->txtData.bstrFontColor)); } break; @@ -1137,7 +1137,7 @@ CWMPTHandler::GetTxtPropTypeAndValue( case Text: { cstrType = SCHEMA_STRING; - cstrValue.Format(L"%s", pWmData->txtData.bstrText); + cstrValue.Format(L"%s", static_cast(pWmData->txtData.bstrText)); } break; diff --git a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp b/print/XPSDrvSmpl/src/filters/color/cmimg.cpp index f44fa028..6c312629 100644 --- a/print/XPSDrvSmpl/src/filters/color/cmimg.cpp +++ b/print/XPSDrvSmpl/src/filters/color/cmimg.cpp @@ -537,7 +537,7 @@ CColorManagedImage::GetResURI( // Create a unique name for the bitmap for this print session // CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.wdp", cstrFileName, GetUniqueNumber()); + cstrURI.Format(L"%s_%u.wdp", static_cast(cstrFileName), GetUniqueNumber()); SysFreeString(*pbstrResURI); *pbstrResURI = cstrURI.AllocSysString(); diff --git a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp b/print/XPSDrvSmpl/src/filters/color/dictionary.cpp index 5106aad7..efd15760 100644 --- a/print/XPSDrvSmpl/src/filters/color/dictionary.cpp +++ b/print/XPSDrvSmpl/src/filters/color/dictionary.cpp @@ -273,7 +273,7 @@ CRemoteDictionary::GetResURI( // Create a unique name for the dictionary for this print session // CStringXDW cstrURI; - cstrURI.Format(L"%s_%u.dict", m_bstrDictionaryURI, GetUniqueNumber()); + cstrURI.Format(L"%s_%u.dict", static_cast(m_bstrDictionaryURI), GetUniqueNumber()); *pbstrResURI = cstrURI.AllocSysString(); } diff --git a/print/XPSDrvSmpl/src/filters/color/profman.cpp b/print/XPSDrvSmpl/src/filters/color/profman.cpp index 8bd06284..16ee9dc2 100644 --- a/print/XPSDrvSmpl/src/filters/color/profman.cpp +++ b/print/XPSDrvSmpl/src/filters/color/profman.cpp @@ -692,7 +692,7 @@ CProfileManager::GetResURI( // Create a unique name for the profile for this print session // CStringXDW cstrURI; - cstrURI.Format(L"/%s_%u%s", cstrFileName, GetUniqueNumber(), cstrFileExt); + cstrURI.Format(L"/%s_%u%s", static_cast(cstrFileName), GetUniqueNumber(), static_cast(cstrFileExt)); *pbstrResURI = cstrURI.AllocSysString(); } diff --git a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp b/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp index 209c344a..fa50170f 100644 --- a/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp +++ b/print/XPSDrvSmpl/src/filters/common/ptmanage.cpp @@ -178,9 +178,9 @@ CPTManager::Initialise( // // We couldn't revert the security context. The filter pipeline // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can + // when it is determined that the security context was not + // reverted. Since there are no security implications with + // running this filter in an elevated context, we can // continue to run. // } @@ -589,7 +589,7 @@ CPTManager::GetCapabilities( { } } - + // // Always revert back to the default security context // @@ -598,9 +598,9 @@ CPTManager::GetCapabilities( // // We couldn't revert the security context. The filter pipeline // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can + // when it is determined that the security context was not + // reverted. Since there are no security implications with + // running this filter in an elevated context, we can // continue to run. // } @@ -1034,7 +1034,7 @@ CPTManager::GetMergedTicket( { CStringXDA cstrMessage; CStringXDA cstrError(bstrErrorMessage); - cstrMessage.Format("PTMergeAndValidatePrintTicket failed with message: %s\n", cstrError); + cstrMessage.Format("PTMergeAndValidatePrintTicket failed with message: %s\n", static_cast(cstrError)); ERR(cstrMessage.GetBuffer()); } @@ -1047,9 +1047,9 @@ CPTManager::GetMergedTicket( // // We couldn't revert the security context. The filter pipeline // manager will clean up the thread when operation is complete, - // when it is determined that the security context was not - // reverted. Since there are no security implications with - // running this filter in an elevated context, we can + // when it is determined that the security context was not + // reverted. Since there are no security implications with + // running this filter in an elevated context, we can // continue to run. // } diff --git a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp b/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp index 830f6928..6c92730c 100644 --- a/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp +++ b/print/XPSDrvSmpl/src/filters/nup/nupsax.cpp @@ -266,7 +266,7 @@ CNUpSaxHandler::startElement( if (sizePage.Width < 1.f) { // - // According to the Xps Specification, + // According to the Xps Specification, // FixedPage Width must be >= 1.0 // hr = E_FAIL; @@ -363,8 +363,8 @@ CNUpSaxHandler::startElement( sizePage.Height); cstrOut.Format(L"(bstrMatrix), + static_cast(strClip)); // // Add additional namespaces from the FixedPage diff --git a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp b/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp index 44e0d5d3..7a7bc160 100644 --- a/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp +++ b/print/XPSDrvSmpl/src/filters/scaling/pagescale.cpp @@ -699,7 +699,7 @@ CPageScaling::GetOpenTagXML( if (SUCCEEDED(hr = CreateTransform(&bstrMatrixXForm))) { CStringXDW cstrCanvas; - cstrCanvas.Format(L"(bstrMatrixXForm)); *pbstrXML = cstrCanvas.AllocSysString(); } } diff --git a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp b/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp index 578995bf..5f139830 100644 --- a/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp +++ b/print/XPSDrvSmpl/src/filters/watermark/wmvect.cpp @@ -159,7 +159,8 @@ CVectorWatermark::CreateXMLElement( try { CStringXDW strOpenCanvas; - strOpenCanvas.Format(L"", bstrWMOpacity, bstrMatrixXForm); + strOpenCanvas.Format(L"", + static_cast(bstrWMOpacity), static_cast(bstrMatrixXForm)); IStream* pStream; CComBSTR bstrContent; diff --git a/sd/sdiomars/mars.vcxproj b/sd/sdiomars/mars.vcxproj index fc11a774..21ca54ce 100644 --- a/sd/sdiomars/mars.vcxproj +++ b/sd/sdiomars/mars.vcxproj @@ -101,15 +101,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\sdbus.lib;$(DDK_LIB_PATH)\ntstrsafe.lib - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. @@ -117,15 +117,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\sdbus.lib;$(DDK_LIB_PATH)\ntstrsafe.lib - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. @@ -133,15 +133,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\sdbus.lib;$(DDK_LIB_PATH)\ntstrsafe.lib - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. @@ -149,15 +149,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\sdbus.lib;$(DDK_LIB_PATH)\ntstrsafe.lib - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. - %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories);. @@ -176,4 +176,4 @@ - \ No newline at end of file + diff --git a/security/elam/elamsample.c b/security/elam/elamsample.c index 13654d6e..0877ee71 100644 --- a/security/elam/elamsample.c +++ b/security/elam/elamsample.c @@ -20,7 +20,7 @@ // Kernel mode only. // -#include +#include "elamsample.h" #ifdef ALLOC_PRAGMA #pragma alloc_text(INIT, DriverEntry) diff --git a/sensors/Activity/Device.h b/sensors/Activity/Device.h index 64b2a5e4..afd205db 100644 --- a/sensors/Activity/Device.h +++ b/sensors/Activity/Device.h @@ -12,7 +12,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include @@ -197,4 +197,4 @@ private: // // Set up accessor function to retrieve device context // -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(ActivityDevice, GetActivityContextFromSensorInstance); \ No newline at end of file +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(ActivityDevice, GetActivityContextFromSensorInstance); diff --git a/sensors/CustomSensors/Device.h b/sensors/CustomSensors/Device.h index 0679b137..692bf675 100644 --- a/sensors/CustomSensors/Device.h +++ b/sensors/CustomSensors/Device.h @@ -15,7 +15,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include @@ -135,4 +135,4 @@ WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(CustomSensorDevice, GetCustomSensorContextFro #define CustomSensorDevice_Resolution (0.1f) // CO2 concentration resolution in parts per million (ppmv). #define CustomSensorDevice_Minimum_CO2Level (0.0f) // Minimum CO2 concentration in parts per million (ppmv). -#define CustomSensorDevice_Maximum_CO2Level (10000.0f) // Maximum CO2 concentration in parts per million (ppmv). \ No newline at end of file +#define CustomSensorDevice_Maximum_CO2Level (10000.0f) // Maximum CO2 concentration in parts per million (ppmv). diff --git a/sensors/CustomSensors/HardwareSimulator.h b/sensors/CustomSensors/HardwareSimulator.h index e170918b..3bb6e04c 100644 --- a/sensors/CustomSensors/HardwareSimulator.h +++ b/sensors/CustomSensors/HardwareSimulator.h @@ -14,7 +14,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #define SIMULATOR_HARDWARE_INTERVAL_MS (100) // 100ms diff --git a/sensors/Fusion/Device.h b/sensors/Fusion/Device.h index 1bd39606..89d45ed9 100644 --- a/sensors/Fusion/Device.h +++ b/sensors/Fusion/Device.h @@ -19,11 +19,7 @@ #include #include #include -#include #include -#include -#include -#include #define SENSOR_POOL_TAG_FUSIONSENSOR 'esuF' diff --git a/sensors/Pedometer/Device.h b/sensors/Pedometer/Device.h index 008c3ef6..593e0b95 100644 --- a/sensors/Pedometer/Device.h +++ b/sensors/Pedometer/Device.h @@ -15,7 +15,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include diff --git a/sensors/Pedometer/HardwareSimulator.h b/sensors/Pedometer/HardwareSimulator.h index 3d9646b9..c0f72cac 100644 --- a/sensors/Pedometer/HardwareSimulator.h +++ b/sensors/Pedometer/HardwareSimulator.h @@ -14,7 +14,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include "Device.h" diff --git a/sensors/SensorsComboDriver/SensorsComboDriver.vcxproj b/sensors/SensorsComboDriver/SensorsComboDriver.vcxproj index 15e5d0a5..381f5a03 100644 --- a/sensors/SensorsComboDriver/SensorsComboDriver.vcxproj +++ b/sensors/SensorsComboDriver/SensorsComboDriver.vcxproj @@ -118,7 +118,6 @@ %(AdditionalDependencies);$(SDK_LIB_PATH)\mincore.lib;$(SDK_LIB_PATH)\propsys.lib;$(SDK_LIB_PATH)\sensors\1.1\sensorscxstub.lib;$(SDK_LIB_PATH)\sensorsutils.lib - SensorsComboDriver.def @@ -139,7 +138,6 @@ %(AdditionalDependencies);$(SDK_LIB_PATH)\mincore.lib;$(SDK_LIB_PATH)\propsys.lib;$(SDK_LIB_PATH)\sensors\1.1\sensorscxstub.lib;$(SDK_LIB_PATH)\sensorsutils.lib - SensorsComboDriver.def @@ -160,7 +158,6 @@ %(AdditionalDependencies);$(SDK_LIB_PATH)\mincore.lib;$(SDK_LIB_PATH)\propsys.lib;$(SDK_LIB_PATH)\sensors\1.1\sensorscxstub.lib;$(SDK_LIB_PATH)\sensorsutils.lib - SensorsComboDriver.def @@ -181,7 +178,6 @@ %(AdditionalDependencies);$(SDK_LIB_PATH)\mincore.lib;$(SDK_LIB_PATH)\propsys.lib;$(SDK_LIB_PATH)\sensors\1.1\sensorscxstub.lib;$(SDK_LIB_PATH)\sensorsutils.lib - SensorsComboDriver.def @@ -197,4 +193,4 @@ - \ No newline at end of file + diff --git a/sensors/SimpleDeviceOrientationSensor/Device.h b/sensors/SimpleDeviceOrientationSensor/Device.h index b75b5ceb..3d1e677c 100644 --- a/sensors/SimpleDeviceOrientationSensor/Device.h +++ b/sensors/SimpleDeviceOrientationSensor/Device.h @@ -15,7 +15,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include diff --git a/sensors/SimpleDeviceOrientationSensor/HardwareSimulator.h b/sensors/SimpleDeviceOrientationSensor/HardwareSimulator.h index 8f96b902..7da0be14 100644 --- a/sensors/SimpleDeviceOrientationSensor/HardwareSimulator.h +++ b/sensors/SimpleDeviceOrientationSensor/HardwareSimulator.h @@ -14,7 +14,7 @@ #include #include -#include +#include "SensorsTrace.h" #include #include diff --git a/smartcrd/pscr/Pscr.vcxproj b/smartcrd/pscr/Pscr.vcxproj index 519d508f..2bcdd80d 100644 --- a/smartcrd/pscr/Pscr.vcxproj +++ b/smartcrd/pscr/Pscr.vcxproj @@ -99,15 +99,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\smclib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. @@ -115,15 +115,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\smclib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. @@ -131,15 +131,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\smclib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. @@ -147,15 +147,15 @@ %(AdditionalDependencies);$(DDK_LIB_PATH)\smclib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. @@ -179,4 +179,4 @@ - \ No newline at end of file + diff --git a/storage/class/classpnp/src/srblib.c b/storage/class/classpnp/src/srblib.c index a888d390..64a7ca88 100644 --- a/storage/class/classpnp/src/srblib.c +++ b/storage/class/classpnp/src/srblib.c @@ -22,7 +22,7 @@ Revision History: --*/ -#include +#include "classp.h" PVOID DefaultStorageRequestBlockAllocateRoutine( diff --git a/storage/miniports/lsi_u3/src/lsi_u3.inf b/storage/miniports/lsi_u3/src/lsi_u3.inf index 1225dad4..8d631d41 100644 Binary files a/storage/miniports/lsi_u3/src/lsi_u3.inf and b/storage/miniports/lsi_u3/src/lsi_u3.inf differ diff --git a/storage/msdsm/src/intrface.c b/storage/msdsm/src/intrface.c index e7c1eb29..925252be 100644 --- a/storage/msdsm/src/intrface.c +++ b/storage/msdsm/src/intrface.c @@ -2159,13 +2159,13 @@ Return Value: group->LBPolicySelection = DSM_DEFAULT_LB_POLICY_LUN_EXPLICIT; } - + if (!explicitlySet && !vidpidPolicySet && !overallPolicySet) { group->LBPolicySelection = DSM_DEFAULT_LB_POLICY_ALUA_CAPABILITY; - } - + } + // // If ALUA is enabled and the load balance policy is set to Round Robin, // we need to set it to Round Robin with Subset instead. @@ -2466,7 +2466,7 @@ Return Value: KIRQL irql; BOOLEAN retVal; ULONG SpecialHandlingFlag = 0; - + // // 1. If PR and reserved by this node, register the PR keys. // 2. Find the FOG for the passed in PathId @@ -2714,7 +2714,7 @@ Return Value: PDSM_FOG_DEVICELIST_ENTRY fogDeviceListEntry = NULL; PDSM_GROUP_ENTRY group = deviceInfo->Group; ULONG SpecialHandlingFlag = 0; - + TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_PNP, "DsmPathVerify (DevInfo %p): Entering function.\n", @@ -2722,22 +2722,6 @@ Return Value: if (DsmpIsDeviceInitialized(deviceInfo)) { - if (deviceInfo->Unresponsive) { - // - // Since the device is marked unresponsive, there - // is no point in sending RTPG or TUR down - // as that will fail by port driver. - // but that doesn't necessarily mean that the path doesn't exist. - // Return SUCCESS here so that MPIO doesn't remove - // disk in case of failover etc. - // If really this path is gone, this should get deleted - // as part of pnp removal and then if no other paths are left - // disk will be removed - // - status = STATUS_SUCCESS; - return status; - } - irql = ExAcquireSpinLockExclusive(&(dsmCtxt->DsmContextLock)); // @@ -2974,11 +2958,11 @@ Return Value: // Initialize all the entries to indicate that they haven't been processed. // for (entry = failGroup->ZombieGroupList.Flink; entry != &(failGroup->ZombieGroupList); entry = entry->Flink) { - + group = CONTAINING_RECORD(entry, DSM_ZOMBIEGROUP_ENTRY, ListEntry); group->Processed = FALSE; } - + // // Since we need to drop the spin lock while processing an entry, it is possible // that a removal in parallel frees up this entry during that time, thus making it @@ -2988,7 +2972,7 @@ Return Value: // of the list, skipping over the already processed ones. // entry = failGroup->ZombieGroupList.Flink; - + while (entry != &(failGroup->ZombieGroupList)) { group = CONTAINING_RECORD(entry, DSM_ZOMBIEGROUP_ENTRY, ListEntry); @@ -3165,7 +3149,7 @@ Return Value: BOOLEAN adminRequest = FALSE; PDSM_GROUP_ENTRY group = NULL; ULONG SpecialHandlingFlag = 0; - + TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_WMI, "DsmMoveDevice (DsmIds %p): Entering function - DsmContext %p MPIOPath (%p) SuggestedPath %p.\n", @@ -3613,7 +3597,7 @@ Return Value: cdb = SrbGetCdb(Srb); if (cdb) { opCode = cdb->AsByte[0]; - + } } @@ -3739,7 +3723,7 @@ Return Value: // 2. If the old path was supposed to be removed, check if there are // no more requests are outstanding, and if yes, remove the path // - + irpStack = IoGetCurrentIrpStackLocation(irp); oldPath = irpStack->Parameters.Others.Argument3; @@ -3788,7 +3772,7 @@ Return Value: } } else { - + *Status = STATUS_NO_SUCH_DEVICE; @@ -3796,7 +3780,7 @@ Return Value: TRACE_FLAG_RW, "DsmLBGetPath (DsmIds %p): Failed to get FO group in LBGetPath.\n", DsmList)); - + } @@ -4101,16 +4085,16 @@ Return Value: __Exit_DsmSrbDeviceControl: if (status != STATUS_PENDING) { - + // // Set-up the Irp status for mpio's completion of the request. // If it was IRP_MJ_SCSI, one of the helper routines set Srb->SrbStatus // already. // if ((irpStack->MajorFunction == IRP_MJ_SCSI) && - (Srb != NULL) && + (Srb != NULL) && (Srb->SrbStatus == SRB_STATUS_PENDING)) { - + Srb->SrbStatus = SRB_STATUS_ERROR; } @@ -4694,7 +4678,7 @@ Return Value: handled = TRUE; break; - } + } } } } @@ -4884,7 +4868,7 @@ Return Value: break; } - + default: { if ((scsiStatus == SCSISTAT_CHECK_CONDITION) && @@ -4998,7 +4982,7 @@ Return Value: if (failover) { ULONG SpecialHandlingFlag = 0; - + // // If ALUA is supported, then it is possible that we may need to send // down an STPG so build an IRP and fill in the SRB for STPG and send it down. @@ -5072,7 +5056,7 @@ Return Value: deviceInfo->Group->PathToBeUsed)); } } - } + } *Retry = retry; diff --git a/usb/UcmCxUcsi/UcmCxUcsi.vcxproj b/usb/UcmCxUcsi/UcmCxUcsi.vcxproj index 6a028bd4..6b1efbb1 100644 --- a/usb/UcmCxUcsi/UcmCxUcsi.vcxproj +++ b/usb/UcmCxUcsi/UcmCxUcsi.vcxproj @@ -90,6 +90,7 @@ pch.h + %(AdditionalIncludeDirectories);. true true trace.h @@ -128,4 +129,4 @@ - \ No newline at end of file + diff --git a/usb/kmdf_enumswitches/sys/kmdf_enumswitches.vcxproj b/usb/kmdf_enumswitches/sys/kmdf_enumswitches.vcxproj index e771d816..39422319 100644 --- a/usb/kmdf_enumswitches/sys/kmdf_enumswitches.vcxproj +++ b/usb/kmdf_enumswitches/sys/kmdf_enumswitches.vcxproj @@ -99,18 +99,18 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING %(AdditionalDependencies);$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\wdmsec.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -118,18 +118,18 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING %(AdditionalDependencies);$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\wdmsec.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -137,18 +137,18 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING %(AdditionalDependencies);$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\wdmsec.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -156,18 +156,18 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING %(AdditionalDependencies);$(DDK_LIB_PATH)\ntstrsafe.lib;$(DDK_LIB_PATH)\wdmsec.lib - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -220,4 +220,4 @@ - \ No newline at end of file + diff --git a/usb/kmdf_fx2/driver/osrusbfx2.vcxproj b/usb/kmdf_fx2/driver/osrusbfx2.vcxproj index 08cde31a..2bcf6616 100644 --- a/usb/kmdf_fx2/driver/osrusbfx2.vcxproj +++ b/usb/kmdf_fx2/driver/osrusbfx2.vcxproj @@ -115,17 +115,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -134,17 +134,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -153,17 +153,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -172,17 +172,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -241,4 +241,4 @@ - \ No newline at end of file + diff --git a/usb/umdf2_fx2/driver/osrusbfx2um.vcxproj b/usb/umdf2_fx2/driver/osrusbfx2um.vcxproj index 72e39bc1..a4209763 100644 --- a/usb/umdf2_fx2/driver/osrusbfx2um.vcxproj +++ b/usb/umdf2_fx2/driver/osrusbfx2um.vcxproj @@ -114,17 +114,17 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE @@ -135,17 +135,17 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE @@ -156,17 +156,17 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE @@ -177,17 +177,17 @@ true Level4 - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING;UNICODE;_UNICODE @@ -207,4 +207,4 @@ - \ No newline at end of file + diff --git a/usb/umdf_filter_kmdf/kmdf_driver/osrusbfx2.vcxproj b/usb/umdf_filter_kmdf/kmdf_driver/osrusbfx2.vcxproj index 2db1f7c1..3974f664 100644 --- a/usb/umdf_filter_kmdf/kmdf_driver/osrusbfx2.vcxproj +++ b/usb/umdf_filter_kmdf/kmdf_driver/osrusbfx2.vcxproj @@ -115,17 +115,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -134,17 +134,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -153,17 +153,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -172,17 +172,17 @@ - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. true Level4 %(PreprocessorDefinitions);EVENT_TRACING - %(AdditionalIncludeDirectories);..\inc + %(AdditionalIncludeDirectories);..\inc;. %(PreprocessorDefinitions);EVENT_TRACING @@ -241,4 +241,4 @@ - \ No newline at end of file + diff --git a/wpd/WpdHelloWorldDriver/WpdHelloWorldDriver.inx b/wpd/WpdHelloWorldDriver/WpdHelloWorldDriver.inx index 40d31f8c..f79d7810 100644 --- a/wpd/WpdHelloWorldDriver/WpdHelloWorldDriver.inx +++ b/wpd/WpdHelloWorldDriver/WpdHelloWorldDriver.inx @@ -68,6 +68,7 @@ ServiceBinary=%12%\WUDFRd.sys [DestinationDirs] System32Copy=12,UMDF ; copy to system32\drivers\umdf +CoInstallers_CopyFiles= 11 [System32Copy] WpdHelloWorldDriver.dll diff --git a/wpd/WpdMultiTransportDriver/WpdMultiTransportDriver.inx b/wpd/WpdMultiTransportDriver/WpdMultiTransportDriver.inx index d293c9f7..5e20c4c3 100644 --- a/wpd/WpdMultiTransportDriver/WpdMultiTransportDriver.inx +++ b/wpd/WpdMultiTransportDriver/WpdMultiTransportDriver.inx @@ -69,6 +69,7 @@ ServiceBinary=%12%\WUDFRd.sys [DestinationDirs] System32Copy=12,UMDF ; copy to system32\drivers\umdf +CoInstallers_CopyFiles= 11 [System32Copy] WpdMultiTransportDriver.dll diff --git a/wpd/WpdServiceSampleDriver/WpdServiceSampleDriver.inx b/wpd/WpdServiceSampleDriver/WpdServiceSampleDriver.inx index 935a61cd..0f4365cc 100644 --- a/wpd/WpdServiceSampleDriver/WpdServiceSampleDriver.inx +++ b/wpd/WpdServiceSampleDriver/WpdServiceSampleDriver.inx @@ -65,6 +65,7 @@ ServiceBinary=%12%\WUDFRd.sys [DestinationDirs] System32Copy=12,UMDF ; copy to system32\drivers\umdf +CoInstallers_CopyFiles= 11 [System32Copy] WpdServiceSampleDriver.dll diff --git a/wpd/WpdWudfSampleDriver/WpdWudfSampleDriver.inx b/wpd/WpdWudfSampleDriver/WpdWudfSampleDriver.inx index c66eb485..a2e11b1b 100644 Binary files a/wpd/WpdWudfSampleDriver/WpdWudfSampleDriver.inx and b/wpd/WpdWudfSampleDriver/WpdWudfSampleDriver.inx differ -- cgit v1.3.1