From af60c12439cf289a8fcb670abc4e7cca76e32a4f Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 6 Nov 2025 20:09:07 -0800 Subject: Create the WIFICX Folder to prepare the project for WIFICX Sample driver. --- network/wlan/WIFICX/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 network/wlan/WIFICX/README.md diff --git a/network/wlan/WIFICX/README.md b/network/wlan/WIFICX/README.md new file mode 100644 index 00000000..363e0578 --- /dev/null +++ b/network/wlan/WIFICX/README.md @@ -0,0 +1,13 @@ +--- +page_type: sample +description: "Demonstrates leveraging WIFICX for control flow and NetAdapterCx for data flow." +languages: +- cpp +products: +- windows +- windows-wdk +--- + +# WIFICX and NetAdapterCx samples + +This sample demonstrates leveraging WIFICX for control flow and NetAdapterCx for data flow. -- cgit v1.3.1 From bddbce760509546060b3ccc28a9891b2412d2824 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 10 Nov 2025 12:29:39 -0800 Subject: have the buildable KM and UM solutions for Wifi only scenarios. --- network/wlan/WIFICX/drivercode/SharedTypes.h | 82 + network/wlan/WIFICX/drivercode/adapter.cpp | 43 + network/wlan/WIFICX/drivercode/adapter.h | 21 + network/wlan/WIFICX/drivercode/device.cpp | 125 + network/wlan/WIFICX/drivercode/device.h | 11 + network/wlan/WIFICX/drivercode/driver.cpp | 137 + .../wlan/WIFICX/drivercode/memorymanagement.cpp | 150 + network/wlan/WIFICX/drivercode/precomp.h | 32 + network/wlan/WIFICX/drivercode/testdata.h | 7439 ++++++++++++++++++++ network/wlan/WIFICX/drivercode/trace.h | 247 + network/wlan/WIFICX/drivercode/umkmfusion.h | 89 + network/wlan/WIFICX/drivercode/wifirequest.cpp | 1521 ++++ network/wlan/WIFICX/drivercode/wifirequest.h | 30 + network/wlan/WIFICX/km/wificxsampleclientkm.inf | 62 + .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 191 + .../WIFICX/km/wificxsampleclientkm.vcxproj.filters | 84 + network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 0 -> 3340 bytes .../wlan/WIFICX/um/wificxsampleclientum.vcxproj | 201 + .../WIFICX/um/wificxsampleclientum.vcxproj.filters | 66 + network/wlan/WIFICX/wificxsampleclient.sln | 48 + 20 files changed, 10579 insertions(+) create mode 100644 network/wlan/WIFICX/drivercode/SharedTypes.h create mode 100644 network/wlan/WIFICX/drivercode/adapter.cpp create mode 100644 network/wlan/WIFICX/drivercode/adapter.h create mode 100644 network/wlan/WIFICX/drivercode/device.cpp create mode 100644 network/wlan/WIFICX/drivercode/device.h create mode 100644 network/wlan/WIFICX/drivercode/driver.cpp create mode 100644 network/wlan/WIFICX/drivercode/memorymanagement.cpp create mode 100644 network/wlan/WIFICX/drivercode/precomp.h create mode 100644 network/wlan/WIFICX/drivercode/testdata.h create mode 100644 network/wlan/WIFICX/drivercode/trace.h create mode 100644 network/wlan/WIFICX/drivercode/umkmfusion.h create mode 100644 network/wlan/WIFICX/drivercode/wifirequest.cpp create mode 100644 network/wlan/WIFICX/drivercode/wifirequest.h create mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.inf create mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj create mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters create mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.inf create mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.vcxproj create mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters create mode 100644 network/wlan/WIFICX/wificxsampleclient.sln diff --git a/network/wlan/WIFICX/drivercode/SharedTypes.h b/network/wlan/WIFICX/drivercode/SharedTypes.h new file mode 100644 index 00000000..237f5997 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/SharedTypes.h @@ -0,0 +1,82 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +// +// SharedTypes.h +// Central header for global definitions, macros, and shared structures. +// +#include "precomp.h" +#include // for GUID defination + +// ============================= +// GUIDs or Constants +// ============================= +// {bb67559a-06f6-4eb0-81e9-21fdc3b60efb} +DEFINE_GUID(GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, 0xbb67559a, 0x06f6, 0x4eb0, 0x81, 0xe9, 0x21, 0xfd, 0xc3, 0xb6, 0x0e, 0xfb); +#define WIFI_DRIVER_DEFAULT_POOL_TAG 'sHIW' // WIFI IHV Sample Driver + +// ============================= +// WDF Object Context Types +// ============================= + +typedef struct _WIFI_DEVICE_CONTEXT +{ + // + // Do not add field variable before WdfTriageInfoPtr. + // NetAdapterCx carving code requires the first field of WDF context + // to be a pointer to WDF_TRIAGE_INFO. + // + void* WdfTriageInfoPtr; + WDFDEVICE WdfDevice; + UCHAR CurrentRadioState; + WDI_GET_ADAPTER_CAPABILITIES_PARAMETERS AdapterCapabilities; + TLV_CONTEXT TlvContext; + UINT32 LastConnectEntryId; + UINT32 LastConnectTransactionId; + WDI_AUTH_ALGORITHM LastAuthAlgo; + DOT11_MAC_ADDRESS ConnectedPeer; + NETADAPTER primaryStaAdapter; +} WIFI_DEVICE_CONTEXT, * PWIFI_DEVICE_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_DEVICE_CONTEXT, WifiGetDeviceContext); +static_assert(FIELD_OFFSET(WIFI_DEVICE_CONTEXT, WdfTriageInfoPtr) == 0); + +// Context for each NetAdapter instance. +// Each NetAdapter instance corresponds to an IP interface +// +typedef struct _WIFI_NETADAPTER_CONTEXT +{ + PWIFI_DEVICE_CONTEXT WifiDeviceContext; // Wdf device context + NETADAPTER NetAdapter; // NetAdapter object + + LIST_ENTRY ReceiveList; + NETPACKETQUEUE TxQueue; // Tx Queue object + NETPACKETQUEUE RxQueue; // Rx Queue object + bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; +} WIFI_NETADAPTER_CONTEXT, * PWIFI_NETADAPTER_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_NETADAPTER_CONTEXT, WifiGetNetAdapterContext); + +typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT +{ + size_t cbMaxSize; + _Field_size_bytes_(cbMaxSize) void* pbBuffer; +} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; +typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; + +// for FreeWdfMemoryBuffer to correct get +// the handle to free the memory +struct WIFI_IHV_MEMORY_HEADER +{ + size_t HeaderSize; + WDFMEMORY WdfMemoryHandle; +}; + +// for tracking memory leaks +struct WIFI_IHV_MEMORY_CONTEXT +{ + size_t ContextSize; + void* pvCaller; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp new file mode 100644 index 00000000..e0ea86e6 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/adapter.cpp @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +#include "precomp.h" + +#include "device.h" + +#include "adapter.h" +#include "adapter.tmh" + +_Use_decl_annotations_ +NTSTATUS WifiCxTestAdapterStart(NETADAPTER netAdapter) +{ + TraceEntry(); + + ULONG64 maxXmitLinkSpeed = WIFI_MEDIA_MAX_SPEED; + ULONG64 maxRcvLinkSpeed = WIFI_MEDIA_MAX_SPEED; + + NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCapabilities; + NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCapabilities, maxXmitLinkSpeed, maxRcvLinkSpeed); + + NetAdapterSetLinkLayerCapabilities(netAdapter, &linkLayerCapabilities); + + NetAdapterSetLinkLayerMtuSize(netAdapter, WIFI_MAX_PACKET_SIZE); + + static WDI_MAC_ADDRESS STAAddress = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; + NET_ADAPTER_LINK_LAYER_ADDRESS permanentLinkLayerAddress; + NET_ADAPTER_LINK_LAYER_ADDRESS_INIT(&permanentLinkLayerAddress, sizeof(WDI_MAC_ADDRESS), STAAddress.Address); + NetAdapterSetPermanentLinkLayerAddress(netAdapter, &permanentLinkLayerAddress); + + WIFI_ADAPTER_WAKE_CAPABILITIES wakeCap{}; + WIFI_ADAPTER_WAKE_CAPABILITIES_INIT(&wakeCap); + if (WIFI_IS_FIELD_AVAILABLE(WIFI_ADAPTER_WAKE_CAPABILITIES, ClientDriverDiagnostic)) + { + wakeCap.ClientDriverDiagnostic = true; + } + WifiAdapterSetWakeCapabilities(netAdapter, &wakeCap); + + NTSTATUS status = NetAdapterStart(netAdapter); + ASSERT(STATUS_SUCCESS == status); + + TraceExit(status); + + return status; +} diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h new file mode 100644 index 00000000..33a886f0 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/adapter.h @@ -0,0 +1,21 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +#include "device.h" + +// packet and header sizes +#define WIFI_MAX_PACKET_SIZE (1514) + +// maximum link speed for send and recv in bps +#define WIFI_MEDIA_MAX_SPEED 1'000'000'000 + +// +// NetAdapter functions +// + +EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue; +EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; + +EVT_WDF_DEVICE_CONTEXT_DESTROY MbbDestroyAdapterContext; + +NTSTATUS WifiCxTestAdapterStart(_In_ NETADAPTER netAdapter); diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp new file mode 100644 index 00000000..dbd03566 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------- +// Net Adapter source file +// +// Copyright (c) Microsoft Corporation. All rights reserved. + +#include "precomp.h" + +#include "adapter.h" +#include "device.h" +#include "device.tmh" + +_Use_decl_annotations_ +NTSTATUS EvtDevicePrepareHardware(WDFDEVICE device, WDFCMRESLIST resourcesRaw, WDFCMRESLIST resourcesTranslated) +{ + UNREFERENCED_PARAMETER(resourcesRaw); + UNREFERENCED_PARAMETER(resourcesTranslated); + UNREFERENCED_PARAMETER(device); + NTSTATUS status = STATUS_SUCCESS; + + //status = WifiCxTestSetDeviceCapabilities(device); + + if (!NT_SUCCESS(status)) + { + WFCError("%!FUNC!: WifiCxTestSetDeviceCapabilities failed with %!STATUS!", status); + return status; + } + + WFCInfo("Device=0x%p", device); + return status; +} + +_Use_decl_annotations_ +NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTranslated) +{ + UNREFERENCED_PARAMETER(device); + UNREFERENCED_PARAMETER(resourcesTranslated); + + WFCInfo("Device=0x%p", device); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +void EvtDeviceSurpriseRemoval(WDFDEVICE device) +{ + UNREFERENCED_PARAMETER(device); + WFCInfo("Device=0x%p is surprise removed", device); +} + +static NTSTATUS WifiInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter) +{ + PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(Device); + PWIFI_NETADAPTER_CONTEXT netAdapterContext = WifiGetNetAdapterContext(NetAdapter); + NTSTATUS status = STATUS_SUCCESS; + + deviceContext->LastConnectEntryId = 0; // Disconnected State + deviceContext->LastConnectTransactionId = 0; + deviceContext->CurrentRadioState = TRUE; + if (deviceContext->primaryStaAdapter == WDF_NO_HANDLE) + { + deviceContext->primaryStaAdapter = NetAdapter; + } + + InitializeListHead(&netAdapterContext->ReceiveList); + netAdapterContext->WifiDeviceContext = deviceContext; + netAdapterContext->NetAdapter = NetAdapter; + return status; +} + +_Use_decl_annotations_ +NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) +{ + + //NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; + //NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks, EvtAdapterCreateTxQueue, EvtAdapterCreateRxQueue); + + //NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks); + + WDF_OBJECT_ATTRIBUTES adapterAttributes; + WDF_OBJECT_ATTRIBUTES_INIT(&adapterAttributes); + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WIFI_NETADAPTER_CONTEXT); + adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; + + NETADAPTER netAdapter; + NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: NetAdapterCreate failed, status=0x%x", ntStatus); + return ntStatus; + } + + ntStatus = WifiAdapterInitialize(netAdapter); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiAdapterInitialize failed with %!STATUS!", ntStatus); + return ntStatus; + } + + ntStatus = WifiInitAdapterContext(Device, netAdapter); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiInitAdapterContext failed with %!STATUS!", ntStatus); + return ntStatus; + } + + ntStatus = WifiCxTestAdapterStart(netAdapter); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiCxTestAdapterStart failed with %!STATUS!", ntStatus); + return ntStatus; + } + + return ntStatus; +} + +_Use_decl_annotations_ +void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) +{ + UNREFERENCED_PARAMETER(NetAdapter); + TraceEntry(); + TraceExit(STATUS_SUCCESS); +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h new file mode 100644 index 00000000..ba716fe6 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/device.h @@ -0,0 +1,11 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +EVT_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; +EVT_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; +EVT_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval; + +EVT_WIFI_DEVICE_CREATE_ADAPTER EvtWifiDeviceCreateAdapter; +EVT_WIFI_DEVICE_CREATE_WIFIDIRECTDEVICE EvtWifiDeviceCreateWifiDirectDevice; +EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; +EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtAdapterCleanup; diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp new file mode 100644 index 00000000..2b0e2658 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/driver.cpp @@ -0,0 +1,137 @@ +//------------------------------------------------------------------------------- +// Net Adapter source file +// +// Copyright (c) Microsoft Corporation. All rights reserved. + +#include "precomp.h" + +#include "device.h" +#include "driver.tmh" + +EXTERN_C __declspec(code_seg("INIT")) DRIVER_INITIALIZE DriverEntry; +EVT_WDF_DRIVER_UNLOAD EvtDriverUnload; +EVT_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; + + + +#if __cplusplus >= 201703L +#define MAYBE_UNUSED [[maybe_unused]] +#else +#define MAYBE_UNUSED +#endif + +__declspec(code_seg("INIT")) NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT driverObject, _In_ PUNICODE_STRING registryPath) +{ + NTSTATUS status = STATUS_SUCCESS; + + WPP_INIT_TRACING(driverObject, registryPath); + TraceEntry(); + + WDF_DRIVER_CONFIG driverConfig; + WDF_DRIVER_CONFIG_INIT(&driverConfig, EvtDriverDeviceAdd); + driverConfig.DriverPoolTag = WIFI_DRIVER_DEFAULT_POOL_TAG; + + driverConfig.EvtDriverUnload = EvtDriverUnload; + + WDFDRIVER driver; + status = WdfDriverCreate(driverObject, registryPath, WDF_NO_OBJECT_ATTRIBUTES, &driverConfig, &driver); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDriverCreate failed 0x%x", status); + goto Exit; + } + +Exit: + TraceExit(status); + + if (!NT_SUCCESS(status)) + { + WPP_CLEANUP(driverObject); + } + + return status; +} + +NTSTATUS EvtDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT deviceInit) +{ + UNREFERENCED_PARAMETER(driver); + + TraceEntry(); + + NTSTATUS status = STATUS_SUCCESS; + + status = NetDeviceInitConfig(deviceInit); + if (!NT_SUCCESS(status)) + { + WFCError("NetDeviceInitConfig failed, status=0x%x", status); + goto Exit; + } + + status = WifiDeviceInitConfig(deviceInit); + if (!NT_SUCCESS(status)) + { + WFCError("WifiDeviceInitConfig failed, status=0x%x", status); + goto Exit; + } + + WDF_OBJECT_ATTRIBUTES deviceAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, WIFI_DEVICE_CONTEXT); + + WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks; + WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks); + pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware; + pnpPowerCallbacks.EvtDeviceReleaseHardware = EvtDeviceReleaseHardware; + pnpPowerCallbacks.EvtDeviceSurpriseRemoval = EvtDeviceSurpriseRemoval; + + WdfDeviceInitSetPnpPowerEventCallbacks(deviceInit, &pnpPowerCallbacks); + + WDFDEVICE wdfDevice; + status = WdfDeviceCreate(&deviceInit, &deviceAttributes, &wdfDevice); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDeviceCreate failed, status=0x%x", status); + goto Exit; + } + + status = WdfDeviceCreateDeviceInterface(wdfDevice, &GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, nullptr); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDeviceCreateDeviceInterface failed with status=0x%x", status); + goto Exit; + } + + // Set the device to be not ejectable + WDF_DEVICE_PNP_CAPABILITIES pnpCapabilities; + WDF_DEVICE_PNP_CAPABILITIES_INIT(&pnpCapabilities); + pnpCapabilities.SurpriseRemovalOK = WdfTrue; + WdfDeviceSetPnpCapabilities(wdfDevice, &pnpCapabilities); + + WIFI_DEVICE_CONFIG wifiDeviceConfig; + WIFI_DEVICE_CONFIG_INIT( + &wifiDeviceConfig, WDI_VERSION_LATEST, EvtWifiDeviceSendCommand, EvtWifiDeviceCreateAdapter, nullptr); + + status = WifiDeviceInitialize(wdfDevice, &wifiDeviceConfig); + if (!NT_SUCCESS(status)) + { + WFCError("WifiDeviceInitialize failed, status=0x%x", status); + goto Exit; + } + + PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(wdfDevice); + deviceContext->WdfDevice = wdfDevice; + deviceContext->WdfTriageInfoPtr = WdfGetTriageInfo(); + + deviceContext->TlvContext.AllocationContext = 0; + deviceContext->TlvContext.PeerVersion = WifiDeviceGetOsWdiVersion(wdfDevice); + +Exit: + TraceExit(status); + return status; +} + +void EvtDriverUnload(MAYBE_UNUSED _In_ WDFDRIVER driver) +{ + TraceEntry(); + UNREFERENCED_PARAMETER(driver); + WPP_CLEANUP(WdfDriverWdmGetDriverObject(driver)); +} diff --git a/network/wlan/WIFICX/drivercode/memorymanagement.cpp b/network/wlan/WIFICX/drivercode/memorymanagement.cpp new file mode 100644 index 00000000..8c6d56d0 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/memorymanagement.cpp @@ -0,0 +1,150 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + + Microsoft Confidential + + THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + PURPOSE. + +Module Name: + + new.cpp + +Abstract: + + Test only stub WDI driver (C++ portions) + +Environment: + + Kernel mode + +Author: + + +--*/ +#include "precomp.h" + +#ifndef _KERNEL_MODE +#include // for _ReturnAddress for user mode +#endif // UM + +void* AllocateWdfMemoryBuffer(size_t Size, _In_ void* CallerForMemoryLeakTracking) +{ + size_t totalSize = 0; + if (!NT_SUCCESS(Wifi::SizeTAddSafe(Size, sizeof(WIFI_IHV_MEMORY_HEADER), &totalSize))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate total size"); + return nullptr; + } + + // allocate the context memory to store the WIFI_IHV_MEMORY_CONTEXT + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WIFI_IHV_MEMORY_CONTEXT); + WDFMEMORY wdfMemoryBufferHandle = WDF_NO_HANDLE; + void* pWdfMemoryBuffer = nullptr; + + if (!NT_SUCCESS(WdfMemoryCreate(&attributes, NonPagedPoolNx, WIFI_DRIVER_DEFAULT_POOL_TAG, totalSize, &wdfMemoryBufferHandle, &pWdfMemoryBuffer))) + { + WFCError("Failed to allocate memory buffer"); + return nullptr; + } + + RtlZeroMemory(pWdfMemoryBuffer, totalSize); + + // store the wdf memory handle in the header for FreeWdfMemoryBuffer to find the handle + WIFI_IHV_MEMORY_HEADER* pMemoryHeader = static_cast(pWdfMemoryBuffer); + pMemoryHeader->HeaderSize = sizeof(WIFI_IHV_MEMORY_HEADER); + pMemoryHeader->WdfMemoryHandle = wdfMemoryBufferHandle; + + // store the caller and caller's caller for tracking memory leaks + auto memoryContext = GetWificxIhvMemoryContextFromHandle(wdfMemoryBufferHandle); + RtlZeroMemory(memoryContext, sizeof(WIFI_IHV_MEMORY_CONTEXT)); + memoryContext->ContextSize = sizeof(WIFI_IHV_MEMORY_CONTEXT); + memoryContext->pvCaller = CallerForMemoryLeakTracking; + + // hide the wdf memory header to the caller. + const ULONG_PTR wdfMemoryWithHeaderBuffer = reinterpret_cast(pWdfMemoryBuffer); + ULONG_PTR wdfMemoryPayloadOnlyBuffer{ 0 }; + if (!NT_SUCCESS(Wifi::ULongPtrAddSafe(wdfMemoryWithHeaderBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryPayloadOnlyBuffer))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate payload buffer address"); + return nullptr; + } + + return reinterpret_cast(wdfMemoryPayloadOnlyBuffer); +} + +void FreeWdfMemoryBuffer(_In_opt_ void* pBuffer) +{ + if (pBuffer == nullptr) // existing wdi code not checking for nullptr before delete, so we have to leave it as is + { + return; + } + const ULONG_PTR wdfMemoryPayloadOnlyBuffer = reinterpret_cast(pBuffer); + ULONG_PTR wdfMemoryWithHeaderBuffer{ 0 }; + if (!NT_SUCCESS(Wifi::ULongPtrSubSafe(wdfMemoryPayloadOnlyBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryWithHeaderBuffer))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate header buffer address"); + return; + } + + const auto wificxMemoryHeader = static_cast(reinterpret_cast(wdfMemoryWithHeaderBuffer)); + + // This is memory corruption detection logic, + // keep it, don't remove it. + NT_ASSERT(wificxMemoryHeader->HeaderSize == sizeof(WIFI_IHV_MEMORY_HEADER)); + + WdfObjectDelete(wificxMemoryHeader->WdfMemoryHandle); +} + +_Ret_writes_bytes_maybenull_(_Size) void* PlacementNewHelper(size_t _Size, PCPLACEMENT_NEW_ALLOCATION_CONTEXT AllocationContext) +{ + if (_Size <= AllocationContext->cbMaxSize) + { + RtlZeroMemory(AllocationContext->pbBuffer, _Size); + return AllocationContext->pbBuffer; + } + WFCError( + "Placement operator new called with insufficient buffer space (desired: %Iu, availible: %Iu)", _Size, AllocationContext->cbMaxSize); + return nullptr; +} + +void* __cdecl operator new(size_t Size) +{ + return AllocateWdfMemoryBuffer(Size, _ReturnAddress()); +} + +__forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationContext) throw() +{ + if (AllocationContext != 0) + { + return PlacementNewHelper(_Size, (PPLACEMENT_NEW_ALLOCATION_CONTEXT)AllocationContext); + } + return AllocateWdfMemoryBuffer(_Size, _ReturnAddress()); +} + +void __cdecl operator delete(void* pData) +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete[](void* pData) +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete(void* pData, ULONG_PTR) +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete[](void* pData, ULONG_PTR) +{ + FreeWdfMemoryBuffer(pData); +} diff --git a/network/wlan/WIFICX/drivercode/precomp.h b/network/wlan/WIFICX/drivercode/precomp.h new file mode 100644 index 00000000..c08123a1 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/precomp.h @@ -0,0 +1,32 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +//#include + +#ifdef _KERNEL_MODE + #include +#else + #include + #include +#endif +// WDF Headers +#include + +// Network Device Headers +#include +#include + +// WIFI Device Headers +#include +#include "umkmfusion.h" +#include "dot11wificxintf.h" +#include "dot11wificxtypes.hpp" +#include "TLVGeneratorParser.hpp" +#include "SharedTypes.h" +// WPP Tracing Headers +#include "trace.h" + +//#include "device.h" +//#include "adapter.h" + +//#include "wifirequest.h" diff --git a/network/wlan/WIFICX/drivercode/testdata.h b/network/wlan/WIFICX/drivercode/testdata.h new file mode 100644 index 00000000..f8f83f63 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/testdata.h @@ -0,0 +1,7439 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + + Microsoft Confidential + + THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + PURPOSE. + +Module Name: + + TestData.h + +Abstract: + + Test only Network data + +Environment: + + Kernel mode + +Author: + + +--*/ + +#pragma once + +#define TESTMP_BAND_IHV 0x00000010 + +typedef struct +{ + UINT32 BandId; + WDI_MAC_ADDRESS* pMacAddress; + PUCHAR pTlvBssEntry; + UINT32 TlvBssEntrySize; + PUCHAR pTlvAssociationResult; + UINT32 TlvAssociationResultSize; + +} WdiTestConnectEntry, *PWdiTestConnectEntry; + +// +//=============================================================================== +// Set alternate local addresses based on simulation parameters +//=============================================================================== +// +UCHAR s_ArubaSimLocalAddress[] = {0xd4, 0x6a, 0x6a, 0x52, 0x18, 0x07}; // For Wpa3SuiteB - Aruba +UCHAR g_IntelSimLocalAddress[] = {0x34, 0x13, 0xe8, 0xb3, 0x14, 0x4c}; // For Wpa3SuiteB - Intel +UCHAR g_SaeSimLocalAddress[] = {0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5}; // For Wpa3Sae + +#ifdef WPA3_ARUBA_SIM +PUCHAR g_AlternateLocalAddress = s_ArubaSimLocalAddress; +#elif WPA3_INTEL_SIM +PUCHAR g_AlternateLocalAddress = g_IntelSimLocalAddress; +#elif WPA3_SAE +PUCHAR g_AlternateLocalAddress = g_SaeSimLocalAddress; +#else +PUCHAR g_AlternateLocalAddress = NULL; +#endif + +// clang-format off + +// +//=============================================================================== +// + +UCHAR s_DeviceServiceTestBlob[] = +{ + 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa +}; + +// +//=============================================================================== +// + +UCHAR s_TLV_AssociationParametersRequestedType[] = +{ + // WDI_TLV_ASSOCIATION_PARAMETERS_REQUESTED_TYPE + 0xBB, 0x00, + 0x02, 0x00, + 0x9F, 0x00 // PMKID +}; + +UCHAR s_TLV_RoamingNeededIndication[] = +{ + // WDI_TLV_ROAMING_NEEDED_PARAMETERS + 0x55, 0x00, + 0x04, 0x00, + 0x0a, 0x00, 0x00, 0x00 +}; + +UCHAR s_TLV_NeighborReport[] = +{ + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ACTION_FRAME_BODY + 0xBE, 0x00, + 0x14, 0x00, + 0x05, // Category = Radio Measurement + 0x05, // Action = Neighbor Report Response + 0x01, // Dialog Token + 0x34, // Element ID = Neighbor Report + 0x0F, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, // BSSID + 0x00, 0x00, 0x00, 0x00, // BSSID Information + 0x00, // Operating class + 0x06, // Channel Number + 0x00, // PHY Type + 0x00, 0x00, // Optional IEs +}; + +// +//=============================================================================== +// + +// +//=============================================================================== +// BSs entries +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr = {0x00, 0x20, 0x30, 0x40, 0x50, 0x60}; + +UCHAR s_TLV_BSS_Entry_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + + +UCHAR s_TLV_OpenDisassociation[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + 0x01, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + 0x00 +}; + +WDI_MAC_ADDRESS s_Connect_Addr_2_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2}; + +UCHAR s_TLV_BSS_Entry_2_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x59, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x26, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x28, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID + +}; + +UCHAR s_TLV_Success_AssociationResult_2_Open[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x25, 0x00, + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_3_WEP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3}; + +UCHAR s_TLV_BSS_Entry_3_WEP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x03, 0x01, 0x01, // DSSS Parameter (Offset: 42) + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality (Offset: 57) + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel (Offset: 64) + 0x01, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_3_WEP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_4_RSNA_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4}; + +#define WFA_TEST_MIN_RSN_IE 1 + +UCHAR s_TLV_BSS_Entry_4_RSNA_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef WFA_TEST_MIN_RSN_IE + 0x79, 0x00, //Len +#else + 0x8B, 0x00, //Len +#endif // WFA_TEST_MIN_RSN_IE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef WFA_TEST_MIN_RSN_IE + 0x46, 0x00, +#else + 0x58, 0x00, +#endif // WFA_TEST_MIN_RSN_IE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved +#ifdef WFA_TEST_MIN_RSN_IE + 0x30, 0x02, + 0x01, 0x00, +#else + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite -- RSNA_PSK + 0x00, 0x00, // RSN Capability +#endif // WFA_TEST_MIN_RSN_IE + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_4_RSNA_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x22, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x58, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_5_IHV = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5}; + +UCHAR s_TLV_BSS_Entry_5_IHV [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x03, 0x01, 0x01, // DSSS Parameter + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel = 36 + 0x08, 0x00, 0x00, 0x00, // Band ID = Custom +// 0x02, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_5_IHV[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x02, 0x00, 0x00, 0x80, //AuthAlgorithm = Custom + 0x01, 0x00, 0x00, 0x80, //UnicastCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastDataCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x80, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x24, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x02, 0x00, 0x00, 0x80, // Phy = IHV Phy 2 + +}; + + +UCHAR s_TLV_IhvRequestComplete[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x0A, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0x00, 0x00, 0x01 +}; + + +UCHAR s_TLV_IhvIndication[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x30, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5 +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_6_FT_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6}; + +UCHAR s_TLV_BSS_Entry_6_FT_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xEA, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB7, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_6_FT_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x06, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x3E, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xC5, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x37, 0x69, // FTE IE + 0x00, 0x00, // MIC Control - 0 => no MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0xB4, 0xC7, 0x99, 0x8A, 0xB6, 0x30, + 0x03, 0x0D, // R0KH-ID + 'a', 'p', '8', '1', '3', '2', '-', '7', '3', '4', 'E', 'B', '0', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xB7, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_7_FT_PSK_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7}; + +UCHAR s_TLV_BSS_Entry_7_FT_PSK_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xED, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xBA, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_7_FT_PSK_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x41, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, + 0xAC, 0x01, 0x00, 0x00, + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xBF, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite -- FT-PSK + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x37, 0x63, // FTE IE + 0x00, 0x02, // MIC Control + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + 0x03, 0x07, // R0KH-ID + 'x', '@', 'y', '.', 'c', 'o', 'm', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xBA, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_8_Hidden = {0x00, 0xA0, 0xB0, 0xC0, 0xD0,0xE8}; + +UCHAR s_TLV_BSS_Entry_Beacon_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x24, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x00, // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_BSS_Entry_ProbeResponse_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x5a, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + + +UCHAR s_TLV_Success_AssociationResult_8_Hidden[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// +// 11ad +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_9_11ad_PSK = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_9_11ad_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_10_11ad_1x = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_10_11ad_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_10_11ad_Dmg_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_11_11ad_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x05, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Dmg_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== +// +// 11ax +// +//=============================================================================== + +// +// Open on 2.4 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_12_11ax_24_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC}; + + +UCHAR s_TLV_BSS_Entry_12_11ax_24_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x78, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x4A, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_12_11ax_24_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4E, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x43, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== + +// +// Open on 5 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_13_11ax_5_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED}; + + +UCHAR s_TLV_BSS_Entry_13_11ax_5_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x76, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x48, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel 36 + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_13_11ax_5_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4C, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x24, 0x30, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +// #define SAE_MIXED_MODE 1 + +WDI_MAC_ADDRESS s_Connect_Addr_14_WPA3_SAE_CCMP = { 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32 }; + +UCHAR s_TLV_BSS_Entry_14_WPA3_SAE_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef SAE_MIXED_MODE + 0x91, 0x00, //Len +#else + 0x8D, 0x00, //Len +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Capability - no MFPR or MFPC +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, +#ifdef SAE_MIXED_MODE + 0x2A, 0x01, +#else + 0x26, 0x01, +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4A, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AMK Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Multicast Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Cap = MFP-Capable +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Cap = MFP-Capable + MFP required +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +// +// SAE-Specific definitions :: Start +// +DWORD g_dwSaeResendConfirmRequested = 0; + +UCHAR pucSAECommitResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + 0x93, 0x48, 0x89, 0xab, 0x38, 0x6b, 0x72, 0xd5, 0xff, 0x0d, 0x3c, 0xaa, 0x09, 0x56, 0x50, 0x20, + 0x2b, 0xd0, 0x3e, 0x26, 0x96, 0xb5, 0x90, 0x5f, 0x7b, 0x49, 0x5f, 0x3b, 0x7d, 0xc3, 0x5b, 0x48, + + // [14] AP Element + 0x58, 0x54, 0x5e, 0x6c, 0xa0, 0xe8, 0x86, 0xef, 0xfb, 0x05, 0x2a, 0xfb, 0x63, 0x2c, 0xa2, 0x19, + 0x5b, 0xb0, 0xb0, 0xa8, 0x25, 0xe5, 0x9d, 0xba, 0x6b, 0xaa, 0x0e, 0x93, 0xaf, 0x04, 0x6e, 0xf4, + 0xc9, 0x45, 0x5f, 0xec, 0x43, 0xfe, 0x5e, 0xb0, 0x2a, 0x6b, 0x8a, 0xbc, 0x8f, 0xd7, 0x07, 0x87, + 0x87, 0x3d, 0xd1, 0xd5, 0xd7, 0xfd, 0xe3, 0x07, 0x3a, 0x4c, 0xf3, 0xc2, 0xc7, 0x6f, 0x59, 0x5c, + }; +UCHAR pucSAECommitResponseReflection [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + + 0x49, 0x5c, 0x2c, 0xb4, 0x20, 0xec, 0xc9, 0xe8, 0xe8, 0x03, 0x2d, 0x00, 0x8d, 0xab, 0x4d, 0x91, + 0x70, 0x16, 0x06, 0x28, 0x40, 0x83, 0xb9, 0x8d, 0x19, 0xc6, 0x43, 0xcb, 0x63, 0x29, 0x9f, 0x03, + + // [14] AP Element + 0x13, 0x2e, 0xfc, 0x90, 0xb9, 0xd7, 0xb5, 0xc1, 0x2a, 0x1d, 0xe9, 0x05, 0x9c, 0xb3, 0xba, 0xc8, + 0xa6, 0x93, 0xff, 0xbf, 0x23, 0x02, 0x42, 0x3e, 0x58, 0xc2, 0x0d, 0x00, 0x10, 0xe8, 0x44, 0x60, + 0x9d, 0xfc, 0x34, 0x5e, 0x98, 0x8e, 0xf2, 0x12, 0x67, 0x24, 0xd0, 0x80, 0xfb, 0x2f, 0x1e, 0x7a, + 0xe6, 0x54, 0x01, 0x00, 0x50, 0xd4, 0xfe, 0x66, 0x47, 0x62, 0xc0, 0x3c, 0x9f, 0x7a, 0x10, 0x27, + }; + +UCHAR pucSAEConfirmResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x02, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (DOT11_FRAME_STATUS_ANTI_CLOGGING_TOKEN_REQUIRED) (not-Element, 2 octets) + 0x00, 0x00, // [12] SendConfirm (not-IE, 2 octets) + // [15] Confirm + 0xc7, 0xd1, 0x04, 0x94, 0x29, 0xec, 0xdf, 0x25, 0xda, 0xaa, 0x79, 0x6f, 0xda, 0xe9, 0x91, 0x9f, + 0x4b, 0x83, 0xad, 0xa3, 0x08, 0xde, 0x62, 0xca, 0xcd, 0x59, 0xfc, 0xf5, 0xc5, 0x4d, 0xeb, 0xd9, + }; + +UCHAR pucM1SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control: Version = 0x0, Type = DOT11_FRAME_TYPE_DATA, Subtype = DOT11_DATA_SUBTYPE_DATA + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Address1: Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address2: Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address3: Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype = DOT11_ETH_TYPE_EAPOL + // NWF_EAPOL_HEADER + 0x02, // Version = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 OR NWF_EAPOL_PROTOCOL_VERSION_V2 = 2 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x00, 0x8a, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // MIC + 0x00, 0x16, // Key length + 0xdd, 0x14, // KeyData -> DOT11_INFO_ELEMENT_ID_VENDOR_SPECIFIC + Len + 0x00, 0x0f, 0xac, 0x04, // OUI -> RSN_KEY_DATA_OUI + RSN_KEY_DATA_OUI_TYPE_PMKID -> {0x00,0x0F,0xAC} + {0x04) + 0x37, 0xfb, 0x9a, 0x24, 0xc1, 0x57, 0x8c, 0xce, 0xc3, 0x60, 0x6c, 0x6f, 0x39, 0xe0, 0xb7, 0x02, // PMKID +}; + + +UCHAR pucExpectedM2SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version = bProtocolVersion = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type = bKeyDesc = NWF_EAPOL_KEY_DESC_RSNA = 2 + 0x01, 0x0a, // Info = usKeyInfo, ResponseKeyInfo.Version = KEY_DESC_VERSION_AES, Type=RSN_KEY_TYPE_PAIRWISE, MIC=1, Secure=0 + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x80, 0xf8, 0x10, 0x83, 0x4f, 0x0f, 0x40, 0xa1, 0xe5, 0x5d, 0x51, 0x92, 0x83, 0x4f, 0x8e, 0x98, // Nonce + 0x09, 0xca, 0xd5, 0x14, 0xc6, 0x08, 0x4c, 0xa9, 0xed, 0xc3, 0xa8, 0xff, 0xce, 0xc9, 0x36, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa1, 0x79, 0x5f, 0x05, 0xa4, 0x12, 0x84, 0xf2, 0xf9, 0x0c, 0x79, 0x88, 0xeb, 0x92, 0x71, 0x62, // MIC + 0x00, 0x16, // Key Length + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, // Key Data = RSN + 0x00, 0x0f, 0xac, 0x08, 0x80, 0x00 + +}; + +UCHAR pucM3SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x02, // Version + 0x03, // Type + 0x00, 0x97, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x13, 0xca, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa5, 0xea, 0xdc, 0xfd, 0x97, 0xc7, 0x72, 0x76, 0x24, 0xe2, 0x7e, 0x71, 0x45, 0x3a, 0x24, 0xca, // MIC + 0x00, 0x38, // Key Length + 0x6f, 0x39, 0x30, 0x2c, 0x46, 0xb4, 0x3c, 0xf8, 0x42, 0x07, 0x8e, 0xc9, 0x65, 0x05, 0x2c, 0xd0, // Encrypted Key data + 0xe1, 0x7b, 0xdd, 0x2e, 0xbd, 0x69, 0x09, 0x1e, 0x39, 0xcc, 0x1a, 0xb3, 0x6e, 0x55, 0xd1, 0xad, + 0x5c, 0x45, 0x52, 0x4b, 0x83, 0x5d, 0x39, 0xe3, 0x1c, 0xb6, 0xed, 0x35, 0x52, 0x76, 0xb1, 0xc6, + 0x5a, 0x2c, 0x96, 0x07, 0x77, 0x15, 0x15, 0x5c, +}; + + +UCHAR pucExpectedM4SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x10, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version + 0x03, // Type + 0x00, 0x5f, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x03, 0x0a, // Info + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Nonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x52, 0x97, 0x0f, 0x90, 0x69, 0x7d, 0xcd, 0xeb, 0x98, 0xbf, 0xb1, 0x2a, 0xb2, 0x3e, 0xcc, 0x49, // MIC + 0x00, 0x00, // Key Length +}; + +// +// SAE-Specific definitions :: End +// + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_15_WPA2PSK_SHA256 = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF}; + +UCHAR s_TLV_BSS_Entry_15_WPA2PSK_SHA256 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x91, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'H', 'A', '2', '5', '6', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x06, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x06, // AMK Suite - WPA2PSK_SHA256 + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +#ifdef WPA3_ARUBA_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5}; // For Aruba +#elif WPA3_INTEL_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a}; // For Intel +#else +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0}; +#endif + +UCHAR s_TLV_BSS_Entry_16_WPA3_SUITEB [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x97, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_16_WPA3_SUITEB[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x3A, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_ENT_192 = 8 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x54, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// +// 6 GHz +// +//=============================================================================== + +// +// RNR IE has the following format (only care about TBTT length = 8 or 12): +// 0xc9, 0x +// 0x -> 2 bytes (contains number and size of each element) +// 0x, 0x -> 2 bytes (applies to all element in this list) +// 0x -> 1 byte +// 0x -> 6 bytes +// [0x] -> 4 bytes +// 0x -> 1 byte +// + +// +// Mac addresses have the following nomenclature for 6GHz Ssids +// +// 1st 3 bytes are 0x00 0xA1, 0xB0 +// 4th byte is for SSID: +// 01 = 6E__1 +// 02 = 6E__2 +// 03 = SSID3 +// 04 = SSID4 +// 5th Byte is for band: +// 02 = 2.4 GHz +// 05 = 5 GHz +// 06 = 6 GHz +// 6th byte is instance +// 01 = 1st instance +// 02 - 2nd instance +// : +// + +//=============================================================================== +// SIX_G: 6E__1: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (2 * 6 GHz) +// 2.4 GHz: +// S1_24_1: S1_5_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 5 GHz: +// S1_5_1: S1_24_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 6 GHz: +// S1_6_1: S1_24_1 (In) + S1_5_1 (In) +// S1_6_2: S1_24_1 (In) + S1_5_1 (In) +//=============================================================================== + +// +// 6E__1: 1 * 2.4 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [5:36 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_17_6G_S1_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xE9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel / Freq = 2412 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x01, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1 * 5 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [2.4:1 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_18_6G_S1_5_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_18_6G_S1_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel / Freq = 36 / 5180 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x24, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_19_6G_S1a_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_19_6G_S1a_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x65, 0x00, 0x00, 0x00, // Channel / Freq = 101 / 6445 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xfD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x65, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x65, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 2/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_20_6G_S1b_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02}; +UCHAR s_TLV_BSS_Entry_20_6G_S1b_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x85, 0x00, 0x00, 0x00, // Channel / Freq = 133 / 6605 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x85, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: 6E__2: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (1 * 6 GHz) +// 2.4 GHz: +// S2_24_1: S2_5_1 (In+Out) + [S2_6_2 (Out)] +// 5 GHz: +// S2_5_1: S2_24_1 (In+Out) + S2_6_1 (Out) + [S2_6_2 (Out)] +// 6 GHz: +// S2_6_1: S2_5_1 (In) +//=============================================================================== + +// +// 6E__2: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each: Band:Channel = [5:44] + [6:101] +// +WDI_MAC_ADDRESS s_Connect_Addr_21_6G_S2_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x24, 0x01}; +UCHAR s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xD3, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xA0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel / Freq = 2437 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xF5, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x06, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 5 GHz Bss's +// 3 RNR IEs with 1 entry each: Band:Channel = [2.4:6] + [6:101] + [6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_22_6G_S2_5_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_22_6G_S2_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xed, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x2c, 0x00, 0x00, 0x00, // Channel / Freq = 44 / 5220 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x2c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_23_6G_S2_6_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_23_6G_S2_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x79, 0x00, 0x00, 0x00, // Channel / Freq = 121 / 6545 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x79, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: SSID3: +// (1 * 2.4 GHz) +// 2.4 GHz: +// S3_24_1: *S2_5_1 (Out)* +//=============================================================================== + +// +// SSID3: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each Band:Channel = [5:44 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_24_6G_S3_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xDB, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel / Freq = 2457 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x0a, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// SIX_G: SSID4 (non-colocated AP): +// (1 * 6 GHz) +// 6 GHz: +// S4_6_1: +//=============================================================================== + +// +// SSID4: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_25_6G_S4_6_Ghz = {0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_25_6G_S4_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0xe5, 0x00, 0x00, 0x00, // Channel / Freq = 229 / 7085 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0xe5, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// WDI_OWE_RNR +//=============================================================================== + + +/// WDI_OWE_RNR +/// +/// Description +/// - Non-Transition mode OWE network +/// - Advertises Reduced Neighbor Reports (RNRs) for the OWE Transition Mode BSSes WDI_OWE_TM_OWE and WDI_OWE_TM_OPEN +/// - Note: The OWE TM BSSes do not advertise RNR IEs +/// - Definitions for these two Transition Mode networks follows this one +/// +/// Intention +/// - Test Non-Transition Mode OWE networks +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving beacon or probe +/// - Since the networks are indicated in order during scans (i.e. the OWE TM networks will be indicated after this one) +/// it is expected that RNR for the OWE TM networks will be received before their beacons and probes. +/// +/// Expectation +/// - Scan results display WDI_OWE_RNR as an Enhanced Open network to which connections are supported +/// - The RNR will not effect connections to or display of OWE Transition Mode networks that it contains +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_26_OWE_With_RNR = {00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF}; +UCHAR s_TLV_BSS_Entry_26_OWE_With_RNR [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xB6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x83, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0B, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'R', 'N', 'R', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // MAC Address --> OWE Transition Mode OWE (Defined below) + 0xFD, 0x1F, 0x3F, 0x49, // Short SSID for WDI_OWE_TM_OWE + 0x00, // BssParameters + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // MAC Address --> OWE Transition Mode Open (Defined below) + 0x21, 0x24, 0x6C, 0x85, // Short SSID for WDI_OWE_TM_OPEN + 0x00, // BssParameters + + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_26_OWE_With_RNR [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, // Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OWE +/// Description +/// - OWE BSS of OWE Transition Mode network +/// - Auth Type is OWE +/// - Partner BSS is the OWE Transition Mode Open BSS "WDI_OWE_TM_OPEN" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of the OWE TM OWE BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: "WDI_OWE_TM_OPEN" +/// - Authentication: OWE +/// - Encryption: CCMP +/// - MFP Required: 1 +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_27_OWE_TM_OWE = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00}; +UCHAR s_TLV_BSS_Entry_27_OWE_TM_OWE [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xA1, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x6e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x1A, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // Partner BSS BSSID + 0x0F, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented simulated OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_27_OWE_TM_OWE [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OPEN +/// Description +/// - Open BSS of OWE Transition Mode network +/// - Open network +/// - Partner BSS is the OWE Transition Mode OWE BSS "WDI_OWE_TM_OWE" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of this BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: (Hidden) +/// - Authentication: Open +/// - Encryption: None +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_28_OWE_TM_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01}; +UCHAR s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x95, 0x00, // Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x62, 0x00, // Length + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x19, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // Partner BSS BSSID + 0x0E, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'W', 'E', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_28_OWE_TM_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +//=============================================================================== +// +// Wi-Fi 7 +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_29_WiFi7_Mixed_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02}; +WDI_MAC_ADDRESS s_Connect_Addr_30_WiFi7_Mixed_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03}; +WDI_MAC_ADDRESS s_Connect_Addr_31_WiFi7_Mixed_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04}; +WDI_MAC_ADDRESS s_Connect_Addr_32_WiFi7_Mixed_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05}; + +UCHAR s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xfa, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // Link 1 MAC address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xc7, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x32, 0x01, // DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0xFB, // BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xc0, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7e, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x9b, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x01, + 0xFB, // H2E Only + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : MAC address + // STA Profile + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_33_WiFi7_Open_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06}; +WDI_MAC_ADDRESS s_Connect_Addr_34_WiFi7_Open_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07}; +WDI_MAC_ADDRESS s_Connect_Addr_35_WiFi7_Open_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08}; +WDI_MAC_ADDRESS s_Connect_Addr_36_WiFi7_Open_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09}; + +UCHAR s_TLV_BSS_Entry_34_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_37_WiFi7_Only_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a}; +WDI_MAC_ADDRESS s_Connect_Addr_38_WiFi7_Only_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b}; +WDI_MAC_ADDRESS s_Connect_Addr_39_WiFi7_Only_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c}; +WDI_MAC_ADDRESS s_Connect_Addr_40_WiFi7_Only_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d}; + +UCHAR s_TLV_BSS_Entry_38_WiFi7_Only_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe8, 0x00, //Len + + // WDI_TLV_BSSID = 10 = 0xa + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // Link 1 MAC address + + // WDI_TLV_BEACON_FRAME = 143 = 0x8f + 0x0a, 0x00, + 0xb5, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x01, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xaf, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7f, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x89, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : MAC address + // STA Profile + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== +// DualSta networks +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_41_DualSta_5Ghz = {0x00, 0x51, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_41_DualSta_5Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +// ----- + +WDI_MAC_ADDRESS s_Connect_Addr_42_DualSta_6Ghz = {0x00, 0x52, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_42_DualSta_6Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x09, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +//=============================================================================== + +// clang-format on diff --git a/network/wlan/WIFICX/drivercode/trace.h b/network/wlan/WIFICX/drivercode/trace.h new file mode 100644 index 00000000..7bbda1fa --- /dev/null +++ b/network/wlan/WIFICX/drivercode/trace.h @@ -0,0 +1,247 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// +#pragma once +#ifndef TRACE_H +#define TRACE_H + +//extern "C" +//{ +//#include +//} +#define WPP_USE_TRACE_LEVELS + +// 21BA7B61-05F8-41F1-9048-C09493DCFE38 +#define WPP_CONTROL_GUIDS \ + WPP_DEFINE_CONTROL_GUID(WdiLibraryCtlGuid, (21BA7B61, 05F8, 41F1, 9048, C09493DCFE38), WPP_DEFINE_BIT(DUMMY)) + +#define WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags) WPP_CONTROL(WPP_BIT_##flags).AutoLogContext, lvl, WPP_BIT_##flags +#define WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags) \ + (WPP_LEVEL_ENABLED(lvl) || lvl < TRACE_LEVEL_VERBOSE || WPP_CONTROL(WPP_BIT_##flags).AutoLogVerboseEnabled) + +#define WPP_RECORDER_LEVEL_ARGS(LEVEL) WPP_RECORDER_LEVEL_FLAGS_ARGS(LEVEL, DUMMY) +#define WPP_RECORDER_LEVEL_FILTER(LEVEL) WPP_RECORDER_LEVEL_FLAGS_FILTER(LEVEL, DUMMY) + +#define WPP_RECORDER_LEVEL_EXP_FILTER(LEVEL, EXP) WPP_RECORDER_LEVEL_FILTER(LEVEL) +#define WPP_RECORDER_LEVEL_EXP_ARGS(LEVEL, EXP) WPP_RECORDER_LEVEL_ARGS(LEVEL) + +// Suppress warnings about constants in logical expressions because the +// level is often a constant +#define WPP_LEVEL_PRE(LEVEL) __pragma(warning(suppress : 25039 25040)) +#define WPP_LEVEL_EXP_PRE(LEVEL, EXP) __pragma(warning(suppress : 25039 25040)) + +#define TraceEntry(...) +#define TraceExit(Status) +#define WFCTrace(Format, ...) +#define WFCError(Format, ...) +#define WFCInfo(Format, ...) + + +// begin_wpp config +// USEPREFIX (TraceEntry, "%!STDPREFIX!"); +// FUNC TraceEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); +// USESUFFIX (TraceEntry, "--> %!FUNC!"); +// end_wpp + +// begin_wpp config +// USEPREFIX (TraceExit, "%!STDPREFIX!"); +// FUNC TraceExit{LEVEL=TRACE_LEVEL_VERBOSE}(EXP); +// USESUFFIX (TraceExit, "<-- %!FUNC!: 0x%x", EXP); +// end_wpp + +// +// Flat-C trace commands +// +// begin_wpp config +// +// USEPREFIX (WFCError, "%!STDPREFIX! %!FUNC!: [ERROR]"); +// FUNC WFCError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCInfo, "%!STDPREFIX! %!FUNC!: [INFO]"); +// FUNC WFCInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); +// +// USEPREFIX (WFCTrace, "%!STDPREFIX! %!FUNC!: [TRACE]"); +// FUNC WFCTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); +// +// end_wpp +// + +// +// C++ with Activity ID function entry/exit commands +// +// begin_wpp config +// +// USEPREFIX (TraceActEntry, "%!STDPREFIX! [O:%p][A:%x]", this, this->get_ActivityId()); +// FUNC TraceActEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); +// USESUFFIX (TraceActEntry, "--> %!FUNC!"); +// +// USEPREFIX (TraceActExit, "%!STDPREFIX! [O:%p][A:%x]", this, this->get_ActivityId()); +// FUNC TraceActExit{LEVEL=TRACE_LEVEL_VERBOSE}(EXP); +// USESUFFIX (TraceActExit, "<-- %!FUNC!: 0x%x", EXP); +// +// end_wpp +// + +// +// C++ with Activity ID trace commands +// +// begin_wpp config +// +// USEPREFIX (WFCActError, "%!STDPREFIX! [O:%p][A:%x][ERROR]", this, this->get_ActivityId()); +// FUNC WFCActError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCActErrorStatus, "%!STDPREFIX! [O:%p][A:%x][ERROR=%x]", this, this->get_ActivityId(), status); +// FUNC WFCActErrorStatus{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCActInfo, "%!STDPREFIX! [O:%p][A:%x][INFO]", this, this->get_ActivityId()); +// FUNC WFCActInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); +// +// USEPREFIX (WFCActTrace, "%!STDPREFIX! [O:%p][A:%x][TRACE]", this, this->get_ActivityId()); +// FUNC WFCActTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); +// +// end_wpp +// + +// +// C++ with Port ID trace commands +// +// begin_wpp config +// +// USEPREFIX (WFCPortError, "%!STDPREFIX! [O:%p][P:%x][ERROR]", this, this->GetPortId()); +// FUNC WFCPortError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCPortErrorStatus, "%!STDPREFIX! [O:%p][P:%x][ERROR=%x]", this, this->GetPortId(), status); +// FUNC WFCPortErrorStatus{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCPortInfo, "%!STDPREFIX! [O:%p][P:%x][INFO]", this, this->GetPortId()); +// FUNC WFCPortInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); +// +// USEPREFIX (WFCPortTrace, "%!STDPREFIX! [O:%p][P:%x][TRACE]", this, this->GetPortId()); +// FUNC WFCPortTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); +// +// end_wpp +// + +#define MACRO_START \ + do \ + { +#define MACRO_END \ + } \ + while (0) + +// +// WPP Macros: WX_RETURN_IF_NOT_NT_SUCCESS_MSG +// +// begin_wpp config +// FUNC WX_RETURN_IF_NOT_NT_SUCCESS_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(NTEXPR,MSG,...); +// USEPREFIX (WX_RETURN_IF_NOT_NT_SUCCESS_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); +// USESUFFIX (WX_RETURN_IF_NOT_NT_SUCCESS_MSG, " [status=%!STATUS!]", nt__wpp); +// end_wpp + +#define WPP_COMPNAME_LEVEL_NTEXPR_PRE(comp, level, ntexpr) \ + MACRO_START NTSTATUS nt__wpp = (ntexpr); \ + if (!NT_SUCCESS(nt__wpp)) \ + { +#define WPP_COMPNAME_LEVEL_NTEXPR_POST(comp, level, ntexpr) \ + ; \ + return nt__wpp; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_FILTER(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_ARGS(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +// +// WPP Macros: WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG +// +// begin_wpp config +// FUNC WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR2,MSG,...); +// USEPREFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); +// USESUFFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!s! is null", #PTR2); +// end_wpp + +#define WPP_COMPNAME_LEVEL_PTR2_PRE(comp, level, ptr) \ + MACRO_START if ((ptr == nullptr)) \ + { +#define WPP_COMPNAME_LEVEL_PTR2_POST(comp, level, ptr) \ + ; \ + return STATUS_INSUFFICIENT_RESOURCES; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +// +// WPP Macros: WX_RETURN_IF_NULL_MSG +// +// begin_wpp config +// FUNC WX_RETURN_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR3,MSG,...); +// USEPREFIX (WX_RETURN_IF_NULL_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); +// USESUFFIX (WX_RETURN_IF_NULL_MSG, "%!s! is null", #PTR3); +// end_wpp + +#define WPP_COMPNAME_LEVEL_PTR3_PRE(comp, level, ptr) \ + MACRO_START if ((ptr == nullptr)) \ + { +#define WPP_COMPNAME_LEVEL_PTR3_POST(comp, level, ptr) \ + ; \ + return; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +typedef struct _ByteArray +{ + USHORT usLength; + const void* pvBuffer; +} ByteArray; + +__inline ByteArray log_lenstr(ULONG len, const void* buf) +{ + ByteArray xs = {0}; + xs.usLength = (USHORT)len; + xs.pvBuffer = buf; + return xs; +} + +#define WPP_LOGHEXDUMP(x) \ + WPP_LOGPAIR(2, &((x).usLength)) \ + WPP_LOGPAIR((x).usLength, (x).pvBuffer) + +#define WPP_LOGANSISTRING(x) \ + WPP_LOGPAIR(2, &((x).usLength)) \ + WPP_LOGPAIR((x).usLength, (x).pvBuffer) + +#define WPP_LOGMACADDR(x) WPP_LOGPAIR(6, x) + +#define WPP_LOGDOT11SSID(x) \ + WPP_LOGPAIR(2, &((*(x)).uSSIDLength)) \ + WPP_LOGPAIR((*(x)).uSSIDLength, ((const char*)(*(x)).ucSSID)) + +// +// Custom types +// +// begin_wpp config +// +// DEFINE_CPLX_TYPE(HEXDUMP, WPP_LOGHEXDUMP, ByteArray, ItemHEXDump,"s", _HEX_, 0,2); +// WPP_FLAGS(-DLOG_HEXDUMP(len,str)=log_lenstr(len,str)); +// +// DEFINE_CPLX_TYPE(ANSISTRING, WPP_LOGANSISTRING, ByteArray, ItemPString,"s", _SSID_, 0,2); +// WPP_FLAGS(-DLOG_ANSISTRING(len,str)=log_lenstr(len,str)); +// +// DEFINE_CPLX_TYPE(DOT11SSID, WPP_LOGDOT11SSID, DOT11_SSID*, ItemPString,"s", _SSID_, 0,2); +// +// DEFINE_CPLX_TYPE(MACADDR, WPP_LOGMACADDR, DOT11_MAC_ADDRESS, ItemMACAddr,"s", _MAC_, 0); +// +// CUSTOM_TYPE(WFC_RX_PEER_STATE, ItemEnum(_WFC_RX_PEER_STATE)); +// +// CUSTOM_TYPE(MESSAGE_ID, ItemEnum(WDI_TLV::ENUMS::MESSAGE_ID)); +// CUSTOM_TYPE(WFC_PORT_PROPERTY_NAME, ItemEnum(WFC_PORT_PROPERTY_NAME)); +// CUSTOM_TYPE(DisconnectInDxReason, ItemEnum(CSetPowerJob::DisconnectInDxReason)); +// CUSTOM_TYPE(WFC_JOB_TYPE, ItemEnum(_WFC_JOB_TYPE)); +// CUSTOM_TYPE(ConfigurableActionFrameWakePatterns, ItemEnum(ConfigurableActionFrameWakePatterns)); +// CUSTOM_TYPE(WFC_PORT_TYPE, ItemEnum(_WFC_PORT_TYPE)); +// end_wpp +// + +#endif diff --git a/network/wlan/WIFICX/drivercode/umkmfusion.h b/network/wlan/WIFICX/drivercode/umkmfusion.h new file mode 100644 index 00000000..cc74cd83 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/umkmfusion.h @@ -0,0 +1,89 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "precomp.h" + +#include "winerror.h" + +#ifdef _KERNEL_MODE +#include "ntintsafe.h" +#else +#include "intsafe.h" +#endif + +namespace Wifi +{ + _inline + NTSTATUS ConvertHRESULTToNTSTATUS(HRESULT hr) { + if ((hr & FACILITY_NT_BIT) == FACILITY_NT_BIT) { + return static_cast(hr & ~FACILITY_NT_BIT); // Strip NT bit safely + } + + // Trace the HRESULT value for diagnostics + + + return SUCCEEDED(hr) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + } + + _Must_inspect_result_ + _inline + NTSTATUS SizeTAddSafe(_In_ size_t Augend, _In_ size_t Addend, _Out_ _Deref_out_range_(== , Augend + Addend) size_t* pResult) + { +#ifdef _KERNEL_MODE + return RtlSizeTAdd(Augend, Addend, pResult); +#else + return ConvertHRESULTToNTSTATUS(SizeTAdd(Augend, Addend, pResult)); +#endif + } + + _Must_inspect_result_ + __inline + NTSTATUS ULongPtrAddSafe( + _In_ ULONGLONG ullAugend, + _In_ ULONGLONG ullAddend, + _Out_ _Deref_out_range_(== , ullAugend + ullAddend) ULONGLONG* pullResult) + { +#ifdef _KERNEL_MODE + return RtlULongPtrAdd(ullAugend, ullAddend, pullResult); +#else + return ConvertHRESULTToNTSTATUS(ULongPtrAdd(ullAugend, ullAddend, pullResult)); +#endif + } + + _Must_inspect_result_ + __inline + NTSTATUS ULongPtrSubSafe( + _In_ ULONGLONG ullMinuend, + _In_ ULONGLONG ullSubtrahend, + _Out_ _Deref_out_range_(== , ullMinuend - ullSubtrahend) ULONGLONG* pullResult) + { +#ifdef _KERNEL_MODE + return RtlULongPtrSub(ullMinuend, ullSubtrahend, pullResult); +#else + return ConvertHRESULTToNTSTATUS(ULongPtrSub(ullMinuend, ullSubtrahend, pullResult)); +#endif + } +} + +#ifndef _KERNEL_MODE +// TODO: Cleanup when EWDK contains the payload of https://microsoft.visualstudio.com/OS/_workitems/edit/58447986 +typedef enum _NDIS_FRAME_HEADER +{ + NdisFrameHeaderUndefined, + NdisFrameHeaderMac, + NdisFrameHeaderArp, + NdisFrameHeaderIPv4, + NdisFrameHeaderIPv6, + NdisFrameHeaderUdp, + NdisFrameHeaderMaximum +}NDIS_FRAME_HEADER, * PNDIS_FRAME_HEADER; + +typedef enum _NDIS_RECEIVE_FILTER_TEST +{ + NdisReceiveFilterTestUndefined, + NdisReceiveFilterTestEqual, + NdisReceiveFilterTestMaskEqual, + NdisReceiveFilterTestNotEqual, + NdisReceiveFilterTestMaximum +}NDIS_RECEIVE_FILTER_TEST, * PNDIS_RECEIVE_FILTER_TEST; +// End of TODO +#endif // !_KERNEL_MODE \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifirequest.cpp b/network/wlan/WIFICX/drivercode/wifirequest.cpp new file mode 100644 index 00000000..06703795 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifirequest.cpp @@ -0,0 +1,1521 @@ +//------------------------------------------------------------------------------- +// Net Adapter source file +// +// Copyright (c) Microsoft Corporation. All rights reserved. + +#include "precomp.h" +#include "testdata.h" +#include +#include "wifirequest.h" +#include "wifirequest.tmh" + +// clang-format off + + +WdiTestConnectEntry g_ConnectEntries[] = +{ + // 0 + { // 0th Entry is disconnected state + 0, + nullptr, + nullptr, 0, + nullptr, 0, + }, + + // 1 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr, + s_TLV_BSS_Entry_1, sizeof(s_TLV_BSS_Entry_1), + s_TLV_SuccessOpenAssociationResult, sizeof(s_TLV_SuccessOpenAssociationResult), + }, + + // 2 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr_2_Open, + s_TLV_BSS_Entry_2_Open, sizeof(s_TLV_BSS_Entry_2_Open), + s_TLV_Success_AssociationResult_2_Open, sizeof(s_TLV_Success_AssociationResult_2_Open), + }, + + // 3 - WDI__WEP + { + WDI_BAND_ID_2400, + &s_Connect_Addr_3_WEP, + s_TLV_BSS_Entry_3_WEP, sizeof(s_TLV_BSS_Entry_3_WEP), + s_TLV_Success_AssociationResult_3_WEP, sizeof(s_TLV_Success_AssociationResult_3_WEP), + }, + + // 4 - WDI_SECURE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_4_RSNA_CCMP, + s_TLV_BSS_Entry_4_RSNA_CCMP, sizeof(s_TLV_BSS_Entry_4_RSNA_CCMP), + s_TLV_Success_AssociationResult_4_RSNA_CCMP, sizeof(s_TLV_Success_AssociationResult_4_RSNA_CCMP), + }, + + // 5 - WDI__IHV + { + TESTMP_BAND_IHV, + &s_Connect_Addr_5_IHV, + s_TLV_BSS_Entry_5_IHV, sizeof(s_TLV_BSS_Entry_5_IHV), + s_TLV_Success_AssociationResult_5_IHV, sizeof(s_TLV_Success_AssociationResult_5_IHV), + }, + + // 6 - WDI__FT + { + WDI_BAND_ID_2400, + &s_Connect_Addr_6_FT_CCMP, + s_TLV_BSS_Entry_6_FT_CCMP, sizeof(s_TLV_BSS_Entry_6_FT_CCMP), + s_TLV_Success_AssociationResult_6_FT_CCMP, sizeof(s_TLV_Success_AssociationResult_6_FT_CCMP), + }, + + // 7 - WDI__FTPSK + { + WDI_BAND_ID_2400, + &s_Connect_Addr_7_FT_PSK_CCMP, + s_TLV_BSS_Entry_7_FT_PSK_CCMP, sizeof(s_TLV_BSS_Entry_7_FT_PSK_CCMP), + s_TLV_Success_AssociationResult_7_FT_PSK_CCMP, sizeof(s_TLV_Success_AssociationResult_7_FT_PSK_CCMP), + }, + + // 8 - + { + WDI_BAND_ID_2400, + &s_Connect_Addr_8_Hidden, + s_TLV_BSS_Entry_Beacon_8_Hidden, sizeof(s_TLV_BSS_Entry_Beacon_8_Hidden), + s_TLV_Success_AssociationResult_8_Hidden, sizeof(s_TLV_Success_AssociationResult_8_Hidden), + }, + + // 9 - WDI_adPSK + { + WDI_BAND_ID_60000, + &s_Connect_Addr_9_11ad_PSK, +#ifdef DMG_CAPABILITIES + s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK), + s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK), +#else + s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK), + s_TLV_Success_AssociationResult_9_11ad_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_PSK), +#endif // DMG_CAPABILITIES + }, + + // 10 - WDI_ad_1x + { + WDI_BAND_ID_60000, + &s_Connect_Addr_10_11ad_1x, +#ifdef DMG_CAPABILITIES + s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x), + s_TLV_Success_AssociationResult_10_11ad_Dmg_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_Dmg_1x), +#else + s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x), + s_TLV_Success_AssociationResult_10_11ad_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_1x), +#endif // DMG_CAPABILITIES + }, + + // 11 - WDI_ad_ON + { + WDI_BAND_ID_60000, + &s_Connect_Addr_11_11ad_Open, +#ifdef DMG_CAPABILITIES + s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open), + s_TLV_Success_AssociationResult_11_11ad_Dmg_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Dmg_Open), +#else + s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open), + s_TLV_Success_AssociationResult_11_11ad_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Open), +#endif // DMG_CAPABILITIES + }, + + // 12 - WDI_OPEN_11ax.2.4 + { + WDI_BAND_ID_60000, + &s_Connect_Addr_12_11ax_24_Open, + s_TLV_BSS_Entry_12_11ax_24_Open, sizeof(s_TLV_BSS_Entry_12_11ax_24_Open), + s_TLV_Success_AssociationResult_12_11ax_24_Open, sizeof(s_TLV_Success_AssociationResult_12_11ax_24_Open), + }, + + // 13 - WDI_OPEN_11ax.5 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_13_11ax_5_Open, + s_TLV_BSS_Entry_13_11ax_5_Open, sizeof(s_TLV_BSS_Entry_13_11ax_5_Open), + s_TLV_Success_AssociationResult_13_11ax_5_Open, sizeof(s_TLV_Success_AssociationResult_13_11ax_5_Open), + }, + + // 14 - WDI_WPA3-SAE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_14_WPA3_SAE_CCMP, + s_TLV_BSS_Entry_14_WPA3_SAE_CCMP, sizeof(s_TLV_BSS_Entry_14_WPA3_SAE_CCMP), + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP), + }, + + // 15 - WDI_SHA256 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_15_WPA2PSK_SHA256, + s_TLV_BSS_Entry_15_WPA2PSK_SHA256, sizeof(s_TLV_BSS_Entry_15_WPA2PSK_SHA256), + s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256, sizeof(s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256), + }, + + // 16 - WDI_WPA3-SUITE_B + { + WDI_BAND_ID_2400, + &s_Connect_Addr_16_WPA3_SUITEB, + s_TLV_BSS_Entry_16_WPA3_SUITEB, sizeof(s_TLV_BSS_Entry_16_WPA3_SUITEB), + s_TLV_Success_AssociationResult_16_WPA3_SUITEB, sizeof(s_TLV_Success_AssociationResult_16_WPA3_SUITEB), + }, + + // 17 - 6E__1 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_17_6G_S1_2_4_Ghz, + s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz, sizeof(s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz), + s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz), + }, + + // 18 - 6E__1 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_18_6G_S1_5_Ghz, + s_TLV_BSS_Entry_18_6G_S1_5_Ghz, sizeof(s_TLV_BSS_Entry_18_6G_S1_5_Ghz), + s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz, sizeof(s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz), + }, + + // 19 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_19_6G_S1a_6_Ghz, + s_TLV_BSS_Entry_19_6G_S1a_6_Ghz, sizeof(s_TLV_BSS_Entry_19_6G_S1a_6_Ghz), + s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz, sizeof(s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz), + }, + + // 20 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_20_6G_S1b_6_Ghz, + s_TLV_BSS_Entry_20_6G_S1b_6_Ghz, sizeof(s_TLV_BSS_Entry_20_6G_S1b_6_Ghz), + s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz, sizeof(s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz), + }, + + // 21 - 6E__2 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_21_6G_S2_2_4_Ghz, + s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz, sizeof(s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz), + s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz), + }, + + // 22 - 6E__2 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_22_6G_S2_5_Ghz, + s_TLV_BSS_Entry_22_6G_S2_5_Ghz, sizeof(s_TLV_BSS_Entry_22_6G_S2_5_Ghz), + s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz, sizeof(s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz), + }, + + // 23 - 6E__2 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_23_6G_S2_6_Ghz, + s_TLV_BSS_Entry_23_6G_S2_6_Ghz, sizeof(s_TLV_BSS_Entry_23_6G_S2_6_Ghz), + s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz, sizeof(s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz), + }, + + // 24 - 6E__3 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_24_6G_S3_2_4_Ghz, + s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz, sizeof(s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz), + s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz), + }, + + // 25 - 6E__4 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_25_6G_S4_6_Ghz, + s_TLV_BSS_Entry_25_6G_S4_6_Ghz, sizeof(s_TLV_BSS_Entry_25_6G_S4_6_Ghz), + s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz, sizeof(s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz), + }, + + // 26 - WDI_OWE_RNR + { + WDI_BAND_ID_2400, + &s_ConnectAddr_26_OWE_With_RNR, + s_TLV_BSS_Entry_26_OWE_With_RNR, sizeof(s_TLV_BSS_Entry_26_OWE_With_RNR), + s_TLV_Failure_AssociationResult_26_OWE_With_RNR, sizeof(s_TLV_Failure_AssociationResult_26_OWE_With_RNR) + }, + // 27 - + { + WDI_BAND_ID_2400, + &s_ConnectAddr_27_OWE_TM_OWE, + s_TLV_BSS_Entry_27_OWE_TM_OWE, sizeof(s_TLV_BSS_Entry_27_OWE_TM_OWE), + s_TLV_Failure_AssociationResult_27_OWE_TM_OWE, sizeof(s_TLV_Failure_AssociationResult_27_OWE_TM_OWE) + }, + // 28 - WDI_OWE_TM_OPEN + { + WDI_BAND_ID_2400, + &s_ConnectAddr_28_OWE_TM_Open, + s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon, sizeof(s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon), + s_TLV_Failure_AssociationResult_28_OWE_TM_Open, sizeof(s_TLV_Failure_AssociationResult_28_OWE_TM_Open) + }, + + // 29 is only MLD address for Wi-Fi 7 + // 30 - Wi-Fi 7 - Mixed + { + WDI_BAND_ID_5000, + &s_Connect_Addr_30_WiFi7_Mixed_Link_1, + s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1), + s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1), + }, + // 34 - Wi-Fi 7 - Open + { + WDI_BAND_ID_5000, + &s_Connect_Addr_34_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_34_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_34_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1), + }, + // 38 - Wi-Fi 7 - Only + { + WDI_BAND_ID_6000, + &s_Connect_Addr_38_WiFi7_Only_Link_1, + s_TLV_BSS_Entry_38_WiFi7_Only_Link_1, sizeof(s_TLV_BSS_Entry_38_WiFi7_Only_Link_1), + s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1, sizeof(s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1), + }, + + // 41 - Dual-Sta + { + WDI_BAND_ID_5000, + &s_Connect_Addr_41_DualSta_5Ghz, + s_TLV_BSS_Entry_41_DualSta_5Ghz, sizeof(s_TLV_BSS_Entry_41_DualSta_5Ghz), + s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz), + }, + + // 42 - Dual-Sta + { + WDI_BAND_ID_6000, + &s_Connect_Addr_42_DualSta_6Ghz, + s_TLV_BSS_Entry_42_DualSta_6Ghz, sizeof(s_TLV_BSS_Entry_42_DualSta_6Ghz), + s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz), + }, +}; + +// clang-format on + +#define ConnectEntryId_MAX ARRAYSIZE(g_ConnectEntries) + +_Use_decl_annotations_ +void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) +{ + NTSTATUS Status = STATUS_SUCCESS; + UINT InBufferLen = 0; + UINT OutBufferLen = 0; + UINT BytesWritten = 0; + void* Buffer = WifiRequestGetInOutBuffer(SendRequest, &InBufferLen, &OutBufferLen); + UINT16 MessageId = WifiRequestGetMessageId(SendRequest); + + Status = ProcessWifiRequest(Device, MessageId, Buffer, InBufferLen, OutBufferLen, &BytesWritten); + + if (Status != STATUS_PENDING) + { + WifiRequestComplete(SendRequest, Status, BytesWritten); + } + return; +} + +_Use_decl_annotations_ +void WifiCxTestSendIndication(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, UINT32 TransactionId, PUCHAR pTlvData, UINT32 TlvDataSize) +{ + NTSTATUS ntStatus; + WDFMEMORY data; + PUCHAR pIndicationBuffer = nullptr; + PWDI_MESSAGE_HEADER pIndicationHeader = nullptr; + SIZE_T indicationSize = sizeof(WDI_MESSAGE_HEADER) + TlvDataSize; + WDF_OBJECT_ATTRIBUTES objectAttribs; + + WDF_OBJECT_ATTRIBUTES_INIT(&objectAttribs); + objectAttribs.ParentObject = Device; + + ntStatus = WdfMemoryCreate(&objectAttribs, NonPagedPoolNx, 0, indicationSize, &data, reinterpret_cast(&pIndicationBuffer)); + + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: Failed to initialize indication buffer %!STATUS!", ntStatus); + return; + } + + RtlZeroMemory(pIndicationBuffer, indicationSize); + pIndicationHeader = reinterpret_cast(pIndicationBuffer); + + RtlCopyMemory(pIndicationHeader, pWdiHeader, sizeof(WDI_MESSAGE_HEADER)); + pIndicationHeader->TransactionId = TransactionId; + + if (TlvDataSize > 0) + { + RtlCopyMemory(pIndicationBuffer + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); + } + + // Send the indication up to WifiCx + WifiDeviceReceiveIndication(Device, MessageId, data); + + // Don't need to keep this around + WdfObjectDelete(data); +} + +_Use_decl_annotations_ +UINT WifiCxTestSetOutput(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize, PUCHAR pTlvData, UINT32 TlvDataSize) +{ + UNREFERENCED_PARAMETER(pDeviceContext); + PWDI_MESSAGE_HEADER pWdiHeader = static_cast(ReqBuffer); + UINT BytesWritten = 0; + pWdiHeader->Status = NDIS_STATUS_SUCCESS; // TODO Need to set it to actual output + + if (ReqBufferSize >= (TlvDataSize + sizeof(WDI_MESSAGE_HEADER))) + { + if (TlvDataSize > 0) + { + RtlCopyMemory((static_cast(ReqBuffer)) + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); + } + BytesWritten = static_cast(TlvDataSize); + } + else + { + pWdiHeader->Status = NDIS_STATUS_BUFFER_OVERFLOW; + } + return BytesWritten; +} + +_Use_decl_annotations_ +NDIS_STATUS WifiCxTestGetAdapterCapabilities(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize) +{ + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + PUCHAR pOutput = nullptr; + ULONG length = 0; + + // Generate TLV + ndisStatus = + GenerateWdiGetAdapterCapabilities(&pDeviceContext->AdapterCapabilities, 0, &pDeviceContext->TlvContext, &length, &pOutput); + + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + // Set the information in the wifirequest + WifiCxTestSetOutput(pDeviceContext, ReqBuffer, ReqBufferSize, pOutput, length); + } + + FreeGenerated(pOutput); + + return ndisStatus; +} + +_Use_decl_annotations_ +NDIS_STATUS WifiCxTestSetAdapterConfiguration(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize) +{ + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + WDI_SET_FIRMWARE_CONFIGURATION_PARAMETERS fwConfig = {}; + + ULONG TLVStreamLength = static_cast(ReqBufferSize - sizeof(WDI_MESSAGE_HEADER)); + auto TLVByteStream = static_cast(ReqBuffer) + sizeof(WDI_MESSAGE_HEADER); + + DumpMessageTlvByteStream( + WDI_SET_ADAPTER_CONFIGURATION, TRUE, pDeviceContext->TlvContext.PeerVersion, TLVStreamLength, TLVByteStream, 0, nullptr); + ndisStatus = ParseWdiSetAdapterConfiguration(TLVStreamLength, TLVByteStream, &pDeviceContext->TlvContext, &fwConfig); + + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + if (fwConfig.Optional.MacAddress_IsPresent) + { + pDeviceContext->AdapterCapabilities.InterfaceAttributes.InterfaceCapabilities.Address = fwConfig.MacAddress; + } + } + + CleanupParsedWdiSetAdapterConfiguration(&fwConfig); + + return ndisStatus; +} + + +extern WDI_MAC_ADDRESS STAAddress; + +WDI_MAC_ADDRESS LocalLinkAddresses[] = { + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, +}; + +static NTSTATUS WifiCxTestSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) +{ + // Report link quality + NTSTATUS ntStatus = STATUS_SUCCESS; + PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); + WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; + WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RtlCopyMemory( + &linkStateChangeParameters.LinkStateChangeParameters.PeerMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + linkStateChangeParameters.LinkStateChangeParameters.TxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.RxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.LinkQuality = 56; + + pLinkInfo[0].LinkID = 1; + RtlCopyMemory(&pLinkInfo[0].LocalLinkMACAddress, &LocalLinkAddresses[0], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[0].PeerLinkMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[0].ChannelNumber = 6; + pLinkInfo[0].BandId = WDI_BAND_ID_2400; + pLinkInfo[0].RSSI = -50; + pLinkInfo[0].Bandwidth = 40; + pLinkInfo[0].TxMCS = 3; + pLinkInfo[0].RxMCS = 4; + + if (numLinks > 1) + { + pLinkInfo[1].LinkID = 2; + RtlCopyMemory(&pLinkInfo[1].LocalLinkMACAddress, &LocalLinkAddresses[1], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[1].PeerLinkMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[1].ChannelNumber = 36; + pLinkInfo[1].BandId = WDI_BAND_ID_5000; + pLinkInfo[1].RSSI = -30; + pLinkInfo[1].Bandwidth = 160; + pLinkInfo[1].TxMCS = 8; + pLinkInfo[1].RxMCS = 9; + } + + linkStateChangeParameters.LinkInfo.pElements = pLinkInfo; + linkStateChangeParameters.LinkInfo.ElementCount = numLinks > 1 ? 2 : 1; + + ntStatus = + GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (STATUS_SUCCESS == ntStatus) + { + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, 0, pOutput, cbOutput); + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_LINK_STATE_CHANGE - 0x%08x\n", ntStatus); + } + + return ntStatus; +} + +#define TEST_RSN_EAPOL_SHA384_KCK_LENGTH (192 / 8) // 24 bytes +#define TEST_RSN_EAPOL_SHA384_KEK_LENGTH (256 / 8) // 32 bytes +#define TEST_RSN_CCMP_KEY_LENGTH 16 +#define TEST_RSN_BIP_GMAC_256_KEY_LENGTH 32 + +#define TEST_NUM_LINKS 3 +#define TEST_NUM_CIPHER_KEY_TYPES 3 + + +static NTSTATUS WifiCxTestPerformAssociation( + _In_ WDFDEVICE Device, + _In_ struct ArrayOfElements* pPreferredBSSEntryList, + _In_ struct ArrayOfElements* pAuthenticationAlgorithms, + _In_ PWDI_MESSAGE_HEADER pWdiHeader) +{ + + ULONG bssIndex = 0; + ULONG connectEntry = ConnectEntryId_MAX; + NTSTATUS ntStatus = STATUS_SUCCESS; + UINT32 NewConnectEntryId = 0; // Disconnected State + WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; + UCHAR pucData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10}; + PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); + ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; + + do + { + // We search for the BSSID pattern to figure out what AP we are trying to connect to + for (bssIndex = 0; bssIndex < pPreferredBSSEntryList->ElementCount; bssIndex++) + { + for (connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (RtlCompareMemory( + pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, + g_ConnectEntries[connectEntry].pMacAddress, + sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS)) + { + PUCHAR pAssociationResult = g_ConnectEntries[connectEntry].pTlvAssociationResult; + + NewConnectEntryId = connectEntry; + pDeviceContext->LastConnectTransactionId = pWdiHeader->TransactionId; + + // TODO NetAdapter: datapath not yet implemented +#ifdef WIFICX_TEST_DATAPATH + // add peer on datapath + AddDatapathPeer(0x33, *g_ConnectEntries[connectEntry].pMacAddress); + + // example inject frame + InjectDatapathFrame(0x33); + + // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. + RecieveDatapathFrame(0x33, sizeof(pucData), pucData); + +#endif + if ((&s_Connect_Addr_14_WPA3_SAE_CCMP == g_ConnectEntries[connectEntry].pMacAddress) || + (&s_Connect_Addr_30_WiFi7_Mixed_Link_1 == g_ConnectEntries[connectEntry].pMacAddress) || + (&s_Connect_Addr_38_WiFi7_Only_Link_1 == g_ConnectEntries[connectEntry].pMacAddress)) + { + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + + // + // Handle special case for WPA3-SAE + // Send the Indication to request additonal SAE params + // + g_dwSaeResendConfirmRequested = 0; + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_REQUEST_PARAMS_NEEDED; + RtlCopyMemory( + SAEAuthParamsNeeded.BssId.Address, g_ConnectEntries[connectEntry].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + ndisStatus = GenerateWdiIndicationSaeAuthParamsNeeded( + &SAEAuthParamsNeeded, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); + + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + + FreeGenerated(pOutput); + + break; + } + } + + // Get the assoc status + RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); + + // Send the association indication + WifiCxTestSendIndication( + Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + 0, + g_ConnectEntries[connectEntry].pTlvAssociationResult, + g_ConnectEntries[connectEntry].TlvAssociationResultSize); + + break; + } + } + + // + // If we found a matching BSSID entry, we are done + // + if (connectEntry < ConnectEntryId_MAX) + { + break; + } + } + + } while (FALSE); + + if (WDI_ASSOC_STATUS_SUCCESS != assocStatus || 0 == NewConnectEntryId || bssIndex >= pPreferredBSSEntryList->ElementCount) + { + NewConnectEntryId = 0; // Disconnected State + NewAuthAlgo = WDI_AUTH_ALGO_80211_OPEN; + ntStatus = STATUS_UNSUCCESSFUL; + } + else + { + RtlCopyMemory(&pDeviceContext->ConnectedPeer, pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, sizeof(DOT11_MAC_ADDRESS)); + } + + pDeviceContext->LastConnectEntryId = NewConnectEntryId; + pDeviceContext->LastAuthAlgo = NewAuthAlgo; + + if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != pDeviceContext->LastAuthAlgo)) + { + // Report link quality + ntStatus = WifiCxTestSendLinkStateIndication(Device, pWdiHeader, 2); + } + + return ntStatus; +} + +static void WifiCxTestPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) +{ + // clang-format off + UCHAR s_TLV_Disassociation[] = + { + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + + 0x00 + }; + // clang-format on + + PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); + + // TODO NetAdapter: datapath not yet implemented +#ifdef WIFICX_TEST_DATAPATH + // example inject frame + InjectDatapathFrame(0x33); +#endif + + RtlCopyMemory(&s_TLV_Disassociation[4], &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); + + // Send the disassociation indication + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, 0, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); + + pDeviceContext->LastConnectEntryId = 0; // Disconnected State +} + +_Use_decl_annotations_ +static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buffer, UINT InBufferLen, UINT OutBufferLen, UINT* pBytesWritten) +{ + NTSTATUS ntStatus = STATUS_SUCCESS; + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(Device); + PWDI_MESSAGE_HEADER pWdiHeader = static_cast(Buffer); + UINT BytesWritten = sizeof(WDI_MESSAGE_HEADER); + + if (InBufferLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + if (OutBufferLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto const buffer = static_cast(Buffer); + + // Check for integer overflow + if (!(buffer + InBufferLen > buffer)) + { + return STATUS_INVALID_PARAMETER; + } + + switch (MessageId) + { + case WDI_TASK_SET_RADIO_STATE: + { + WDI_SET_RADIO_STATE_PARAMETERS RadioStateParams = {}; + ULONG TLVStreamLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); + auto TLVByteStream = buffer + sizeof(WDI_MESSAGE_HEADER); + + DumpMessageTlvByteStream( + WDI_TASK_SET_RADIO_STATE, TRUE, deviceContext->TlvContext.PeerVersion, TLVStreamLength, TLVByteStream, 0, nullptr); + ParseWdiTaskSetRadioState(TLVStreamLength, TLVByteStream, &deviceContext->TlvContext, &RadioStateParams); + + if (RadioStateParams.SoftwareRadioState != deviceContext->CurrentRadioState) + { + // Change the radio state + deviceContext->CurrentRadioState = RadioStateParams.SoftwareRadioState; + + // Send the radio state indication + WDI_INDICATION_RADIO_STATUS_PARAMETERS RadioStatusParams = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RadioStatusParams.RadioState.HardwareState = TRUE; + RadioStatusParams.RadioState.SoftwareState = deviceContext->CurrentRadioState; + GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, &deviceContext->TlvContext, &cbOutput, &pOutput); + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, 0, pOutput, cbOutput); + + FreeGenerated(pOutput); + } + + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SET_RADIO_STATE_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + + CleanupParsedWdiTaskSetRadioState(&RadioStateParams); + } + break; + + case WDI_SET_ADAPTER_CONFIGURATION: + { + ndisStatus = WifiCxTestSetAdapterConfiguration(deviceContext, Buffer, InBufferLen); + } + break; + + case WDI_TASK_SCAN: + { + ULONG scanDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); + auto pScanData = buffer + sizeof(WDI_MESSAGE_HEADER); + + WDI_SCAN_PARAMETERS scanParams = {}; + + ndisStatus = ParseWdiTaskScan(scanDataLength, pScanData, &deviceContext->TlvContext, &scanParams); + + if (NDIS_STATUS_SUCCESS != ndisStatus) + { + WFCTrace("Scan parameters parsing failed: %d\n", ndisStatus); + // ntStatus = NdisConvertNdisStatusToNtStatus(parseStatus); + break; + } + + for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (g_SupportedBands & g_ConnectEntries[connectEntry].BandId) + { + + PUCHAR pBssEntry = g_ConnectEntries[connectEntry].pTlvBssEntry; + + // + // If currently connected, see if the connected entry should be skipped + // + if ((deviceContext->LastConnectEntryId != 0) && + (RtlCompareMemory(&deviceContext->ConnectedPeer, &pBssEntry[8], sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS))) + { + // Already connected, don't report this entry + continue; + } + + // TODO: Skip the IHV band as it is not being reported in capabilities + if (g_ConnectEntries[connectEntry].BandId == TESTMP_BAND_IHV) + { + continue; + } + + // Send the BSS entry indication + WifiCxTestSendIndication( + Device, + pWdiHeader, + WDI_INDICATION_BSS_ENTRY_LIST, + 0, + g_ConnectEntries[connectEntry].pTlvBssEntry, + g_ConnectEntries[connectEntry].TlvBssEntrySize); + } + } + + // + // See if the hidden network needs to be indicated + // + if ((scanParams.SSIDList.ElementCount > 0) && (scanParams.SSIDList.pElements[0].ElementCount == 8) && + (scanParams.SSIDList.pElements[0].pElements[4] == 'H') && (scanParams.SSIDList.pElements[0].pElements[5] == 'I') && + (scanParams.SSIDList.pElements[0].pElements[6] == 'D') && (scanParams.SSIDList.pElements[0].pElements[7] == 'E')) + { + WifiCxTestSendIndication( + Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, 0, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); + } + + CleanupParsedWdiTaskScan(&scanParams); + + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SCAN_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + } + break; + + case WDI_TASK_DOT11_RESET: + { + WDI_TASK_DOT11_RESET_PARAMETERS resetParameters; + + ULONG resetDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); + auto pResetData = buffer + sizeof(WDI_MESSAGE_HEADER); + + ndisStatus = ParseWdiTaskDot11Reset(resetDataLength, pResetData, &deviceContext->TlvContext, &resetParameters); + + if (NDIS_STATUS_SUCCESS != ndisStatus) + { + WFCTrace("DOT11 Reset parameters parsing failed: %d\n", ndisStatus); + } + else if (0 == resetParameters.Optional.ResetMACAddress_IsPresent) + { + WFCTrace("DOT11 Reset, set default MIB = %d, no MAC Address specified\n", resetParameters.Dot11ResetParameters.SetDefaultMIB); + } + else + { + WFCTrace( + "DOT11 Reset, set default MIB = %d, MAC Address = %2x:%2x:%2x:%2x:%2x:%2x\n", + resetParameters.Dot11ResetParameters.SetDefaultMIB, + resetParameters.ResetMACAddress.Address[0], + resetParameters.ResetMACAddress.Address[1], + resetParameters.ResetMACAddress.Address[2], + resetParameters.ResetMACAddress.Address[3], + resetParameters.ResetMACAddress.Address[4], + resetParameters.ResetMACAddress.Address[5]); + } + + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DOT11_RESET_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + + CleanupParsedWdiTaskDot11Reset(&resetParameters); + } + break; + + case WDI_TASK_CONNECT: + { + ULONG connectDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); + auto pConnectData = buffer + sizeof(WDI_MESSAGE_HEADER); + + DumpMessageTlvByteStream(WDI_TASK_CONNECT, TRUE, deviceContext->TlvContext.PeerVersion, connectDataLength, pConnectData, 0, nullptr); + + WDI_TASK_CONNECT_PARAMETERS connectParams; + + if (deviceContext->LastConnectEntryId != 0) // Not Disconnected State + { + ASSERT(FALSE); + // TODO NetAdapter: datapath not yet implemented +#ifdef WIFICX_TEST_DATAPATH + DeleteDatapathPeer(0x33); +#endif + } + + // We search for the BSSID pattern to figure out what AP we are trying to connect to + ndisStatus = ParseWdiTaskConnect(connectDataLength, pConnectData, &deviceContext->TlvContext, &connectParams); + if (NDIS_STATUS_SUCCESS != ndisStatus) + { + // ntStatus = NdisConvertNdisStatusToNtStatus(parseStatus); + WFCTrace("ParseWdiTaskConnect FAIled %d\n", ndisStatus); + break; + } + + // Call the helper + ndisStatus = WifiCxTestPerformAssociation( + Device, &connectParams.PreferredBSSEntryList, &connectParams.ConnectParameters.AuthenticationAlgorithms, pWdiHeader); + CleanupParsedWdiTaskConnect(&connectParams); + + // + // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete + // + if (WDI_AUTH_ALGO_WPA3_SAE != deviceContext->LastAuthAlgo) + { + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + } + } + break; + + case WDI_TASK_DISCONNECT: + { + WifiCxTestPerformDisassociation(Device, pWdiHeader, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); + + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DISCONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + +#ifdef WIFICX_TEST_DATAPATH + // TODO NetAdapter: datapath not yet implemented + DeleteDatapathPeer(0x33); +#endif + } + break; + + case WDI_SET_PRIVACY_EXEMPTION_LIST: + case WDI_SET_DEFAULT_KEY_ID: + case WDI_SET_ADD_CIPHER_KEYS: + case WDI_SET_DELETE_CIPHER_KEYS: + case WDI_SET_RECEIVE_PACKET_FILTER: + case WDI_SET_CONNECTION_QUALITY: + // Doing Nothing special + break; + + case WDI_SET_SAE_AUTH_PARAMS: + { + WDI_SET_SAE_AUTH_PARAMS_COMMAND setSAEAuthParams; + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + // Commit frame when Status = 0: FiniteCyclicGroup + Scalar + Element + // Commit frame when Status = 76: FiniteCyclicGroup + AntiCloggingToken + WFCInfo("WDI_SET_SAE_AUTH_PARAMS called!!!\n"); + + ndisStatus = ParseWdiSetSaeAuthParams( + InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &setSAEAuthParams); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + if (WDI_SAE_REQUEST_TYPE_COMMIT_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Commit request for Tx, Setting CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + + // + // Send reflection attack first + // + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponseReflection); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponseReflection; + } + else if ( + (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) && + (WDI_SAE_STATUS_COMMIT_MESSAGE_REFLECTION_ATTACK_DETECTED == setSAEAuthParams.SAEStatus)) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS returned Reflection error -- Inidicate proper CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponse; + } + else if (WDI_SAE_REQUEST_TYPE_CONFIRM_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Confirm request for Tx, Setting ConfirmResponse for Rx\n"); + + if (g_dwSaeResendConfirmRequested) + { + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAEConfirmResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAEConfirmResponse; + } + else + { + g_dwSaeResendConfirmRequested = 1; + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_REQUEST_RESEND_REQUEST; + } + } + else + { + if (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated error - %d\n", setSAEAuthParams.SAEStatus); + } + else if (WDI_SAE_REQUEST_TYPE_SUCCESS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated SAE success - %d\n", setSAEAuthParams.SAEStatus); + } + else + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has set INVALID Request type = %d\n", setSAEAuthParams.SAERequestType); + } +#ifdef WIFICX_TEST_DATAPATH + // example inject frame + InjectDatapathFrame(0x33); +#endif + // Send the association indication + if (WDI_AUTH_ALGO_WPA3_SAE == deviceContext->LastAuthAlgo) + { + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[27] = (UCHAR)WDI_AUTH_ALGO_WPA3_SAE; + } + else + { + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; + } + + WifiCxTestSendIndication( + Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + 0, + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, + sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP)); + RtlCopyMemory(&deviceContext->ConnectedPeer, &s_Connect_Addr_14_WPA3_SAE_CCMP, sizeof(DOT11_MAC_ADDRESS)); + + // Report link quality + ntStatus = WifiCxTestSendLinkStateIndication(Device, pWdiHeader, 1); + + WifiCxTestSendIndication( + Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, deviceContext->LastConnectTransactionId, nullptr, 0); + +#ifdef WIFICX_TEST_DATAPATH + // + // Receive M1 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM1SaeFrame), pucM1SaeFrame); + + // + // Receive M3 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); +#endif + break; + } + + RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &s_Connect_Addr_14_WPA3_SAE_CCMP, sizeof(DOT11_MAC_ADDRESS)); + + ndisStatus = + GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, &deviceContext->TlvContext, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED - 0x%08x\n", ndisStatus); + } + } + else + { + WFCError("[SAE] Failed to parse WDI_SET_SAE_AUTH_PARAMS data - 0x%08x\n", ndisStatus); + } + CleanupParsedWdiSetSaeAuthParamsToIhv(&setSAEAuthParams); + } + break; + + case WDI_SET_LOCATION_PRIVACY: + { + WDI_SET_LOCATION_PRIVACY_PARAMETERS privacyParams; + + ndisStatus = ParseWdiSetLocationPrivacyToIhv( + InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &privacyParams); + if (NDIS_STATUS_SUCCESS == ndisStatus) + { + WFCInfo("[WDI_SET_LOCATION_PRIVACY]: Got privacy setting = %x *****\n", privacyParams.LocationAllowed); + CleanupParsedWdiSetLocationPrivacy(&privacyParams); + } + else + { + WFCError("[WDI_SET_LOCATION_PRIVACY]: ParseWdiSetLocationPrivacyToIhv FAIled %x0x *****\n", ndisStatus); + } + } + break; + + default: + ntStatus = STATUS_NOT_SUPPORTED; + break; + } + + // Set the ndis Status in the WDI header + pWdiHeader->Status = ndisStatus; + + // Set the output length + if (pBytesWritten) + { + *pBytesWritten = BytesWritten; + } + return ntStatus; +} + +_Use_decl_annotations_ +NTSTATUS WifiCxTestSetDeviceCapabilities(WDFDEVICE Device) +{ + WIFI_DEVICE_CAPABILITIES deviceCaps = {}; + WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); + + deviceCaps.HardwareRadioState = TRUE; + deviceCaps.SoftwareRadioState = TRUE; + deviceCaps.FirmwareVersion[MAX_FIRMWARE_VERSION_LENGTH]; + deviceCaps.ActionFramesSupported = TRUE; + deviceCaps.NumRxStreams = 1; + deviceCaps.NumTxStreams = 1; + deviceCaps.Support_eCSA = FALSE; + deviceCaps.MACAddressRandomization = FALSE; + deviceCaps.MACAddressRandomizationMask.Address[0] = 0; + deviceCaps.MACAddressRandomizationMask.Address[1] = 0; + deviceCaps.MACAddressRandomizationMask.Address[2] = 0; + deviceCaps.MACAddressRandomizationMask.Address[3] = 0xFF; + deviceCaps.MACAddressRandomizationMask.Address[4] = 0; + deviceCaps.MACAddressRandomizationMask.Address[5] = 0; + deviceCaps.BluetoothCoexistenceSupport = WDI_BLUETOOTH_COEXISTENCE_PERFORMANCE_MAINTAINED; + deviceCaps.SupportsNonWdiOidRequests = FALSE; + deviceCaps.FastTransitionSupported = TRUE; + deviceCaps.MU_MIMOSupported = FALSE; + deviceCaps.SAEAuthenticationSupported = TRUE; + deviceCaps.BSSTransitionSupported = TRUE; + deviceCaps.MBOSupported = FALSE; + deviceCaps.BeaconReportsImplemented = FALSE; + + WifiDeviceSetDeviceCapabilities(Device, &deviceCaps); + + WIFI_STATION_CAPABILITIES StationCaps = {}; + WIFI_STATION_CAPABILITIES_INIT(&StationCaps); + + StationCaps.ScanSSIDListSize = 4; + StationCaps.DesiredSSIDListSize = 1; + StationCaps.PrivacyExemptionListSize = 1; + StationCaps.KeyMappingTableSize = 32; + StationCaps.DefaultKeyTableSize = 4; + StationCaps.WEPKeyValueMaxLength = 0x20; + StationCaps.MaxNumPerSTA = 4; + StationCaps.SupportedQOSFlags = 0; + StationCaps.HostFIPSModeImplemented = FALSE; + StationCaps.MFPCapable = TRUE; + StationCaps.AutoPowerSaveMode = FALSE; + StationCaps.BSSListCachemanagement = FALSE; + StationCaps.ConnectBSSSelectionOverride = FALSE; + StationCaps.MaxNetworkOffloadListSize = 0; + StationCaps.HESSIDConnectionSupported = FALSE; + StationCaps.FTMAsInitiatorSupport = FALSE; + StationCaps.FTMNumberOfSupportedTargets = 0; + + const DOT11_AUTH_CIPHER_PAIR UnicastAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_WEP}, + {DOT11_AUTH_ALGO_WPA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_TKIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_CCMP}, + }; + + const DOT11_AUTH_CIPHER_PAIR McastMgmtAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_BIP_GMAC_256}, + }; + + StationCaps.NumSupportedUnicastAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.UnicastAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastDataAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.MulticastDataAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastMgmtAlgorithms = ARRAYSIZE(McastMgmtAlgos); + StationCaps.MulticastMgmtAlgorithmsList = const_cast(McastMgmtAlgos); + + WIFI_STA_BANDS_COMBINATION SecondaryStaBandsCombinations[] = { + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {3, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN}}, + }; + + StationCaps.NumSecondaryStaBandCombinations = ARRAYSIZE(SecondaryStaBandsCombinations); + StationCaps.SecondaryStaBandsCombinations = SecondaryStaBandsCombinations; + + WDI_MAC_ADDRESS MLOAddresses[] = { + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, + }; + StationCaps.MaxMLOLinksSupported = ARRAYSIZE(MLOAddresses); + StationCaps.MLOAddressesList = MLOAddresses; + + RSNA_AKM_SUITE AkmsList[] = { + rsna_akm_1x, + rsna_akm_psk, + rsna_akm_ft_1x_sha256, + rsna_akm_ft_psk_sha256, + rsna_akm_1x_sha256, + rsna_akm_psk_sha256, + rsna_akm_sae_pmk256, + rsna_akm_1x_suite_b_sha384, + rsna_akm_owe, + rsna_akm_1x_sha384, + rsna_akm_sae_pmk384, + }; + StationCaps.NumAkmsSupported = ARRAYSIZE(AkmsList); + StationCaps.AkmsList = AkmsList; + + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)) + { + StationCaps.MSCSSupported = true; + } + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)) + { + StationCaps.DSCPToUPMappingSupported = true; + } +#ifdef _KERNEL_MODE + if (!KdRefreshDebuggerNotPresent()) + { + DbgPrintEx( + DPFLTR_DEFAULT_ID, + DPFLTR_ERROR_LEVEL, + "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::MSCSSupported %u\n", + WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)); + DbgPrintEx( + DPFLTR_DEFAULT_ID, + DPFLTR_ERROR_LEVEL, + "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::DSCPToUPMappingSupported %u\n", + WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)); + DbgPrintEx( + DPFLTR_DEFAULT_ID, + DPFLTR_ERROR_LEVEL, + "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::MaxNumConfigurableActionFrameWakePatterns %u\n", + WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MaxNumConfigurableActionFrameWakePatterns)); + DbgPrintEx( + DPFLTR_DEFAULT_ID, + DPFLTR_ERROR_LEVEL, + "WIFI_IS_FUNCTION_AVAILABLE:WifiPowerOffloadGetActionFrameWakePatternParameters %u\n", + WIFI_IS_FUNCTION_AVAILABLE(WifiPowerOffloadGetActionFrameWakePatternParameters)); + } +#endif + WifiDeviceSetStationCapabilities(Device, &StationCaps); + + WIFI_BAND_CAPABILITIES BandCaps = {}; + WIFI_BAND_CAPABILITIES_INIT(&BandCaps); + + const WDI_PHY_TYPE Phy24GHz[] = { WDI_PHY_TYPE_ERP, WDI_PHY_TYPE_HE }; // g, ax + const WDI_PHY_TYPE Phy5GHz[] = { WDI_PHY_TYPE_OFDM, WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // a, ax, be + const WDI_PHY_TYPE Phy6GHz[] = { WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // ax, be + const WDI_PHY_TYPE pPhy60GHz[] = { WDI_PHY_TYPE_DMG }; // ad + const WDI_PHY_TYPE phyIHV[2] = { WDI_PHY_TYPE_OFDM, static_cast(WDI_PHY_TYPE_IHV_START + 1) }; + + // clang-format off + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap24[] = { + {1, 2412}, + {2, 2417}, + {3, 2422}, + {4, 2427}, + {5, 2432}, + {6, 2437}, + {7, 2442}, + {8, 2447}, + {9, 2452}, + {10, 2457}, + {11, 2462}, + {12, 2467}, // Not used in US + {13, 2472}, // Not used in US + {14, 2484}, // Allowed in Japan only + }; + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap5[] = { + {7, 5035}, // Not used in US + {8, 5040}, // Not used in US + {9, 5045}, // Not used in US + {11, 5055}, // Not used in US + {12, 5060}, // Not used in US + {16, 5080}, // Not used in US + {32, 5160}, // Unknown status + {34, 5170}, // Not used in US + {36, 5180}, + {38, 5190}, + {40, 5200}, + {42, 5210}, + {44, 5220}, + {46, 5230}, + {48, 5240}, + {50, 5250}, // DFS + {52, 5260}, // DFS + {54, 5270}, // DFS + {56, 5280}, // DFS + {58, 5290}, // DFS + {60, 5300}, // DFS + {62, 5310}, // DFS + {64, 5320}, // DFS + {68, 5340}, // Unknown status + {96, 5480}, // Unknown status + {100, 5500}, // DFS + {102, 5510}, // DFS + {104, 5520}, // DFS + {106, 5530}, // DFS + {108, 5540}, // DFS + {110, 5550}, // DFS + {112, 5560}, // DFS + {114, 5570}, // DFS + {116, 5580}, // DFS + {118, 5590}, // DFS + {120, 5600}, // DFS + {122, 5610}, // DFS + {124, 5620}, // DFS + {126, 5630}, // DFS + {128, 5640}, // DFS + {132, 5660}, // DFS + {134, 5670}, // DFS + {136, 5680}, // DFS + {138, 5690}, // DFS + {140, 5700}, // DFS + {142, 5710}, // DFS + {142, 5720}, // DFS + {144, 5730}, // DFS + {149, 5745}, + {151, 5755}, + {153, 5765}, + {155, 5785}, + {157, 5785}, + {159, 5795}, + {161, 5805}, + {165, 5825}, + {169, 5845}, // Not used in US + {173, 5865}, // Not used in US + {183, 4915}, // Not used in US + {184, 4920}, // Not used in US + {185, 4925}, // Not used in US + {187, 4935}, // Not used in US + {188, 4940}, // Not used in US + {189, 4945}, // Not used in US + {192, 4960}, // Not used in US + {196, 4980}, // Not used in US + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap6[] = { + {1, 5955}, + {5, 5975}, // PSC Channel (1) + {9, 5995}, + + {13, 6015}, + {17, 6035}, + {21, 6055}, // PSC Channel (2) + {25, 6075}, + {29, 6095}, + + {33, 6115}, + {37, 6135}, // PSC Channel (3) + {41, 6155}, + {45, 6175}, + {49, 6195}, + + {53, 6215}, // PSC Channel (4) + {57, 6235}, + {61, 6255}, + {65, 6275}, + {69, 6295}, // PSC Channel (5) + + {73, 6315}, + {77, 6335}, + {81, 6355}, + {85, 6375}, // PSC Channel (6) + {89, 6395}, + + {93, 6415}, + {97, 6435}, + {101, 6455}, // PSC Channel (7) + {105, 6475}, + {109, 6495}, + + {113, 6515}, + {117, 6535}, // PSC Channel (8) + {121, 6555}, + {125, 6575}, + {129, 6595}, + + {133, 6615}, // PSC Channel (9) + {137, 6635}, + {141, 6655}, + {145, 6675}, + {149, 6695}, // PSC Channel (10) + + {153, 6715}, + {157, 6735}, + {161, 6755}, + {165, 6775}, // PSC Channel (11) + {169, 6795}, + + {173, 6815}, + {177, 6835}, + {181, 6855}, // PSC Channel (12) + {185, 6875}, + {189, 6895}, + + {193, 6915}, + {197, 6935}, // PSC Channel (13) + {201, 6955}, + {205, 6975}, + {209, 6995}, + + {213, 7015}, // PSC Channel (14) + {217, 7035}, + {221, 7055}, + {225, 7075}, + {229, 7095}, // PSC Channel (15) + + {233, 7115}, + {237, 7135}, + {241, 7155}, + {245, 7175}, + {249, 7195}, + + {253, 7215}, + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap60[] = { + {1, 58320}, + {2, 60480}, + {3, 62640}, + {4, 64800}, + {5, 66960}, + {6, 69120}, + }; + + // clang-format on + + UINT32 ChannelWidth10Mhz = 10; + UINT32 ChannelWidth20Mhz = 20; + UINT32 channelWidth2160Mhz = 2160; + UINT32 pChannelWidth6Ghz[] = { 20, 40, 80, 160, 320 }; + + WIFI_BAND_INFO BandInfo[4] = {}; // Upto 4 bands + UINT32 bandInfoCount = 0; + + if (g_SupportedBands & WDI_BAND_ID_2400) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_2400; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy24GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy24GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap24); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap24); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth10Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 1); + + if (g_SupportedBands & WDI_BAND_ID_5000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_5000; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy5GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy5GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap5); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap5); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth20Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 2); + + if (g_SupportedBands & WDI_BAND_ID_6000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_6000; // 6 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy6GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy6GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap6); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap6); + BandInfo[bandInfoCount].NumChannelWidths = ARRAYSIZE(pChannelWidth6Ghz); + BandInfo[bandInfoCount].ChannelWidthList = pChannelWidth6Ghz; + bandInfoCount++; + } + + NT_ASSERT(bandInfoCount <= 3); + if (g_SupportedBands & WDI_BAND_ID_60000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_60000; // 60 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(pPhy60GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(pPhy60GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap60); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap60); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &channelWidth2160Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 4); + + BandCaps.NumBands = bandInfoCount; + BandCaps.BandInfoList = BandInfo; + + WifiDeviceSetBandCapabilities(Device, &BandCaps); + + WIFI_PHY_CAPABILITIES PhyCaps = {}; + WIFI_PHY_CAPABILITIES_INIT(&PhyCaps); + + WIFI_PHY_INFO PhyInfoList[3]; + + const WDI_DATA_RATE_ENTRY DataRateListErp[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 4}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 22}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListOfdm[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListEht[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + + PhyInfoList[0].PhyType = WDI_PHY_TYPE_ERP; + PhyInfoList[0].NumberDataRateEntries = ARRAYSIZE(DataRateListErp); + RtlCopyMemory(&PhyInfoList[0].DataRateList, &DataRateListErp, sizeof(DataRateListErp)); + + PhyInfoList[1].PhyType = WDI_PHY_TYPE_HE; + PhyInfoList[1].NumberDataRateEntries = ARRAYSIZE(DataRateListOfdm); + RtlCopyMemory(&PhyInfoList[1].DataRateList, &DataRateListOfdm, sizeof(DataRateListOfdm)); + + PhyInfoList[2].PhyType = WDI_PHY_TYPE_EHT; + PhyInfoList[2].NumberDataRateEntries = ARRAYSIZE(DataRateListEht); + RtlCopyMemory(&PhyInfoList[2].DataRateList, &DataRateListEht, sizeof(DataRateListEht)); + + PhyCaps.NumPhyTypes = ARRAYSIZE(PhyInfoList); + PhyCaps.PhyInfoList = PhyInfoList; + + WifiDeviceSetPhyCapabilities(Device, &PhyCaps); + + return STATUS_SUCCESS; +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifirequest.h b/network/wlan/WIFICX/drivercode/wifirequest.h new file mode 100644 index 00000000..b2221c1e --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifirequest.h @@ -0,0 +1,30 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; + +static NTSTATUS ProcessWifiRequest( + _In_ WDFDEVICE Device, _In_ UINT16 MessageId, _In_ void* Buffer, _In_ UINT InBufferLen, _In_ UINT OutBufferLen, _In_ UINT* pBytesWritten); + +UINT WifiCxTestSetOutput( + _In_ PWIFI_DEVICE_CONTEXT pDeviceContext, + _Inout_ void* ReqBuffer, + _In_ SIZE_T ReqBufferSize, + _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, + _In_ UINT32 TlvDataSize); + +void WifiCxTestSendIndication( + _In_ WDFDEVICE Device, + _In_ PWDI_MESSAGE_HEADER pWdiHeader, + _In_ UINT16 MessageId, + _In_ UINT32 TransactionId, + _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, + _In_ UINT32 TlvDataSize); + +NDIS_STATUS WifiCxTestGetAdapterCapabilities(_In_ PWIFI_DEVICE_CONTEXT pDeviceContext, _In_ void* ReqBuffer, _In_ SIZE_T ReqBufferSize); + +NDIS_STATUS WifiCxTestSetAdapterConfiguration(_In_ PWIFI_DEVICE_CONTEXT pDeviceContext, _In_ void* ReqBuffer, _In_ SIZE_T ReqBufferSize); + +NTSTATUS WifiCxTestSetDeviceCapabilities(_In_ WDFDEVICE Device); + +ULONG g_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf new file mode 100644 index 00000000..432e31ac --- /dev/null +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.inf @@ -0,0 +1,62 @@ +; +; wificxsampleclientkm.inf +; + +[Version] +Signature = "$WINDOWS NT$" +Class = System ; TODO: specify appropriate Class +ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid +Provider = %ManufacturerName% +CatalogFile = wificxsampleclientkm.cat +DriverVer = ; TODO: set DriverVer in stampinf property pages +PnpLockdown = 1 + +[DestinationDirs] +DefaultDestDir = 13 + +[SourceDisksNames] +1 = %DiskName%,,,"" + +[SourceDisksFiles] +wificxsampleclientkm.sys = 1,, + +;***************************************** +; Install Section +;***************************************** + +[Manufacturer] +%ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299 + +[Standard.NT$ARCH$.10.0...16299] +%wificxsampleclientkm.DeviceDesc% = wificxsampleclientkm_Device, Root\wificxsampleclientkm ; TODO: edit hw-id + +[wificxsampleclientkm_Device.NT] +CopyFiles = File_Copy + +[File_Copy] +wificxsampleclientkm.sys + +;-------------- Service installation +[wificxsampleclientkm_Device.NT.Services] +AddService = wificxsampleclientkm,%SPSVCINST_ASSOCSERVICE%, wificxsampleclientkm_Service_Inst + +; -------------- wificxsampleclientkm driver install sections +[wificxsampleclientkm_Service_Inst] +DisplayName = %wificxsampleclientkm.SVCDESC% +ServiceType = 1 ; SERVICE_KERNEL_DRIVER +StartType = 3 ; SERVICE_DEMAND_START +ErrorControl = 1 ; SERVICE_ERROR_NORMAL +ServiceBinary = %13%\wificxsampleclientkm.sys + +[wificxsampleclientkm_Device.NT.Wdf] +KmdfService = wificxsampleclientkm, wificxsampleclientkm_wdfsect + +[wificxsampleclientkm_wdfsect] +KmdfLibraryVersion = $KMDFVERSION$ + +[Strings] +SPSVCINST_ASSOCSERVICE = 0x00000002 +ManufacturerName = "" ;TODO: Replace with your manufacturer name +DiskName = "wificxsampleclientkm Installation Disk" +wificxsampleclientkm.DeviceDesc = "wificxsampleclientkm Device" +wificxsampleclientkm.SVCDESC = "wificxsampleclientkm Service" diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj new file mode 100644 index 00000000..73dfb632 --- /dev/null +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + wificxsampleclientkm + + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Universal + 1 + 33 + 33 + true + 2 + 4 + 4 + true + 1 + 2 + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Universal + 1 + 33 + 33 + true + 2 + 4 + 4 + true + 1 + 2 + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Universal + 1 + 33 + 33 + true + 2 + 4 + 4 + true + 1 + 2 + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Universal + 1 + 33 + 33 + true + 2 + 4 + 4 + true + 1 + 2 + + + + + + + + + + + DbgengKernelDebugger + + + DbgengKernelDebugger + + + DbgengKernelDebugger + + + DbgengKernelDebugger + + + + sha256 + + + true + $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters new file mode 100644 index 00000000..d1dec69c --- /dev/null +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters @@ -0,0 +1,84 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + {eed063b0-f52a-4d8e-b03f-1f616b73061c} + + + {56f07a12-b9fb-4ff6-a9b5-e4af54eed417} + + + {58bc1adc-c940-478a-898b-59d217c27f36} + + + + + Driver Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\controlpath + + + Source Files\datapath + + + Source Files\datapath + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf new file mode 100644 index 00000000..6ed871d4 Binary files /dev/null and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj new file mode 100644 index 00000000..5e4d00b9 --- /dev/null +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -0,0 +1,201 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + + + + {C804D7D0-80D8-1409-44DA-91EF3260D07F} + {2177f19c-eb4c-4687-9e7f-f9eec1f12cf1} + v4.5 + 12.0 + Debug + x64 + wificxsampleclientum + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + + Windows10 + true + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + false + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + true + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + false + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + + + + + + + + + DbgengRemoteDebugger + + + DbgengRemoteDebugger + + + DbgengRemoteDebugger + + + DbgengRemoteDebugger + + + + sha256 + + + $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters new file mode 100644 index 00000000..20ff1a35 --- /dev/null +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/network/wlan/WIFICX/wificxsampleclient.sln b/network/wlan/WIFICX/wificxsampleclient.sln new file mode 100644 index 00000000..0975a4da --- /dev/null +++ b/network/wlan/WIFICX/wificxsampleclient.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 12.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientum", "um\wificxsampleclientum.vcxproj", "{C804D7D0-80D8-1409-44DA-91EF3260D07F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Build.0 = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.ActiveCfg = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Build.0 = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Deploy.0 = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.ActiveCfg = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Build.0 = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Deploy.0 = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.ActiveCfg = Release|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Build.0 = Release|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Deploy.0 = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Build.0 = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.ActiveCfg = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Build.0 = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Deploy.0 = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.ActiveCfg = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Build.0 = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Deploy.0 = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.ActiveCfg = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Build.0 = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Deploy.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {37680CDC-EACB-499B-BA11-7C376F53DB71} + EndGlobalSection +EndGlobal -- cgit v1.3.1 From fe139d460e690a27cc98bb9c077eeb5964fc7877 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 11 Nov 2025 16:07:58 -0800 Subject: have the HAL layer created for correctly demo the Interface of WIfireuqest, meanwhile have the WPPTrace enabled for both um and km --- network/wlan/WIFICX/drivercode/SharedTypes.h | 68 +- network/wlan/WIFICX/drivercode/adapter.h | 11 + network/wlan/WIFICX/drivercode/device.cpp | 16 +- network/wlan/WIFICX/drivercode/device.h | 23 +- network/wlan/WIFICX/drivercode/driver.cpp | 186 +- network/wlan/WIFICX/drivercode/driver.h | 6 + .../wlan/WIFICX/drivercode/memorymanagement.cpp | 53 +- network/wlan/WIFICX/drivercode/precomp.h | 10 +- network/wlan/WIFICX/drivercode/testdata.h | 7439 ------------------ network/wlan/WIFICX/drivercode/trace.h | 84 +- network/wlan/WIFICX/drivercode/umkmfusion.h | 7 + network/wlan/WIFICX/drivercode/wifihal.cpp | 907 +++ network/wlan/WIFICX/drivercode/wifihal.h | 31 + network/wlan/WIFICX/drivercode/wifihaltestdata.h | 8290 ++++++++++++++++++++ network/wlan/WIFICX/drivercode/wifirequest.cpp | 1405 +--- network/wlan/WIFICX/drivercode/wifirequest.h | 18 +- .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 23 +- .../wlan/WIFICX/um/wificxsampleclientum.vcxproj | 31 +- .../WIFICX/um/wificxsampleclientum.vcxproj.filters | 36 +- 19 files changed, 9585 insertions(+), 9059 deletions(-) create mode 100644 network/wlan/WIFICX/drivercode/driver.h delete mode 100644 network/wlan/WIFICX/drivercode/testdata.h create mode 100644 network/wlan/WIFICX/drivercode/wifihal.cpp create mode 100644 network/wlan/WIFICX/drivercode/wifihal.h create mode 100644 network/wlan/WIFICX/drivercode/wifihaltestdata.h diff --git a/network/wlan/WIFICX/drivercode/SharedTypes.h b/network/wlan/WIFICX/drivercode/SharedTypes.h index 237f5997..43fd815a 100644 --- a/network/wlan/WIFICX/drivercode/SharedTypes.h +++ b/network/wlan/WIFICX/drivercode/SharedTypes.h @@ -13,70 +13,4 @@ // ============================= // {bb67559a-06f6-4eb0-81e9-21fdc3b60efb} DEFINE_GUID(GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, 0xbb67559a, 0x06f6, 0x4eb0, 0x81, 0xe9, 0x21, 0xfd, 0xc3, 0xb6, 0x0e, 0xfb); -#define WIFI_DRIVER_DEFAULT_POOL_TAG 'sHIW' // WIFI IHV Sample Driver - -// ============================= -// WDF Object Context Types -// ============================= - -typedef struct _WIFI_DEVICE_CONTEXT -{ - // - // Do not add field variable before WdfTriageInfoPtr. - // NetAdapterCx carving code requires the first field of WDF context - // to be a pointer to WDF_TRIAGE_INFO. - // - void* WdfTriageInfoPtr; - WDFDEVICE WdfDevice; - UCHAR CurrentRadioState; - WDI_GET_ADAPTER_CAPABILITIES_PARAMETERS AdapterCapabilities; - TLV_CONTEXT TlvContext; - UINT32 LastConnectEntryId; - UINT32 LastConnectTransactionId; - WDI_AUTH_ALGORITHM LastAuthAlgo; - DOT11_MAC_ADDRESS ConnectedPeer; - NETADAPTER primaryStaAdapter; -} WIFI_DEVICE_CONTEXT, * PWIFI_DEVICE_CONTEXT; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_DEVICE_CONTEXT, WifiGetDeviceContext); -static_assert(FIELD_OFFSET(WIFI_DEVICE_CONTEXT, WdfTriageInfoPtr) == 0); - -// Context for each NetAdapter instance. -// Each NetAdapter instance corresponds to an IP interface -// -typedef struct _WIFI_NETADAPTER_CONTEXT -{ - PWIFI_DEVICE_CONTEXT WifiDeviceContext; // Wdf device context - NETADAPTER NetAdapter; // NetAdapter object - - LIST_ENTRY ReceiveList; - NETPACKETQUEUE TxQueue; // Tx Queue object - NETPACKETQUEUE RxQueue; // Rx Queue object - bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; -} WIFI_NETADAPTER_CONTEXT, * PWIFI_NETADAPTER_CONTEXT; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_NETADAPTER_CONTEXT, WifiGetNetAdapterContext); - -typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT -{ - size_t cbMaxSize; - _Field_size_bytes_(cbMaxSize) void* pbBuffer; -} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; -typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; - -// for FreeWdfMemoryBuffer to correct get -// the handle to free the memory -struct WIFI_IHV_MEMORY_HEADER -{ - size_t HeaderSize; - WDFMEMORY WdfMemoryHandle; -}; - -// for tracking memory leaks -struct WIFI_IHV_MEMORY_CONTEXT -{ - size_t ContextSize; - void* pvCaller; -}; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); +#define WIFI_DRIVER_DEFAULT_POOL_TAG 'shiW' // WIFI IHV Sample Driver \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h index 33a886f0..65e7e023 100644 --- a/network/wlan/WIFICX/drivercode/adapter.h +++ b/network/wlan/WIFICX/drivercode/adapter.h @@ -19,3 +19,14 @@ EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; EVT_WDF_DEVICE_CONTEXT_DESTROY MbbDestroyAdapterContext; NTSTATUS WifiCxTestAdapterStart(_In_ NETADAPTER netAdapter); + + +// Context for each "Wdi Port"[NetAdapter] instance. +// Each NetAdapter instance corresponds to an IP interface +typedef struct _WIFI_IHV_NETADAPTER_CONTEXT +{ + PWIFI_IHV_DEVICE_CONTEXT WifiDeviceContext; // Wdf Ihv device context + NETADAPTER NetAdapter; // NetAdapter object +} WIFI_IHV_NETADAPTER_CONTEXT, * PWIFI_IHV_NETADAPTER_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_NETADAPTER_CONTEXT, WifiGetIhvNetAdapterContext); diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index dbd03566..a0614807 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -1,6 +1,3 @@ -//------------------------------------------------------------------------------- -// Net Adapter source file -// // Copyright (c) Microsoft Corporation. All rights reserved. #include "precomp.h" @@ -49,21 +46,16 @@ void EvtDeviceSurpriseRemoval(WDFDEVICE device) static NTSTATUS WifiInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter) { - PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(Device); - PWIFI_NETADAPTER_CONTEXT netAdapterContext = WifiGetNetAdapterContext(NetAdapter); + PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); + PWIFI_IHV_NETADAPTER_CONTEXT netAdapterContext = WifiGetIhvNetAdapterContext(NetAdapter); NTSTATUS status = STATUS_SUCCESS; - - deviceContext->LastConnectEntryId = 0; // Disconnected State - deviceContext->LastConnectTransactionId = 0; - deviceContext->CurrentRadioState = TRUE; if (deviceContext->primaryStaAdapter == WDF_NO_HANDLE) { deviceContext->primaryStaAdapter = NetAdapter; } - InitializeListHead(&netAdapterContext->ReceiveList); netAdapterContext->WifiDeviceContext = deviceContext; - netAdapterContext->NetAdapter = NetAdapter; + return status; } @@ -78,7 +70,7 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn WDF_OBJECT_ATTRIBUTES adapterAttributes; WDF_OBJECT_ATTRIBUTES_INIT(&adapterAttributes); - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WIFI_NETADAPTER_CONTEXT); + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WIFI_IHV_NETADAPTER_CONTEXT); adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; NETADAPTER netAdapter; diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h index ba716fe6..57de18f3 100644 --- a/network/wlan/WIFICX/drivercode/device.h +++ b/network/wlan/WIFICX/drivercode/device.h @@ -1,11 +1,30 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once - +#include "wifiHAL.h" EVT_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; EVT_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; -EVT_WDF_DEVICE_SURPRISE_REMOVAL EvtDeviceSurpriseRemoval; EVT_WIFI_DEVICE_CREATE_ADAPTER EvtWifiDeviceCreateAdapter; EVT_WIFI_DEVICE_CREATE_WIFIDIRECTDEVICE EvtWifiDeviceCreateWifiDirectDevice; EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtAdapterCleanup; + +typedef struct _WIFI_IHV_DEVICE_CONTEXT +{ + // + // Do not add field variable before WdfTriageInfoPtr. + // NetAdapterCx carving code requires the first field of WDF context + // to be a pointer to WDF_TRIAGE_INFO. + // + void* WdfTriageInfoPtr; + WDFDEVICE WdfDevice; + WDI_GET_ADAPTER_CAPABILITIES_PARAMETERS AdapterCapabilities; + TLV_CONTEXT TlvContext; + UINT32 LastConnectTransactionId; + WDI_AUTH_ALGORITHM LastAuthAlgo; + NETADAPTER primaryStaAdapter; + WifiHAL* wifiHAL; +} WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_DEVICE_CONTEXT, WifiGetIhvDeviceContext); +static_assert(FIELD_OFFSET(WIFI_IHV_DEVICE_CONTEXT, WdfTriageInfoPtr) == 0); diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp index 2b0e2658..562769ef 100644 --- a/network/wlan/WIFICX/drivercode/driver.cpp +++ b/network/wlan/WIFICX/drivercode/driver.cpp @@ -1,58 +1,94 @@ -//------------------------------------------------------------------------------- -// Net Adapter source file -// // Copyright (c) Microsoft Corporation. All rights reserved. - #include "precomp.h" #include "device.h" +#include "driver.h" #include "driver.tmh" -EXTERN_C __declspec(code_seg("INIT")) DRIVER_INITIALIZE DriverEntry; -EVT_WDF_DRIVER_UNLOAD EvtDriverUnload; -EVT_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; +extern "C" +NTSTATUS DriverEntry( + _In_ PDRIVER_OBJECT driverObject, + _In_ PUNICODE_STRING registryPath) +/*++ + +Routine Description: + DriverEntry initializes the driver and is the first routine called by the + system after the driver is loaded. DriverEntry specifies the other entry + points in the function driver, such as EvtDevice and DriverUnload. + +Parameters Description: + DriverObject - represents the instance of the function driver that is loaded + into memory. DriverEntry must initialize members of DriverObject before it + returns to the caller. DriverObject is allocated by the system before the + driver is loaded, and it is released by the system after the system unloads + the function driver from memory. + RegistryPath - represents the driver specific path in the Registry. + The function driver can use the path to store driver related data between + reboots. The path does not store hardware instance specific data. -#if __cplusplus >= 201703L -#define MAYBE_UNUSED [[maybe_unused]] -#else -#define MAYBE_UNUSED -#endif +Return Value: -__declspec(code_seg("INIT")) NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT driverObject, _In_ PUNICODE_STRING registryPath) + STATUS_SUCCESS if successful, + STATUS_UNSUCCESSFUL otherwise. + +--*/ { NTSTATUS status = STATUS_SUCCESS; + WDF_DRIVER_CONFIG driverConfig{}; + WDF_OBJECT_ATTRIBUTES attributes; + // + // Initialize WPP Tracing + // WPP_INIT_TRACING(driverObject, registryPath); + + // Since WPP tracing is now initialized, we can use Trace functions TraceEntry(); - WDF_DRIVER_CONFIG driverConfig; - WDF_DRIVER_CONFIG_INIT(&driverConfig, EvtDriverDeviceAdd); - driverConfig.DriverPoolTag = WIFI_DRIVER_DEFAULT_POOL_TAG; - - driverConfig.EvtDriverUnload = EvtDriverUnload; + // + // Register a cleanup callback so that we can call WPP_CLEANUP when + // the framework driver object is deleted during driver unload. + // + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + attributes.EvtCleanupCallback = EvtWifiDriverContextCleanup; - WDFDRIVER driver; - status = WdfDriverCreate(driverObject, registryPath, WDF_NO_OBJECT_ATTRIBUTES, &driverConfig, &driver); - if (!NT_SUCCESS(status)) - { - WFCError("WdfDriverCreate failed 0x%x", status); - goto Exit; - } - -Exit: - TraceExit(status); + WDF_DRIVER_CONFIG_INIT(&driverConfig, EvtWifiDriverDeviceAdd); + driverConfig.DriverPoolTag = WIFI_DRIVER_DEFAULT_POOL_TAG; + status = WdfDriverCreate(driverObject, registryPath, &attributes, &driverConfig, WDF_NO_HANDLE); if (!NT_SUCCESS(status)) { + WFCError("WdfDriverCreate failed %!STATUS!", status); WPP_CLEANUP(driverObject); + return status; } + //TraceExit(status); + return status; } -NTSTATUS EvtDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT deviceInit) +NTSTATUS EvtWifiDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT deviceInit) +/*++ +Routine Description: + + EvtWifiDriverDeviceAdd is called by the framework in response to AddDevice + call from the PnP manager. We create and initialize a device object to + represent a new instance of the device. + +Arguments: + + Driver - Handle to a framework driver object created in DriverEntry + + DeviceInit - Pointer to a framework-allocated WDFDEVICE_INIT structure. + +Return Value: + + NTSTATUS + +--*/ { UNREFERENCED_PARAMETER(driver); @@ -60,6 +96,7 @@ NTSTATUS EvtDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT devic NTSTATUS status = STATUS_SUCCESS; + // Configure the device init for NetAdapterCx (Data Path) status = NetDeviceInitConfig(deviceInit); if (!NT_SUCCESS(status)) { @@ -67,6 +104,7 @@ NTSTATUS EvtDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT devic goto Exit; } + // Configure the device init for WifiCx (Control Path) status = WifiDeviceInitConfig(deviceInit); if (!NT_SUCCESS(status)) { @@ -74,64 +112,100 @@ NTSTATUS EvtDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT devic goto Exit; } - WDF_OBJECT_ATTRIBUTES deviceAttributes; - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, WIFI_DEVICE_CONTEXT); - + // Set PnP and Power Callbacks. + // [Scope: Only PrepareHardware and ReleaseHardware are implemented in this sample.] WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks; WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks); pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware; pnpPowerCallbacks.EvtDeviceReleaseHardware = EvtDeviceReleaseHardware; - pnpPowerCallbacks.EvtDeviceSurpriseRemoval = EvtDeviceSurpriseRemoval; - WdfDeviceInitSetPnpPowerEventCallbacks(deviceInit, &pnpPowerCallbacks); - WDFDEVICE wdfDevice; - status = WdfDeviceCreate(&deviceInit, &deviceAttributes, &wdfDevice); + // [Scope: ArmWake and DisarmWake are not implemented in this sample.] + //WDF_POWER_POLICY_EVENT_CALLBACKS powerPolicyCallbacks; + //WdfDeviceInitSetPowerPolicyEventCallbacks(deviceInit, &powerPolicyCallbacks); + + WDFDEVICE wdfIhvDevice{}; + // Create the device object context to store the device specific information + WDF_OBJECT_ATTRIBUTES ihvDeviceAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&ihvDeviceAttributes, WIFI_IHV_DEVICE_CONTEXT); + + status = WdfDeviceCreate(&deviceInit, &ihvDeviceAttributes, &wdfIhvDevice); if (!NT_SUCCESS(status)) { WFCError("WdfDeviceCreate failed, status=0x%x", status); goto Exit; } - - status = WdfDeviceCreateDeviceInterface(wdfDevice, &GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, nullptr); + + // + // Create a device interface so that applications can find and talk + // to us. + // + status = WdfDeviceCreateDeviceInterface(wdfIhvDevice, &GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, nullptr); if (!NT_SUCCESS(status)) { WFCError("WdfDeviceCreateDeviceInterface failed with status=0x%x", status); goto Exit; } - // Set the device to be not ejectable - WDF_DEVICE_PNP_CAPABILITIES pnpCapabilities; - WDF_DEVICE_PNP_CAPABILITIES_INIT(&pnpCapabilities); - pnpCapabilities.SurpriseRemovalOK = WdfTrue; - WdfDeviceSetPnpCapabilities(wdfDevice, &pnpCapabilities); - + // Initialize WifiCx device now that the WDFDEVICE has been created. + // In short the WifICx is the "wdf managed WDI", so the Wdi core + // concepts still applies. WIFI_DEVICE_CONFIG wifiDeviceConfig; WIFI_DEVICE_CONFIG_INIT( - &wifiDeviceConfig, WDI_VERSION_LATEST, EvtWifiDeviceSendCommand, EvtWifiDeviceCreateAdapter, nullptr); - - status = WifiDeviceInitialize(wdfDevice, &wifiDeviceConfig); + &wifiDeviceConfig, + WDI_VERSION_LATEST, // The "WDI" version supported by this Ihv driver + EvtWifiDeviceSendCommand, // The Wdi command and task, now called "wifirequest". + EvtWifiDeviceCreateAdapter, // The Wdi "ports", now support by the netadapter instances. + nullptr); // [Scope: No WiFi Direct support in this sample] + + // Initialize the WifiCx device with the configuration above to let OS side ready. + status = WifiDeviceInitialize(wdfIhvDevice, &wifiDeviceConfig); if (!NT_SUCCESS(status)) { WFCError("WifiDeviceInitialize failed, status=0x%x", status); goto Exit; } - PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(wdfDevice); - deviceContext->WdfDevice = wdfDevice; - deviceContext->WdfTriageInfoPtr = WdfGetTriageInfo(); + // Get a pointer to the device context structure that we just associated + // with the device object. We define this structure in the device.h + // header file. WifiGetIhvDeviceContext is an inline function generated by + // using the WDF_DECLARE_CONTEXT_TYPE_WITH_NAME macro in device.h. + // This function will do the type checking and return the device context. + // If you pass a wrong object handle it will return NULL and assert if + // run under framework verifier mode. + auto deviceIhvContext = WifiGetIhvDeviceContext(wdfIhvDevice); + deviceIhvContext->WdfDevice = wdfIhvDevice; + deviceIhvContext->WdfTriageInfoPtr = WdfGetTriageInfo(); - deviceContext->TlvContext.AllocationContext = 0; - deviceContext->TlvContext.PeerVersion = WifiDeviceGetOsWdiVersion(wdfDevice); + deviceIhvContext->TlvContext.AllocationContext = 0; + deviceIhvContext->TlvContext.PeerVersion = WifiDeviceGetOsWdiVersion(wdfIhvDevice); Exit: TraceExit(status); return status; } -void EvtDriverUnload(MAYBE_UNUSED _In_ WDFDRIVER driver) +void EvtWifiDriverContextCleanup(_In_ WDFOBJECT DriverObject) +/*++ +Routine Description: + + Free all the resources allocated in DriverEntry. + +Arguments: + + DriverObject - handle to a WDF Driver object. + +Return Value: + + VOID. + +--*/ { - TraceEntry(); - UNREFERENCED_PARAMETER(driver); - WPP_CLEANUP(WdfDriverWdmGetDriverObject(driver)); +#ifndef _KERNEL_MODE + // follow https://github.com/MicrosoftDocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/wdf/using-wpp-software-tracing-in-kmdf-and-umdf-2-drivers.md + // because UMDF drivers use the kernel-mode signatures of these macros for initializing and cleaning up tracing, the calls look identical for KMDF and UMDF. + UNREFERENCED_PARAMETER(DriverObject); +#endif // !_KERNEL_MODE + + WPP_CLEANUP(WdfDriverWdmGetDriverObject(static_cast(DriverObject))); } diff --git a/network/wlan/WIFICX/drivercode/driver.h b/network/wlan/WIFICX/drivercode/driver.h new file mode 100644 index 00000000..12820f1c --- /dev/null +++ b/network/wlan/WIFICX/drivercode/driver.h @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +#pragma once +#include "precomp.h" + +EVT_WDF_DRIVER_DEVICE_ADD EvtWifiDriverDeviceAdd; +EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/memorymanagement.cpp b/network/wlan/WIFICX/drivercode/memorymanagement.cpp index 8c6d56d0..de231d8c 100644 --- a/network/wlan/WIFICX/drivercode/memorymanagement.cpp +++ b/network/wlan/WIFICX/drivercode/memorymanagement.cpp @@ -1,36 +1,35 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - - Microsoft Confidential - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - -Module Name: - - new.cpp - -Abstract: - - Test only stub WDI driver (C++ portions) - -Environment: - - Kernel mode - -Author: - - ---*/ +// Copyright (C) Microsoft Corporation. All rights reserved. #include "precomp.h" #ifndef _KERNEL_MODE #include // for _ReturnAddress for user mode #endif // UM +typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT +{ + size_t cbMaxSize; + _Field_size_bytes_(cbMaxSize) void* pbBuffer; +} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; +typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; + +// for FreeWdfMemoryBuffer to correct get +// the handle to free the memory +struct WIFI_IHV_MEMORY_HEADER +{ + size_t HeaderSize; + WDFMEMORY WdfMemoryHandle; +}; + +// for tracking memory leaks +struct WIFI_IHV_MEMORY_CONTEXT +{ + size_t ContextSize; + void* pvCaller; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); + + void* AllocateWdfMemoryBuffer(size_t Size, _In_ void* CallerForMemoryLeakTracking) { size_t totalSize = 0; diff --git a/network/wlan/WIFICX/drivercode/precomp.h b/network/wlan/WIFICX/drivercode/precomp.h index c08123a1..f6bc3aad 100644 --- a/network/wlan/WIFICX/drivercode/precomp.h +++ b/network/wlan/WIFICX/drivercode/precomp.h @@ -1,12 +1,12 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once -//#include - #ifdef _KERNEL_MODE #include #else #include + #include // For NDIS_STATUS + #include // For NDIS_STATUS codes #include #endif // WDF Headers @@ -23,10 +23,6 @@ #include "dot11wificxtypes.hpp" #include "TLVGeneratorParser.hpp" #include "SharedTypes.h" + // WPP Tracing Headers #include "trace.h" - -//#include "device.h" -//#include "adapter.h" - -//#include "wifirequest.h" diff --git a/network/wlan/WIFICX/drivercode/testdata.h b/network/wlan/WIFICX/drivercode/testdata.h deleted file mode 100644 index f8f83f63..00000000 --- a/network/wlan/WIFICX/drivercode/testdata.h +++ /dev/null @@ -1,7439 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - - Microsoft Confidential - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - -Module Name: - - TestData.h - -Abstract: - - Test only Network data - -Environment: - - Kernel mode - -Author: - - ---*/ - -#pragma once - -#define TESTMP_BAND_IHV 0x00000010 - -typedef struct -{ - UINT32 BandId; - WDI_MAC_ADDRESS* pMacAddress; - PUCHAR pTlvBssEntry; - UINT32 TlvBssEntrySize; - PUCHAR pTlvAssociationResult; - UINT32 TlvAssociationResultSize; - -} WdiTestConnectEntry, *PWdiTestConnectEntry; - -// -//=============================================================================== -// Set alternate local addresses based on simulation parameters -//=============================================================================== -// -UCHAR s_ArubaSimLocalAddress[] = {0xd4, 0x6a, 0x6a, 0x52, 0x18, 0x07}; // For Wpa3SuiteB - Aruba -UCHAR g_IntelSimLocalAddress[] = {0x34, 0x13, 0xe8, 0xb3, 0x14, 0x4c}; // For Wpa3SuiteB - Intel -UCHAR g_SaeSimLocalAddress[] = {0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5}; // For Wpa3Sae - -#ifdef WPA3_ARUBA_SIM -PUCHAR g_AlternateLocalAddress = s_ArubaSimLocalAddress; -#elif WPA3_INTEL_SIM -PUCHAR g_AlternateLocalAddress = g_IntelSimLocalAddress; -#elif WPA3_SAE -PUCHAR g_AlternateLocalAddress = g_SaeSimLocalAddress; -#else -PUCHAR g_AlternateLocalAddress = NULL; -#endif - -// clang-format off - -// -//=============================================================================== -// - -UCHAR s_DeviceServiceTestBlob[] = -{ - 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa -}; - -// -//=============================================================================== -// - -UCHAR s_TLV_AssociationParametersRequestedType[] = -{ - // WDI_TLV_ASSOCIATION_PARAMETERS_REQUESTED_TYPE - 0xBB, 0x00, - 0x02, 0x00, - 0x9F, 0x00 // PMKID -}; - -UCHAR s_TLV_RoamingNeededIndication[] = -{ - // WDI_TLV_ROAMING_NEEDED_PARAMETERS - 0x55, 0x00, - 0x04, 0x00, - 0x0a, 0x00, 0x00, 0x00 -}; - -UCHAR s_TLV_NeighborReport[] = -{ - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ACTION_FRAME_BODY - 0xBE, 0x00, - 0x14, 0x00, - 0x05, // Category = Radio Measurement - 0x05, // Action = Neighbor Report Response - 0x01, // Dialog Token - 0x34, // Element ID = Neighbor Report - 0x0F, // Length - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, // BSSID - 0x00, 0x00, 0x00, 0x00, // BSSID Information - 0x00, // Operating class - 0x06, // Channel Number - 0x00, // PHY Type - 0x00, 0x00, // Optional IEs -}; - -// -//=============================================================================== -// - -// -//=============================================================================== -// BSs entries -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr = {0x00, 0x20, 0x30, 0x40, 0x50, 0x60}; - -UCHAR s_TLV_BSS_Entry_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - - -UCHAR s_TLV_OpenDisassociation[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0xBC, 0x00, - 0x0A, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - 0x01, 0x00, 0x00, 0x00, - - // WDI_TLV Need Peer Cleanup Params - 0xb4, 0x00, - 0x01, 0x00, - 0x00 -}; - -WDI_MAC_ADDRESS s_Connect_Addr_2_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2}; - -UCHAR s_TLV_BSS_Entry_2_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x59, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x26, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x28, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID - -}; - -UCHAR s_TLV_Success_AssociationResult_2_Open[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x25, 0x00, - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_3_WEP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3}; - -UCHAR s_TLV_BSS_Entry_3_WEP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x1f, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x03, 0x01, 0x01, // DSSS Parameter (Offset: 42) - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x3C, 0x00, 0x00, 0x00, // Link Quality (Offset: 57) - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel (Offset: 64) - 0x01, 0x00, 0x00, 0x00, // Band ID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_3_WEP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x32, 0x00, - 0x10, 0x04, // Capability - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_4_RSNA_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4}; - -#define WFA_TEST_MIN_RSN_IE 1 - -UCHAR s_TLV_BSS_Entry_4_RSNA_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type -#ifdef WFA_TEST_MIN_RSN_IE - 0x79, 0x00, //Len -#else - 0x8B, 0x00, //Len -#endif // WFA_TEST_MIN_RSN_IE - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, -#ifdef WFA_TEST_MIN_RSN_IE - 0x46, 0x00, -#else - 0x58, 0x00, -#endif // WFA_TEST_MIN_RSN_IE - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved -#ifdef WFA_TEST_MIN_RSN_IE - 0x30, 0x02, - 0x01, 0x00, -#else - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite -- RSNA_PSK - 0x00, 0x00, // RSN Capability -#endif // WFA_TEST_MIN_RSN_IE - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_4_RSNA_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x22, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x48, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x58, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_5_IHV = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5}; - -UCHAR s_TLV_BSS_Entry_5_IHV [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x1f, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x03, 0x01, 0x01, // DSSS Parameter - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x3C, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel = 36 - 0x08, 0x00, 0x00, 0x00, // Band ID = Custom -// 0x02, 0x00, 0x00, 0x00, // Band ID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_5_IHV[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x02, 0x00, 0x00, 0x80, //AuthAlgorithm = Custom - 0x01, 0x00, 0x00, 0x80, //UnicastCipherAlgorithm - 0x01, 0x00, 0x00, 0x80, //MulticastDataCipherAlgorithm - 0x01, 0x00, 0x00, 0x80, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x80, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x32, 0x00, - 0x10, 0x04, // Capability - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x24, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x02, 0x00, 0x00, 0x80, // Phy = IHV Phy 2 - -}; - - -UCHAR s_TLV_IhvRequestComplete[] = -{ - // WDI_TLV_IHV_DATA - 0xBD, 0x00, - 0x0A, 0x00, - - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0x00, 0x00, 0x01 -}; - - -UCHAR s_TLV_IhvIndication[] = -{ - // WDI_TLV_IHV_DATA - 0xBD, 0x00, - 0x30, 0x00, - - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5 -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_6_FT_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6}; - -UCHAR s_TLV_BSS_Entry_6_FT_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xEA, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xB7, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x53, 0x8D, 0x5B, - 0x2A, 0x01, - 0x00, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x85, 0x1E, - 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x4A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_6_FT_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0C, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, - - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x06, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x3E, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT - 0x0C, 0x00, // RSN Capability - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0xDD, 0x07, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0xC5, 0x00, - 0x31, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, // Supported Rates - 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x26, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT - 0x28, 0x00, // RSN Capability - 0x01, 0x00, // PMKID Count -- PMKR1Name - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x37, 0x69, // FTE IE - 0x00, 0x00, // MIC Control - 0 => no MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x06, // R1KH-ID - 0xB4, 0xC7, 0x99, 0x8A, 0xB6, 0x30, - 0x03, 0x0D, // R0KH-ID - 'a', 'p', '8', '1', '3', '2', '-', '7', '3', '4', 'E', 'B', '0', - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xB7, 0x00, - 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x6E, 0x8D, 0x5B, - 0x2A, 0x01, // ERP - 0x00, - 0x30, 0x14, // RSN - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite - 0x0C, 0x00, // RSN Capability - 0x32, 0x01, // Extended Supported Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x85, 0x1E, - 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_7_FT_PSK_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7}; - -UCHAR s_TLV_BSS_Entry_7_FT_PSK_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xED, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xBA, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x53, 0x8D, 0x5B, - 0x2A, 0x01, - 0x00, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x85, 0x1E, - 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x4A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_7_FT_PSK_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0C, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x41, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x14, // RSN IE - 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, - 0xAC, 0x01, 0x00, 0x00, - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0xDD, 0x07, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0xBF, 0x00, - 0x31, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, // Supported Rates - 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x26, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite -- FT-PSK - 0x28, 0x00, // RSN Capability - 0x01, 0x00, // PMKID Count -- PMKR1Name - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x37, 0x63, // FTE IE - 0x00, 0x02, // MIC Control - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x06, // R1KH-ID - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - 0x03, 0x07, // R0KH-ID - 'x', '@', 'y', '.', 'c', 'o', 'm', - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xBA, 0x00, - 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x6E, 0x8D, 0x5B, - 0x2A, 0x01, // ERP - 0x00, - 0x30, 0x14, // RSN - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, // Extended Supported Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x85, 0x1E, - 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00 -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_8_Hidden = {0x00, 0xA0, 0xB0, 0xC0, 0xD0,0xE8}; - -UCHAR s_TLV_BSS_Entry_Beacon_8_Hidden [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x24, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x00, // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_BSS_Entry_ProbeResponse_8_Hidden [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x5a, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x2C, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - - -UCHAR s_TLV_Success_AssociationResult_8_Hidden[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== -// -// 11ad -// -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_9_11ad_PSK = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9}; - -UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_Dmg_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x14, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // Dmg - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x17, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_9_11ad_PSK [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_10_11ad_1x = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA}; - -UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_Dmg_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x14, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // Dmg - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x17, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_10_11ad_1x [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_10_11ad_Dmg_1x [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_11_11ad_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB}; - -UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Dmg_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x05, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_11_11ad_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x71, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x36, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x2E, 0x01, - 0x08, - 0x94, 11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x53, 0x00, - 0x07, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, // DMG Capabilities - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x02, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x2C, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_11_11ad_Dmg_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x71, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x36, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x2E, 0x01, - 0x08, - 0x94, 11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x53, 0x00, - 0x07, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, // DMG Capabilities - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x02, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x2C, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== -// -// 11ax -// -//=============================================================================== - -// -// Open on 2.4 GHz -// -WDI_MAC_ADDRESS s_Connect_Addr_12_11ax_24_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC}; - - -UCHAR s_TLV_BSS_Entry_12_11ax_24_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x78, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x4A, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, - 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_Success_AssociationResult_12_11ax_24_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x28, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4E, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x45, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x43, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== - -// -// Open on 5 GHz -// -WDI_MAC_ADDRESS s_Connect_Addr_13_11ax_5_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED}; - - -UCHAR s_TLV_BSS_Entry_13_11ax_5_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x76, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x48, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x0F, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, - 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel 36 - 0x02, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_Success_AssociationResult_13_11ax_5_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0F, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4C, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0xF, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x24, 0x30, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x45, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x2C, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0xF, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -//=============================================================================== -// - -// #define SAE_MIXED_MODE 1 - -WDI_MAC_ADDRESS s_Connect_Addr_14_WPA3_SAE_CCMP = { 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32 }; - -UCHAR s_TLV_BSS_Entry_14_WPA3_SAE_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type -#ifdef SAE_MIXED_MODE - 0x91, 0x00, //Len -#else - 0x8D, 0x00, //Len -#endif // SAE_MIXED_MODE - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, -#ifdef SAE_MIXED_MODE - 0x5E, 0x00, -#else - 0x5A, 0x00, -#endif // SAE_MIXED_MODE - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved -#ifdef SAE_MIXED_MODE - 0x30, 0x18, -#else - 0x30, 0x14, -#endif // SAE_MIXED_MODE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -#ifdef SAE_MIXED_MODE - 0x02, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0x80, 0x00, // RSN Capability - no MFPR or MFPC -#else - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0xC0, 0x00, // RSN Capability = MFP-Capable -#endif // SAE_MIXED_MODE - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, -#ifdef SAE_MIXED_MODE - 0x2A, 0x01, -#else - 0x26, 0x01, -#endif // SAE_MIXED_MODE - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4A, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AMK Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AMK Suite - WPA3SAE - 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, -#ifdef SAE_MIXED_MODE - 0x5E, 0x00, -#else - 0x5A, 0x00, -#endif // SAE_MIXED_MODE - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved -#ifdef SAE_MIXED_MODE - 0x30, 0x18, -#else - 0x30, 0x14, -#endif // SAE_MIXED_MODE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Multicast Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -#ifdef SAE_MIXED_MODE - 0x02, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0x80, 0x00, // RSN Cap = MFP-Capable -#else - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0xC0, 0x00, // RSN Cap = MFP-Capable + MFP required -#endif // SAE_MIXED_MODE - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -// -// SAE-Specific definitions :: Start -// -DWORD g_dwSaeResendConfirmRequested = 0; - -UCHAR pucSAECommitResponse [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) - 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) -// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) - // [13] AP Scalar - 0x93, 0x48, 0x89, 0xab, 0x38, 0x6b, 0x72, 0xd5, 0xff, 0x0d, 0x3c, 0xaa, 0x09, 0x56, 0x50, 0x20, - 0x2b, 0xd0, 0x3e, 0x26, 0x96, 0xb5, 0x90, 0x5f, 0x7b, 0x49, 0x5f, 0x3b, 0x7d, 0xc3, 0x5b, 0x48, - - // [14] AP Element - 0x58, 0x54, 0x5e, 0x6c, 0xa0, 0xe8, 0x86, 0xef, 0xfb, 0x05, 0x2a, 0xfb, 0x63, 0x2c, 0xa2, 0x19, - 0x5b, 0xb0, 0xb0, 0xa8, 0x25, 0xe5, 0x9d, 0xba, 0x6b, 0xaa, 0x0e, 0x93, 0xaf, 0x04, 0x6e, 0xf4, - 0xc9, 0x45, 0x5f, 0xec, 0x43, 0xfe, 0x5e, 0xb0, 0x2a, 0x6b, 0x8a, 0xbc, 0x8f, 0xd7, 0x07, 0x87, - 0x87, 0x3d, 0xd1, 0xd5, 0xd7, 0xfd, 0xe3, 0x07, 0x3a, 0x4c, 0xf3, 0xc2, 0xc7, 0x6f, 0x59, 0x5c, - }; -UCHAR pucSAECommitResponseReflection [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) - 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) -// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) - // [13] AP Scalar - - 0x49, 0x5c, 0x2c, 0xb4, 0x20, 0xec, 0xc9, 0xe8, 0xe8, 0x03, 0x2d, 0x00, 0x8d, 0xab, 0x4d, 0x91, - 0x70, 0x16, 0x06, 0x28, 0x40, 0x83, 0xb9, 0x8d, 0x19, 0xc6, 0x43, 0xcb, 0x63, 0x29, 0x9f, 0x03, - - // [14] AP Element - 0x13, 0x2e, 0xfc, 0x90, 0xb9, 0xd7, 0xb5, 0xc1, 0x2a, 0x1d, 0xe9, 0x05, 0x9c, 0xb3, 0xba, 0xc8, - 0xa6, 0x93, 0xff, 0xbf, 0x23, 0x02, 0x42, 0x3e, 0x58, 0xc2, 0x0d, 0x00, 0x10, 0xe8, 0x44, 0x60, - 0x9d, 0xfc, 0x34, 0x5e, 0x98, 0x8e, 0xf2, 0x12, 0x67, 0x24, 0xd0, 0x80, 0xfb, 0x2f, 0x1e, 0x7a, - 0xe6, 0x54, 0x01, 0x00, 0x50, 0xd4, 0xfe, 0x66, 0x47, 0x62, 0xc0, 0x3c, 0x9f, 0x7a, 0x10, 0x27, - }; - -UCHAR pucSAEConfirmResponse [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x02, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (DOT11_FRAME_STATUS_ANTI_CLOGGING_TOKEN_REQUIRED) (not-Element, 2 octets) - 0x00, 0x00, // [12] SendConfirm (not-IE, 2 octets) - // [15] Confirm - 0xc7, 0xd1, 0x04, 0x94, 0x29, 0xec, 0xdf, 0x25, 0xda, 0xaa, 0x79, 0x6f, 0xda, 0xe9, 0x91, 0x9f, - 0x4b, 0x83, 0xad, 0xa3, 0x08, 0xde, 0x62, 0xca, 0xcd, 0x59, 0xfc, 0xf5, 0xc5, 0x4d, 0xeb, 0xd9, - }; - -UCHAR pucM1SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x02, // Frame Control: Version = 0x0, Type = DOT11_FRAME_TYPE_DATA, Subtype = DOT11_DATA_SUBTYPE_DATA - 0x30, 0x00, // Duration - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Address1: Receiver/Destination/STA address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address2: Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address3: Source address - 0x00, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype = DOT11_ETH_TYPE_EAPOL - // NWF_EAPOL_HEADER - 0x02, // Version = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 OR NWF_EAPOL_PROTOCOL_VERSION_V2 = 2 - 0x03, // Type = EAPOL_Key = 2 - 0x00, 0x75, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x00, 0x8a, // Info - 0x00, 0x10, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter - 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce - 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // MIC - 0x00, 0x16, // Key length - 0xdd, 0x14, // KeyData -> DOT11_INFO_ELEMENT_ID_VENDOR_SPECIFIC + Len - 0x00, 0x0f, 0xac, 0x04, // OUI -> RSN_KEY_DATA_OUI + RSN_KEY_DATA_OUI_TYPE_PMKID -> {0x00,0x0F,0xAC} + {0x04) - 0x37, 0xfb, 0x9a, 0x24, 0xc1, 0x57, 0x8c, 0xce, 0xc3, 0x60, 0x6c, 0x6f, 0x39, 0xe0, 0xb7, 0x02, // PMKID -}; - - -UCHAR pucExpectedM2SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x01, // Frame Control - 0x2c, 0x00, // Duration - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x00, 0x00, 0x07, 0x00, - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x01, // Version = bProtocolVersion = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 - 0x03, // Type = EAPOL_Key = 2 - 0x00, 0x75, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type = bKeyDesc = NWF_EAPOL_KEY_DESC_RSNA = 2 - 0x01, 0x0a, // Info = usKeyInfo, ResponseKeyInfo.Version = KEY_DESC_VERSION_AES, Type=RSN_KEY_TYPE_PAIRWISE, MIC=1, Secure=0 - 0x00, 0x00, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter - 0x80, 0xf8, 0x10, 0x83, 0x4f, 0x0f, 0x40, 0xa1, 0xe5, 0x5d, 0x51, 0x92, 0x83, 0x4f, 0x8e, 0x98, // Nonce - 0x09, 0xca, 0xd5, 0x14, 0xc6, 0x08, 0x4c, 0xa9, 0xed, 0xc3, 0xa8, 0xff, 0xce, 0xc9, 0x36, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0xa1, 0x79, 0x5f, 0x05, 0xa4, 0x12, 0x84, 0xf2, 0xf9, 0x0c, 0x79, 0x88, 0xeb, 0x92, 0x71, 0x62, // MIC - 0x00, 0x16, // Key Length - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, // Key Data = RSN - 0x00, 0x0f, 0xac, 0x08, 0x80, 0x00 - -}; - -UCHAR pucM3SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x02, // Frame Control - 0x30, 0x00, // Duration - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Receiver/Destination/STA address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x00, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x02, // Version - 0x03, // Type - 0x00, 0x97, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x13, 0xca, // Info - 0x00, 0x10, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter - 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce - 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0xa5, 0xea, 0xdc, 0xfd, 0x97, 0xc7, 0x72, 0x76, 0x24, 0xe2, 0x7e, 0x71, 0x45, 0x3a, 0x24, 0xca, // MIC - 0x00, 0x38, // Key Length - 0x6f, 0x39, 0x30, 0x2c, 0x46, 0xb4, 0x3c, 0xf8, 0x42, 0x07, 0x8e, 0xc9, 0x65, 0x05, 0x2c, 0xd0, // Encrypted Key data - 0xe1, 0x7b, 0xdd, 0x2e, 0xbd, 0x69, 0x09, 0x1e, 0x39, 0xcc, 0x1a, 0xb3, 0x6e, 0x55, 0xd1, 0xad, - 0x5c, 0x45, 0x52, 0x4b, 0x83, 0x5d, 0x39, 0xe3, 0x1c, 0xb6, 0xed, 0x35, 0x52, 0x76, 0xb1, 0xc6, - 0x5a, 0x2c, 0x96, 0x07, 0x77, 0x15, 0x15, 0x5c, -}; - - -UCHAR pucExpectedM4SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x01, // Frame Control - 0x2c, 0x00, // Duration - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x10, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x01, // Version - 0x03, // Type - 0x00, 0x5f, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x03, 0x0a, // Info - 0x00, 0x00, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Nonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0x52, 0x97, 0x0f, 0x90, 0x69, 0x7d, 0xcd, 0xeb, 0x98, 0xbf, 0xb1, 0x2a, 0xb2, 0x3e, 0xcc, 0x49, // MIC - 0x00, 0x00, // Key Length -}; - -// -// SAE-Specific definitions :: End -// - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_15_WPA2PSK_SHA256 = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF}; - -UCHAR s_TLV_BSS_Entry_15_WPA2PSK_SHA256 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x91, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x5e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'H', 'A', '2', '5', '6', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x06, // AKM Suite - 0xCC, 0x00, // RSN Capability - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x28, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x48, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AMK Suite Count - 0x00, 0x0F, 0xAC, 0x06, // AMK Suite - WPA2PSK_SHA256 - 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x5e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0xCC, 0x00, // RSN Capability - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -#ifdef WPA3_ARUBA_SIM -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5}; // For Aruba -#elif WPA3_INTEL_SIM -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a}; // For Intel -#else -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0}; -#endif - -UCHAR s_TLV_BSS_Entry_16_WPA3_SUITEB [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x97, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length -#ifdef WPA3_ARUBA_SIM - 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba -#elif WPA3_INTEL_SIM - 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel -#else - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, -#endif - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x64, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_16_WPA3_SUITEB[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x3A, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, -#ifdef WPA3_ARUBA_SIM - 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba -#elif WPA3_INTEL_SIM - 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel -#else - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, -#endif - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_ENT_192 = 8 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x54, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x64, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// -// 6 GHz -// -//=============================================================================== - -// -// RNR IE has the following format (only care about TBTT length = 8 or 12): -// 0xc9, 0x -// 0x -> 2 bytes (contains number and size of each element) -// 0x, 0x -> 2 bytes (applies to all element in this list) -// 0x -> 1 byte -// 0x -> 6 bytes -// [0x] -> 4 bytes -// 0x -> 1 byte -// - -// -// Mac addresses have the following nomenclature for 6GHz Ssids -// -// 1st 3 bytes are 0x00 0xA1, 0xB0 -// 4th byte is for SSID: -// 01 = 6E__1 -// 02 = 6E__2 -// 03 = SSID3 -// 04 = SSID4 -// 5th Byte is for band: -// 02 = 2.4 GHz -// 05 = 5 GHz -// 06 = 6 GHz -// 6th byte is instance -// 01 = 1st instance -// 02 - 2nd instance -// : -// - -//=============================================================================== -// SIX_G: 6E__1: -// (1 * 2.4 GHz) + (1 * 5 GHz) + (2 * 6 GHz) -// 2.4 GHz: -// S1_24_1: S1_5_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) -// 5 GHz: -// S1_5_1: S1_24_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) -// 6 GHz: -// S1_6_1: S1_24_1 (In) + S1_5_1 (In) -// S1_6_2: S1_24_1 (In) + S1_5_1 (In) -//=============================================================================== - -// -// 6E__1: 1 * 2.4 GHz Bss's -// 1 RNR IE with 3 entries: Band:Channel = [5:36 + 6:101 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_17_6G_S1_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01}; -UCHAR s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xE9, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xB6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x01, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel / Freq = 2412 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0B, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x01, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x01, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 1 * 5 GHz Bss's -// 1 RNR IE with 3 entries: Band:Channel = [2.4:1 + 6:101 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_18_6G_S1_5_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01}; -UCHAR s_TLV_BSS_Entry_18_6G_S1_5_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xe9, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x24, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel / Freq = 36 / 5180 MHz - 0x02, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0B, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x24, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x24, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 1/2 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_19_6G_S1a_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_19_6G_S1a_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x65, 0x00, 0x00, 0x00, // Channel / Freq = 101 / 6445 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xfD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x65, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x65, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 2/2 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_20_6G_S1b_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02}; -UCHAR s_TLV_BSS_Entry_20_6G_S1b_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x85, 0x00, 0x00, 0x00, // Channel / Freq = 133 / 6605 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x85, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// SIX_G: 6E__2: -// (1 * 2.4 GHz) + (1 * 5 GHz) + (1 * 6 GHz) -// 2.4 GHz: -// S2_24_1: S2_5_1 (In+Out) + [S2_6_2 (Out)] -// 5 GHz: -// S2_5_1: S2_24_1 (In+Out) + S2_6_1 (Out) + [S2_6_2 (Out)] -// 6 GHz: -// S2_6_1: S2_5_1 (In) -//=============================================================================== - -// -// 6E__2: 1 * 2.4 GHz Bss's -// 2 RNR IEs with 1 entry each: Band:Channel = [5:44] + [6:101] -// -WDI_MAC_ADDRESS s_Connect_Addr_21_6G_S2_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x24, 0x01}; -UCHAR s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xD3, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xA0, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x06, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x0c, // RNR IE - 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x0c, // RNR IE - 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel / Freq = 2437 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xF5, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x06, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xa0, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x06, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x0c, // RNR IE - 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x0c, // RNR IE - 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__2: 1 * 5 GHz Bss's -// 3 RNR IEs with 1 entry each: Band:Channel = [2.4:6] + [6:101] + [6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_22_6G_S2_5_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01}; -UCHAR s_TLV_BSS_Entry_22_6G_S2_5_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xed, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xba, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x2c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz - 0xc9, 0x10, // RNR IE - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x2c, 0x00, 0x00, 0x00, // Channel / Freq = 44 / 5220 MHz - 0x02, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0F, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x2c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xba, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x2c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x10, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz - 0xc9, 0x10, // RNR IE - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz - - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__2: 1 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_23_6G_S2_6_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_23_6G_S2_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x79, 0x00, 0x00, 0x00, // Channel / Freq = 121 / 6545 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x79, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// SIX_G: SSID3: -// (1 * 2.4 GHz) -// 2.4 GHz: -// S3_24_1: *S2_5_1 (Out)* -//=============================================================================== - -// -// SSID3: 1 * 2.4 GHz Bss's -// 2 RNR IEs with 1 entry each Band:Channel = [5:44 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_24_6G_S3_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01}; -UCHAR s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xDB, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xa8, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x0a, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel / Freq = 2457 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x0a, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xa8, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x0a, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== -// SIX_G: SSID4 (non-colocated AP): -// (1 * 6 GHz) -// 6 GHz: -// S4_6_1: -//=============================================================================== - -// -// SSID4: 1 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_25_6G_S4_6_Ghz = {0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_25_6G_S4_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0xe5, 0x00, 0x00, 0x00, // Channel / Freq = 229 / 7085 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0xe5, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// WDI_OWE_RNR -//=============================================================================== - - -/// WDI_OWE_RNR -/// -/// Description -/// - Non-Transition mode OWE network -/// - Advertises Reduced Neighbor Reports (RNRs) for the OWE Transition Mode BSSes WDI_OWE_TM_OWE and WDI_OWE_TM_OPEN -/// - Note: The OWE TM BSSes do not advertise RNR IEs -/// - Definitions for these two Transition Mode networks follows this one -/// -/// Intention -/// - Test Non-Transition Mode OWE networks -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving beacon or probe -/// - Since the networks are indicated in order during scans (i.e. the OWE TM networks will be indicated after this one) -/// it is expected that RNR for the OWE TM networks will be received before their beacons and probes. -/// -/// Expectation -/// - Scan results display WDI_OWE_RNR as an Enhanced Open network to which connections are supported -/// - The RNR will not effect connections to or display of OWE Transition Mode networks that it contains -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_26_OWE_With_RNR = {00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF}; -UCHAR s_TLV_BSS_Entry_26_OWE_With_RNR [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xB6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x83, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0B, // SSID - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'R', 'N', 'R', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE - 0xC0, 0x00, // RSN Capability - MFP Req + Capable - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B - 0x00, // TBTT Offset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // MAC Address --> OWE Transition Mode OWE (Defined below) - 0xFD, 0x1F, 0x3F, 0x49, // Short SSID for WDI_OWE_TM_OWE - 0x00, // BssParameters - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B - 0x00, // TBTT Offset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // MAC Address --> OWE Transition Mode Open (Defined below) - 0x21, 0x24, 0x6C, 0x85, // Short SSID for WDI_OWE_TM_OPEN - 0x00, // BssParameters - - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_26_OWE_With_RNR [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0xFF, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, // Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/// WDI_OWE_TM_OWE -/// Description -/// - OWE BSS of OWE Transition Mode network -/// - Auth Type is OWE -/// - Partner BSS is the OWE Transition Mode Open BSS "WDI_OWE_TM_OPEN" -/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS -/// - Listed in RNR of BSS WDI_OWE_RNR -/// - RNR IEs are not avertised by this BSS -/// -/// Intention -/// - Test OWE Transition Mode -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe -/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. -/// -/// Expectation -/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS -/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their -/// support for OWE, while also allowing the most secure connection to be made. -/// -/// - The UI will display: -/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) -/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected -/// - Security Description: "Enhanced Open" -/// - "Secured" or a lock icon should not be displayed -/// - No password prompt on connect -/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry -/// - In the entry containing the BSSID of the OWE TM OWE BSS, "netsh wlan show networks mode=bss" displays -/// - SSID: "WDI_OWE_TM_OPEN" -/// - Authentication: OWE -/// - Encryption: CCMP -/// - MFP Required: 1 -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_27_OWE_TM_OWE = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00}; -UCHAR s_TLV_BSS_Entry_27_OWE_TM_OWE [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xA1, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x6e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE - 0xC0, 0x00, // RSN Capability - MFP Req + Capable - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - 0xDD, 0x1A, // Vendor specific - OWE Transition Mode - 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // Partner BSS BSSID - 0x0F, // Partner BSS SSID Length - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', // Partner BSS SSID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented simulated OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_27_OWE_TM_OWE [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0x00, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/// WDI_OWE_TM_OPEN -/// Description -/// - Open BSS of OWE Transition Mode network -/// - Open network -/// - Partner BSS is the OWE Transition Mode OWE BSS "WDI_OWE_TM_OWE" -/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS -/// - Listed in RNR of BSS WDI_OWE_RNR -/// - RNR IEs are not avertised by this BSS -/// -/// Intention -/// - Test OWE Transition Mode -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe -/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. -/// -/// Expectation -/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS -/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their -/// support for OWE, while also allowing the most secure connection to be made. -/// -/// - The UI will display: -/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) -/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected -/// - Security Description: "Enhanced Open" -/// - "Secured" or a lock icon should not be displayed -/// - No password prompt on connect -/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry -/// - In the entry containing the BSSID of this BSS, "netsh wlan show networks mode=bss" displays -/// - SSID: (Hidden) -/// - Authentication: Open -/// - Encryption: None -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_28_OWE_TM_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01}; -UCHAR s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x95, 0x00, // Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x62, 0x00, // Length - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x0F, // SSID - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - 0xDD, 0x19, // Vendor specific - OWE Transition Mode - 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // Partner BSS BSSID - 0x0E, // Partner BSS SSID Length - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'W', 'E', // Partner BSS SSID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_28_OWE_TM_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -//=============================================================================== -// -// Wi-Fi 7 -// -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_29_WiFi7_Mixed_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02}; -WDI_MAC_ADDRESS s_Connect_Addr_30_WiFi7_Mixed_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03}; -WDI_MAC_ADDRESS s_Connect_Addr_31_WiFi7_Mixed_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04}; -WDI_MAC_ADDRESS s_Connect_Addr_32_WiFi7_Mixed_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05}; - -UCHAR s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xfa, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // Link 1 MAC address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xc7, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x32, 0x01, // DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0xFB, // BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0x30, 0x2a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x03, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x03, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xc0, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x7e, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address - // STA Profile - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, - 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address - // STA Profile - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x9b, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x32, 0x01, - 0xFB, // H2E Only - 0x30, 0x2a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x03, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x03, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : MAC address - // STA Profile - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_33_WiFi7_Open_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06}; -WDI_MAC_ADDRESS s_Connect_Addr_34_WiFi7_Open_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07}; -WDI_MAC_ADDRESS s_Connect_Addr_35_WiFi7_Open_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08}; -WDI_MAC_ADDRESS s_Connect_Addr_36_WiFi7_Open_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09}; - -UCHAR s_TLV_BSS_Entry_34_WiFi7_Open_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xca, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x97, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x01, 0x00, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x9d, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xb3, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x75, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xff, 0x3d, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] - 0x0b, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) - // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] - 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address - // STA Profile - // Remaining STA Profile for Link 2 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length = 21 - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address - // STA Profile - // Remaining STA Profile for Link 3 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 2 MAC address - // STA Profile - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x97, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x01, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address - // STA Profile - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_37_WiFi7_Only_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a}; -WDI_MAC_ADDRESS s_Connect_Addr_38_WiFi7_Only_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b}; -WDI_MAC_ADDRESS s_Connect_Addr_39_WiFi7_Only_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c}; -WDI_MAC_ADDRESS s_Connect_Addr_40_WiFi7_Only_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d}; - -UCHAR s_TLV_BSS_Entry_38_WiFi7_Only_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xe8, 0x00, //Len - - // WDI_TLV_BSSID = 10 = 0xa - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // Link 1 MAC address - - // WDI_TLV_BEACON_FRAME = 143 = 0x8f - 0x0a, 0x00, - 0xb5, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x30, 0x1a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x32, 0x01, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x32, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - - 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xaf, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x7f, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address - // STA Profile - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, - 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address - // STA Profile - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x89, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : MAC address - // STA Profile - 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== -// DualSta networks -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_41_DualSta_5Ghz = {0x00, 0x51, 0x30, 0x40, 0x50, 0x60}; -UCHAR s_TLV_BSS_Entry_41_DualSta_5Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - -// ----- - -WDI_MAC_ADDRESS s_Connect_Addr_42_DualSta_6Ghz = {0x00, 0x52, 0x30, 0x40, 0x50, 0x60}; -UCHAR s_TLV_BSS_Entry_42_DualSta_6Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x09, 0x00, 0x00, 0x00, // Channel - 0x05, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -//=============================================================================== - -// clang-format on diff --git a/network/wlan/WIFICX/drivercode/trace.h b/network/wlan/WIFICX/drivercode/trace.h index 7bbda1fa..39b9033d 100644 --- a/network/wlan/WIFICX/drivercode/trace.h +++ b/network/wlan/WIFICX/drivercode/trace.h @@ -5,16 +5,16 @@ #ifndef TRACE_H #define TRACE_H -//extern "C" -//{ -//#include -//} #define WPP_USE_TRACE_LEVELS // 21BA7B61-05F8-41F1-9048-C09493DCFE38 #define WPP_CONTROL_GUIDS \ WPP_DEFINE_CONTROL_GUID(WdiLibraryCtlGuid, (21BA7B61, 05F8, 41F1, 9048, C09493DCFE38), WPP_DEFINE_BIT(DUMMY)) +//#define WPP_LEVEL_EXP_ENABLED(LEVEL, EXP) WPP_LEVEL_ENABLED(LEVEL) +//#define WPP_LEVEL_EXP_LOGGER(LEVEL, EXP) WPP_LEVEL_LOGGER(LEVEL) + + #define WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags) WPP_CONTROL(WPP_BIT_##flags).AutoLogContext, lvl, WPP_BIT_##flags #define WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags) \ (WPP_LEVEL_ENABLED(lvl) || lvl < TRACE_LEVEL_VERBOSE || WPP_CONTROL(WPP_BIT_##flags).AutoLogVerboseEnabled) @@ -36,7 +36,6 @@ #define WFCError(Format, ...) #define WFCInfo(Format, ...) - // begin_wpp config // USEPREFIX (TraceEntry, "%!STDPREFIX!"); // FUNC TraceEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); @@ -66,62 +65,6 @@ // end_wpp // -// -// C++ with Activity ID function entry/exit commands -// -// begin_wpp config -// -// USEPREFIX (TraceActEntry, "%!STDPREFIX! [O:%p][A:%x]", this, this->get_ActivityId()); -// FUNC TraceActEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); -// USESUFFIX (TraceActEntry, "--> %!FUNC!"); -// -// USEPREFIX (TraceActExit, "%!STDPREFIX! [O:%p][A:%x]", this, this->get_ActivityId()); -// FUNC TraceActExit{LEVEL=TRACE_LEVEL_VERBOSE}(EXP); -// USESUFFIX (TraceActExit, "<-- %!FUNC!: 0x%x", EXP); -// -// end_wpp -// - -// -// C++ with Activity ID trace commands -// -// begin_wpp config -// -// USEPREFIX (WFCActError, "%!STDPREFIX! [O:%p][A:%x][ERROR]", this, this->get_ActivityId()); -// FUNC WFCActError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); -// -// USEPREFIX (WFCActErrorStatus, "%!STDPREFIX! [O:%p][A:%x][ERROR=%x]", this, this->get_ActivityId(), status); -// FUNC WFCActErrorStatus{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); -// -// USEPREFIX (WFCActInfo, "%!STDPREFIX! [O:%p][A:%x][INFO]", this, this->get_ActivityId()); -// FUNC WFCActInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); -// -// USEPREFIX (WFCActTrace, "%!STDPREFIX! [O:%p][A:%x][TRACE]", this, this->get_ActivityId()); -// FUNC WFCActTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); -// -// end_wpp -// - -// -// C++ with Port ID trace commands -// -// begin_wpp config -// -// USEPREFIX (WFCPortError, "%!STDPREFIX! [O:%p][P:%x][ERROR]", this, this->GetPortId()); -// FUNC WFCPortError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); -// -// USEPREFIX (WFCPortErrorStatus, "%!STDPREFIX! [O:%p][P:%x][ERROR=%x]", this, this->GetPortId(), status); -// FUNC WFCPortErrorStatus{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); -// -// USEPREFIX (WFCPortInfo, "%!STDPREFIX! [O:%p][P:%x][INFO]", this, this->GetPortId()); -// FUNC WFCPortInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); -// -// USEPREFIX (WFCPortTrace, "%!STDPREFIX! [O:%p][P:%x][TRACE]", this, this->GetPortId()); -// FUNC WFCPortTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); -// -// end_wpp -// - #define MACRO_START \ do \ { @@ -130,12 +73,12 @@ while (0) // -// WPP Macros: WX_RETURN_IF_NOT_NT_SUCCESS_MSG +// WPP Macros: WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG // // begin_wpp config -// FUNC WX_RETURN_IF_NOT_NT_SUCCESS_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(NTEXPR,MSG,...); -// USEPREFIX (WX_RETURN_IF_NOT_NT_SUCCESS_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); -// USESUFFIX (WX_RETURN_IF_NOT_NT_SUCCESS_MSG, " [status=%!STATUS!]", nt__wpp); +// FUNC WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(NTEXPR,MSG,...); +// USEPREFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); +// USESUFFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, " [status=%!STATUS!]", nt__wpp); // end_wpp #define WPP_COMPNAME_LEVEL_NTEXPR_PRE(comp, level, ntexpr) \ @@ -155,7 +98,7 @@ // // begin_wpp config // FUNC WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR2,MSG,...); -// USEPREFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); +// USEPREFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); // USESUFFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!s! is null", #PTR2); // end_wpp @@ -175,7 +118,7 @@ // // begin_wpp config // FUNC WX_RETURN_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR3,MSG,...); -// USEPREFIX (WX_RETURN_IF_NULL_MSG, "%!STDPREFIX! !! WifiCx - %!FUNC!: "); +// USEPREFIX (WX_RETURN_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); // USESUFFIX (WX_RETURN_IF_NULL_MSG, "%!s! is null", #PTR3); // end_wpp @@ -233,14 +176,7 @@ __inline ByteArray log_lenstr(ULONG len, const void* buf) // // DEFINE_CPLX_TYPE(MACADDR, WPP_LOGMACADDR, DOT11_MAC_ADDRESS, ItemMACAddr,"s", _MAC_, 0); // -// CUSTOM_TYPE(WFC_RX_PEER_STATE, ItemEnum(_WFC_RX_PEER_STATE)); -// // CUSTOM_TYPE(MESSAGE_ID, ItemEnum(WDI_TLV::ENUMS::MESSAGE_ID)); -// CUSTOM_TYPE(WFC_PORT_PROPERTY_NAME, ItemEnum(WFC_PORT_PROPERTY_NAME)); -// CUSTOM_TYPE(DisconnectInDxReason, ItemEnum(CSetPowerJob::DisconnectInDxReason)); -// CUSTOM_TYPE(WFC_JOB_TYPE, ItemEnum(_WFC_JOB_TYPE)); -// CUSTOM_TYPE(ConfigurableActionFrameWakePatterns, ItemEnum(ConfigurableActionFrameWakePatterns)); -// CUSTOM_TYPE(WFC_PORT_TYPE, ItemEnum(_WFC_PORT_TYPE)); // end_wpp // diff --git a/network/wlan/WIFICX/drivercode/umkmfusion.h b/network/wlan/WIFICX/drivercode/umkmfusion.h index cc74cd83..f94454f8 100644 --- a/network/wlan/WIFICX/drivercode/umkmfusion.h +++ b/network/wlan/WIFICX/drivercode/umkmfusion.h @@ -24,6 +24,13 @@ namespace Wifi return SUCCEEDED(hr) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } + _inline + NTSTATUS ConvertNDISSTATUSoNTSTATUS(NDIS_STATUS ndisStatus) { + + return ndisStatus > 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + } + + _Must_inspect_result_ _inline NTSTATUS SizeTAddSafe(_In_ size_t Augend, _In_ size_t Addend, _Out_ _Deref_out_range_(== , Augend + Addend) size_t* pResult) diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp new file mode 100644 index 00000000..824ab6ac --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -0,0 +1,907 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#include "precomp.h" +#include "wifirequest.h" +#include "wifiHALtestdata.h" +#include "WifiHal.h" +#include "WifiHal.tmh" + +NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) +{ + WIFI_DEVICE_CAPABILITIES deviceCaps = {}; + WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); + + deviceCaps.HardwareRadioState = TRUE; + deviceCaps.SoftwareRadioState = TRUE; + deviceCaps.FirmwareVersion[MAX_FIRMWARE_VERSION_LENGTH]; + deviceCaps.ActionFramesSupported = TRUE; + deviceCaps.NumRxStreams = 1; + deviceCaps.NumTxStreams = 1; + deviceCaps.Support_eCSA = FALSE; + deviceCaps.MACAddressRandomization = FALSE; + deviceCaps.MACAddressRandomizationMask.Address[0] = 0; + deviceCaps.MACAddressRandomizationMask.Address[1] = 0; + deviceCaps.MACAddressRandomizationMask.Address[2] = 0; + deviceCaps.MACAddressRandomizationMask.Address[3] = 0xFF; + deviceCaps.MACAddressRandomizationMask.Address[4] = 0; + deviceCaps.MACAddressRandomizationMask.Address[5] = 0; + deviceCaps.BluetoothCoexistenceSupport = WDI_BLUETOOTH_COEXISTENCE_PERFORMANCE_MAINTAINED; + deviceCaps.SupportsNonWdiOidRequests = FALSE; + deviceCaps.FastTransitionSupported = TRUE; + deviceCaps.MU_MIMOSupported = FALSE; + deviceCaps.SAEAuthenticationSupported = TRUE; + deviceCaps.BSSTransitionSupported = TRUE; + deviceCaps.MBOSupported = FALSE; + deviceCaps.BeaconReportsImplemented = FALSE; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetDeviceCapabilities(Device, &deviceCaps), + "Failed to set device capabilities"); + + WIFI_STATION_CAPABILITIES StationCaps = {}; + WIFI_STATION_CAPABILITIES_INIT(&StationCaps); + + StationCaps.ScanSSIDListSize = 4; + StationCaps.DesiredSSIDListSize = 1; + StationCaps.PrivacyExemptionListSize = 1; + StationCaps.KeyMappingTableSize = 32; + StationCaps.DefaultKeyTableSize = 4; + StationCaps.WEPKeyValueMaxLength = 0x20; + StationCaps.MaxNumPerSTA = 4; + StationCaps.SupportedQOSFlags = 0; + StationCaps.HostFIPSModeImplemented = FALSE; + StationCaps.MFPCapable = TRUE; + StationCaps.AutoPowerSaveMode = FALSE; + StationCaps.BSSListCachemanagement = FALSE; + StationCaps.ConnectBSSSelectionOverride = FALSE; + StationCaps.MaxNetworkOffloadListSize = 0; + StationCaps.HESSIDConnectionSupported = FALSE; + StationCaps.FTMAsInitiatorSupport = FALSE; + StationCaps.FTMNumberOfSupportedTargets = 0; + + const DOT11_AUTH_CIPHER_PAIR UnicastAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_WEP}, + {DOT11_AUTH_ALGO_WPA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_TKIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_CCMP}, + }; + + const DOT11_AUTH_CIPHER_PAIR McastMgmtAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_BIP_GMAC_256}, + }; + + StationCaps.NumSupportedUnicastAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.UnicastAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastDataAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.MulticastDataAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastMgmtAlgorithms = ARRAYSIZE(McastMgmtAlgos); + StationCaps.MulticastMgmtAlgorithmsList = const_cast(McastMgmtAlgos); + + WIFI_STA_BANDS_COMBINATION SecondaryStaBandsCombinations[] = { + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {3, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN}}, + }; + + StationCaps.NumSecondaryStaBandCombinations = ARRAYSIZE(SecondaryStaBandsCombinations); + StationCaps.SecondaryStaBandsCombinations = SecondaryStaBandsCombinations; + + WDI_MAC_ADDRESS MLOAddresses[] = { + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, + }; + StationCaps.MaxMLOLinksSupported = ARRAYSIZE(MLOAddresses); + StationCaps.MLOAddressesList = MLOAddresses; + + RSNA_AKM_SUITE AkmsList[] = { + rsna_akm_1x, + rsna_akm_psk, + rsna_akm_ft_1x_sha256, + rsna_akm_ft_psk_sha256, + rsna_akm_1x_sha256, + rsna_akm_psk_sha256, + rsna_akm_sae_pmk256, + rsna_akm_1x_suite_b_sha384, + rsna_akm_owe, + rsna_akm_1x_sha384, + rsna_akm_sae_pmk384, + }; + StationCaps.NumAkmsSupported = ARRAYSIZE(AkmsList); + StationCaps.AkmsList = AkmsList; + + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)) + { + StationCaps.MSCSSupported = true; + } + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)) + { + StationCaps.DSCPToUPMappingSupported = true; + } + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetStationCapabilities(Device, &StationCaps), + "Failed to set station capabilities"); + + WIFI_BAND_CAPABILITIES BandCaps = {}; + WIFI_BAND_CAPABILITIES_INIT(&BandCaps); + + const WDI_PHY_TYPE Phy24GHz[] = { WDI_PHY_TYPE_ERP, WDI_PHY_TYPE_HE }; // g, ax + const WDI_PHY_TYPE Phy5GHz[] = { WDI_PHY_TYPE_OFDM, WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // a, ax, be + const WDI_PHY_TYPE Phy6GHz[] = { WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // ax, be + const WDI_PHY_TYPE pPhy60GHz[] = { WDI_PHY_TYPE_DMG }; // ad + const WDI_PHY_TYPE phyIHV[2] = { WDI_PHY_TYPE_OFDM, static_cast(WDI_PHY_TYPE_IHV_START + 1) }; + + // clang-format off + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap24[] = { + {1, 2412}, + {2, 2417}, + {3, 2422}, + {4, 2427}, + {5, 2432}, + {6, 2437}, + {7, 2442}, + {8, 2447}, + {9, 2452}, + {10, 2457}, + {11, 2462}, + {12, 2467}, // Not used in US + {13, 2472}, // Not used in US + {14, 2484}, // Allowed in Japan only + }; + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap5[] = { + {7, 5035}, // Not used in US + {8, 5040}, // Not used in US + {9, 5045}, // Not used in US + {11, 5055}, // Not used in US + {12, 5060}, // Not used in US + {16, 5080}, // Not used in US + {32, 5160}, // Unknown status + {34, 5170}, // Not used in US + {36, 5180}, + {38, 5190}, + {40, 5200}, + {42, 5210}, + {44, 5220}, + {46, 5230}, + {48, 5240}, + {50, 5250}, // DFS + {52, 5260}, // DFS + {54, 5270}, // DFS + {56, 5280}, // DFS + {58, 5290}, // DFS + {60, 5300}, // DFS + {62, 5310}, // DFS + {64, 5320}, // DFS + {68, 5340}, // Unknown status + {96, 5480}, // Unknown status + {100, 5500}, // DFS + {102, 5510}, // DFS + {104, 5520}, // DFS + {106, 5530}, // DFS + {108, 5540}, // DFS + {110, 5550}, // DFS + {112, 5560}, // DFS + {114, 5570}, // DFS + {116, 5580}, // DFS + {118, 5590}, // DFS + {120, 5600}, // DFS + {122, 5610}, // DFS + {124, 5620}, // DFS + {126, 5630}, // DFS + {128, 5640}, // DFS + {132, 5660}, // DFS + {134, 5670}, // DFS + {136, 5680}, // DFS + {138, 5690}, // DFS + {140, 5700}, // DFS + {142, 5710}, // DFS + {142, 5720}, // DFS + {144, 5730}, // DFS + {149, 5745}, + {151, 5755}, + {153, 5765}, + {155, 5785}, + {157, 5785}, + {159, 5795}, + {161, 5805}, + {165, 5825}, + {169, 5845}, // Not used in US + {173, 5865}, // Not used in US + {183, 4915}, // Not used in US + {184, 4920}, // Not used in US + {185, 4925}, // Not used in US + {187, 4935}, // Not used in US + {188, 4940}, // Not used in US + {189, 4945}, // Not used in US + {192, 4960}, // Not used in US + {196, 4980}, // Not used in US + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap6[] = { + {1, 5955}, + {5, 5975}, // PSC Channel (1) + {9, 5995}, + + {13, 6015}, + {17, 6035}, + {21, 6055}, // PSC Channel (2) + {25, 6075}, + {29, 6095}, + + {33, 6115}, + {37, 6135}, // PSC Channel (3) + {41, 6155}, + {45, 6175}, + {49, 6195}, + + {53, 6215}, // PSC Channel (4) + {57, 6235}, + {61, 6255}, + {65, 6275}, + {69, 6295}, // PSC Channel (5) + + {73, 6315}, + {77, 6335}, + {81, 6355}, + {85, 6375}, // PSC Channel (6) + {89, 6395}, + + {93, 6415}, + {97, 6435}, + {101, 6455}, // PSC Channel (7) + {105, 6475}, + {109, 6495}, + + {113, 6515}, + {117, 6535}, // PSC Channel (8) + {121, 6555}, + {125, 6575}, + {129, 6595}, + + {133, 6615}, // PSC Channel (9) + {137, 6635}, + {141, 6655}, + {145, 6675}, + {149, 6695}, // PSC Channel (10) + + {153, 6715}, + {157, 6735}, + {161, 6755}, + {165, 6775}, // PSC Channel (11) + {169, 6795}, + + {173, 6815}, + {177, 6835}, + {181, 6855}, // PSC Channel (12) + {185, 6875}, + {189, 6895}, + + {193, 6915}, + {197, 6935}, // PSC Channel (13) + {201, 6955}, + {205, 6975}, + {209, 6995}, + + {213, 7015}, // PSC Channel (14) + {217, 7035}, + {221, 7055}, + {225, 7075}, + {229, 7095}, // PSC Channel (15) + + {233, 7115}, + {237, 7135}, + {241, 7155}, + {245, 7175}, + {249, 7195}, + + {253, 7215}, + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap60[] = { + {1, 58320}, + {2, 60480}, + {3, 62640}, + {4, 64800}, + {5, 66960}, + {6, 69120}, + }; + + // clang-format on + + UINT32 ChannelWidth10Mhz = 10; + UINT32 ChannelWidth20Mhz = 20; + UINT32 channelWidth2160Mhz = 2160; + UINT32 pChannelWidth6Ghz[] = { 20, 40, 80, 160, 320 }; + + WIFI_BAND_INFO BandInfo[4] = {}; // Upto 4 bands + UINT32 bandInfoCount = 0; + + if (m_SupportedBands & WDI_BAND_ID_2400) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_2400; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy24GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy24GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap24); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap24); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth10Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 1); + + if (m_SupportedBands & WDI_BAND_ID_5000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_5000; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy5GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy5GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap5); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap5); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth20Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 2); + + if (m_SupportedBands & WDI_BAND_ID_6000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_6000; // 6 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy6GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy6GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap6); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap6); + BandInfo[bandInfoCount].NumChannelWidths = ARRAYSIZE(pChannelWidth6Ghz); + BandInfo[bandInfoCount].ChannelWidthList = pChannelWidth6Ghz; + bandInfoCount++; + } + + NT_ASSERT(bandInfoCount <= 3); + if (m_SupportedBands & WDI_BAND_ID_60000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_60000; // 60 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(pPhy60GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(pPhy60GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap60); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap60); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &channelWidth2160Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 4); + + BandCaps.NumBands = bandInfoCount; + BandCaps.BandInfoList = BandInfo; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetBandCapabilities(Device, &BandCaps), + "Failed to set band capabilities"); + + WIFI_PHY_CAPABILITIES PhyCaps = {}; + WIFI_PHY_CAPABILITIES_INIT(&PhyCaps); + + WIFI_PHY_INFO PhyInfoList[3]; + + const WDI_DATA_RATE_ENTRY DataRateListErp[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 4}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 22}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListOfdm[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListEht[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + + PhyInfoList[0].PhyType = WDI_PHY_TYPE_ERP; + PhyInfoList[0].NumberDataRateEntries = ARRAYSIZE(DataRateListErp); + RtlCopyMemory(&PhyInfoList[0].DataRateList, &DataRateListErp, sizeof(DataRateListErp)); + + PhyInfoList[1].PhyType = WDI_PHY_TYPE_HE; + PhyInfoList[1].NumberDataRateEntries = ARRAYSIZE(DataRateListOfdm); + RtlCopyMemory(&PhyInfoList[1].DataRateList, &DataRateListOfdm, sizeof(DataRateListOfdm)); + + PhyInfoList[2].PhyType = WDI_PHY_TYPE_EHT; + PhyInfoList[2].NumberDataRateEntries = ARRAYSIZE(DataRateListEht); + RtlCopyMemory(&PhyInfoList[2].DataRateList, &DataRateListEht, sizeof(DataRateListEht)); + + PhyCaps.NumPhyTypes = ARRAYSIZE(PhyInfoList); + PhyCaps.PhyInfoList = PhyInfoList; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetPhyCapabilities(Device, &PhyCaps), + "Failed to set PHY capabilities"); + + return STATUS_SUCCESS; +} + +NTSTATUS WifiHAL::WifiIhvReset(WDFDEVICE Device, const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +{ + if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) + { + WFCTrace("DOT11 Reset, set default MIB = %d, no MAC Address specified\n", ResetParameters.Dot11ResetParameters.SetDefaultMIB); + } + else + { + WFCTrace( + "DOT11 Reset, set default MIB = %d, MAC Address = %2x:%2x:%2x:%2x:%2x:%2x\n", + ResetParameters.Dot11ResetParameters.SetDefaultMIB, + ResetParameters.ResetMACAddress.Address[0], + ResetParameters.ResetMACAddress.Address[1], + ResetParameters.ResetMACAddress.Address[2], + ResetParameters.ResetMACAddress.Address[3], + ResetParameters.ResetMACAddress.Address[4], + ResetParameters.ResetMACAddress.Address[5]); + } + + // Reset the connection ID in case the previous connection attempt did not complete + m_LastConnectEntryId = 0; + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DOT11_RESET_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvSetRadioState(WDFDEVICE Device, const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT Context) +{ + if (RadioState.SoftwareRadioState != m_CurrentRadioState) + { + // Change the radio state + m_CurrentRadioState = RadioState.SoftwareRadioState; + + // Send the radio state indication + WDI_INDICATION_RADIO_STATUS_PARAMETERS RadioStatusParams = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RadioStatusParams.RadioState.HardwareState = TRUE; + RadioStatusParams.RadioState.SoftwareState = m_CurrentRadioState; + if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, Context, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) + { + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, 0, pOutput, cbOutput); + FreeGenerated(pOutput); + } + } + + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SET_RADIO_STATE_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvScan(WDFDEVICE Device, WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +{ + for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (m_SupportedBands & g_ConnectEntries[connectEntry].BandId) + { + PUCHAR pBssEntry = g_ConnectEntries[connectEntry].pTlvBssEntry; + // + // If currently connected, see if the connected entry should be skipped + // + if ((m_LastConnectEntryId != 0) && + (RtlCompareMemory(&m_ConnectedPeer, &pBssEntry[8], sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS))) + { + // Already connected, don't report this entry + continue; + } + + // TODO: Skip the IHV band as it is not being reported in capabilities + if (g_ConnectEntries[connectEntry].BandId == TESTMP_BAND_IHV) + { + continue; + } + + // Send the BSS entry indication + WifiIhvSendIndicationToOs( + Device, + pWdiHeader, + WDI_INDICATION_BSS_ENTRY_LIST, + 0, + g_ConnectEntries[connectEntry].pTlvBssEntry, + g_ConnectEntries[connectEntry].TlvBssEntrySize); + } + } + + // + // See if the hidden network needs to be indicated + // + if ((ScanParameters.SSIDList.ElementCount > 0) && (ScanParameters.SSIDList.pElements[0].ElementCount == 8) && + (ScanParameters.SSIDList.pElements[0].pElements[4] == 'H') && (ScanParameters.SSIDList.pElements[0].pElements[5] == 'I') && + (ScanParameters.SSIDList.pElements[0].pElements[6] == 'D') && (ScanParameters.SSIDList.pElements[0].pElements[7] == 'E')) + { + WifiIhvSendIndicationToOs( + Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, 0, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); + } + + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SCAN_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + + return STATUS_SUCCESS; +} + +NTSTATUS WifiHAL::WifiIhvConnect(WDFDEVICE Device, WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +{ + NT_ASSERT(m_LastConnectEntryId == 0); + if (m_LastConnectEntryId != 0) // Not Disconnected State + { +#ifdef WIFI_IHV_NETV + DeleteDatapathPeer( + deviceContext->netAdapters[pWdiHeader->PortId], reinterpret_cast(&deviceContext->ConnectedPeer)); +#endif // WIFI_IHV_NETV + } + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( + Device, &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), + "Failed to perform association"); + + // + // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete + // + if (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo) + { + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + } + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) +{ + // Report link quality + NTSTATUS ntStatus = STATUS_SUCCESS; + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(Device); + WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; + WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RtlCopyMemory( + &linkStateChangeParameters.LinkStateChangeParameters.PeerMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + linkStateChangeParameters.LinkStateChangeParameters.TxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.RxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.LinkQuality = 56; + + // Default linkId for non-Mlo connections is 0 + pLinkInfo[0].LinkID = 0; + RtlCopyMemory(&pLinkInfo[0].LocalLinkMACAddress, &m_LocalLinkAddresses[0], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[0].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[0].ChannelNumber = 6; + pLinkInfo[0].BandId = WDI_BAND_ID_2400; + pLinkInfo[0].RSSI = -50; + pLinkInfo[0].Bandwidth = 40; + pLinkInfo[0].TxMCS = 3; + pLinkInfo[0].RxMCS = 4; + + if (numLinks > 1) + { + // For Mlo connections, set the link ID for the first link to 1 + pLinkInfo[0].LinkID = 1; + + pLinkInfo[1].LinkID = 2; + RtlCopyMemory(&pLinkInfo[1].LocalLinkMACAddress, &m_LocalLinkAddresses[1], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[1].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[1].ChannelNumber = 36; + pLinkInfo[1].BandId = WDI_BAND_ID_5000; + pLinkInfo[1].RSSI = -30; + pLinkInfo[1].Bandwidth = 160; + pLinkInfo[1].TxMCS = 8; + pLinkInfo[1].RxMCS = 9; + } + + linkStateChangeParameters.LinkInfo.pElements = pLinkInfo; + linkStateChangeParameters.LinkInfo.ElementCount = numLinks > 1 ? 2 : 1; + + ntStatus = GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (STATUS_SUCCESS == ntStatus) + { + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, 0, pOutput, cbOutput); + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_LINK_STATE_CHANGE - 0x%08x\n", ntStatus); + } + + return ntStatus; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvPerformAssociation( + WDFDEVICE Device, + struct ArrayOfElements* pPreferredBSSEntryList, + struct ArrayOfElements* pAuthenticationAlgorithms, + PWDI_MESSAGE_HEADER pWdiHeader) +{ + + ULONG bssIndex = 0; + ULONG connectEntry = ConnectEntryId_MAX; + NTSTATUS ntStatus = STATUS_SUCCESS; + UINT32 NewConnectEntryId = 0; // Disconnected State + WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; + UCHAR pucData[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10 }; +#ifdef WIFI_IHV_NETV + WifiNetvDevice* pDeviceContext = WifiNetvDeviceGetContext(Device); +#else + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(Device); +#endif // WIFI_IHV_NETV + ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; + + do + { + // We search for the BSSID pattern to figure out what AP we are trying to connect to + for (bssIndex = 0; bssIndex < pPreferredBSSEntryList->ElementCount; bssIndex++) + { + for (connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (RtlCompareMemory( + pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, + g_ConnectEntries[connectEntry].pMacAddress, + sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS)) + { + PUCHAR pAssociationResult = g_ConnectEntries[connectEntry].pTlvAssociationResult; + + NewConnectEntryId = connectEntry; + m_LastConnectTransactionId = pWdiHeader->TransactionId; +#ifdef WIFI_IHV_NETV + // add peer on datapath + AddDatapathPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], + reinterpret_cast(g_ConnectEntries[connectEntry].pMacAddress)); +#endif // WIFI_IHV_NETV + +#ifdef WIFI_IHV_HANDSHAKE + // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. + RecieveDatapathFrame(0x33, sizeof(pucData), pucData); +#endif // WIFI_IHV_HANDSHAKE + + if (NewAuthAlgo == WDI_AUTH_ALGO_WPA3_SAE) + { + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + + // + // Handle special case for WPA3-SAE + // Send the Indication to request additonal SAE params + // + g_dwSaeResendConfirmRequested = 0; + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_REQUEST_PARAMS_NEEDED; + RtlCopyMemory( + SAEAuthParamsNeeded.BssId.Address, g_ConnectEntries[connectEntry].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + ndisStatus = GenerateWdiIndicationSaeAuthParamsNeeded( + &SAEAuthParamsNeeded, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); + + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + + FreeGenerated(pOutput); + + break; + } + } + + // Get the assoc status + RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); + + // Send the association indication + WifiIhvSendIndicationToOs( + Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + 0, + g_ConnectEntries[connectEntry].pTlvAssociationResult, + g_ConnectEntries[connectEntry].TlvAssociationResultSize); + + break; + } + } + + // If we found a matching BSSID entry, we are done + if (connectEntry < ConnectEntryId_MAX) + { + break; + } + } + + } while (FALSE); + + if (WDI_ASSOC_STATUS_SUCCESS != assocStatus || 0 == NewConnectEntryId || bssIndex >= pPreferredBSSEntryList->ElementCount) + { + NewConnectEntryId = 0; // Disconnected State + NewAuthAlgo = WDI_AUTH_ALGO_80211_OPEN; + ntStatus = STATUS_UNSUCCESSFUL; + } + else + { + RtlCopyMemory(&m_ConnectedPeer, pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, sizeof(DOT11_MAC_ADDRESS)); + } + + m_LastConnectEntryId = NewConnectEntryId; + m_LastAuthAlgo = NewAuthAlgo; + + if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo)) + { + // Report link quality + ntStatus = WifiIhvSendLinkStateIndication(Device, pWdiHeader, 2); + } + + return ntStatus; +} + +NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(WDFDEVICE Device, const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT Context) +{ + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded{}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + // Commit frame when Status = 0: FiniteCyclicGroup + Scalar + Element + // Commit frame when Status = 76: FiniteCyclicGroup + AntiCloggingToken + WFCInfo("WDI_SET_SAE_AUTH_PARAMS called!!!\n"); + if (WDI_SAE_REQUEST_TYPE_COMMIT_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Commit request for Tx, Setting CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + + // + // Send reflection attack first + // + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponseReflection); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponseReflection; + } + else if ( + (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) && + (WDI_SAE_STATUS_COMMIT_MESSAGE_REFLECTION_ATTACK_DETECTED == setSAEAuthParams.SAEStatus)) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS returned Reflection error -- Inidicate proper CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponse; + } + else if (WDI_SAE_REQUEST_TYPE_CONFIRM_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Confirm request for Tx, Setting ConfirmResponse for Rx\n"); + + if (g_dwSaeResendConfirmRequested) + { + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAEConfirmResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAEConfirmResponse; + } + else + { + g_dwSaeResendConfirmRequested = 1; + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_REQUEST_RESEND_REQUEST; + } + } + else + { + if (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated error - %d\n", setSAEAuthParams.SAEStatus); + } + else if (WDI_SAE_REQUEST_TYPE_SUCCESS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated SAE success - %d\n", setSAEAuthParams.SAEStatus); + } + else + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has set INVALID Request type = %d\n", setSAEAuthParams.SAERequestType); + } + + // Send the association indication + // This assumes that the association result fields are in the right order + if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) + { + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_WPA3_SAE; + } + else + { + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; + } + + WifiIhvSendIndicationToOs( + Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + 0, + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult, + g_ConnectEntries[m_LastConnectEntryId].TlvAssociationResultSize); + RtlCopyMemory(&m_ConnectedPeer, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + // Report link quality + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(Device, pWdiHeader, 1), + "Failed WifiIhvSendLinkStateIndication"); + + WifiIhvSendIndicationToOs( + Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, m_LastConnectTransactionId, nullptr, 0); +#ifdef WIFI_IHV_HANDSHAKE + // + // Receive M1 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM1SaeFrame), pucM1SaeFrame); + + // + // Receive M3 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); +#endif + } + + RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + auto ndisStatus = + GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, Context, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED - 0x%08x\n", ndisStatus); + } + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +void WifiHAL::WifiIhvPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) +{ + UCHAR s_TLV_Disassociation[] = + { + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + + 0x00 + }; + + RtlCopyMemory(&s_TLV_Disassociation[4], &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); + + // Send the disassociation indication + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, 0, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); + + m_LastConnectEntryId = 0; // Disconnected State + +#ifdef WIFI_IHV_NETV + DeleteDatapathPeer(0x33); +#endif + + WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DISCONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h new file mode 100644 index 00000000..5f1ec299 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifihal.h @@ -0,0 +1,31 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +// The class for Wifi IHV device's HAL functionalities +class WifiHAL +{ +public: + NTSTATUS WifiIhvSetDeviceCapabilities(_In_ WDFDEVICE Device); + NTSTATUS WifiIhvReset(_In_ WDFDEVICE Device,_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); + NTSTATUS WifiIhvSetRadioState(_In_ WDFDEVICE Device, _In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); + NTSTATUS WifiIhvScan(_In_ WDFDEVICE Device, _In_ WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); + NTSTATUS WifiIhvConnect(_In_ WDFDEVICE Device, _In_ WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); + NTSTATUS WifiIhvPerformAssociation(_In_ WDFDEVICE Device, _In_ struct ArrayOfElements* pPreferredBSSEntryList, _In_ struct ArrayOfElements* pAuthenticationAlgorithms, _In_ PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvSetSaeAuthParams(_In_ WDFDEVICE Device, _In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); + void WifiIhvPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus); +private: + NTSTATUS WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); + + UCHAR m_CurrentRadioState{}; + UINT32 m_LastConnectEntryId{}; + UINT32 m_LastConnectTransactionId{}; + WDI_AUTH_ALGORITHM m_LastAuthAlgo{}; + DOT11_MAC_ADDRESS m_ConnectedPeer{}; + + const WDI_MAC_ADDRESS m_LocalLinkAddresses[2] = { + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, + }; + + const ULONG m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); +}; diff --git a/network/wlan/WIFICX/drivercode/wifihaltestdata.h b/network/wlan/WIFICX/drivercode/wifihaltestdata.h new file mode 100644 index 00000000..7ded0f2b --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifihaltestdata.h @@ -0,0 +1,8290 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +#define TESTMP_BAND_IHV 0x00000010 + +// clang-format on + +#define ConnectEntryId_MAX ARRAYSIZE(g_ConnectEntries) + +// +//=============================================================================== +// Set alternate local addresses based on simulation parameters +//=============================================================================== +// +UCHAR s_ArubaSimLocalAddress[] = {0xd4, 0x6a, 0x6a, 0x52, 0x18, 0x07}; // For Wpa3SuiteB - Aruba +UCHAR g_IntelSimLocalAddress[] = {0x34, 0x13, 0xe8, 0xb3, 0x14, 0x4c}; // For Wpa3SuiteB - Intel +UCHAR g_SaeSimLocalAddress[] = {0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5}; // For Wpa3Sae + +#ifdef WPA3_ARUBA_SIM +PUCHAR g_AlternateLocalAddress = s_ArubaSimLocalAddress; +#elif WPA3_INTEL_SIM +PUCHAR g_AlternateLocalAddress = g_IntelSimLocalAddress; +#elif WPA3_SAE +PUCHAR g_AlternateLocalAddress = g_SaeSimLocalAddress; +#else +PUCHAR g_AlternateLocalAddress = NULL; +#endif + +// clang-format off + +// +//=============================================================================== +// + +UCHAR s_DeviceServiceTestBlob[] = +{ + 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa +}; + +// +//=============================================================================== +// + +UCHAR s_TLV_AssociationParametersRequestedType[] = +{ + // WDI_TLV_ASSOCIATION_PARAMETERS_REQUESTED_TYPE + 0xBB, 0x00, + 0x02, 0x00, + 0x9F, 0x00 // PMKID +}; + +UCHAR s_TLV_RoamingNeededIndication[] = +{ + // WDI_TLV_ROAMING_NEEDED_PARAMETERS + 0x55, 0x00, + 0x04, 0x00, + 0x0a, 0x00, 0x00, 0x00 +}; + +UCHAR s_TLV_NeighborReport[] = +{ + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ACTION_FRAME_BODY + 0xBE, 0x00, + 0x14, 0x00, + 0x05, // Category = Radio Measurement + 0x05, // Action = Neighbor Report Response + 0x01, // Dialog Token + 0x34, // Element ID = Neighbor Report + 0x0F, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, // BSSID + 0x00, 0x00, 0x00, 0x00, // BSSID Information + 0x00, // Operating class + 0x06, // Channel Number + 0x00, // PHY Type + 0x00, 0x00, // Optional IEs +}; + +// +//=============================================================================== +// + +// +//=============================================================================== +// BSs entries +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr = {0x00, 0x20, 0x30, 0x40, 0x50, 0x60}; + +UCHAR s_TLV_BSS_Entry_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + + +UCHAR s_TLV_OpenDisassociation[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + 0x01, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + 0x00 +}; + +WDI_MAC_ADDRESS s_Connect_Addr_2_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2}; + +UCHAR s_TLV_BSS_Entry_2_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x59, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x26, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x28, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID + +}; + +UCHAR s_TLV_Success_AssociationResult_2_Open[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x25, 0x00, + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_3_WEP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3}; + +UCHAR s_TLV_BSS_Entry_3_WEP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x03, 0x01, 0x01, // DSSS Parameter (Offset: 42) + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality (Offset: 57) + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel (Offset: 64) + 0x01, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_3_WEP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_4_RSNA_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4}; + +#define WFA_TEST_MIN_RSN_IE 1 + +UCHAR s_TLV_BSS_Entry_4_RSNA_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef WFA_TEST_MIN_RSN_IE + 0x79, 0x00, //Len +#else + 0x8B, 0x00, //Len +#endif // WFA_TEST_MIN_RSN_IE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef WFA_TEST_MIN_RSN_IE + 0x46, 0x00, +#else + 0x58, 0x00, +#endif // WFA_TEST_MIN_RSN_IE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved +#ifdef WFA_TEST_MIN_RSN_IE + 0x30, 0x02, + 0x01, 0x00, +#else + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite -- RSNA_PSK + 0x00, 0x00, // RSN Capability +#endif // WFA_TEST_MIN_RSN_IE + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_4_RSNA_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x22, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x58, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_5_IHV = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5}; + +UCHAR s_TLV_BSS_Entry_5_IHV [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x03, 0x01, 0x01, // DSSS Parameter + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel = 36 + 0x08, 0x00, 0x00, 0x00, // Band ID = Custom +// 0x02, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_5_IHV[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x02, 0x00, 0x00, 0x80, //AuthAlgorithm = Custom + 0x01, 0x00, 0x00, 0x80, //UnicastCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastDataCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x80, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x24, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x02, 0x00, 0x00, 0x80, // Phy = IHV Phy 2 + +}; + + +UCHAR s_TLV_IhvRequestComplete[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x0A, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0x00, 0x00, 0x01 +}; + + +UCHAR s_TLV_IhvIndication[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x30, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5 +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_6_FT_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6}; + +UCHAR s_TLV_BSS_Entry_6_FT_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xEA, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB7, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_6_FT_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x06, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x3E, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xC5, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x37, 0x69, // FTE IE + 0x00, 0x00, // MIC Control - 0 => no MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0xB4, 0xC7, 0x99, 0x8A, 0xB6, 0x30, + 0x03, 0x0D, // R0KH-ID + 'a', 'p', '8', '1', '3', '2', '-', '7', '3', '4', 'E', 'B', '0', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xB7, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_7_FT_PSK_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7}; + +UCHAR s_TLV_BSS_Entry_7_FT_PSK_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xED, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xBA, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_7_FT_PSK_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x41, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, + 0xAC, 0x01, 0x00, 0x00, + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xBF, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite -- FT-PSK + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x37, 0x63, // FTE IE + 0x00, 0x02, // MIC Control + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + 0x03, 0x07, // R0KH-ID + 'x', '@', 'y', '.', 'c', 'o', 'm', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xBA, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_8_Hidden = {0x00, 0xA0, 0xB0, 0xC0, 0xD0,0xE8}; + +UCHAR s_TLV_BSS_Entry_Beacon_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x24, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x00, // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_BSS_Entry_ProbeResponse_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x5a, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + + +UCHAR s_TLV_Success_AssociationResult_8_Hidden[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// +// 11ad +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_9_11ad_PSK = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_9_11ad_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_10_11ad_1x = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_10_11ad_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_10_11ad_Dmg_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_11_11ad_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x05, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Dmg_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== +// +// 11ax +// +//=============================================================================== + +// +// Open on 2.4 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_12_11ax_24_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC}; + + +UCHAR s_TLV_BSS_Entry_12_11ax_24_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x78, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x4A, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_12_11ax_24_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4E, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x43, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== + +// +// Open on 5 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_13_11ax_5_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED}; + + +UCHAR s_TLV_BSS_Entry_13_11ax_5_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x76, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x48, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel 36 + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_13_11ax_5_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4C, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x24, 0x30, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +// #define SAE_MIXED_MODE 1 + +WDI_MAC_ADDRESS s_Connect_Addr_14_WPA3_SAE_CCMP = { 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32 }; + +UCHAR s_TLV_BSS_Entry_14_WPA3_SAE_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef SAE_MIXED_MODE + 0x91, 0x00, //Len +#else + 0x8D, 0x00, //Len +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Capability - no MFPR or MFPC +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, +#ifdef SAE_MIXED_MODE + 0x2A, 0x01, +#else + 0x26, 0x01, +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4A, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AMK Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Multicast Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Cap = MFP-Capable +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Cap = MFP-Capable + MFP required +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +// +// SAE-Specific definitions :: Start +// +DWORD g_dwSaeResendConfirmRequested = 0; + +UCHAR pucSAECommitResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + 0x93, 0x48, 0x89, 0xab, 0x38, 0x6b, 0x72, 0xd5, 0xff, 0x0d, 0x3c, 0xaa, 0x09, 0x56, 0x50, 0x20, + 0x2b, 0xd0, 0x3e, 0x26, 0x96, 0xb5, 0x90, 0x5f, 0x7b, 0x49, 0x5f, 0x3b, 0x7d, 0xc3, 0x5b, 0x48, + + // [14] AP Element + 0x58, 0x54, 0x5e, 0x6c, 0xa0, 0xe8, 0x86, 0xef, 0xfb, 0x05, 0x2a, 0xfb, 0x63, 0x2c, 0xa2, 0x19, + 0x5b, 0xb0, 0xb0, 0xa8, 0x25, 0xe5, 0x9d, 0xba, 0x6b, 0xaa, 0x0e, 0x93, 0xaf, 0x04, 0x6e, 0xf4, + 0xc9, 0x45, 0x5f, 0xec, 0x43, 0xfe, 0x5e, 0xb0, 0x2a, 0x6b, 0x8a, 0xbc, 0x8f, 0xd7, 0x07, 0x87, + 0x87, 0x3d, 0xd1, 0xd5, 0xd7, 0xfd, 0xe3, 0x07, 0x3a, 0x4c, 0xf3, 0xc2, 0xc7, 0x6f, 0x59, 0x5c, + }; +UCHAR pucSAECommitResponseReflection [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + + 0x49, 0x5c, 0x2c, 0xb4, 0x20, 0xec, 0xc9, 0xe8, 0xe8, 0x03, 0x2d, 0x00, 0x8d, 0xab, 0x4d, 0x91, + 0x70, 0x16, 0x06, 0x28, 0x40, 0x83, 0xb9, 0x8d, 0x19, 0xc6, 0x43, 0xcb, 0x63, 0x29, 0x9f, 0x03, + + // [14] AP Element + 0x13, 0x2e, 0xfc, 0x90, 0xb9, 0xd7, 0xb5, 0xc1, 0x2a, 0x1d, 0xe9, 0x05, 0x9c, 0xb3, 0xba, 0xc8, + 0xa6, 0x93, 0xff, 0xbf, 0x23, 0x02, 0x42, 0x3e, 0x58, 0xc2, 0x0d, 0x00, 0x10, 0xe8, 0x44, 0x60, + 0x9d, 0xfc, 0x34, 0x5e, 0x98, 0x8e, 0xf2, 0x12, 0x67, 0x24, 0xd0, 0x80, 0xfb, 0x2f, 0x1e, 0x7a, + 0xe6, 0x54, 0x01, 0x00, 0x50, 0xd4, 0xfe, 0x66, 0x47, 0x62, 0xc0, 0x3c, 0x9f, 0x7a, 0x10, 0x27, + }; + +UCHAR pucSAEConfirmResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x02, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (DOT11_FRAME_STATUS_ANTI_CLOGGING_TOKEN_REQUIRED) (not-Element, 2 octets) + 0x00, 0x00, // [12] SendConfirm (not-IE, 2 octets) + // [15] Confirm + 0xc7, 0xd1, 0x04, 0x94, 0x29, 0xec, 0xdf, 0x25, 0xda, 0xaa, 0x79, 0x6f, 0xda, 0xe9, 0x91, 0x9f, + 0x4b, 0x83, 0xad, 0xa3, 0x08, 0xde, 0x62, 0xca, 0xcd, 0x59, 0xfc, 0xf5, 0xc5, 0x4d, 0xeb, 0xd9, + }; + +UCHAR pucM1SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control: Version = 0x0, Type = DOT11_FRAME_TYPE_DATA, Subtype = DOT11_DATA_SUBTYPE_DATA + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Address1: Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address2: Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address3: Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype = DOT11_ETH_TYPE_EAPOL + // NWF_EAPOL_HEADER + 0x02, // Version = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 OR NWF_EAPOL_PROTOCOL_VERSION_V2 = 2 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x00, 0x8a, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // MIC + 0x00, 0x16, // Key length + 0xdd, 0x14, // KeyData -> DOT11_INFO_ELEMENT_ID_VENDOR_SPECIFIC + Len + 0x00, 0x0f, 0xac, 0x04, // OUI -> RSN_KEY_DATA_OUI + RSN_KEY_DATA_OUI_TYPE_PMKID -> {0x00,0x0F,0xAC} + {0x04) + 0x37, 0xfb, 0x9a, 0x24, 0xc1, 0x57, 0x8c, 0xce, 0xc3, 0x60, 0x6c, 0x6f, 0x39, 0xe0, 0xb7, 0x02, // PMKID +}; + + +UCHAR pucExpectedM2SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version = bProtocolVersion = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type = bKeyDesc = NWF_EAPOL_KEY_DESC_RSNA = 2 + 0x01, 0x0a, // Info = usKeyInfo, ResponseKeyInfo.Version = KEY_DESC_VERSION_AES, Type=RSN_KEY_TYPE_PAIRWISE, MIC=1, Secure=0 + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x80, 0xf8, 0x10, 0x83, 0x4f, 0x0f, 0x40, 0xa1, 0xe5, 0x5d, 0x51, 0x92, 0x83, 0x4f, 0x8e, 0x98, // Nonce + 0x09, 0xca, 0xd5, 0x14, 0xc6, 0x08, 0x4c, 0xa9, 0xed, 0xc3, 0xa8, 0xff, 0xce, 0xc9, 0x36, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa1, 0x79, 0x5f, 0x05, 0xa4, 0x12, 0x84, 0xf2, 0xf9, 0x0c, 0x79, 0x88, 0xeb, 0x92, 0x71, 0x62, // MIC + 0x00, 0x16, // Key Length + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, // Key Data = RSN + 0x00, 0x0f, 0xac, 0x08, 0x80, 0x00 + +}; + +UCHAR pucM3SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x02, // Version + 0x03, // Type + 0x00, 0x97, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x13, 0xca, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa5, 0xea, 0xdc, 0xfd, 0x97, 0xc7, 0x72, 0x76, 0x24, 0xe2, 0x7e, 0x71, 0x45, 0x3a, 0x24, 0xca, // MIC + 0x00, 0x38, // Key Length + 0x6f, 0x39, 0x30, 0x2c, 0x46, 0xb4, 0x3c, 0xf8, 0x42, 0x07, 0x8e, 0xc9, 0x65, 0x05, 0x2c, 0xd0, // Encrypted Key data + 0xe1, 0x7b, 0xdd, 0x2e, 0xbd, 0x69, 0x09, 0x1e, 0x39, 0xcc, 0x1a, 0xb3, 0x6e, 0x55, 0xd1, 0xad, + 0x5c, 0x45, 0x52, 0x4b, 0x83, 0x5d, 0x39, 0xe3, 0x1c, 0xb6, 0xed, 0x35, 0x52, 0x76, 0xb1, 0xc6, + 0x5a, 0x2c, 0x96, 0x07, 0x77, 0x15, 0x15, 0x5c, +}; + + +UCHAR pucExpectedM4SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x10, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version + 0x03, // Type + 0x00, 0x5f, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x03, 0x0a, // Info + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Nonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x52, 0x97, 0x0f, 0x90, 0x69, 0x7d, 0xcd, 0xeb, 0x98, 0xbf, 0xb1, 0x2a, 0xb2, 0x3e, 0xcc, 0x49, // MIC + 0x00, 0x00, // Key Length +}; + +// +// SAE-Specific definitions :: End +// + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_15_WPA2PSK_SHA256 = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF}; + +UCHAR s_TLV_BSS_Entry_15_WPA2PSK_SHA256 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x91, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'H', 'A', '2', '5', '6', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x06, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x06, // AMK Suite - WPA2PSK_SHA256 + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +#ifdef WPA3_ARUBA_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5}; // For Aruba +#elif WPA3_INTEL_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a}; // For Intel +#else +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0}; +#endif + +UCHAR s_TLV_BSS_Entry_16_WPA3_SUITEB [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x97, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_16_WPA3_SUITEB[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x3A, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_ENT_192 = 8 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x54, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// +// 6 GHz +// +//=============================================================================== + +// +// RNR IE has the following format (only care about TBTT length = 8 or 12): +// 0xc9, 0x +// 0x -> 2 bytes (contains number and size of each element) +// 0x, 0x -> 2 bytes (applies to all element in this list) +// 0x -> 1 byte +// 0x -> 6 bytes +// [0x] -> 4 bytes +// 0x -> 1 byte +// + +// +// Mac addresses have the following nomenclature for 6GHz Ssids +// +// 1st 3 bytes are 0x00 0xA1, 0xB0 +// 4th byte is for SSID: +// 01 = 6E__1 +// 02 = 6E__2 +// 03 = SSID3 +// 04 = SSID4 +// 5th Byte is for band: +// 02 = 2.4 GHz +// 05 = 5 GHz +// 06 = 6 GHz +// 6th byte is instance +// 01 = 1st instance +// 02 - 2nd instance +// : +// + +//=============================================================================== +// SIX_G: 6E__1: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (2 * 6 GHz) +// 2.4 GHz: +// S1_24_1: S1_5_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 5 GHz: +// S1_5_1: S1_24_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 6 GHz: +// S1_6_1: S1_24_1 (In) + S1_5_1 (In) +// S1_6_2: S1_24_1 (In) + S1_5_1 (In) +//=============================================================================== + +// +// 6E__1: 1 * 2.4 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [5:36 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_17_6G_S1_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xE9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel / Freq = 2412 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x01, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1 * 5 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [2.4:1 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_18_6G_S1_5_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_18_6G_S1_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel / Freq = 36 / 5180 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x24, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_19_6G_S1a_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_19_6G_S1a_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x65, 0x00, 0x00, 0x00, // Channel / Freq = 101 / 6445 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xfD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x65, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x65, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 2/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_20_6G_S1b_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02}; +UCHAR s_TLV_BSS_Entry_20_6G_S1b_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x85, 0x00, 0x00, 0x00, // Channel / Freq = 133 / 6605 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x85, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: 6E__2: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (1 * 6 GHz) +// 2.4 GHz: +// S2_24_1: S2_5_1 (In+Out) + [S2_6_2 (Out)] +// 5 GHz: +// S2_5_1: S2_24_1 (In+Out) + S2_6_1 (Out) + [S2_6_2 (Out)] +// 6 GHz: +// S2_6_1: S2_5_1 (In) +//=============================================================================== + +// +// 6E__2: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each: Band:Channel = [5:44] + [6:101] +// +WDI_MAC_ADDRESS s_Connect_Addr_21_6G_S2_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x24, 0x01}; +UCHAR s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xD3, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xA0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel / Freq = 2437 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xF5, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x06, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 5 GHz Bss's +// 3 RNR IEs with 1 entry each: Band:Channel = [2.4:6] + [6:101] + [6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_22_6G_S2_5_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_22_6G_S2_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xed, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x2c, 0x00, 0x00, 0x00, // Channel / Freq = 44 / 5220 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x2c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_23_6G_S2_6_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_23_6G_S2_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x79, 0x00, 0x00, 0x00, // Channel / Freq = 121 / 6545 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x79, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: SSID3: +// (1 * 2.4 GHz) +// 2.4 GHz: +// S3_24_1: *S2_5_1 (Out)* +//=============================================================================== + +// +// SSID3: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each Band:Channel = [5:44 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_24_6G_S3_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xDB, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel / Freq = 2457 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x0a, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// SIX_G: SSID4 (non-colocated AP): +// (1 * 6 GHz) +// 6 GHz: +// S4_6_1: +//=============================================================================== + +// +// SSID4: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_25_6G_S4_6_Ghz = {0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_25_6G_S4_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0xe5, 0x00, 0x00, 0x00, // Channel / Freq = 229 / 7085 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0xe5, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// WDI_OWE_RNR +//=============================================================================== + + +/// WDI_OWE_RNR +/// +/// Description +/// - Non-Transition mode OWE network +/// - Advertises Reduced Neighbor Reports (RNRs) for the OWE Transition Mode BSSes WDI_OWE_TM_OWE and WDI_OWE_TM_OPEN +/// - Note: The OWE TM BSSes do not advertise RNR IEs +/// - Definitions for these two Transition Mode networks follows this one +/// +/// Intention +/// - Test Non-Transition Mode OWE networks +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving beacon or probe +/// - Since the networks are indicated in order during scans (i.e. the OWE TM networks will be indicated after this one) +/// it is expected that RNR for the OWE TM networks will be received before their beacons and probes. +/// +/// Expectation +/// - Scan results display WDI_OWE_RNR as an Enhanced Open network to which connections are supported +/// - The RNR will not effect connections to or display of OWE Transition Mode networks that it contains +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_26_OWE_With_RNR = {00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF}; +UCHAR s_TLV_BSS_Entry_26_OWE_With_RNR [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xB6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x83, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0B, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'R', 'N', 'R', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // MAC Address --> OWE Transition Mode OWE (Defined below) + 0xFD, 0x1F, 0x3F, 0x49, // Short SSID for WDI_OWE_TM_OWE + 0x00, // BssParameters + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // MAC Address --> OWE Transition Mode Open (Defined below) + 0x21, 0x24, 0x6C, 0x85, // Short SSID for WDI_OWE_TM_OPEN + 0x00, // BssParameters + + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_26_OWE_With_RNR [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, // Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OWE +/// Description +/// - OWE BSS of OWE Transition Mode network +/// - Auth Type is OWE +/// - Partner BSS is the OWE Transition Mode Open BSS "WDI_OWE_TM_OPEN" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of the OWE TM OWE BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: "WDI_OWE_TM_OPEN" +/// - Authentication: OWE +/// - Encryption: CCMP +/// - MFP Required: 1 +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_27_OWE_TM_OWE = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00}; +UCHAR s_TLV_BSS_Entry_27_OWE_TM_OWE [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xA1, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x6e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x1A, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // Partner BSS BSSID + 0x0F, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented simulated OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_27_OWE_TM_OWE [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OPEN +/// Description +/// - Open BSS of OWE Transition Mode network +/// - Open network +/// - Partner BSS is the OWE Transition Mode OWE BSS "WDI_OWE_TM_OWE" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of this BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: (Hidden) +/// - Authentication: Open +/// - Encryption: None +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_28_OWE_TM_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01}; +UCHAR s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x95, 0x00, // Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x62, 0x00, // Length + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x19, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // Partner BSS BSSID + 0x0E, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'W', 'E', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_28_OWE_TM_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +//=============================================================================== +// +// Wi-Fi 7 +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_29_WiFi7_Mixed_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02}; +WDI_MAC_ADDRESS s_Connect_Addr_30_WiFi7_Mixed_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03}; +WDI_MAC_ADDRESS s_Connect_Addr_31_WiFi7_Mixed_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04}; +WDI_MAC_ADDRESS s_Connect_Addr_32_WiFi7_Mixed_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05}; + +UCHAR s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xfa, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // Link 1 MAC address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xc7, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x32, 0x01, // DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0xFB, // BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xc0, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7e, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x9b, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x01, + 0xFB, // H2E Only + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : MAC address + // STA Profile + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_33_WiFi7_Open_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06}; +WDI_MAC_ADDRESS s_Connect_Addr_34_WiFi7_Open_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07}; +WDI_MAC_ADDRESS s_Connect_Addr_35_WiFi7_Open_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08}; +WDI_MAC_ADDRESS s_Connect_Addr_36_WiFi7_Open_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09}; + +UCHAR s_TLV_BSS_Entry_34_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_37_WiFi7_Only_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a}; +WDI_MAC_ADDRESS s_Connect_Addr_38_WiFi7_Only_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b}; +WDI_MAC_ADDRESS s_Connect_Addr_39_WiFi7_Only_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c}; +WDI_MAC_ADDRESS s_Connect_Addr_40_WiFi7_Only_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d}; + +UCHAR s_TLV_BSS_Entry_38_WiFi7_Only_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe8, 0x00, //Len + + // WDI_TLV_BSSID = 10 = 0xa + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // Link 1 MAC address + + // WDI_TLV_BEACON_FRAME = 143 = 0x8f + 0x0a, 0x00, + 0xb5, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x01, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xaf, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7f, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x89, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : MAC address + // STA Profile + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== +// DualSta networks +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_41_DualSta_5Ghz = {0x00, 0x51, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_41_DualSta_5Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +// ----- + +WDI_MAC_ADDRESS s_Connect_Addr_42_DualSta_6Ghz = {0x00, 0x52, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_42_DualSta_6Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x09, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// Data throughput test networks +//=============================================================================== +// + +__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x01}; +__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x02}; +__declspec(selectany) UCHAR s_TLV_BSS_Entry_43_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x22, 0x22, 0x22, 0X22, 0x00, 0x01, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + + +__declspec(selectany) UCHAR s_TLV_BSS_Entry_44_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== +//=============================================================================== + +typedef struct +{ + UINT32 BandId; + WDI_MAC_ADDRESS* pMacAddress; + PUCHAR pTlvBssEntry; + UINT32 TlvBssEntrySize; + PUCHAR pTlvAssociationResult; + UINT32 TlvAssociationResultSize; + +} WdiTestConnectEntry, * PWdiTestConnectEntry; + +WdiTestConnectEntry g_ConnectEntries[] = +{ + // 0 + { // 0th Entry is disconnected state + 0, + nullptr, + nullptr, 0, + nullptr, 0, + }, + + // 1 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr, + s_TLV_BSS_Entry_1, sizeof(s_TLV_BSS_Entry_1), + s_TLV_SuccessOpenAssociationResult, sizeof(s_TLV_SuccessOpenAssociationResult), + }, + + // 2 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr_2_Open, + s_TLV_BSS_Entry_2_Open, sizeof(s_TLV_BSS_Entry_2_Open), + s_TLV_Success_AssociationResult_2_Open, sizeof(s_TLV_Success_AssociationResult_2_Open), + }, + + // 3 - WDI__WEP + { + WDI_BAND_ID_2400, + &s_Connect_Addr_3_WEP, + s_TLV_BSS_Entry_3_WEP, sizeof(s_TLV_BSS_Entry_3_WEP), + s_TLV_Success_AssociationResult_3_WEP, sizeof(s_TLV_Success_AssociationResult_3_WEP), + }, + + // 4 - WDI_SECURE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_4_RSNA_CCMP, + s_TLV_BSS_Entry_4_RSNA_CCMP, sizeof(s_TLV_BSS_Entry_4_RSNA_CCMP), + s_TLV_Success_AssociationResult_4_RSNA_CCMP, sizeof(s_TLV_Success_AssociationResult_4_RSNA_CCMP), + }, + + // 5 - WDI__IHV + { + TESTMP_BAND_IHV, + &s_Connect_Addr_5_IHV, + s_TLV_BSS_Entry_5_IHV, sizeof(s_TLV_BSS_Entry_5_IHV), + s_TLV_Success_AssociationResult_5_IHV, sizeof(s_TLV_Success_AssociationResult_5_IHV), + }, + + // 6 - WDI__FT + { + WDI_BAND_ID_2400, + &s_Connect_Addr_6_FT_CCMP, + s_TLV_BSS_Entry_6_FT_CCMP, sizeof(s_TLV_BSS_Entry_6_FT_CCMP), + s_TLV_Success_AssociationResult_6_FT_CCMP, sizeof(s_TLV_Success_AssociationResult_6_FT_CCMP), + }, + + // 7 - WDI__FTPSK + { + WDI_BAND_ID_2400, + &s_Connect_Addr_7_FT_PSK_CCMP, + s_TLV_BSS_Entry_7_FT_PSK_CCMP, sizeof(s_TLV_BSS_Entry_7_FT_PSK_CCMP), + s_TLV_Success_AssociationResult_7_FT_PSK_CCMP, sizeof(s_TLV_Success_AssociationResult_7_FT_PSK_CCMP), + }, + + // 8 - + { + WDI_BAND_ID_2400, + &s_Connect_Addr_8_Hidden, + s_TLV_BSS_Entry_Beacon_8_Hidden, sizeof(s_TLV_BSS_Entry_Beacon_8_Hidden), + s_TLV_Success_AssociationResult_8_Hidden, sizeof(s_TLV_Success_AssociationResult_8_Hidden), + }, + + // 9 - WDI_adPSK + { + WDI_BAND_ID_60000, + &s_Connect_Addr_9_11ad_PSK, + s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK), + s_TLV_Success_AssociationResult_9_11ad_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_PSK), + }, + + // 10 - WDI_ad_1x + { + WDI_BAND_ID_60000, + &s_Connect_Addr_10_11ad_1x, + s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x), + s_TLV_Success_AssociationResult_10_11ad_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_1x), + }, + + // 11 - WDI_ad_ON + { + WDI_BAND_ID_60000, + &s_Connect_Addr_11_11ad_Open, + s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open), + s_TLV_Success_AssociationResult_11_11ad_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Open), + }, + + // 12 - WDI_OPEN_11ax.2.4 + { + WDI_BAND_ID_60000, + &s_Connect_Addr_12_11ax_24_Open, + s_TLV_BSS_Entry_12_11ax_24_Open, sizeof(s_TLV_BSS_Entry_12_11ax_24_Open), + s_TLV_Success_AssociationResult_12_11ax_24_Open, sizeof(s_TLV_Success_AssociationResult_12_11ax_24_Open), + }, + + // 13 - WDI_OPEN_11ax.5 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_13_11ax_5_Open, + s_TLV_BSS_Entry_13_11ax_5_Open, sizeof(s_TLV_BSS_Entry_13_11ax_5_Open), + s_TLV_Success_AssociationResult_13_11ax_5_Open, sizeof(s_TLV_Success_AssociationResult_13_11ax_5_Open), + }, + + // 14 - WDI_WPA3-SAE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_14_WPA3_SAE_CCMP, + s_TLV_BSS_Entry_14_WPA3_SAE_CCMP, sizeof(s_TLV_BSS_Entry_14_WPA3_SAE_CCMP), + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP), + }, + + // 15 - WDI_SHA256 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_15_WPA2PSK_SHA256, + s_TLV_BSS_Entry_15_WPA2PSK_SHA256, sizeof(s_TLV_BSS_Entry_15_WPA2PSK_SHA256), + s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256, sizeof(s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256), + }, + + // 16 - WDI_WPA3-SUITE_B + { + WDI_BAND_ID_2400, + &s_Connect_Addr_16_WPA3_SUITEB, + s_TLV_BSS_Entry_16_WPA3_SUITEB, sizeof(s_TLV_BSS_Entry_16_WPA3_SUITEB), + s_TLV_Success_AssociationResult_16_WPA3_SUITEB, sizeof(s_TLV_Success_AssociationResult_16_WPA3_SUITEB), + }, + + // 17 - 6E__1 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_17_6G_S1_2_4_Ghz, + s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz, sizeof(s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz), + s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz), + }, + + // 18 - 6E__1 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_18_6G_S1_5_Ghz, + s_TLV_BSS_Entry_18_6G_S1_5_Ghz, sizeof(s_TLV_BSS_Entry_18_6G_S1_5_Ghz), + s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz, sizeof(s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz), + }, + + // 19 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_19_6G_S1a_6_Ghz, + s_TLV_BSS_Entry_19_6G_S1a_6_Ghz, sizeof(s_TLV_BSS_Entry_19_6G_S1a_6_Ghz), + s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz, sizeof(s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz), + }, + + // 20 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_20_6G_S1b_6_Ghz, + s_TLV_BSS_Entry_20_6G_S1b_6_Ghz, sizeof(s_TLV_BSS_Entry_20_6G_S1b_6_Ghz), + s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz, sizeof(s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz), + }, + + // 21 - 6E__2 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_21_6G_S2_2_4_Ghz, + s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz, sizeof(s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz), + s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz), + }, + + // 22 - 6E__2 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_22_6G_S2_5_Ghz, + s_TLV_BSS_Entry_22_6G_S2_5_Ghz, sizeof(s_TLV_BSS_Entry_22_6G_S2_5_Ghz), + s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz, sizeof(s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz), + }, + + // 23 - 6E__2 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_23_6G_S2_6_Ghz, + s_TLV_BSS_Entry_23_6G_S2_6_Ghz, sizeof(s_TLV_BSS_Entry_23_6G_S2_6_Ghz), + s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz, sizeof(s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz), + }, + + // 24 - 6E__3 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_24_6G_S3_2_4_Ghz, + s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz, sizeof(s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz), + s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz), + }, + + // 25 - 6E__4 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_25_6G_S4_6_Ghz, + s_TLV_BSS_Entry_25_6G_S4_6_Ghz, sizeof(s_TLV_BSS_Entry_25_6G_S4_6_Ghz), + s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz, sizeof(s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz), + }, + + // 26 - WDI_OWE_RNR + { + WDI_BAND_ID_2400, + &s_ConnectAddr_26_OWE_With_RNR, + s_TLV_BSS_Entry_26_OWE_With_RNR, sizeof(s_TLV_BSS_Entry_26_OWE_With_RNR), + s_TLV_Failure_AssociationResult_26_OWE_With_RNR, sizeof(s_TLV_Failure_AssociationResult_26_OWE_With_RNR) + }, + // 27 - + { + WDI_BAND_ID_2400, + &s_ConnectAddr_27_OWE_TM_OWE, + s_TLV_BSS_Entry_27_OWE_TM_OWE, sizeof(s_TLV_BSS_Entry_27_OWE_TM_OWE), + s_TLV_Failure_AssociationResult_27_OWE_TM_OWE, sizeof(s_TLV_Failure_AssociationResult_27_OWE_TM_OWE) + }, + // 28 - WDI_OWE_TM_OPEN + { + WDI_BAND_ID_2400, + &s_ConnectAddr_28_OWE_TM_Open, + s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon, sizeof(s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon), + s_TLV_Failure_AssociationResult_28_OWE_TM_Open, sizeof(s_TLV_Failure_AssociationResult_28_OWE_TM_Open) + }, + + // 29 is only MLD address for Wi-Fi 7 + // 30 - Wi-Fi 7 - Mixed + { + WDI_BAND_ID_5000, + &s_Connect_Addr_30_WiFi7_Mixed_Link_1, + s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1), + s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1), + }, + // 34 - Wi-Fi 7 - Open + { + WDI_BAND_ID_5000, + &s_Connect_Addr_34_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_34_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_34_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1), + }, + // 38 - Wi-Fi 7 - Only + { + WDI_BAND_ID_6000, + &s_Connect_Addr_38_WiFi7_Only_Link_1, + s_TLV_BSS_Entry_38_WiFi7_Only_Link_1, sizeof(s_TLV_BSS_Entry_38_WiFi7_Only_Link_1), + s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1, sizeof(s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1), + }, + + // 41 - Dual-Sta + { + WDI_BAND_ID_5000, + &s_Connect_Addr_41_DualSta_5Ghz, + s_TLV_BSS_Entry_41_DualSta_5Ghz, sizeof(s_TLV_BSS_Entry_41_DualSta_5Ghz), + s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz), + }, + + // 42 - Dual-Sta + { + WDI_BAND_ID_6000, + &s_Connect_Addr_42_DualSta_6Ghz, + s_TLV_BSS_Entry_42_DualSta_6Ghz, sizeof(s_TLV_BSS_Entry_42_DualSta_6Ghz), + s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz), + }, + + // 43 - Speed Test(01) + { + WDI_BAND_ID_5000, + &s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_43_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_43_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1), + }, + + // 44 - Speed Test(02) + { + WDI_BAND_ID_5000, + &s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_44_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_44_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1), + }, +}; + +// clang-format on diff --git a/network/wlan/WIFICX/drivercode/wifirequest.cpp b/network/wlan/WIFICX/drivercode/wifirequest.cpp index 06703795..1fefe040 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.cpp +++ b/network/wlan/WIFICX/drivercode/wifirequest.cpp @@ -1,308 +1,10 @@ -//------------------------------------------------------------------------------- -// Net Adapter source file -// // Copyright (c) Microsoft Corporation. All rights reserved. #include "precomp.h" -#include "testdata.h" -#include +#include "wifiHAL.h" #include "wifirequest.h" #include "wifirequest.tmh" -// clang-format off - - -WdiTestConnectEntry g_ConnectEntries[] = -{ - // 0 - { // 0th Entry is disconnected state - 0, - nullptr, - nullptr, 0, - nullptr, 0, - }, - - // 1 - WFC_OPEN - { - WDI_BAND_ID_2400, - &s_Connect_Addr, - s_TLV_BSS_Entry_1, sizeof(s_TLV_BSS_Entry_1), - s_TLV_SuccessOpenAssociationResult, sizeof(s_TLV_SuccessOpenAssociationResult), - }, - - // 2 - WFC_OPEN - { - WDI_BAND_ID_2400, - &s_Connect_Addr_2_Open, - s_TLV_BSS_Entry_2_Open, sizeof(s_TLV_BSS_Entry_2_Open), - s_TLV_Success_AssociationResult_2_Open, sizeof(s_TLV_Success_AssociationResult_2_Open), - }, - - // 3 - WDI__WEP - { - WDI_BAND_ID_2400, - &s_Connect_Addr_3_WEP, - s_TLV_BSS_Entry_3_WEP, sizeof(s_TLV_BSS_Entry_3_WEP), - s_TLV_Success_AssociationResult_3_WEP, sizeof(s_TLV_Success_AssociationResult_3_WEP), - }, - - // 4 - WDI_SECURE - { - WDI_BAND_ID_2400, - &s_Connect_Addr_4_RSNA_CCMP, - s_TLV_BSS_Entry_4_RSNA_CCMP, sizeof(s_TLV_BSS_Entry_4_RSNA_CCMP), - s_TLV_Success_AssociationResult_4_RSNA_CCMP, sizeof(s_TLV_Success_AssociationResult_4_RSNA_CCMP), - }, - - // 5 - WDI__IHV - { - TESTMP_BAND_IHV, - &s_Connect_Addr_5_IHV, - s_TLV_BSS_Entry_5_IHV, sizeof(s_TLV_BSS_Entry_5_IHV), - s_TLV_Success_AssociationResult_5_IHV, sizeof(s_TLV_Success_AssociationResult_5_IHV), - }, - - // 6 - WDI__FT - { - WDI_BAND_ID_2400, - &s_Connect_Addr_6_FT_CCMP, - s_TLV_BSS_Entry_6_FT_CCMP, sizeof(s_TLV_BSS_Entry_6_FT_CCMP), - s_TLV_Success_AssociationResult_6_FT_CCMP, sizeof(s_TLV_Success_AssociationResult_6_FT_CCMP), - }, - - // 7 - WDI__FTPSK - { - WDI_BAND_ID_2400, - &s_Connect_Addr_7_FT_PSK_CCMP, - s_TLV_BSS_Entry_7_FT_PSK_CCMP, sizeof(s_TLV_BSS_Entry_7_FT_PSK_CCMP), - s_TLV_Success_AssociationResult_7_FT_PSK_CCMP, sizeof(s_TLV_Success_AssociationResult_7_FT_PSK_CCMP), - }, - - // 8 - - { - WDI_BAND_ID_2400, - &s_Connect_Addr_8_Hidden, - s_TLV_BSS_Entry_Beacon_8_Hidden, sizeof(s_TLV_BSS_Entry_Beacon_8_Hidden), - s_TLV_Success_AssociationResult_8_Hidden, sizeof(s_TLV_Success_AssociationResult_8_Hidden), - }, - - // 9 - WDI_adPSK - { - WDI_BAND_ID_60000, - &s_Connect_Addr_9_11ad_PSK, -#ifdef DMG_CAPABILITIES - s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK), - s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK), -#else - s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK), - s_TLV_Success_AssociationResult_9_11ad_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_PSK), -#endif // DMG_CAPABILITIES - }, - - // 10 - WDI_ad_1x - { - WDI_BAND_ID_60000, - &s_Connect_Addr_10_11ad_1x, -#ifdef DMG_CAPABILITIES - s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x), - s_TLV_Success_AssociationResult_10_11ad_Dmg_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_Dmg_1x), -#else - s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x), - s_TLV_Success_AssociationResult_10_11ad_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_1x), -#endif // DMG_CAPABILITIES - }, - - // 11 - WDI_ad_ON - { - WDI_BAND_ID_60000, - &s_Connect_Addr_11_11ad_Open, -#ifdef DMG_CAPABILITIES - s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open), - s_TLV_Success_AssociationResult_11_11ad_Dmg_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Dmg_Open), -#else - s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open), - s_TLV_Success_AssociationResult_11_11ad_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Open), -#endif // DMG_CAPABILITIES - }, - - // 12 - WDI_OPEN_11ax.2.4 - { - WDI_BAND_ID_60000, - &s_Connect_Addr_12_11ax_24_Open, - s_TLV_BSS_Entry_12_11ax_24_Open, sizeof(s_TLV_BSS_Entry_12_11ax_24_Open), - s_TLV_Success_AssociationResult_12_11ax_24_Open, sizeof(s_TLV_Success_AssociationResult_12_11ax_24_Open), - }, - - // 13 - WDI_OPEN_11ax.5 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_13_11ax_5_Open, - s_TLV_BSS_Entry_13_11ax_5_Open, sizeof(s_TLV_BSS_Entry_13_11ax_5_Open), - s_TLV_Success_AssociationResult_13_11ax_5_Open, sizeof(s_TLV_Success_AssociationResult_13_11ax_5_Open), - }, - - // 14 - WDI_WPA3-SAE - { - WDI_BAND_ID_2400, - &s_Connect_Addr_14_WPA3_SAE_CCMP, - s_TLV_BSS_Entry_14_WPA3_SAE_CCMP, sizeof(s_TLV_BSS_Entry_14_WPA3_SAE_CCMP), - s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP), - }, - - // 15 - WDI_SHA256 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_15_WPA2PSK_SHA256, - s_TLV_BSS_Entry_15_WPA2PSK_SHA256, sizeof(s_TLV_BSS_Entry_15_WPA2PSK_SHA256), - s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256, sizeof(s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256), - }, - - // 16 - WDI_WPA3-SUITE_B - { - WDI_BAND_ID_2400, - &s_Connect_Addr_16_WPA3_SUITEB, - s_TLV_BSS_Entry_16_WPA3_SUITEB, sizeof(s_TLV_BSS_Entry_16_WPA3_SUITEB), - s_TLV_Success_AssociationResult_16_WPA3_SUITEB, sizeof(s_TLV_Success_AssociationResult_16_WPA3_SUITEB), - }, - - // 17 - 6E__1 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_17_6G_S1_2_4_Ghz, - s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz, sizeof(s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz), - s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz), - }, - - // 18 - 6E__1 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_18_6G_S1_5_Ghz, - s_TLV_BSS_Entry_18_6G_S1_5_Ghz, sizeof(s_TLV_BSS_Entry_18_6G_S1_5_Ghz), - s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz, sizeof(s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz), - }, - - // 19 - 6E__1 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_19_6G_S1a_6_Ghz, - s_TLV_BSS_Entry_19_6G_S1a_6_Ghz, sizeof(s_TLV_BSS_Entry_19_6G_S1a_6_Ghz), - s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz, sizeof(s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz), - }, - - // 20 - 6E__1 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_20_6G_S1b_6_Ghz, - s_TLV_BSS_Entry_20_6G_S1b_6_Ghz, sizeof(s_TLV_BSS_Entry_20_6G_S1b_6_Ghz), - s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz, sizeof(s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz), - }, - - // 21 - 6E__2 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_21_6G_S2_2_4_Ghz, - s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz, sizeof(s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz), - s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz), - }, - - // 22 - 6E__2 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_22_6G_S2_5_Ghz, - s_TLV_BSS_Entry_22_6G_S2_5_Ghz, sizeof(s_TLV_BSS_Entry_22_6G_S2_5_Ghz), - s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz, sizeof(s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz), - }, - - // 23 - 6E__2 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_23_6G_S2_6_Ghz, - s_TLV_BSS_Entry_23_6G_S2_6_Ghz, sizeof(s_TLV_BSS_Entry_23_6G_S2_6_Ghz), - s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz, sizeof(s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz), - }, - - // 24 - 6E__3 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_24_6G_S3_2_4_Ghz, - s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz, sizeof(s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz), - s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz), - }, - - // 25 - 6E__4 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_25_6G_S4_6_Ghz, - s_TLV_BSS_Entry_25_6G_S4_6_Ghz, sizeof(s_TLV_BSS_Entry_25_6G_S4_6_Ghz), - s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz, sizeof(s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz), - }, - - // 26 - WDI_OWE_RNR - { - WDI_BAND_ID_2400, - &s_ConnectAddr_26_OWE_With_RNR, - s_TLV_BSS_Entry_26_OWE_With_RNR, sizeof(s_TLV_BSS_Entry_26_OWE_With_RNR), - s_TLV_Failure_AssociationResult_26_OWE_With_RNR, sizeof(s_TLV_Failure_AssociationResult_26_OWE_With_RNR) - }, - // 27 - - { - WDI_BAND_ID_2400, - &s_ConnectAddr_27_OWE_TM_OWE, - s_TLV_BSS_Entry_27_OWE_TM_OWE, sizeof(s_TLV_BSS_Entry_27_OWE_TM_OWE), - s_TLV_Failure_AssociationResult_27_OWE_TM_OWE, sizeof(s_TLV_Failure_AssociationResult_27_OWE_TM_OWE) - }, - // 28 - WDI_OWE_TM_OPEN - { - WDI_BAND_ID_2400, - &s_ConnectAddr_28_OWE_TM_Open, - s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon, sizeof(s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon), - s_TLV_Failure_AssociationResult_28_OWE_TM_Open, sizeof(s_TLV_Failure_AssociationResult_28_OWE_TM_Open) - }, - - // 29 is only MLD address for Wi-Fi 7 - // 30 - Wi-Fi 7 - Mixed - { - WDI_BAND_ID_5000, - &s_Connect_Addr_30_WiFi7_Mixed_Link_1, - s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1), - s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1), - }, - // 34 - Wi-Fi 7 - Open - { - WDI_BAND_ID_5000, - &s_Connect_Addr_34_WiFi7_Open_Link_1, - s_TLV_BSS_Entry_34_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_34_WiFi7_Open_Link_1), - s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1), - }, - // 38 - Wi-Fi 7 - Only - { - WDI_BAND_ID_6000, - &s_Connect_Addr_38_WiFi7_Only_Link_1, - s_TLV_BSS_Entry_38_WiFi7_Only_Link_1, sizeof(s_TLV_BSS_Entry_38_WiFi7_Only_Link_1), - s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1, sizeof(s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1), - }, - - // 41 - Dual-Sta - { - WDI_BAND_ID_5000, - &s_Connect_Addr_41_DualSta_5Ghz, - s_TLV_BSS_Entry_41_DualSta_5Ghz, sizeof(s_TLV_BSS_Entry_41_DualSta_5Ghz), - s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz), - }, - - // 42 - Dual-Sta - { - WDI_BAND_ID_6000, - &s_Connect_Addr_42_DualSta_6Ghz, - s_TLV_BSS_Entry_42_DualSta_6Ghz, sizeof(s_TLV_BSS_Entry_42_DualSta_6Ghz), - s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz), - }, -}; - -// clang-format on - -#define ConnectEntryId_MAX ARRAYSIZE(g_ConnectEntries) - _Use_decl_annotations_ void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) { @@ -323,10 +25,9 @@ void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) } _Use_decl_annotations_ -void WifiCxTestSendIndication(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, UINT32 TransactionId, PUCHAR pTlvData, UINT32 TlvDataSize) +void WifiIhvSendIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, UINT32 TransactionId, PUCHAR pTlvData, UINT32 TlvDataSize) { - NTSTATUS ntStatus; - WDFMEMORY data; + WDFMEMORY data = WDF_NO_HANDLE; PUCHAR pIndicationBuffer = nullptr; PWDI_MESSAGE_HEADER pIndicationHeader = nullptr; SIZE_T indicationSize = sizeof(WDI_MESSAGE_HEADER) + TlvDataSize; @@ -335,11 +36,9 @@ void WifiCxTestSendIndication(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, WDF_OBJECT_ATTRIBUTES_INIT(&objectAttribs); objectAttribs.ParentObject = Device; - ntStatus = WdfMemoryCreate(&objectAttribs, NonPagedPoolNx, 0, indicationSize, &data, reinterpret_cast(&pIndicationBuffer)); - - if (!NT_SUCCESS(ntStatus)) + if(!NT_SUCCESS(WdfMemoryCreate(&objectAttribs, NonPagedPoolNx, 0, indicationSize, &data, reinterpret_cast(&pIndicationBuffer)))) { - WFCError("%!FUNC!: Failed to initialize indication buffer %!STATUS!", ntStatus); + WFCError("Failed to create indication buffer"); return; } @@ -361,321 +60,11 @@ void WifiCxTestSendIndication(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, WdfObjectDelete(data); } -_Use_decl_annotations_ -UINT WifiCxTestSetOutput(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize, PUCHAR pTlvData, UINT32 TlvDataSize) -{ - UNREFERENCED_PARAMETER(pDeviceContext); - PWDI_MESSAGE_HEADER pWdiHeader = static_cast(ReqBuffer); - UINT BytesWritten = 0; - pWdiHeader->Status = NDIS_STATUS_SUCCESS; // TODO Need to set it to actual output - - if (ReqBufferSize >= (TlvDataSize + sizeof(WDI_MESSAGE_HEADER))) - { - if (TlvDataSize > 0) - { - RtlCopyMemory((static_cast(ReqBuffer)) + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); - } - BytesWritten = static_cast(TlvDataSize); - } - else - { - pWdiHeader->Status = NDIS_STATUS_BUFFER_OVERFLOW; - } - return BytesWritten; -} - -_Use_decl_annotations_ -NDIS_STATUS WifiCxTestGetAdapterCapabilities(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize) -{ - NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - PUCHAR pOutput = nullptr; - ULONG length = 0; - - // Generate TLV - ndisStatus = - GenerateWdiGetAdapterCapabilities(&pDeviceContext->AdapterCapabilities, 0, &pDeviceContext->TlvContext, &length, &pOutput); - - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - // Set the information in the wifirequest - WifiCxTestSetOutput(pDeviceContext, ReqBuffer, ReqBufferSize, pOutput, length); - } - - FreeGenerated(pOutput); - - return ndisStatus; -} - -_Use_decl_annotations_ -NDIS_STATUS WifiCxTestSetAdapterConfiguration(PWIFI_DEVICE_CONTEXT pDeviceContext, void* ReqBuffer, SIZE_T ReqBufferSize) -{ - NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - WDI_SET_FIRMWARE_CONFIGURATION_PARAMETERS fwConfig = {}; - - ULONG TLVStreamLength = static_cast(ReqBufferSize - sizeof(WDI_MESSAGE_HEADER)); - auto TLVByteStream = static_cast(ReqBuffer) + sizeof(WDI_MESSAGE_HEADER); - - DumpMessageTlvByteStream( - WDI_SET_ADAPTER_CONFIGURATION, TRUE, pDeviceContext->TlvContext.PeerVersion, TLVStreamLength, TLVByteStream, 0, nullptr); - ndisStatus = ParseWdiSetAdapterConfiguration(TLVStreamLength, TLVByteStream, &pDeviceContext->TlvContext, &fwConfig); - - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - if (fwConfig.Optional.MacAddress_IsPresent) - { - pDeviceContext->AdapterCapabilities.InterfaceAttributes.InterfaceCapabilities.Address = fwConfig.MacAddress; - } - } - - CleanupParsedWdiSetAdapterConfiguration(&fwConfig); - - return ndisStatus; -} - - -extern WDI_MAC_ADDRESS STAAddress; - -WDI_MAC_ADDRESS LocalLinkAddresses[] = { - {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, - {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, -}; - -static NTSTATUS WifiCxTestSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) -{ - // Report link quality - NTSTATUS ntStatus = STATUS_SUCCESS; - PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); - WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; - WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - RtlCopyMemory( - &linkStateChangeParameters.LinkStateChangeParameters.PeerMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - linkStateChangeParameters.LinkStateChangeParameters.TxLinkSpeed = 30000; - linkStateChangeParameters.LinkStateChangeParameters.RxLinkSpeed = 30000; - linkStateChangeParameters.LinkStateChangeParameters.LinkQuality = 56; - - pLinkInfo[0].LinkID = 1; - RtlCopyMemory(&pLinkInfo[0].LocalLinkMACAddress, &LocalLinkAddresses[0], sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&pLinkInfo[0].PeerLinkMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - pLinkInfo[0].ChannelNumber = 6; - pLinkInfo[0].BandId = WDI_BAND_ID_2400; - pLinkInfo[0].RSSI = -50; - pLinkInfo[0].Bandwidth = 40; - pLinkInfo[0].TxMCS = 3; - pLinkInfo[0].RxMCS = 4; - - if (numLinks > 1) - { - pLinkInfo[1].LinkID = 2; - RtlCopyMemory(&pLinkInfo[1].LocalLinkMACAddress, &LocalLinkAddresses[1], sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&pLinkInfo[1].PeerLinkMACAddress, &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - pLinkInfo[1].ChannelNumber = 36; - pLinkInfo[1].BandId = WDI_BAND_ID_5000; - pLinkInfo[1].RSSI = -30; - pLinkInfo[1].Bandwidth = 160; - pLinkInfo[1].TxMCS = 8; - pLinkInfo[1].RxMCS = 9; - } - - linkStateChangeParameters.LinkInfo.pElements = pLinkInfo; - linkStateChangeParameters.LinkInfo.ElementCount = numLinks > 1 ? 2 : 1; - - ntStatus = - GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); - if (STATUS_SUCCESS == ntStatus) - { - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, 0, pOutput, cbOutput); - FreeGenerated(pOutput); - } - else - { - WFCError("Failed to generate WDI_INDICATION_LINK_STATE_CHANGE - 0x%08x\n", ntStatus); - } - - return ntStatus; -} - -#define TEST_RSN_EAPOL_SHA384_KCK_LENGTH (192 / 8) // 24 bytes -#define TEST_RSN_EAPOL_SHA384_KEK_LENGTH (256 / 8) // 32 bytes -#define TEST_RSN_CCMP_KEY_LENGTH 16 -#define TEST_RSN_BIP_GMAC_256_KEY_LENGTH 32 - -#define TEST_NUM_LINKS 3 -#define TEST_NUM_CIPHER_KEY_TYPES 3 - - -static NTSTATUS WifiCxTestPerformAssociation( - _In_ WDFDEVICE Device, - _In_ struct ArrayOfElements* pPreferredBSSEntryList, - _In_ struct ArrayOfElements* pAuthenticationAlgorithms, - _In_ PWDI_MESSAGE_HEADER pWdiHeader) -{ - - ULONG bssIndex = 0; - ULONG connectEntry = ConnectEntryId_MAX; - NTSTATUS ntStatus = STATUS_SUCCESS; - UINT32 NewConnectEntryId = 0; // Disconnected State - WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; - UCHAR pucData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10}; - PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); - ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; - - do - { - // We search for the BSSID pattern to figure out what AP we are trying to connect to - for (bssIndex = 0; bssIndex < pPreferredBSSEntryList->ElementCount; bssIndex++) - { - for (connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) - { - if (RtlCompareMemory( - pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, - g_ConnectEntries[connectEntry].pMacAddress, - sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS)) - { - PUCHAR pAssociationResult = g_ConnectEntries[connectEntry].pTlvAssociationResult; - - NewConnectEntryId = connectEntry; - pDeviceContext->LastConnectTransactionId = pWdiHeader->TransactionId; - - // TODO NetAdapter: datapath not yet implemented -#ifdef WIFICX_TEST_DATAPATH - // add peer on datapath - AddDatapathPeer(0x33, *g_ConnectEntries[connectEntry].pMacAddress); - - // example inject frame - InjectDatapathFrame(0x33); - - // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. - RecieveDatapathFrame(0x33, sizeof(pucData), pucData); - -#endif - if ((&s_Connect_Addr_14_WPA3_SAE_CCMP == g_ConnectEntries[connectEntry].pMacAddress) || - (&s_Connect_Addr_30_WiFi7_Mixed_Link_1 == g_ConnectEntries[connectEntry].pMacAddress) || - (&s_Connect_Addr_38_WiFi7_Only_Link_1 == g_ConnectEntries[connectEntry].pMacAddress)) - { - WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - - // - // Handle special case for WPA3-SAE - // Send the Indication to request additonal SAE params - // - g_dwSaeResendConfirmRequested = 0; - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_REQUEST_PARAMS_NEEDED; - RtlCopyMemory( - SAEAuthParamsNeeded.BssId.Address, g_ConnectEntries[connectEntry].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); - - ndisStatus = GenerateWdiIndicationSaeAuthParamsNeeded( - &SAEAuthParamsNeeded, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); - - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); - - FreeGenerated(pOutput); - - break; - } - } - - // Get the assoc status - RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); - - // Send the association indication - WifiCxTestSendIndication( - Device, - pWdiHeader, - WDI_INDICATION_ASSOCIATION_RESULT, - 0, - g_ConnectEntries[connectEntry].pTlvAssociationResult, - g_ConnectEntries[connectEntry].TlvAssociationResultSize); - - break; - } - } - - // - // If we found a matching BSSID entry, we are done - // - if (connectEntry < ConnectEntryId_MAX) - { - break; - } - } - - } while (FALSE); - - if (WDI_ASSOC_STATUS_SUCCESS != assocStatus || 0 == NewConnectEntryId || bssIndex >= pPreferredBSSEntryList->ElementCount) - { - NewConnectEntryId = 0; // Disconnected State - NewAuthAlgo = WDI_AUTH_ALGO_80211_OPEN; - ntStatus = STATUS_UNSUCCESSFUL; - } - else - { - RtlCopyMemory(&pDeviceContext->ConnectedPeer, pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, sizeof(DOT11_MAC_ADDRESS)); - } - - pDeviceContext->LastConnectEntryId = NewConnectEntryId; - pDeviceContext->LastAuthAlgo = NewAuthAlgo; - - if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != pDeviceContext->LastAuthAlgo)) - { - // Report link quality - ntStatus = WifiCxTestSendLinkStateIndication(Device, pWdiHeader, 2); - } - - return ntStatus; -} - -static void WifiCxTestPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) -{ - // clang-format off - UCHAR s_TLV_Disassociation[] = - { - // WDI_TLV_ASSOCIATION_RESULT - 0xBC, 0x00, - 0x0A, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - - // WDI_TLV Need Peer Cleanup Params - 0xb4, 0x00, - 0x01, 0x00, - - 0x00 - }; - // clang-format on - - PWIFI_DEVICE_CONTEXT pDeviceContext = WifiGetDeviceContext(Device); - - // TODO NetAdapter: datapath not yet implemented -#ifdef WIFICX_TEST_DATAPATH - // example inject frame - InjectDatapathFrame(0x33); -#endif - - RtlCopyMemory(&s_TLV_Disassociation[4], &pDeviceContext->ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); - - // Send the disassociation indication - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, 0, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); - - pDeviceContext->LastConnectEntryId = 0; // Disconnected State -} - _Use_decl_annotations_ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buffer, UINT InBufferLen, UINT OutBufferLen, UINT* pBytesWritten) { NTSTATUS ntStatus = STATUS_SUCCESS; - NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - PWIFI_DEVICE_CONTEXT deviceContext = WifiGetDeviceContext(Device); + PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); PWDI_MESSAGE_HEADER pWdiHeader = static_cast(Buffer); UINT BytesWritten = sizeof(WDI_MESSAGE_HEADER); @@ -703,42 +92,31 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf { WDI_SET_RADIO_STATE_PARAMETERS RadioStateParams = {}; ULONG TLVStreamLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); - auto TLVByteStream = buffer + sizeof(WDI_MESSAGE_HEADER); + auto TLVByteStream = buffer +sizeof(WDI_MESSAGE_HEADER); DumpMessageTlvByteStream( WDI_TASK_SET_RADIO_STATE, TRUE, deviceContext->TlvContext.PeerVersion, TLVStreamLength, TLVByteStream, 0, nullptr); - ParseWdiTaskSetRadioState(TLVStreamLength, TLVByteStream, &deviceContext->TlvContext, &RadioStateParams); - if (RadioStateParams.SoftwareRadioState != deviceContext->CurrentRadioState) - { - // Change the radio state - deviceContext->CurrentRadioState = RadioStateParams.SoftwareRadioState; - - // Send the radio state indication - WDI_INDICATION_RADIO_STATUS_PARAMETERS RadioStatusParams = {}; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - RadioStatusParams.RadioState.HardwareState = TRUE; - RadioStatusParams.RadioState.SoftwareState = deviceContext->CurrentRadioState; - GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, &deviceContext->TlvContext, &cbOutput, &pOutput); - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, 0, pOutput, cbOutput); + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + Wifi::ConvertNDISSTATUSoNTSTATUS( + ParseWdiTaskSetRadioState( + TLVStreamLength, + TLVByteStream, + &deviceContext->TlvContext, + &RadioStateParams)), + "Set Radio State parsing failed"); - FreeGenerated(pOutput); + // No WX_RETURN here since we need to cleanup. + ntStatus = deviceContext->wifiHAL->WifiIhvSetRadioState( + Device, RadioStateParams, pWdiHeader, &deviceContext->TlvContext); + if(!NT_SUCCESS(ntStatus)) + { + WFCError("WifiIhvSetRadioState failed: %!STATUS!\n", ntStatus); } - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SET_RADIO_STATE_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - CleanupParsedWdiTaskSetRadioState(&RadioStateParams); } break; - - case WDI_SET_ADAPTER_CONFIGURATION: - { - ndisStatus = WifiCxTestSetAdapterConfiguration(deviceContext, Buffer, InBufferLen); - } - break; - case WDI_TASK_SCAN: { ULONG scanDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); @@ -746,63 +124,24 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf WDI_SCAN_PARAMETERS scanParams = {}; - ndisStatus = ParseWdiTaskScan(scanDataLength, pScanData, &deviceContext->TlvContext, &scanParams); - - if (NDIS_STATUS_SUCCESS != ndisStatus) - { - WFCTrace("Scan parameters parsing failed: %d\n", ndisStatus); - // ntStatus = NdisConvertNdisStatusToNtStatus(parseStatus); - break; - } - - for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) - { - if (g_SupportedBands & g_ConnectEntries[connectEntry].BandId) - { - - PUCHAR pBssEntry = g_ConnectEntries[connectEntry].pTlvBssEntry; - - // - // If currently connected, see if the connected entry should be skipped - // - if ((deviceContext->LastConnectEntryId != 0) && - (RtlCompareMemory(&deviceContext->ConnectedPeer, &pBssEntry[8], sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS))) - { - // Already connected, don't report this entry - continue; - } - - // TODO: Skip the IHV band as it is not being reported in capabilities - if (g_ConnectEntries[connectEntry].BandId == TESTMP_BAND_IHV) - { - continue; - } + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + Wifi::ConvertNDISSTATUSoNTSTATUS( + ParseWdiTaskScan( + scanDataLength, + pScanData, + &deviceContext->TlvContext, + &scanParams)), + "Scan parameters parsing failed"); - // Send the BSS entry indication - WifiCxTestSendIndication( - Device, - pWdiHeader, - WDI_INDICATION_BSS_ENTRY_LIST, - 0, - g_ConnectEntries[connectEntry].pTlvBssEntry, - g_ConnectEntries[connectEntry].TlvBssEntrySize); - } - } - - // - // See if the hidden network needs to be indicated - // - if ((scanParams.SSIDList.ElementCount > 0) && (scanParams.SSIDList.pElements[0].ElementCount == 8) && - (scanParams.SSIDList.pElements[0].pElements[4] == 'H') && (scanParams.SSIDList.pElements[0].pElements[5] == 'I') && - (scanParams.SSIDList.pElements[0].pElements[6] == 'D') && (scanParams.SSIDList.pElements[0].pElements[7] == 'E')) + // No WX_RETURN here since we need to cleanup. + ntStatus = deviceContext->wifiHAL->WifiIhvScan( + Device, scanParams, pWdiHeader, &deviceContext->TlvContext); + if (!NT_SUCCESS(ntStatus)) { - WifiCxTestSendIndication( - Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, 0, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); + WFCError("WifiIhvSetRadioState failed: %!STATUS!\n", ntStatus); } CleanupParsedWdiTaskScan(&scanParams); - - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SCAN_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); } break; @@ -813,30 +152,17 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf ULONG resetDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); auto pResetData = buffer + sizeof(WDI_MESSAGE_HEADER); - ndisStatus = ParseWdiTaskDot11Reset(resetDataLength, pResetData, &deviceContext->TlvContext, &resetParameters); + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiTaskDot11Reset(resetDataLength, pResetData, &deviceContext->TlvContext, &resetParameters)), + "DOT11 Reset parameters parsing failed"); - if (NDIS_STATUS_SUCCESS != ndisStatus) - { - WFCTrace("DOT11 Reset parameters parsing failed: %d\n", ndisStatus); - } - else if (0 == resetParameters.Optional.ResetMACAddress_IsPresent) + // No WX_RETURN here since we need to cleanup. + ntStatus = deviceContext->wifiHAL->WifiIhvReset( + Device, resetParameters, pWdiHeader, &deviceContext->TlvContext); + if (!NT_SUCCESS(ntStatus)) { - WFCTrace("DOT11 Reset, set default MIB = %d, no MAC Address specified\n", resetParameters.Dot11ResetParameters.SetDefaultMIB); + WFCError("WifiIhvReset failed: %!STATUS!\n", ntStatus); } - else - { - WFCTrace( - "DOT11 Reset, set default MIB = %d, MAC Address = %2x:%2x:%2x:%2x:%2x:%2x\n", - resetParameters.Dot11ResetParameters.SetDefaultMIB, - resetParameters.ResetMACAddress.Address[0], - resetParameters.ResetMACAddress.Address[1], - resetParameters.ResetMACAddress.Address[2], - resetParameters.ResetMACAddress.Address[3], - resetParameters.ResetMACAddress.Address[4], - resetParameters.ResetMACAddress.Address[5]); - } - - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DOT11_RESET_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); CleanupParsedWdiTaskDot11Reset(&resetParameters); } @@ -849,51 +175,29 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf DumpMessageTlvByteStream(WDI_TASK_CONNECT, TRUE, deviceContext->TlvContext.PeerVersion, connectDataLength, pConnectData, 0, nullptr); - WDI_TASK_CONNECT_PARAMETERS connectParams; + WDI_TASK_CONNECT_PARAMETERS connectParams{}; - if (deviceContext->LastConnectEntryId != 0) // Not Disconnected State - { - ASSERT(FALSE); - // TODO NetAdapter: datapath not yet implemented -#ifdef WIFICX_TEST_DATAPATH - DeleteDatapathPeer(0x33); -#endif - } // We search for the BSSID pattern to figure out what AP we are trying to connect to - ndisStatus = ParseWdiTaskConnect(connectDataLength, pConnectData, &deviceContext->TlvContext, &connectParams); - if (NDIS_STATUS_SUCCESS != ndisStatus) + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiTaskConnect(connectDataLength, pConnectData, &deviceContext->TlvContext, &connectParams)), + "Connect parameters parsing failed"); + + // No WX_RETURN here since we need to cleanup. + ntStatus = deviceContext->wifiHAL->WifiIhvConnect( + Device, connectParams, pWdiHeader, &deviceContext->TlvContext); + if (!NT_SUCCESS(ntStatus)) { - // ntStatus = NdisConvertNdisStatusToNtStatus(parseStatus); - WFCTrace("ParseWdiTaskConnect FAIled %d\n", ndisStatus); - break; + WFCError("WifiIhvConnect failed: %!STATUS!\n", ntStatus); } - // Call the helper - ndisStatus = WifiCxTestPerformAssociation( - Device, &connectParams.PreferredBSSEntryList, &connectParams.ConnectParameters.AuthenticationAlgorithms, pWdiHeader); CleanupParsedWdiTaskConnect(&connectParams); - - // - // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete - // - if (WDI_AUTH_ALGO_WPA3_SAE != deviceContext->LastAuthAlgo) - { - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - } } break; case WDI_TASK_DISCONNECT: { - WifiCxTestPerformDisassociation(Device, pWdiHeader, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); - - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_DISCONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - -#ifdef WIFICX_TEST_DATAPATH - // TODO NetAdapter: datapath not yet implemented - DeleteDatapathPeer(0x33); -#endif + deviceContext->wifiHAL->WifiIhvPerformDisassociation(Device, pWdiHeader, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); } break; @@ -903,161 +207,28 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf case WDI_SET_DELETE_CIPHER_KEYS: case WDI_SET_RECEIVE_PACKET_FILTER: case WDI_SET_CONNECTION_QUALITY: + case WDI_SET_ADAPTER_CONFIGURATION: // Doing Nothing special break; case WDI_SET_SAE_AUTH_PARAMS: { WDI_SET_SAE_AUTH_PARAMS_COMMAND setSAEAuthParams; - WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - // Commit frame when Status = 0: FiniteCyclicGroup + Scalar + Element - // Commit frame when Status = 76: FiniteCyclicGroup + AntiCloggingToken - WFCInfo("WDI_SET_SAE_AUTH_PARAMS called!!!\n"); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiSetSaeAuthParams( + InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &setSAEAuthParams)), + "Failed to parse WDI_SET_SAE_AUTH_PARAMS"); - ndisStatus = ParseWdiSetSaeAuthParams( - InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &setSAEAuthParams); - if (ndisStatus == NDIS_STATUS_SUCCESS) + // No WX_RETURN here since we need to cleanup. + ntStatus = deviceContext->wifiHAL->WifiIhvSetSaeAuthParams( + Device, setSAEAuthParams, pWdiHeader, &deviceContext->TlvContext); + if (!NT_SUCCESS(ntStatus)) { - if (WDI_SAE_REQUEST_TYPE_COMMIT_PARAMS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Commit request for Tx, Setting CommitResponse for Rx\n"); - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - - // - // Send reflection attack first - // - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponseReflection); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponseReflection; - } - else if ( - (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) && - (WDI_SAE_STATUS_COMMIT_MESSAGE_REFLECTION_ATTACK_DETECTED == setSAEAuthParams.SAEStatus)) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS returned Reflection error -- Inidicate proper CommitResponse for Rx\n"); - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponse); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponse; - } - else if (WDI_SAE_REQUEST_TYPE_CONFIRM_PARAMS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Confirm request for Tx, Setting ConfirmResponse for Rx\n"); - - if (g_dwSaeResendConfirmRequested) - { - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAEConfirmResponse); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAEConfirmResponse; - } - else - { - g_dwSaeResendConfirmRequested = 1; - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_REQUEST_RESEND_REQUEST; - } - } - else - { - if (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated error - %d\n", setSAEAuthParams.SAEStatus); - } - else if (WDI_SAE_REQUEST_TYPE_SUCCESS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated SAE success - %d\n", setSAEAuthParams.SAEStatus); - } - else - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has set INVALID Request type = %d\n", setSAEAuthParams.SAERequestType); - } -#ifdef WIFICX_TEST_DATAPATH - // example inject frame - InjectDatapathFrame(0x33); -#endif - // Send the association indication - if (WDI_AUTH_ALGO_WPA3_SAE == deviceContext->LastAuthAlgo) - { - s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[27] = (UCHAR)WDI_AUTH_ALGO_WPA3_SAE; - } - else - { - s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; - } - - WifiCxTestSendIndication( - Device, - pWdiHeader, - WDI_INDICATION_ASSOCIATION_RESULT, - 0, - s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, - sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP)); - RtlCopyMemory(&deviceContext->ConnectedPeer, &s_Connect_Addr_14_WPA3_SAE_CCMP, sizeof(DOT11_MAC_ADDRESS)); - - // Report link quality - ntStatus = WifiCxTestSendLinkStateIndication(Device, pWdiHeader, 1); - - WifiCxTestSendIndication( - Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, deviceContext->LastConnectTransactionId, nullptr, 0); - -#ifdef WIFICX_TEST_DATAPATH - // - // Receive M1 frame of 4-way handshake - // - RecieveDatapathFrame(0x33, sizeof(pucM1SaeFrame), pucM1SaeFrame); - - // - // Receive M3 frame of 4-way handshake - // - RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); -#endif - break; - } - - RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &s_Connect_Addr_14_WPA3_SAE_CCMP, sizeof(DOT11_MAC_ADDRESS)); - - ndisStatus = - GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, &deviceContext->TlvContext, &cbOutput, &pOutput); - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - WifiCxTestSendIndication(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); - - FreeGenerated(pOutput); - } - else - { - WFCError("Failed to generate WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED - 0x%08x\n", ndisStatus); - } - } - else - { - WFCError("[SAE] Failed to parse WDI_SET_SAE_AUTH_PARAMS data - 0x%08x\n", ndisStatus); + WFCError("WifiIhvSetSaeAuthParams failed: %!STATUS!\n", ntStatus); } - CleanupParsedWdiSetSaeAuthParamsToIhv(&setSAEAuthParams); - } - break; - - case WDI_SET_LOCATION_PRIVACY: - { - WDI_SET_LOCATION_PRIVACY_PARAMETERS privacyParams; - ndisStatus = ParseWdiSetLocationPrivacyToIhv( - InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &privacyParams); - if (NDIS_STATUS_SUCCESS == ndisStatus) - { - WFCInfo("[WDI_SET_LOCATION_PRIVACY]: Got privacy setting = %x *****\n", privacyParams.LocationAllowed); - CleanupParsedWdiSetLocationPrivacy(&privacyParams); - } - else - { - WFCError("[WDI_SET_LOCATION_PRIVACY]: ParseWdiSetLocationPrivacyToIhv FAIled %x0x *****\n", ndisStatus); - } + CleanupParsedWdiSetSaeAuthParams(&setSAEAuthParams); } break; @@ -1066,9 +237,6 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf break; } - // Set the ndis Status in the WDI header - pWdiHeader->Status = ndisStatus; - // Set the output length if (pBytesWritten) { @@ -1076,446 +244,3 @@ static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buf } return ntStatus; } - -_Use_decl_annotations_ -NTSTATUS WifiCxTestSetDeviceCapabilities(WDFDEVICE Device) -{ - WIFI_DEVICE_CAPABILITIES deviceCaps = {}; - WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); - - deviceCaps.HardwareRadioState = TRUE; - deviceCaps.SoftwareRadioState = TRUE; - deviceCaps.FirmwareVersion[MAX_FIRMWARE_VERSION_LENGTH]; - deviceCaps.ActionFramesSupported = TRUE; - deviceCaps.NumRxStreams = 1; - deviceCaps.NumTxStreams = 1; - deviceCaps.Support_eCSA = FALSE; - deviceCaps.MACAddressRandomization = FALSE; - deviceCaps.MACAddressRandomizationMask.Address[0] = 0; - deviceCaps.MACAddressRandomizationMask.Address[1] = 0; - deviceCaps.MACAddressRandomizationMask.Address[2] = 0; - deviceCaps.MACAddressRandomizationMask.Address[3] = 0xFF; - deviceCaps.MACAddressRandomizationMask.Address[4] = 0; - deviceCaps.MACAddressRandomizationMask.Address[5] = 0; - deviceCaps.BluetoothCoexistenceSupport = WDI_BLUETOOTH_COEXISTENCE_PERFORMANCE_MAINTAINED; - deviceCaps.SupportsNonWdiOidRequests = FALSE; - deviceCaps.FastTransitionSupported = TRUE; - deviceCaps.MU_MIMOSupported = FALSE; - deviceCaps.SAEAuthenticationSupported = TRUE; - deviceCaps.BSSTransitionSupported = TRUE; - deviceCaps.MBOSupported = FALSE; - deviceCaps.BeaconReportsImplemented = FALSE; - - WifiDeviceSetDeviceCapabilities(Device, &deviceCaps); - - WIFI_STATION_CAPABILITIES StationCaps = {}; - WIFI_STATION_CAPABILITIES_INIT(&StationCaps); - - StationCaps.ScanSSIDListSize = 4; - StationCaps.DesiredSSIDListSize = 1; - StationCaps.PrivacyExemptionListSize = 1; - StationCaps.KeyMappingTableSize = 32; - StationCaps.DefaultKeyTableSize = 4; - StationCaps.WEPKeyValueMaxLength = 0x20; - StationCaps.MaxNumPerSTA = 4; - StationCaps.SupportedQOSFlags = 0; - StationCaps.HostFIPSModeImplemented = FALSE; - StationCaps.MFPCapable = TRUE; - StationCaps.AutoPowerSaveMode = FALSE; - StationCaps.BSSListCachemanagement = FALSE; - StationCaps.ConnectBSSSelectionOverride = FALSE; - StationCaps.MaxNetworkOffloadListSize = 0; - StationCaps.HESSIDConnectionSupported = FALSE; - StationCaps.FTMAsInitiatorSupport = FALSE; - StationCaps.FTMNumberOfSupportedTargets = 0; - - const DOT11_AUTH_CIPHER_PAIR UnicastAlgos[] = { - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_WEP}, - {DOT11_AUTH_ALGO_WPA_PSK, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_TKIP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_CCMP}, - }; - - const DOT11_AUTH_CIPHER_PAIR McastMgmtAlgos[] = { - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, - {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_BIP_GMAC_256}, - }; - - StationCaps.NumSupportedUnicastAlgorithms = ARRAYSIZE(UnicastAlgos); - StationCaps.UnicastAlgorithmsList = const_cast(UnicastAlgos); - StationCaps.NumSupportedMulticastDataAlgorithms = ARRAYSIZE(UnicastAlgos); - StationCaps.MulticastDataAlgorithmsList = const_cast(UnicastAlgos); - StationCaps.NumSupportedMulticastMgmtAlgorithms = ARRAYSIZE(McastMgmtAlgos); - StationCaps.MulticastMgmtAlgorithmsList = const_cast(McastMgmtAlgos); - - WIFI_STA_BANDS_COMBINATION SecondaryStaBandsCombinations[] = { - {2, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {2, {WDI_BAND_ID_2400, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {2, {WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {3, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN}}, - }; - - StationCaps.NumSecondaryStaBandCombinations = ARRAYSIZE(SecondaryStaBandsCombinations); - StationCaps.SecondaryStaBandsCombinations = SecondaryStaBandsCombinations; - - WDI_MAC_ADDRESS MLOAddresses[] = { - {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, - {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, - }; - StationCaps.MaxMLOLinksSupported = ARRAYSIZE(MLOAddresses); - StationCaps.MLOAddressesList = MLOAddresses; - - RSNA_AKM_SUITE AkmsList[] = { - rsna_akm_1x, - rsna_akm_psk, - rsna_akm_ft_1x_sha256, - rsna_akm_ft_psk_sha256, - rsna_akm_1x_sha256, - rsna_akm_psk_sha256, - rsna_akm_sae_pmk256, - rsna_akm_1x_suite_b_sha384, - rsna_akm_owe, - rsna_akm_1x_sha384, - rsna_akm_sae_pmk384, - }; - StationCaps.NumAkmsSupported = ARRAYSIZE(AkmsList); - StationCaps.AkmsList = AkmsList; - - if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)) - { - StationCaps.MSCSSupported = true; - } - if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)) - { - StationCaps.DSCPToUPMappingSupported = true; - } -#ifdef _KERNEL_MODE - if (!KdRefreshDebuggerNotPresent()) - { - DbgPrintEx( - DPFLTR_DEFAULT_ID, - DPFLTR_ERROR_LEVEL, - "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::MSCSSupported %u\n", - WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)); - DbgPrintEx( - DPFLTR_DEFAULT_ID, - DPFLTR_ERROR_LEVEL, - "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::DSCPToUPMappingSupported %u\n", - WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)); - DbgPrintEx( - DPFLTR_DEFAULT_ID, - DPFLTR_ERROR_LEVEL, - "WIFI_IS_FIELD_AVAILABLE:WIFI_STATION_CAPABILITIES::MaxNumConfigurableActionFrameWakePatterns %u\n", - WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MaxNumConfigurableActionFrameWakePatterns)); - DbgPrintEx( - DPFLTR_DEFAULT_ID, - DPFLTR_ERROR_LEVEL, - "WIFI_IS_FUNCTION_AVAILABLE:WifiPowerOffloadGetActionFrameWakePatternParameters %u\n", - WIFI_IS_FUNCTION_AVAILABLE(WifiPowerOffloadGetActionFrameWakePatternParameters)); - } -#endif - WifiDeviceSetStationCapabilities(Device, &StationCaps); - - WIFI_BAND_CAPABILITIES BandCaps = {}; - WIFI_BAND_CAPABILITIES_INIT(&BandCaps); - - const WDI_PHY_TYPE Phy24GHz[] = { WDI_PHY_TYPE_ERP, WDI_PHY_TYPE_HE }; // g, ax - const WDI_PHY_TYPE Phy5GHz[] = { WDI_PHY_TYPE_OFDM, WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // a, ax, be - const WDI_PHY_TYPE Phy6GHz[] = { WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // ax, be - const WDI_PHY_TYPE pPhy60GHz[] = { WDI_PHY_TYPE_DMG }; // ad - const WDI_PHY_TYPE phyIHV[2] = { WDI_PHY_TYPE_OFDM, static_cast(WDI_PHY_TYPE_IHV_START + 1) }; - - // clang-format off - - const WDI_CHANNEL_MAPPING_ENTRY ChannelMap24[] = { - {1, 2412}, - {2, 2417}, - {3, 2422}, - {4, 2427}, - {5, 2432}, - {6, 2437}, - {7, 2442}, - {8, 2447}, - {9, 2452}, - {10, 2457}, - {11, 2462}, - {12, 2467}, // Not used in US - {13, 2472}, // Not used in US - {14, 2484}, // Allowed in Japan only - }; - - const WDI_CHANNEL_MAPPING_ENTRY ChannelMap5[] = { - {7, 5035}, // Not used in US - {8, 5040}, // Not used in US - {9, 5045}, // Not used in US - {11, 5055}, // Not used in US - {12, 5060}, // Not used in US - {16, 5080}, // Not used in US - {32, 5160}, // Unknown status - {34, 5170}, // Not used in US - {36, 5180}, - {38, 5190}, - {40, 5200}, - {42, 5210}, - {44, 5220}, - {46, 5230}, - {48, 5240}, - {50, 5250}, // DFS - {52, 5260}, // DFS - {54, 5270}, // DFS - {56, 5280}, // DFS - {58, 5290}, // DFS - {60, 5300}, // DFS - {62, 5310}, // DFS - {64, 5320}, // DFS - {68, 5340}, // Unknown status - {96, 5480}, // Unknown status - {100, 5500}, // DFS - {102, 5510}, // DFS - {104, 5520}, // DFS - {106, 5530}, // DFS - {108, 5540}, // DFS - {110, 5550}, // DFS - {112, 5560}, // DFS - {114, 5570}, // DFS - {116, 5580}, // DFS - {118, 5590}, // DFS - {120, 5600}, // DFS - {122, 5610}, // DFS - {124, 5620}, // DFS - {126, 5630}, // DFS - {128, 5640}, // DFS - {132, 5660}, // DFS - {134, 5670}, // DFS - {136, 5680}, // DFS - {138, 5690}, // DFS - {140, 5700}, // DFS - {142, 5710}, // DFS - {142, 5720}, // DFS - {144, 5730}, // DFS - {149, 5745}, - {151, 5755}, - {153, 5765}, - {155, 5785}, - {157, 5785}, - {159, 5795}, - {161, 5805}, - {165, 5825}, - {169, 5845}, // Not used in US - {173, 5865}, // Not used in US - {183, 4915}, // Not used in US - {184, 4920}, // Not used in US - {185, 4925}, // Not used in US - {187, 4935}, // Not used in US - {188, 4940}, // Not used in US - {189, 4945}, // Not used in US - {192, 4960}, // Not used in US - {196, 4980}, // Not used in US - }; - - const WDI_CHANNEL_MAPPING_ENTRY channelMap6[] = { - {1, 5955}, - {5, 5975}, // PSC Channel (1) - {9, 5995}, - - {13, 6015}, - {17, 6035}, - {21, 6055}, // PSC Channel (2) - {25, 6075}, - {29, 6095}, - - {33, 6115}, - {37, 6135}, // PSC Channel (3) - {41, 6155}, - {45, 6175}, - {49, 6195}, - - {53, 6215}, // PSC Channel (4) - {57, 6235}, - {61, 6255}, - {65, 6275}, - {69, 6295}, // PSC Channel (5) - - {73, 6315}, - {77, 6335}, - {81, 6355}, - {85, 6375}, // PSC Channel (6) - {89, 6395}, - - {93, 6415}, - {97, 6435}, - {101, 6455}, // PSC Channel (7) - {105, 6475}, - {109, 6495}, - - {113, 6515}, - {117, 6535}, // PSC Channel (8) - {121, 6555}, - {125, 6575}, - {129, 6595}, - - {133, 6615}, // PSC Channel (9) - {137, 6635}, - {141, 6655}, - {145, 6675}, - {149, 6695}, // PSC Channel (10) - - {153, 6715}, - {157, 6735}, - {161, 6755}, - {165, 6775}, // PSC Channel (11) - {169, 6795}, - - {173, 6815}, - {177, 6835}, - {181, 6855}, // PSC Channel (12) - {185, 6875}, - {189, 6895}, - - {193, 6915}, - {197, 6935}, // PSC Channel (13) - {201, 6955}, - {205, 6975}, - {209, 6995}, - - {213, 7015}, // PSC Channel (14) - {217, 7035}, - {221, 7055}, - {225, 7075}, - {229, 7095}, // PSC Channel (15) - - {233, 7115}, - {237, 7135}, - {241, 7155}, - {245, 7175}, - {249, 7195}, - - {253, 7215}, - }; - - const WDI_CHANNEL_MAPPING_ENTRY channelMap60[] = { - {1, 58320}, - {2, 60480}, - {3, 62640}, - {4, 64800}, - {5, 66960}, - {6, 69120}, - }; - - // clang-format on - - UINT32 ChannelWidth10Mhz = 10; - UINT32 ChannelWidth20Mhz = 20; - UINT32 channelWidth2160Mhz = 2160; - UINT32 pChannelWidth6Ghz[] = { 20, 40, 80, 160, 320 }; - - WIFI_BAND_INFO BandInfo[4] = {}; // Upto 4 bands - UINT32 bandInfoCount = 0; - - if (g_SupportedBands & WDI_BAND_ID_2400) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_2400; - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy24GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy24GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap24); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap24); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth10Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 1); - - if (g_SupportedBands & WDI_BAND_ID_5000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_5000; - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy5GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy5GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap5); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap5); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth20Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 2); - - if (g_SupportedBands & WDI_BAND_ID_6000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_6000; // 6 - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy6GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy6GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap6); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap6); - BandInfo[bandInfoCount].NumChannelWidths = ARRAYSIZE(pChannelWidth6Ghz); - BandInfo[bandInfoCount].ChannelWidthList = pChannelWidth6Ghz; - bandInfoCount++; - } - - NT_ASSERT(bandInfoCount <= 3); - if (g_SupportedBands & WDI_BAND_ID_60000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_60000; // 60 - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(pPhy60GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(pPhy60GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap60); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap60); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &channelWidth2160Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 4); - - BandCaps.NumBands = bandInfoCount; - BandCaps.BandInfoList = BandInfo; - - WifiDeviceSetBandCapabilities(Device, &BandCaps); - - WIFI_PHY_CAPABILITIES PhyCaps = {}; - WIFI_PHY_CAPABILITIES_INIT(&PhyCaps); - - WIFI_PHY_INFO PhyInfoList[3]; - - const WDI_DATA_RATE_ENTRY DataRateListErp[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 4}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 22}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - const WDI_DATA_RATE_ENTRY DataRateListOfdm[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - const WDI_DATA_RATE_ENTRY DataRateListEht[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - - PhyInfoList[0].PhyType = WDI_PHY_TYPE_ERP; - PhyInfoList[0].NumberDataRateEntries = ARRAYSIZE(DataRateListErp); - RtlCopyMemory(&PhyInfoList[0].DataRateList, &DataRateListErp, sizeof(DataRateListErp)); - - PhyInfoList[1].PhyType = WDI_PHY_TYPE_HE; - PhyInfoList[1].NumberDataRateEntries = ARRAYSIZE(DataRateListOfdm); - RtlCopyMemory(&PhyInfoList[1].DataRateList, &DataRateListOfdm, sizeof(DataRateListOfdm)); - - PhyInfoList[2].PhyType = WDI_PHY_TYPE_EHT; - PhyInfoList[2].NumberDataRateEntries = ARRAYSIZE(DataRateListEht); - RtlCopyMemory(&PhyInfoList[2].DataRateList, &DataRateListEht, sizeof(DataRateListEht)); - - PhyCaps.NumPhyTypes = ARRAYSIZE(PhyInfoList); - PhyCaps.PhyInfoList = PhyInfoList; - - WifiDeviceSetPhyCapabilities(Device, &PhyCaps); - - return STATUS_SUCCESS; -} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifirequest.h b/network/wlan/WIFICX/drivercode/wifirequest.h index b2221c1e..601fec7d 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.h +++ b/network/wlan/WIFICX/drivercode/wifirequest.h @@ -1,30 +1,16 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once +#include "device.h" EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; static NTSTATUS ProcessWifiRequest( _In_ WDFDEVICE Device, _In_ UINT16 MessageId, _In_ void* Buffer, _In_ UINT InBufferLen, _In_ UINT OutBufferLen, _In_ UINT* pBytesWritten); -UINT WifiCxTestSetOutput( - _In_ PWIFI_DEVICE_CONTEXT pDeviceContext, - _Inout_ void* ReqBuffer, - _In_ SIZE_T ReqBufferSize, - _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, - _In_ UINT32 TlvDataSize); - -void WifiCxTestSendIndication( +void WifiIhvSendIndicationToOs( _In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT16 MessageId, _In_ UINT32 TransactionId, _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, _In_ UINT32 TlvDataSize); - -NDIS_STATUS WifiCxTestGetAdapterCapabilities(_In_ PWIFI_DEVICE_CONTEXT pDeviceContext, _In_ void* ReqBuffer, _In_ SIZE_T ReqBufferSize); - -NDIS_STATUS WifiCxTestSetAdapterConfiguration(_In_ PWIFI_DEVICE_CONTEXT pDeviceContext, _In_ void* ReqBuffer, _In_ SIZE_T ReqBufferSize); - -NTSTATUS WifiCxTestSetDeviceCapabilities(_In_ WDFDEVICE Device); - -ULONG g_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index 73dfb632..aea719ed 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -127,6 +127,9 @@ true $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + ..\drivercode\trace.h + false $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -138,6 +141,10 @@ $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -149,6 +156,10 @@ $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -160,6 +171,10 @@ $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -177,13 +192,19 @@ + + + + + + - + diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj index 5e4d00b9..70383f39 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -128,9 +128,13 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true + ..\drivercode\trace.h + false + false + true $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -141,9 +145,13 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true + ..\drivercode\trace.h + false + false + true $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -154,9 +162,13 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true + ..\drivercode\trace.h + false + false + true $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -167,9 +179,13 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true + ..\drivercode\trace.h + false + false + true $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -181,10 +197,12 @@ + - - + + + @@ -193,6 +211,7 @@ + diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters index 20ff1a35..099c33f8 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters @@ -24,42 +24,54 @@ - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + + Header Files + + + Header Files + + + Header Files + + Header Files - + + Source Files + + Source Files - + Source Files - + Source Files - + Source Files - + Source Files -- cgit v1.3.1 From 773e9d01f3348ec31b63eccb6b42bd72d206a32c Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 13 Nov 2025 19:25:14 -0800 Subject: have the M3 and M4 correctly trigger --- .../wlan/WIFICX/drivercode/transition_steps.hpp | 17 ++ network/wlan/WIFICX/drivercode/umkmfusion.h | 18 +- network/wlan/WIFICX/drivercode/wifihal.cpp | 100 ++++--- network/wlan/WIFICX/drivercode/wifihal.h | 24 +- network/wlan/WIFICX/drivercode/wifirequest.cpp | 237 +++------------ network/wlan/WIFICX/drivercode/wifirequest.h | 14 +- network/wlan/WIFICX/drivercode/wifitransition.cpp | 25 ++ network/wlan/WIFICX/drivercode/wifitransition.h | 332 +++++++++++++++++++++ .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 2 + .../WIFICX/km/wificxsampleclientkm.vcxproj.filters | 56 ++-- .../wlan/WIFICX/um/wificxsampleclientum.vcxproj | 2 + .../WIFICX/um/wificxsampleclientum.vcxproj.filters | 6 + 12 files changed, 545 insertions(+), 288 deletions(-) create mode 100644 network/wlan/WIFICX/drivercode/transition_steps.hpp create mode 100644 network/wlan/WIFICX/drivercode/wifitransition.cpp create mode 100644 network/wlan/WIFICX/drivercode/wifitransition.h diff --git a/network/wlan/WIFICX/drivercode/transition_steps.hpp b/network/wlan/WIFICX/drivercode/transition_steps.hpp new file mode 100644 index 00000000..dc04eab2 --- /dev/null +++ b/network/wlan/WIFICX/drivercode/transition_steps.hpp @@ -0,0 +1,17 @@ +template +NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepFns... fns) +{ + NTSTATUS status = STATUS_SUCCESS; + auto seq = { (status = (fns(ctx, p)), status == STATUS_SUCCESS ? 0 : 1)... }; + UNREFERENCED_PARAMETER(seq); + return status; +} + +// In a traits Handle(): +static NTSTATUS Handle(TransitionContext& ctx, ParamType& params) +{ + return ExecuteSteps(ctx, params, + [](TransitionContext& c, ParamType& par){ return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); }, + [](TransitionContext& c, ParamType&){ return STATUS_SUCCESS; } // extra step + ); +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/umkmfusion.h b/network/wlan/WIFICX/drivercode/umkmfusion.h index f94454f8..35e5a6cf 100644 --- a/network/wlan/WIFICX/drivercode/umkmfusion.h +++ b/network/wlan/WIFICX/drivercode/umkmfusion.h @@ -19,17 +19,23 @@ namespace Wifi } // Trace the HRESULT value for diagnostics - - return SUCCEEDED(hr) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } - _inline - NTSTATUS ConvertNDISSTATUSoNTSTATUS(NDIS_STATUS ndisStatus) { - - return ndisStatus > 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + __inline + NTSTATUS ConvertNDISSTATUSToNTSTATUS(NDIS_STATUS ndisStatus) + { + // NDIS_STATUS_SUCCESS is 0x00000000 + // Any non-success NDIS status should map to STATUS_UNSUCCESSFUL + return (ndisStatus == NDIS_STATUS_SUCCESS) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } + __inline + NDIS_STATUS ConvertNTSTATUSToNDISSTATUS(NTSTATUS ntStatus) + { + // Use NT_SUCCESS macro to check NTSTATUS + return NT_SUCCESS(ntStatus) ? NDIS_STATUS_SUCCESS : NDIS_STATUS_FAILURE; + } _Must_inspect_result_ _inline diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 824ab6ac..edeb8fe0 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -6,7 +6,7 @@ #include "WifiHal.h" #include "WifiHal.tmh" -NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) +NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() { WIFI_DEVICE_CAPABILITIES deviceCaps = {}; WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); @@ -35,7 +35,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) deviceCaps.BeaconReportsImplemented = FALSE; WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetDeviceCapabilities(Device, &deviceCaps), + WifiDeviceSetDeviceCapabilities(m_Device, &deviceCaps), "Failed to set device capabilities"); WIFI_STATION_CAPABILITIES StationCaps = {}; @@ -133,7 +133,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) } WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetStationCapabilities(Device, &StationCaps), + WifiDeviceSetStationCapabilities(m_Device, &StationCaps), "Failed to set station capabilities"); WIFI_BAND_CAPABILITIES BandCaps = {}; @@ -392,7 +392,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) BandCaps.BandInfoList = BandInfo; WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetBandCapabilities(Device, &BandCaps), + WifiDeviceSetBandCapabilities(m_Device, &BandCaps), "Failed to set band capabilities"); WIFI_PHY_CAPABILITIES PhyCaps = {}; @@ -426,13 +426,13 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities(WDFDEVICE Device) PhyCaps.PhyInfoList = PhyInfoList; WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetPhyCapabilities(Device, &PhyCaps), + WifiDeviceSetPhyCapabilities(m_Device, &PhyCaps), "Failed to set PHY capabilities"); return STATUS_SUCCESS; } -NTSTATUS WifiHAL::WifiIhvReset(WDFDEVICE Device, const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER) { if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) { @@ -453,13 +453,12 @@ NTSTATUS WifiHAL::WifiIhvReset(WDFDEVICE Device, const WDI_TASK_DOT11_RESET_PARA // Reset the connection ID in case the previous connection attempt did not complete m_LastConnectEntryId = 0; - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DOT11_RESET_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - + return STATUS_SUCCESS; } _Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSetRadioState(WDFDEVICE Device, const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT Context) +NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader) { if (RadioState.SoftwareRadioState != m_CurrentRadioState) { @@ -473,20 +472,18 @@ NTSTATUS WifiHAL::WifiIhvSetRadioState(WDFDEVICE Device, const WDI_SET_RADIO_STA RadioStatusParams.RadioState.HardwareState = TRUE; RadioStatusParams.RadioState.SoftwareState = m_CurrentRadioState; - if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, Context, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) + if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, m_TlvContext, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) { - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, 0, pOutput, cbOutput); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, pOutput, cbOutput); FreeGenerated(pOutput); } } - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SET_RADIO_STATE_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - return STATUS_SUCCESS; } _Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvScan(WDFDEVICE Device, WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +NTSTATUS WifiHAL::WifiIhvScan(WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader) { for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) { @@ -510,11 +507,10 @@ NTSTATUS WifiHAL::WifiIhvScan(WDFDEVICE Device, WDI_SCAN_PARAMETERS& ScanParamet } // Send the BSS entry indication - WifiIhvSendIndicationToOs( - Device, + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, - 0, g_ConnectEntries[connectEntry].pTlvBssEntry, g_ConnectEntries[connectEntry].TlvBssEntrySize); } @@ -527,16 +523,14 @@ NTSTATUS WifiHAL::WifiIhvScan(WDFDEVICE Device, WDI_SCAN_PARAMETERS& ScanParamet (ScanParameters.SSIDList.pElements[0].pElements[4] == 'H') && (ScanParameters.SSIDList.pElements[0].pElements[5] == 'I') && (ScanParameters.SSIDList.pElements[0].pElements[6] == 'D') && (ScanParameters.SSIDList.pElements[0].pElements[7] == 'E')) { - WifiIhvSendIndicationToOs( - Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, 0, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); } - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SCAN_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); - return STATUS_SUCCESS; } -NTSTATUS WifiHAL::WifiIhvConnect(WDFDEVICE Device, WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT) +NTSTATUS WifiHAL::WifiIhvConnect(WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader) { NT_ASSERT(m_LastConnectEntryId == 0); if (m_LastConnectEntryId != 0) // Not Disconnected State @@ -548,26 +542,25 @@ NTSTATUS WifiHAL::WifiIhvConnect(WDFDEVICE Device, WDI_TASK_CONNECT_PARAMETERS& } WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( - Device, &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), + &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), "Failed to perform association"); // // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete // - if (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo) + if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) { - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); + return STATUS_PENDING; } - return STATUS_SUCCESS; } _Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) +NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) { // Report link quality NTSTATUS ntStatus = STATUS_SUCCESS; - PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(Device); + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; UINT8* pOutput = nullptr; @@ -612,7 +605,7 @@ NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWD ntStatus = GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); if (STATUS_SUCCESS == ntStatus) { - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, 0, pOutput, cbOutput); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, pOutput, cbOutput); FreeGenerated(pOutput); } else @@ -625,7 +618,6 @@ NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWD _Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvPerformAssociation( - WDFDEVICE Device, struct ArrayOfElements* pPreferredBSSEntryList, struct ArrayOfElements* pAuthenticationAlgorithms, PWDI_MESSAGE_HEADER pWdiHeader) @@ -640,7 +632,7 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( #ifdef WIFI_IHV_NETV WifiNetvDevice* pDeviceContext = WifiNetvDeviceGetContext(Device); #else - PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(Device); + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); #endif // WIFI_IHV_NETV ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; @@ -693,7 +685,7 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( { WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); FreeGenerated(pOutput); @@ -705,11 +697,10 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); // Send the association indication - WifiIhvSendIndicationToOs( - Device, + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, pWdiHeader, WDI_INDICATION_ASSOCIATION_RESULT, - 0, g_ConnectEntries[connectEntry].pTlvAssociationResult, g_ConnectEntries[connectEntry].TlvAssociationResultSize); @@ -743,14 +734,22 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo)) { // Report link quality - ntStatus = WifiIhvSendLinkStateIndication(Device, pWdiHeader, 2); + ntStatus = WifiIhvSendLinkStateIndication(pWdiHeader, 2); } return ntStatus; } -NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(WDFDEVICE Device, const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, PCTLV_CONTEXT Context) +NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader) { + //Since this is DIRECT OID, need to check the m_LastConnectTransactionId match + if (pWdiHeader->TransactionId != m_LastConnectTransactionId) + { + WFCError("WDI_SET_SAE_AUTH_PARAMS called with invalid TransactionId: %llu, expected: %llu\n", + pWdiHeader->TransactionId, m_LastConnectTransactionId); + return STATUS_INVALID_DEVICE_REQUEST; + } + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded{}; UINT8* pOutput = nullptr; ULONG cbOutput = 0; @@ -826,21 +825,20 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(WDFDEVICE Device, const WDI_SET_SAE_AU g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; } - WifiIhvSendIndicationToOs( - Device, + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, pWdiHeader, WDI_INDICATION_ASSOCIATION_RESULT, - 0, g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult, g_ConnectEntries[m_LastConnectEntryId].TlvAssociationResultSize); RtlCopyMemory(&m_ConnectedPeer, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); // Report link quality - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(Device, pWdiHeader, 1), + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(pWdiHeader, 1), "Failed WifiIhvSendLinkStateIndication"); - WifiIhvSendIndicationToOs( - Device, pWdiHeader, WDI_INDICATION_CONNECT_COMPLETE, m_LastConnectTransactionId, nullptr, 0); + WifiIhvSendM4IndicationToOs( + m_Device, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader, STATUS_SUCCESS); #ifdef WIFI_IHV_HANDSHAKE // // Receive M1 frame of 4-way handshake @@ -857,10 +855,10 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(WDFDEVICE Device, const WDI_SET_SAE_AU RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); auto ndisStatus = - GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, Context, &cbOutput, &pOutput); + GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, m_TlvContext, &cbOutput, &pOutput); if (ndisStatus == NDIS_STATUS_SUCCESS) { - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, 0, pOutput, cbOutput); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); FreeGenerated(pOutput); } @@ -873,7 +871,7 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(WDFDEVICE Device, const WDI_SET_SAE_AU } _Use_decl_annotations_ -void WifiHAL::WifiIhvPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) +void WifiHAL::WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) { UCHAR s_TLV_Disassociation[] = { @@ -895,13 +893,17 @@ void WifiHAL::WifiIhvPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESS RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); // Send the disassociation indication - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, 0, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); m_LastConnectEntryId = 0; // Disconnected State #ifdef WIFI_IHV_NETV DeleteDatapathPeer(0x33); #endif +} - WifiIhvSendIndicationToOs(Device, pWdiHeader, WDI_INDICATION_DISCONNECT_COMPLETE, pWdiHeader->TransactionId, nullptr, 0); -} \ No newline at end of file +WifiHAL::WifiHAL(WDFDEVICE Device) +{ + m_Device = Device; + m_TlvContext = &WifiGetIhvDeviceContext(Device)->TlvContext; +} diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h index 5f1ec299..d2d770d9 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.h +++ b/network/wlan/WIFICX/drivercode/wifihal.h @@ -5,17 +5,21 @@ class WifiHAL { public: - NTSTATUS WifiIhvSetDeviceCapabilities(_In_ WDFDEVICE Device); - NTSTATUS WifiIhvReset(_In_ WDFDEVICE Device,_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); - NTSTATUS WifiIhvSetRadioState(_In_ WDFDEVICE Device, _In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); - NTSTATUS WifiIhvScan(_In_ WDFDEVICE Device, _In_ WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); - NTSTATUS WifiIhvConnect(_In_ WDFDEVICE Device, _In_ WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); - NTSTATUS WifiIhvPerformAssociation(_In_ WDFDEVICE Device, _In_ struct ArrayOfElements* pPreferredBSSEntryList, _In_ struct ArrayOfElements* pAuthenticationAlgorithms, _In_ PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvSetSaeAuthParams(_In_ WDFDEVICE Device, _In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ PCTLV_CONTEXT Context); - void WifiIhvPerformDisassociation(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus); + WifiHAL(_In_ WDFDEVICE Device); + NTSTATUS WifiIhvSetDeviceCapabilities(); + NTSTATUS WifiIhvReset(_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvSetRadioState(_In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvScan(_In_ WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvConnect(_In_ WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvPerformAssociation(_In_ struct ArrayOfElements* pPreferredBSSEntryList, _In_ struct ArrayOfElements* pAuthenticationAlgorithms, _In_ PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + void WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus); private: - NTSTATUS WifiIhvSendLinkStateIndication(_In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); - + NTSTATUS WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); + + WDFDEVICE m_Device{}; + PCTLV_CONTEXT m_TlvContext{}; + UCHAR m_CurrentRadioState{}; UINT32 m_LastConnectEntryId{}; UINT32 m_LastConnectTransactionId{}; diff --git a/network/wlan/WIFICX/drivercode/wifirequest.cpp b/network/wlan/WIFICX/drivercode/wifirequest.cpp index 1fefe040..525fa14c 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.cpp +++ b/network/wlan/WIFICX/drivercode/wifirequest.cpp @@ -1,31 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #include "precomp.h" -#include "wifiHAL.h" +#include "wifitransition.h" #include "wifirequest.h" #include "wifirequest.tmh" _Use_decl_annotations_ void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) { - NTSTATUS Status = STATUS_SUCCESS; UINT InBufferLen = 0; UINT OutBufferLen = 0; - UINT BytesWritten = 0; void* Buffer = WifiRequestGetInOutBuffer(SendRequest, &InBufferLen, &OutBufferLen); UINT16 MessageId = WifiRequestGetMessageId(SendRequest); - Status = ProcessWifiRequest(Device, MessageId, Buffer, InBufferLen, OutBufferLen, &BytesWritten); - - if (Status != STATUS_PENDING) + TransitionContext tctx{ + Device, + WifiGetIhvDeviceContext(Device), + SendRequest, + static_cast(Buffer), + Buffer, + InBufferLen, + OutBufferLen + }; + + if(!NT_SUCCESS(RunTransitionByMessage(tctx, MessageId))) { - WifiRequestComplete(SendRequest, Status, BytesWritten); + WFCError("RunTransitionByMessage failed for MessageId: 0x%04X", MessageId); + return; } - return; } -_Use_decl_annotations_ -void WifiIhvSendIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, UINT32 TransactionId, PUCHAR pTlvData, UINT32 TlvDataSize) +void WifiIhvSendIndicationToOs( + _In_ WDFDEVICE Device, + _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, + _In_ UINT16 WifiRequestMessageId, + _In_ UINT32 WifiRequestTransactionId, + _In_ NTSTATUS WifiRquestM4Status, + _In_ PUCHAR pTlvData, + _In_ UINT32 TlvDataSize) { WDFMEMORY data = WDF_NO_HANDLE; PUCHAR pIndicationBuffer = nullptr; @@ -45,8 +57,9 @@ void WifiIhvSendIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, RtlZeroMemory(pIndicationBuffer, indicationSize); pIndicationHeader = reinterpret_cast(pIndicationBuffer); - RtlCopyMemory(pIndicationHeader, pWdiHeader, sizeof(WDI_MESSAGE_HEADER)); - pIndicationHeader->TransactionId = TransactionId; + RtlCopyMemory(pIndicationHeader, pOriginalWdiHeader, sizeof(WDI_MESSAGE_HEADER)); + pIndicationHeader->TransactionId = WifiRequestTransactionId; + pIndicationHeader->Status = Wifi::ConvertNDISSTATUSToNTSTATUS(WifiRquestM4Status); if (TlvDataSize > 0) { @@ -54,193 +67,31 @@ void WifiIhvSendIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, } // Send the indication up to WifiCx - WifiDeviceReceiveIndication(Device, MessageId, data); + WifiDeviceReceiveIndication(Device, WifiRequestMessageId, data); // Don't need to keep this around WdfObjectDelete(data); } _Use_decl_annotations_ -static NTSTATUS ProcessWifiRequest(WDFDEVICE Device, UINT16 MessageId, void* Buffer, UINT InBufferLen, UINT OutBufferLen, UINT* pBytesWritten) +void WifiIhvSendUnsolicitedIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, PUCHAR pTlvData, UINT32 TlvDataSize) { - NTSTATUS ntStatus = STATUS_SUCCESS; - PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); - PWDI_MESSAGE_HEADER pWdiHeader = static_cast(Buffer); - UINT BytesWritten = sizeof(WDI_MESSAGE_HEADER); - - if (InBufferLen < sizeof(WDI_MESSAGE_HEADER)) - { - return STATUS_INVALID_PARAMETER; - } - - if (OutBufferLen < sizeof(WDI_MESSAGE_HEADER)) - { - return STATUS_INVALID_PARAMETER; - } - - auto const buffer = static_cast(Buffer); - - // Check for integer overflow - if (!(buffer + InBufferLen > buffer)) - { - return STATUS_INVALID_PARAMETER; - } - - switch (MessageId) - { - case WDI_TASK_SET_RADIO_STATE: - { - WDI_SET_RADIO_STATE_PARAMETERS RadioStateParams = {}; - ULONG TLVStreamLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); - auto TLVByteStream = buffer +sizeof(WDI_MESSAGE_HEADER); - - DumpMessageTlvByteStream( - WDI_TASK_SET_RADIO_STATE, TRUE, deviceContext->TlvContext.PeerVersion, TLVStreamLength, TLVByteStream, 0, nullptr); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - Wifi::ConvertNDISSTATUSoNTSTATUS( - ParseWdiTaskSetRadioState( - TLVStreamLength, - TLVByteStream, - &deviceContext->TlvContext, - &RadioStateParams)), - "Set Radio State parsing failed"); - - // No WX_RETURN here since we need to cleanup. - ntStatus = deviceContext->wifiHAL->WifiIhvSetRadioState( - Device, RadioStateParams, pWdiHeader, &deviceContext->TlvContext); - if(!NT_SUCCESS(ntStatus)) - { - WFCError("WifiIhvSetRadioState failed: %!STATUS!\n", ntStatus); - } - - CleanupParsedWdiTaskSetRadioState(&RadioStateParams); - } - break; - case WDI_TASK_SCAN: - { - ULONG scanDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); - auto pScanData = buffer + sizeof(WDI_MESSAGE_HEADER); - - WDI_SCAN_PARAMETERS scanParams = {}; - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - Wifi::ConvertNDISSTATUSoNTSTATUS( - ParseWdiTaskScan( - scanDataLength, - pScanData, - &deviceContext->TlvContext, - &scanParams)), - "Scan parameters parsing failed"); - - // No WX_RETURN here since we need to cleanup. - ntStatus = deviceContext->wifiHAL->WifiIhvScan( - Device, scanParams, pWdiHeader, &deviceContext->TlvContext); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("WifiIhvSetRadioState failed: %!STATUS!\n", ntStatus); - } - - CleanupParsedWdiTaskScan(&scanParams); - } - break; - - case WDI_TASK_DOT11_RESET: - { - WDI_TASK_DOT11_RESET_PARAMETERS resetParameters; - - ULONG resetDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); - auto pResetData = buffer + sizeof(WDI_MESSAGE_HEADER); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiTaskDot11Reset(resetDataLength, pResetData, &deviceContext->TlvContext, &resetParameters)), - "DOT11 Reset parameters parsing failed"); - - // No WX_RETURN here since we need to cleanup. - ntStatus = deviceContext->wifiHAL->WifiIhvReset( - Device, resetParameters, pWdiHeader, &deviceContext->TlvContext); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("WifiIhvReset failed: %!STATUS!\n", ntStatus); - } - - CleanupParsedWdiTaskDot11Reset(&resetParameters); - } - break; - - case WDI_TASK_CONNECT: - { - ULONG connectDataLength = static_cast(InBufferLen - sizeof(WDI_MESSAGE_HEADER)); - auto pConnectData = buffer + sizeof(WDI_MESSAGE_HEADER); - - DumpMessageTlvByteStream(WDI_TASK_CONNECT, TRUE, deviceContext->TlvContext.PeerVersion, connectDataLength, pConnectData, 0, nullptr); - - WDI_TASK_CONNECT_PARAMETERS connectParams{}; - - - // We search for the BSSID pattern to figure out what AP we are trying to connect to - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiTaskConnect(connectDataLength, pConnectData, &deviceContext->TlvContext, &connectParams)), - "Connect parameters parsing failed"); - - // No WX_RETURN here since we need to cleanup. - ntStatus = deviceContext->wifiHAL->WifiIhvConnect( - Device, connectParams, pWdiHeader, &deviceContext->TlvContext); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("WifiIhvConnect failed: %!STATUS!\n", ntStatus); - } - - CleanupParsedWdiTaskConnect(&connectParams); - } - break; - - case WDI_TASK_DISCONNECT: - { - deviceContext->wifiHAL->WifiIhvPerformDisassociation(Device, pWdiHeader, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); - } - break; - - case WDI_SET_PRIVACY_EXEMPTION_LIST: - case WDI_SET_DEFAULT_KEY_ID: - case WDI_SET_ADD_CIPHER_KEYS: - case WDI_SET_DELETE_CIPHER_KEYS: - case WDI_SET_RECEIVE_PACKET_FILTER: - case WDI_SET_CONNECTION_QUALITY: - case WDI_SET_ADAPTER_CONFIGURATION: - // Doing Nothing special - break; - - case WDI_SET_SAE_AUTH_PARAMS: - { - WDI_SET_SAE_AUTH_PARAMS_COMMAND setSAEAuthParams; - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - Wifi::ConvertNDISSTATUSoNTSTATUS(ParseWdiSetSaeAuthParams( - InBufferLen - sizeof(WDI_MESSAGE_HEADER), (PUINT8)buffer + sizeof(WDI_MESSAGE_HEADER), &deviceContext->TlvContext, &setSAEAuthParams)), - "Failed to parse WDI_SET_SAE_AUTH_PARAMS"); - - // No WX_RETURN here since we need to cleanup. - ntStatus = deviceContext->wifiHAL->WifiIhvSetSaeAuthParams( - Device, setSAEAuthParams, pWdiHeader, &deviceContext->TlvContext); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("WifiIhvSetSaeAuthParams failed: %!STATUS!\n", ntStatus); - } - - CleanupParsedWdiSetSaeAuthParams(&setSAEAuthParams); - } - break; - - default: - ntStatus = STATUS_NOT_SUPPORTED; - break; - } - - // Set the output length - if (pBytesWritten) + WifiIhvSendIndicationToOs(Device, pWdiHeader, MessageId, 0, STATUS_SUCCESS, pTlvData, TlvDataSize); //TransactionId required to be 0 for unsolicited indications. +} +_Use_decl_annotations_ +void WifiIhvNotifyM3Completion(WIFIREQUEST Request, NTSTATUS WifiRequestM3Status, UINT BytesWritten) +{ + if(!NT_SUCCESS(WifiRequestM3Status)) { - *pBytesWritten = BytesWritten; - } - return ntStatus; + WFCError("WifiRequest M3 failed: %!STATUS!, BytesWritten: %d\n", WifiRequestM3Status, BytesWritten); + } + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiRequestComplete(Request, WifiRequestM3Status, BytesWritten); } + +_Use_decl_annotations_ +void WifiIhvSendM4IndicationToOs(WDFDEVICE Device, UINT16 WifiRequestMessageId, const PWDI_MESSAGE_HEADER pWdiHeader, NTSTATUS WifiRequestM4Status) +{ + WifiIhvSendIndicationToOs(Device, pWdiHeader, WifiRequestMessageId, pWdiHeader->TransactionId, WifiRequestM4Status, nullptr, 0); +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifirequest.h b/network/wlan/WIFICX/drivercode/wifirequest.h index 601fec7d..c3317eb3 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.h +++ b/network/wlan/WIFICX/drivercode/wifirequest.h @@ -7,10 +7,20 @@ EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; static NTSTATUS ProcessWifiRequest( _In_ WDFDEVICE Device, _In_ UINT16 MessageId, _In_ void* Buffer, _In_ UINT InBufferLen, _In_ UINT OutBufferLen, _In_ UINT* pBytesWritten); -void WifiIhvSendIndicationToOs( +void WifiIhvSendUnsolicitedIndicationToOs( _In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT16 MessageId, - _In_ UINT32 TransactionId, _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, _In_ UINT32 TlvDataSize); + +void WifiIhvNotifyM3Completion( + _In_ WIFIREQUEST Request, + _In_ NTSTATUS WifiRequestM3Status, + _In_ UINT BytesWritten); + +void WifiIhvSendM4IndicationToOs( + _In_ WDFDEVICE Device, + _In_ UINT16 WifiRequestMessageId, + _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, + _In_ NTSTATUS WifiRequestM4Status); \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp new file mode 100644 index 00000000..4e55f39c --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifitransition.cpp @@ -0,0 +1,25 @@ +#include "wifitransition.h" + +// Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. +NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) +{ + switch (messageId) + { + case WDI_TASK_SET_RADIO_STATE: + return RunTransition(ctx); + case WDI_TASK_SCAN: + return RunTransition(ctx); + case WDI_TASK_DOT11_RESET: + return RunTransition(ctx); + case WDI_TASK_CONNECT: + return RunTransition(ctx); + case WDI_TASK_DISCONNECT: + return RunTransition(ctx); + case WDI_SET_SAE_AUTH_PARAMS: + return RunTransition(ctx); + default: + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); + WifiRequestComplete(ctx.WifiRequest, STATUS_NOT_SUPPORTED, bytesWritten); + return STATUS_NOT_SUPPORTED; + } +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifitransition.h b/network/wlan/WIFICX/drivercode/wifitransition.h new file mode 100644 index 00000000..d57e73cb --- /dev/null +++ b/network/wlan/WIFICX/drivercode/wifitransition.h @@ -0,0 +1,332 @@ +#pragma once +#include "precomp.h" +#include "wifiHAL.h" +#include "wifirequest.h" // WifiIhvSendM4IndicationToOs, DumpMessageTlvByteStream, Wifi::ConvertNDISSTATUSToNTSTATUS + +// Generic execution context passed between steps and parse/handle +struct TransitionContext +{ + WDFDEVICE Device; + PWIFI_IHV_DEVICE_CONTEXT DevCtx; + WIFIREQUEST WifiRequest; + PWDI_MESSAGE_HEADER Header; + void* RawBuffer; + UINT InLen; + UINT OutLen; +}; + +// Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. +template +NTSTATUS ParseTlvCommon(TransitionContext& ctx, + UINT16 messageId, + ParserFn parser, + Param& outParams, + bool dumpStream = true) +{ + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); + + if (dumpStream) + { + DumpMessageTlvByteStream( + messageId, + TRUE, + ctx.DevCtx->TlvContext.PeerVersion, + tlvLen, + tlvBytes, + 0, + nullptr); + } + + auto ndisStatus = parser(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &outParams); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); +} + +// Execute two step callables. +// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) +// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) +// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. +// Skips StepM4 if StepM3 failed +template +NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) +{ + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum + NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); + if (!NT_SUCCESS(m3Status)) + { + return m3Status; + } + return stepM4(ctx, p); +} +// Primary traits template (specialize per MessageId) +template +struct TransitionTraits; + +// -------- WDI_TASK_SET_RADIO_STATE -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SET_RADIO_STATE_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_SET_RADIO_STATE_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_SET_RADIO_STATE, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskSetRadioState(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p) { CleanupParsedWdiTaskSetRadioState(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); + } + ); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_SCAN -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SCAN_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_SCAN_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_SCAN, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskScan(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p){ CleanupParsedWdiTaskScan(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvScan(par, c.Header); + } + ); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_DOT11_RESET -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_TASK_DOT11_RESET_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_DOT11_RESET_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_DOT11_RESET, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskDot11Reset(len, bytes, tlvCtx, out); + }, + p, + false); + } + void Cleanup(ParamType& p){ CleanupParsedWdiTaskDot11Reset(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvReset(par, c.Header); + }); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_CONNECT -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_TASK_CONNECT_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_CONNECT_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_CONNECT, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskConnect(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p){ CleanupParsedWdiTaskConnect(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvConnect(par, c.Header); + }); + } + bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } +}; + +// -------- WDI_TASK_DISCONNECT -------- +template<> +struct TransitionTraits +{ + struct ParamType {}; + enum : UINT16 { CompleteIndication = WDI_INDICATION_DISCONNECT_COMPLETE }; + + NTSTATUS Parse(TransitionContext&, ParamType&){ return STATUS_SUCCESS; } + void Cleanup(ParamType&){} + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType&) + { + c.DevCtx->wifiHAL->WifiIhvPerformDisassociation(c.Header, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); + return STATUS_SUCCESS; + }); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_SET_SAE_AUTH_PARAMS -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SET_SAE_AUTH_PARAMS_COMMAND; + enum : UINT16 { CompleteIndication = 0 }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_SET_SAE_AUTH_PARAMS, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiSetSaeAuthParams(len, bytes, tlvCtx, out); + }, + p, + /*dumpStream*/ false); + } + + void Cleanup(ParamType& p) + { + CleanupParsedWdiSetSaeAuthParams(&p); + } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // Step M3: invoke HAL handler, report bytes written (just header) + [](TransitionContext& c, ParamType& par, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return c.DevCtx->wifiHAL->WifiIhvSetSaeAuthParams(par, c.Header); + }, + // Step M4: no-op (no completion indication for this OID) + [](TransitionContext&, ParamType&) { return STATUS_SUCCESS; }); + } + + bool ShouldSendComplete(NTSTATUS) const + { + // Do not send M4 indication for WDI_SET_SAE_AUTH_PARAMS (original code omitted it). + return false; + } +}; + +// -------- Generic runner (compile-time) -------- +template +NTSTATUS RunTransition(TransitionContext& ctx) +{ + TransitionTraits traits; + typename TransitionTraits::ParamType params{}; + NTSTATUS parseStatus = traits.Parse(ctx, params); + if (!NT_SUCCESS(parseStatus)) + { + traits.Cleanup(params); + // Report Failed M3 to OS + // Note: No M4 indication on parse failure + WifiIhvNotifyM3Completion(ctx.WifiRequest, parseStatus, 0); + return parseStatus; + } + + NTSTATUS m4Status = traits.Handle(ctx, params); + + if (traits.ShouldSendComplete(m4Status)) + { + WifiIhvSendM4IndicationToOs( + ctx.Device, + TransitionTraits::CompleteIndication, + ctx.Header, + m4Status); + } + + traits.Cleanup(params); + return m4Status; +} + +// -------- Runtime dispatcher (decl) -------- +NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId); \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index aea719ed..49510981 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -193,6 +193,7 @@ + @@ -205,6 +206,7 @@ + diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters index d1dec69c..2930b24d 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters @@ -17,15 +17,6 @@ {8E41214B-6785-4CFE-B992-037D68949A14} inf;inv;inx;mof;mc; - - {eed063b0-f52a-4d8e-b03f-1f616b73061c} - - - {56f07a12-b9fb-4ff6-a9b5-e4af54eed417} - - - {58bc1adc-c940-478a-898b-59d217c27f36} - @@ -33,51 +24,60 @@ - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - - Source Files\controlpath - - - Source Files\datapath + + Source Files - - Source Files\datapath + + Source Files - + + Header Files + + + Header Files + + + Header Files + + + Header Files + + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files - + Header Files diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj index 70383f39..715859e3 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -205,6 +205,7 @@ + @@ -213,6 +214,7 @@ + diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters index 099c33f8..a10fb659 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters @@ -54,6 +54,9 @@ Header Files + + Header Files + @@ -74,5 +77,8 @@ Source Files + + Source Files + \ No newline at end of file -- cgit v1.3.1 From efa7a263ea3939ecf56e6a1256458d12c400e169 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 13 Nov 2025 19:29:17 -0800 Subject: move the logic to CPP --- network/wlan/WIFICX/drivercode/wifitransition.cpp | 314 ++++++++++++++++++++++ network/wlan/WIFICX/drivercode/wifitransition.h | 313 --------------------- 2 files changed, 314 insertions(+), 313 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp index 4e55f39c..9ac857bc 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.cpp +++ b/network/wlan/WIFICX/drivercode/wifitransition.cpp @@ -1,5 +1,319 @@ #include "wifitransition.h" +// Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. +template +NTSTATUS ParseTlvCommon(TransitionContext& ctx, + UINT16 messageId, + ParserFn parser, + Param& outParams, + bool dumpStream = true) +{ + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); + + if (dumpStream) + { + DumpMessageTlvByteStream( + messageId, + TRUE, + ctx.DevCtx->TlvContext.PeerVersion, + tlvLen, + tlvBytes, + 0, + nullptr); + } + + auto ndisStatus = parser(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &outParams); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); +} + +// Execute two step callables. +// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) +// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) +// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. +// Skips StepM4 if StepM3 failed +template +NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) +{ + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum + NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); + if (!NT_SUCCESS(m3Status)) + { + return m3Status; + } + return stepM4(ctx, p); +} +// Primary traits template (specialize per MessageId) +template +struct TransitionTraits; + +// -------- WDI_TASK_SET_RADIO_STATE -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SET_RADIO_STATE_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_SET_RADIO_STATE_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_SET_RADIO_STATE, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskSetRadioState(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p) { CleanupParsedWdiTaskSetRadioState(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); + } + ); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_SCAN -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SCAN_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_SCAN_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_SCAN, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskScan(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p) { CleanupParsedWdiTaskScan(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvScan(par, c.Header); + } + ); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_DOT11_RESET -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_TASK_DOT11_RESET_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_DOT11_RESET_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_DOT11_RESET, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskDot11Reset(len, bytes, tlvCtx, out); + }, + p, + false); + } + void Cleanup(ParamType& p) { CleanupParsedWdiTaskDot11Reset(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvReset(par, c.Header); + }); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_TASK_CONNECT -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_TASK_CONNECT_PARAMETERS; + enum : UINT16 { CompleteIndication = WDI_INDICATION_CONNECT_COMPLETE }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_TASK_CONNECT, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiTaskConnect(len, bytes, tlvCtx, out); + }, + p, + true); + } + void Cleanup(ParamType& p) { CleanupParsedWdiTaskConnect(&p); } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType& par) + { + return c.DevCtx->wifiHAL->WifiIhvConnect(par, c.Header); + }); + } + bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } +}; + +// -------- WDI_TASK_DISCONNECT -------- +template<> +struct TransitionTraits +{ + struct ParamType {}; + enum : UINT16 { CompleteIndication = WDI_INDICATION_DISCONNECT_COMPLETE }; + + NTSTATUS Parse(TransitionContext&, ParamType&) { return STATUS_SUCCESS; } + void Cleanup(ParamType&) {} + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // STEPM3 + [](TransitionContext&, ParamType&, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return STATUS_SUCCESS; + }, + // STEPM4 + [](TransitionContext& c, ParamType&) + { + c.DevCtx->wifiHAL->WifiIhvPerformDisassociation(c.Header, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); + return STATUS_SUCCESS; + }); + } + bool ShouldSendComplete(NTSTATUS) const { return true; } +}; + +// -------- WDI_SET_SAE_AUTH_PARAMS -------- +template<> +struct TransitionTraits +{ + using ParamType = WDI_SET_SAE_AUTH_PARAMS_COMMAND; + enum : UINT16 { CompleteIndication = 0 }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + return ParseTlvCommon(ctx, + WDI_SET_SAE_AUTH_PARAMS, + [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) + { + return ParseWdiSetSaeAuthParams(len, bytes, tlvCtx, out); + }, + p, + /*dumpStream*/ false); + } + + void Cleanup(ParamType& p) + { + CleanupParsedWdiSetSaeAuthParams(&p); + } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, + // Step M3: invoke HAL handler, report bytes written (just header) + [](TransitionContext& c, ParamType& par, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + return c.DevCtx->wifiHAL->WifiIhvSetSaeAuthParams(par, c.Header); + }, + // Step M4: no-op (no completion indication for this OID) + [](TransitionContext&, ParamType&) { return STATUS_SUCCESS; }); + } + + bool ShouldSendComplete(NTSTATUS) const + { + // Do not send M4 indication for WDI_SET_SAE_AUTH_PARAMS (original code omitted it). + return false; + } +}; + +// -------- Generic runner (compile-time) -------- +template +NTSTATUS RunTransition(TransitionContext& ctx) +{ + TransitionTraits traits; + typename TransitionTraits::ParamType params{}; + NTSTATUS parseStatus = traits.Parse(ctx, params); + if (!NT_SUCCESS(parseStatus)) + { + traits.Cleanup(params); + // Report Failed M3 to OS + // Note: No M4 indication on parse failure + WifiIhvNotifyM3Completion(ctx.WifiRequest, parseStatus, 0); + return parseStatus; + } + + NTSTATUS m4Status = traits.Handle(ctx, params); + + if (traits.ShouldSendComplete(m4Status)) + { + WifiIhvSendM4IndicationToOs( + ctx.Device, + TransitionTraits::CompleteIndication, + ctx.Header, + m4Status); + } + + traits.Cleanup(params); + return m4Status; +} + + // Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) { diff --git a/network/wlan/WIFICX/drivercode/wifitransition.h b/network/wlan/WIFICX/drivercode/wifitransition.h index d57e73cb..74d8dff6 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.h +++ b/network/wlan/WIFICX/drivercode/wifitransition.h @@ -15,318 +15,5 @@ struct TransitionContext UINT OutLen; }; -// Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. -template -NTSTATUS ParseTlvCommon(TransitionContext& ctx, - UINT16 messageId, - ParserFn parser, - Param& outParams, - bool dumpStream = true) -{ - if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) - { - return STATUS_INVALID_PARAMETER; - } - - auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); - auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); - - if (dumpStream) - { - DumpMessageTlvByteStream( - messageId, - TRUE, - ctx.DevCtx->TlvContext.PeerVersion, - tlvLen, - tlvBytes, - 0, - nullptr); - } - - auto ndisStatus = parser(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &outParams); - return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); -} - -// Execute two step callables. -// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) -// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) -// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. -// Skips StepM4 if StepM3 failed -template -NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) -{ - UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum - NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); - // Report the M3 status back to OS - // OS expects M3 before the M4 - WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); - if (!NT_SUCCESS(m3Status)) - { - return m3Status; - } - return stepM4(ctx, p); -} -// Primary traits template (specialize per MessageId) -template -struct TransitionTraits; - -// -------- WDI_TASK_SET_RADIO_STATE -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_SET_RADIO_STATE_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_SET_RADIO_STATE_COMPLETE }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_SET_RADIO_STATE, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskSetRadioState(len, bytes, tlvCtx, out); - }, - p, - true); - } - void Cleanup(ParamType& p) { CleanupParsedWdiTaskSetRadioState(&p); } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); - } - ); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; - -// -------- WDI_TASK_SCAN -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_SCAN_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_SCAN_COMPLETE }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_SCAN, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskScan(len, bytes, tlvCtx, out); - }, - p, - true); - } - void Cleanup(ParamType& p){ CleanupParsedWdiTaskScan(&p); } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvScan(par, c.Header); - } - ); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; - -// -------- WDI_TASK_DOT11_RESET -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_TASK_DOT11_RESET_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_DOT11_RESET_COMPLETE }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_DOT11_RESET, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskDot11Reset(len, bytes, tlvCtx, out); - }, - p, - false); - } - void Cleanup(ParamType& p){ CleanupParsedWdiTaskDot11Reset(&p); } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvReset(par, c.Header); - }); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; - -// -------- WDI_TASK_CONNECT -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_TASK_CONNECT_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_CONNECT_COMPLETE }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_CONNECT, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskConnect(len, bytes, tlvCtx, out); - }, - p, - true); - } - void Cleanup(ParamType& p){ CleanupParsedWdiTaskConnect(&p); } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvConnect(par, c.Header); - }); - } - bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } -}; - -// -------- WDI_TASK_DISCONNECT -------- -template<> -struct TransitionTraits -{ - struct ParamType {}; - enum : UINT16 { CompleteIndication = WDI_INDICATION_DISCONNECT_COMPLETE }; - - NTSTATUS Parse(TransitionContext&, ParamType&){ return STATUS_SUCCESS; } - void Cleanup(ParamType&){} - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType&) - { - c.DevCtx->wifiHAL->WifiIhvPerformDisassociation(c.Header, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); - return STATUS_SUCCESS; - }); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; - -// -------- WDI_SET_SAE_AUTH_PARAMS -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_SET_SAE_AUTH_PARAMS_COMMAND; - enum : UINT16 { CompleteIndication = 0 }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_SET_SAE_AUTH_PARAMS, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiSetSaeAuthParams(len, bytes, tlvCtx, out); - }, - p, - /*dumpStream*/ false); - } - - void Cleanup(ParamType& p) - { - CleanupParsedWdiSetSaeAuthParams(&p); - } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // Step M3: invoke HAL handler, report bytes written (just header) - [](TransitionContext& c, ParamType& par, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return c.DevCtx->wifiHAL->WifiIhvSetSaeAuthParams(par, c.Header); - }, - // Step M4: no-op (no completion indication for this OID) - [](TransitionContext&, ParamType&) { return STATUS_SUCCESS; }); - } - - bool ShouldSendComplete(NTSTATUS) const - { - // Do not send M4 indication for WDI_SET_SAE_AUTH_PARAMS (original code omitted it). - return false; - } -}; - -// -------- Generic runner (compile-time) -------- -template -NTSTATUS RunTransition(TransitionContext& ctx) -{ - TransitionTraits traits; - typename TransitionTraits::ParamType params{}; - NTSTATUS parseStatus = traits.Parse(ctx, params); - if (!NT_SUCCESS(parseStatus)) - { - traits.Cleanup(params); - // Report Failed M3 to OS - // Note: No M4 indication on parse failure - WifiIhvNotifyM3Completion(ctx.WifiRequest, parseStatus, 0); - return parseStatus; - } - - NTSTATUS m4Status = traits.Handle(ctx, params); - - if (traits.ShouldSendComplete(m4Status)) - { - WifiIhvSendM4IndicationToOs( - ctx.Device, - TransitionTraits::CompleteIndication, - ctx.Header, - m4Status); - } - - traits.Cleanup(params); - return m4Status; -} - // -------- Runtime dispatcher (decl) -------- NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId); \ No newline at end of file -- cgit v1.3.1 From c9aa1b84b884282ea161c528cb00d1417c0cdb50 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Fri, 14 Nov 2025 14:48:31 -0800 Subject: have the M3 amd M4 general types --- network/wlan/WIFICX/drivercode/wifihal.cpp | 55 ++- network/wlan/WIFICX/drivercode/wifihal.h | 30 +- network/wlan/WIFICX/drivercode/wifitransition.cpp | 425 +++++++++++----------- 3 files changed, 268 insertions(+), 242 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index edeb8fe0..bbfa04e0 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -6,6 +6,24 @@ #include "WifiHal.h" #include "WifiHal.tmh" +WifiHAL::WifiHAL(WDFDEVICE Device) +{ + m_Device = Device; + m_TlvContext = &WifiGetIhvDeviceContext(Device)->TlvContext; +} + +NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() +{ + return ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) + && (WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter != WDF_NO_HANDLE) // In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized + && (m_CurrentRadioState == TRUE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY); // Device is ready only if radio is ON (this may be replaced by other state in IHV implementation) +} + +NTSTATUS WifiHAL::WifiIhvGetPendingTransitionStatus() +{ + return m_LastConnectTransactionId ==0 ? STATUS_SUCCESS : STATUS_PENDING; +} + NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() { WIFI_DEVICE_CAPABILITIES deviceCaps = {}; @@ -432,7 +450,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() return STATUS_SUCCESS; } -NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER) +NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER, UINT) { if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) { @@ -458,7 +476,7 @@ NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParam } _Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader) +NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { if (RadioState.SoftwareRadioState != m_CurrentRadioState) { @@ -483,7 +501,7 @@ NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& Rad } _Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvScan(WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader) +NTSTATUS WifiHAL::WifiIhvScan(const WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) { @@ -530,7 +548,7 @@ NTSTATUS WifiHAL::WifiIhvScan(WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_ME return STATUS_SUCCESS; } -NTSTATUS WifiHAL::WifiIhvConnect(WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader) +NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { NT_ASSERT(m_LastConnectEntryId == 0); if (m_LastConnectEntryId != 0) // Not Disconnected State @@ -550,7 +568,11 @@ NTSTATUS WifiHAL::WifiIhvConnect(WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, // if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) { - return STATUS_PENDING; + m_LastConnectTransactionId = pWdiHeader->TransactionId; + } + else + { + m_LastConnectTransactionId = 0; } return STATUS_SUCCESS; } @@ -618,9 +640,9 @@ NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHe _Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvPerformAssociation( - struct ArrayOfElements* pPreferredBSSEntryList, - struct ArrayOfElements* pAuthenticationAlgorithms, - PWDI_MESSAGE_HEADER pWdiHeader) + const struct ArrayOfElements* pPreferredBSSEntryList, + const struct ArrayOfElements* pAuthenticationAlgorithms, + const PWDI_MESSAGE_HEADER pWdiHeader) { ULONG bssIndex = 0; @@ -740,7 +762,7 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( return ntStatus; } -NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader) +NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { //Since this is DIRECT OID, need to check the m_LastConnectTransactionId match if (pWdiHeader->TransactionId != m_LastConnectTransactionId) @@ -837,8 +859,9 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(pWdiHeader, 1), "Failed WifiIhvSendLinkStateIndication"); - WifiIhvSendM4IndicationToOs( - m_Device, WDI_INDICATION_CONNECT_COMPLETE, pWdiHeader, STATUS_SUCCESS); + // Complete the transaction to let the M4 hanlder WifiIhvGetPendingTransitionStatus know that association is complete + m_LastConnectTransactionId = 0; + #ifdef WIFI_IHV_HANDSHAKE // // Receive M1 frame of 4-way handshake @@ -850,6 +873,7 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& // RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); #endif + return STATUS_SUCCESS; } RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); @@ -871,7 +895,7 @@ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& } _Use_decl_annotations_ -void WifiHAL::WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus) +NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { UCHAR s_TLV_Disassociation[] = { @@ -888,6 +912,7 @@ void WifiHAL::WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, 0x00 }; + WDI_ASSOC_STATUS DisassocStatus = WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST; RtlCopyMemory(&s_TLV_Disassociation[4], &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); @@ -900,10 +925,6 @@ void WifiHAL::WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, #ifdef WIFI_IHV_NETV DeleteDatapathPeer(0x33); #endif -} -WifiHAL::WifiHAL(WDFDEVICE Device) -{ - m_Device = Device; - m_TlvContext = &WifiGetIhvDeviceContext(Device)->TlvContext; + return STATUS_SUCCESS; } diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h index d2d770d9..844a9ccb 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.h +++ b/network/wlan/WIFICX/drivercode/wifihal.h @@ -6,17 +6,25 @@ class WifiHAL { public: WifiHAL(_In_ WDFDEVICE Device); + + // Wifi request M3 working condition verification function + NTSTATUS WifiIhvIsDeviceReadyForRequest(); + + // Wifi request pending transition status check function + // for example, during SAE authentication, the connect request is pending until SAE exchange is complete + NTSTATUS WifiIhvGetPendingTransitionStatus(); + NTSTATUS WifiIhvSetDeviceCapabilities(); - NTSTATUS WifiIhvReset(_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvSetRadioState(_In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvScan(_In_ WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvConnect(_In_ WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvPerformAssociation(_In_ struct ArrayOfElements* pPreferredBSSEntryList, _In_ struct ArrayOfElements* pAuthenticationAlgorithms, _In_ PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - void WifiIhvPerformDisassociation(_In_ PWDI_MESSAGE_HEADER pWdiHeader, _In_ WDI_ASSOC_STATUS DisassocStatus); + NTSTATUS WifiIhvReset(_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvSetRadioState(_In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvScan(_In_ const WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvConnect(_In_ const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvDisconnect(_In_ const WDI_TASK_DISCONNECT_PARAMETERS& disconnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); private: - NTSTATUS WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); - + NTSTATUS WifiIhvPerformAssociation(_In_ const struct ArrayOfElements* pPreferredBSSEntryList, _In_ const struct ArrayOfElements* pAuthenticationAlgorithms, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvSendLinkStateIndication(_In_ const PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); + WDFDEVICE m_Device{}; PCTLV_CONTEXT m_TlvContext{}; @@ -27,8 +35,8 @@ private: DOT11_MAC_ADDRESS m_ConnectedPeer{}; const WDI_MAC_ADDRESS m_LocalLinkAddresses[2] = { - {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, - {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, }; const ULONG m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp index 9ac857bc..eccf9dc3 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.cpp +++ b/network/wlan/WIFICX/drivercode/wifitransition.cpp @@ -32,255 +32,132 @@ NTSTATUS ParseTlvCommon(TransitionContext& ctx, return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); } -// Execute two step callables. -// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) -// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) -// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. -// Skips StepM4 if StepM3 failed -template -NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) -{ - UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum - NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); - // Report the M3 status back to OS - // OS expects M3 before the M4 - WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); - if (!NT_SUCCESS(m3Status)) - { - return m3Status; - } - return stepM4(ctx, p); -} + // Primary traits template (specialize per MessageId) template struct TransitionTraits; -// -------- WDI_TASK_SET_RADIO_STATE -------- -template<> -struct TransitionTraits +// --- Generic pure-type traits template (add before existing specializations) --- +// WIFIREQUEST always needs M3 notification, so TPreM3Fn is mandatory. +// and WIFICX expectes the M3 then M4 order, so we always execute M3 then M4. +// using template parameters to configure parsing, cleanup, M3/M4 steps. +// to make sure that all transitions have consistent implementations. +template< + UINT16 TMsgId, + typename TParam, + UINT16 TCompleteIndication, + bool TDumpTlvStream, + NDIS_STATUS (*TParseFn)(ULONG, const UINT8*, PCTLV_CONTEXT, TParam*), + void (*TCleanupFn)(TParam*), + NTSTATUS (WifiHAL::*TPreM3Fn)(), // mandatory pre-M3 hook + NTSTATUS (WifiHAL::*THalM3Fn)(const TParam&, const PWDI_MESSAGE_HEADER, UINT BytesWriten), // optional HAL M3 (may be nullptr) + NTSTATUS (WifiHAL::*TPreM4Fn)(), // optional pre-M4 hook (may be nullptr) + NTSTATUS (WifiHAL::*THalM4Fn)(const PWDI_MESSAGE_HEADER) // optional HAL M4 (may be nullptr) +> +struct GenericTransitionTraits { - using ParamType = WDI_SET_RADIO_STATE_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_SET_RADIO_STATE_COMPLETE }; + using ParamType = TParam; + enum : UINT16 { CompleteIndication = TCompleteIndication }; NTSTATUS Parse(TransitionContext& ctx, ParamType& p) { - return ParseTlvCommon(ctx, - WDI_TASK_SET_RADIO_STATE, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskSetRadioState(len, bytes, tlvCtx, out); - }, - p, - true); - } - void Cleanup(ParamType& p) { CleanupParsedWdiTaskSetRadioState(&p); } + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); - } - ); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); -// -------- WDI_TASK_SCAN -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_SCAN_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_SCAN_COMPLETE }; + if (TDumpTlvStream) + { + DumpMessageTlvByteStream( + TMsgId, + TRUE, + ctx.DevCtx->TlvContext.PeerVersion, + tlvLen, + tlvBytes, + 0, + nullptr); + } - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_SCAN, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskScan(len, bytes, tlvCtx, out); - }, - p, - true); + auto ndisStatus = TParseFn(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &p); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); } - void Cleanup(ParamType& p) { CleanupParsedWdiTaskScan(&p); } - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + void Cleanup(ParamType& p) { TCleanupFn(&p); } + + // Make static so pointer matches ExecuteSteps expected callable type (no implicit this) + static NTSTATUS StepM3(TransitionContext& c, ParamType& p, UINT& bytesWritten) { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + ASSERT(TPreM3Fn); + + if (TPreM3Fn) + { + // Call member function pointer on WifiHAL instance + NTSTATUS preStatus = (c.DevCtx->wifiHAL->*TPreM3Fn)(); + if (!NT_SUCCESS(preStatus)) { - return c.DevCtx->wifiHAL->WifiIhvScan(par, c.Header); + return preStatus; } - ); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; + } -// -------- WDI_TASK_DOT11_RESET -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_TASK_DOT11_RESET_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_DOT11_RESET_COMPLETE }; + if (THalM3Fn) + { + // Pass required third argument (BytesWriten) to HAL M3 function + return (c.DevCtx->wifiHAL->*THalM3Fn)(p, c.Header, bytesWritten); + } - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_DOT11_RESET, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskDot11Reset(len, bytes, tlvCtx, out); - }, - p, - false); + return STATUS_SUCCESS; } - void Cleanup(ParamType& p) { CleanupParsedWdiTaskDot11Reset(&p); } - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + static NTSTATUS StepM4(TransitionContext& c, ParamType&) { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) + if (TPreM4Fn) + { + NTSTATUS preStatus = (c.DevCtx->wifiHAL->*TPreM4Fn)(); + if (!NT_SUCCESS(preStatus)) { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvReset(par, c.Header); - }); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } -}; + return preStatus; + } + } -// -------- WDI_TASK_CONNECT -------- -template<> -struct TransitionTraits -{ - using ParamType = WDI_TASK_CONNECT_PARAMETERS; - enum : UINT16 { CompleteIndication = WDI_INDICATION_CONNECT_COMPLETE }; + if (THalM4Fn) + { + return (c.DevCtx->wifiHAL->*THalM4Fn)(c.Header); + } - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_TASK_CONNECT, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiTaskConnect(len, bytes, tlvCtx, out); - }, - p, - true); + return (TPreM4Fn == nullptr && THalM4Fn == nullptr) ? STATUS_PENDING : STATUS_SUCCESS; } - void Cleanup(ParamType& p) { CleanupParsedWdiTaskConnect(&p); } NTSTATUS Handle(TransitionContext& ctx, ParamType& p) { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType& par) - { - return c.DevCtx->wifiHAL->WifiIhvConnect(par, c.Header); - }); + return ExecuteSteps(ctx, p, &GenericTransitionTraits::StepM3, &GenericTransitionTraits::StepM4); } - bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } -}; - -// -------- WDI_TASK_DISCONNECT -------- -template<> -struct TransitionTraits -{ - struct ParamType {}; - enum : UINT16 { CompleteIndication = WDI_INDICATION_DISCONNECT_COMPLETE }; - NTSTATUS Parse(TransitionContext&, ParamType&) { return STATUS_SUCCESS; } - void Cleanup(ParamType&) {} - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // STEPM3 - [](TransitionContext&, ParamType&, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return STATUS_SUCCESS; - }, - // STEPM4 - [](TransitionContext& c, ParamType&) - { - c.DevCtx->wifiHAL->WifiIhvPerformDisassociation(c.Header, WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST); - return STATUS_SUCCESS; - }); - } - bool ShouldSendComplete(NTSTATUS) const { return true; } + bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } }; -// -------- WDI_SET_SAE_AUTH_PARAMS -------- -template<> -struct TransitionTraits +// Execute two step callables. +// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) +// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) +// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. +// Skips StepM4 if StepM3 failed +template +NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) { - using ParamType = WDI_SET_SAE_AUTH_PARAMS_COMMAND; - enum : UINT16 { CompleteIndication = 0 }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - return ParseTlvCommon(ctx, - WDI_SET_SAE_AUTH_PARAMS, - [](ULONG len, UINT8* bytes, PCTLV_CONTEXT tlvCtx, ParamType* out) - { - return ParseWdiSetSaeAuthParams(len, bytes, tlvCtx, out); - }, - p, - /*dumpStream*/ false); - } - - void Cleanup(ParamType& p) - { - CleanupParsedWdiSetSaeAuthParams(&p); - } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, - // Step M3: invoke HAL handler, report bytes written (just header) - [](TransitionContext& c, ParamType& par, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - return c.DevCtx->wifiHAL->WifiIhvSetSaeAuthParams(par, c.Header); - }, - // Step M4: no-op (no completion indication for this OID) - [](TransitionContext&, ParamType&) { return STATUS_SUCCESS; }); - } - - bool ShouldSendComplete(NTSTATUS) const + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum + NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); + if (!NT_SUCCESS(m3Status)) { - // Do not send M4 indication for WDI_SET_SAE_AUTH_PARAMS (original code omitted it). - return false; + return m3Status; } -}; + return stepM4(ctx, p); +} // -------- Generic runner (compile-time) -------- template @@ -313,6 +190,126 @@ NTSTATUS RunTransition(TransitionContext& ctx) return m4Status; } +//// -------- SCENARIO: [Connect with a SAE WI-FI7 network -------- +/// Demo: Handle WDI_TASK_CONNECT + WDI_SET_SAE_AUTH_PARAMS then WDI_TASK_DISCONNECT +/// Scope: +/// -WifiRequest WDI_TASK_CONNECT & WDI_TASK_DISCONNECT are both WIFICX task commands, which is a two step M3/M4 transition +/// -The direct WifiRequest WDI_SET_SAE_AUTH_PARAMS, which is a single step transition but +/// is logically part of the connect scenario. since WDI_SET_SAE_AUTH_PARAMS is WIFICX property command, +/// it only has M3 step, no M4 step. +/// - The WifiCx unsolicited indication e.g. WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED is sent from the HAL during the connect process, +/// Notes: +/// - M3 and M4 status mainly used for WifiCx to track progress of the transition. e.g. the hung detection and trigger recovery. +/// - The actual scenario result is reported through unsolicited indication. +/// + +// -------- WDI_TASK_CONNECT -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_CONNECT, + WDI_TASK_CONNECT_PARAMETERS, + WDI_INDICATION_CONNECT_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskConnect, + CleanupParsedWdiTaskConnect, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvConnect, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr + > +{ +}; + +// --- WDI_SET_SAE_AUTH_PARAMS --- +template<> +struct TransitionTraits + : GenericTransitionTraits< + WDI_SET_SAE_AUTH_PARAMS, + WDI_SET_SAE_AUTH_PARAMS_COMMAND, + WDI_INDICATION_CONNECT_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiSetSaeAuthParams, + CleanupParsedWdiSetSaeAuthParams, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvSetSaeAuthParams, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr// HAL M4 + > +{}; + +// -------- WDI_TASK_DISCONNECT -------- +template<> +struct TransitionTraits + : GenericTransitionTraits< + WDI_TASK_DISCONNECT, + WDI_TASK_DISCONNECT_PARAMETERS, + WDI_INDICATION_DISCONNECT_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiTaskDisconnect, + CleanupParsedWdiTaskDisconnect, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvDisconnect, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; +/// ----- End of scenario [Connect with a SAE WI-FI7 network]----- + +// -------- WDI_TASK_DOT11_RESET -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_DOT11_RESET, + WDI_TASK_DOT11_RESET_PARAMETERS, + WDI_INDICATION_DOT11_RESET_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiTaskDot11Reset, + CleanupParsedWdiTaskDot11Reset, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvReset, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; + +// -------- WDI_TASK_SCAN -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_SCAN, + WDI_SCAN_PARAMETERS, + WDI_INDICATION_SCAN_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskScan, + CleanupParsedWdiTaskScan, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvScan, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; + +// -------- WDI_TASK_SET_RADIO_STATE -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_SET_RADIO_STATE, + WDI_SET_RADIO_STATE_PARAMETERS, + WDI_INDICATION_SET_RADIO_STATE_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskSetRadioState, + CleanupParsedWdiTaskSetRadioState, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvSetRadioState, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; // Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) -- cgit v1.3.1 From 90a7fc175216f84a11cda994958cd1634341783f Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Sun, 16 Nov 2025 12:38:39 -0800 Subject: have the wifiHAL living with the wdfdevice addtional context memory --- network/wlan/WIFICX/drivercode/adapter.cpp | 18 ++++++- network/wlan/WIFICX/drivercode/adapter.h | 13 +---- network/wlan/WIFICX/drivercode/device.cpp | 77 +++++++--------------------- network/wlan/WIFICX/drivercode/device.h | 3 -- network/wlan/WIFICX/drivercode/driver.cpp | 2 +- network/wlan/WIFICX/drivercode/wifihal.cpp | 31 +++++++++-- network/wlan/WIFICX/drivercode/wifihal.h | 32 +++++++++--- network/wlan/WIFICX/drivercode/wifirequest.h | 3 -- 8 files changed, 91 insertions(+), 88 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp index e0ea86e6..f532ae02 100644 --- a/network/wlan/WIFICX/drivercode/adapter.cpp +++ b/network/wlan/WIFICX/drivercode/adapter.cpp @@ -7,7 +7,23 @@ #include "adapter.tmh" _Use_decl_annotations_ -NTSTATUS WifiCxTestAdapterStart(NETADAPTER netAdapter) +NTSTATUS WifiIhvInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter) +{ + PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); + PWIFI_IHV_NETADAPTER_CONTEXT netAdapterContext = WifiGetIhvNetAdapterContext(NetAdapter); + + if (deviceContext->primaryStaAdapter == WDF_NO_HANDLE) + { + deviceContext->primaryStaAdapter = NetAdapter; + } + + netAdapterContext->WifiDeviceContext = deviceContext; + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiIhvAdapterStart(NETADAPTER netAdapter) { TraceEntry(); diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h index 65e7e023..eb39dee1 100644 --- a/network/wlan/WIFICX/drivercode/adapter.h +++ b/network/wlan/WIFICX/drivercode/adapter.h @@ -9,17 +9,8 @@ // maximum link speed for send and recv in bps #define WIFI_MEDIA_MAX_SPEED 1'000'000'000 -// -// NetAdapter functions -// - -EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue; -EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; - -EVT_WDF_DEVICE_CONTEXT_DESTROY MbbDestroyAdapterContext; - -NTSTATUS WifiCxTestAdapterStart(_In_ NETADAPTER netAdapter); - +NTSTATUS WifiIhvInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter); +NTSTATUS WifiIhvAdapterStart(_In_ NETADAPTER netAdapter); // Context for each "Wdi Port"[NetAdapter] instance. // Each NetAdapter instance corresponds to an IP interface diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index a0614807..9ea10fd1 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -11,25 +11,18 @@ NTSTATUS EvtDevicePrepareHardware(WDFDEVICE device, WDFCMRESLIST resourcesRaw, W { UNREFERENCED_PARAMETER(resourcesRaw); UNREFERENCED_PARAMETER(resourcesTranslated); - UNREFERENCED_PARAMETER(device); - NTSTATUS status = STATUS_SUCCESS; - //status = WifiCxTestSetDeviceCapabilities(device); - - if (!NT_SUCCESS(status)) - { - WFCError("%!FUNC!: WifiCxTestSetDeviceCapabilities failed with %!STATUS!", status); - return status; - } + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiHAL::_Create(device), + "WifiHAL::_Create failed"); WFCInfo("Device=0x%p", device); - return status; + return STATUS_SUCCESS; } _Use_decl_annotations_ NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTranslated) { - UNREFERENCED_PARAMETER(device); UNREFERENCED_PARAMETER(resourcesTranslated); WFCInfo("Device=0x%p", device); @@ -40,24 +33,9 @@ NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTransl _Use_decl_annotations_ void EvtDeviceSurpriseRemoval(WDFDEVICE device) { - UNREFERENCED_PARAMETER(device); WFCInfo("Device=0x%p is surprise removed", device); } -static NTSTATUS WifiInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter) -{ - PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); - PWIFI_IHV_NETADAPTER_CONTEXT netAdapterContext = WifiGetIhvNetAdapterContext(NetAdapter); - NTSTATUS status = STATUS_SUCCESS; - if (deviceContext->primaryStaAdapter == WDF_NO_HANDLE) - { - deviceContext->primaryStaAdapter = NetAdapter; - } - - netAdapterContext->WifiDeviceContext = deviceContext; - - return status; -} _Use_decl_annotations_ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) @@ -73,39 +51,20 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WIFI_IHV_NETADAPTER_CONTEXT); adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; - NETADAPTER netAdapter; - NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: NetAdapterCreate failed, status=0x%x", ntStatus); - return ntStatus; - } - - ntStatus = WifiAdapterInitialize(netAdapter); - ASSERT(NT_SUCCESS(ntStatus)); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiAdapterInitialize failed with %!STATUS!", ntStatus); - return ntStatus; - } - - ntStatus = WifiInitAdapterContext(Device, netAdapter); - ASSERT(NT_SUCCESS(ntStatus)); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiInitAdapterContext failed with %!STATUS!", ntStatus); - return ntStatus; - } - - ntStatus = WifiCxTestAdapterStart(netAdapter); - ASSERT(NT_SUCCESS(ntStatus)); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiCxTestAdapterStart failed with %!STATUS!", ntStatus); - return ntStatus; - } - - return ntStatus; + NETADAPTER netAdapter{}; + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter), "Failed to create NetAdapter"); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiAdapterInitialize(netAdapter), "Failed to initialize WifiAdapter"); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiIhvInitAdapterContext(Device, netAdapter), "Failed to initialize WifiAdapterContext"); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiIhvAdapterStart(netAdapter), "Failed to start WifiIhvAdapter"); + + return STATUS_SUCCESS; } _Use_decl_annotations_ diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h index 57de18f3..8c00515e 100644 --- a/network/wlan/WIFICX/drivercode/device.h +++ b/network/wlan/WIFICX/drivercode/device.h @@ -18,10 +18,7 @@ typedef struct _WIFI_IHV_DEVICE_CONTEXT // void* WdfTriageInfoPtr; WDFDEVICE WdfDevice; - WDI_GET_ADAPTER_CAPABILITIES_PARAMETERS AdapterCapabilities; TLV_CONTEXT TlvContext; - UINT32 LastConnectTransactionId; - WDI_AUTH_ALGORITHM LastAuthAlgo; NETADAPTER primaryStaAdapter; WifiHAL* wifiHAL; } WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp index 562769ef..f25cc7b5 100644 --- a/network/wlan/WIFICX/drivercode/driver.cpp +++ b/network/wlan/WIFICX/drivercode/driver.cpp @@ -65,7 +65,7 @@ Return Value: return status; } - //TraceExit(status); + TraceExit(status); return status; } diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index bbfa04e0..4619e87c 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -6,10 +6,35 @@ #include "WifiHal.h" #include "WifiHal.tmh" -WifiHAL::WifiHAL(WDFDEVICE Device) +_Use_decl_annotations_ +NTSTATUS WifiHAL::_Create(WDFDEVICE Device) +{ + // Download firmware, initialize hardware, etc. + + // Create WifiHAL object and associate it with Device context after FW ready + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WifiHAL); + attributes.EvtCleanupCallback = WifiHAL::_OnCleanup; + attributes.ParentObject = Device; + + void* memory = nullptr; + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WdfObjectAllocateContext(Device, &attributes, &memory), "Failed to allocate WifiHAL context. Device=%p", Device); + + // Obtain the context and initialize it + auto* wifiHal = reinterpret_cast(memory); + wifiHal->Initialize(Device, &WifiGetIhvDeviceContext(Device)->TlvContext); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + wifiHal->WifiIhvSetDeviceCapabilities(), + "Failed to set device capabilities. Device=%p", Device); + + return STATUS_SUCCESS; +} + +void WifiHAL::_OnCleanup(WDFOBJECT Object) { - m_Device = Device; - m_TlvContext = &WifiGetIhvDeviceContext(Device)->TlvContext; + UNREFERENCED_PARAMETER(Object); } NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h index 844a9ccb..75c7d94d 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.h +++ b/network/wlan/WIFICX/drivercode/wifihal.h @@ -5,7 +5,27 @@ class WifiHAL { public: - WifiHAL(_In_ WDFDEVICE Device); + static NTSTATUS _Create(_In_ WDFDEVICE Device); + static void _OnCleanup(_In_ WDFOBJECT Object); + + // Default ctor so context memory can be zeroed by WDF without placement new + WifiHAL() = default; + + // Initialization routine replacing the previous parameterized ctor usage + void Initialize(_In_ WDFDEVICE Device, _In_ PCTLV_CONTEXT TlvContext) + { + m_Device = Device; + m_TlvContext = TlvContext; + m_CurrentRadioState = 0; + m_LastConnectEntryId = 0; + m_LastConnectTransactionId = 0; + m_LastAuthAlgo = WDI_AUTH_ALGO_UNKNOWN; + RtlZeroMemory(&m_ConnectedPeer, sizeof(m_ConnectedPeer)); + // Initialize link addresses and supported bands (previously in-class const init) + m_LocalLinkAddresses[0] = {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}; + m_LocalLinkAddresses[1] = {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}; + m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); + } // Wifi request M3 working condition verification function NTSTATUS WifiIhvIsDeviceReadyForRequest(); @@ -34,10 +54,8 @@ private: WDI_AUTH_ALGORITHM m_LastAuthAlgo{}; DOT11_MAC_ADDRESS m_ConnectedPeer{}; - const WDI_MAC_ADDRESS m_LocalLinkAddresses[2] = { - {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, - {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, - }; - - const ULONG m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); + // Removed const so we can initialize without running a constructor via placement new + WDI_MAC_ADDRESS m_LocalLinkAddresses[2]; + ULONG m_SupportedBands; }; +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiHAL, GetWifiHalFromHandle); diff --git a/network/wlan/WIFICX/drivercode/wifirequest.h b/network/wlan/WIFICX/drivercode/wifirequest.h index c3317eb3..74380548 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.h +++ b/network/wlan/WIFICX/drivercode/wifirequest.h @@ -4,9 +4,6 @@ EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; -static NTSTATUS ProcessWifiRequest( - _In_ WDFDEVICE Device, _In_ UINT16 MessageId, _In_ void* Buffer, _In_ UINT InBufferLen, _In_ UINT OutBufferLen, _In_ UINT* pBytesWritten); - void WifiIhvSendUnsolicitedIndicationToOs( _In_ WDFDEVICE Device, _In_ PWDI_MESSAGE_HEADER pWdiHeader, -- cgit v1.3.1 From 25de639a793266bde0116816b86f8ada28808186 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 18 Nov 2025 18:21:05 -0800 Subject: add the INF file for UM and KM, make the static analysis issue free --- network/wlan/WIFICX/drivercode/device.cpp | 16 +++---- network/wlan/WIFICX/drivercode/driver.cpp | 2 +- network/wlan/WIFICX/drivercode/driver.h | 5 +++ network/wlan/WIFICX/drivercode/wifihal.cpp | 7 +++- network/wlan/WIFICX/drivercode/wifirequest.cpp | 11 ++--- network/wlan/WIFICX/km/wificxsampleclientkm.inf | 46 ++++++++++++++++----- .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 24 +++++++++-- network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 3340 -> 6802 bytes 8 files changed, 81 insertions(+), 30 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index 9ea10fd1..0fc17ea4 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -30,13 +30,6 @@ NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTransl return STATUS_SUCCESS; } -_Use_decl_annotations_ -void EvtDeviceSurpriseRemoval(WDFDEVICE device) -{ - WFCInfo("Device=0x%p is surprise removed", device); -} - - _Use_decl_annotations_ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) { @@ -67,6 +60,15 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn return STATUS_SUCCESS; } +_Use_decl_annotations_ +NTSTATUS EvtWifiDeviceCreateWifiDirectDevice(WDFDEVICE, WIFIDIRECT_DEVICE_INIT*) +{ + NTSTATUS status = STATUS_SUCCESS; + TraceEntry(); + TraceExit(status); + return status; +} + _Use_decl_annotations_ void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) { diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp index f25cc7b5..974d87fb 100644 --- a/network/wlan/WIFICX/drivercode/driver.cpp +++ b/network/wlan/WIFICX/drivercode/driver.cpp @@ -156,7 +156,7 @@ Return Value: WDI_VERSION_LATEST, // The "WDI" version supported by this Ihv driver EvtWifiDeviceSendCommand, // The Wdi command and task, now called "wifirequest". EvtWifiDeviceCreateAdapter, // The Wdi "ports", now support by the netadapter instances. - nullptr); // [Scope: No WiFi Direct support in this sample] + EvtWifiDeviceCreateWifiDirectDevice); // [Scope: No WiFi Direct support in this sample] // Initialize the WifiCx device with the configuration above to let OS side ready. status = WifiDeviceInitialize(wdfIhvDevice, &wifiDeviceConfig); diff --git a/network/wlan/WIFICX/drivercode/driver.h b/network/wlan/WIFICX/drivercode/driver.h index 12820f1c..8d4f12b7 100644 --- a/network/wlan/WIFICX/drivercode/driver.h +++ b/network/wlan/WIFICX/drivercode/driver.h @@ -2,5 +2,10 @@ #pragma once #include "precomp.h" +extern "C" +{ + DRIVER_INITIALIZE DriverEntry; +} + EVT_WDF_DRIVER_DEVICE_ADD EvtWifiDriverDeviceAdd; EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 4619e87c..4a73d386 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -15,7 +15,6 @@ NTSTATUS WifiHAL::_Create(WDFDEVICE Device) WDF_OBJECT_ATTRIBUTES attributes; WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WifiHAL); attributes.EvtCleanupCallback = WifiHAL::_OnCleanup; - attributes.ParentObject = Device; void* memory = nullptr; WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( @@ -32,6 +31,7 @@ NTSTATUS WifiHAL::_Create(WDFDEVICE Device) return STATUS_SUCCESS; } +_Use_decl_annotations_ void WifiHAL::_OnCleanup(WDFOBJECT Object) { UNREFERENCED_PARAMETER(Object); @@ -56,7 +56,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() deviceCaps.HardwareRadioState = TRUE; deviceCaps.SoftwareRadioState = TRUE; - deviceCaps.FirmwareVersion[MAX_FIRMWARE_VERSION_LENGTH]; + RtlCopyMemory(deviceCaps.FirmwareVersion, "1.0.0", sizeof("1.0.0")); deviceCaps.ActionFramesSupported = TRUE; deviceCaps.NumRxStreams = 1; deviceCaps.NumTxStreams = 1; @@ -475,6 +475,7 @@ NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() return STATUS_SUCCESS; } +_Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER, UINT) { if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) @@ -573,6 +574,7 @@ NTSTATUS WifiHAL::WifiIhvScan(const WDI_SCAN_PARAMETERS& ScanParameters, const P return STATUS_SUCCESS; } +_Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { NT_ASSERT(m_LastConnectEntryId == 0); @@ -787,6 +789,7 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( return ntStatus; } +_Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { //Since this is DIRECT OID, need to check the m_LastConnectTransactionId match diff --git a/network/wlan/WIFICX/drivercode/wifirequest.cpp b/network/wlan/WIFICX/drivercode/wifirequest.cpp index 525fa14c..fd02bd91 100644 --- a/network/wlan/WIFICX/drivercode/wifirequest.cpp +++ b/network/wlan/WIFICX/drivercode/wifirequest.cpp @@ -36,7 +36,7 @@ void WifiIhvSendIndicationToOs( _In_ UINT16 WifiRequestMessageId, _In_ UINT32 WifiRequestTransactionId, _In_ NTSTATUS WifiRquestM4Status, - _In_ PUCHAR pTlvData, + _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, _In_ UINT32 TlvDataSize) { WDFMEMORY data = WDF_NO_HANDLE; @@ -56,12 +56,13 @@ void WifiIhvSendIndicationToOs( RtlZeroMemory(pIndicationBuffer, indicationSize); pIndicationHeader = reinterpret_cast(pIndicationBuffer); - - RtlCopyMemory(pIndicationHeader, pOriginalWdiHeader, sizeof(WDI_MESSAGE_HEADER)); - pIndicationHeader->TransactionId = WifiRequestTransactionId; + pIndicationHeader->PortId = pOriginalWdiHeader->PortId; + pIndicationHeader->Reserved = pOriginalWdiHeader->Reserved; pIndicationHeader->Status = Wifi::ConvertNDISSTATUSToNTSTATUS(WifiRquestM4Status); + pIndicationHeader->TransactionId = WifiRequestTransactionId; + pIndicationHeader->IhvSpecificId = pOriginalWdiHeader->IhvSpecificId; - if (TlvDataSize > 0) + if (TlvDataSize > 0 && pTlvData != nullptr) { RtlCopyMemory(pIndicationBuffer + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); } diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf index 432e31ac..d068b5ff 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.inf +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.inf @@ -1,11 +1,11 @@ -; +;Copyright (c) Microsoft Corporation. All rights reserved. ; wificxsampleclientkm.inf ; [Version] Signature = "$WINDOWS NT$" -Class = System ; TODO: specify appropriate Class -ClassGuid = {4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid +Class = NET +ClassGuid = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %ManufacturerName% CatalogFile = wificxsampleclientkm.cat DriverVer = ; TODO: set DriverVer in stampinf property pages @@ -28,16 +28,25 @@ wificxsampleclientkm.sys = 1,, %ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299 [Standard.NT$ARCH$.10.0...16299] -%wificxsampleclientkm.DeviceDesc% = wificxsampleclientkm_Device, Root\wificxsampleclientkm ; TODO: edit hw-id +%wificxsampleclientkm.DeviceDesc% = wificxsampleclientkm_Device.ndi, Root\wificxsampleclientkm -[wificxsampleclientkm_Device.NT] +; +; Normal device - Networking Section +; +[wificxsampleclientkm_Device.ndi.NT] CopyFiles = File_Copy +Characteristics = 0x84 ; NCF_HAS_UI, NCF_PHYSICAL +BusType = 0 ; Internal +AddReg = wificxsampleclientkm.reg +*IfType = 71 ; IF_TYPE_IEEE80211 +*MediaType = 16 ; NdisMediumNative802_11 +*PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 [File_Copy] wificxsampleclientkm.sys ;-------------- Service installation -[wificxsampleclientkm_Device.NT.Services] +[wificxsampleclientkm_Device.ndi.NT.Services] AddService = wificxsampleclientkm,%SPSVCINST_ASSOCSERVICE%, wificxsampleclientkm_Service_Inst ; -------------- wificxsampleclientkm driver install sections @@ -48,15 +57,30 @@ StartType = 3 ; SERVICE_DEMAND_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %13%\wificxsampleclientkm.sys -[wificxsampleclientkm_Device.NT.Wdf] +[wificxsampleclientkm_Device.ndi.NT.Wdf] KmdfService = wificxsampleclientkm, wificxsampleclientkm_wdfsect [wificxsampleclientkm_wdfsect] KmdfLibraryVersion = $KMDFVERSION$ + +[wificxsampleclientkm.reg] +HKR, Ndi, Service, 0, "wificxsampleclientkm" +HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" +HKR, Ndi\Interfaces, LowerRange, 0, "wlan,ethernet" +; standard INF keywords for NetAdapter drivers +; using AddReg directive so they will work when this INF being Includes/Needs + +HKR, NetworkInterface, *IfConnectorPresent, 0x00010001, 1 +HKR, NetworkInterface, *ConnectionType, 0x00010001, 1 +HKR, NetworkInterface, *DirectionType, 0x00010001, 0 +HKR, NetworkInterface, *AccessType, 0x00010001, 2 +HKR, NetworkInterface, *HardwareLoopback, 0x00010001, 0 +HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 + [Strings] SPSVCINST_ASSOCSERVICE = 0x00000002 -ManufacturerName = "" ;TODO: Replace with your manufacturer name -DiskName = "wificxsampleclientkm Installation Disk" -wificxsampleclientkm.DeviceDesc = "wificxsampleclientkm Device" -wificxsampleclientkm.SVCDESC = "wificxsampleclientkm Service" +ManufacturerName = "WDK Sample" +DiskName = "Wificxsampleclientkm Installation Disk" +wificxsampleclientkm.DeviceDesc = "Wificxsampleclientkm Device" +wificxsampleclientkm.SVCDESC = "Wificxsampleclientkm Service" diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index 49510981..d2748de9 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -34,7 +34,7 @@ WindowsKernelModeDriver10.0 Driver KMDF - Universal + Windows Driver 1 33 33 @@ -52,7 +52,7 @@ WindowsKernelModeDriver10.0 Driver KMDF - Universal + Windows Driver 1 33 33 @@ -70,7 +70,7 @@ WindowsKernelModeDriver10.0 Driver KMDF - Universal + Windows Driver 1 33 33 @@ -88,7 +88,7 @@ WindowsKernelModeDriver10.0 Driver KMDF - Universal + Windows Driver 1 33 33 @@ -110,15 +110,19 @@ DbgengKernelDebugger + true DbgengKernelDebugger + true DbgengKernelDebugger + true DbgengKernelDebugger + true @@ -134,6 +138,9 @@ $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + 1.0 + @@ -149,6 +156,9 @@ $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + 1.0 + @@ -164,6 +174,9 @@ $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + 1.0 + @@ -179,6 +192,9 @@ $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + 1.0 + diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 6ed871d4..41828dea 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From dd61a12239a771573bc87117119eceb082b9762b Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 20 Nov 2025 11:45:37 -0800 Subject: have the Infrastructure ready to have the driver install success and able to start handling the WifiRequest --- network/wlan/WIFICX/drivercode/adapter.cpp | 24 +++++++----- network/wlan/WIFICX/drivercode/device.h | 1 - network/wlan/WIFICX/drivercode/umkmfusion.h | 43 ++++++++++++++++++---- network/wlan/WIFICX/drivercode/wifihal.cpp | 15 +++++++- network/wlan/WIFICX/drivercode/wifitransition.cpp | 8 ++-- network/wlan/WIFICX/km/wificxsampleclientkm.inf | 2 +- network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 6802 -> 6508 bytes 7 files changed, 69 insertions(+), 24 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp index f532ae02..958f69ea 100644 --- a/network/wlan/WIFICX/drivercode/adapter.cpp +++ b/network/wlan/WIFICX/drivercode/adapter.cpp @@ -27,20 +27,24 @@ NTSTATUS WifiIhvAdapterStart(NETADAPTER netAdapter) { TraceEntry(); - ULONG64 maxXmitLinkSpeed = WIFI_MEDIA_MAX_SPEED; - ULONG64 maxRcvLinkSpeed = WIFI_MEDIA_MAX_SPEED; - - NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCapabilities; - NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCapabilities, maxXmitLinkSpeed, maxRcvLinkSpeed); - - NetAdapterSetLinkLayerCapabilities(netAdapter, &linkLayerCapabilities); - - NetAdapterSetLinkLayerMtuSize(netAdapter, WIFI_MAX_PACKET_SIZE); - static WDI_MAC_ADDRESS STAAddress = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; NET_ADAPTER_LINK_LAYER_ADDRESS permanentLinkLayerAddress; NET_ADAPTER_LINK_LAYER_ADDRESS_INIT(&permanentLinkLayerAddress, sizeof(WDI_MAC_ADDRESS), STAAddress.Address); + NetAdapterSetCurrentLinkLayerAddress(netAdapter, &permanentLinkLayerAddress); NetAdapterSetPermanentLinkLayerAddress(netAdapter, &permanentLinkLayerAddress); + + // Sample Phase 1 has no datapath support, so setting those values to the default one. + NET_ADAPTER_TX_CAPABILITIES txCaps; + NET_ADAPTER_RX_CAPABILITIES rxCaps; + NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCaps; + + NET_ADAPTER_TX_CAPABILITIES_INIT(&txCaps, 1); + NET_ADAPTER_RX_CAPABILITIES_INIT_SYSTEM_MANAGED(&rxCaps, 1514, 1); + NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCaps, 0, 0); + + NetAdapterSetLinkLayerMtuSize(netAdapter, 1500); + NetAdapterSetLinkLayerCapabilities(netAdapter, &linkLayerCaps); + NetAdapterSetDataPathCapabilities(netAdapter, &txCaps, &rxCaps); WIFI_ADAPTER_WAKE_CAPABILITIES wakeCap{}; WIFI_ADAPTER_WAKE_CAPABILITIES_INIT(&wakeCap); diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h index 8c00515e..bf70ba7b 100644 --- a/network/wlan/WIFICX/drivercode/device.h +++ b/network/wlan/WIFICX/drivercode/device.h @@ -20,7 +20,6 @@ typedef struct _WIFI_IHV_DEVICE_CONTEXT WDFDEVICE WdfDevice; TLV_CONTEXT TlvContext; NETADAPTER primaryStaAdapter; - WifiHAL* wifiHAL; } WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_DEVICE_CONTEXT, WifiGetIhvDeviceContext); diff --git a/network/wlan/WIFICX/drivercode/umkmfusion.h b/network/wlan/WIFICX/drivercode/umkmfusion.h index 35e5a6cf..8f0db3f8 100644 --- a/network/wlan/WIFICX/drivercode/umkmfusion.h +++ b/network/wlan/WIFICX/drivercode/umkmfusion.h @@ -23,18 +23,47 @@ namespace Wifi } __inline - NTSTATUS ConvertNDISSTATUSToNTSTATUS(NDIS_STATUS ndisStatus) + NTSTATUS ConvertNDISSTATUSToNTSTATUS(NDIS_STATUS NdisStatus) { - // NDIS_STATUS_SUCCESS is 0x00000000 - // Any non-success NDIS status should map to STATUS_UNSUCCESSFUL - return (ndisStatus == NDIS_STATUS_SUCCESS) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + if (NT_SUCCESS(NdisStatus) && NdisStatus != NDIS_STATUS_SUCCESS && NdisStatus != NDIS_STATUS_PENDING && + NdisStatus != NDIS_STATUS_INDICATION_REQUIRED) + { + // Case where an NDIS error is incorrectly mapped as a success by NT_SUCCESS macro + return STATUS_UNSUCCESSFUL; + } + else + { + switch (NdisStatus) + { + case NDIS_STATUS_BUFFER_TOO_SHORT: + return STATUS_BUFFER_TOO_SMALL; + break; + default: + return (NTSTATUS)NdisStatus; + break; + } + } } __inline - NDIS_STATUS ConvertNTSTATUSToNDISSTATUS(NTSTATUS ntStatus) + NDIS_STATUS ConvertNTSTATUSToNDISSTATUS(NTSTATUS NtStatus) { - // Use NT_SUCCESS macro to check NTSTATUS - return NT_SUCCESS(ntStatus) ? NDIS_STATUS_SUCCESS : NDIS_STATUS_FAILURE; + if (NT_SUCCESS(NtStatus) && NtStatus != STATUS_PENDING && NtStatus != STATUS_NDIS_INDICATION_REQUIRED) + { + return NDIS_STATUS_SUCCESS; + } + else + { + switch (NtStatus) + { + case STATUS_BUFFER_TOO_SMALL: + return NDIS_STATUS_BUFFER_TOO_SHORT; + break; + default: + return (NDIS_STATUS)NtStatus; + break; + } + } } _Must_inspect_result_ diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 4a73d386..87be1f6b 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -39,9 +39,20 @@ void WifiHAL::_OnCleanup(WDFOBJECT Object) NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() { - return ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) + NTSTATUS status = + ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) && (WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter != WDF_NO_HANDLE) // In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized && (m_CurrentRadioState == TRUE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY); // Device is ready only if radio is ON (this may be replaced by other state in IHV implementation) + + if(NT_SUCCESS(status) == FALSE) + { + WFCError( + "Device not ready for request. Device=%p, primaryStaAdapter=%p, CurrentRadioState=%u", + m_Device, + (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter : WDF_NO_HANDLE, + m_CurrentRadioState); + } + return status; } NTSTATUS WifiHAL::WifiIhvGetPendingTransitionStatus() @@ -504,6 +515,7 @@ NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParam _Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { + WFCInfo("Setting OS requested Radio State: SoftwareRadioState=%u\n", RadioState.SoftwareRadioState); if (RadioState.SoftwareRadioState != m_CurrentRadioState) { // Change the radio state @@ -518,6 +530,7 @@ NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& Rad RadioStatusParams.RadioState.SoftwareState = m_CurrentRadioState; if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, m_TlvContext, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) { + WFCInfo("Indicate OS with Radio State: SoftwareRadioState=%u\n", m_CurrentRadioState); WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, pOutput, cbOutput); FreeGenerated(pOutput); } diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp index eccf9dc3..64811796 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.cpp +++ b/network/wlan/WIFICX/drivercode/wifitransition.cpp @@ -96,7 +96,7 @@ struct GenericTransitionTraits if (TPreM3Fn) { // Call member function pointer on WifiHAL instance - NTSTATUS preStatus = (c.DevCtx->wifiHAL->*TPreM3Fn)(); + NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM3Fn)(); if (!NT_SUCCESS(preStatus)) { return preStatus; @@ -106,7 +106,7 @@ struct GenericTransitionTraits if (THalM3Fn) { // Pass required third argument (BytesWriten) to HAL M3 function - return (c.DevCtx->wifiHAL->*THalM3Fn)(p, c.Header, bytesWritten); + return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM3Fn)(p, c.Header, bytesWritten); } return STATUS_SUCCESS; @@ -116,7 +116,7 @@ struct GenericTransitionTraits { if (TPreM4Fn) { - NTSTATUS preStatus = (c.DevCtx->wifiHAL->*TPreM4Fn)(); + NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM4Fn)(); if (!NT_SUCCESS(preStatus)) { return preStatus; @@ -125,7 +125,7 @@ struct GenericTransitionTraits if (THalM4Fn) { - return (c.DevCtx->wifiHAL->*THalM4Fn)(c.Header); + return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM4Fn)(c.Header); } return (TPreM4Fn == nullptr && THalM4Fn == nullptr) ? STATUS_PENDING : STATUS_SUCCESS; diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf index d068b5ff..a29d9721 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.inf +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.inf @@ -82,5 +82,5 @@ HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 SPSVCINST_ASSOCSERVICE = 0x00000002 ManufacturerName = "WDK Sample" DiskName = "Wificxsampleclientkm Installation Disk" -wificxsampleclientkm.DeviceDesc = "Wificxsampleclientkm Device" +wificxsampleclientkm.DeviceDesc = "[KMDF]Wificx Sample Client Device" wificxsampleclientkm.SVCDESC = "Wificxsampleclientkm Service" diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 41828dea..7b0b35ff 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From 23999221becc1487db027737db9d3336c17f2a29 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 20 Nov 2025 11:47:54 -0800 Subject: cleanup dead file --- network/wlan/WIFICX/drivercode/transition_steps.hpp | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 network/wlan/WIFICX/drivercode/transition_steps.hpp diff --git a/network/wlan/WIFICX/drivercode/transition_steps.hpp b/network/wlan/WIFICX/drivercode/transition_steps.hpp deleted file mode 100644 index dc04eab2..00000000 --- a/network/wlan/WIFICX/drivercode/transition_steps.hpp +++ /dev/null @@ -1,17 +0,0 @@ -template -NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepFns... fns) -{ - NTSTATUS status = STATUS_SUCCESS; - auto seq = { (status = (fns(ctx, p)), status == STATUS_SUCCESS ? 0 : 1)... }; - UNREFERENCED_PARAMETER(seq); - return status; -} - -// In a traits Handle(): -static NTSTATUS Handle(TransitionContext& ctx, ParamType& params) -{ - return ExecuteSteps(ctx, params, - [](TransitionContext& c, ParamType& par){ return c.DevCtx->wifiHAL->WifiIhvSetRadioState(par, c.Header); }, - [](TransitionContext& c, ParamType&){ return STATUS_SUCCESS; } // extra step - ); -} \ No newline at end of file -- cgit v1.3.1 From 76cc5bf0e86d85e92fdf3df9c8eccd245a6118bf Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 20 Nov 2025 13:35:47 -0800 Subject: adding the copyright to the code file, and let the Radio State by default is on --- network/wlan/WIFICX/drivercode/wifihal.cpp | 25 +++++++++++++++++------ network/wlan/WIFICX/drivercode/wifihal.h | 15 +------------- network/wlan/WIFICX/drivercode/wifitransition.cpp | 2 ++ network/wlan/WIFICX/drivercode/wifitransition.h | 3 ++- 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 87be1f6b..1a5914a6 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -37,20 +37,33 @@ void WifiHAL::_OnCleanup(WDFOBJECT Object) UNREFERENCED_PARAMETER(Object); } +_Use_decl_annotations_ +void WifiHAL::Initialize(WDFDEVICE Device, PCTLV_CONTEXT TlvContext) +{ + m_Device = Device; + m_TlvContext = TlvContext; + m_CurrentRadioState = 1; // On by default + m_LastConnectEntryId = 0; + m_LastConnectTransactionId = 0; + m_LastAuthAlgo = WDI_AUTH_ALGO_UNKNOWN; + RtlZeroMemory(&m_ConnectedPeer, sizeof(m_ConnectedPeer)); + // Initialize link addresses and supported bands (previously in-class const init) + m_LocalLinkAddresses[0] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x21 }; + m_LocalLinkAddresses[1] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x22 }; + m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); +} + NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() { NTSTATUS status = ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) - && (WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter != WDF_NO_HANDLE) // In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized - && (m_CurrentRadioState == TRUE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY); // Device is ready only if radio is ON (this may be replaced by other state in IHV implementation) - + && (WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter != WDF_NO_HANDLE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY);// In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized if(NT_SUCCESS(status) == FALSE) { WFCError( - "Device not ready for request. Device=%p, primaryStaAdapter=%p, CurrentRadioState=%u", + "Device not ready for request. Device=%p, primaryStaAdapter=%p", m_Device, - (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter : WDF_NO_HANDLE, - m_CurrentRadioState); + (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter : WDF_NO_HANDLE); } return status; } diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h index 75c7d94d..38e1166a 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.h +++ b/network/wlan/WIFICX/drivercode/wifihal.h @@ -12,20 +12,7 @@ public: WifiHAL() = default; // Initialization routine replacing the previous parameterized ctor usage - void Initialize(_In_ WDFDEVICE Device, _In_ PCTLV_CONTEXT TlvContext) - { - m_Device = Device; - m_TlvContext = TlvContext; - m_CurrentRadioState = 0; - m_LastConnectEntryId = 0; - m_LastConnectTransactionId = 0; - m_LastAuthAlgo = WDI_AUTH_ALGO_UNKNOWN; - RtlZeroMemory(&m_ConnectedPeer, sizeof(m_ConnectedPeer)); - // Initialize link addresses and supported bands (previously in-class const init) - m_LocalLinkAddresses[0] = {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}; - m_LocalLinkAddresses[1] = {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}; - m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); - } + void Initialize(_In_ WDFDEVICE Device, _In_ PCTLV_CONTEXT TlvContext); // Wifi request M3 working condition verification function NTSTATUS WifiIhvIsDeviceReadyForRequest(); diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp index 64811796..41106932 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.cpp +++ b/network/wlan/WIFICX/drivercode/wifitransition.cpp @@ -1,3 +1,5 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + #include "wifitransition.h" // Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. diff --git a/network/wlan/WIFICX/drivercode/wifitransition.h b/network/wlan/WIFICX/drivercode/wifitransition.h index 74d8dff6..a0addf88 100644 --- a/network/wlan/WIFICX/drivercode/wifitransition.h +++ b/network/wlan/WIFICX/drivercode/wifitransition.h @@ -1,7 +1,8 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. #pragma once #include "precomp.h" #include "wifiHAL.h" -#include "wifirequest.h" // WifiIhvSendM4IndicationToOs, DumpMessageTlvByteStream, Wifi::ConvertNDISSTATUSToNTSTATUS +#include "wifirequest.h" // Generic execution context passed between steps and parse/handle struct TransitionContext -- cgit v1.3.1 From 00c74bed33e4a0ccadb3d7a41c1c29cf0a461009 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 20 Nov 2025 14:45:04 -0800 Subject: Update the project status. --- network/wlan/WIFICX/README.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/network/wlan/WIFICX/README.md b/network/wlan/WIFICX/README.md index 363e0578..65f6dd88 100644 --- a/network/wlan/WIFICX/README.md +++ b/network/wlan/WIFICX/README.md @@ -1,6 +1,6 @@ --- page_type: sample -description: "Demonstrates leveraging WIFICX for control flow and NetAdapterCx for data flow." +description: "Demonstrates how to use WIFICX for control flow and NetAdapterCx for data flow." languages: - cpp products: @@ -8,6 +8,35 @@ products: - windows-wdk --- -# WIFICX and NetAdapterCx samples +# WIFICX and NetAdapterCx Samples -This sample demonstrates leveraging WIFICX for control flow and NetAdapterCx for data flow. +This sample illustrates how to leverage **WIFICX** for control flow and **NetAdapterCx** for data flow. It supports both **KMDF** and **UMDF** drivers. + +## How to Build +1. Mount the EWDK ISO from a local drive (network share paths are not supported). +2. Run `LaunchBuildEnv.cmd`. +3. In the environment created in step 2, type `SetupVSEnv` and press **Enter**. +4. Navigate to the current folder and open the solution file, for example: + `X:\Windows-driver-samples\network\wlan\WIFICX\wificxsampleclient.sln` +5. Build the solution from the Visual Studio UI. + +## Interfaces and Abstraction +The sample interacts with three OS components: + +- **WDF** + `driver.cpp`, `device.cpp`, and `adapter.cpp` demonstrate proper registration for PnP and power event callbacks. WDF manages system PnP and power requests (e.g., power IRPs), so IHV drivers should follow the flow triggered through these callbacks. + +- **WDF Wi-Fi Class Extension (WIFICX)** + `wifixxxxx.cpp` files implement the **control path**, handling commands sent to Wi-Fi firmware (e.g., scan access points, connect, disconnect). + +- **WDF NetAdapter Class Extension (NetAdapterCx)** + `netvxxxx.cpp` files implement the **data path**, managing network buffers and synchronizing with the control path for transfer start/stop operations. + +## Data Buffers from Firmware +The control path uses hardcoded data since this sample does not target real hardware. The data path uses **Emulated Network Link (ENL)**, which connects two virtual network adapters directly. Packets sent over one adapter are delivered to the other and vice versa. + +## Supported Scenarios +- [x] Scan access points and report BSS entries to the Windows UI. +- [x] Connect to an open access point from the Windows UI. +- [x] Disconnect from the connected access point. +- [ ] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). -- cgit v1.3.1 From b7ae1a8fefca1a1d46eb2129fc76ea289add4a84 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 24 Nov 2025 14:32:47 -0800 Subject: try to walk aroudn the DrvCat EWDK(10.0.26100.6584) error by disabling the inf2cat and code analysis. Will enable back when newer version EWDK fixed the issue. --- network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 16 ++++++++++++---- network/wlan/WIFICX/um/wificxsampleclientum.vcxproj | 12 ++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index d2748de9..16842485 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -45,6 +45,7 @@ true 1 2 + true Windows10 @@ -63,6 +64,7 @@ true 1 2 + true Windows10 @@ -81,6 +83,7 @@ true 1 2 + true Windows10 @@ -99,6 +102,7 @@ true 1 2 + true @@ -110,19 +114,23 @@ DbgengKernelDebugger - true + false + false DbgengKernelDebugger - true + false + false DbgengKernelDebugger - true + false + false DbgengKernelDebugger - true + false + false diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj index 715859e3..85e826d5 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -59,7 +59,7 @@ 35 true 2 - 5 + 4 true 1 2 @@ -72,7 +72,7 @@ 35 true 2 - 5 + 4 true 1 2 @@ -85,7 +85,7 @@ 35 true 2 - 5 + 4 true 1 2 @@ -98,7 +98,7 @@ 35 true 2 - 5 + 4 true 1 2 @@ -113,15 +113,19 @@ DbgengRemoteDebugger + false DbgengRemoteDebugger + false DbgengRemoteDebugger + false DbgengRemoteDebugger + false -- cgit v1.3.1 From 4afd989f71e639db7797b75229f57b81b372573b Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 24 Nov 2025 14:58:18 -0800 Subject: fix the rror 1001: Invalid INF 'D:\a\Windows-driver-samples\Windows-driver-samples\network\wlan\WIFICX\um\ARM64\Debug\wificxsampleclientum.inf', must contain [Version] section and have signature "$Windows NT$" --- network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 6508 -> 6508 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 7b0b35ff..48cf379c 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From c27f85b9c2d42d2e86863ad18954d42c11ea95b2 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 24 Nov 2025 17:39:06 -0800 Subject: BuildBreak Fix: Convert to UTF8 --- network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 6508 -> 3154 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 48cf379c..35477349 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From 9dbc926ce6e032e6500d46c6890451c17724b766 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 25 Nov 2025 12:00:49 -0800 Subject: Moving to UTF-16 LE BOM as https://learn.microsoft.com/en-us/windows-hardware/drivers/install/general-guidelines-for-inf-files#editing-inf-files-and-file-encodings The file must be saved with an ANSI or Unicode (UTF-16 LE) file encoding. Unicode (UTF-16 LE) is preferred since it allows the INF to support localizing the INF Strings section in a wide variety of languages. If your INF contains non-ASCII characters, you must save the file as a Unicode (UTF-16 LE) file. --- network/wlan/WIFICX/km/wificxsampleclientkm.inf | Bin 2896 -> 5966 bytes network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 3154 -> 6504 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf index a29d9721..a05b7050 100644 Binary files a/network/wlan/WIFICX/km/wificxsampleclientkm.inf and b/network/wlan/WIFICX/km/wificxsampleclientkm.inf differ diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 35477349..174afe55 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From ee5cca45e2b748ca92e902e876840986fd3d7f18 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 25 Nov 2025 15:06:20 -0800 Subject: fixing the GitHub code analysis errors --- network/wlan/WIFICX/drivercode/driver.cpp | 1 - network/wlan/WIFICX/drivercode/driver.h | 11 ++++++----- network/wlan/WIFICX/drivercode/trace.h | 2 +- network/wlan/WIFICX/km/wificxsampleclientkm.inf | Bin 5966 -> 2896 bytes network/wlan/WIFICX/um/wificxsampleclientum.inf | Bin 6504 -> 3154 bytes 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp index 974d87fb..bbc4d151 100644 --- a/network/wlan/WIFICX/drivercode/driver.cpp +++ b/network/wlan/WIFICX/drivercode/driver.cpp @@ -5,7 +5,6 @@ #include "driver.h" #include "driver.tmh" -extern "C" NTSTATUS DriverEntry( _In_ PDRIVER_OBJECT driverObject, _In_ PUNICODE_STRING registryPath) diff --git a/network/wlan/WIFICX/drivercode/driver.h b/network/wlan/WIFICX/drivercode/driver.h index 8d4f12b7..8573b30e 100644 --- a/network/wlan/WIFICX/drivercode/driver.h +++ b/network/wlan/WIFICX/drivercode/driver.h @@ -2,10 +2,11 @@ #pragma once #include "precomp.h" -extern "C" -{ - DRIVER_INITIALIZE DriverEntry; -} +WDF_EXTERN_C_START + +DRIVER_INITIALIZE DriverEntry; EVT_WDF_DRIVER_DEVICE_ADD EvtWifiDriverDeviceAdd; -EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; \ No newline at end of file +EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; + +WDF_EXTERN_C_END \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/trace.h b/network/wlan/WIFICX/drivercode/trace.h index 39b9033d..324e1c87 100644 --- a/network/wlan/WIFICX/drivercode/trace.h +++ b/network/wlan/WIFICX/drivercode/trace.h @@ -141,7 +141,7 @@ typedef struct _ByteArray __inline ByteArray log_lenstr(ULONG len, const void* buf) { - ByteArray xs = {0}; + ByteArray xs{}; xs.usLength = (USHORT)len; xs.pvBuffer = buf; return xs; diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf index a05b7050..a29d9721 100644 Binary files a/network/wlan/WIFICX/km/wificxsampleclientkm.inf and b/network/wlan/WIFICX/km/wificxsampleclientkm.inf differ diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 174afe55..35477349 100644 Binary files a/network/wlan/WIFICX/um/wificxsampleclientum.inf and b/network/wlan/WIFICX/um/wificxsampleclientum.inf differ -- cgit v1.3.1 From 83019ae0c63454b2835f8fc245c7505351cee677 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 2 Dec 2025 13:37:13 -0800 Subject: Have the NetVAdapter Lib buildable with EWDK for both UM and KM --- .../netvadapterlibrary/code/adapter.cpp | 652 +++++++++++++ .../netadaptercx/netvadapterlibrary/code/adapter.h | 141 +++ .../netvadapterlibrary/code/configuration.cpp | 102 ++ .../netvadapterlibrary/code/configuration.h | 8 + .../netadaptercx/netvadapterlibrary/code/enl.cpp | 1025 ++++++++++++++++++++ network/netadaptercx/netvadapterlibrary/code/enl.h | 268 +++++ .../netvadapterlibrary/code/enlthreads.cpp | 136 +++ .../netvadapterlibrary/code/enlthreads.h | 119 +++ .../netvadapterlibrary/code/memory.cpp | 77 ++ .../netadaptercx/netvadapterlibrary/code/memory.h | 59 ++ .../netvadapterlibrary/code/net/netpacketlibrary.h | 85 ++ .../netvadapterlibrary/code/net/netringiterator.h | 281 ++++++ .../netvadapterlibrary/code/net/umxfilter.h | 268 +++++ .../netadaptercx/netvadapterlibrary/code/pch.hpp | 34 + .../netadaptercx/netvadapterlibrary/code/queue.cpp | 42 + .../netadaptercx/netvadapterlibrary/code/queue.h | 46 + .../netvadapterlibrary/code/rtl/KCriticalRegion.h | 67 ++ .../netvadapterlibrary/code/rtl/KDebug.h | 31 + .../netvadapterlibrary/code/rtl/KLockHolder.h | 114 +++ .../netvadapterlibrary/code/rtl/KMacros.h | 84 ++ .../netvadapterlibrary/code/rtl/KNew.h | 203 ++++ .../netvadapterlibrary/code/rtl/KPushLock.h | 61 ++ .../netvadapterlibrary/code/rtl/KSpinLock.h | 157 +++ .../netvadapterlibrary/code/rtl/KWaitEvent.h | 172 ++++ .../netvadapterlibrary/code/rtl/UmPool.h | 97 ++ .../netvadapterlibrary/code/rtl/pooltypes.h | 53 + .../netvadapterlibrary/code/rxqueue.cpp | 191 ++++ .../netadaptercx/netvadapterlibrary/code/rxqueue.h | 57 ++ .../netadaptercx/netvadapterlibrary/code/trace.h | 96 ++ .../netvadapterlibrary/code/txqueue.cpp | 118 +++ .../netadaptercx/netvadapterlibrary/code/txqueue.h | 51 + .../km/netvadapterlibrarykm.filters | 26 + .../km/netvadapterlibrarykm.vcxproj | 196 ++++ .../netvadapterlibrary/km/packages.config | 4 + .../netvadapterlibrary/netvadapterlibrary.sln | 41 + .../um/netvadapterlibraryum.filters | 26 + .../um/netvadapterlibraryum.vcxproj | 197 ++++ .../netvadapterlibrary/um/packages.config | 4 + 38 files changed, 5389 insertions(+) create mode 100644 network/netadaptercx/netvadapterlibrary/code/adapter.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/adapter.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/configuration.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/configuration.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/enl.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/enl.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/enlthreads.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/enlthreads.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/memory.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/memory.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/net/netpacketlibrary.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/net/netringiterator.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/net/umxfilter.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/pch.hpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/queue.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/queue.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KMacros.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/rxqueue.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/trace.h create mode 100644 network/netadaptercx/netvadapterlibrary/code/txqueue.cpp create mode 100644 network/netadaptercx/netvadapterlibrary/code/txqueue.h create mode 100644 network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters create mode 100644 network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj create mode 100644 network/netadaptercx/netvadapterlibrary/km/packages.config create mode 100644 network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln create mode 100644 network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters create mode 100644 network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj create mode 100644 network/netadaptercx/netvadapterlibrary/um/packages.config diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp new file mode 100644 index 00000000..1e6777b8 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp @@ -0,0 +1,652 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" + +#include +#ifdef _KERNEL_MODE +#include +#else +#include "net/umxfilter.h" // Copied from Km XFilter.h, NETCX please move this xfilter.h into shared location +#endif +#include "adapter.h" +#include "rxqueue.h" +#include "txqueue.h" +#include "configuration.h" +#include "trace.h" +#include "memory.h" + +#include "adapter.tmh" + +UCHAR NetvMacAddressBase[MAC_ADDR_LEN] = { 0x22, 0x22, 0x22, 0x22, 0x00, 0x00 }; +const ULONG GSO_MAX_OFFLOAD_SIZE = 0xffff; +const ULONG GSO_MIN_SEGMENT_COUNT = 2; + +/* + * increasing beyond 1Gbps results in intermittent failure of + * netvadapter start due to buffer allocation failures in + * netadaptercx when running in nebula. + * tracked as bug 50671552 (if it doesn't get archived) + */ +static auto constexpr MAX_LINK_SPEED{1'000'000'000ull}; + +void +NetvEnlInterruptRoutine( + _Inout_ PVOID PortContext, + _In_ bool Tx +) +{ + NETPACKETQUEUE queue = (NETPACKETQUEUE)PortContext; + + if (Tx) // Tx + { + NetTxQueueNotifyMoreCompletedPacketsAvailable(queue); + } + else // Rx + { + NetRxQueueNotifyMoreReceivedPacketsAvailable(queue); + } +} + +static +EVT_PACKET_QUEUE_START + EvtTxQueueStart; + +static +EVT_PACKET_QUEUE_STOP + EvtTxQueueStop; + +static +EVT_PACKET_QUEUE_ADVANCE + EvtTxQueueAdvance; + +static +EVT_PACKET_QUEUE_CANCEL + EvtTxQueueCancel; + +static +EVT_PACKET_QUEUE_SET_NOTIFICATION_ENABLED + EvtTxQueueSetNotify; + +static +EVT_PACKET_QUEUE_START + EvtRxQueueStart; + +static +EVT_PACKET_QUEUE_STOP + EvtRxQueueStop; + +static +EVT_PACKET_QUEUE_ADVANCE + EvtRxQueueAdvance; + +static +EVT_PACKET_QUEUE_CANCEL + EvtRxQueueCancel; + +static +EVT_PACKET_QUEUE_SET_NOTIFICATION_ENABLED + EvtRxQueueSetNotify; + +NetvAdapter::NetvAdapter( + NETADAPTER Handle, + WDFDEVICE Device +) noexcept + : m_handle(Handle) + , m_device(Device) +{ +} + +NTSTATUS +NetvAdapter::Initialize( + void +) +{ + RETURN_IF_NOT_STATUS_SUCCESS( + NetvAdapterReadConfiguration(this, m_device)); + + RETURN_IF_NOT_STATUS_SUCCESS(NetvAdapterReadAddress()); + + SetLinkState(); + + NTSTATUS status = STATUS_SUCCESS; + + // Create ENL + EnlPortCreated = FALSE; + + if (NetvEnlMLink[EnlIndex].LinkCount == 0) + { + RETURN_IF_NOT_STATUS_SUCCESS( + EnlMCreateLink( + LinkCount, + LinkProcIndex, + LinkPoll, + &NetvEnlMLink[EnlIndex])); + } + + RETURN_NTSTATUS_IF(STATUS_INVALID_ADDRESS, + EnlMIsPortActive(&NetvEnlMLink[EnlIndex], EnlPortIndex)); + + status = EnlMActivateLinkPort( + &NetvEnlMLink[EnlIndex], + EnlPortIndex, + NetvEnlInterruptRoutine, + this); + + // what is the virtue of doing this? + if (NT_SUCCESS(status)) + { + EnlPortCreated = TRUE; + } + + RETURN_STATUS_SUCCESS(); +} + +void +NetvAdapter::Destroy( + void +) +{ + if (EnlPortCreated) + { + EnlMDeactivateLinkPort(&NetvEnlMLink[EnlIndex], EnlPortIndex); + EnlPortCreated = FALSE; + } + + if (EnlIndexValid && !EnlIsLinkActive(NetvEnlMLink[EnlIndex].LinkHandle[0])) + { + EnlMCloseLink(&NetvEnlMLink[EnlIndex]); + } +} + +_Use_decl_annotations_ +NTSTATUS +NetvAdapter::CreateRxQueue( + NETRXQUEUE_INIT * NetRxQueueInit + ) +{ + WDF_OBJECT_ATTRIBUTES rxAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&rxAttributes, NetvRxQueue); + rxAttributes.EvtDestroyCallback = [](WDFOBJECT Handle) { + NetvRxQueueGetContext(static_cast(Handle))->Destroy(); + }; + + NET_PACKET_QUEUE_CONFIG rxConfig; + NET_PACKET_QUEUE_CONFIG_INIT( + &rxConfig, + EvtRxQueueAdvance, + EvtRxQueueSetNotify, + EvtRxQueueCancel); + rxConfig.EvtStart = EvtRxQueueStart; + rxConfig.EvtStop = EvtRxQueueStop; + + NETPACKETQUEUE rxQueue; + RETURN_IF_NOT_STATUS_SUCCESS(NetRxQueueCreate( + NetRxQueueInit, + &rxAttributes, + &rxConfig, + &rxQueue)); + + new (NetvRxQueueGetContext(rxQueue)) NetvRxQueue(rxQueue, *this); + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +NTSTATUS +NetvAdapter::CreateTxQueue( + NETTXQUEUE_INIT * NetTxQueueInit + ) +{ + WDF_OBJECT_ATTRIBUTES txAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&txAttributes, NetvTxQueue); + txAttributes.EvtDestroyCallback = [](WDFOBJECT Handle) { + NetvTxQueueGetContext(static_cast(Handle))->Destroy(); + }; + + NET_PACKET_QUEUE_CONFIG txConfig; + NET_PACKET_QUEUE_CONFIG_INIT( + &txConfig, + EvtTxQueueAdvance, + EvtTxQueueSetNotify, + EvtTxQueueCancel); + txConfig.EvtStart = EvtTxQueueStart; + txConfig.EvtStop = EvtTxQueueStop; + + NETPACKETQUEUE txQueue; + RETURN_IF_NOT_STATUS_SUCCESS(NetTxQueueCreate( + NetTxQueueInit, + &txAttributes, + &txConfig, + &txQueue)); + + new (NetvTxQueueGetContext(txQueue)) NetvTxQueue(txQueue, *this); + + RETURN_STATUS_SUCCESS(); +} + +void NetvAdapter::SetPdoWakeSignalCallback(_In_ EVT_PDO_WAKE_SIGNAL* evtPdoWakeSignal, _In_ void* context) +{ + EnlSetPdoWakeSignalCallback(NetvEnlMLink[EnlIndex].LinkHandle[0], evtPdoWakeSignal, context); +} + +_Use_decl_annotations_ +_IRQL_requires_max_(PASSIVE_LEVEL) +void NetvAdapter::ArmWakeFromS0(void) +{ + if (EnlPortCreated) + { + ENLP_LINK* enLinkHandle = NetvEnlMLink[EnlIndex].LinkHandle[0]; + EnlArmWake(enLinkHandle); + } +} + +_Use_decl_annotations_ +_IRQL_requires_max_(PASSIVE_LEVEL) +void NetvAdapter::DisarmWakeFromS0(void) +{ + if (EnlPortCreated) + { + ENLP_LINK* enLinkHandle = NetvEnlMLink[EnlIndex].LinkHandle[0]; + EnlDisarmWake(enLinkHandle); + } +} + +_Use_decl_annotations_ +void +NetvAdapter::SetLinkState( + void +) const +{ + NET_ADAPTER_AUTO_NEGOTIATION_FLAGS autoNegotiationFlags{NetAdapterAutoNegotiationFlagNone}; + if (LinkAutoNeg) + { + autoNegotiationFlags |= + NetAdapterAutoNegotiationFlagXmitLinkSpeedAutoNegotiated | + NetAdapterAutoNegotiationFlagRcvLinkSpeedautoNegotiated | + NetAdapterAutoNegotiationFlagDuplexAutoNegotiated; + } + if (FlowControl != NetvFlowControlDisabled) + { + autoNegotiationFlags |= + NetAdapterAutoNegotiationFlagPauseFunctionsAutoNegotiated; + } + + NET_ADAPTER_PAUSE_FUNCTION_TYPE pauseFunctions{NetAdapterPauseFunctionTypeUnknown}; + switch (FlowControl) + { + case NetvFlowControlDisabled: + pauseFunctions = NetAdapterPauseFunctionTypeUnsupported; + break; + case NetvFlowControlRxEnabled: + pauseFunctions = NetAdapterPauseFunctionTypeReceiveOnly; + break; + case NetvFlowControlTxEnabled: + pauseFunctions = NetAdapterPauseFunctionTypeSendOnly; + break; + case NetvFlowControlTxRxEnabled: + pauseFunctions = NetAdapterPauseFunctionTypeSendAndReceive; + break; + } + + NET_ADAPTER_LINK_STATE linkState; + NET_ADAPTER_LINK_STATE_INIT( + &linkState, + MAX_LINK_SPEED, + MediaConnectStateConnected, + MediaDuplexStateFull, + pauseFunctions, + autoNegotiationFlags); + NetAdapterSetLinkState(m_handle, &linkState); +} + +static +void +EvtSetReceiveFilter( + _In_ NETADAPTER NetAdapter, + _In_ NETRECEIVEFILTER Handle + ) +{ + NetvAdapter* adapter = NetvAdapterGetContextFromWDFObject(NetAdapter); + + adapter->PacketFilter = NetReceiveFilterGetPacketFilter(Handle); + + adapter->NumMulticastAddresses = (ULONG)NetReceiveFilterGetMulticastAddressCount(Handle); + + RtlZeroMemory(adapter->MulticastAddressList, + sizeof(NET_ADAPTER_LINK_LAYER_ADDRESS) * MAX_MULTICAST_LIST_SIZE); + + if (adapter->NumMulticastAddresses != 0U) + { + NET_ADAPTER_LINK_LAYER_ADDRESS const * MulticastAddressList = NetReceiveFilterGetMulticastAddressList(Handle); + RtlCopyMemory(adapter->MulticastAddressList, + MulticastAddressList, + sizeof(NET_ADAPTER_LINK_LAYER_ADDRESS) * adapter->NumMulticastAddresses); + } +} + +static +_IRQL_requires_same_ +_IRQL_requires_max_(PASSIVE_LEVEL) +void +NTAPI +EvtNetAdapterOffloadSetRxXSum( + _In_ NETADAPTER Adapter, + _In_ NETOFFLOAD Offload + ) +{ + UNREFERENCED_PARAMETER((Adapter, Offload)); + ASSERT(NetOffloadIsRxChecksumIPv4Enabled(Offload)); + ASSERT(NetOffloadIsRxChecksumUdpEnabled(Offload)); +} + +static +_IRQL_requires_same_ +_IRQL_requires_max_(PASSIVE_LEVEL) +void +NTAPI +EvtNetAdapterOffloadSetGso( + _In_ NETADAPTER Adapter, + _In_ NETOFFLOAD Offload + ) +{ + auto adapter = NetvAdapterGetContextFromWDFObject(Adapter); + if (adapter->UsoEnabled) + { + // + // Since netvadapter only converts USO sends into URO receives, + // both must be enabled together, or disabled together. + // The order of callbacks is nondeterministic, so this can't assert + // that URO is enabled, since it might not have been enabled yet. + // This assert is so anyone using netvadapter knows that USO has + // been disabled after being enabled. + // + NT_FRE_ASSERTMSG("USO can't be disabled after being enabled", NetOffloadIsUsoIPv4Enabled(Offload)); + NT_FRE_ASSERTMSG("USO can't be disabled after being enabled", NetOffloadIsUsoIPv6Enabled(Offload)); + } + else + { + adapter->UsoEnabled = NetOffloadIsUsoIPv4Enabled(Offload) && NetOffloadIsUsoIPv6Enabled(Offload); + } +} + +static +_IRQL_requires_same_ +_IRQL_requires_max_(PASSIVE_LEVEL) +void +NTAPI +EvtNetAdapterOffloadSetRsc( + _In_ NETADAPTER Adapter, + _In_ NETOFFLOAD Offload + ) +{ + auto adapter = NetvAdapterGetContextFromWDFObject(Adapter); + if (adapter->UroEnabled) + { + // + // Since netvadapter only converts USO sends into URO receives, + // both must be enabled together, or disabled together. + // The order of callbacks is nondeterministic, so this can't assert + // that USO is enabled, since it might not have been enabled yet. + // This assert is so anyone using netvadapter knows that URO has + // been disabled after being enabled. + // This assert is important because if URO is disabled, netvadapter + // will forward the USO send without fixing it up or segmenting it, + // and the stack may behave badly. + // + NT_FRE_ASSERTMSG("URO can't be disabled after being enabled", NetOffloadIsUdpRscEnabled(Offload)); + } + else + { + adapter->UroEnabled = NetOffloadIsUdpRscEnabled(Offload); + } +} + +static +void +NetvAdapterSetUsoUroOffloadCapabilities( + _In_ NETADAPTER Adapter + ) +{ + NET_ADAPTER_OFFLOAD_GSO_CAPABILITIES gsoCapabilities; + NET_ADAPTER_OFFLOAD_GSO_CAPABILITIES_INIT( + &gsoCapabilities, + NetAdapterOffloadLayer3FlagIPv4NoOptions | NetAdapterOffloadLayer3FlagIPv6NoExtensions, + NetAdapterOffloadLayer4FlagUdp, + GSO_MAX_OFFLOAD_SIZE, + GSO_MIN_SEGMENT_COUNT, + EvtNetAdapterOffloadSetGso); + + NET_ADAPTER_OFFLOAD_RSC_CAPABILITIES rscCapabilities; + NET_ADAPTER_OFFLOAD_RSC_CAPABILITIES_INIT( + &rscCapabilities, + NetAdapterOffloadLayer3FlagIPv4NoOptions | NetAdapterOffloadLayer3FlagIPv6NoExtensions, + NetAdapterOffloadLayer4FlagUdp, + EvtNetAdapterOffloadSetRsc); + rscCapabilities.TcpTimestampOption = FALSE; + + NetAdapterOffloadSetGsoCapabilities(Adapter, &gsoCapabilities); + NetAdapterOffloadSetRscCapabilities(Adapter, &rscCapabilities); +} + +_Use_decl_annotations_ +NTSTATUS NetvAdapter::ConfigureDataCapabilities() +{ + if (PreallocatedRxBuffers) + { + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, Memory); + attributes.EvtDestroyCallback = [](WDFOBJECT Object) + { + Memory* memory = GetMemoryFromHandle(Object); + memory->~Memory(); + }; + + attributes.EvtCleanupCallback = [](WDFOBJECT Object) + { + Memory* memory = GetMemoryFromHandle(Object); + memory->ReleaseAllMappings(); + }; + + NET_MEMORY_COLLECTION_CONFIG collectionConfig; + NET_MEMORY_COLLECTION_CONFIG_INIT( + &collectionConfig, + PREALLOCATED_BUFFERS_COUNT); + + RETURN_IF_NOT_STATUS_SUCCESS( + NetMemoryCollectionCreate( + m_device, + &attributes, + &collectionConfig, + &m_preallocatedRxBuffers)); + + Memory* memory = new (GetMemoryFromHandle(m_preallocatedRxBuffers)) Memory(); + RETURN_IF_NOT_STATUS_SUCCESS( + memory->Initialize( + m_preallocatedRxBuffers, + MAX_RX_BUFFER_SIZE + )); + } + + NET_ADAPTER_TX_CAPABILITIES txCapabilities; + NET_ADAPTER_TX_CAPABILITIES_INIT(&txCapabilities, MAX_TX_QUEUES); + + NET_ADAPTER_RX_CAPABILITIES rxCapabilities; + NET_ADAPTER_RX_CAPABILITIES_INIT_SYSTEM_MANAGED(&rxCapabilities, MAX_RX_BUFFER_SIZE, MAX_RX_QUEUES); + + if (PreallocatedRxBuffers) + { + rxCapabilities.AllocationMode = NetRxFragmentBufferAllocationModeDriverV2; + rxCapabilities.AttachmentMode = NetRxFragmentBufferAttachmentModeDriver; + rxCapabilities.MemoryCollection = m_preallocatedRxBuffers; + } + + NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCapabilities; + NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCapabilities, MAX_LINK_SPEED, MAX_LINK_SPEED); + + NET_ADAPTER_RECEIVE_FILTER_CAPABILITIES receiveFilterCapabilities; + NET_ADAPTER_RECEIVE_FILTER_CAPABILITIES_INIT(&receiveFilterCapabilities, EvtSetReceiveFilter); + receiveFilterCapabilities.SupportedPacketFilters = NETV_SUPPORTED_FILTERS; + receiveFilterCapabilities.MaximumMulticastAddresses = MAX_MULTICAST_LIST_SIZE; + + NET_ADAPTER_OFFLOAD_RX_CHECKSUM_CAPABILITIES xsumCapabilities; + NET_ADAPTER_OFFLOAD_RX_CHECKSUM_CAPABILITIES_INIT(&xsumCapabilities, EvtNetAdapterOffloadSetRxXSum); + + NetAdapterSetLinkLayerCapabilities(m_handle, &linkLayerCapabilities); + NetAdapterSetLinkLayerMtuSize(m_handle, MTU_SIZE); + NetAdapterSetDataPathCapabilities(m_handle, &txCapabilities, &rxCapabilities); + NetAdapterSetReceiveFilterCapabilities(m_handle, &receiveFilterCapabilities); + NetAdapterOffloadSetRxChecksumCapabilities(m_handle, &xsumCapabilities); + + NET_ADAPTER_LINK_LAYER_ADDRESS netvLinkAddress; + NET_ADAPTER_LINK_LAYER_ADDRESS_INIT(&netvLinkAddress, MAC_ADDR_LEN, (CONST UCHAR*)&(PermanentAddress.Address)); + + NetAdapterSetPermanentLinkLayerAddress(m_handle, &netvLinkAddress); + NetAdapterSetCurrentLinkLayerAddress(m_handle, &netvLinkAddress); + + if (EnableUsoUro) + { + NetvAdapterSetUsoUroOffloadCapabilities(m_handle); + } + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +NTSTATUS +ConfigureAndStartAdapter( + NETADAPTER Adapter + ) +{ + auto adapter = NetvAdapterGetContextFromWDFObject(Adapter); + RETURN_IF_NOT_STATUS_SUCCESS( + adapter->ConfigureDataCapabilities()); + + RETURN_IF_NOT_STATUS_SUCCESS( + NetAdapterStart(Adapter)); + + RETURN_STATUS_SUCCESS(); +} + +NTSTATUS +NetvAdapter::NetvAdapterReadAddress() +{ + PermanentAddress.Length = MAC_ADDR_LEN; + + RETURN_NTSTATUS_IF(STATUS_INVALID_ADDRESS, + MACLastByte < 1 || + MACLastByte > MAX_ADAPTER_COUNT); + + ETH_COPY_NETWORK_ADDRESS(PermanentAddress.Address, NetvMacAddressBase); + PermanentAddress.Address[MAC_ADDR_LEN - 1] = (UCHAR) MACLastByte; + + if (ETH_IS_MULTICAST(PermanentAddress.Address) || + ETH_IS_BROADCAST(PermanentAddress.Address)) + { + RETURN_IF_NOT_STATUS_SUCCESS(STATUS_INVALID_ADDRESS); + } + + RtlCopyMemory( + &CurrentAddress, + &PermanentAddress, + sizeof(PermanentAddress) + ); + + EnlIndex = (MACLastByte - 1) >> 1; + EnlPortIndex = (MACLastByte - 1) & 1; + EnlIndexValid = TRUE; + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +void +EvtTxQueueStart( + NETPACKETQUEUE Queue +) +{ + NetvTxQueueGetContext(Queue)->Start(); +} + +_Use_decl_annotations_ +void +EvtTxQueueStop( + NETPACKETQUEUE Queue +) +{ + NetvTxQueueGetContext(Queue)->Stop(); +} + +_Use_decl_annotations_ +void +EvtTxQueueAdvance( + NETPACKETQUEUE Queue +) +{ + NetvTxQueueGetContext(Queue)->Advance(); +} + +_Use_decl_annotations_ +void +EvtTxQueueCancel( + NETPACKETQUEUE Queue +) +{ + NetvTxQueueGetContext(Queue)->Cancel(); +} + +_Use_decl_annotations_ +void +EvtTxQueueSetNotify( + NETPACKETQUEUE Queue, + BOOLEAN Enable +) +{ + NetvTxQueueGetContext(Queue)->SetNotify(Enable); +} + +_Use_decl_annotations_ +void +EvtRxQueueStart( + NETPACKETQUEUE Queue +) +{ + NetvRxQueueGetContext(Queue)->Start(); +} + +_Use_decl_annotations_ +void +EvtRxQueueStop( + NETPACKETQUEUE Queue +) +{ + NetvRxQueueGetContext(Queue)->Stop(); +} + + +_Use_decl_annotations_ +void +EvtRxQueueAdvance( + NETPACKETQUEUE Queue +) +{ + NetvRxQueueGetContext(Queue)->Advance(); +} + +_Use_decl_annotations_ +void +EvtRxQueueCancel( + NETPACKETQUEUE Queue +) +{ + NetvRxQueueGetContext(Queue)->Cancel(); +} + +_Use_decl_annotations_ +void +EvtRxQueueSetNotify( + NETPACKETQUEUE Queue, + BOOLEAN Enable +) +{ + NetvRxQueueGetContext(Queue)->SetNotify(Enable); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.h b/network/netadaptercx/netvadapterlibrary/code/adapter.h new file mode 100644 index 00000000..55c4948d --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/adapter.h @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#pragma once + +#include + +#define MAX_RX_BUFFER_SIZE 65535 +#define MAX_RX_QUEUES 1 +#define MAX_TX_QUEUES 1 +#define MTU_SIZE 1500 +#define MAX_MULTICAST_LIST_SIZE 32 +#define MAC_ADDR_LEN 6 +#define NETV_NUMBER_OF_QUEUES 1 + +// supported filters +#define NETV_SUPPORTED_FILTERS ( \ + NetPacketFilterFlagDirected | \ + NetPacketFilterFlagMulticast | \ + NetPacketFilterFlagBroadcast | \ + NetPacketFilterFlagPromiscuous | \ + NetPacketFilterFlagAllMulticast) + +NTSTATUS +ConfigureAndStartAdapter( + _In_ NETADAPTER Adapter + ); + +EVT_NET_ADAPTER_CREATE_TXQUEUE + CreateTxQueue; +EVT_NET_ADAPTER_CREATE_RXQUEUE + CreateRxQueue; + +typedef enum _NETV_FLOW_CONTROL +{ + NetvFlowControlDisabled = 0, + NetvFlowControlTxEnabled = 1, + NetvFlowControlRxEnabled = 2, + NetvFlowControlTxRxEnabled = 3, +} NETV_FLOW_CONTROL; + +typedef NTSTATUS(EVT_PDO_WAKE_SIGNAL)(_In_ void* Context); + +class NetvAdapter +{ + +public: + + NetvAdapter( + NETADAPTER Handle, + WDFDEVICE Device + ) noexcept; + + void + Destroy( + void + ); + + NTSTATUS + Initialize( + void + ); + + NTSTATUS + CreateRxQueue( + NETRXQUEUE_INIT * NetRxQueueInit + ); + + NTSTATUS + CreateTxQueue( + NETTXQUEUE_INIT * NetTxQueueInit + ); + + NTSTATUS ConfigureDataCapabilities(); + + void SetPdoWakeSignalCallback(_In_ EVT_PDO_WAKE_SIGNAL* evtPdoWakeSignal, _In_ void* context); + + void ArmWakeFromS0(void); + + void DisarmWakeFromS0(void); + + NETADAPTER m_handle = WDF_NO_HANDLE; + + WDFDEVICE m_device = WDF_NO_HANDLE; + + NETMEMORYCOLLECTION + m_preallocatedRxBuffers = WDF_NO_HANDLE; + + // configuration + NET_ADAPTER_LINK_LAYER_ADDRESS PermanentAddress; + NET_ADAPTER_LINK_LAYER_ADDRESS CurrentAddress; + ULONG MACLastByte; + BOOLEAN S0Idle; + BOOLEAN EnableUsoUro; + BOOLEAN PreallocatedRxBuffers; + + // Packet Filter and look ahead size. + NET_PACKET_FILTER_FLAGS PacketFilter; + + bool LinkAutoNeg{false}; + NETV_FLOW_CONTROL FlowControl; + + ULONG MtuSize; + ULONG CurrentPacketFilter; + ULONG NumMulticastAddresses; + NET_ADAPTER_LINK_LAYER_ADDRESS MulticastAddressList[MAX_MULTICAST_LIST_SIZE]; + + //ENL + LIST_ENTRY AdapterListLink; + ULONG LinkCount{1}; + ULONG LinkProcIndex; + ULONG EnlIndex; + ULONG EnlPortIndex; + BOOLEAN EnlIndexValid; + BOOLEAN EnlPortCreated; + BOOLEAN LinkPoll; + ULONG64 EnlTxDrops; + + // Offloads + bool UsoEnabled; + bool UroEnabled; + +private: + + _IRQL_requires_(PASSIVE_LEVEL) + void + SetLinkState( + void + ) const; + + virtual NTSTATUS NetvAdapterReadAddress(); +}; + +extern NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter); + +typedef struct _GLOBAL_CONTEXT +{ +} GLOBAL_CONTEXT; + +extern GLOBAL_CONTEXT NetvGlobalContext; + + diff --git a/network/netadaptercx/netvadapterlibrary/code/configuration.cpp b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp new file mode 100644 index 00000000..52ae7886 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp @@ -0,0 +1,102 @@ +#include "pch.hpp" +#include "trace.h" +#include "configuration.tmh" +#include "adapter.h" + +typedef struct _NETVADAPTER_ADVANCED_PROPERTY +{ + UNICODE_STRING RegName; // variable name text + UINT32 FieldOffset; // offset to NetvAdapter field + UINT32 FieldSize; // size (in bytes) of the field + UINT32 Default; // default value to use + UINT32 Min; // minimum value allowed + UINT32 Max; // maximum value allowed +} NETVADAPTER_ADVANCED_PROPERTY; + +#define NETV_OFFSET(field) ((UINT32)FIELD_OFFSET(NetvAdapter,field)) +#define NETV_SIZE(field) RTL_FIELD_SIZE(NetvAdapter,field) + +#define CONSTANT_UNICODE_STRING(s) {sizeof( s ) - sizeof( WCHAR ), sizeof( s ), s } + +NETVADAPTER_ADVANCED_PROPERTY NetvSupportedProperties[] = +{ + // reg value name - Offset in NetvAdapter - Field size - Default Value - Min - Max + + // Standard Keywords + { CONSTANT_UNICODE_STRING(L"MACLastByte"), NETV_OFFSET(MACLastByte), NETV_SIZE(MACLastByte), 0, 0, 254 }, + { CONSTANT_UNICODE_STRING(L"LinkProcIndex"), NETV_OFFSET(LinkProcIndex), NETV_SIZE(LinkProcIndex), 1000, 0, 1023 }, + { CONSTANT_UNICODE_STRING(L"S0Idle"), NETV_OFFSET(S0Idle), NETV_SIZE(S0Idle), 0, 0, 1 }, + { CONSTANT_UNICODE_STRING(L"EnableUsoUro"), NETV_OFFSET(EnableUsoUro), NETV_SIZE(EnableUsoUro), 0, 0, 1 }, + { CONSTANT_UNICODE_STRING(L"PreallocatedRxBuffers"), NETV_OFFSET(PreallocatedRxBuffers), NETV_SIZE(PreallocatedRxBuffers), 0, 0, 1 }, +}; + +NTSTATUS +NetvAdapterReadConfiguration( + NetvAdapter *Adapter, + WDFDEVICE Device + ) +{ + NTSTATUS status = STATUS_SUCCESS; + + NETCONFIGURATION configuration; + RETURN_IF_NOT_STATUS_SUCCESS( + NetDeviceOpenConfiguration(Device, WDF_NO_OBJECT_ATTRIBUTES, &configuration)); + + // read all the registry values + for (auto &property : NetvSupportedProperties) + { + // Driver should NOT fail the initialization only because it can not + // read the registry + auto pointer = (PUCHAR)Adapter + property.FieldOffset; + + // Get the configuration value for a specific parameter. Under NT the + // parameters are all read in as DWORDs. + ULONG value = 0; + + status = NetConfigurationQueryUlong( + configuration, + NET_CONFIGURATION_QUERY_ULONG_NO_FLAGS, + &property.RegName, + &value); + + // Store the value in the adapter structure. + switch (property.FieldSize) + { + case 1: + *((PUCHAR)pointer) = (UCHAR)value; + break; + + case 2: + *((PUSHORT)pointer) = (USHORT)value; + break; + + case 4: + *((PULONG)pointer) = (ULONG)value; + break; + + default: + break; + } + + // If the parameter was present, then check its value for validity. + if (NT_SUCCESS(status)) + { + // Check that param value is not too small or too large + + if (value < property.Min || + value > property.Max) + { + value = property.Default; + } + } + else + { + value = property.Default; + status = STATUS_SUCCESS; + } + } + + NetConfigurationClose(configuration); + + RETURN_STATUS_SUCCESS(); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/configuration.h b/network/netadaptercx/netvadapterlibrary/code/configuration.h new file mode 100644 index 00000000..0bfe0170 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/configuration.h @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +NTSTATUS +NetvAdapterReadConfiguration( + NetvAdapter *Adapter, + WDFDEVICE Device + ); + diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp new file mode 100644 index 00000000..4e19517f --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -0,0 +1,1025 @@ +#include "pch.hpp" +#include +//#include +#include "adapter.h" +#include "rxqueue.h" +#include "txqueue.h" +#include "trace.h" +#include "memory.h" +#include "enl.tmh" + +/////////////////////////////////////////////////////////////////////////////// +// BEGIN Generic execution engine thread lib // +/////////////////////////////////////////////////////////////////////////////// + +ENL_MLINK NetvEnlMLink[MAX_ADAPTER_COUNT / 2]; + +/*++ +The iteration routine performs one full pass over all input queues and +any internal queues (that might be holding previous items waiting to be +processed). +--*/ + +static +SIZE_T +CopyTxPacketDataToBuffer( + _Out_writes_bytes_(BufferLength) PUCHAR BufferDest, + _In_ NET_RING_PACKET_ITERATOR const * Iterator, + _In_ NET_EXTENSION const * VirtualAddressExtension, + _In_ SIZE_T BufferLength) +{ + SIZE_T bytesCopied = 0; + + for (NET_RING_FRAGMENT_ITERATOR fi = NetPacketIteratorGetFragments(Iterator); + NetFragmentIteratorHasAny(&fi) && (BufferLength > 0); + NetFragmentIteratorAdvance(&fi)) + { + NET_FRAGMENT const * fragment = NetFragmentIteratorGetFragment(&fi); + NET_FRAGMENT_VIRTUAL_ADDRESS const * virtualAddress = + NetExtensionGetFragmentVirtualAddress(VirtualAddressExtension, NetFragmentIteratorGetIndex(&fi)); + + UCHAR const * pPacketData = (UCHAR const *)virtualAddress->VirtualAddress + fragment->Offset; + SIZE_T bytesToCopy = + (BufferLength < (SIZE_T) fragment->ValidLength) ? BufferLength : (SIZE_T) fragment->ValidLength; + RtlCopyMemory(BufferDest, pPacketData, bytesToCopy); + + bytesCopied += bytesToCopy; + BufferDest += bytesToCopy; + BufferLength -= bytesToCopy; + } + + return bytesCopied; +} + +VOID +EnlpAffinitizeThread( + _In_ ULONG ProcIndex, + _In_ ULONG IdealNode + ) +{ + LogInformation(FLAG_DRIVER, L"ProcIndex=%u", ProcIndex); + NTSTATUS status; + PROCESSOR_NUMBER procNumber = { 0 }; + GROUP_AFFINITY affinity = { 0 }; + + if (ProcIndex == 999) + { + // No affinity at all + return; + } + + if (ProcIndex == 1000 || (ProcIndex >= 1001 && ProcIndex <= 1004)) + { + KeQueryNodeActiveAffinity((USHORT)IdealNode, &affinity, NULL); + + if (ProcIndex == 1000) + { + // Affinitize to all the procs in the Node + NOTHING; + } + else + { + // Affinitize to the highest numbered proc in the Node for 1001, + // next highest numbered proc for 1002, ... + ULONG index; +#ifdef _WIN64 + BitScanReverse64(&index, (ULONG64)affinity.Mask); + affinity.Mask = (KAFFINITY)((ULONG64)1 << (index - (ProcIndex - 1001))); +#else + BitScanReverse(&index, (ULONG)affinity.Mask); + affinity.Mask = (KAFFINITY)((ULONG)1 << (index - (ProcIndex - 1001))); +#endif + } + } + else + { + // Affinitize the specifically requested proc + status = KeGetProcessorNumberFromIndex(ProcIndex, &procNumber); + NT_FRE_ASSERTMSG("Bad ProcIndex", NT_SUCCESS(status)); + + affinity.Group = procNumber.Group; + affinity.Mask = AFFINITY_MASK(procNumber.Number); + } + + EnlThreadSetAffinity(&affinity, NULL); +} + +ENL_START_ROUTINE EnlpThreadRoutine; + +NTSTATUS +EnlpStartThread( + _In_ ULONG ProcIndex, + _In_ ULONG IdealNode, + _In_ ENLP_ITERATION_ROUTINE* IterationRoutine, + _In_ PVOID IterationContext, + _In_opt_ KAutoEvent* ArmWaitEvent, + _Out_ ENLP_THREAD_STATE* EnlThread + ) +{ + LogInformation(FLAG_DRIVER, L"ProcIndex=%u EnlThread=%p", ProcIndex, EnlThread); + + EnlThread->PauseRequested = TRUE; + EnlThread->StopRequested = FALSE; + EnlThread->IterationRoutine = IterationRoutine; + EnlThread->IterationContext = IterationContext; + EnlThread->ArmWaitEvent = ArmWaitEvent; + + EnlThread->ProcIndex = ProcIndex; + EnlThread->IdealNode = IdealNode; + + RETURN_IF_NOT_STATUS_SUCCESS( + EnlThreadCreate(EnlpThreadRoutine, EnlThread, EnlThread->Thread)); + + EnlThreadSetPriority(EnlThread->Thread, 15); + + RETURN_STATUS_SUCCESS(); +} + +BOOLEAN +EnlpIsThreadPaused( + _In_ CONST ENLP_THREAD_STATE* EnlThread + ) +{ + return EnlThread->PauseRequested; +} + +VOID +EnlpPauseThread( + _Inout_ ENLP_THREAD_STATE* EnlThread + ) +{ + LogInformation(FLAG_DRIVER, L"EnlThread=%p", EnlThread); + if (!EnlpIsThreadPaused(EnlThread)) + { + WriteBooleanNoFence(&EnlThread->PauseRequested, TRUE); + if (EnlThread->ArmWaitEvent != NULL) + { + EnlThread->ArmWaitEvent->Set(); + } + EnlThread->PausingEvent.Wait(); + } +} + +VOID +EnlpResumeThread( + _Inout_ ENLP_THREAD_STATE* EnlThread + ) +{ + LogInformation(FLAG_DRIVER, L"EnlThread=%p", EnlThread); + if (EnlpIsThreadPaused(EnlThread)) + { + WriteBooleanNoFence(&EnlThread->PauseRequested, FALSE); + KeMemoryBarrier(); + EnlThread->ResumeEvent.Set(); + } +} + +VOID +EnlpStopThread( + _Inout_ ENLP_THREAD_STATE* EnlThread + ) +{ + LogInformation(FLAG_DRIVER, L"EnlThread=%p", EnlThread); + if (EnlThread->Thread != NULL) + { + WriteBooleanNoFence(&EnlThread->StopRequested, TRUE); + EnlpResumeThread(EnlThread); // in case thread was paused + EnlThreadWaitForTermination(EnlThread->Thread); + EnlThread->Thread.reset(); + } +} + +ENL_THREAD_ROUTINE_RETURN +EnlpThreadRoutine( + _In_ PVOID Context + ) +{ + ENLP_THREAD_STATE* enlThread = (ENLP_THREAD_STATE*)Context; + + // + // Affinitize the thread + // + EnlpAffinitizeThread(enlThread->ProcIndex, enlThread->IdealNode); + + // + // ENL thread starts at paused state. + // + enlThread->ResumeEvent.Wait(); + + for (;;) + { + + if (ReadBooleanNoFence(&enlThread->PauseRequested)) + { + enlThread->PausingEvent.Set(); + enlThread->ResumeEvent.Wait(); + } + + if (ReadBooleanNoFence(&enlThread->StopRequested)) + { + break; + } + + enlThread->IterationRoutine(enlThread->IterationContext); + } + + return ENL_THREAD_ROUTINE_RETURN(); +} + +/////////////////////////////////////////////////////////////////////////////// +// END Generic execution engine thread lib // +/////////////////////////////////////////////////////////////////////////////// + +BOOLEAN +enlpCheckAndArmQueue( + _Inout_ ENLP_QUEUE* Q + ) +{ + BOOLEAN armed = FALSE; + auto ringBuffer = Q->Queue->GetPacketRing(); + // If Q is still empty, take the lock, and if still empty under lock, then + // arm it. + if (ringBuffer->BeginIndex == ringBuffer->EndIndex) + { + KAcquireSpinLock lock(Q->Spinlock); + + if (ringBuffer->BeginIndex == ringBuffer->EndIndex) + { + armed = TRUE; + Q->Armed = TRUE; + } + } + + return armed; +} + +VOID +enlpArmAndWait( + _Inout_ ENLP_LINK* EnlLink + ) +{ + ULONG pi, ci; + + for (pi = 0; pi < ENLP_PORT_COUNT; pi++) + { + ENLP_PORT* port = &EnlLink->Ports[pi]; + + for (ci = 0; ci < port->TxQueueCount; ci++) + { + if (!enlpCheckAndArmQueue(port->TxQueue)) + { + return; + } + } + } + + EnlLink->ArmWaitEvent.Wait(); +} + +VOID +EnlpIterationRoutine( + _In_ PVOID IterationContext + ) +{ + auto enlLink = reinterpret_cast(IterationContext); + bool emptyTx = true; + // + // Drain up to TX_BATCH_COUNT items from all tx queues first. + // + + for (size_t pi = 0U; pi < ENLP_PORT_COUNT; pi++) + { + auto txport = &enlLink->Ports[pi]; + auto rxport = &enlLink->Ports[pi ^ 0x1]; // 0 -> 1, 1 -> 0 + + for (size_t ci = 0U; ci < txport->TxQueueCount; ci++) + { + auto txq = &txport->TxQueue[ci]; + if (txq->State != Started) + continue; + + NET_RING_PACKET_ITERATOR txPi = { + txq->Queue->m_rings, nullptr, txq->QueueNext, txq->QueueEnd + }; + + while (NetPacketIteratorHasAny(&txPi)) + { + bool rxDrop = TRUE; + auto txPacket = NetPacketIteratorGetPacket(&txPi); + + emptyTx = FALSE; + + if (enlLink->ArmedForWake) + { + // Save wake packet and trigger a wake signal, any other frames queued after the wake + // packet will be dropped + enlLink->WakeFrameSize = CopyTxPacketDataToBuffer( + &enlLink->WakeFrame[0], + &txPi, + &txq->TxQueue->VirtualAddressExtension, + sizeof(enlLink->WakeFrame)); +#if _KERNEL_MODE + enlLink->EvtWakeSignal(enlLink->WakeSignalContext); +#endif + + // Make sure to disarm wake, otherwise this thread might overwrite the original wake frame + EnlDisarmWake(enlLink); + } + + if (rxport->RxQueueCount > 0) + { + //TODO: Currently does 1:1 mapping between Tx and Rx. Need to set up indirection table + auto rxq = &rxport->RxQueue[ci]; + + if (rxq->State == Started) + { + NET_RING_FRAGMENT_ITERATOR rxFi = { + rxq->Queue->m_rings, nullptr, rxq->QueueNext, rxq->QueueEnd + }; + + auto rxPi = NetRingGetPostPackets(rxq->Queue->m_rings); + + if (NetFragmentIteratorHasAny(&rxFi) && NetPacketIteratorHasAny(&rxPi)) + { + rxDrop = FALSE; + + auto fragment = NetFragmentIteratorGetFragment(&rxFi); + BYTE* fragmentBuffer = nullptr; + + if (rxq->RxQueue->m_adapter.PreallocatedRxBuffers) + { + MemoryBuffer* bufferToUse = GetMemoryFromHandle(rxq->RxQueue->m_adapter.m_preallocatedRxBuffers)->PopAvailableBuffer(); + if (bufferToUse == nullptr) + { + // No more buffers available, stop processing packets + rxq->QueueNext = NetFragmentIteratorGetIndex(&rxFi); + break; + } + + NET_FRAGMENT_NET_MEMORY* netMemoryId = + NetExtensionGetFragmentNetMemory( + &rxq->RxQueue->NetMemoryExtension, + NetFragmentIteratorGetIndex(&rxFi)); + + NET_FRAGMENT_RETURN_CONTEXT* fragmentReturnContext = + NetExtensionGetFragmentReturnContext( + &rxq->RxQueue->NetMemoryReturnContextExtensionIn, + NetFragmentIteratorGetIndex(&rxFi)); + + netMemoryId->NetMemoryId = bufferToUse->MemoryId; + fragmentReturnContext->Handle = reinterpret_cast(bufferToUse); + fragmentBuffer = bufferToUse->VirtualAddress; + + auto const rxVirtualAddress = + NetExtensionGetFragmentVirtualAddress( + &rxq->RxQueue->VirtualAddressExtension, + NetFragmentIteratorGetIndex(&rxFi)); + + rxVirtualAddress->VirtualAddress = bufferToUse->VirtualAddress; + + fragment->Capacity = MAX_RX_BUFFER_SIZE; + fragment->Offset = 0; + fragment->Scratch = 0; + } + else + { + auto const rxVirtualAddress = + NetExtensionGetFragmentVirtualAddress( + &rxq->RxQueue->VirtualAddressExtension, + NetFragmentIteratorGetIndex(&rxFi)); + + fragmentBuffer = static_cast(rxVirtualAddress->VirtualAddress); + } + + fragment->Offset = 0; + fragment->ValidLength = + CopyTxPacketDataToBuffer( + fragmentBuffer, + &txPi, + &txq->TxQueue->VirtualAddressExtension, + static_cast(fragment->Capacity)); + + auto rxPacket = NetPacketIteratorGetPacket(&rxPi); + rxPacket->FragmentIndex = NetFragmentIteratorGetIndex(&rxFi); + rxPacket->FragmentCount = 1; + + if (enlLink->InitializePacketLayout) + { + rxPacket->Layout = txPacket->Layout; + } + else + { + rxPacket->Layout = {}; + } + + if (rxq->RxQueue->RxXSumExtension.Enabled) + { + auto RxXSum = NetExtensionGetPacketChecksum( + &rxq->RxQueue->RxXSumExtension, + NetPacketIteratorGetIndex(&rxPi)); + RxXSum->Layer2 = NetPacketRxChecksumEvaluationNotChecked; + RxXSum->Layer3 = NetPacketRxChecksumEvaluationValid; + RxXSum->Layer4 = NetPacketRxChecksumEvaluationValid; + } + + if (rxq->RxQueue->UdpRscExtension.Enabled && + txq->TxQueue->UsoExtension.Enabled) + { + auto txUso = NetExtensionGetPacketGso( + &txq->TxQueue->UsoExtension, + NetPacketIteratorGetIndex(&txPi)); + if (txPacket->Layout.Layer4Type == NetPacketLayer4TypeUdp && + txUso->UDP.Mss > 0) + { + if (txPacket->Layout.Layer3Type == NetPacketLayer3TypeIPv6NoExtensions) + { + UINT16* ipv6PayloadLength = (UINT16*)(fragmentBuffer + txPacket->Layout.Layer2HeaderLength + 4); + *ipv6PayloadLength = _byteswap_ushort( + (USHORT)(fragment->ValidLength - + (txPacket->Layout.Layer2HeaderLength + txPacket->Layout.Layer3HeaderLength))); + } + else if (txPacket->Layout.Layer3Type == NetPacketLayer3TypeIPv4NoOptions) + { + UINT16* ipv4TotalLength = (UINT16*)(fragmentBuffer + txPacket->Layout.Layer2HeaderLength + 2); + *ipv4TotalLength = _byteswap_ushort((USHORT)(fragment->ValidLength - txPacket->Layout.Layer2HeaderLength )); + NT_FRE_ASSERT(*ipv4TotalLength > 0); + } + + UINT16* udpPayloadLength = (UINT16*)(fragmentBuffer + txPacket->Layout.Layer2HeaderLength + + txPacket->Layout.Layer3HeaderLength + 4); + *udpPayloadLength = _byteswap_ushort( + (USHORT)(fragment->ValidLength - + (txPacket->Layout.Layer3HeaderLength + txPacket->Layout.Layer2HeaderLength))); + + // Set the checksum to zero + UINT16* udpChecksum = udpPayloadLength + 1; + *udpChecksum = 0; + + auto rxUro = NetExtensionGetPacketRsc( + &rxq->RxQueue->UdpRscExtension, + NetPacketIteratorGetIndex(&rxPi)); + rxUro->UDP.CoalescedSegmentSize = (UINT16)txUso->UDP.Mss; + rxUro->UDP.CoalescedSegmentCount = + (UINT16)((fragment->ValidLength - txPacket->Layout.Layer3HeaderLength - txPacket->Layout.Layer4HeaderLength + + txUso->UDP.Mss - 1) / txUso->UDP.Mss); + NT_FRE_ASSERT(rxUro->UDP.CoalescedSegmentCount > 1); + NT_FRE_ASSERT(*udpPayloadLength >= 8); + } + } + + // prevent any reordering the tx/rx completion flag + KeMemoryBarrier(); + + // Use Scratch field as completion flag for the rx fragment + fragment->Scratch = 1; + rxPacket->Scratch = 1; + + NetFragmentIteratorAdvance(&rxFi); + NetPacketIteratorAdvance(&rxPi); + + rxq->QueueNext = NetFragmentIteratorGetIndex(&rxFi); + NetPacketIteratorSet(&rxPi); + + if (rxq->Notify) + { + rxport->Interrupt(rxq->Queue->m_handle, rxq->TxRx); + } + } + } + } + + if (rxDrop) + { + // TODO - add rxdrop stat + } + + // Use Scratch field as completion flag for the tx packet + txPacket->Scratch = 1; + NetPacketIteratorAdvance(&txPi); + } + + if (!emptyTx) + { + if (txq->Notify) + { + txport->Interrupt(txq->Queue->m_handle, txq->TxRx); + } + + // Store the next index so that the EnlThread knows which packet to start from in the next iteration + txq->QueueNext = NetPacketIteratorGetIndex(&txPi); + } + } + } + + ULONG64 ts; + + if (emptyTx) + { + if (enlLink->Poll == FALSE) + { + enlpArmAndWait(enlLink); + } + + ts = ReadTimeStampCounter(); + enlLink->EmptyTicks += (ts - enlLink->Ts); + } + else + { + ts = ReadTimeStampCounter(); + enlLink->BusyTicks += (ts - enlLink->Ts); + } + + enlLink->Ts = ts; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +ENLP_QUEUE * +EnlCreateQueue( + _In_ NETPACKETQUEUE Queue, + _In_ BOOLEAN Tx + ) +{ + ENLP_LINK* enlLink; + ENLP_PORT* port; + ENLP_QUEUE* enlQueue; + + if (Tx) // Tx + { + NetvTxQueue* netvTxQueue = NetvTxQueueGetContext(Queue); + enlLink = NetvEnlMLink[netvTxQueue->m_adapter.EnlIndex].LinkHandle[0]; + port = &enlLink->Ports[netvTxQueue->m_adapter.EnlPortIndex]; + enlQueue = &port->TxQueue[0]; // Change to accommodate multiple Queues + enlQueue->Queue = netvTxQueue; + enlQueue->TxQueue = netvTxQueue; + enlQueue->State = Stopped; + enlQueue->ArmWaitEvent = &enlLink->ArmWaitEvent; + enlQueue->QueueNext = 0; + enlQueue->QueueEnd = 0; + enlQueue->TxRx = TX; + enlQueue->EnlPortHandle = port; + port->TxQueueCount++; + LogInformation(FLAG_DRIVER, L"Adapter=%p Queue=%Iu TxQueue=%p", + &netvTxQueue->m_adapter, reinterpret_cast(Queue), netvTxQueue); + } + else // Rx + { + NetvRxQueue* netvRxQueue = NetvRxQueueGetContext(Queue); + enlLink = NetvEnlMLink[netvRxQueue->m_adapter.EnlIndex].LinkHandle[0]; + port = &enlLink->Ports[netvRxQueue->m_adapter.EnlPortIndex]; + enlQueue = &port->RxQueue[0]; // Change to accommodate multiple Queues + enlQueue->Queue = netvRxQueue; + enlQueue->RxQueue = netvRxQueue; + enlQueue->State = Stopped; + enlQueue->QueueNext = 0; + enlQueue->QueueEnd = 0; + enlQueue->TxRx = RX; + enlQueue->EnlPortHandle = port; + port->RxQueueCount++; + LogInformation(FLAG_DRIVER, L"Adapter=%p Queue=%Iu RxQueue=%p", + &netvRxQueue->m_adapter, reinterpret_cast(Queue), netvRxQueue); + } + + EnlpResumeThread(&enlLink->EnlThread); + + return enlQueue; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlDestroyQueue( + _In_ ENLP_QUEUE * Queue, + _In_ BOOLEAN Tx + ) +{ + LogInformation(FLAG_DRIVER, L"Queue=%p", Queue); + ENLP_PORT* port = Queue->EnlPortHandle; + + if (Tx) + { + port->TxQueueCount--; + } + else + { + port->RxQueueCount--; + } + + Queue->ArmWaitEvent = nullptr; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlRingDoorBell( + _In_ ENLP_QUEUE * Queue, + _In_ ULONG EndIndex + ) +{ + InterlockedExchange((volatile LONG *)&Queue->QueueEnd, (LONG)EndIndex); + + KAcquireSpinLock lock{ Queue->Spinlock }; + if (Queue->Armed) + { + NT_ASSERT(Queue->ArmWaitEvent != NULL); + Queue->Armed = FALSE; + lock.Release(); + Queue->ArmWaitEvent->Set(); + } +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlArmInterrupt( + _In_ ENLP_QUEUE * Queue, + _In_ BOOLEAN notificationEnabled + ) +{ + Queue->Notify = notificationEnabled; + + // TODO: InterlockedExchange reduces the throughput of the ENL from about 500MB/s to 8MB/s. -> why + //InterlockedExchange((volatile LONG *)&Queue->Notify, (LONG)notificationEnabled); +} + +_Use_decl_annotations_ +VOID +EnlIndicateQueueState( + ENLP_QUEUE * Queue, + ENL_QUEUE_STATE State + ) +{ + Queue->State = State; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlCreateLink( + _In_ ULONG ProcessorIndex, + _In_ ULONG IdealNode, + _In_ BOOLEAN Poll, + _In_ BOOLEAN InitializePacketLayout, + _Out_ ENLP_LINK ** EnlLink + ) +{ + LogInformation(FLAG_DRIVER, L"ProcessorIndex=%u", ProcessorIndex); + + auto enlLink = wil::make_unique_nothrow(); + RETURN_NTSTATUS_IF( + STATUS_INSUFFICIENT_RESOURCES, + ! enlLink); + + enlLink->Ts = ReadTimeStampCounter(); + enlLink->Poll = Poll; + enlLink->InitializePacketLayout = InitializePacketLayout; + + RETURN_IF_NOT_STATUS_SUCCESS( + EnlpStartThread( + ProcessorIndex, + IdealNode, + EnlpIterationRoutine, + enlLink.get(), + enlLink->Poll ? NULL : &enlLink->ArmWaitEvent, + &enlLink->EnlThread)); + + *EnlLink = enlLink.release(); + + RETURN_STATUS_SUCCESS(); +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlIsPortActive( + _In_ ENLP_LINK * EnlLink, + _In_ ULONG PortIndex + ) +{ + ENLP_PORT* port = &EnlLink->Ports[PortIndex]; + ENLP_QUEUE* txq = &port->TxQueue[0]; + + NT_FRE_ASSERT(PortIndex < ENLP_PORT_COUNT); + + return (txq->Queue == nullptr) ? FALSE : TRUE; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlIsLinkActive( + _In_ ENLP_LINK * EnlLink + ) +{ + return (EnlIsPortActive(EnlLink, 0) || EnlIsPortActive(EnlLink, 1)); +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlActivateLinkPort( + _In_ ENLP_LINK * EnlLink, + _In_ ULONG PortIndex, + _In_ ENL_INTERRUPT_ROUTINE Interrupt, + _In_ PVOID PortContext + ) +{ + ENLP_PORT* port = &EnlLink->Ports[PortIndex]; + + LogInformation(FLAG_DRIVER, L"PortIndex=%u Queue=%p", PortIndex, port->TxQueue[0].Queue); + + NT_FRE_ASSERT(!EnlIsPortActive(EnlLink, PortIndex)); + NT_FRE_ASSERT(port->TxQueueCount == 0); + NT_FRE_ASSERT(port->RxQueueCount == 0); + + port->Interrupt = Interrupt; + port->PortContext = PortContext; + + RETURN_STATUS_SUCCESS(); +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlDeactivateLinkPort( + _In_ ENLP_LINK * EnlLink, + _In_ ULONG PortIndex + ) +{ + NT_FRE_ASSERT(PortIndex < ENLP_PORT_COUNT); + + ENLP_PORT* port = &EnlLink->Ports[PortIndex]; + LogInformation(FLAG_DRIVER, L"PortIndex=%u Queue=%p", PortIndex, port->TxQueue[0].Queue); + + ULONG i; + NT_FRE_ASSERT(EnlIsPortActive(EnlLink, PortIndex)); + + KLockThisExclusive(EnlLink->Lock); + NT_FRE_ASSERT(!EnlpIsThreadPaused(&EnlLink->EnlThread)); + EnlpPauseThread(&EnlLink->EnlThread); + +#if _KERNEL_MODE + KeFlushQueuedDpcs(); +#endif + + port->PortContext = NULL; + + //Clears reference to only first queue - Change for all queues + port->TxQueue[0].Queue = nullptr; + port->RxQueue[0].Queue = nullptr; + + + // As long as there's one port with active queues, the EnlThread will run. + for (i = 0; i < ENLP_PORT_COUNT; i++) + { + if (EnlIsPortActive(EnlLink, i)) + { + EnlpResumeThread(&EnlLink->EnlThread); + break; + } + } +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlCloseLink( + _In_ ENLP_LINK * EnlLink + ) +{ + ULONG i; + + for (i = 0; i < ENLP_PORT_COUNT; i++) + { + NT_FRE_ASSERT(!EnlIsPortActive(EnlLink, i)); + } + + EnlpStopThread(&EnlLink->EnlThread); + + delete EnlLink; +} + +/////////////////////////////////////////////////////////////////////////////// +// Multi link wrapper APIs // +/////////////////////////////////////////////////////////////////////////////// + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlMCreateLink( + _In_range_(1, ENL_MLINK_MAX)ULONG LinkCount, + _In_reads_(LinkCount) ULONG ProcessorIndex, + _In_ BOOLEAN Poll, + _Out_ ENL_MLINK* EnlMLink + ) +{ + NTSTATUS status = STATUS_SUCCESS; + ULONG i = 0; + + RtlZeroMemory(EnlMLink, sizeof(*EnlMLink)); + + if (LinkCount < 1 || LinkCount > ENL_MLINK_MAX || + (LinkCount & (LinkCount - 1)) != 0) + { + status = STATUS_REQUEST_NOT_ACCEPTED; + goto exit; + } + + for (i = 0; i < LinkCount; i++) + { +#ifdef _KERNEL_MODE + const BOOLEAN initializePacketLayout = TRUE; +#else + const BOOLEAN initializePacketLayout = FALSE; +#endif + status = EnlCreateLink(ProcessorIndex, 0, Poll, initializePacketLayout, &EnlMLink->LinkHandle[i]); + + if (!NT_SUCCESS(status)) + { + goto exit; + } + } + + EnlMLink->LinkCount = LinkCount; + +exit: + + if (!NT_SUCCESS(status)) + { + for (; i > 0; i--) + { + EnlCloseLink(EnlMLink->LinkHandle[i - 1]); + EnlMLink->LinkHandle[i - 1] = NULL; + } + } + RETURN_NTSTATUS_IF( + status, + status != STATUS_SUCCESS); + + RETURN_STATUS_SUCCESS(); +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void EnlSetPdoWakeSignalCallback( + _In_ ENLP_LINK * EnlLink, + _In_ EVT_ENLP_PDO_WAKE_SIGNAL* evtPdoWakeSignal, + _In_ void* Context) +{ + EnlLink->EvtWakeSignal = evtPdoWakeSignal; + EnlLink->WakeSignalContext = Context; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlArmWake( + _In_ ENLP_LINK * EnlLink +) +{ + EnlLink->ArmedForWake = TRUE; + RtlZeroMemory(&EnlLink->WakeFrame[0], sizeof(EnlLink->WakeFrame)); + EnlLink->WakeFrameSize = 0; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlDisarmWake( + _In_ ENLP_LINK * EnlLink +) +{ + EnlLink->ArmedForWake = FALSE; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +size_t +EnlCopyWakeFrame( + _In_ ENLP_LINK * EnlLink, + _Out_writes_bytes_(BufferSize) unsigned char * Buffer, + _In_ size_t BufferSize +) +{ + if (EnlLink->WakeFrameSize == 0) + { + // There was no wake + return 0; + } + + if (BufferSize < EnlLink->WakeFrameSize) + { + // Wake frame is larger than what we can indicate + return 0; + } + + RtlCopyMemory(Buffer, &EnlLink->WakeFrame[0], EnlLink->WakeFrameSize); + auto const wakeFrameSize = EnlLink->WakeFrameSize; + + // Make sure to erase the wake frame, since the network interface might have + // multiple receive queues + RtlZeroMemory(&EnlLink->WakeFrame[0], EnlLink->WakeFrameSize); + EnlLink->WakeFrameSize = 0; + + return wakeFrameSize; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlMIsPortActive( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex + ) +{ + ULONG i; + + BOOLEAN result = EnlIsPortActive(EnlMLink->LinkHandle[0], PortIndex); + + for (i = 1; i < EnlMLink->LinkCount; i++) + { + NT_FRE_ASSERT(EnlIsPortActive(EnlMLink->LinkHandle[i], PortIndex) == result); + } + + return result; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlMIsLinkActive( + _In_ CONST ENL_MLINK* EnlMLink + ) +{ + ULONG i; + + BOOLEAN result = EnlIsLinkActive(EnlMLink->LinkHandle[0]); + + for (i = 1; i < EnlMLink->LinkCount; i++) + { + NT_FRE_ASSERT(EnlIsLinkActive(EnlMLink->LinkHandle[i]) == result); + } + + return result; +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlMActivateLinkPort( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex, + _In_ ENL_INTERRUPT_ROUTINE Interrupt, + _In_ PVOID PortContext + ) +{ + LogInformation(FLAG_DRIVER, L"EnlMLink=%p PortIndex=%u", EnlMLink, PortIndex); + + NTSTATUS status = STATUS_SUCCESS; + ULONG i; + + for (i = 0; i < EnlMLink->LinkCount; i++) + { + status = EnlActivateLinkPort( + EnlMLink->LinkHandle[i], + PortIndex, + Interrupt, + PortContext); + + if (!NT_SUCCESS(status)) + { + break; + } + } + + if (!NT_SUCCESS(status)) + { + for (; i > 0; i--) + { + EnlDeactivateLinkPort(EnlMLink->LinkHandle[i], PortIndex); + } + } + + RETURN_NTSTATUS_IF(status, + status != STATUS_SUCCESS); + + RETURN_STATUS_SUCCESS(); +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlMDeactivateLinkPort( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex + ) +{ + LogInformation(FLAG_DRIVER, L"EnlMLink=%p PortIndex=%u", EnlMLink, PortIndex); + + ULONG i; + + for (i = 0; i < EnlMLink->LinkCount; i++) + { + EnlDeactivateLinkPort(EnlMLink->LinkHandle[i], PortIndex); + } +} + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlMCloseLink( + _Inout_ ENL_MLINK* EnlMLink + ) +{ + LogInformation(FLAG_DRIVER, L"EnlMLink=%p", EnlMLink); + + ULONG i; + + for (i = 0; i < EnlMLink->LinkCount; i++) + { + EnlCloseLink(EnlMLink->LinkHandle[i]); + EnlMLink->LinkHandle[i] = NULL; + } + + EnlMLink->LinkCount = 0; +} diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.h b/network/netadaptercx/netvadapterlibrary/code/enl.h new file mode 100644 index 00000000..6089107e --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/enl.h @@ -0,0 +1,268 @@ + +// +// Emulated Network Link (ENL) definitions +// + +// +// An ENL connects two virtual network adapters directly. Packets sent over +// one adapter are delivered to the other adapter and vice versa. +// +// An ENL is created with a processor index. This processor is used to emulate +// the NIC hardware for the adapters connected by the ENL. +// +// Caller can send packets as NBLs over a given port, and also receive +// incoming packets placed into NBLs over a given port. +// +// ENL indicates tx and rx NBL completions over the target processor(s) +// determined by the RSS indirection table and the hash value for each NBL. +// The current version of the ENL requires a symmetric Toeplitz hash key +// to be used by the system globally so that both directions of a given +// 4-tuple (or 2-tuple) yield the same hash value. ENL currently indicates +// NBL completions by queueing DPCs to the target processor. +// + +//#include +#ifndef _KERNEL_MODE +#define ASSERT(x) NT_ASSERT(x) +#include "rtl/UmPool.h" +#endif +#include "rtl/KWaitEvent.h" +#include "rtl/KLockHolder.h" +#include "rtl/KSpinLock.h" +#include "rtl/KPushLock.h" +#include "rtl/KNew.h" + +#define ENL_MAX_PROC_COUNT 16 +#define ENLP_PORT_COUNT 2 + +#define TX TRUE +#define RX FALSE + +enum ENL_QUEUE_STATE { + Stopped, + Started + }; + +typedef +VOID +(ENL_INTERRUPT_ROUTINE) ( + _Inout_ PVOID PortContext, + _In_ bool TxRx + ); + +struct ENLP_LINK; +struct DECLSPEC_ALIGN(PAGE_SIZE) ENLP_PORT; +struct ENLP_QUEUE; + +typedef NTSTATUS(EVT_ENLP_PDO_WAKE_SIGNAL)(_In_ void* Context); + +_IRQL_requires_max_(PASSIVE_LEVEL) +ENLP_QUEUE * +EnlCreateQueue( + _In_ NETPACKETQUEUE Queue, + _In_ BOOLEAN Tx + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlDestroyQueue( + _In_ ENLP_QUEUE * QueueContext, + _In_ BOOLEAN Tx + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlRingDoorBell( + _In_ ENLP_QUEUE * QueueContext, + _In_ ULONG EndIndex + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlArmInterrupt( + _In_ ENLP_QUEUE * QueueContext, + _In_ BOOLEAN NotificationEnabled + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlSetPdoWakeSignalCallback( + _In_ ENLP_LINK * EnlLinkHandle, + _In_ EVT_ENLP_PDO_WAKE_SIGNAL* evtPdoWakeSignal, + _In_ void* Context + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlArmWake( + _In_ ENLP_LINK * EnlLinkHandle + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlDisarmWake( + _In_ ENLP_LINK * EnlLinkHandle + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +size_t +EnlCopyWakeFrame( + _In_ ENLP_LINK * EnlLinkHandle, + _Out_writes_bytes_(BufferSize) unsigned char * Buffer, + _In_ size_t BufferSize + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlIsLinkActive( + _In_ ENLP_LINK * EnlLinkHandle + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlIndicateQueueState( + _In_ ENLP_QUEUE * EnlLinkHandle, + _In_ ENL_QUEUE_STATE State + ); + +/////////////////////////////////////////////////////////////////////////////// +// Multi link wrapper APIs // +/////////////////////////////////////////////////////////////////////////////// + +#define ENL_MLINK_MAX 4 + +typedef struct +{ + _Field_range_(1, ENL_MLINK_MAX) ULONG LinkCount; + _Field_size_(LinkCount) ENLP_LINK * LinkHandle[ENL_MLINK_MAX]; +} ENL_MLINK; + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlMCreateLink( + _In_range_(1, ENL_MLINK_MAX)ULONG LinkCount, + _In_reads_(LinkCount) ULONG ProcessorIndex, + _In_ BOOLEAN Poll, + _Out_ ENL_MLINK* EnlMLink + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +BOOLEAN +EnlMIsPortActive( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +NTSTATUS +EnlMActivateLinkPort( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex, + _In_ ENL_INTERRUPT_ROUTINE Interrupt, + _In_ PVOID PortContext + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +void +EnlMDeactivateLinkPort( + _In_ CONST ENL_MLINK* EnlMLink, + _In_ ULONG PortIndex + ); + +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +EnlMCloseLink( + _Inout_ ENL_MLINK* EnlMLink + ); + +#define ENL_MAXIMUM_WAKE_FRAME_SIZE 1514 + +typedef +_IRQL_requires_max_(PASSIVE_LEVEL) +VOID +(ENLP_ITERATION_ROUTINE) ( + _In_ PVOID IterationContext + ); + +struct ENLP_THREAD_STATE +{ + BOOLEAN PauseRequested{}; + BOOLEAN StopRequested{}; + ENLP_ITERATION_ROUTINE* IterationRoutine{}; + PVOID IterationContext{}; + KAutoEvent *ArmWaitEvent{}; + KAutoEvent ResumeEvent{}; + KAutoEvent PausingEvent{}; + ULONG ProcIndex{}; + ULONG IdealNode{}; + unique_thread Thread{}; +}; + +class NetvQueue; +class NetvRxQueue; +class NetvTxQueue; + +struct ENLP_QUEUE +{ + BOOLEAN TxRx{}; + BOOLEAN Notify{}; + ULONG QueueEnd{}; + ULONG QueueNext{}; + + ENLP_PORT * EnlPortHandle{}; + + BOOLEAN Armed{}; + KSpinLock Spinlock{}; + KAutoEvent *ArmWaitEvent{}; + + ENL_QUEUE_STATE State{}; + + NetvQueue * Queue{nullptr}; + union { + NetvRxQueue * RxQueue; + NetvTxQueue * TxQueue; + }; + +}; + +struct DECLSPEC_ALIGN(PAGE_SIZE) ENLP_PORT +{ + ENL_INTERRUPT_ROUTINE* Interrupt; + PVOID PortContext; + ULONG TxQueueCount; + ULONG RxQueueCount; + + DECLSPEC_CACHEALIGN + ENLP_QUEUE TxQueue[ENL_MAX_PROC_COUNT]; + + DECLSPEC_CACHEALIGN + ENLP_QUEUE RxQueue[ENL_MAX_PROC_COUNT]; +}; + +struct ENLP_LINK : + public NONPAGED_OBJECT<'LLNE'> +{ + KPushLock Lock{}; + ULONG64 Ts{}; + ULONG64 BusyTicks{}; + ULONG64 EmptyTicks{}; + BOOLEAN Poll{}; + BOOLEAN InitializePacketLayout{}; + + // + // Power related features. If PowerInterface is NULL none of the other + // fields have meaning + // + EVT_ENLP_PDO_WAKE_SIGNAL* EvtWakeSignal; + void* WakeSignalContext; + BOOLEAN ArmedForWake{}; + unsigned char WakeFrame[ENL_MAXIMUM_WAKE_FRAME_SIZE]; + size_t WakeFrameSize{}; + + KAutoEvent ArmWaitEvent{}; + ENLP_THREAD_STATE EnlThread{}; + ENLP_PORT Ports[ENLP_PORT_COUNT]; +}; +#define MAX_ADAPTER_COUNT 2 +extern ENL_MLINK NetvEnlMLink[MAX_ADAPTER_COUNT / 2]; +C_ASSERT((ENLP_PORT_COUNT & 0x1) == 0); diff --git a/network/netadaptercx/netvadapterlibrary/code/enlthreads.cpp b/network/netadaptercx/netvadapterlibrary/code/enlthreads.cpp new file mode 100644 index 00000000..ffe70d6e --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/enlthreads.cpp @@ -0,0 +1,136 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#include "pch.hpp" +//#include +#include "enlthreads.h" + +#ifdef _KERNEL_MODE +unique_thread::operator bool( + void +) const +{ + return !!NtHandle; +} + +void unique_thread::reset( +) +{ + NtHandle.reset(); + ObHandle.reset(); +} +#endif + +ENL_THREAD +EnlGetCurrentThread( + void +) +{ +#ifdef _KERNEL_MODE + return KeGetCurrentThread(); +#else + return GetCurrentThreadId(); +#endif +} + +_Use_decl_annotations_ +NTSTATUS +EnlThreadCreate( + ENL_START_ROUTINE StartRoutine, + void * Context, + unique_thread & Thread +) +{ +#ifdef _KERNEL_MODE + + unique_zw_handle ntHandle; + unique_pkthread obHandle; + + auto const ntStatus = PsCreateSystemThread( + &ntHandle, + THREAD_ALL_ACCESS, + nullptr, + nullptr, + nullptr, + StartRoutine, + Context); + + if (ntStatus != STATUS_SUCCESS) + { + return ntStatus; + } + + NT_FRE_ASSERT( + NT_SUCCESS( + ObReferenceObjectByHandle( + ntHandle.get(), + THREAD_ALL_ACCESS, + nullptr, + KernelMode, + reinterpret_cast(&obHandle), + nullptr))); + + Thread.NtHandle = wistd::move(ntHandle); + Thread.ObHandle = wistd::move(obHandle); + +#else + wil::unique_handle thread{ CreateThread(nullptr, 0, StartRoutine, Context, 0, nullptr) }; + + if (!thread) + { + return NTSTATUS_FROM_WIN32(GetLastError()); + } + + Thread = wistd::move(thread); +#endif + + return STATUS_SUCCESS; +} + +void +EnlThreadSetPriority( + unique_thread & Thread, + ENL_THREAD_PRIORITY Priority +) +{ +#ifdef _KERNEL_MODE + // KeSetBasePriorityThread does not take the actual priority, but an increment + // to be added to the current base priority. Calculate this value. + auto const increment = Priority - (LOW_REALTIME_PRIORITY + LOW_PRIORITY) / 2; + KeSetBasePriorityThread(Thread.ObHandle.get(), increment); +#else + SetThreadPriority(Thread.get(), Priority); +#endif +} + +_Use_decl_annotations_ +void +EnlThreadSetAffinity( + PGROUP_AFFINITY GroupAffinity, + PGROUP_AFFINITY PreviousAffinity +) +{ +#ifdef _KERNEL_MODE + KeSetSystemGroupAffinityThread(GroupAffinity, PreviousAffinity); +#else + SetThreadGroupAffinity(GetCurrentThread(), GroupAffinity, PreviousAffinity); +#endif +} + +_Use_decl_annotations_ +void +EnlThreadWaitForTermination( + unique_thread & Thread +) +{ +#ifdef _KERNEL_MODE + KeWaitForSingleObject( + Thread.ObHandle.get(), + KWAIT_REASON::Executive, + KernelMode, + FALSE, + nullptr); +#else + WaitForSingleObject( + Thread.get(), + INFINITE); +#endif +} diff --git a/network/netadaptercx/netvadapterlibrary/code/enlthreads.h b/network/netadaptercx/netvadapterlibrary/code/enlthreads.h new file mode 100644 index 00000000..062d728e --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/enlthreads.h @@ -0,0 +1,119 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +#include +// #include + +#ifdef _KERNEL_MODE + using ENL_START_ROUTINE = KSTART_ROUTINE; + using ENL_THREAD_ROUTINE_RETURN = VOID; + using ENL_THREAD = PKTHREAD; + // static const EC_THREAD EC_THREAD_INVALID = nullptr; + using ENL_THREAD_PRIORITY = LONG; + // #define EC_INVALID_THREAD_PRIORITY MAXLONG + + using unique_zw_handle = wil::unique_any; + using unique_pkthread = wil::unique_any; + using unique_pkevent = wil::unique_any; + using unique_completionport = wil::unique_any; + + struct unique_thread + { + unique_zw_handle + NtHandle; + + unique_pkthread + ObHandle; + + operator bool( + void + ) const; + + void reset( + ); + }; +#else + +#ifndef NOTHING +#define NOTHING +#endif + +#ifndef AFFINITY_MASK +#define AFFINITY_MASK(n) ((KAFFINITY)1 << (n)) +#endif + +typedef struct _NDTBUS_POWER_INTERFACE_STANDARD +{ +} NDTBUS_POWER_INTERFACE_STANDARD; + +_IRQL_requires_same_ +typedef DWORD (WINAPI ENL_START_ROUTINE)( + LPVOID lpThreadParameter +); +using ENL_THREAD_ROUTINE_RETURN = DWORD; +using ENL_THREAD = DWORD; +// static const EC_THREAD EC_THREAD_INVALID = 0; +using ENL_THREAD_PRIORITY = int; +// #define EC_INVALID_THREAD_PRIORITY THREAD_PRIORITY_ERROR_RETURN +using unique_thread = wil::unique_handle; + +#define KeGetProcessorIndexFromNumber(_processor) (_processor)->Number +#define KeMemoryBarrier() MemoryBarrier() + +inline +NTSTATUS +KeGetProcessorNumberFromIndex ( + _In_ ULONG ProcIndex, + _Out_ PPROCESSOR_NUMBER ProcNumber + ) +{ + ProcNumber->Number = static_cast(ProcIndex); + ProcNumber->Group = 0; + ProcNumber->Reserved = 0; + + return STATUS_SUCCESS; +} + +inline +VOID +KeQueryNodeActiveAffinity ( + __in USHORT NodeNumber, + __out_opt PGROUP_AFFINITY Affinity, + __out_opt PUSHORT Count +) +{ + UNREFERENCED_PARAMETER(NodeNumber); + UNREFERENCED_PARAMETER(Count); + + GetThreadGroupAffinity(GetCurrentThread(), Affinity); +} +#endif + +ENL_THREAD +EnlGetCurrentThread( + void +); + +NTSTATUS +EnlThreadCreate( + _In_ ENL_START_ROUTINE StartRoutine, + _In_opt_ void * Context, + _Out_ unique_thread & Thread +); + +void +EnlThreadSetPriority( + _In_ unique_thread & Thread, + _In_ ENL_THREAD_PRIORITY Priority +); + +void +EnlThreadSetAffinity( + _In_ PGROUP_AFFINITY GroupAffinity, + _Out_opt_ PGROUP_AFFINITY PreviousAffinity +); + +void +EnlThreadWaitForTermination( + _In_ unique_thread & Thread +); diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.cpp b/network/netadaptercx/netvadapterlibrary/code/memory.cpp new file mode 100644 index 00000000..6d23f3bc --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/memory.cpp @@ -0,0 +1,77 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#include "pch.hpp" +#include "memory.h" +#include +#include "trace.h" +#include "memory.tmh" + +NTSTATUS +Memory::Initialize( + NETMEMORYCOLLECTION MemoryCollection, + size_t BufferSize +) +{ + m_memoryCollection = MemoryCollection; + + for (size_t i = 0; i < PREALLOCATED_BUFFERS_COUNT; i++) + { + NET_MEMORY_CONFIG memoryConfig{}; + NET_MEMORY_CONFIG_INIT( + &memoryConfig, + m_buffers[i].VirtualAddress, + BufferSize); + + RETURN_IF_NOT_STATUS_SUCCESS( + NetMemoryCreate( + MemoryCollection, + &memoryConfig, + &m_buffers[i].MemoryId + )); + + m_buffersReadyToUse[i] = &m_buffers[i]; + } + + m_lastBufferToUse = PREALLOCATED_BUFFERS_COUNT; + return STATUS_SUCCESS; +} + +void +Memory::ReleaseAllMappings( + void +) +{ + for (size_t i = 0; i < PREALLOCATED_BUFFERS_COUNT; i++) + { + NetMemoryDestroy(m_memoryCollection, m_buffers[i].MemoryId); + } + + m_lastBufferToUse = 0; + RtlZeroMemory(m_buffersReadyToUse, sizeof(m_buffersReadyToUse)); +} + +MemoryBuffer* +Memory::PopAvailableBuffer( + void +) +{ + KAcquireSpinLock lock{ m_spinLock }; + + if (m_lastBufferToUse == 0) + { + return nullptr; + } + + return m_buffersReadyToUse[--m_lastBufferToUse]; +} + +void +Memory::ReturnBuffer( + MemoryBuffer* Buffer +) +{ + KAcquireSpinLock lock{ m_spinLock }; + + NT_FRE_ASSERT(m_lastBufferToUse < PREALLOCATED_BUFFERS_COUNT); + + m_buffersReadyToUse[m_lastBufferToUse++] = Buffer; +} diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.h b/network/netadaptercx/netvadapterlibrary/code/memory.h new file mode 100644 index 00000000..b7ed654d --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/memory.h @@ -0,0 +1,59 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "adapter.h" +#include + +static const size_t PREALLOCATED_BUFFERS_COUNT = 128; + +struct MemoryBuffer +{ + NET_MEMORY_ID + MemoryId; + + BYTE + VirtualAddress[MAX_RX_BUFFER_SIZE]; +}; + +class Memory +{ +public: + + NTSTATUS + Initialize( + NETMEMORYCOLLECTION MemoryCollection, + size_t BufferSize + ); + + MemoryBuffer* + PopAvailableBuffer( + void + ); + + void + ReturnBuffer( + MemoryBuffer* Buffer + ); + + void + ReleaseAllMappings( + void + ); + +private: + NETMEMORYCOLLECTION + m_memoryCollection; + + MemoryBuffer + m_buffers[PREALLOCATED_BUFFERS_COUNT]; + + MemoryBuffer* + m_buffersReadyToUse[PREALLOCATED_BUFFERS_COUNT]; + + size_t + m_lastBufferToUse; + + KSpinLock + m_spinLock{}; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(Memory, GetMemoryFromHandle); diff --git a/network/netadaptercx/netvadapterlibrary/code/net/netpacketlibrary.h b/network/netadaptercx/netvadapterlibrary/code/net/netpacketlibrary.h new file mode 100644 index 00000000..b5e34518 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/net/netpacketlibrary.h @@ -0,0 +1,85 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#include + +// +// Following are some helper APIs for common ring manipulations. +// They are all implemented using iterator +// + +inline +SIZE_T +GetTxPacketDataLength( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + SIZE_T length = 0; + + for (NET_RING_FRAGMENT_ITERATOR fi = NetPacketIteratorGetFragments(Iterator); + NetFragmentIteratorHasAny(&fi); + NetFragmentIteratorAdvance(&fi)) + { + NET_FRAGMENT* fragment = NetFragmentIteratorGetFragment(&fi); + length += (SIZE_T)fragment->ValidLength; + } + + return length; +} + +inline +VOID +CompleteTxPacketsBatch( + _In_ NET_RING_COLLECTION const* Rings, + _In_ UINT32 BatchSize +) +{ + UINT32 packetCount = 0; + + NET_RING_PACKET_ITERATOR pi = NetRingGetDrainPackets(Rings); + + while (NetPacketIteratorHasAny(&pi)) + { + NET_PACKET* packet = NetPacketIteratorGetPacket(&pi); + + // this function uses Scratch field as the bit for testing completion + if (!packet->Scratch) + { + break; + } + + packetCount++; + + NET_RING_FRAGMENT_ITERATOR fi = NetPacketIteratorGetFragments(&pi); + NetFragmentIteratorAdvanceToTheEnd(&fi); + + NetPacketIteratorAdvance(&pi); + + if (packetCount >= BatchSize) + { + NetPacketIteratorSet(&pi); + Rings->Rings[NetRingTypeFragment]->BeginIndex = NetFragmentIteratorGetIndex(&fi); + } + } +} + +inline +void +CancelRxPackets( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING_PACKET_ITERATOR pi = NetRingGetAllPackets(Rings); + + for (; NetPacketIteratorHasAny(&pi); NetPacketIteratorAdvance(&pi)) + { + NetPacketIteratorGetPacket(&pi)->Ignore = 1; + } + + NetPacketIteratorSet(&pi); + + NET_RING_FRAGMENT_ITERATOR fi = NetRingGetAllFragments(Rings); + NetFragmentIteratorAdvanceToTheEnd(&fi); + NetFragmentIteratorSet(&fi); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/net/netringiterator.h b/network/netadaptercx/netvadapterlibrary/code/net/netringiterator.h new file mode 100644 index 00000000..fb010751 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/net/netringiterator.h @@ -0,0 +1,281 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#include + +typedef struct _NET_RING_ITERATOR +{ + + NET_RING_COLLECTION const* + Rings; + + UINT32* const + IndexToSet; + + UINT32 + Index; + + UINT32 const + End; + +} NET_RING_ITERATOR; + +typedef struct _NET_RING_PACKET_ITERATOR +{ + + NET_RING_ITERATOR + Iterator; + +} NET_RING_PACKET_ITERATOR; + +typedef struct _NET_RING_FRAGMENT_ITERATOR +{ + + NET_RING_ITERATOR + Iterator; + +} NET_RING_FRAGMENT_ITERATOR; + + +inline +NET_RING_PACKET_ITERATOR +NetRingGetPostPackets( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypePacket]; + NET_RING_PACKET_ITERATOR iterator = { + Rings, &ring->NextIndex, ring->NextIndex, ring->EndIndex, + }; + + return iterator; +} + +inline +NET_RING_PACKET_ITERATOR +NetRingGetDrainPackets( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypePacket]; + NET_RING_PACKET_ITERATOR iterator = { + Rings, &ring->BeginIndex, ring->BeginIndex, ring->NextIndex, + }; + + return iterator; +} + +inline +NET_RING_PACKET_ITERATOR +NetRingGetAllPackets( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypePacket]; + NET_RING_PACKET_ITERATOR iterator = { + Rings, &ring->BeginIndex, ring->BeginIndex, ring->EndIndex, + }; + + return iterator; +} + +inline +NET_PACKET* +NetPacketIteratorGetPacket( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + return NetRingGetPacketAtIndex( + Iterator->Iterator.Rings->Rings[NetRingTypePacket], + Iterator->Iterator.Index); +} + +inline +UINT32 +NetPacketIteratorGetIndex( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + return Iterator->Iterator.Index; +} + +inline +BOOLEAN +NetPacketIteratorHasAny( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + return Iterator->Iterator.Index != Iterator->Iterator.End; +} + +inline +UINT32 +NetPacketIteratorGetCount( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + NET_RING const* ring = Iterator->Iterator.Rings->Rings[NetRingTypePacket]; + + return (Iterator->Iterator.End - Iterator->Iterator.Index) & ring->ElementIndexMask; +} + +inline +void +NetPacketIteratorAdvance( + _In_ NET_RING_PACKET_ITERATOR* Iterator +) +{ + Iterator->Iterator.Index = NetRingIncrementIndex( + Iterator->Iterator.Rings->Rings[NetRingTypePacket], + Iterator->Iterator.Index); +} + +inline +void +NetPacketIteratorAdvanceToTheEnd( + _In_ NET_RING_PACKET_ITERATOR* Iterator +) +{ + Iterator->Iterator.Index = Iterator->Iterator.End; +} + +inline +void +NetPacketIteratorSet( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + *Iterator->Iterator.IndexToSet + = Iterator->Iterator.Index; +} + + +inline +NET_RING_FRAGMENT_ITERATOR +NetPacketIteratorGetFragments( + _In_ NET_RING_PACKET_ITERATOR const* Iterator +) +{ + NET_RING const* ring = Iterator->Iterator.Rings->Rings[NetRingTypeFragment]; + NET_PACKET const* packet = NetPacketIteratorGetPacket(Iterator); + UINT32 const end = NetRingIncrementIndex(ring, + packet->FragmentIndex + packet->FragmentCount - 1); + NET_RING_FRAGMENT_ITERATOR iterator = { + Iterator->Iterator.Rings, NULL, packet->FragmentIndex, end, + }; + + return iterator; +} + +inline +NET_RING_FRAGMENT_ITERATOR +NetRingGetPostFragments( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypeFragment]; + NET_RING_FRAGMENT_ITERATOR iterator = { + Rings, &ring->NextIndex, ring->NextIndex, ring->EndIndex, + }; + + return iterator; +} + +inline +NET_RING_FRAGMENT_ITERATOR +NetRingGetDrainFragments( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypeFragment]; + NET_RING_FRAGMENT_ITERATOR iterator = { + Rings, &ring->BeginIndex, ring->BeginIndex, ring->NextIndex, + }; + + return iterator; +} + +inline +NET_RING_FRAGMENT_ITERATOR +NetRingGetAllFragments( + _In_ NET_RING_COLLECTION const* Rings +) +{ + NET_RING* ring = Rings->Rings[NetRingTypeFragment]; + NET_RING_FRAGMENT_ITERATOR iterator = { + Rings, &ring->BeginIndex, ring->BeginIndex, ring->EndIndex, + }; + + return iterator; +} + +inline +NET_FRAGMENT* +NetFragmentIteratorGetFragment( + _In_ NET_RING_FRAGMENT_ITERATOR const* Iterator +) +{ + return NetRingGetFragmentAtIndex( + Iterator->Iterator.Rings->Rings[NetRingTypeFragment], + Iterator->Iterator.Index); +} + +inline +UINT32 +NetFragmentIteratorGetIndex( + _In_ NET_RING_FRAGMENT_ITERATOR const* Iterator +) +{ + return Iterator->Iterator.Index; +} + +inline +BOOLEAN +NetFragmentIteratorHasAny( + _In_ NET_RING_FRAGMENT_ITERATOR const* Iterator +) +{ + return Iterator->Iterator.Index != Iterator->Iterator.End; +} + +inline +UINT32 +NetFragmentIteratorGetCount( + _In_ NET_RING_FRAGMENT_ITERATOR const* Iterator +) +{ + NET_RING const* ring = Iterator->Iterator.Rings->Rings[NetRingTypeFragment]; + + return (Iterator->Iterator.End - Iterator->Iterator.Index) & ring->ElementIndexMask; +} + +inline +void +NetFragmentIteratorAdvance( + _In_ NET_RING_FRAGMENT_ITERATOR* Iterator +) +{ + Iterator->Iterator.Index = NetRingIncrementIndex( + Iterator->Iterator.Rings->Rings[NetRingTypeFragment], + Iterator->Iterator.Index); +} + +inline +void +NetFragmentIteratorAdvanceToTheEnd( + _In_ NET_RING_FRAGMENT_ITERATOR* Iterator +) +{ + Iterator->Iterator.Index = Iterator->Iterator.End; +} + +inline +void +NetFragmentIteratorSet( + _In_ NET_RING_FRAGMENT_ITERATOR const* Iterator +) +{ + *(Iterator->Iterator.IndexToSet) + = Iterator->Iterator.Index; +} diff --git a/network/netadaptercx/netvadapterlibrary/code/net/umxfilter.h b/network/netadaptercx/netvadapterlibrary/code/net/umxfilter.h new file mode 100644 index 00000000..a6a019e4 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/net/umxfilter.h @@ -0,0 +1,268 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xfilter.h + +Abstract: + + Header file for the address filtering library for NDIS MAC's. + +Author: + +Environment: + +Notes: + + None. + +Revision History: + +--*/ + +#ifndef _X_FILTER_DEFS_ +#define _X_FILTER_DEFS_ + +#pragma once + +#define ETH_LENGTH_OF_ADDRESS 6 + + +// +// ZZZ This is a little-endian specific check. +// +#define ETH_IS_MULTICAST(Address) \ + (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x01)) + + +// +// Check whether an address is broadcast. +// +#define ETH_IS_BROADCAST(Address) \ + ((((PUCHAR)(Address))[0] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[1] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[2] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[3] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[4] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[5] == ((UCHAR)0xff))) + + +// +// This macro will compare network addresses. +// +// A - Is a network address. +// +// B - Is a network address. +// +// Result - The result of comparing two network address. +// +// Result < 0 Implies the B address is greater. +// Result > 0 Implies the A element is greater. +// Result = 0 Implies equality. +// +// Note that this is an arbitrary ordering. There is not +// defined relation on network addresses. This is ad-hoc! +// +// +#define ETH_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ +{ \ + if (*(ULONG UNALIGNED *)&(_A)[2] > \ + *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(ULONG UNALIGNED *)&(_A)[2] < \ + *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) > \ + *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) < \ + *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else \ + { \ + *(_Result) = 0; \ + } \ +} + +// +// This macro will compare network addresses. +// +// A - Is a network address. +// +// B - Is a network address. +// +// Result - The result of comparing two network address. +// +// Result != 0 Implies inequality. +// Result == 0 Implies equality. +// +// +#define ETH_COMPARE_NETWORK_ADDRESSES_EQ(_A,_B, _Result) \ +{ \ + if ((*(ULONG UNALIGNED *)&(_A)[2] == \ + *(ULONG UNALIGNED *)&(_B)[2]) && \ + (*(USHORT UNALIGNED *)(_A) == \ + *(USHORT UNALIGNED *)(_B))) \ + { \ + *(_Result) = 0; \ + } \ + else \ + { \ + *(_Result) = 1; \ + } \ +} + + +// +// This macro is used to copy from one network address to +// another. +// +#define ETH_COPY_NETWORK_ADDRESS(_D, _S) \ +{ \ + *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ + *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ +} + +#define TR_LENGTH_OF_FUNCTIONAL 4 +#define TR_LENGTH_OF_ADDRESS 6 + + +// +// Only the low 32 bits of the functional/group address +// are needed since the upper 16 bits is always c0-00. +// +typedef ULONG TR_FUNCTIONAL_ADDRESS; +typedef ULONG TR_GROUP_ADDRESS; + + +#define TR_IS_NOT_DIRECTED(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ +} + +#define TR_IS_FUNCTIONAL(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)(((_Address)[0] & 0x80) && \ + !((_Address)[2] & 0x80)); \ +} + +// +// +#define TR_IS_GROUP(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & (_Address)[2] & 0x80); \ +} + +// +// +#define TR_IS_SOURCE_ROUTING(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ +} + +// +// Check for NDIS_PACKET_TYPE_MAC_FRAME +// +#define TR_IS_MAC_FRAME(_PacketHeader) ((((PUCHAR)_PacketHeader)[1] & 0xFC) == 0) + + +// +// Check whether an address is broadcast. This is a little-endian check. +// +#define TR_IS_BROADCAST(_Address, _Result) \ +{ \ + *(_Result) = (BOOLEAN)(((*(UNALIGNED USHORT *)&(_Address)[0] == 0xFFFF) || \ + (*(UNALIGNED USHORT *)&(_Address)[0] == 0x00C0)) && \ + (*(UNALIGNED ULONG *)&(_Address)[2] == 0xFFFFFFFF));\ +} + + +// +// This macro will compare network addresses. +// +// A - Is a network address. +// +// B - Is a network address. +// +// Result - The result of comparing two network address. +// +// Result < 0 Implies the B address is greater. +// Result > 0 Implies the A element is greater. +// Result = 0 Implies equality. +// +// Note that this is an arbitrary ordering. There is not +// defined relation on network addresses. This is ad-hoc! +// +// +#define TR_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ +{ \ + if (*(ULONG UNALIGNED *)&(_A)[2] > \ + *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(ULONG UNALIGNED *)&(_A)[2] < \ + *(ULONG UNALIGNED *)&(_B)[2]) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) > \ + *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = 1; \ + } \ + else if (*(USHORT UNALIGNED *)(_A) < \ + *(USHORT UNALIGNED *)(_B)) \ + { \ + *(_Result) = (UINT)-1; \ + } \ + else \ + { \ + *(_Result) = 0; \ + } \ +} + +// +// This macro will compare network addresses. +// +// A - Is a network address. +// +// B - Is a network address. +// +// Result - The result of comparing two network address. +// +// Result != 0 Implies inequality. +// Result == 0 Implies equality. +// +// +#define TR_COMPARE_NETWORK_ADDRESSES_EQ(_A, _B, _Result) \ +{ \ + if ((*(ULONG UNALIGNED *)&(_A)[2] == *(ULONG UNALIGNED *)&(_B)[2]) && \ + (*(USHORT UNALIGNED *)&(_A)[0] == *(USHORT UNALIGNED *)&(_B)[0])) \ + { \ + *(_Result) = 0; \ + } \ + else \ + { \ + *(_Result) = 1; \ + } \ +} + + +// +// This macro is used to copy from one network address to +// another. +// +#define TR_COPY_NETWORK_ADDRESS(_D, _S) \ +{ \ + *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ + *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = \ + *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ +} + +#endif // _X_FILTER_DEFS_ diff --git a/network/netadaptercx/netvadapterlibrary/code/pch.hpp b/network/netadaptercx/netvadapterlibrary/code/pch.hpp new file mode 100644 index 00000000..cf2f0f22 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/pch.hpp @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +#include + +#ifndef _KERNEL_MODE +// This is a user-mode driver +#include + +#else +// This is a kernel-mode driver +#include +#define NTSTRSAFE_LIB +#include +#endif + +// This is a common WDF header (for both KMDF and UMDF) +#include + +#include +//#include +#include "net/netringiterator.h" +#include "net/netpacketlibrary.h" +#include +#include +#include +#include +#include + +#include "enlthreads.h" +#include "enl.h" + +#include "trace.h" + diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.cpp b/network/netadaptercx/netvadapterlibrary/code/queue.cpp new file mode 100644 index 00000000..f4a12c2a --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/queue.cpp @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" + +#include + +#include "queue.h" + +NetvQueue::NetvQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter, + NET_RING_COLLECTION const * Rings +) + : m_handle{Handle} + , m_adapter{Adapter} + , m_rings{Rings} +{ +} + +NET_RING * +NetvQueue::GetPacketRing( + void +) +{ + return NetRingCollectionGetPacketRing(m_rings); +} + +NET_RING * +NetvQueue::GetFragmentRing( + void +) +{ + return NetRingCollectionGetFragmentRing(m_rings); +} + +NET_RING * +NetvQueue::GetNetMemoryReturnRing( + void +) +{ + return NetRingCollectionGetFragmentReturnContextRing(m_rings); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.h b/network/netadaptercx/netvadapterlibrary/code/queue.h new file mode 100644 index 00000000..64012298 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/queue.h @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#pragma once + +class NetvAdapter; +struct ENLP_QUEUE; + +class NetvQueue +{ + +public: + + NetvQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter, + NET_RING_COLLECTION const * Rings + ); + + NET_RING * + GetPacketRing( + void + ); + + NET_RING * + GetFragmentRing( + void + ); + + NET_RING * + GetNetMemoryReturnRing( + void + ); + + NETPACKETQUEUE const + m_handle{WDF_NO_HANDLE}; + + NetvAdapter & + m_adapter; + + NET_RING_COLLECTION const * + m_rings; + + ENLP_QUEUE * + EnlQueueHandle; + +}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h new file mode 100644 index 00000000..3f226355 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h @@ -0,0 +1,67 @@ + +#pragma once + +#include + +class KCriticalRegion +{ +public: + + PAGED KCriticalRegion() : m_Entered(false) { } + + PAGED ~KCriticalRegion() { if (m_Entered) Leave(); } + + KCriticalRegion(KCriticalRegion &) = delete; + KCriticalRegion &operator=(KCriticalRegion &) = delete; + + PAGED void Enter() + { + ASSERT(m_Entered == false); + UnbalancedEnter(); + m_Entered = true; + } + + PAGED void Leave() + { + ASSERT(m_Entered == true); + m_Entered = false; + UnbalancedLeave(); + } + + static PAGED void UnbalancedEnter() + { +#if _KERNEL_MODE + KeEnterCriticalRegion(); +#endif + } + + static PAGED void UnbalancedLeave() + { +#if _KERNEL_MODE + KeLeaveCriticalRegion(); +#endif + } + +private: + + bool m_Entered; +}; + +struct KDefaultRegion +{ + void Enter() { } + void Leave() { } +}; + +struct KIrqlRegion +{ + KIrqlRegion() { } + ~KIrqlRegion() { } + + void Enter() { } + void Leave() { } + + KIRQL m_OldIrql; +}; + + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h new file mode 100644 index 00000000..d90e6056 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h @@ -0,0 +1,31 @@ + +#pragma once + +#include + +template +struct KRTL_CLASS NdisDebugBlock +{ +#if DBG + PAGED ~NdisDebugBlock() + { + ASSERT_VALID(); + Signature |= 0x80; + } +#endif + + _IRQL_requires_max_(HIGH_LEVEL) + NONPAGEDX bool ASSERT_VALID() const + { +#if DBG + return NT_VERIFY(Signature == SIGNATURE); +#else + return true; +#endif + } + +private: +#if DBG + ULONG Signature = SIGNATURE; +#endif +}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h new file mode 100644 index 00000000..1e21c0f2 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h @@ -0,0 +1,114 @@ + +#pragma once + +#include +#include + +class KRTL_CLASS KLockHolder +{ +private: + + enum { Unlocked, Shared, Exclusive } m_State; + +public: + + PAGED KLockHolder(KPushLockBase &lock) : m_Lock(lock), m_State(Unlocked) { } + PAGED ~KLockHolder() + { + switch (m_State) + { + case Shared: + ReleaseShared(); + break; + case Exclusive: + ReleaseExclusive(); + break; + } + } + + KLockHolder(KLockHolder &) = delete; + KLockHolder &operator=(KLockHolder &) = delete; + + _IRQL_requires_(PASSIVE_LEVEL) + PAGED void AcquireShared() + { + m_Region.Enter(); + ASSERT(m_State == Unlocked); + m_Lock.AcquireShared(); + m_State = Shared; + } + + _IRQL_requires_(PASSIVE_LEVEL) + PAGED void ReleaseShared() + { + ASSERT(m_State == Shared); + m_Lock.ReleaseShared(); + m_State = Unlocked; + m_Region.Leave(); + } + + _IRQL_requires_(PASSIVE_LEVEL) + PAGED void AcquireExclusive() + { + m_Region.Enter(); + ASSERT(m_State == Unlocked); + m_Lock.AcquireExclusive(); + m_State = Exclusive; + } + + _IRQL_requires_(PASSIVE_LEVEL) + PAGED void ReleaseExclusive() + { + ASSERT(m_State == Exclusive); + m_Lock.ReleaseExclusive(); + m_State = Unlocked; + m_Region.Leave(); + } + +private: + + KPushLockBase &m_Lock; + KCriticalRegion m_Region; +}; + +class KRTL_CLASS KLockThisShared : protected KLockHolder +{ +public: + + PAGED KLockThisShared(KPushLockBase &lock) : KLockHolder(lock) + { + AcquireShared(); + } + + PAGED void Acquire() + { + AcquireShared(); + } + + PAGED void Release() + { + ReleaseShared(); + } +}; + +class KRTL_CLASS KLockThisExclusive : protected KLockHolder +{ +public: + + PAGED KLockThisExclusive(KPushLockBase &lock) : KLockHolder(lock) + { + AcquireExclusive(); + } + + PAGED void Acquire() + { + AcquireExclusive(); + } + + PAGED void Release() + { + ReleaseExclusive(); + } +}; + + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KMacros.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KMacros.h new file mode 100644 index 00000000..631c08bf --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KMacros.h @@ -0,0 +1,84 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#include + +#ifdef _KERNEL_MODE + +// nullptr_t is normally automatically defined by the CRT headers, but it +// doesn't get included by kernel code. +namespace std { typedef decltype(__nullptr) nullptr_t; } +using ::std::nullptr_t; + +// The stddef.h used for kernel code has the old offsetof macro. +// Let's use the new one instead. +#undef offsetof +#define offsetof(s,m) __builtin_offsetof(s,m) + +#endif // _KERNEL_MODE + +#define BEGIN_MACRO do { +#define END_MACRO } while (0) + +#ifdef _KERNEL_MODE +#define CODE_SEG(segment) __declspec(code_seg(segment)) +#else +#define CODE_SEG(segment) +#endif + +#ifndef KRTL_PAGE_SEGMENT +# define KRTL_PAGE_SEGMENT "PAGE" +#endif +#ifndef KRTL_INIT_SEGMENT +# define KRTL_INIT_SEGMENT "INIT" +#endif +#ifndef KRTL_NONPAGED_SEGMENT +# define KRTL_NONPAGED_SEGMENT ".text" +#endif + +/// Use on pageable functions. +#define PAGED CODE_SEG(KRTL_PAGE_SEGMENT) _IRQL_always_function_max_(PASSIVE_LEVEL) + +/// Use on pageable functions, where you don't want the SAL IRQL annotation to say PASSIVE_LEVEL. +#define PAGEDX CODE_SEG(KRTL_PAGE_SEGMENT) + +/// Use on code in the INIT segment. (Code is discarded after DriverEntry returns.) +#define INITCODE CODE_SEG(KRTL_INIT_SEGMENT) + +/// Use on code that must always be locked in memory. +#define NONPAGED CODE_SEG(KRTL_NONPAGED_SEGMENT) _IRQL_requires_max_(DISPATCH_LEVEL) + +/// Use on code that must always be locked in memory, where you don't want SAL IRQL annotations. +#define NONPAGEDX CODE_SEG(KRTL_NONPAGED_SEGMENT) + +#ifndef _KERNEL_MODE + +#ifndef PAGED_CODE +#define PAGED_CODE() (void)0 +#endif // PAGED_CODE + +#endif // _KERNEL_MODE + +/// Use on classes or structs. Class member functions & compiler-generated code +/// will default to the PAGE segment. You can override any member function with `NONPAGED`. +#define KRTL_CLASS CODE_SEG(KRTL_PAGE_SEGMENT) __declspec(empty_bases) + +/// Use on classes or structs. Class member functions & compiler-generated code +/// will default to the NONPAGED segment. You can override any member function with `PAGED`. +#define KRTL_CLASS_DPC_ALLOC __declspec(empty_bases) + +enum CallRunMode +{ + // This call should complete synchronously on the current thread + RunSynchronous, + // This call should return immediately, and complete the operation in a background thread + RunAsynchronous, + // This call can return immediately, OR complete synchronously + // (Use this if you're running on a workitem thread already, and you + // don't mind if the callee uses your thread to do its work, but you + // can tolerate the call completing asynchronously if the callee doesn't + // need your thread.) + RunAsynchronousButOkayToBlock, +}; + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h new file mode 100644 index 00000000..28c832bd --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h @@ -0,0 +1,203 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#include + +#if UMDF_DRIVER == 0 +#include +#endif + +#include +#include + +// +// KALLOCATOR KALLOCATOR_NONPAGED +// ---------------------------------------+--------------------+--------------------+ +// The object must be allocated at IRQL: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | +// ---------------------------------------+--------------------+--------------------+ +// The object must be freed at IRQL: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | +// ---------------------------------------+--------------------+--------------------+ +// Constructor & destructor run at: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | +// ---------------------------------------+--------------------+--------------------+ +// Member functions default to: | PAGED code segment | .text code segment | +// ---------------------------------------+--------------------+--------------------+ +// Compiler-generated code goes to: | PAGED code segment | .text code segment | +// ---------------------------------------+--------------------+--------------------+ +// The memory is allocated from pool: | paged or nonpaged | paged or nonpaged | +// ---------------------------------------+--------------------+--------------------+ +// + +PAGED void *operator new(size_t s, std::nothrow_t const &, ULONG tag); +PAGED void operator delete(void *p, ULONG tag); +PAGED void *operator new[](size_t s, std::nothrow_t const &, ULONG tag); +PAGED void operator delete[](void *p, ULONG tag); +PAGEDX void __cdecl operator delete[](void *p); +void __cdecl operator delete(void *p); + +template +struct KRTL_CLASS KALLOCATION_TAG +{ + static const ULONG AllocationTag = TAG; + static const ULONG AllocationArena = ARENA; +}; + +template +struct KRTL_CLASS_DPC_ALLOC KALLOCATION_TAG_DPC_ALLOC +{ + static const ULONG AllocationTag = TAG; + static const ULONG AllocationArena = ARENA; +}; + +template +struct KRTL_CLASS KALLOCATOR : public KALLOCATION_TAG +{ + // Scalar new & delete + + PAGED void *operator new(size_t cb, std::nothrow_t const &) + { + PAGED_CODE(); + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); + } + + PAGED void operator delete(void *p) + { + PAGED_CODE(); + + if (p != nullptr) + { + ExFreePoolWithTag(p, TAG); + } + } + + // Scalar new with bonus bytes + + PAGED void *operator new(size_t cb, std::nothrow_t const &, size_t extraBytes) + { + PAGED_CODE(); + + auto size = cb + extraBytes; + + // Overflow check + if (size < cb) + return nullptr; + + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), size, TAG); + } + + // Array new & delete + + PAGED void *operator new[](size_t cb, std::nothrow_t const &) + { + PAGED_CODE(); + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); + } + + PAGED void operator delete[](void *p) + { + PAGED_CODE(); + + if (p != nullptr) + { + ExFreePoolWithTag(p, TAG); + } + } + + // Placement new & delete + + PAGED void *operator new(size_t n, void * p) + { + PAGED_CODE(); + UNREFERENCED_PARAMETER((n)); + return p; + } + + PAGED void operator delete(void *p1, void *p2) + { + PAGED_CODE(); + UNREFERENCED_PARAMETER((p1, p2)); + } +}; + +template +struct KRTL_CLASS_DPC_ALLOC KALLOCATOR_NONPAGED : public KALLOCATION_TAG_DPC_ALLOC +{ + // Scalar new & delete + + NONPAGED void *operator new(size_t cb, std::nothrow_t const &) + { + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); + } + + NONPAGED void operator delete(void *p) + { + if (p != nullptr) + { + ExFreePoolWithTag(p, TAG); + } + } + + // Scalar new with bonus bytes + + NONPAGED void *operator new(size_t cb, std::nothrow_t const &, size_t extraBytes) + { + auto size = cb + extraBytes; + + // Overflow check + if (size < cb) + return nullptr; + + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), size, TAG); + } + + // Array new & delete + + NONPAGED void *operator new[](size_t cb, std::nothrow_t const &) + { + #pragma warning( suppress : 4996 28751 ) + return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); + } + + NONPAGED void operator delete[](void *p) + { + if (p != nullptr) + { + ExFreePoolWithTag(p, TAG); + } + } + + // Placement new & delete + + NONPAGED void *operator new(size_t n, void * p) + { + UNREFERENCED_PARAMETER((n)); + return p; + } + + NONPAGED void operator delete(void *p1, void *p2) + { + UNREFERENCED_PARAMETER((p1, p2)); + } +}; + +template +struct KRTL_CLASS PAGED_OBJECT : + public KALLOCATOR, + public NdisDebugBlock +{ + +}; + +template +struct KRTL_CLASS NONPAGED_OBJECT : + public KALLOCATOR, + public NdisDebugBlock +{ + +}; + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h new file mode 100644 index 00000000..81c58071 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h @@ -0,0 +1,61 @@ + +#pragma once + +#include +#include + +typedef struct _KTHREAD *PKTHREAD; + +class KPushLockBase +{ +public: + + KPushLockBase() = default; + KPushLockBase(KPushLockBase &) = delete; + KPushLockBase & operator=(KPushLockBase &) = delete; + + PAGED void AcquireShared(); + + PAGED void ReleaseShared(); + + PAGED void AcquireExclusive(); + + PAGED void ReleaseExclusive(); + + PAGED void AssertLockHeld(); + + PAGED void AssertLockNotHeld(); + +protected: + + PAGED void InitializeInner(); + +private: + +#ifdef _KERNEL_MODE + EX_PUSH_LOCK m_Lock; +#else + SRWLOCK m_Lock; +#endif + +#if DBG + PKTHREAD m_ExclusiveOwner; +#endif +}; + +class KPushLock : public KPushLockBase +{ +public: + + PAGED KPushLock() noexcept; + + PAGED ~KPushLock(); +}; + +class KPushLockManualConstruct : public KPushLockBase +{ +public: + + PAGED void Initialize(); +}; + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h new file mode 100644 index 00000000..c344e7bb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h @@ -0,0 +1,157 @@ +#pragma once + +#include +#define WIN_ASSERT NT_ASSERT + +class KSpinLockBase +{ +protected: + + KSpinLockBase() = default; + + void InitializeBase() + { +#if _KERNEL_MODE + KeInitializeSpinLock(&m_lock); +#else + InitializeSRWLock(&m_lock); +#endif + } + +public: + + KSpinLockBase(KSpinLockBase&) = delete; + KSpinLockBase(KSpinLockBase&&) = delete; + KSpinLockBase& operator=(KSpinLockBase&) = delete; + KSpinLockBase& operator=(KSpinLockBase&&) = delete; + + _Requires_lock_not_held_(*this) + _Acquires_lock_(*this) + _IRQL_requires_max_(DISPATCH_LEVEL) + _IRQL_saves_ + _IRQL_raises_(DISPATCH_LEVEL) + KIRQL Acquire() + { +#if _KERNEL_MODE + KIRQL oldIrql; + KeAcquireSpinLock(&m_lock, &oldIrql); + return oldIrql; +#else + AcquireSRWLockExclusive(&m_lock); + return 0; +#endif + } + + _Requires_lock_held_(*this) + _Releases_lock_(*this) + _IRQL_requires_(DISPATCH_LEVEL) + void Release(_In_ KIRQL oldIrql) + { +#if _KERNEL_MODE + return KeReleaseSpinLock(&m_lock, oldIrql); +#else + UNREFERENCED_PARAMETER(oldIrql); + ReleaseSRWLockExclusive(&m_lock); +#endif + } + + _IRQL_requires_max_(DISPATCH_LEVEL) + bool IsAcquired() + { +#if _KERNEL_MODE + return !KeTestSpinLock(&m_lock); +#else + if (!TryAcquireSRWLockExclusive(&m_lock)) + return false; + + ReleaseSRWLockExclusive(&m_lock); + return true; +#endif + } + +private: + +#if _KERNEL_MODE + KSPIN_LOCK m_lock; +#else + SRWLOCK m_lock; +#endif +}; + +class KSpinLock : public KSpinLockBase +{ +public: + + KSpinLock() + { + InitializeBase(); + } +}; + +class KSpinLockManualConstruct : public KSpinLockBase +{ +public: + + KSpinLockManualConstruct() = default; + + void Initialize() + { + InitializeBase(); + } +}; + +class KAcquireSpinLock +{ +public: + + _Requires_lock_not_held_(lock) + _Acquires_lock_(lock) + _IRQL_requires_max_(DISPATCH_LEVEL) + _IRQL_raises_(DISPATCH_LEVEL) + KAcquireSpinLock(KSpinLockBase &lock) : + m_lock(lock) + { + Acquire(); + } + + _Requires_lock_held_(this->m_lock) + _Releases_lock_(this->m_lock) + _IRQL_requires_(DISPATCH_LEVEL) + ~KAcquireSpinLock() + { + if (IsAcquired()) + Release(); + } + + _Requires_lock_not_held_(this->m_lock) + _Acquires_lock_(this->m_lock) + _IRQL_requires_max_(DISPATCH_LEVEL) + _IRQL_raises_(DISPATCH_LEVEL) + void Acquire() + { + WIN_ASSERT(!IsAcquired()); + m_oldIrql = m_lock.Acquire(); + } + + _Requires_lock_held_(this->m_lock) + _Releases_lock_(this->m_lock) + _IRQL_requires_(DISPATCH_LEVEL) + void Release() + { + WIN_ASSERT(IsAcquired()); + m_lock.Release(m_oldIrql); + m_oldIrql = NOT_ACQUIRED; + } + + _IRQL_requires_max_(DISPATCH_LEVEL) + bool IsAcquired() + { + return m_oldIrql != NOT_ACQUIRED; + } + +private: + + static const KIRQL NOT_ACQUIRED = (KIRQL)-1; + KIRQL m_oldIrql = NOT_ACQUIRED; + KSpinLockBase &m_lock; +}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h new file mode 100644 index 00000000..d1287f5b --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h @@ -0,0 +1,172 @@ + +#pragma once + +#include + +#if _KERNEL_MODE +typedef wistd::integral_constant auto_reset_event_t; +#else +typedef wistd::integral_constant auto_reset_event_t; +#endif + +#if _KERNEL_MODE +typedef wistd::integral_constant manual_reset_event_t; +#else +typedef wistd::integral_constant manual_reset_event_t; +#endif + +#define WIN_VERIFY NT_VERIFY +#define WIN_ASSERT NT_ASSERT + +template +class KWaitEventBase +{ +public: + + KWaitEventBase() = default; + +#ifdef _KERNEL_MODE + NONPAGED ~KWaitEventBase() = default; +#else + NONPAGED ~KWaitEventBase() + { + WIN_ASSERT(m_event == nullptr); + } +#endif + + KWaitEventBase(KWaitEventBase &) = delete; + KWaitEventBase(KWaitEventBase &&) = delete; + KWaitEventBase & operator=(KWaitEventBase &) = delete; + KWaitEventBase & operator=(KWaitEventBase &&) = delete; + + _IRQL_requires_max_(DISPATCH_LEVEL) void Set() + { +#if _KERNEL_MODE + KeSetEvent(&m_event, 0, false); +#else + WIN_VERIFY(SetEvent(m_event)); +#endif + } + + _IRQL_requires_max_(DISPATCH_LEVEL) void Clear() + { +#if _KERNEL_MODE + KeClearEvent(&m_event); +#else + WIN_VERIFY(ResetEvent(m_event)); +#endif + } + + PAGED void Wait() + { +#if _KERNEL_MODE + // Not used at runtime, but might be useful during debugging + volatile LARGE_INTEGER SystemTime; + KeQuerySystemTime(const_cast(&SystemTime)); + + NTSTATUS NtStatus = KeWaitForSingleObject( + &m_event, Executive, KernelMode, FALSE, nullptr); + NT_VERIFY(NtStatus == STATUS_SUCCESS); +#else + ULONG r = WaitForSingleObject(m_event, INFINITE); + WIN_VERIFY(r == NO_ERROR); +#endif + } + + PAGED bool Test() + { +#if _KERNEL_MODE + return !!KeReadStateEvent(&m_event); +#else + ULONG r = WaitForSingleObject(m_event, 0); + WIN_VERIFY(r == WAIT_TIMEOUT || r == WAIT_OBJECT_0); + return (r == WAIT_OBJECT_0); +#endif + } + + NONPAGED bool TestNP() + { +#if _KERNEL_MODE + return !!KeReadStateEvent(&m_event); +#else + ULONG r = WaitForSingleObject(m_event, 0); + WIN_VERIFY(r == WAIT_TIMEOUT || r == WAIT_OBJECT_0); + return (r == WAIT_OBJECT_0); +#endif + } + +protected: + + PAGED void InitializeBase() + { +#if _KERNEL_MODE + KeInitializeEvent(&m_event, TEventType(), FALSE); +#else + m_event = CreateEventW(nullptr, TEventType(), false, nullptr); + WIN_VERIFY(m_event); +#endif + } + + NONPAGED void CleanupBase() + { +#ifndef _KERNEL_MODE + CloseHandle(m_event); + m_event = nullptr; +#endif + } + +private: + +#if _KERNEL_MODE + KEVENT m_event; +#else + HANDLE m_event; +#endif + +}; + +class KWaitEvent : public KWaitEventBase +{ +public: + + PAGED KWaitEvent() noexcept + { + InitializeBase(); + } + + NONPAGED ~KWaitEvent() + { + CleanupBase(); + } +}; + +class KWaitEventManualConstruct : public KWaitEventBase +{ +public: + + PAGED void Initialize() + { + InitializeBase(); + } + + PAGED void Cleanup() + { + CleanupBase(); + } +}; + + +class KAutoEvent : public KWaitEventBase +{ +public: + + PAGED KAutoEvent() noexcept + { + InitializeBase(); + } + + NONPAGED ~KAutoEvent() + { + CleanupBase(); + } +}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h b/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h new file mode 100644 index 00000000..45491006 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h @@ -0,0 +1,97 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#if UMDF_DRIVER == 0 +#include "pooltypes.h" +#endif + +#ifndef _KERNEL_MODE + +#if (NTDDI_VERSION >= NTDDI_WIN10_VB) && !defined(KRTL_USE_LEGACY_POOL_API) + +typedef _Enum_is_bitflag_ enum _EX_POOL_PRIORITY { + LowPoolPriority, + LowPoolPrioritySpecialPoolOverrun = 8, + LowPoolPrioritySpecialPoolUnderrun = 9, + NormalPoolPriority = 16, + NormalPoolPrioritySpecialPoolOverrun = 24, + NormalPoolPrioritySpecialPoolUnderrun = 25, + HighPoolPriority = 32, + HighPoolPrioritySpecialPoolOverrun = 40, + HighPoolPrioritySpecialPoolUnderrun = 41 +} EX_POOL_PRIORITY; + +typedef enum POOL_EXTENDED_PARAMETER_TYPE { + PoolExtendedParameterInvalidType = 0, + PoolExtendedParameterPriority, + PoolExtendedParameterMax +} POOL_EXTENDED_PARAMETER_TYPE, *PPOOL_EXTENDED_PARAMETER_TYPE; + +#define POOL_EXTENDED_PARAMETER_TYPE_BITS 8 +#define POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS 1 +#define POOL_EXTENDED_PARAMETER_RESERVED_BITS (64 - POOL_EXTENDED_PARAMETER_TYPE_BITS - POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS) + +#pragma warning(push) +#pragma warning(disable: 4201) // nameless struct/union +typedef struct DECLSPEC_ALIGN(8) POOL_EXTENDED_PARAMETER { + struct { + ULONG64 Type : POOL_EXTENDED_PARAMETER_TYPE_BITS; + ULONG64 Optional : POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS; + ULONG64 Reserved : POOL_EXTENDED_PARAMETER_RESERVED_BITS; + } DUMMYSTRUCTNAME; + + union { + ULONG64 Reserved2; + PVOID Reserved3; + EX_POOL_PRIORITY Priority; + } DUMMYUNIONNAME; +} POOL_EXTENDED_PARAMETER, *PPOOL_EXTENDED_PARAMETER; +#pragma warning(pop) + +typedef ULONG64 POOL_FLAGS; + +_Check_return_ +_Ret_maybenull_ +_Post_writable_byte_size_(NumberOfBytes) +PVOID +ExAllocatePool2 ( + _In_ POOL_FLAGS Flags, + _In_ SIZE_T NumberOfBytes, + _In_ ULONG Tag + ); + +_Check_return_ +_Ret_maybenull_ +_Post_writable_byte_size_(NumberOfBytes) +PVOID +ExAllocatePool3 ( + _In_ POOL_FLAGS Flags, + _In_ SIZE_T NumberOfBytes, + _In_ ULONG Tag, + _In_reads_opt_(ExtendedParameterCount) PPOOL_EXTENDED_PARAMETER ExtendedParameters, + _In_ ULONG ExtendedParametersCount + ); + +#endif // (NTDDI_VERSION >= NTDDI_WIN10_VB) && !defined(KRTL_USE_LEGACY_POOL_API) + +PVOID +ExAllocatePoolWithTag( + POOL_TYPE PoolType, + SIZE_T NumberOfBytes, + ULONG Tag + ); + +VOID +ExFreePoolWithTag( + _Pre_notnull_ __drv_freesMem(Mem) PVOID P, + _In_ ULONG Tag + ); + +VOID +ExFreePool( + _Pre_notnull_ __drv_freesMem(Mem) PVOID P + ); + +#endif // _KERNEL_MODE + diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h b/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h new file mode 100644 index 00000000..8bee9a72 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h @@ -0,0 +1,53 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#ifndef _KERNEL_MODE + +#include + +// +// Pool Allocation routines (in pool.c) +// +typedef _Enum_is_bitflag_ enum _POOL_TYPE { + NonPagedPool, + NonPagedPoolExecute = NonPagedPool, + PagedPool, + NonPagedPoolMustSucceed = NonPagedPool + 2, + DontUseThisType, + NonPagedPoolCacheAligned = NonPagedPool + 4, + PagedPoolCacheAligned, + NonPagedPoolCacheAlignedMustS = NonPagedPool + 6, + MaxPoolType, + + // + // Define base types for NonPaged (versus Paged) pool, for use in cracking + // the underlying pool type. + // + + NonPagedPoolBase = 0, + NonPagedPoolBaseMustSucceed = NonPagedPoolBase + 2, + NonPagedPoolBaseCacheAligned = NonPagedPoolBase + 4, + NonPagedPoolBaseCacheAlignedMustS = NonPagedPoolBase + 6, + + // + // Note these per session types are carefully chosen so that the appropriate + // masking still applies as well as MaxPoolType above. + // + + NonPagedPoolSession = 32, + PagedPoolSession = NonPagedPoolSession + 1, + NonPagedPoolMustSucceedSession = PagedPoolSession + 1, + DontUseThisTypeSession = NonPagedPoolMustSucceedSession + 1, + NonPagedPoolCacheAlignedSession = DontUseThisTypeSession + 1, + PagedPoolCacheAlignedSession = NonPagedPoolCacheAlignedSession + 1, + NonPagedPoolCacheAlignedMustSSession = PagedPoolCacheAlignedSession + 1, + + NonPagedPoolNx = 512, + NonPagedPoolNxCacheAligned = NonPagedPoolNx + 4, + NonPagedPoolSessionNx = NonPagedPoolNx + 32, + +} POOL_TYPE; + +#endif // _KERNEL_MODE + diff --git a/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp new file mode 100644 index 00000000..61c12ca3 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" +#include "adapter.h" +#include "rxqueue.h" +#include "memory.h" + +static +void +CheckForWakeFrame( + NetvRxQueue * rx +) +{ + NET_RING_FRAGMENT_ITERATOR fi = NetRingGetAllFragments(rx->m_rings); + + if (! NetFragmentIteratorHasAny(&fi)) + { + return; + } + + auto *fragment = NetFragmentIteratorGetFragment(&fi); + auto *rxVirtualAddress = NetExtensionGetFragmentVirtualAddress( + &rx->VirtualAddressExtension, + NetFragmentIteratorGetIndex(&fi)); + + auto *fragmentBuffer = reinterpret_cast(rxVirtualAddress->VirtualAddress) + fragment->Offset; + + fragment->ValidLength = EnlCopyWakeFrame( + NetvEnlMLink[rx->m_adapter.EnlIndex].LinkHandle[0], + fragmentBuffer, + fragment->Capacity); + + // If there was a pending wake frame mark this fragment as complete, the normal advance code will get to it + fragment->Scratch = fragment->ValidLength > 0 ? 1 : 0; + + rx->CheckedWakeFrame = true; +} + + +NetvRxQueue::NetvRxQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter +) + : NetvQueue{Handle, Adapter, NetRxQueueGetRingCollection(Handle)} +{ + NET_EXTENSION_QUERY extension; + + NET_EXTENSION_QUERY_INIT( + &extension, + NET_FRAGMENT_EXTENSION_VIRTUAL_ADDRESS_NAME, + NET_FRAGMENT_EXTENSION_VIRTUAL_ADDRESS_VERSION_1, + NetExtensionTypeFragment); + + NetRxQueueGetExtension(m_handle, &extension, &VirtualAddressExtension); + + NET_EXTENSION_QUERY_INIT( + &extension, + NET_PACKET_EXTENSION_RSC_NAME, + NET_PACKET_EXTENSION_RSC_VERSION_2, + NetExtensionTypePacket); + + NetRxQueueGetExtension(m_handle, &extension, &UdpRscExtension); + + NET_EXTENSION_QUERY_INIT( + &extension, + NET_PACKET_EXTENSION_CHECKSUM_NAME, + NET_PACKET_EXTENSION_CHECKSUM_VERSION_1, + NetExtensionTypePacket); + + NetRxQueueGetExtension(m_handle, &extension, &RxXSumExtension); + + if (Adapter.PreallocatedRxBuffers) + { + NET_EXTENSION_QUERY_INIT( + &extension, + NET_FRAGMENT_EXTENSION_NET_MEMORY_NAME, + NET_FRAGMENT_EXTENSION_NET_MEMORY_VERSION_1, + NetExtensionTypeFragment); + + NetRxQueueGetExtension(m_handle, &extension, &NetMemoryExtension); + + NET_EXTENSION_QUERY_INIT( + &extension, + NET_FRAGMENT_EXTENSION_RETURN_CONTEXT_NAME, + NET_FRAGMENT_EXTENSION_RETURN_CONTEXT_VERSION_1, + NetExtensionTypeFragment); + + NetRxQueueGetExtension(m_handle, &extension, &NetMemoryReturnContextExtensionIn); + } + + EnlQueueHandle = EnlCreateQueue(Handle, RX); +} + +_Use_decl_annotations_ +void +NetvRxQueue::Destroy( + void +) +{ + EnlDestroyQueue(EnlQueueHandle, RX); +} + +void +NetvRxQueue::Start( + void +) +{ + auto link = NetvEnlMLink[m_adapter.EnlIndex].LinkHandle[0]; + auto port = &link->Ports[m_adapter.EnlPortIndex]; + auto queue = &port->RxQueue[0]; + + WDFVERIFY(queue->State == Stopped); + + queue->QueueNext = queue->QueueEnd = 0U; + + EnlIndicateQueueState(EnlQueueHandle, Started); +} + +void +NetvRxQueue::Stop( + void +) +{ + EnlIndicateQueueState(EnlQueueHandle, Stopped); +} + +_Use_decl_annotations_ +void +NetvRxQueue::Advance( + void +) +{ + auto fr = GetFragmentRing(); + NET_RING_PACKET_ITERATOR pi = NetRingGetAllPackets(m_rings); + NET_RING_FRAGMENT_ITERATOR fi = NetRingGetAllFragments(m_rings); + + // Ideally this would run in EvtQueueStart, but at that point the receive buffers are not + // attached to the fragment yet + if (! CheckedWakeFrame) + { + CheckForWakeFrame(this); + } + + // Move begin index forward for all fragments with Scratch == 1, thus returning them to the OS since we're done processing them. + for (; NetFragmentIteratorHasAny(&fi) && NetPacketIteratorHasAny(&pi); NetPacketIteratorAdvance(&pi), NetFragmentIteratorAdvance(&fi)) + { + NET_FRAGMENT const * fragment = NetFragmentIteratorGetFragment(&fi); + if (! fragment->Scratch) + { + break; + } + } + + if (m_adapter.PreallocatedRxBuffers) + { + NET_RING* dataBufferRing = GetNetMemoryReturnRing(); + while (dataBufferRing->BeginIndex != dataBufferRing->EndIndex) + { + NET_FRAGMENT_RETURN_CONTEXT* netMemoryReturnContextOut = + NetRingGetFragmentReturnContextAtIndex( + dataBufferRing, + dataBufferRing->BeginIndex); + + MemoryBuffer* memoryBuffer = reinterpret_cast(netMemoryReturnContextOut->Handle); + GetMemoryFromHandle(m_adapter.m_preallocatedRxBuffers)->ReturnBuffer(memoryBuffer); + dataBufferRing->BeginIndex = NetRingIncrementIndex(dataBufferRing, dataBufferRing->BeginIndex); + } + } + + NetFragmentIteratorSet(&fi); + NetPacketIteratorSet(&pi); + EnlRingDoorBell(EnlQueueHandle, fr->EndIndex); +} + +_Use_decl_annotations_ +void +NetvRxQueue::Cancel( + void +) +{ + CancelRxPackets(m_rings); +} + +_Use_decl_annotations_ +void +NetvRxQueue::SetNotify( + bool NotificationEnabled +) +{ + EnlArmInterrupt(EnlQueueHandle, NotificationEnabled); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/rxqueue.h b/network/netadaptercx/netvadapterlibrary/code/rxqueue.h new file mode 100644 index 00000000..cf208def --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/rxqueue.h @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once +#include "queue.h" + +class NetvRxQueue final + : public NetvQueue +{ + +public: + + NetvRxQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter + ); + + void + Destroy( + void + ); + + void + Start( + void + ); + + void + Stop( + void + ); + + void + Advance( + void + ); + + void + Cancel( + void + ); + + void + SetNotify( + bool Enable + ); + + ENLP_QUEUE * EnlQueueHandle; + + NET_EXTENSION VirtualAddressExtension; + NET_EXTENSION UdpRscExtension; + NET_EXTENSION RxXSumExtension; + NET_EXTENSION NetMemoryExtension; + NET_EXTENSION NetMemoryReturnContextExtensionIn; + + bool CheckedWakeFrame = false; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(NetvRxQueue, NetvRxQueueGetContext); diff --git a/network/netadaptercx/netvadapterlibrary/code/trace.h b/network/netadaptercx/netvadapterlibrary/code/trace.h new file mode 100644 index 00000000..dc2e28e4 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/trace.h @@ -0,0 +1,96 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#pragma once + +#include + +// 5EC34F87-7705-4B5B-B5F6-1F3E4665A31E +#define WPP_CONTROL_GUIDS \ + WPP_DEFINE_CONTROL_GUID( \ + NetvadapterTraceGuid, \ + (5EC34F87,7705,4B5B,B5F6,1F3E4665A31E), \ + WPP_DEFINE_BIT(FLAG_DRIVER) \ + ) + +#define WPP_FLAG_LEVEL_LOGGER(flag, level) \ + WPP_LEVEL_LOGGER(flag) + +#define WPP_FLAG_LEVEL_ENABLED(flag, level) \ + (WPP_LEVEL_ENABLED(flag) && WPP_CONTROL(WPP_BIT_ ## flag).Level >= level) + +#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) \ + WPP_LEVEL_LOGGER(flags) + +#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \ + (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl) + +// begin_wpp config +// USEPREFIX (LogInformation, "%!FUNC! ->"); +// LogVerbose{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS, MSG, ...); +// end_wpp + +// begin_wpp config +// USEPREFIX (LogInformation, "%!FUNC! ->"); +// LogWarning{LEVEL=TRACE_LEVEL_WARNING}(FLAGS, MSG, ...); +// end_wpp + +// begin_wpp config +// USEPREFIX (LogInformation, "%!FUNC! ->"); +// LogError{LEVEL=TRACE_LEVEL_ERROR}(FLAGS, MSG, ...); +// end_wpp + +// begin_wpp config +// USEPREFIX (LogInformation, "%!FUNC! ->"); +// LogInformation{LEVEL=TRACE_LEVEL_INFORMATION}(FLAGS, MSG, ...); +// end_wpp + +// +// WPP orders static parameters before dynamic parameters. To support the Trace function +// defined below which sets FLAGS=MYDRIVER_ALL_INFO, a custom macro must be defined to +// reorder the arguments to what the .tpl configuration file expects. +// +#define WPP_RECORDER_FLAGS_LEVEL_ARGS(flags, lvl) \ + WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags) + +#define WPP_RECORDER_FLAGS_LEVEL_FILTER(flags, lvl) \ + WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags) + +// begin_wpp config +// USEPREFIX (RETURN_IF_NOT_STATUS_SUCCESS, "%!STATUS! %!FUNC! ->%!s!", nt__wpp, #NTSTATUS); +// FUNC RETURN_IF_NOT_STATUS_SUCCESS{FLAG=FLAG_DRIVER,LEVEL=TRACE_LEVEL_ERROR}(NTSTATUS); +// end_wpp + +#define WPP_FLAG_LEVEL_NTSTATUS_PRE(flag, level, ntstatus) do { NTSTATUS nt__wpp = (ntstatus); if (STATUS_SUCCESS != nt__wpp) { +#define WPP_FLAG_LEVEL_NTSTATUS_POST(flag, level, ntstatus); return nt__wpp; } } while (0) +#define WPP_RECORDER_FLAG_LEVEL_NTSTATUS_FILTER(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, flag) +#define WPP_RECORDER_FLAG_LEVEL_NTSTATUS_ARGS(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, flag) + +// begin_wpp config +// USEPREFIX (RETURN_NTSTATUS_IF, "%!STATUS! %!FUNC! ->%!s!", nt__wpp, #CONDITION); +// FUNC RETURN_NTSTATUS_IF{FLAG=FLAG_DRIVER,LEVEL=TRACE_LEVEL_ERROR}(NTSTATUS, CONDITION); +// end_wpp + +#define WPP_FLAG_LEVEL_NTSTATUS_CONDITION_PRE(flag, level, ntstatus, condition) if (condition) { NTSTATUS nt__wpp = (ntstatus); +#define WPP_FLAG_LEVEL_NTSTATUS_CONDITION_POST(flag, level, ntstatus, condition); return nt__wpp; } +#define WPP_RECORDER_FLAG_LEVEL_NTSTATUS_CONDITION_FILTER(flag, level, ntstatus, condition) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, flag) +#define WPP_RECORDER_FLAG_LEVEL_NTSTATUS_CONDITION_ARGS(flag, level, ntstatus, condition) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, flag) + +// begin_wpp config +// USEPREFIX (RETURN_FAILED_NTSTATUS_MSG, "%!STATUS! %!FUNC! ->", nt__wpp); +// FUNC RETURN_FAILED_NTSTATUS_MSG{FLAG=FLAG_DRIVER,FAILEDLEVEL=TRACE_LEVEL_ERROR}(NTSTATUS, MSG, ...); +// end_wpp + +#define WPP_FLAG_FAILEDLEVEL_NTSTATUS_PRE(flag, level, ntstatus); do { NTSTATUS nt__wpp = (ntstatus); +#define WPP_FLAG_FAILEDLEVEL_NTSTATUS_POST(flag, level, ntstatus); return nt__wpp; } while (0) +#define WPP_RECORDER_FLAG_FAILEDLEVEL_NTSTATUS_FILTER(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, flag) +#define WPP_RECORDER_FLAG_FAILEDLEVEL_NTSTATUS_ARGS(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, flag) + +// begin_wpp config +// USEPREFIX (RETURN_STATUS_SUCCESS, "%!STATUS! %!FUNC!", STATUS_SUCCESS); +// FUNC RETURN_STATUS_SUCCESS{FLAG=FLAG_DRIVER,SUCCESSLEVEL=TRACE_LEVEL_INFORMATION,NTSTATUS=STATUS_SUCCESS}(); +// end_wpp + +#define WPP_FLAG_SUCCESSLEVEL_NTSTATUS_POST(flag, level, ntstatus); return (ntstatus); +#define WPP_RECORDER_FLAG_SUCCESSLEVEL_NTSTATUS_FILTER(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, flag) +#define WPP_RECORDER_FLAG_SUCCESSLEVEL_NTSTATUS_ARGS(flag, level, ntstatus) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, flag) + diff --git a/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp b/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp new file mode 100644 index 00000000..56424523 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" +#include "adapter.h" +#include "txqueue.h" + +NetvTxQueue::NetvTxQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter +) noexcept + : NetvQueue{Handle, Adapter, NetTxQueueGetRingCollection(Handle)} +{ + NET_EXTENSION_QUERY extension; + NET_EXTENSION_QUERY_INIT( + &extension, + NET_FRAGMENT_EXTENSION_VIRTUAL_ADDRESS_NAME, + NET_FRAGMENT_EXTENSION_VIRTUAL_ADDRESS_VERSION_1, + NetExtensionTypeFragment); + + NetTxQueueGetExtension(m_handle, &extension, &VirtualAddressExtension); + + NET_EXTENSION_QUERY_INIT( + &extension, + NET_PACKET_EXTENSION_GSO_NAME, + NET_PACKET_EXTENSION_GSO_VERSION_1, + NetExtensionTypePacket); + + NetTxQueueGetExtension(m_handle, &extension, &UsoExtension); + + EnlQueueHandle = EnlCreateQueue(Handle, TX); +} + +_Use_decl_annotations_ +void +NetvTxQueue::Destroy( + void +) +{ + EnlDestroyQueue(EnlQueueHandle, TX); +} + +void +NetvTxQueue::Start( + void +) +{ + auto link = NetvEnlMLink[m_adapter.EnlIndex].LinkHandle[0]; + auto port = &link->Ports[m_adapter.EnlPortIndex]; + auto queue = &port->TxQueue[0]; + + NT_ASSERT(queue->State == Stopped); + + queue->QueueNext = queue->QueueEnd = 0U; + + EnlIndicateQueueState(EnlQueueHandle, Started); +} + +void +NetvTxQueue::Stop( + void +) +{ + EnlIndicateQueueState(EnlQueueHandle, Stopped); +} + +_Use_decl_annotations_ +void +NetvTxQueue::Advance( + void +) +{ + auto pr = GetPacketRing(); + auto pi = NetRingGetAllPackets(m_rings); + + // drain Tx packets + for (; NetPacketIteratorHasAny(&pi); NetPacketIteratorAdvance(&pi)) + { + auto packet = NetPacketIteratorGetPacket(&pi); + if (! packet->Scratch) + { + break; + } + + auto fi = NetPacketIteratorGetFragments(&pi); + for (; NetFragmentIteratorHasAny(&fi); NetFragmentIteratorAdvance(&fi)) + { + continue; + } + + m_rings->Rings[NetRingTypeFragment]->BeginIndex = + NetFragmentIteratorGetIndex(&fi); + } + + NetPacketIteratorSet(&pi); + + // post Tx packets + EnlRingDoorBell(EnlQueueHandle, pr->EndIndex); +} + +_Use_decl_annotations_ +void +NetvTxQueue::Cancel( + void +) +{ + auto ringBuffer = GetPacketRing(); + + EnlRingDoorBell(EnlQueueHandle, ringBuffer->EndIndex); +} + +_Use_decl_annotations_ +void +NetvTxQueue::SetNotify( + bool NotificationEnabled +) +{ + EnlArmInterrupt(EnlQueueHandle, NotificationEnabled); +} diff --git a/network/netadaptercx/netvadapterlibrary/code/txqueue.h b/network/netadaptercx/netvadapterlibrary/code/txqueue.h new file mode 100644 index 00000000..425a38e9 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/code/txqueue.h @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "queue.h" + +class NetvTxQueue final + : public NetvQueue +{ + +public: + + NetvTxQueue( + NETPACKETQUEUE Handle, + NetvAdapter & Adapter + ) noexcept; + + void + Destroy( + void + ); + + void + Start( + void + ); + + void + Stop( + void + ); + + void + Advance( + void + ); + + void + Cancel( + void + ); + + void + SetNotify( + bool Enable + ); + + ENLP_QUEUE * EnlQueueHandle; + NET_EXTENSION VirtualAddressExtension; + NET_EXTENSION UsoExtension; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(NetvTxQueue, NetvTxQueueGetContext); diff --git a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj new file mode 100644 index 00000000..5e0be8e5 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 6 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 6 + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 6 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 6 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + ..\code\trace.h + true + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/km/packages.config b/network/netadaptercx/netvadapterlibrary/km/packages.config new file mode 100644 index 00000000..d690ede8 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/km/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln new file mode 100644 index 00000000..c39e8929 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36717.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.ActiveCfg = Debug|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.Build.0 = Debug|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.ActiveCfg = Release|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.Build.0 = Release|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.ActiveCfg = Debug|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.Build.0 = Debug|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.ActiveCfg = Release|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6D884183-BDDB-43F8-A3F9-410276822289} + EndGlobalSection +EndGlobal diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj new file mode 100644 index 00000000..99a6e5e9 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj @@ -0,0 +1,197 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {612F33AD-430C-4FE7-8000-35E15A5EB757} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + KMDF_Driver1 + + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 33 + true + 2 + 6 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 33 + true + 2 + 6 + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 33 + true + 2 + 6 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 33 + true + 2 + 6 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + true + ..\code\trace.h + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/packages.config b/network/netadaptercx/netvadapterlibrary/um/packages.config new file mode 100644 index 00000000..d690ede8 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/um/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file -- cgit v1.3.1 From 977cb2461482a898f96ee08f9cb24eb7f421da03 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 4 Dec 2025 15:03:24 -0800 Subject: intergrate the netvadapterlibrary with wificxsampledriver, cleanup the memory related header -KNEW.H --- .../netvadapterlibrary/Interface/netvadapter.h | 126 +++++++++++++ .../netvadapterlibrary/code/adapter.cpp | 8 +- .../netadaptercx/netvadapterlibrary/code/adapter.h | 141 -------------- .../netvadapterlibrary/code/configuration.cpp | 5 +- .../netadaptercx/netvadapterlibrary/code/enl.cpp | 11 +- network/netadaptercx/netvadapterlibrary/code/enl.h | 13 +- .../netvadapterlibrary/code/memory.cpp | 10 + .../netadaptercx/netvadapterlibrary/code/memory.h | 6 +- .../netvadapterlibrary/code/rtl/KNew.h | 203 --------------------- .../netvadapterlibrary/code/rtl/UmPool.h | 97 ---------- .../netvadapterlibrary/code/rtl/pooltypes.h | 53 ------ .../netvadapterlibrary/code/rxqueue.cpp | 10 +- .../netvadapterlibrary/code/txqueue.cpp | 2 +- .../km/netvadapterlibrarykm.vcxproj | 19 +- .../um/netvadapterlibraryum.vcxproj | 26 +-- network/wlan/WIFICX/drivercode/adapter.cpp | 135 +++++++++++--- network/wlan/WIFICX/drivercode/adapter.h | 32 +++- network/wlan/WIFICX/drivercode/device.cpp | 85 ++++++--- network/wlan/WIFICX/drivercode/device.h | 5 +- .../wlan/WIFICX/drivercode/memorymanagement.cpp | 14 +- network/wlan/WIFICX/drivercode/precomp.h | 5 + network/wlan/WIFICX/drivercode/wifihal.cpp | 4 +- .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 25 ++- .../wlan/WIFICX/um/wificxsampleclientum.vcxproj | 21 ++- network/wlan/WIFICX/wificxsampleclient.sln | 34 ++++ 25 files changed, 469 insertions(+), 621 deletions(-) create mode 100644 network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h delete mode 100644 network/netadaptercx/netvadapterlibrary/code/adapter.h delete mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h delete mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h delete mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h new file mode 100644 index 00000000..d8e4294f --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +#define MAX_MULTICAST_LIST_SIZE 32 +#define MAC_ADDR_LEN 6 +#define MAX_RX_QUEUES 1 +#define MAX_TX_QUEUES 1 +#define MTU_SIZE 1500 + +#define NETV_NUMBER_OF_QUEUES 1 + +// supported filters +#define NETV_SUPPORTED_FILTERS ( \ + NetPacketFilterFlagDirected | \ + NetPacketFilterFlagMulticast | \ + NetPacketFilterFlagBroadcast | \ + NetPacketFilterFlagPromiscuous | \ + NetPacketFilterFlagAllMulticast) + + +NTSTATUS +ConfigureAndStartAdapter( + _In_ NETADAPTER Adapter + ); + +EVT_NET_ADAPTER_CREATE_TXQUEUE + CreateTxQueue; +EVT_NET_ADAPTER_CREATE_RXQUEUE + CreateRxQueue; + +typedef enum _NETV_FLOW_CONTROL +{ + NetvFlowControlDisabled = 0, + NetvFlowControlTxEnabled = 1, + NetvFlowControlRxEnabled = 2, + NetvFlowControlTxRxEnabled = 3, +} NETV_FLOW_CONTROL; + +typedef NTSTATUS(EVT_PDO_WAKE_SIGNAL)(_In_ void* Context); + +class NetvAdapter +{ + +public: + + NetvAdapter( + NETADAPTER Handle, + WDFDEVICE Device + ) noexcept; + + // Public API + void Destroy(); + NTSTATUS Initialize(); + NTSTATUS CreateRxQueue(_Inout_ NETRXQUEUE_INIT* NetRxQueueInit); + NTSTATUS CreateTxQueue(_Inout_ NETTXQUEUE_INIT* NetTxQueueInit); + + // Former INetvAdapter method (kept as regular method) + NTSTATUS ConfigureDataCapabilities(); + + // Existing public API + void SetPdoWakeSignalCallback(_In_ EVT_PDO_WAKE_SIGNAL* evtPdoWakeSignal, _In_ void* context); + void ArmWakeFromS0(void); + void DisarmWakeFromS0(void); + + NETADAPTER m_handle = WDF_NO_HANDLE; + + WDFDEVICE m_device = WDF_NO_HANDLE; + +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) + BOOLEAN PreallocatedRxBuffers; + NETMEMORYCOLLECTION + m_preallocatedRxBuffers = WDF_NO_HANDLE; +#endif //NETCX 2.6 only + + // configuration + NET_ADAPTER_LINK_LAYER_ADDRESS PermanentAddress; + NET_ADAPTER_LINK_LAYER_ADDRESS CurrentAddress; + ULONG MACLastByte; + BOOLEAN S0Idle; + BOOLEAN EnableUsoUro; + + // Packet Filter and look ahead size. + NET_PACKET_FILTER_FLAGS PacketFilter; + + bool LinkAutoNeg{false}; + NETV_FLOW_CONTROL FlowControl; + + ULONG MtuSize; + ULONG CurrentPacketFilter; + ULONG NumMulticastAddresses; + NET_ADAPTER_LINK_LAYER_ADDRESS MulticastAddressList[MAX_MULTICAST_LIST_SIZE]; + + //ENL + LIST_ENTRY AdapterListLink; + ULONG LinkCount{1}; + ULONG LinkProcIndex; + ULONG EnlIndex; + ULONG EnlPortIndex; + BOOLEAN EnlIndexValid; + BOOLEAN EnlPortCreated; + BOOLEAN LinkPoll; + ULONG64 EnlTxDrops; + + // Offloads + bool UsoEnabled; + bool UroEnabled; + +private: + + _IRQL_requires_(PASSIVE_LEVEL) + void + SetLinkState( + void + ) const; + + + virtual NTSTATUS NetvAdapterReadAddress(); +}; + +extern NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter); + +typedef struct _GLOBAL_CONTEXT +{ +} GLOBAL_CONTEXT; + +extern GLOBAL_CONTEXT NetvGlobalContext; \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp index 1e6777b8..a047f163 100644 --- a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp @@ -8,7 +8,7 @@ #else #include "net/umxfilter.h" // Copied from Km XFilter.h, NETCX please move this xfilter.h into shared location #endif -#include "adapter.h" +#include "netvadapter.h" #include "rxqueue.h" #include "txqueue.h" #include "configuration.h" @@ -431,6 +431,7 @@ NetvAdapterSetUsoUroOffloadCapabilities( _Use_decl_annotations_ NTSTATUS NetvAdapter::ConfigureDataCapabilities() { +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) if (PreallocatedRxBuffers) { WDF_OBJECT_ATTRIBUTES attributes; @@ -466,20 +467,21 @@ NTSTATUS NetvAdapter::ConfigureDataCapabilities() MAX_RX_BUFFER_SIZE )); } +#endif //NETCX 2.6 only NET_ADAPTER_TX_CAPABILITIES txCapabilities; NET_ADAPTER_TX_CAPABILITIES_INIT(&txCapabilities, MAX_TX_QUEUES); NET_ADAPTER_RX_CAPABILITIES rxCapabilities; NET_ADAPTER_RX_CAPABILITIES_INIT_SYSTEM_MANAGED(&rxCapabilities, MAX_RX_BUFFER_SIZE, MAX_RX_QUEUES); - +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) if (PreallocatedRxBuffers) { rxCapabilities.AllocationMode = NetRxFragmentBufferAllocationModeDriverV2; rxCapabilities.AttachmentMode = NetRxFragmentBufferAttachmentModeDriver; rxCapabilities.MemoryCollection = m_preallocatedRxBuffers; } - +#endif //NETCX 2.6 only NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCapabilities; NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCapabilities, MAX_LINK_SPEED, MAX_LINK_SPEED); diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.h b/network/netadaptercx/netvadapterlibrary/code/adapter.h deleted file mode 100644 index 55c4948d..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/adapter.h +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved - -#pragma once - -#include - -#define MAX_RX_BUFFER_SIZE 65535 -#define MAX_RX_QUEUES 1 -#define MAX_TX_QUEUES 1 -#define MTU_SIZE 1500 -#define MAX_MULTICAST_LIST_SIZE 32 -#define MAC_ADDR_LEN 6 -#define NETV_NUMBER_OF_QUEUES 1 - -// supported filters -#define NETV_SUPPORTED_FILTERS ( \ - NetPacketFilterFlagDirected | \ - NetPacketFilterFlagMulticast | \ - NetPacketFilterFlagBroadcast | \ - NetPacketFilterFlagPromiscuous | \ - NetPacketFilterFlagAllMulticast) - -NTSTATUS -ConfigureAndStartAdapter( - _In_ NETADAPTER Adapter - ); - -EVT_NET_ADAPTER_CREATE_TXQUEUE - CreateTxQueue; -EVT_NET_ADAPTER_CREATE_RXQUEUE - CreateRxQueue; - -typedef enum _NETV_FLOW_CONTROL -{ - NetvFlowControlDisabled = 0, - NetvFlowControlTxEnabled = 1, - NetvFlowControlRxEnabled = 2, - NetvFlowControlTxRxEnabled = 3, -} NETV_FLOW_CONTROL; - -typedef NTSTATUS(EVT_PDO_WAKE_SIGNAL)(_In_ void* Context); - -class NetvAdapter -{ - -public: - - NetvAdapter( - NETADAPTER Handle, - WDFDEVICE Device - ) noexcept; - - void - Destroy( - void - ); - - NTSTATUS - Initialize( - void - ); - - NTSTATUS - CreateRxQueue( - NETRXQUEUE_INIT * NetRxQueueInit - ); - - NTSTATUS - CreateTxQueue( - NETTXQUEUE_INIT * NetTxQueueInit - ); - - NTSTATUS ConfigureDataCapabilities(); - - void SetPdoWakeSignalCallback(_In_ EVT_PDO_WAKE_SIGNAL* evtPdoWakeSignal, _In_ void* context); - - void ArmWakeFromS0(void); - - void DisarmWakeFromS0(void); - - NETADAPTER m_handle = WDF_NO_HANDLE; - - WDFDEVICE m_device = WDF_NO_HANDLE; - - NETMEMORYCOLLECTION - m_preallocatedRxBuffers = WDF_NO_HANDLE; - - // configuration - NET_ADAPTER_LINK_LAYER_ADDRESS PermanentAddress; - NET_ADAPTER_LINK_LAYER_ADDRESS CurrentAddress; - ULONG MACLastByte; - BOOLEAN S0Idle; - BOOLEAN EnableUsoUro; - BOOLEAN PreallocatedRxBuffers; - - // Packet Filter and look ahead size. - NET_PACKET_FILTER_FLAGS PacketFilter; - - bool LinkAutoNeg{false}; - NETV_FLOW_CONTROL FlowControl; - - ULONG MtuSize; - ULONG CurrentPacketFilter; - ULONG NumMulticastAddresses; - NET_ADAPTER_LINK_LAYER_ADDRESS MulticastAddressList[MAX_MULTICAST_LIST_SIZE]; - - //ENL - LIST_ENTRY AdapterListLink; - ULONG LinkCount{1}; - ULONG LinkProcIndex; - ULONG EnlIndex; - ULONG EnlPortIndex; - BOOLEAN EnlIndexValid; - BOOLEAN EnlPortCreated; - BOOLEAN LinkPoll; - ULONG64 EnlTxDrops; - - // Offloads - bool UsoEnabled; - bool UroEnabled; - -private: - - _IRQL_requires_(PASSIVE_LEVEL) - void - SetLinkState( - void - ) const; - - virtual NTSTATUS NetvAdapterReadAddress(); -}; - -extern NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter); - -typedef struct _GLOBAL_CONTEXT -{ -} GLOBAL_CONTEXT; - -extern GLOBAL_CONTEXT NetvGlobalContext; - - diff --git a/network/netadaptercx/netvadapterlibrary/code/configuration.cpp b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp index 52ae7886..360cc43d 100644 --- a/network/netadaptercx/netvadapterlibrary/code/configuration.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp @@ -1,7 +1,8 @@ #include "pch.hpp" +#include "netvadapter.h" + #include "trace.h" #include "configuration.tmh" -#include "adapter.h" typedef struct _NETVADAPTER_ADVANCED_PROPERTY { @@ -27,7 +28,9 @@ NETVADAPTER_ADVANCED_PROPERTY NetvSupportedProperties[] = { CONSTANT_UNICODE_STRING(L"LinkProcIndex"), NETV_OFFSET(LinkProcIndex), NETV_SIZE(LinkProcIndex), 1000, 0, 1023 }, { CONSTANT_UNICODE_STRING(L"S0Idle"), NETV_OFFSET(S0Idle), NETV_SIZE(S0Idle), 0, 0, 1 }, { CONSTANT_UNICODE_STRING(L"EnableUsoUro"), NETV_OFFSET(EnableUsoUro), NETV_SIZE(EnableUsoUro), 0, 0, 1 }, +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) { CONSTANT_UNICODE_STRING(L"PreallocatedRxBuffers"), NETV_OFFSET(PreallocatedRxBuffers), NETV_SIZE(PreallocatedRxBuffers), 0, 0, 1 }, +#endif //NETCX 2.6 only }; NTSTATUS diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index 4e19517f..30822900 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -1,7 +1,7 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. #include "pch.hpp" #include -//#include -#include "adapter.h" +#include "netvadapter.h" #include "rxqueue.h" #include "txqueue.h" #include "trace.h" @@ -345,7 +345,7 @@ EnlpIterationRoutine( auto fragment = NetFragmentIteratorGetFragment(&rxFi); BYTE* fragmentBuffer = nullptr; - +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) if (rxq->RxQueue->m_adapter.PreallocatedRxBuffers) { MemoryBuffer* bufferToUse = GetMemoryFromHandle(rxq->RxQueue->m_adapter.m_preallocatedRxBuffers)->PopAvailableBuffer(); @@ -382,6 +382,7 @@ EnlpIterationRoutine( fragment->Scratch = 0; } else +#endif //NETCX 2.6 only { auto const rxVirtualAddress = NetExtensionGetFragmentVirtualAddress( @@ -659,7 +660,7 @@ EnlCreateLink( ) { LogInformation(FLAG_DRIVER, L"ProcessorIndex=%u", ProcessorIndex); - + auto enlLink = wil::make_unique_nothrow(); RETURN_NTSTATUS_IF( STATUS_INSUFFICIENT_RESOURCES, @@ -745,7 +746,7 @@ EnlDeactivateLinkPort( ULONG i; NT_FRE_ASSERT(EnlIsPortActive(EnlLink, PortIndex)); - KLockThisExclusive(EnlLink->Lock); + //KLockThisExclusive(EnlLink->Lock); NT_FRE_ASSERT(!EnlpIsThreadPaused(&EnlLink->EnlThread)); EnlpPauseThread(&EnlLink->EnlThread); diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.h b/network/netadaptercx/netvadapterlibrary/code/enl.h index 6089107e..529c36ac 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.h +++ b/network/netadaptercx/netvadapterlibrary/code/enl.h @@ -1,4 +1,4 @@ - +// Copyright (C) Microsoft Corporation. All rights reserved. // // Emulated Network Link (ENL) definitions // @@ -21,16 +21,13 @@ // NBL completions by queueing DPCs to the target processor. // -//#include + #ifndef _KERNEL_MODE #define ASSERT(x) NT_ASSERT(x) -#include "rtl/UmPool.h" + #endif #include "rtl/KWaitEvent.h" -#include "rtl/KLockHolder.h" #include "rtl/KSpinLock.h" -#include "rtl/KPushLock.h" -#include "rtl/KNew.h" #define ENL_MAX_PROC_COUNT 16 #define ENLP_PORT_COUNT 2 @@ -239,10 +236,8 @@ struct DECLSPEC_ALIGN(PAGE_SIZE) ENLP_PORT ENLP_QUEUE RxQueue[ENL_MAX_PROC_COUNT]; }; -struct ENLP_LINK : - public NONPAGED_OBJECT<'LLNE'> +struct ENLP_LINK { - KPushLock Lock{}; ULONG64 Ts{}; ULONG64 BusyTicks{}; ULONG64 EmptyTicks{}; diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.cpp b/network/netadaptercx/netvadapterlibrary/code/memory.cpp index 6d23f3bc..0c010d59 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/memory.cpp @@ -5,6 +5,8 @@ #include "trace.h" #include "memory.tmh" +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) + NTSTATUS Memory::Initialize( NETMEMORYCOLLECTION MemoryCollection, @@ -75,3 +77,11 @@ Memory::ReturnBuffer( m_buffersReadyToUse[m_lastBufferToUse++] = Buffer; } +#endif //NETCX 2.6 only + +// for wil::make_unique_nothrow +void* +operator new(size_t s, std::nothrow_t const&) +{ + return operator new(s); +} \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.h b/network/netadaptercx/netvadapterlibrary/code/memory.h index b7ed654d..a07af6b8 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.h +++ b/network/netadaptercx/netvadapterlibrary/code/memory.h @@ -1,8 +1,11 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once -#include "adapter.h" #include +#define MAX_RX_BUFFER_SIZE 65535 + +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) + static const size_t PREALLOCATED_BUFFERS_COUNT = 128; struct MemoryBuffer @@ -57,3 +60,4 @@ private: }; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(Memory, GetMemoryFromHandle); +#endif //NETCX 2.6 only \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h deleted file mode 100644 index 28c832bd..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KNew.h +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. - -#pragma once - -#include - -#if UMDF_DRIVER == 0 -#include -#endif - -#include -#include - -// -// KALLOCATOR KALLOCATOR_NONPAGED -// ---------------------------------------+--------------------+--------------------+ -// The object must be allocated at IRQL: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | -// ---------------------------------------+--------------------+--------------------+ -// The object must be freed at IRQL: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | -// ---------------------------------------+--------------------+--------------------+ -// Constructor & destructor run at: | = PASSIVE_LEVEL | = PASSIVE_LEVEL | -// ---------------------------------------+--------------------+--------------------+ -// Member functions default to: | PAGED code segment | .text code segment | -// ---------------------------------------+--------------------+--------------------+ -// Compiler-generated code goes to: | PAGED code segment | .text code segment | -// ---------------------------------------+--------------------+--------------------+ -// The memory is allocated from pool: | paged or nonpaged | paged or nonpaged | -// ---------------------------------------+--------------------+--------------------+ -// - -PAGED void *operator new(size_t s, std::nothrow_t const &, ULONG tag); -PAGED void operator delete(void *p, ULONG tag); -PAGED void *operator new[](size_t s, std::nothrow_t const &, ULONG tag); -PAGED void operator delete[](void *p, ULONG tag); -PAGEDX void __cdecl operator delete[](void *p); -void __cdecl operator delete(void *p); - -template -struct KRTL_CLASS KALLOCATION_TAG -{ - static const ULONG AllocationTag = TAG; - static const ULONG AllocationArena = ARENA; -}; - -template -struct KRTL_CLASS_DPC_ALLOC KALLOCATION_TAG_DPC_ALLOC -{ - static const ULONG AllocationTag = TAG; - static const ULONG AllocationArena = ARENA; -}; - -template -struct KRTL_CLASS KALLOCATOR : public KALLOCATION_TAG -{ - // Scalar new & delete - - PAGED void *operator new(size_t cb, std::nothrow_t const &) - { - PAGED_CODE(); - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); - } - - PAGED void operator delete(void *p) - { - PAGED_CODE(); - - if (p != nullptr) - { - ExFreePoolWithTag(p, TAG); - } - } - - // Scalar new with bonus bytes - - PAGED void *operator new(size_t cb, std::nothrow_t const &, size_t extraBytes) - { - PAGED_CODE(); - - auto size = cb + extraBytes; - - // Overflow check - if (size < cb) - return nullptr; - - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), size, TAG); - } - - // Array new & delete - - PAGED void *operator new[](size_t cb, std::nothrow_t const &) - { - PAGED_CODE(); - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); - } - - PAGED void operator delete[](void *p) - { - PAGED_CODE(); - - if (p != nullptr) - { - ExFreePoolWithTag(p, TAG); - } - } - - // Placement new & delete - - PAGED void *operator new(size_t n, void * p) - { - PAGED_CODE(); - UNREFERENCED_PARAMETER((n)); - return p; - } - - PAGED void operator delete(void *p1, void *p2) - { - PAGED_CODE(); - UNREFERENCED_PARAMETER((p1, p2)); - } -}; - -template -struct KRTL_CLASS_DPC_ALLOC KALLOCATOR_NONPAGED : public KALLOCATION_TAG_DPC_ALLOC -{ - // Scalar new & delete - - NONPAGED void *operator new(size_t cb, std::nothrow_t const &) - { - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); - } - - NONPAGED void operator delete(void *p) - { - if (p != nullptr) - { - ExFreePoolWithTag(p, TAG); - } - } - - // Scalar new with bonus bytes - - NONPAGED void *operator new(size_t cb, std::nothrow_t const &, size_t extraBytes) - { - auto size = cb + extraBytes; - - // Overflow check - if (size < cb) - return nullptr; - - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), size, TAG); - } - - // Array new & delete - - NONPAGED void *operator new[](size_t cb, std::nothrow_t const &) - { - #pragma warning( suppress : 4996 28751 ) - return ExAllocatePoolWithTag(static_cast(ARENA), cb, TAG); - } - - NONPAGED void operator delete[](void *p) - { - if (p != nullptr) - { - ExFreePoolWithTag(p, TAG); - } - } - - // Placement new & delete - - NONPAGED void *operator new(size_t n, void * p) - { - UNREFERENCED_PARAMETER((n)); - return p; - } - - NONPAGED void operator delete(void *p1, void *p2) - { - UNREFERENCED_PARAMETER((p1, p2)); - } -}; - -template -struct KRTL_CLASS PAGED_OBJECT : - public KALLOCATOR, - public NdisDebugBlock -{ - -}; - -template -struct KRTL_CLASS NONPAGED_OBJECT : - public KALLOCATOR, - public NdisDebugBlock -{ - -}; - diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h b/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h deleted file mode 100644 index 45491006..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/UmPool.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. - -#pragma once - -#if UMDF_DRIVER == 0 -#include "pooltypes.h" -#endif - -#ifndef _KERNEL_MODE - -#if (NTDDI_VERSION >= NTDDI_WIN10_VB) && !defined(KRTL_USE_LEGACY_POOL_API) - -typedef _Enum_is_bitflag_ enum _EX_POOL_PRIORITY { - LowPoolPriority, - LowPoolPrioritySpecialPoolOverrun = 8, - LowPoolPrioritySpecialPoolUnderrun = 9, - NormalPoolPriority = 16, - NormalPoolPrioritySpecialPoolOverrun = 24, - NormalPoolPrioritySpecialPoolUnderrun = 25, - HighPoolPriority = 32, - HighPoolPrioritySpecialPoolOverrun = 40, - HighPoolPrioritySpecialPoolUnderrun = 41 -} EX_POOL_PRIORITY; - -typedef enum POOL_EXTENDED_PARAMETER_TYPE { - PoolExtendedParameterInvalidType = 0, - PoolExtendedParameterPriority, - PoolExtendedParameterMax -} POOL_EXTENDED_PARAMETER_TYPE, *PPOOL_EXTENDED_PARAMETER_TYPE; - -#define POOL_EXTENDED_PARAMETER_TYPE_BITS 8 -#define POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS 1 -#define POOL_EXTENDED_PARAMETER_RESERVED_BITS (64 - POOL_EXTENDED_PARAMETER_TYPE_BITS - POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS) - -#pragma warning(push) -#pragma warning(disable: 4201) // nameless struct/union -typedef struct DECLSPEC_ALIGN(8) POOL_EXTENDED_PARAMETER { - struct { - ULONG64 Type : POOL_EXTENDED_PARAMETER_TYPE_BITS; - ULONG64 Optional : POOL_EXTENDED_PARAMETER_REQUIRED_FIELD_BITS; - ULONG64 Reserved : POOL_EXTENDED_PARAMETER_RESERVED_BITS; - } DUMMYSTRUCTNAME; - - union { - ULONG64 Reserved2; - PVOID Reserved3; - EX_POOL_PRIORITY Priority; - } DUMMYUNIONNAME; -} POOL_EXTENDED_PARAMETER, *PPOOL_EXTENDED_PARAMETER; -#pragma warning(pop) - -typedef ULONG64 POOL_FLAGS; - -_Check_return_ -_Ret_maybenull_ -_Post_writable_byte_size_(NumberOfBytes) -PVOID -ExAllocatePool2 ( - _In_ POOL_FLAGS Flags, - _In_ SIZE_T NumberOfBytes, - _In_ ULONG Tag - ); - -_Check_return_ -_Ret_maybenull_ -_Post_writable_byte_size_(NumberOfBytes) -PVOID -ExAllocatePool3 ( - _In_ POOL_FLAGS Flags, - _In_ SIZE_T NumberOfBytes, - _In_ ULONG Tag, - _In_reads_opt_(ExtendedParameterCount) PPOOL_EXTENDED_PARAMETER ExtendedParameters, - _In_ ULONG ExtendedParametersCount - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN10_VB) && !defined(KRTL_USE_LEGACY_POOL_API) - -PVOID -ExAllocatePoolWithTag( - POOL_TYPE PoolType, - SIZE_T NumberOfBytes, - ULONG Tag - ); - -VOID -ExFreePoolWithTag( - _Pre_notnull_ __drv_freesMem(Mem) PVOID P, - _In_ ULONG Tag - ); - -VOID -ExFreePool( - _Pre_notnull_ __drv_freesMem(Mem) PVOID P - ); - -#endif // _KERNEL_MODE - diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h b/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h deleted file mode 100644 index 8bee9a72..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/pooltypes.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. - -#pragma once - -#ifndef _KERNEL_MODE - -#include - -// -// Pool Allocation routines (in pool.c) -// -typedef _Enum_is_bitflag_ enum _POOL_TYPE { - NonPagedPool, - NonPagedPoolExecute = NonPagedPool, - PagedPool, - NonPagedPoolMustSucceed = NonPagedPool + 2, - DontUseThisType, - NonPagedPoolCacheAligned = NonPagedPool + 4, - PagedPoolCacheAligned, - NonPagedPoolCacheAlignedMustS = NonPagedPool + 6, - MaxPoolType, - - // - // Define base types for NonPaged (versus Paged) pool, for use in cracking - // the underlying pool type. - // - - NonPagedPoolBase = 0, - NonPagedPoolBaseMustSucceed = NonPagedPoolBase + 2, - NonPagedPoolBaseCacheAligned = NonPagedPoolBase + 4, - NonPagedPoolBaseCacheAlignedMustS = NonPagedPoolBase + 6, - - // - // Note these per session types are carefully chosen so that the appropriate - // masking still applies as well as MaxPoolType above. - // - - NonPagedPoolSession = 32, - PagedPoolSession = NonPagedPoolSession + 1, - NonPagedPoolMustSucceedSession = PagedPoolSession + 1, - DontUseThisTypeSession = NonPagedPoolMustSucceedSession + 1, - NonPagedPoolCacheAlignedSession = DontUseThisTypeSession + 1, - PagedPoolCacheAlignedSession = NonPagedPoolCacheAlignedSession + 1, - NonPagedPoolCacheAlignedMustSSession = PagedPoolCacheAlignedSession + 1, - - NonPagedPoolNx = 512, - NonPagedPoolNxCacheAligned = NonPagedPoolNx + 4, - NonPagedPoolSessionNx = NonPagedPoolNx + 32, - -} POOL_TYPE; - -#endif // _KERNEL_MODE - diff --git a/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp index 61c12ca3..d0b87f9e 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved #include "pch.hpp" -#include "adapter.h" +#include "netvadapter.h" #include "rxqueue.h" #include "memory.h" @@ -68,7 +68,7 @@ NetvRxQueue::NetvRxQueue( NetExtensionTypePacket); NetRxQueueGetExtension(m_handle, &extension, &RxXSumExtension); - +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) if (Adapter.PreallocatedRxBuffers) { NET_EXTENSION_QUERY_INIT( @@ -87,7 +87,7 @@ NetvRxQueue::NetvRxQueue( NetRxQueueGetExtension(m_handle, &extension, &NetMemoryReturnContextExtensionIn); } - +#endif //NETCX 2.6 only EnlQueueHandle = EnlCreateQueue(Handle, RX); } @@ -150,7 +150,7 @@ NetvRxQueue::Advance( break; } } - +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) if (m_adapter.PreallocatedRxBuffers) { NET_RING* dataBufferRing = GetNetMemoryReturnRing(); @@ -166,7 +166,7 @@ NetvRxQueue::Advance( dataBufferRing->BeginIndex = NetRingIncrementIndex(dataBufferRing, dataBufferRing->BeginIndex); } } - +#endif //NETCX 2.6 only NetFragmentIteratorSet(&fi); NetPacketIteratorSet(&pi); EnlRingDoorBell(EnlQueueHandle, fr->EndIndex); diff --git a/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp b/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp index 56424523..b67692b5 100644 --- a/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/txqueue.cpp @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved #include "pch.hpp" -#include "adapter.h" +#include "netvadapter.h" #include "txqueue.h" NetvTxQueue::NetvTxQueue( diff --git a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj index 5e0be8e5..e1d68f5c 100644 --- a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj +++ b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj @@ -38,7 +38,7 @@ 33 true 2 - 6 + 5 Windows10 @@ -51,7 +51,7 @@ 33 true 2 - 6 + 5 Windows10 @@ -64,7 +64,7 @@ 33 true 2 - 6 + 5 Windows10 @@ -77,7 +77,7 @@ 33 true 2 - 6 + 5 @@ -89,19 +89,19 @@ DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) @@ -159,7 +159,6 @@ - @@ -169,6 +168,8 @@ + + diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj index 99a6e5e9..ce418965 100644 --- a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj +++ b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj @@ -36,10 +36,10 @@ KMDF Universal 2 - 33 + 35 true 2 - 6 + 5 Windows10 @@ -49,10 +49,10 @@ KMDF Universal 2 - 33 + 35 true 2 - 6 + 5 Windows10 @@ -62,10 +62,10 @@ KMDF Universal 2 - 33 + 35 true 2 - 6 + 5 Windows10 @@ -75,10 +75,10 @@ KMDF Universal 2 - 33 + 35 true 2 - 6 + 5 @@ -90,19 +90,19 @@ DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) @@ -160,7 +160,6 @@ - @@ -170,6 +169,7 @@ + diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp index 958f69ea..b2f736b9 100644 --- a/network/wlan/WIFICX/drivercode/adapter.cpp +++ b/network/wlan/WIFICX/drivercode/adapter.cpp @@ -6,45 +6,93 @@ #include "adapter.h" #include "adapter.tmh" -_Use_decl_annotations_ -NTSTATUS WifiIhvInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter) +extern UCHAR NetvMacAddressBase[MAC_ADDR_LEN]; + +NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter) +{ + WifiNetvAdapter* wifiNetvAdapter = WifiNetvAdapterGetContext(netAdapter); + NetvAdapter* netvAdapter{ wifiNetvAdapter }; + return netvAdapter; +} + +WifiNetvAdapter::WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device) : NetvAdapter(Handle, Device) +{ +} + +NTSTATUS WifiNetvAdapter::Initialize() { - PWIFI_IHV_DEVICE_CONTEXT deviceContext = WifiGetIhvDeviceContext(Device); - PWIFI_IHV_NETADAPTER_CONTEXT netAdapterContext = WifiGetIhvNetAdapterContext(NetAdapter); + if (WifiGetIhvDeviceContext(m_device)->netAdapters[WifiAdapterGetPortId(m_handle)] != WDF_NO_HANDLE) + { + return STATUS_SUCCESS; + } + return NetvAdapter::Initialize(); +} + +// the Xfilter.h should be included in the share(currently in km only) +#ifndef _KERNEL_MODE +// +// This macro is used to copy from one network address to +// another. +// +#define ETH_COPY_NETWORK_ADDRESS(_D, _S) \ +{ \ + *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ + *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ +} +// +// ZZZ This is a little-endian specific check. +// +#define ETH_IS_MULTICAST(Address) \ + (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x01)) + +// +// Check whether an address is broadcast. +// +#define ETH_IS_BROADCAST(Address) \ + ((((PUCHAR)(Address))[0] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[1] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[2] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[3] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[4] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[5] == ((UCHAR)0xff))) + +#endif // _KERNEL_MODE + +NTSTATUS WifiNetvAdapter::NetvAdapterReadAddress() +{ + UCHAR MACLastByteFinial = (UCHAR)MACLastByte; + if (MACLastByteFinial == 0) + { + MACLastByteFinial++; + } + + PermanentAddress.Length = MAC_ADDR_LEN; - if (deviceContext->primaryStaAdapter == WDF_NO_HANDLE) + ETH_COPY_NETWORK_ADDRESS(PermanentAddress.Address, NetvMacAddressBase); + PermanentAddress.Address[MAC_ADDR_LEN - 1] = MACLastByteFinial; + if (ETH_IS_MULTICAST(PermanentAddress.Address) || ETH_IS_BROADCAST(PermanentAddress.Address)) { - deviceContext->primaryStaAdapter = NetAdapter; + WFCError("%!FUNC!: Failed with %!STATUS!", STATUS_INVALID_ADDRESS); + return STATUS_INVALID_ADDRESS; } - netAdapterContext->WifiDeviceContext = deviceContext; + RtlCopyMemory(&CurrentAddress, &PermanentAddress, sizeof(PermanentAddress)); + + EnlIndex = (MACLastByteFinial - 1) >> 1; + EnlPortIndex = (MACLastByteFinial - 1) & 1; + EnlIndexValid = TRUE; return STATUS_SUCCESS; } -_Use_decl_annotations_ -NTSTATUS WifiIhvAdapterStart(NETADAPTER netAdapter) +NTSTATUS WifiNetvAdapter::AdapterStart() { TraceEntry(); - static WDI_MAC_ADDRESS STAAddress = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; - NET_ADAPTER_LINK_LAYER_ADDRESS permanentLinkLayerAddress; - NET_ADAPTER_LINK_LAYER_ADDRESS_INIT(&permanentLinkLayerAddress, sizeof(WDI_MAC_ADDRESS), STAAddress.Address); - NetAdapterSetCurrentLinkLayerAddress(netAdapter, &permanentLinkLayerAddress); - NetAdapterSetPermanentLinkLayerAddress(netAdapter, &permanentLinkLayerAddress); - - // Sample Phase 1 has no datapath support, so setting those values to the default one. - NET_ADAPTER_TX_CAPABILITIES txCaps; - NET_ADAPTER_RX_CAPABILITIES rxCaps; - NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCaps; - - NET_ADAPTER_TX_CAPABILITIES_INIT(&txCaps, 1); - NET_ADAPTER_RX_CAPABILITIES_INIT_SYSTEM_MANAGED(&rxCaps, 1514, 1); - NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCaps, 0, 0); - - NetAdapterSetLinkLayerMtuSize(netAdapter, 1500); - NetAdapterSetLinkLayerCapabilities(netAdapter, &linkLayerCaps); - NetAdapterSetDataPathCapabilities(netAdapter, &txCaps, &rxCaps); + NTSTATUS status = STATUS_SUCCESS; + + NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES wakeMediaChangeCapabilities; + NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES_INIT(&wakeMediaChangeCapabilities); + + wakeMediaChangeCapabilities.MediaConnect = TRUE; + wakeMediaChangeCapabilities.MediaDisconnect = TRUE; + + NetAdapterWakeSetMediaChangeCapabilities(m_handle, &wakeMediaChangeCapabilities); WIFI_ADAPTER_WAKE_CAPABILITIES wakeCap{}; WIFI_ADAPTER_WAKE_CAPABILITIES_INIT(&wakeCap); @@ -52,12 +100,39 @@ NTSTATUS WifiIhvAdapterStart(NETADAPTER netAdapter) { wakeCap.ClientDriverDiagnostic = true; } - WifiAdapterSetWakeCapabilities(netAdapter, &wakeCap); + WifiAdapterSetWakeCapabilities(m_handle, &wakeCap); - NTSTATUS status = NetAdapterStart(netAdapter); - ASSERT(STATUS_SUCCESS == status); + status = NetvAdapter::ConfigureDataCapabilities(); + if (!NT_SUCCESS(status)) + { + WFCError("%!FUNC!: NetvAdapter::ConfigureDataCapabilities failed with %!STATUS!", status); + return status; + } + + status = NetAdapterStart(m_handle); + if (!NT_SUCCESS(status)) + { + WFCError("%!FUNC!: NetAdapterStart failed with %!STATUS!", status); + return status; + } + ASSERT(STATUS_SUCCESS == status); TraceExit(status); return status; } + +NTSTATUS WifiNetvAdapter::CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit) +{ + return NetvAdapter::CreateRxQueue(NetRxQueueInit); +} + +NTSTATUS WifiNetvAdapter::CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit) +{ + return NetvAdapter::CreateTxQueue(NetTxQueueInit); +} + +void WifiNetvAdapter::Destroy(void) +{ + return NetvAdapter::Destroy(); +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h index eb39dee1..ecc597e8 100644 --- a/network/wlan/WIFICX/drivercode/adapter.h +++ b/network/wlan/WIFICX/drivercode/adapter.h @@ -2,6 +2,7 @@ #pragma once #include "device.h" +#include "netvadapter.h" // packet and header sizes #define WIFI_MAX_PACKET_SIZE (1514) @@ -9,9 +10,6 @@ // maximum link speed for send and recv in bps #define WIFI_MEDIA_MAX_SPEED 1'000'000'000 -NTSTATUS WifiIhvInitAdapterContext(_In_ WDFDEVICE Device, _In_ NETADAPTER NetAdapter); -NTSTATUS WifiIhvAdapterStart(_In_ NETADAPTER netAdapter); - // Context for each "Wdi Port"[NetAdapter] instance. // Each NetAdapter instance corresponds to an IP interface typedef struct _WIFI_IHV_NETADAPTER_CONTEXT @@ -21,3 +19,31 @@ typedef struct _WIFI_IHV_NETADAPTER_CONTEXT } WIFI_IHV_NETADAPTER_CONTEXT, * PWIFI_IHV_NETADAPTER_CONTEXT; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_NETADAPTER_CONTEXT, WifiGetIhvNetAdapterContext); + +class WifiNetvAdapter : public NetvAdapter +{ +public: + WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device); + + NTSTATUS + Initialize(); + + NTSTATUS + AdapterStart(); + + NTSTATUS + CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit); + + NTSTATUS + CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit); + + void Destroy(void); + + bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; + +private: + NTSTATUS + NetvAdapterReadAddress() override; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiNetvAdapter, WifiNetvAdapterGetContext); \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index 0fc17ea4..9404b161 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -33,33 +33,67 @@ NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTransl _Use_decl_annotations_ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) { + if (WifiAdapterInitGetType(AdapterInit) != WIFI_ADAPTER_EXTENSIBLE_STATION) + { + WFCError("%!FUNC!: Unsupported adapter type = 0x%x != 0x%x", WifiAdapterInitGetType(AdapterInit), WIFI_ADAPTER_EXTENSIBLE_STATION); + return STATUS_NOT_SUPPORTED; + } - //NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; - //NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks, EvtAdapterCreateTxQueue, EvtAdapterCreateRxQueue); + NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; + NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks, EvtAdapterCreateTxQueue, EvtAdapterCreateRxQueue); - //NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks); + NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks); WDF_OBJECT_ATTRIBUTES adapterAttributes; WDF_OBJECT_ATTRIBUTES_INIT(&adapterAttributes); - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WIFI_IHV_NETADAPTER_CONTEXT); + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WifiNetvAdapter); adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; - NETADAPTER netAdapter{}; - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter), "Failed to create NetAdapter"); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiAdapterInitialize(netAdapter), "Failed to initialize WifiAdapter"); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiIhvInitAdapterContext(Device, netAdapter), "Failed to initialize WifiAdapterContext"); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiIhvAdapterStart(netAdapter), "Failed to start WifiIhvAdapter"); + NETADAPTER netAdapter; + NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: NetAdapterCreate failed, status=0x%x", ntStatus); + return ntStatus; + } + + ntStatus = WifiAdapterInitialize(netAdapter); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiAdapterInitialize failed with %!STATUS!", ntStatus); + return ntStatus; + } + auto wifiNetvAdapter = new (reinterpret_cast(WifiNetvAdapterGetContext(netAdapter))) WifiNetvAdapter(netAdapter, Device); + ntStatus = wifiNetvAdapter->Initialize(); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiNetvAdapter::Initialize failed with %!STATUS!", ntStatus); + return ntStatus; + } + + ntStatus = wifiNetvAdapter->AdapterStart(); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiNetvAdapter::AdapterStart failed with %!STATUS!", ntStatus); + return ntStatus; + } + + WFCInfo("%!FUNC!: Success!"); + return ntStatus; +} - return STATUS_SUCCESS; +_Use_decl_annotations_ +void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) +{ + TraceEntry(); + auto wifiNetvAdapter = WifiNetvAdapterGetContext(NetAdapter); + wifiNetvAdapter->Destroy(); + TraceExit(STATUS_SUCCESS); } + _Use_decl_annotations_ NTSTATUS EvtWifiDeviceCreateWifiDirectDevice(WDFDEVICE, WIFIDIRECT_DEVICE_INIT*) { @@ -69,10 +103,19 @@ NTSTATUS EvtWifiDeviceCreateWifiDirectDevice(WDFDEVICE, WIFIDIRECT_DEVICE_INIT*) return status; } + _Use_decl_annotations_ -void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) +NTSTATUS +EvtAdapterCreateTxQueue(NETADAPTER Adapter, NETTXQUEUE_INIT* Init) { - UNREFERENCED_PARAMETER(NetAdapter); TraceEntry(); - TraceExit(STATUS_SUCCESS); -} \ No newline at end of file + return WifiNetvAdapterGetContext(Adapter)->CreateTxQueue(Init); +} + +_Use_decl_annotations_ +NTSTATUS +EvtAdapterCreateRxQueue(NETADAPTER Adapter, NETRXQUEUE_INIT* Init) +{ + TraceEntry(); + return WifiNetvAdapterGetContext(Adapter)->CreateRxQueue(Init); +} diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h index bf70ba7b..c0dfac3c 100644 --- a/network/wlan/WIFICX/drivercode/device.h +++ b/network/wlan/WIFICX/drivercode/device.h @@ -9,6 +9,9 @@ EVT_WIFI_DEVICE_CREATE_WIFIDIRECTDEVICE EvtWifiDeviceCreateWifiDirectDevice; EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtAdapterCleanup; +EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue; +EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; + typedef struct _WIFI_IHV_DEVICE_CONTEXT { // @@ -19,7 +22,7 @@ typedef struct _WIFI_IHV_DEVICE_CONTEXT void* WdfTriageInfoPtr; WDFDEVICE WdfDevice; TLV_CONTEXT TlvContext; - NETADAPTER primaryStaAdapter; + NETADAPTER netAdapters[5]{}; } WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_DEVICE_CONTEXT, WifiGetIhvDeviceContext); diff --git a/network/wlan/WIFICX/drivercode/memorymanagement.cpp b/network/wlan/WIFICX/drivercode/memorymanagement.cpp index de231d8c..088bad88 100644 --- a/network/wlan/WIFICX/drivercode/memorymanagement.cpp +++ b/network/wlan/WIFICX/drivercode/memorymanagement.cpp @@ -114,12 +114,12 @@ _Ret_writes_bytes_maybenull_(_Size) void* PlacementNewHelper(size_t _Size, PCPLA return nullptr; } -void* __cdecl operator new(size_t Size) +void* __cdecl operator new(size_t Size) noexcept { return AllocateWdfMemoryBuffer(Size, _ReturnAddress()); } -__forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationContext) throw() +__forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationContext) noexcept // for WIFICX TLV { if (AllocationContext != 0) { @@ -128,22 +128,22 @@ __forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationConte return AllocateWdfMemoryBuffer(_Size, _ReturnAddress()); } -void __cdecl operator delete(void* pData) +void __cdecl operator delete(void* pData) noexcept { FreeWdfMemoryBuffer(pData); } -void __cdecl operator delete[](void* pData) +void __cdecl operator delete[](void* pData) noexcept { FreeWdfMemoryBuffer(pData); } -void __cdecl operator delete(void* pData, ULONG_PTR) +void __cdecl operator delete(void* pData, ULONG_PTR) noexcept // For WIFICX TLV { FreeWdfMemoryBuffer(pData); } -void __cdecl operator delete[](void* pData, ULONG_PTR) +void __cdecl operator delete[](void* pData, ULONG_PTR) noexcept // For WIFICX TLV { FreeWdfMemoryBuffer(pData); -} +} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/precomp.h b/network/wlan/WIFICX/drivercode/precomp.h index f6bc3aad..1b0f808e 100644 --- a/network/wlan/WIFICX/drivercode/precomp.h +++ b/network/wlan/WIFICX/drivercode/precomp.h @@ -26,3 +26,8 @@ // WPP Tracing Headers #include "trace.h" + +// Minimal placement-new to match operator new(size_t, void*) +// TLV generator/parser memory interface has the ULONG_PTR version +inline void* operator new(size_t, void* p) noexcept { return p; } +inline void operator delete(void*, void*) noexcept { /* no-op */ } diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 1a5914a6..5283474c 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -57,13 +57,13 @@ NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() { NTSTATUS status = ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) - && (WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter != WDF_NO_HANDLE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY);// In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized + && (WifiGetIhvDeviceContext(m_Device)->netAdapters[0] != WDF_NO_HANDLE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY);// In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized if(NT_SUCCESS(status) == FALSE) { WFCError( "Device not ready for request. Device=%p, primaryStaAdapter=%p", m_Device, - (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->primaryStaAdapter : WDF_NO_HANDLE); + (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->netAdapters[0] : WDF_NO_HANDLE); } return status; } diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index 16842485..0bd8b963 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -40,7 +40,7 @@ 33 true 2 - 4 + 5 4 true 1 @@ -59,7 +59,7 @@ 33 true 2 - 4 + 5 4 true 1 @@ -78,7 +78,7 @@ 33 true 2 - 4 + 5 4 true 1 @@ -97,7 +97,7 @@ 33 true 2 - 4 + 5 4 true 1 @@ -138,10 +138,11 @@ true - $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) true ..\drivercode\trace.h false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -155,11 +156,12 @@ sha256 - $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) true true ..\drivercode\trace.h false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -173,11 +175,12 @@ sha256 - $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) true true ..\drivercode\trace.h false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -191,11 +194,12 @@ sha256 - $(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) true true ..\drivercode\trace.h false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) @@ -232,6 +236,11 @@ + + + {e2a65efd-25cc-4af0-b180-0cd56ee277a9} + + diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj index 85e826d5..a0917a35 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -59,7 +59,7 @@ 35 true 2 - 4 + 5 true 1 2 @@ -72,7 +72,7 @@ 35 true 2 - 4 + 5 true 1 2 @@ -85,7 +85,7 @@ 35 true 2 - 4 + 5 true 1 2 @@ -98,7 +98,7 @@ 35 true 2 - 4 + 5 true 1 2 @@ -132,7 +132,7 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true ..\drivercode\trace.h @@ -149,7 +149,7 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true ..\drivercode\trace.h @@ -166,7 +166,7 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true ..\drivercode\trace.h @@ -183,7 +183,7 @@ sha256 - $(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) true ..\drivercode\trace.h @@ -220,6 +220,11 @@ + + + {612f33ad-430c-4fe7-8000-35e15a5eb757} + + diff --git a/network/wlan/WIFICX/wificxsampleclient.sln b/network/wlan/WIFICX/wificxsampleclient.sln index 0975a4da..d484d08c 100644 --- a/network/wlan/WIFICX/wificxsampleclient.sln +++ b/network/wlan/WIFICX/wificxsampleclient.sln @@ -3,8 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.7.34221.43 MinimumVisualStudioVersion = 12.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" + ProjectSection(ProjectDependencies) = postProject + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} = {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientum", "um\wificxsampleclientum.vcxproj", "{C804D7D0-80D8-1409-44DA-91EF3260D07F}" + ProjectSection(ProjectDependencies) = postProject + {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\..\netadaptercx\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -38,6 +48,30 @@ Global {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.ActiveCfg = Release|x64 {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Build.0 = Release|x64 {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Deploy.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Deploy.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.ActiveCfg = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Build.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Deploy.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Deploy.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Build.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Deploy.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.ActiveCfg = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Build.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Deploy.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.3.1 From 10835ebc2bc4a774907fb47880ffc366b159622c Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 4 Dec 2025 15:30:32 -0800 Subject: Cleanup the KSpinlock.h and replace with WDFSpinlock --- .../netadaptercx/netvadapterlibrary/code/enl.cpp | 21 ++- network/netadaptercx/netvadapterlibrary/code/enl.h | 3 +- .../netvadapterlibrary/code/memory.cpp | 17 ++- .../netadaptercx/netvadapterlibrary/code/memory.h | 3 +- .../netvadapterlibrary/code/rtl/KSpinLock.h | 157 --------------------- 5 files changed, 33 insertions(+), 168 deletions(-) delete mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index 30822900..4087372d 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -241,13 +241,15 @@ enlpCheckAndArmQueue( // arm it. if (ringBuffer->BeginIndex == ringBuffer->EndIndex) { - KAcquireSpinLock lock(Q->Spinlock); + WdfSpinLockAcquire(Q->Spinlock); if (ringBuffer->BeginIndex == ringBuffer->EndIndex) { armed = TRUE; Q->Armed = TRUE; } + + WdfSpinLockRelease(Q->Spinlock); } return armed; @@ -543,6 +545,7 @@ EnlCreateQueue( ENLP_LINK* enlLink; ENLP_PORT* port; ENLP_QUEUE* enlQueue; + NTSTATUS status; if (Tx) // Tx { @@ -580,6 +583,15 @@ EnlCreateQueue( &netvRxQueue->m_adapter, reinterpret_cast(Queue), netvRxQueue); } + // Create WDF spinlock for the queue, parent to the queue's WDF handle + { + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + attributes.ParentObject = enlQueue->Queue->m_handle; + status = WdfSpinLockCreate(&attributes, &enlQueue->Spinlock); + NT_ASSERT(NT_SUCCESS(status)); + } + EnlpResumeThread(&enlLink->EnlThread); return enlQueue; @@ -615,15 +627,16 @@ EnlRingDoorBell( ) { InterlockedExchange((volatile LONG *)&Queue->QueueEnd, (LONG)EndIndex); - - KAcquireSpinLock lock{ Queue->Spinlock }; + WdfSpinLockAcquire(Queue->Spinlock); if (Queue->Armed) { NT_ASSERT(Queue->ArmWaitEvent != NULL); Queue->Armed = FALSE; - lock.Release(); + WdfSpinLockRelease(Queue->Spinlock); Queue->ArmWaitEvent->Set(); + return; } + WdfSpinLockRelease(Queue->Spinlock); } _IRQL_requires_max_(PASSIVE_LEVEL) diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.h b/network/netadaptercx/netvadapterlibrary/code/enl.h index 529c36ac..41f8d11d 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.h +++ b/network/netadaptercx/netvadapterlibrary/code/enl.h @@ -27,7 +27,6 @@ #endif #include "rtl/KWaitEvent.h" -#include "rtl/KSpinLock.h" #define ENL_MAX_PROC_COUNT 16 #define ENLP_PORT_COUNT 2 @@ -209,7 +208,7 @@ struct ENLP_QUEUE ENLP_PORT * EnlPortHandle{}; BOOLEAN Armed{}; - KSpinLock Spinlock{}; + WDFSPINLOCK Spinlock{}; KAutoEvent *ArmWaitEvent{}; ENL_QUEUE_STATE State{}; diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.cpp b/network/netadaptercx/netvadapterlibrary/code/memory.cpp index 0c010d59..b7536531 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/memory.cpp @@ -34,6 +34,13 @@ Memory::Initialize( } m_lastBufferToUse = PREALLOCATED_BUFFERS_COUNT; + // Create WDF spinlock for the queue, parent to the queue's WDF handle + { + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + status = WdfSpinLockCreate(&attributes, &m_spinLock); + NT_ASSERT(NT_SUCCESS(status)); + } return STATUS_SUCCESS; } @@ -56,14 +63,17 @@ Memory::PopAvailableBuffer( void ) { - KAcquireSpinLock lock{ m_spinLock }; + WdfSpinLockAcquire(m_spinLock); if (m_lastBufferToUse == 0) { + WdfSpinLockRelease(m_spinLock); return nullptr; } + auto returnbuffer = m_buffersReadyToUse[--m_lastBufferToUse]; + WdfSpinLockRelease(m_spinLock); - return m_buffersReadyToUse[--m_lastBufferToUse]; + return returnbuffer; } void @@ -71,11 +81,12 @@ Memory::ReturnBuffer( MemoryBuffer* Buffer ) { - KAcquireSpinLock lock{ m_spinLock }; + WdfSpinLockAcquire(m_spinLock); NT_FRE_ASSERT(m_lastBufferToUse < PREALLOCATED_BUFFERS_COUNT); m_buffersReadyToUse[m_lastBufferToUse++] = Buffer; + WdfSpinLockRelease(m_spinLock); } #endif //NETCX 2.6 only diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.h b/network/netadaptercx/netvadapterlibrary/code/memory.h index a07af6b8..4c19fc39 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.h +++ b/network/netadaptercx/netvadapterlibrary/code/memory.h @@ -1,6 +1,5 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once -#include #define MAX_RX_BUFFER_SIZE 65535 @@ -55,7 +54,7 @@ private: size_t m_lastBufferToUse; - KSpinLock + WDFSPINLOCK m_spinLock{}; }; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h deleted file mode 100644 index c344e7bb..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KSpinLock.h +++ /dev/null @@ -1,157 +0,0 @@ -#pragma once - -#include -#define WIN_ASSERT NT_ASSERT - -class KSpinLockBase -{ -protected: - - KSpinLockBase() = default; - - void InitializeBase() - { -#if _KERNEL_MODE - KeInitializeSpinLock(&m_lock); -#else - InitializeSRWLock(&m_lock); -#endif - } - -public: - - KSpinLockBase(KSpinLockBase&) = delete; - KSpinLockBase(KSpinLockBase&&) = delete; - KSpinLockBase& operator=(KSpinLockBase&) = delete; - KSpinLockBase& operator=(KSpinLockBase&&) = delete; - - _Requires_lock_not_held_(*this) - _Acquires_lock_(*this) - _IRQL_requires_max_(DISPATCH_LEVEL) - _IRQL_saves_ - _IRQL_raises_(DISPATCH_LEVEL) - KIRQL Acquire() - { -#if _KERNEL_MODE - KIRQL oldIrql; - KeAcquireSpinLock(&m_lock, &oldIrql); - return oldIrql; -#else - AcquireSRWLockExclusive(&m_lock); - return 0; -#endif - } - - _Requires_lock_held_(*this) - _Releases_lock_(*this) - _IRQL_requires_(DISPATCH_LEVEL) - void Release(_In_ KIRQL oldIrql) - { -#if _KERNEL_MODE - return KeReleaseSpinLock(&m_lock, oldIrql); -#else - UNREFERENCED_PARAMETER(oldIrql); - ReleaseSRWLockExclusive(&m_lock); -#endif - } - - _IRQL_requires_max_(DISPATCH_LEVEL) - bool IsAcquired() - { -#if _KERNEL_MODE - return !KeTestSpinLock(&m_lock); -#else - if (!TryAcquireSRWLockExclusive(&m_lock)) - return false; - - ReleaseSRWLockExclusive(&m_lock); - return true; -#endif - } - -private: - -#if _KERNEL_MODE - KSPIN_LOCK m_lock; -#else - SRWLOCK m_lock; -#endif -}; - -class KSpinLock : public KSpinLockBase -{ -public: - - KSpinLock() - { - InitializeBase(); - } -}; - -class KSpinLockManualConstruct : public KSpinLockBase -{ -public: - - KSpinLockManualConstruct() = default; - - void Initialize() - { - InitializeBase(); - } -}; - -class KAcquireSpinLock -{ -public: - - _Requires_lock_not_held_(lock) - _Acquires_lock_(lock) - _IRQL_requires_max_(DISPATCH_LEVEL) - _IRQL_raises_(DISPATCH_LEVEL) - KAcquireSpinLock(KSpinLockBase &lock) : - m_lock(lock) - { - Acquire(); - } - - _Requires_lock_held_(this->m_lock) - _Releases_lock_(this->m_lock) - _IRQL_requires_(DISPATCH_LEVEL) - ~KAcquireSpinLock() - { - if (IsAcquired()) - Release(); - } - - _Requires_lock_not_held_(this->m_lock) - _Acquires_lock_(this->m_lock) - _IRQL_requires_max_(DISPATCH_LEVEL) - _IRQL_raises_(DISPATCH_LEVEL) - void Acquire() - { - WIN_ASSERT(!IsAcquired()); - m_oldIrql = m_lock.Acquire(); - } - - _Requires_lock_held_(this->m_lock) - _Releases_lock_(this->m_lock) - _IRQL_requires_(DISPATCH_LEVEL) - void Release() - { - WIN_ASSERT(IsAcquired()); - m_lock.Release(m_oldIrql); - m_oldIrql = NOT_ACQUIRED; - } - - _IRQL_requires_max_(DISPATCH_LEVEL) - bool IsAcquired() - { - return m_oldIrql != NOT_ACQUIRED; - } - -private: - - static const KIRQL NOT_ACQUIRED = (KIRQL)-1; - KIRQL m_oldIrql = NOT_ACQUIRED; - KSpinLockBase &m_lock; -}; -- cgit v1.3.1 From fcb9e29e5dfe0c36b9090fbcb43c832af3599907 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 4 Dec 2025 15:56:22 -0800 Subject: bring back the KPushLock --- .../netadaptercx/netvadapterlibrary/code/enl.cpp | 3 +- network/netadaptercx/netvadapterlibrary/code/enl.h | 2 + .../netvadapterlibrary/code/rtl/KCriticalRegion.h | 2 +- .../netvadapterlibrary/code/rtl/KDebug.h | 31 ------ .../netvadapterlibrary/code/rtl/KLockHolder.h | 2 +- .../netvadapterlibrary/code/rtl/KPushLock.h | 106 +++++++++++++++++++-- .../netvadapterlibrary/code/rtl/KWaitEvent.h | 2 +- 7 files changed, 103 insertions(+), 45 deletions(-) delete mode 100644 network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index 4087372d..4d4120b8 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -6,6 +6,7 @@ #include "txqueue.h" #include "trace.h" #include "memory.h" +#include "rtl\KLockHolder.h" #include "enl.tmh" /////////////////////////////////////////////////////////////////////////////// @@ -759,7 +760,7 @@ EnlDeactivateLinkPort( ULONG i; NT_FRE_ASSERT(EnlIsPortActive(EnlLink, PortIndex)); - //KLockThisExclusive(EnlLink->Lock); + KLockThisExclusive(EnlLink->Lock); NT_FRE_ASSERT(!EnlpIsThreadPaused(&EnlLink->EnlThread)); EnlpPauseThread(&EnlLink->EnlThread); diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.h b/network/netadaptercx/netvadapterlibrary/code/enl.h index 41f8d11d..2927a582 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.h +++ b/network/netadaptercx/netvadapterlibrary/code/enl.h @@ -27,6 +27,7 @@ #endif #include "rtl/KWaitEvent.h" +#include "rtl/KPushLock.h" #define ENL_MAX_PROC_COUNT 16 #define ENLP_PORT_COUNT 2 @@ -237,6 +238,7 @@ struct DECLSPEC_ALIGN(PAGE_SIZE) ENLP_PORT struct ENLP_LINK { + KPushLock Lock{}; ULONG64 Ts{}; ULONG64 BusyTicks{}; ULONG64 EmptyTicks{}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h index 3f226355..0bbedadb 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KCriticalRegion.h @@ -1,4 +1,4 @@ - +// Copyright (C) Microsoft Corporation. All rights reserved. #pragma once #include diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h deleted file mode 100644 index d90e6056..00000000 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KDebug.h +++ /dev/null @@ -1,31 +0,0 @@ - -#pragma once - -#include - -template -struct KRTL_CLASS NdisDebugBlock -{ -#if DBG - PAGED ~NdisDebugBlock() - { - ASSERT_VALID(); - Signature |= 0x80; - } -#endif - - _IRQL_requires_max_(HIGH_LEVEL) - NONPAGEDX bool ASSERT_VALID() const - { -#if DBG - return NT_VERIFY(Signature == SIGNATURE); -#else - return true; -#endif - } - -private: -#if DBG - ULONG Signature = SIGNATURE; -#endif -}; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h index 1e21c0f2..d398f137 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KLockHolder.h @@ -1,4 +1,4 @@ - +// Copyright (C) Microsoft Corporation. All rights reserved. #pragma once #include diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h index 81c58071..c589866c 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KPushLock.h @@ -1,3 +1,4 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. #pragma once @@ -5,6 +6,7 @@ #include typedef struct _KTHREAD *PKTHREAD; +// Copyright (C) Microsoft Corporation. All rights reserved. class KPushLockBase { @@ -14,21 +16,90 @@ public: KPushLockBase(KPushLockBase &) = delete; KPushLockBase & operator=(KPushLockBase &) = delete; - PAGED void AcquireShared(); + PAGED + void + KPushLockBase::AcquireShared() + { +#ifdef _KERNEL_MODE + ExAcquirePushLockShared(&m_Lock); +#else + AcquireSRWLockShared(&m_Lock); +#endif + } - PAGED void ReleaseShared(); + PAGED + void + KPushLockBase::ReleaseShared() + { +#ifdef _KERNEL_MODE + ExReleasePushLockShared(&m_Lock); +#else + ReleaseSRWLockShared(&m_Lock); +#endif + } - PAGED void AcquireExclusive(); + PAGED + void + KPushLockBase::AcquireExclusive() + { +#ifdef _KERNEL_MODE + ExAcquirePushLockExclusive(&m_Lock); +#if DBG + m_ExclusiveOwner = KeGetCurrentThread(); +#endif +#else + AcquireSRWLockExclusive(&m_Lock); +#endif - PAGED void ReleaseExclusive(); + } - PAGED void AssertLockHeld(); + PAGED + void + KPushLockBase::ReleaseExclusive() + { +#if DBG + m_ExclusiveOwner = nullptr; +#endif +#ifdef _KERNEL_MODE + ExReleasePushLockExclusive(&m_Lock); +#else + ReleaseSRWLockExclusive(&m_Lock); +#endif + } - PAGED void AssertLockNotHeld(); + PAGED + void + KPushLockBase::AssertLockHeld() + { +#ifdef _KERNEL_MODE + WIN_ASSERT(m_ExclusiveOwner == KeGetCurrentThread()); +#endif + } + + PAGED + void + KPushLockBase::AssertLockNotHeld() + { +#if DBG && defined(_KERNEL_MODE) + WIN_ASSERT(m_ExclusiveOwner != KeGetCurrentThread()); +#endif + } protected: - PAGED void InitializeInner(); + PAGED + void + KPushLockBase::InitializeInner() + { +#ifdef _KERNEL_MODE + ExInitializePushLock(&m_Lock); +#else + InitializeSRWLock(&m_Lock); +#endif +#if DBG + m_ExclusiveOwner = nullptr; +#endif + } private: @@ -47,15 +118,30 @@ class KPushLock : public KPushLockBase { public: - PAGED KPushLock() noexcept; + PAGED + KPushLock::KPushLock() noexcept + { + InitializeInner(); + } + + - PAGED ~KPushLock(); + PAGED + KPushLock::~KPushLock() + { + AssertLockNotHeld(); + } }; class KPushLockManualConstruct : public KPushLockBase { public: - PAGED void Initialize(); + PAGED + void + KPushLockManualConstruct::Initialize() + { + InitializeInner(); + } }; diff --git a/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h b/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h index d1287f5b..124f416e 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h +++ b/network/netadaptercx/netvadapterlibrary/code/rtl/KWaitEvent.h @@ -1,4 +1,4 @@ - +// Copyright (C) Microsoft Corporation. All rights reserved. #pragma once #include -- cgit v1.3.1 From e6d3536e4873fb928f2cc9683df05718fddc8923 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Sat, 6 Dec 2025 18:29:41 -0800 Subject: Fix build break for NETCX2.6 only APIs --- .../netadaptercx/netvadapterlibrary/code/queue.cpp | 2 ++ .../netadaptercx/netvadapterlibrary/code/queue.h | 2 ++ network/wlan/WIFICX/drivercode/device.cpp | 3 +++ network/wlan/WIFICX/drivercode/wifihal.cpp | 27 ++++++++++------------ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.cpp b/network/netadaptercx/netvadapterlibrary/code/queue.cpp index f4a12c2a..cf2aa586 100644 --- a/network/netadaptercx/netvadapterlibrary/code/queue.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/queue.cpp @@ -33,6 +33,7 @@ NetvQueue::GetFragmentRing( return NetRingCollectionGetFragmentRing(m_rings); } +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) NET_RING * NetvQueue::GetNetMemoryReturnRing( void @@ -40,3 +41,4 @@ NetvQueue::GetNetMemoryReturnRing( { return NetRingCollectionGetFragmentReturnContextRing(m_rings); } +#endif // NETCX 2.6 only \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.h b/network/netadaptercx/netvadapterlibrary/code/queue.h index 64012298..da101fd3 100644 --- a/network/netadaptercx/netvadapterlibrary/code/queue.h +++ b/network/netadaptercx/netvadapterlibrary/code/queue.h @@ -26,10 +26,12 @@ public: void ); +#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) NET_RING * GetNetMemoryReturnRing( void ); +#endif // NETCX 2.6 only NETPACKETQUEUE const m_handle{WDF_NO_HANDLE}; diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index 9404b161..31639c9f 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -80,6 +80,9 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn return ntStatus; } + auto wifiNetvDevice = WifiGetIhvDeviceContext(Device); + wifiNetvDevice->netAdapters[WifiAdapterGetPortId(netAdapter)] = netAdapter; + WFCInfo("%!FUNC!: Success!"); return ntStatus; } diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 5283474c..29de321b 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -606,10 +606,9 @@ NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParam NT_ASSERT(m_LastConnectEntryId == 0); if (m_LastConnectEntryId != 0) // Not Disconnected State { -#ifdef WIFI_IHV_NETV - DeleteDatapathPeer( - deviceContext->netAdapters[pWdiHeader->PortId], reinterpret_cast(&deviceContext->ConnectedPeer)); -#endif // WIFI_IHV_NETV + WifiAdapterRemovePeer( + WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], + reinterpret_cast(&m_ConnectedPeer)); } WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( @@ -704,11 +703,9 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( UINT32 NewConnectEntryId = 0; // Disconnected State WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; UCHAR pucData[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10 }; -#ifdef WIFI_IHV_NETV - WifiNetvDevice* pDeviceContext = WifiNetvDeviceGetContext(Device); -#else + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); -#endif // WIFI_IHV_NETV + ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; do @@ -727,12 +724,10 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( NewConnectEntryId = connectEntry; m_LastConnectTransactionId = pWdiHeader->TransactionId; -#ifdef WIFI_IHV_NETV + // add peer on datapath - AddDatapathPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], + WifiAdapterAddPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], reinterpret_cast(g_ConnectEntries[connectEntry].pMacAddress)); -#endif // WIFI_IHV_NETV - #ifdef WIFI_IHV_HANDSHAKE // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. RecieveDatapathFrame(0x33, sizeof(pucData), pucData); @@ -976,9 +971,11 @@ NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const m_LastConnectEntryId = 0; // Disconnected State -#ifdef WIFI_IHV_NETV - DeleteDatapathPeer(0x33); -#endif + WifiAdapterRemovePeer( + WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], + reinterpret_cast(&m_ConnectedPeer)); + + RtlZeroMemory(&m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); return STATUS_SUCCESS; } -- cgit v1.3.1 From 5d296ca7451db754f37261df544a032bf23b12fb Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 8 Dec 2025 11:38:51 -0800 Subject: Remove NETCX2.6 depend features --- .../netvadapterlibrary/Interface/netvadapter.h | 6 -- .../netvadapterlibrary/code/adapter.cpp | 45 +---------- .../netadaptercx/netvadapterlibrary/code/enl.cpp | 49 ++---------- .../netvadapterlibrary/code/memory.cpp | 87 ---------------------- .../netadaptercx/netvadapterlibrary/code/memory.h | 58 --------------- .../netadaptercx/netvadapterlibrary/code/queue.cpp | 10 --- .../netadaptercx/netvadapterlibrary/code/queue.h | 7 -- 7 files changed, 6 insertions(+), 256 deletions(-) diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h index d8e4294f..f4160dfa 100644 --- a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -66,12 +66,6 @@ public: WDFDEVICE m_device = WDF_NO_HANDLE; -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - BOOLEAN PreallocatedRxBuffers; - NETMEMORYCOLLECTION - m_preallocatedRxBuffers = WDF_NO_HANDLE; -#endif //NETCX 2.6 only - // configuration NET_ADAPTER_LINK_LAYER_ADDRESS PermanentAddress; NET_ADAPTER_LINK_LAYER_ADDRESS CurrentAddress; diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp index a047f163..5dc530ea 100644 --- a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp @@ -431,57 +431,14 @@ NetvAdapterSetUsoUroOffloadCapabilities( _Use_decl_annotations_ NTSTATUS NetvAdapter::ConfigureDataCapabilities() { -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - if (PreallocatedRxBuffers) - { - WDF_OBJECT_ATTRIBUTES attributes; - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, Memory); - attributes.EvtDestroyCallback = [](WDFOBJECT Object) - { - Memory* memory = GetMemoryFromHandle(Object); - memory->~Memory(); - }; - - attributes.EvtCleanupCallback = [](WDFOBJECT Object) - { - Memory* memory = GetMemoryFromHandle(Object); - memory->ReleaseAllMappings(); - }; - - NET_MEMORY_COLLECTION_CONFIG collectionConfig; - NET_MEMORY_COLLECTION_CONFIG_INIT( - &collectionConfig, - PREALLOCATED_BUFFERS_COUNT); - - RETURN_IF_NOT_STATUS_SUCCESS( - NetMemoryCollectionCreate( - m_device, - &attributes, - &collectionConfig, - &m_preallocatedRxBuffers)); - Memory* memory = new (GetMemoryFromHandle(m_preallocatedRxBuffers)) Memory(); - RETURN_IF_NOT_STATUS_SUCCESS( - memory->Initialize( - m_preallocatedRxBuffers, - MAX_RX_BUFFER_SIZE - )); - } -#endif //NETCX 2.6 only NET_ADAPTER_TX_CAPABILITIES txCapabilities; NET_ADAPTER_TX_CAPABILITIES_INIT(&txCapabilities, MAX_TX_QUEUES); NET_ADAPTER_RX_CAPABILITIES rxCapabilities; NET_ADAPTER_RX_CAPABILITIES_INIT_SYSTEM_MANAGED(&rxCapabilities, MAX_RX_BUFFER_SIZE, MAX_RX_QUEUES); -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - if (PreallocatedRxBuffers) - { - rxCapabilities.AllocationMode = NetRxFragmentBufferAllocationModeDriverV2; - rxCapabilities.AttachmentMode = NetRxFragmentBufferAttachmentModeDriver; - rxCapabilities.MemoryCollection = m_preallocatedRxBuffers; - } -#endif //NETCX 2.6 only + NET_ADAPTER_LINK_LAYER_CAPABILITIES linkLayerCapabilities; NET_ADAPTER_LINK_LAYER_CAPABILITIES_INIT(&linkLayerCapabilities, MAX_LINK_SPEED, MAX_LINK_SPEED); diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index 4d4120b8..0a7d53d3 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -348,52 +348,13 @@ EnlpIterationRoutine( auto fragment = NetFragmentIteratorGetFragment(&rxFi); BYTE* fragmentBuffer = nullptr; -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - if (rxq->RxQueue->m_adapter.PreallocatedRxBuffers) - { - MemoryBuffer* bufferToUse = GetMemoryFromHandle(rxq->RxQueue->m_adapter.m_preallocatedRxBuffers)->PopAvailableBuffer(); - if (bufferToUse == nullptr) - { - // No more buffers available, stop processing packets - rxq->QueueNext = NetFragmentIteratorGetIndex(&rxFi); - break; - } - - NET_FRAGMENT_NET_MEMORY* netMemoryId = - NetExtensionGetFragmentNetMemory( - &rxq->RxQueue->NetMemoryExtension, - NetFragmentIteratorGetIndex(&rxFi)); - - NET_FRAGMENT_RETURN_CONTEXT* fragmentReturnContext = - NetExtensionGetFragmentReturnContext( - &rxq->RxQueue->NetMemoryReturnContextExtensionIn, - NetFragmentIteratorGetIndex(&rxFi)); - - netMemoryId->NetMemoryId = bufferToUse->MemoryId; - fragmentReturnContext->Handle = reinterpret_cast(bufferToUse); - fragmentBuffer = bufferToUse->VirtualAddress; - auto const rxVirtualAddress = - NetExtensionGetFragmentVirtualAddress( - &rxq->RxQueue->VirtualAddressExtension, - NetFragmentIteratorGetIndex(&rxFi)); + auto const rxVirtualAddress = + NetExtensionGetFragmentVirtualAddress( + &rxq->RxQueue->VirtualAddressExtension, + NetFragmentIteratorGetIndex(&rxFi)); - rxVirtualAddress->VirtualAddress = bufferToUse->VirtualAddress; - - fragment->Capacity = MAX_RX_BUFFER_SIZE; - fragment->Offset = 0; - fragment->Scratch = 0; - } - else -#endif //NETCX 2.6 only - { - auto const rxVirtualAddress = - NetExtensionGetFragmentVirtualAddress( - &rxq->RxQueue->VirtualAddressExtension, - NetFragmentIteratorGetIndex(&rxFi)); - - fragmentBuffer = static_cast(rxVirtualAddress->VirtualAddress); - } + fragmentBuffer = static_cast(rxVirtualAddress->VirtualAddress); fragment->Offset = 0; fragment->ValidLength = diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.cpp b/network/netadaptercx/netvadapterlibrary/code/memory.cpp index b7536531..35a3f2c5 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/memory.cpp @@ -1,95 +1,8 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #include "pch.hpp" #include "memory.h" -#include -#include "trace.h" #include "memory.tmh" -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - -NTSTATUS -Memory::Initialize( - NETMEMORYCOLLECTION MemoryCollection, - size_t BufferSize -) -{ - m_memoryCollection = MemoryCollection; - - for (size_t i = 0; i < PREALLOCATED_BUFFERS_COUNT; i++) - { - NET_MEMORY_CONFIG memoryConfig{}; - NET_MEMORY_CONFIG_INIT( - &memoryConfig, - m_buffers[i].VirtualAddress, - BufferSize); - - RETURN_IF_NOT_STATUS_SUCCESS( - NetMemoryCreate( - MemoryCollection, - &memoryConfig, - &m_buffers[i].MemoryId - )); - - m_buffersReadyToUse[i] = &m_buffers[i]; - } - - m_lastBufferToUse = PREALLOCATED_BUFFERS_COUNT; - // Create WDF spinlock for the queue, parent to the queue's WDF handle - { - WDF_OBJECT_ATTRIBUTES attributes; - WDF_OBJECT_ATTRIBUTES_INIT(&attributes); - status = WdfSpinLockCreate(&attributes, &m_spinLock); - NT_ASSERT(NT_SUCCESS(status)); - } - return STATUS_SUCCESS; -} - -void -Memory::ReleaseAllMappings( - void -) -{ - for (size_t i = 0; i < PREALLOCATED_BUFFERS_COUNT; i++) - { - NetMemoryDestroy(m_memoryCollection, m_buffers[i].MemoryId); - } - - m_lastBufferToUse = 0; - RtlZeroMemory(m_buffersReadyToUse, sizeof(m_buffersReadyToUse)); -} - -MemoryBuffer* -Memory::PopAvailableBuffer( - void -) -{ - WdfSpinLockAcquire(m_spinLock); - - if (m_lastBufferToUse == 0) - { - WdfSpinLockRelease(m_spinLock); - return nullptr; - } - auto returnbuffer = m_buffersReadyToUse[--m_lastBufferToUse]; - WdfSpinLockRelease(m_spinLock); - - return returnbuffer; -} - -void -Memory::ReturnBuffer( - MemoryBuffer* Buffer -) -{ - WdfSpinLockAcquire(m_spinLock); - - NT_FRE_ASSERT(m_lastBufferToUse < PREALLOCATED_BUFFERS_COUNT); - - m_buffersReadyToUse[m_lastBufferToUse++] = Buffer; - WdfSpinLockRelease(m_spinLock); -} -#endif //NETCX 2.6 only - // for wil::make_unique_nothrow void* operator new(size_t s, std::nothrow_t const&) diff --git a/network/netadaptercx/netvadapterlibrary/code/memory.h b/network/netadaptercx/netvadapterlibrary/code/memory.h index 4c19fc39..1200c72c 100644 --- a/network/netadaptercx/netvadapterlibrary/code/memory.h +++ b/network/netadaptercx/netvadapterlibrary/code/memory.h @@ -2,61 +2,3 @@ #pragma once #define MAX_RX_BUFFER_SIZE 65535 - -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - -static const size_t PREALLOCATED_BUFFERS_COUNT = 128; - -struct MemoryBuffer -{ - NET_MEMORY_ID - MemoryId; - - BYTE - VirtualAddress[MAX_RX_BUFFER_SIZE]; -}; - -class Memory -{ -public: - - NTSTATUS - Initialize( - NETMEMORYCOLLECTION MemoryCollection, - size_t BufferSize - ); - - MemoryBuffer* - PopAvailableBuffer( - void - ); - - void - ReturnBuffer( - MemoryBuffer* Buffer - ); - - void - ReleaseAllMappings( - void - ); - -private: - NETMEMORYCOLLECTION - m_memoryCollection; - - MemoryBuffer - m_buffers[PREALLOCATED_BUFFERS_COUNT]; - - MemoryBuffer* - m_buffersReadyToUse[PREALLOCATED_BUFFERS_COUNT]; - - size_t - m_lastBufferToUse; - - WDFSPINLOCK - m_spinLock{}; -}; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(Memory, GetMemoryFromHandle); -#endif //NETCX 2.6 only \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.cpp b/network/netadaptercx/netvadapterlibrary/code/queue.cpp index cf2aa586..667d59f7 100644 --- a/network/netadaptercx/netvadapterlibrary/code/queue.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/queue.cpp @@ -32,13 +32,3 @@ NetvQueue::GetFragmentRing( { return NetRingCollectionGetFragmentRing(m_rings); } - -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) -NET_RING * -NetvQueue::GetNetMemoryReturnRing( - void -) -{ - return NetRingCollectionGetFragmentReturnContextRing(m_rings); -} -#endif // NETCX 2.6 only \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/code/queue.h b/network/netadaptercx/netvadapterlibrary/code/queue.h index da101fd3..becb72ce 100644 --- a/network/netadaptercx/netvadapterlibrary/code/queue.h +++ b/network/netadaptercx/netvadapterlibrary/code/queue.h @@ -26,13 +26,6 @@ public: void ); -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - NET_RING * - GetNetMemoryReturnRing( - void - ); -#endif // NETCX 2.6 only - NETPACKETQUEUE const m_handle{WDF_NO_HANDLE}; -- cgit v1.3.1 From 4372ea08facd248da112eec0aed34d4e512b6236 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 8 Dec 2025 13:17:58 -0800 Subject: have the last Mac byte feature --- .../netvadapterlibrary/Interface/netvadapter.h | 2 +- .../netvadapterlibrary/code/configuration.cpp | 3 -- network/wlan/WIFICX/drivercode/adapter.cpp | 55 ---------------------- network/wlan/WIFICX/drivercode/adapter.h | 11 +---- network/wlan/WIFICX/drivercode/device.cpp | 4 ++ network/wlan/WIFICX/km/wificxsampleclientkm.inf | 12 ++++- network/wlan/WIFICX/um/wificxsampleclientum.inf | 12 ++++- 7 files changed, 29 insertions(+), 70 deletions(-) diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h index f4160dfa..88976291 100644 --- a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -108,7 +108,7 @@ private: ) const; - virtual NTSTATUS NetvAdapterReadAddress(); + NTSTATUS NetvAdapterReadAddress(); }; extern NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter); diff --git a/network/netadaptercx/netvadapterlibrary/code/configuration.cpp b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp index 360cc43d..7482ef84 100644 --- a/network/netadaptercx/netvadapterlibrary/code/configuration.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/configuration.cpp @@ -28,9 +28,6 @@ NETVADAPTER_ADVANCED_PROPERTY NetvSupportedProperties[] = { CONSTANT_UNICODE_STRING(L"LinkProcIndex"), NETV_OFFSET(LinkProcIndex), NETV_SIZE(LinkProcIndex), 1000, 0, 1023 }, { CONSTANT_UNICODE_STRING(L"S0Idle"), NETV_OFFSET(S0Idle), NETV_SIZE(S0Idle), 0, 0, 1 }, { CONSTANT_UNICODE_STRING(L"EnableUsoUro"), NETV_OFFSET(EnableUsoUro), NETV_SIZE(EnableUsoUro), 0, 0, 1 }, -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - { CONSTANT_UNICODE_STRING(L"PreallocatedRxBuffers"), NETV_OFFSET(PreallocatedRxBuffers), NETV_SIZE(PreallocatedRxBuffers), 0, 0, 1 }, -#endif //NETCX 2.6 only }; NTSTATUS diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp index b2f736b9..fd44c72b 100644 --- a/network/wlan/WIFICX/drivercode/adapter.cpp +++ b/network/wlan/WIFICX/drivercode/adapter.cpp @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. #include "precomp.h" - -#include "device.h" - #include "adapter.h" #include "adapter.tmh" @@ -28,58 +25,6 @@ NTSTATUS WifiNetvAdapter::Initialize() return NetvAdapter::Initialize(); } -// the Xfilter.h should be included in the share(currently in km only) -#ifndef _KERNEL_MODE -// -// This macro is used to copy from one network address to -// another. -// -#define ETH_COPY_NETWORK_ADDRESS(_D, _S) \ -{ \ - *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ - *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ -} -// -// ZZZ This is a little-endian specific check. -// -#define ETH_IS_MULTICAST(Address) \ - (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x01)) - -// -// Check whether an address is broadcast. -// -#define ETH_IS_BROADCAST(Address) \ - ((((PUCHAR)(Address))[0] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[1] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[2] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[3] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[4] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[5] == ((UCHAR)0xff))) - -#endif // _KERNEL_MODE - -NTSTATUS WifiNetvAdapter::NetvAdapterReadAddress() -{ - UCHAR MACLastByteFinial = (UCHAR)MACLastByte; - if (MACLastByteFinial == 0) - { - MACLastByteFinial++; - } - - PermanentAddress.Length = MAC_ADDR_LEN; - - ETH_COPY_NETWORK_ADDRESS(PermanentAddress.Address, NetvMacAddressBase); - PermanentAddress.Address[MAC_ADDR_LEN - 1] = MACLastByteFinial; - if (ETH_IS_MULTICAST(PermanentAddress.Address) || ETH_IS_BROADCAST(PermanentAddress.Address)) - { - WFCError("%!FUNC!: Failed with %!STATUS!", STATUS_INVALID_ADDRESS); - return STATUS_INVALID_ADDRESS; - } - - RtlCopyMemory(&CurrentAddress, &PermanentAddress, sizeof(PermanentAddress)); - - EnlIndex = (MACLastByteFinial - 1) >> 1; - EnlPortIndex = (MACLastByteFinial - 1) & 1; - EnlIndexValid = TRUE; - - return STATUS_SUCCESS; -} - NTSTATUS WifiNetvAdapter::AdapterStart() { TraceEntry(); diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h index ecc597e8..0b7aa093 100644 --- a/network/wlan/WIFICX/drivercode/adapter.h +++ b/network/wlan/WIFICX/drivercode/adapter.h @@ -1,14 +1,10 @@ // Copyright (C) Microsoft Corporation. All rights reserved. #pragma once - #include "device.h" #include "netvadapter.h" -// packet and header sizes -#define WIFI_MAX_PACKET_SIZE (1514) - -// maximum link speed for send and recv in bps -#define WIFI_MEDIA_MAX_SPEED 1'000'000'000 +// for STA TX DEMUX +#define MaxNumOfPeers 1 // Context for each "Wdi Port"[NetAdapter] instance. // Each NetAdapter instance corresponds to an IP interface @@ -41,9 +37,6 @@ public: bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; -private: - NTSTATUS - NetvAdapterReadAddress() override; }; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiNetvAdapter, WifiNetvAdapterGetContext); \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index 31639c9f..d251121d 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -49,6 +49,10 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WifiNetvAdapter); adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; + WIFI_ADAPTER_TX_DEMUX peerInfoDemux; + WIFI_ADAPTER_TX_PEER_ADDRESS_DEMUX_INIT(&peerInfoDemux, MaxNumOfPeers); + WifiAdapterInitAddTxDemux(AdapterInit, &peerInfoDemux); + NETADAPTER netAdapter; NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); if (!NT_SUCCESS(ntStatus)) diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf index a29d9721..1968ff32 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.inf +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.inf @@ -37,7 +37,7 @@ wificxsampleclientkm.sys = 1,, CopyFiles = File_Copy Characteristics = 0x84 ; NCF_HAS_UI, NCF_PHYSICAL BusType = 0 ; Internal -AddReg = wificxsampleclientkm.reg +AddReg = wificxsampleclientkm.reg, netvadapter.params *IfType = 71 ; IF_TYPE_IEEE80211 *MediaType = 16 ; NdisMediumNative802_11 *PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 @@ -84,3 +84,13 @@ ManufacturerName = "WDK Sample" DiskName = "Wificxsampleclientkm Installation Disk" wificxsampleclientkm.DeviceDesc = "[KMDF]Wificx Sample Client Device" wificxsampleclientkm.SVCDESC = "Wificxsampleclientkm Service" + +[netvadapter.params] +; MACLastByte + HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" + HKR, Ndi\params\MACLastByte, default, 0, "1" + HKR, Ndi\params\MACLastByte, type, 0, "int" + HKR, Ndi\params\MACLastByte, min, 0, "1" + HKR, Ndi\params\MACLastByte, max, 0, "254" + HKR, Ndi\params\MACLastByte, step, 0, "1" + HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf index 35477349..98633234 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.inf +++ b/network/wlan/WIFICX/um/wificxsampleclientum.inf @@ -31,7 +31,7 @@ Characteristics = 0x1 ; NCF_VIRTUAL *PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 BusType = 15 ; PnpBus NumberOfNetworkInterfaces = 5 -AddReg = Wificxsampleclientum.reg +AddReg = Wificxsampleclientum.reg, netvadapter.params CopyFiles = Wificxsampleclientum.Copy [Wificxsampleclientum_Device.ndi.Hw] @@ -95,3 +95,13 @@ wificxsampleclientum.dll = 1 ManufacturerName = "WDK Sample" DiskName = "wificxsampleclientum Installation Disk" DeviceName = "[UMDF] Wificx Sample Client Device" + +[netvadapter.params] +; MACLastByte + HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" + HKR, Ndi\params\MACLastByte, default, 0, "1" + HKR, Ndi\params\MACLastByte, type, 0, "int" + HKR, Ndi\params\MACLastByte, min, 0, "1" + HKR, Ndi\params\MACLastByte, max, 0, "254" + HKR, Ndi\params\MACLastByte, step, 0, "1" + HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file -- cgit v1.3.1 From eb4a87e545f33af410b15c6c86100c165c0eda2a Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Mon, 8 Dec 2025 15:23:39 -0800 Subject: Remove the TX demx support as ENL limiation. --- .../netvadapterlibrary/Interface/netvadapter.h | 3 ++ .../netadaptercx/netvadapterlibrary/code/enl.cpp | 7 ++-- .../netvadapterlibrary/code/rxqueue.cpp | 37 +--------------------- network/wlan/WIFICX/drivercode/device.cpp | 3 ++ network/wlan/WIFICX/drivercode/wifihal.cpp | 9 ++++-- 5 files changed, 16 insertions(+), 43 deletions(-) diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h index 88976291..b8474a9b 100644 --- a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -9,6 +9,9 @@ #define NETV_NUMBER_OF_QUEUES 1 +#define NETV_SUPPORT_RSS FALSE // RSS not supported due to ENL limitations +#define NETV_SUPPORT_TX_DEMUXING FALSE // TX Demuxing not supported due to ENL limitations + // supported filters #define NETV_SUPPORTED_FILTERS ( \ NetPacketFilterFlagDirected | \ diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index 0a7d53d3..fb763330 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -668,10 +668,10 @@ EnlIsPortActive( { ENLP_PORT* port = &EnlLink->Ports[PortIndex]; ENLP_QUEUE* txq = &port->TxQueue[0]; - + ENLP_QUEUE* rxq = &port->RxQueue[0]; NT_FRE_ASSERT(PortIndex < ENLP_PORT_COUNT); - return (txq->Queue == nullptr) ? FALSE : TRUE; + return (txq->Queue == nullptr && rxq->Queue == nullptr) ? FALSE : TRUE; } _IRQL_requires_max_(PASSIVE_LEVEL) @@ -718,7 +718,6 @@ EnlDeactivateLinkPort( ENLP_PORT* port = &EnlLink->Ports[PortIndex]; LogInformation(FLAG_DRIVER, L"PortIndex=%u Queue=%p", PortIndex, port->TxQueue[0].Queue); - ULONG i; NT_FRE_ASSERT(EnlIsPortActive(EnlLink, PortIndex)); KLockThisExclusive(EnlLink->Lock); @@ -737,7 +736,7 @@ EnlDeactivateLinkPort( // As long as there's one port with active queues, the EnlThread will run. - for (i = 0; i < ENLP_PORT_COUNT; i++) + for (ULONG i = 0; i < ENLP_PORT_COUNT; i++) { if (EnlIsPortActive(EnlLink, i)) { diff --git a/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp index d0b87f9e..6eed638c 100644 --- a/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/rxqueue.cpp @@ -68,26 +68,7 @@ NetvRxQueue::NetvRxQueue( NetExtensionTypePacket); NetRxQueueGetExtension(m_handle, &extension, &RxXSumExtension); -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - if (Adapter.PreallocatedRxBuffers) - { - NET_EXTENSION_QUERY_INIT( - &extension, - NET_FRAGMENT_EXTENSION_NET_MEMORY_NAME, - NET_FRAGMENT_EXTENSION_NET_MEMORY_VERSION_1, - NetExtensionTypeFragment); - - NetRxQueueGetExtension(m_handle, &extension, &NetMemoryExtension); - - NET_EXTENSION_QUERY_INIT( - &extension, - NET_FRAGMENT_EXTENSION_RETURN_CONTEXT_NAME, - NET_FRAGMENT_EXTENSION_RETURN_CONTEXT_VERSION_1, - NetExtensionTypeFragment); - NetRxQueueGetExtension(m_handle, &extension, &NetMemoryReturnContextExtensionIn); - } -#endif //NETCX 2.6 only EnlQueueHandle = EnlCreateQueue(Handle, RX); } @@ -150,23 +131,7 @@ NetvRxQueue::Advance( break; } } -#if ((NETADAPTER_VERSION_MAJOR == 2) && (NETADAPTER_VERSION_MINOR >= 6)) - if (m_adapter.PreallocatedRxBuffers) - { - NET_RING* dataBufferRing = GetNetMemoryReturnRing(); - while (dataBufferRing->BeginIndex != dataBufferRing->EndIndex) - { - NET_FRAGMENT_RETURN_CONTEXT* netMemoryReturnContextOut = - NetRingGetFragmentReturnContextAtIndex( - dataBufferRing, - dataBufferRing->BeginIndex); - - MemoryBuffer* memoryBuffer = reinterpret_cast(netMemoryReturnContextOut->Handle); - GetMemoryFromHandle(m_adapter.m_preallocatedRxBuffers)->ReturnBuffer(memoryBuffer); - dataBufferRing->BeginIndex = NetRingIncrementIndex(dataBufferRing, dataBufferRing->BeginIndex); - } - } -#endif //NETCX 2.6 only + NetFragmentIteratorSet(&fi); NetPacketIteratorSet(&pi); EnlRingDoorBell(EnlQueueHandle, fr->EndIndex); diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp index d251121d..0e04d562 100644 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ b/network/wlan/WIFICX/drivercode/device.cpp @@ -49,10 +49,13 @@ NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterIn WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WifiNetvAdapter); adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; +#ifdef NETV_SUPPORT_TX_DEMUXING WIFI_ADAPTER_TX_DEMUX peerInfoDemux; WIFI_ADAPTER_TX_PEER_ADDRESS_DEMUX_INIT(&peerInfoDemux, MaxNumOfPeers); WifiAdapterInitAddTxDemux(AdapterInit, &peerInfoDemux); +#endif // NETV_SUPPORT_TX_DEMUXING + NETADAPTER netAdapter; NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); if (!NT_SUCCESS(ntStatus)) diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp index 29de321b..fead61b3 100644 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ b/network/wlan/WIFICX/drivercode/wifihal.cpp @@ -604,13 +604,14 @@ _Use_decl_annotations_ NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) { NT_ASSERT(m_LastConnectEntryId == 0); +#ifdef NETV_SUPPORT_TX_DEMUXING if (m_LastConnectEntryId != 0) // Not Disconnected State { WifiAdapterRemovePeer( WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], reinterpret_cast(&m_ConnectedPeer)); } - +#endif //NETV_SUPPORT_TX_DEMUXING WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), "Failed to perform association"); @@ -724,10 +725,11 @@ NTSTATUS WifiHAL::WifiIhvPerformAssociation( NewConnectEntryId = connectEntry; m_LastConnectTransactionId = pWdiHeader->TransactionId; - +#ifdef NETV_SUPPORT_TX_DEMUXING // add peer on datapath WifiAdapterAddPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], reinterpret_cast(g_ConnectEntries[connectEntry].pMacAddress)); +#endif // NETV_SUPPORT_TX_DEMUXING #ifdef WIFI_IHV_HANDSHAKE // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. RecieveDatapathFrame(0x33, sizeof(pucData), pucData); @@ -971,10 +973,11 @@ NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const m_LastConnectEntryId = 0; // Disconnected State +#ifdef NETV_SUPPORT_TX_DEMUXING WifiAdapterRemovePeer( WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], reinterpret_cast(&m_ConnectedPeer)); - +#endif RtlZeroMemory(&m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); return STATUS_SUCCESS; -- cgit v1.3.1 From a3e68cdfb094c7c5cf4f2a12b8be248053313d87 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 9 Dec 2025 11:03:15 -0800 Subject: fix the TX Queue not create issue --- .../netvadapterlibrary/Interface/netvadapter.h | 9 ++------- network/netadaptercx/netvadapterlibrary/code/adapter.cpp | 16 ---------------- network/netadaptercx/netvadapterlibrary/code/enl.cpp | 16 +++++++--------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h index b8474a9b..a572fcbc 100644 --- a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -9,8 +9,8 @@ #define NETV_NUMBER_OF_QUEUES 1 -#define NETV_SUPPORT_RSS FALSE // RSS not supported due to ENL limitations -#define NETV_SUPPORT_TX_DEMUXING FALSE // TX Demuxing not supported due to ENL limitations +//#define NETV_SUPPORT_RSS FALSE // RSS not supported due to ENL limitations +//#define NETV_SUPPORT_TX_DEMUXING // TX Demuxing not supported due to ENL limitations // supported filters #define NETV_SUPPORTED_FILTERS ( \ @@ -21,11 +21,6 @@ NetPacketFilterFlagAllMulticast) -NTSTATUS -ConfigureAndStartAdapter( - _In_ NETADAPTER Adapter - ); - EVT_NET_ADAPTER_CREATE_TXQUEUE CreateTxQueue; EVT_NET_ADAPTER_CREATE_RXQUEUE diff --git a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp index 5dc530ea..880f970d 100644 --- a/network/netadaptercx/netvadapterlibrary/code/adapter.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/adapter.cpp @@ -470,22 +470,6 @@ NTSTATUS NetvAdapter::ConfigureDataCapabilities() RETURN_STATUS_SUCCESS(); } -_Use_decl_annotations_ -NTSTATUS -ConfigureAndStartAdapter( - NETADAPTER Adapter - ) -{ - auto adapter = NetvAdapterGetContextFromWDFObject(Adapter); - RETURN_IF_NOT_STATUS_SUCCESS( - adapter->ConfigureDataCapabilities()); - - RETURN_IF_NOT_STATUS_SUCCESS( - NetAdapterStart(Adapter)); - - RETURN_STATUS_SUCCESS(); -} - NTSTATUS NetvAdapter::NetvAdapterReadAddress() { diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index fb763330..a02fd43f 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -546,13 +546,12 @@ EnlCreateQueue( } // Create WDF spinlock for the queue, parent to the queue's WDF handle - { - WDF_OBJECT_ATTRIBUTES attributes; - WDF_OBJECT_ATTRIBUTES_INIT(&attributes); - attributes.ParentObject = enlQueue->Queue->m_handle; - status = WdfSpinLockCreate(&attributes, &enlQueue->Spinlock); - NT_ASSERT(NT_SUCCESS(status)); - } + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + attributes.ParentObject = enlQueue->Queue->m_handle; + status = WdfSpinLockCreate(&attributes, &enlQueue->Spinlock); + NT_ASSERT(NT_SUCCESS(status)); + EnlpResumeThread(&enlLink->EnlThread); @@ -668,10 +667,9 @@ EnlIsPortActive( { ENLP_PORT* port = &EnlLink->Ports[PortIndex]; ENLP_QUEUE* txq = &port->TxQueue[0]; - ENLP_QUEUE* rxq = &port->RxQueue[0]; NT_FRE_ASSERT(PortIndex < ENLP_PORT_COUNT); - return (txq->Queue == nullptr && rxq->Queue == nullptr) ? FALSE : TRUE; + return (txq->Queue == nullptr) ? FALSE : TRUE; } _IRQL_requires_max_(PASSIVE_LEVEL) -- cgit v1.3.1 From 72c0b658a75daafd0ec2ecb03c3ff2c6cb017494 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 9 Dec 2025 11:12:44 -0800 Subject: have the updated project status --- network/wlan/WIFICX/README.md | 11 ++++++++++- network/wlan/WIFICX/video/ControlPath.mp4 | Bin 0 -> 20871450 bytes network/wlan/WIFICX/video/DataPath.mp4 | Bin 0 -> 5944039 bytes 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 network/wlan/WIFICX/video/ControlPath.mp4 create mode 100644 network/wlan/WIFICX/video/DataPath.mp4 diff --git a/network/wlan/WIFICX/README.md b/network/wlan/WIFICX/README.md index 65f6dd88..6a1ac33c 100644 --- a/network/wlan/WIFICX/README.md +++ b/network/wlan/WIFICX/README.md @@ -39,4 +39,13 @@ The control path uses hardcoded data since this sample does not target real hard - [x] Scan access points and report BSS entries to the Windows UI. - [x] Connect to an open access point from the Windows UI. - [x] Disconnect from the connected access point. -- [ ] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). + + +- [x] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). + \ No newline at end of file diff --git a/network/wlan/WIFICX/video/ControlPath.mp4 b/network/wlan/WIFICX/video/ControlPath.mp4 new file mode 100644 index 00000000..15ec3d62 Binary files /dev/null and b/network/wlan/WIFICX/video/ControlPath.mp4 differ diff --git a/network/wlan/WIFICX/video/DataPath.mp4 b/network/wlan/WIFICX/video/DataPath.mp4 new file mode 100644 index 00000000..fda748e5 Binary files /dev/null and b/network/wlan/WIFICX/video/DataPath.mp4 differ -- cgit v1.3.1 From b532c0e05f2c41cad924da2210ee3d44f02238c7 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Tue, 9 Dec 2025 11:26:23 -0800 Subject: fix the readme.md --- network/wlan/WIFICX/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network/wlan/WIFICX/README.md b/network/wlan/WIFICX/README.md index 6a1ac33c..c4d7e253 100644 --- a/network/wlan/WIFICX/README.md +++ b/network/wlan/WIFICX/README.md @@ -39,12 +39,14 @@ The control path uses hardcoded data since this sample does not target real hard - [x] Scan access points and report BSS entries to the Windows UI. - [x] Connect to an open access point from the Windows UI. - [x] Disconnect from the connected access point. + - [x] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). + @@ -127,6 +128,7 @@ false ..\code\trace.h true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -140,6 +142,7 @@ false ..\code\trace.h true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -153,6 +156,7 @@ false ..\code\trace.h true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -181,17 +185,5 @@ - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/km/packages.config b/network/netadaptercx/netvadapterlibrary/km/packages.config deleted file mode 100644 index d690ede8..00000000 --- a/network/netadaptercx/netvadapterlibrary/km/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj index ce418965..9edcd75b 100644 --- a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj +++ b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj @@ -115,6 +115,7 @@ false true ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -128,6 +129,7 @@ false true ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -141,6 +143,7 @@ false true ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -154,6 +157,7 @@ false true ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) @@ -181,17 +185,5 @@ - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/packages.config b/network/netadaptercx/netvadapterlibrary/um/packages.config deleted file mode 100644 index d690ede8..00000000 --- a/network/netadaptercx/netvadapterlibrary/um/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj index 0bd8b963..e5bd720c 100644 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj @@ -242,6 +242,4 @@ - - \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj index a0917a35..70836086 100644 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj @@ -226,6 +226,4 @@ - - \ No newline at end of file -- cgit v1.3.1 From 848a385279d8967b869d14bd770e96cd13bbf5f1 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Wed, 10 Dec 2025 14:39:10 -0800 Subject: quick fix a typo --- network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h index a572fcbc..3ed87429 100644 --- a/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h +++ b/network/netadaptercx/netvadapterlibrary/Interface/netvadapter.h @@ -9,7 +9,7 @@ #define NETV_NUMBER_OF_QUEUES 1 -//#define NETV_SUPPORT_RSS FALSE // RSS not supported due to ENL limitations +//#define NETV_SUPPORT_RSS // RSS not supported due to ENL limitations //#define NETV_SUPPORT_TX_DEMUXING // TX Demuxing not supported due to ENL limitations // supported filters -- cgit v1.3.1 From 8d6161eda21f360c2d67c3d565315b2a4e042ddb Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Wed, 10 Dec 2025 15:05:26 -0800 Subject: trying to fix the build break on X64 --- .../netvadapterlibrary/netvadapterlibrary.sln | 41 ---------------------- .../netvadapterlibrary/netvadapterlibrary.sln.old | 41 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln create mode 100644 network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old diff --git a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln deleted file mode 100644 index c39e8929..00000000 --- a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36717.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.ActiveCfg = Debug|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.Build.0 = Debug|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.ActiveCfg = Release|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.Build.0 = Release|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.ActiveCfg = Debug|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.Build.0 = Debug|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.ActiveCfg = Release|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6D884183-BDDB-43F8-A3F9-410276822289} - EndGlobalSection -EndGlobal diff --git a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old new file mode 100644 index 00000000..c39e8929 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36717.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.ActiveCfg = Debug|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.Build.0 = Debug|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.ActiveCfg = Release|Win32 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.Build.0 = Release|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.ActiveCfg = Debug|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.Build.0 = Debug|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.ActiveCfg = Release|Win32 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6D884183-BDDB-43F8-A3F9-410276822289} + EndGlobalSection +EndGlobal -- cgit v1.3.1 From 308a30fbcd81b9bd374f7b7fed758f72a5136939 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 11 Dec 2025 17:39:25 -0800 Subject: Add affinity mask asserts, remove sln.old Added assertions to EnlpAffinitizeThread to verify BitScanReverse succeeds. Updated EnlRingDoorBell to properly acquire and release the spinlock around the Armed state check for thread safety. Removed obsolete netvadapterlibrary.sln.old solution file. --- .../netadaptercx/netvadapterlibrary/code/enl.cpp | 7 ++-- .../netvadapterlibrary/netvadapterlibrary.sln.old | 41 ---------------------- 2 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old diff --git a/network/netadaptercx/netvadapterlibrary/code/enl.cpp b/network/netadaptercx/netvadapterlibrary/code/enl.cpp index a02fd43f..709c5a1e 100644 --- a/network/netadaptercx/netvadapterlibrary/code/enl.cpp +++ b/network/netadaptercx/netvadapterlibrary/code/enl.cpp @@ -84,10 +84,10 @@ EnlpAffinitizeThread( // next highest numbered proc for 1002, ... ULONG index; #ifdef _WIN64 - BitScanReverse64(&index, (ULONG64)affinity.Mask); + NT_FRE_ASSERTMSG("Failed to find bit", TRUE == BitScanReverse64(&index, (ULONG64)affinity.Mask)); affinity.Mask = (KAFFINITY)((ULONG64)1 << (index - (ProcIndex - 1001))); #else - BitScanReverse(&index, (ULONG)affinity.Mask); + NT_FRE_ASSERTMSG("Failed to find bit", TRUE == BitScanReverse(&index, (ULONG)affinity.Mask)); affinity.Mask = (KAFFINITY)((ULONG)1 << (index - (ProcIndex - 1001))); #endif } @@ -588,7 +588,9 @@ EnlRingDoorBell( ) { InterlockedExchange((volatile LONG *)&Queue->QueueEnd, (LONG)EndIndex); + WdfSpinLockAcquire(Queue->Spinlock); + if (Queue->Armed) { NT_ASSERT(Queue->ArmWaitEvent != NULL); @@ -597,6 +599,7 @@ EnlRingDoorBell( Queue->ArmWaitEvent->Set(); return; } + WdfSpinLockRelease(Queue->Spinlock); } diff --git a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old b/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old deleted file mode 100644 index c39e8929..00000000 --- a/network/netadaptercx/netvadapterlibrary/netvadapterlibrary.sln.old +++ /dev/null @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.14.36717.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.ActiveCfg = Debug|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x86.Build.0 = Debug|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.ActiveCfg = Release|Win32 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x86.Build.0 = Release|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.ActiveCfg = Debug|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x86.Build.0 = Debug|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.ActiveCfg = Release|Win32 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6D884183-BDDB-43F8-A3F9-410276822289} - EndGlobalSection -EndGlobal -- cgit v1.3.1 From 0ee210e9311f3837f6885580767458b9f5a43b1c Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Thu, 11 Dec 2025 17:51:43 -0800 Subject: rename the WIFICX folder into wificx --- network/wlan/WIFICX/README.md | 50 - network/wlan/WIFICX/drivercode/SharedTypes.h | 16 - network/wlan/WIFICX/drivercode/adapter.cpp | 83 - network/wlan/WIFICX/drivercode/adapter.h | 42 - network/wlan/WIFICX/drivercode/device.cpp | 131 - network/wlan/WIFICX/drivercode/device.h | 29 - network/wlan/WIFICX/drivercode/driver.cpp | 210 - network/wlan/WIFICX/drivercode/driver.h | 12 - .../wlan/WIFICX/drivercode/memorymanagement.cpp | 149 - network/wlan/WIFICX/drivercode/precomp.h | 33 - network/wlan/WIFICX/drivercode/trace.h | 183 - network/wlan/WIFICX/drivercode/umkmfusion.h | 131 - network/wlan/WIFICX/drivercode/wifihal.cpp | 984 --- network/wlan/WIFICX/drivercode/wifihal.h | 48 - network/wlan/WIFICX/drivercode/wifihaltestdata.h | 8290 -------------------- network/wlan/WIFICX/drivercode/wifirequest.cpp | 98 - network/wlan/WIFICX/drivercode/wifirequest.h | 23 - network/wlan/WIFICX/drivercode/wifitransition.cpp | 338 - network/wlan/WIFICX/drivercode/wifitransition.h | 20 - network/wlan/WIFICX/km/wificxsampleclientkm.inf | 96 - .../wlan/WIFICX/km/wificxsampleclientkm.vcxproj | 245 - .../WIFICX/km/wificxsampleclientkm.vcxproj.filters | 84 - network/wlan/WIFICX/um/wificxsampleclientum.inf | 107 - .../wlan/WIFICX/um/wificxsampleclientum.vcxproj | 229 - .../WIFICX/um/wificxsampleclientum.vcxproj.filters | 84 - network/wlan/WIFICX/video/ControlPath.mp4 | Bin 20871450 -> 0 bytes network/wlan/WIFICX/video/DataPath.mp4 | Bin 5944039 -> 0 bytes network/wlan/WIFICX/wificxsampleclient.sln | 82 - network/wlan/wificx/README.md | 50 + network/wlan/wificx/drivercode/SharedTypes.h | 16 + network/wlan/wificx/drivercode/adapter.cpp | 83 + network/wlan/wificx/drivercode/adapter.h | 42 + network/wlan/wificx/drivercode/device.cpp | 131 + network/wlan/wificx/drivercode/device.h | 29 + network/wlan/wificx/drivercode/driver.cpp | 210 + network/wlan/wificx/drivercode/driver.h | 12 + .../wlan/wificx/drivercode/memorymanagement.cpp | 149 + network/wlan/wificx/drivercode/precomp.h | 33 + network/wlan/wificx/drivercode/trace.h | 183 + network/wlan/wificx/drivercode/umkmfusion.h | 131 + network/wlan/wificx/drivercode/wifihal.cpp | 984 +++ network/wlan/wificx/drivercode/wifihal.h | 48 + network/wlan/wificx/drivercode/wifihaltestdata.h | 8290 ++++++++++++++++++++ network/wlan/wificx/drivercode/wifirequest.cpp | 98 + network/wlan/wificx/drivercode/wifirequest.h | 23 + network/wlan/wificx/drivercode/wifitransition.cpp | 338 + network/wlan/wificx/drivercode/wifitransition.h | 20 + network/wlan/wificx/km/wificxsampleclientkm.inf | 96 + .../wlan/wificx/km/wificxsampleclientkm.vcxproj | 245 + .../wificx/km/wificxsampleclientkm.vcxproj.filters | 84 + network/wlan/wificx/um/wificxsampleclientum.inf | 107 + .../wlan/wificx/um/wificxsampleclientum.vcxproj | 229 + .../wificx/um/wificxsampleclientum.vcxproj.filters | 84 + network/wlan/wificx/video/ControlPath.mp4 | Bin 0 -> 20871450 bytes network/wlan/wificx/video/DataPath.mp4 | Bin 0 -> 5944039 bytes network/wlan/wificx/wificxsampleclient.sln | 82 + 56 files changed, 11797 insertions(+), 11797 deletions(-) delete mode 100644 network/wlan/WIFICX/README.md delete mode 100644 network/wlan/WIFICX/drivercode/SharedTypes.h delete mode 100644 network/wlan/WIFICX/drivercode/adapter.cpp delete mode 100644 network/wlan/WIFICX/drivercode/adapter.h delete mode 100644 network/wlan/WIFICX/drivercode/device.cpp delete mode 100644 network/wlan/WIFICX/drivercode/device.h delete mode 100644 network/wlan/WIFICX/drivercode/driver.cpp delete mode 100644 network/wlan/WIFICX/drivercode/driver.h delete mode 100644 network/wlan/WIFICX/drivercode/memorymanagement.cpp delete mode 100644 network/wlan/WIFICX/drivercode/precomp.h delete mode 100644 network/wlan/WIFICX/drivercode/trace.h delete mode 100644 network/wlan/WIFICX/drivercode/umkmfusion.h delete mode 100644 network/wlan/WIFICX/drivercode/wifihal.cpp delete mode 100644 network/wlan/WIFICX/drivercode/wifihal.h delete mode 100644 network/wlan/WIFICX/drivercode/wifihaltestdata.h delete mode 100644 network/wlan/WIFICX/drivercode/wifirequest.cpp delete mode 100644 network/wlan/WIFICX/drivercode/wifirequest.h delete mode 100644 network/wlan/WIFICX/drivercode/wifitransition.cpp delete mode 100644 network/wlan/WIFICX/drivercode/wifitransition.h delete mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.inf delete mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj delete mode 100644 network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters delete mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.inf delete mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.vcxproj delete mode 100644 network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters delete mode 100644 network/wlan/WIFICX/video/ControlPath.mp4 delete mode 100644 network/wlan/WIFICX/video/DataPath.mp4 delete mode 100644 network/wlan/WIFICX/wificxsampleclient.sln create mode 100644 network/wlan/wificx/README.md create mode 100644 network/wlan/wificx/drivercode/SharedTypes.h create mode 100644 network/wlan/wificx/drivercode/adapter.cpp create mode 100644 network/wlan/wificx/drivercode/adapter.h create mode 100644 network/wlan/wificx/drivercode/device.cpp create mode 100644 network/wlan/wificx/drivercode/device.h create mode 100644 network/wlan/wificx/drivercode/driver.cpp create mode 100644 network/wlan/wificx/drivercode/driver.h create mode 100644 network/wlan/wificx/drivercode/memorymanagement.cpp create mode 100644 network/wlan/wificx/drivercode/precomp.h create mode 100644 network/wlan/wificx/drivercode/trace.h create mode 100644 network/wlan/wificx/drivercode/umkmfusion.h create mode 100644 network/wlan/wificx/drivercode/wifihal.cpp create mode 100644 network/wlan/wificx/drivercode/wifihal.h create mode 100644 network/wlan/wificx/drivercode/wifihaltestdata.h create mode 100644 network/wlan/wificx/drivercode/wifirequest.cpp create mode 100644 network/wlan/wificx/drivercode/wifirequest.h create mode 100644 network/wlan/wificx/drivercode/wifitransition.cpp create mode 100644 network/wlan/wificx/drivercode/wifitransition.h create mode 100644 network/wlan/wificx/km/wificxsampleclientkm.inf create mode 100644 network/wlan/wificx/km/wificxsampleclientkm.vcxproj create mode 100644 network/wlan/wificx/km/wificxsampleclientkm.vcxproj.filters create mode 100644 network/wlan/wificx/um/wificxsampleclientum.inf create mode 100644 network/wlan/wificx/um/wificxsampleclientum.vcxproj create mode 100644 network/wlan/wificx/um/wificxsampleclientum.vcxproj.filters create mode 100644 network/wlan/wificx/video/ControlPath.mp4 create mode 100644 network/wlan/wificx/video/DataPath.mp4 create mode 100644 network/wlan/wificx/wificxsampleclient.sln diff --git a/network/wlan/WIFICX/README.md b/network/wlan/WIFICX/README.md deleted file mode 100644 index fb4ca92a..00000000 --- a/network/wlan/WIFICX/README.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -page_type: sample -description: "Demonstrates how to use WIFICX for control flow and NetAdapterCx for data flow." -languages: -- cpp -products: -- windows -- windows-wdk ---- - -# WIFICX and NetAdapterCx Samples - -This sample illustrates how to leverage **WIFICX** for control flow and **NetAdapterCx** for data flow. It supports both **KMDF** and **UMDF(In Preview Stage)** drivers. - -## How to Build -1. Mount the EWDK ISO from a local drive (network share paths are not supported). -2. Run `LaunchBuildEnv.cmd`. -3. In the environment created in step 2, type `SetupVSEnv` and press **Enter**. -4. Navigate to the current folder and open the solution file, for example: - `X:\Windows-driver-samples\network\wlan\WIFICX\wificxsampleclient.sln` -5. Build the solution from the Visual Studio UI. - -## Interfaces and Abstraction -The sample interacts with three OS components: - -- **WDF** - `driver.cpp`, `device.cpp`, and `adapter.cpp` demonstrate proper registration for PnP and power event callbacks. WDF manages system PnP and power requests (e.g., power IRPs), so IHV drivers should follow the flow triggered through these callbacks. - -- **WDF Wi-Fi Class Extension (WIFICX)** - `wifixxxxx.cpp` files implement the **control path**, handling commands sent to Wi-Fi firmware (e.g., scan access points, connect, disconnect). - -- **WDF NetAdapter Class Extension (NetAdapterCx)** - `netvxxxx` files and classes implement the **data path**, managing network buffers and synchronizing with the control path for transfer start/stop operations. - -## Data Buffers from Firmware -The control path uses hardcoded data since this sample does not target real hardware. The data path uses **Emulated Network Link (ENL)**, which connects two virtual network adapters directly. Packets sent over one adapter are delivered to the other and vice versa. - -## Supported Scenarios -- [x] Scan access points and report BSS entries to the Windows UI. -- [x] Connect to an open access point from the Windows UI. -- [x] Disconnect from the connected access point. -- [x] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). - -## 🎥 Control & Data Path Demo Video -A walkthrough video demonstrating the Control & Data Path flow are available here: - -[▶ Watch Control Path Demo](video/ControlPath.mp4) - -[▶ Watch Data Path Demo](video/DataPath.mp4) - diff --git a/network/wlan/WIFICX/drivercode/SharedTypes.h b/network/wlan/WIFICX/drivercode/SharedTypes.h deleted file mode 100644 index 43fd815a..00000000 --- a/network/wlan/WIFICX/drivercode/SharedTypes.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once - -// -// SharedTypes.h -// Central header for global definitions, macros, and shared structures. -// -#include "precomp.h" -#include // for GUID defination - -// ============================= -// GUIDs or Constants -// ============================= -// {bb67559a-06f6-4eb0-81e9-21fdc3b60efb} -DEFINE_GUID(GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, 0xbb67559a, 0x06f6, 0x4eb0, 0x81, 0xe9, 0x21, 0xfd, 0xc3, 0xb6, 0x0e, 0xfb); -#define WIFI_DRIVER_DEFAULT_POOL_TAG 'shiW' // WIFI IHV Sample Driver \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/adapter.cpp b/network/wlan/WIFICX/drivercode/adapter.cpp deleted file mode 100644 index fd44c72b..00000000 --- a/network/wlan/WIFICX/drivercode/adapter.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -#include "precomp.h" -#include "adapter.h" -#include "adapter.tmh" - -extern UCHAR NetvMacAddressBase[MAC_ADDR_LEN]; - -NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter) -{ - WifiNetvAdapter* wifiNetvAdapter = WifiNetvAdapterGetContext(netAdapter); - NetvAdapter* netvAdapter{ wifiNetvAdapter }; - return netvAdapter; -} - -WifiNetvAdapter::WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device) : NetvAdapter(Handle, Device) -{ -} - -NTSTATUS WifiNetvAdapter::Initialize() -{ - if (WifiGetIhvDeviceContext(m_device)->netAdapters[WifiAdapterGetPortId(m_handle)] != WDF_NO_HANDLE) - { - return STATUS_SUCCESS; - } - return NetvAdapter::Initialize(); -} - -NTSTATUS WifiNetvAdapter::AdapterStart() -{ - TraceEntry(); - - NTSTATUS status = STATUS_SUCCESS; - - NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES wakeMediaChangeCapabilities; - NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES_INIT(&wakeMediaChangeCapabilities); - - wakeMediaChangeCapabilities.MediaConnect = TRUE; - wakeMediaChangeCapabilities.MediaDisconnect = TRUE; - - NetAdapterWakeSetMediaChangeCapabilities(m_handle, &wakeMediaChangeCapabilities); - - WIFI_ADAPTER_WAKE_CAPABILITIES wakeCap{}; - WIFI_ADAPTER_WAKE_CAPABILITIES_INIT(&wakeCap); - if (WIFI_IS_FIELD_AVAILABLE(WIFI_ADAPTER_WAKE_CAPABILITIES, ClientDriverDiagnostic)) - { - wakeCap.ClientDriverDiagnostic = true; - } - WifiAdapterSetWakeCapabilities(m_handle, &wakeCap); - - status = NetvAdapter::ConfigureDataCapabilities(); - if (!NT_SUCCESS(status)) - { - WFCError("%!FUNC!: NetvAdapter::ConfigureDataCapabilities failed with %!STATUS!", status); - return status; - } - - status = NetAdapterStart(m_handle); - if (!NT_SUCCESS(status)) - { - WFCError("%!FUNC!: NetAdapterStart failed with %!STATUS!", status); - return status; - } - - ASSERT(STATUS_SUCCESS == status); - TraceExit(status); - - return status; -} - -NTSTATUS WifiNetvAdapter::CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit) -{ - return NetvAdapter::CreateRxQueue(NetRxQueueInit); -} - -NTSTATUS WifiNetvAdapter::CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit) -{ - return NetvAdapter::CreateTxQueue(NetTxQueueInit); -} - -void WifiNetvAdapter::Destroy(void) -{ - return NetvAdapter::Destroy(); -} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/adapter.h b/network/wlan/WIFICX/drivercode/adapter.h deleted file mode 100644 index 0b7aa093..00000000 --- a/network/wlan/WIFICX/drivercode/adapter.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once -#include "device.h" -#include "netvadapter.h" - -// for STA TX DEMUX -#define MaxNumOfPeers 1 - -// Context for each "Wdi Port"[NetAdapter] instance. -// Each NetAdapter instance corresponds to an IP interface -typedef struct _WIFI_IHV_NETADAPTER_CONTEXT -{ - PWIFI_IHV_DEVICE_CONTEXT WifiDeviceContext; // Wdf Ihv device context - NETADAPTER NetAdapter; // NetAdapter object -} WIFI_IHV_NETADAPTER_CONTEXT, * PWIFI_IHV_NETADAPTER_CONTEXT; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_NETADAPTER_CONTEXT, WifiGetIhvNetAdapterContext); - -class WifiNetvAdapter : public NetvAdapter -{ -public: - WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device); - - NTSTATUS - Initialize(); - - NTSTATUS - AdapterStart(); - - NTSTATUS - CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit); - - NTSTATUS - CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit); - - void Destroy(void); - - bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; - -}; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiNetvAdapter, WifiNetvAdapterGetContext); \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/device.cpp b/network/wlan/WIFICX/drivercode/device.cpp deleted file mode 100644 index 0e04d562..00000000 --- a/network/wlan/WIFICX/drivercode/device.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. - -#include "precomp.h" - -#include "adapter.h" -#include "device.h" -#include "device.tmh" - -_Use_decl_annotations_ -NTSTATUS EvtDevicePrepareHardware(WDFDEVICE device, WDFCMRESLIST resourcesRaw, WDFCMRESLIST resourcesTranslated) -{ - UNREFERENCED_PARAMETER(resourcesRaw); - UNREFERENCED_PARAMETER(resourcesTranslated); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiHAL::_Create(device), - "WifiHAL::_Create failed"); - - WFCInfo("Device=0x%p", device); - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTranslated) -{ - UNREFERENCED_PARAMETER(resourcesTranslated); - - WFCInfo("Device=0x%p", device); - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) -{ - if (WifiAdapterInitGetType(AdapterInit) != WIFI_ADAPTER_EXTENSIBLE_STATION) - { - WFCError("%!FUNC!: Unsupported adapter type = 0x%x != 0x%x", WifiAdapterInitGetType(AdapterInit), WIFI_ADAPTER_EXTENSIBLE_STATION); - return STATUS_NOT_SUPPORTED; - } - - NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; - NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks, EvtAdapterCreateTxQueue, EvtAdapterCreateRxQueue); - - NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks); - - WDF_OBJECT_ATTRIBUTES adapterAttributes; - WDF_OBJECT_ATTRIBUTES_INIT(&adapterAttributes); - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WifiNetvAdapter); - adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; - -#ifdef NETV_SUPPORT_TX_DEMUXING - WIFI_ADAPTER_TX_DEMUX peerInfoDemux; - WIFI_ADAPTER_TX_PEER_ADDRESS_DEMUX_INIT(&peerInfoDemux, MaxNumOfPeers); - WifiAdapterInitAddTxDemux(AdapterInit, &peerInfoDemux); -#endif // NETV_SUPPORT_TX_DEMUXING - - - NETADAPTER netAdapter; - NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: NetAdapterCreate failed, status=0x%x", ntStatus); - return ntStatus; - } - - ntStatus = WifiAdapterInitialize(netAdapter); - ASSERT(NT_SUCCESS(ntStatus)); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiAdapterInitialize failed with %!STATUS!", ntStatus); - return ntStatus; - } - auto wifiNetvAdapter = new (reinterpret_cast(WifiNetvAdapterGetContext(netAdapter))) WifiNetvAdapter(netAdapter, Device); - ntStatus = wifiNetvAdapter->Initialize(); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiNetvAdapter::Initialize failed with %!STATUS!", ntStatus); - return ntStatus; - } - - ntStatus = wifiNetvAdapter->AdapterStart(); - ASSERT(NT_SUCCESS(ntStatus)); - if (!NT_SUCCESS(ntStatus)) - { - WFCError("%!FUNC!: WifiNetvAdapter::AdapterStart failed with %!STATUS!", ntStatus); - return ntStatus; - } - - auto wifiNetvDevice = WifiGetIhvDeviceContext(Device); - wifiNetvDevice->netAdapters[WifiAdapterGetPortId(netAdapter)] = netAdapter; - - WFCInfo("%!FUNC!: Success!"); - return ntStatus; -} - -_Use_decl_annotations_ -void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) -{ - TraceEntry(); - auto wifiNetvAdapter = WifiNetvAdapterGetContext(NetAdapter); - wifiNetvAdapter->Destroy(); - TraceExit(STATUS_SUCCESS); -} - - -_Use_decl_annotations_ -NTSTATUS EvtWifiDeviceCreateWifiDirectDevice(WDFDEVICE, WIFIDIRECT_DEVICE_INIT*) -{ - NTSTATUS status = STATUS_SUCCESS; - TraceEntry(); - TraceExit(status); - return status; -} - - -_Use_decl_annotations_ -NTSTATUS -EvtAdapterCreateTxQueue(NETADAPTER Adapter, NETTXQUEUE_INIT* Init) -{ - TraceEntry(); - return WifiNetvAdapterGetContext(Adapter)->CreateTxQueue(Init); -} - -_Use_decl_annotations_ -NTSTATUS -EvtAdapterCreateRxQueue(NETADAPTER Adapter, NETRXQUEUE_INIT* Init) -{ - TraceEntry(); - return WifiNetvAdapterGetContext(Adapter)->CreateRxQueue(Init); -} diff --git a/network/wlan/WIFICX/drivercode/device.h b/network/wlan/WIFICX/drivercode/device.h deleted file mode 100644 index c0dfac3c..00000000 --- a/network/wlan/WIFICX/drivercode/device.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once -#include "wifiHAL.h" -EVT_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; -EVT_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; - -EVT_WIFI_DEVICE_CREATE_ADAPTER EvtWifiDeviceCreateAdapter; -EVT_WIFI_DEVICE_CREATE_WIFIDIRECTDEVICE EvtWifiDeviceCreateWifiDirectDevice; -EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; -EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtAdapterCleanup; - -EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue; -EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; - -typedef struct _WIFI_IHV_DEVICE_CONTEXT -{ - // - // Do not add field variable before WdfTriageInfoPtr. - // NetAdapterCx carving code requires the first field of WDF context - // to be a pointer to WDF_TRIAGE_INFO. - // - void* WdfTriageInfoPtr; - WDFDEVICE WdfDevice; - TLV_CONTEXT TlvContext; - NETADAPTER netAdapters[5]{}; -} WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_DEVICE_CONTEXT, WifiGetIhvDeviceContext); -static_assert(FIELD_OFFSET(WIFI_IHV_DEVICE_CONTEXT, WdfTriageInfoPtr) == 0); diff --git a/network/wlan/WIFICX/drivercode/driver.cpp b/network/wlan/WIFICX/drivercode/driver.cpp deleted file mode 100644 index bbc4d151..00000000 --- a/network/wlan/WIFICX/drivercode/driver.cpp +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -#include "precomp.h" - -#include "device.h" -#include "driver.h" -#include "driver.tmh" - -NTSTATUS DriverEntry( - _In_ PDRIVER_OBJECT driverObject, - _In_ PUNICODE_STRING registryPath) -/*++ - -Routine Description: - DriverEntry initializes the driver and is the first routine called by the - system after the driver is loaded. DriverEntry specifies the other entry - points in the function driver, such as EvtDevice and DriverUnload. - -Parameters Description: - - DriverObject - represents the instance of the function driver that is loaded - into memory. DriverEntry must initialize members of DriverObject before it - returns to the caller. DriverObject is allocated by the system before the - driver is loaded, and it is released by the system after the system unloads - the function driver from memory. - - RegistryPath - represents the driver specific path in the Registry. - The function driver can use the path to store driver related data between - reboots. The path does not store hardware instance specific data. - -Return Value: - - STATUS_SUCCESS if successful, - STATUS_UNSUCCESSFUL otherwise. - ---*/ -{ - NTSTATUS status = STATUS_SUCCESS; - WDF_DRIVER_CONFIG driverConfig{}; - WDF_OBJECT_ATTRIBUTES attributes; - - // - // Initialize WPP Tracing - // - WPP_INIT_TRACING(driverObject, registryPath); - - // Since WPP tracing is now initialized, we can use Trace functions - TraceEntry(); - - // - // Register a cleanup callback so that we can call WPP_CLEANUP when - // the framework driver object is deleted during driver unload. - // - WDF_OBJECT_ATTRIBUTES_INIT(&attributes); - attributes.EvtCleanupCallback = EvtWifiDriverContextCleanup; - - WDF_DRIVER_CONFIG_INIT(&driverConfig, EvtWifiDriverDeviceAdd); - driverConfig.DriverPoolTag = WIFI_DRIVER_DEFAULT_POOL_TAG; - - status = WdfDriverCreate(driverObject, registryPath, &attributes, &driverConfig, WDF_NO_HANDLE); - if (!NT_SUCCESS(status)) - { - WFCError("WdfDriverCreate failed %!STATUS!", status); - WPP_CLEANUP(driverObject); - return status; - } - - TraceExit(status); - - return status; -} - -NTSTATUS EvtWifiDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT deviceInit) -/*++ -Routine Description: - - EvtWifiDriverDeviceAdd is called by the framework in response to AddDevice - call from the PnP manager. We create and initialize a device object to - represent a new instance of the device. - -Arguments: - - Driver - Handle to a framework driver object created in DriverEntry - - DeviceInit - Pointer to a framework-allocated WDFDEVICE_INIT structure. - -Return Value: - - NTSTATUS - ---*/ -{ - UNREFERENCED_PARAMETER(driver); - - TraceEntry(); - - NTSTATUS status = STATUS_SUCCESS; - - // Configure the device init for NetAdapterCx (Data Path) - status = NetDeviceInitConfig(deviceInit); - if (!NT_SUCCESS(status)) - { - WFCError("NetDeviceInitConfig failed, status=0x%x", status); - goto Exit; - } - - // Configure the device init for WifiCx (Control Path) - status = WifiDeviceInitConfig(deviceInit); - if (!NT_SUCCESS(status)) - { - WFCError("WifiDeviceInitConfig failed, status=0x%x", status); - goto Exit; - } - - // Set PnP and Power Callbacks. - // [Scope: Only PrepareHardware and ReleaseHardware are implemented in this sample.] - WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks; - WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks); - pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware; - pnpPowerCallbacks.EvtDeviceReleaseHardware = EvtDeviceReleaseHardware; - WdfDeviceInitSetPnpPowerEventCallbacks(deviceInit, &pnpPowerCallbacks); - - // [Scope: ArmWake and DisarmWake are not implemented in this sample.] - //WDF_POWER_POLICY_EVENT_CALLBACKS powerPolicyCallbacks; - //WdfDeviceInitSetPowerPolicyEventCallbacks(deviceInit, &powerPolicyCallbacks); - - WDFDEVICE wdfIhvDevice{}; - // Create the device object context to store the device specific information - WDF_OBJECT_ATTRIBUTES ihvDeviceAttributes; - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&ihvDeviceAttributes, WIFI_IHV_DEVICE_CONTEXT); - - status = WdfDeviceCreate(&deviceInit, &ihvDeviceAttributes, &wdfIhvDevice); - if (!NT_SUCCESS(status)) - { - WFCError("WdfDeviceCreate failed, status=0x%x", status); - goto Exit; - } - - // - // Create a device interface so that applications can find and talk - // to us. - // - status = WdfDeviceCreateDeviceInterface(wdfIhvDevice, &GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, nullptr); - if (!NT_SUCCESS(status)) - { - WFCError("WdfDeviceCreateDeviceInterface failed with status=0x%x", status); - goto Exit; - } - - // Initialize WifiCx device now that the WDFDEVICE has been created. - // In short the WifICx is the "wdf managed WDI", so the Wdi core - // concepts still applies. - WIFI_DEVICE_CONFIG wifiDeviceConfig; - WIFI_DEVICE_CONFIG_INIT( - &wifiDeviceConfig, - WDI_VERSION_LATEST, // The "WDI" version supported by this Ihv driver - EvtWifiDeviceSendCommand, // The Wdi command and task, now called "wifirequest". - EvtWifiDeviceCreateAdapter, // The Wdi "ports", now support by the netadapter instances. - EvtWifiDeviceCreateWifiDirectDevice); // [Scope: No WiFi Direct support in this sample] - - // Initialize the WifiCx device with the configuration above to let OS side ready. - status = WifiDeviceInitialize(wdfIhvDevice, &wifiDeviceConfig); - if (!NT_SUCCESS(status)) - { - WFCError("WifiDeviceInitialize failed, status=0x%x", status); - goto Exit; - } - - // Get a pointer to the device context structure that we just associated - // with the device object. We define this structure in the device.h - // header file. WifiGetIhvDeviceContext is an inline function generated by - // using the WDF_DECLARE_CONTEXT_TYPE_WITH_NAME macro in device.h. - // This function will do the type checking and return the device context. - // If you pass a wrong object handle it will return NULL and assert if - // run under framework verifier mode. - auto deviceIhvContext = WifiGetIhvDeviceContext(wdfIhvDevice); - deviceIhvContext->WdfDevice = wdfIhvDevice; - deviceIhvContext->WdfTriageInfoPtr = WdfGetTriageInfo(); - - deviceIhvContext->TlvContext.AllocationContext = 0; - deviceIhvContext->TlvContext.PeerVersion = WifiDeviceGetOsWdiVersion(wdfIhvDevice); - -Exit: - TraceExit(status); - return status; -} - -void EvtWifiDriverContextCleanup(_In_ WDFOBJECT DriverObject) -/*++ -Routine Description: - - Free all the resources allocated in DriverEntry. - -Arguments: - - DriverObject - handle to a WDF Driver object. - -Return Value: - - VOID. - ---*/ -{ -#ifndef _KERNEL_MODE - // follow https://github.com/MicrosoftDocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/wdf/using-wpp-software-tracing-in-kmdf-and-umdf-2-drivers.md - // because UMDF drivers use the kernel-mode signatures of these macros for initializing and cleaning up tracing, the calls look identical for KMDF and UMDF. - UNREFERENCED_PARAMETER(DriverObject); -#endif // !_KERNEL_MODE - - WPP_CLEANUP(WdfDriverWdmGetDriverObject(static_cast(DriverObject))); -} diff --git a/network/wlan/WIFICX/drivercode/driver.h b/network/wlan/WIFICX/drivercode/driver.h deleted file mode 100644 index 8573b30e..00000000 --- a/network/wlan/WIFICX/drivercode/driver.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -#pragma once -#include "precomp.h" - -WDF_EXTERN_C_START - -DRIVER_INITIALIZE DriverEntry; - -EVT_WDF_DRIVER_DEVICE_ADD EvtWifiDriverDeviceAdd; -EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; - -WDF_EXTERN_C_END \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/memorymanagement.cpp b/network/wlan/WIFICX/drivercode/memorymanagement.cpp deleted file mode 100644 index 088bad88..00000000 --- a/network/wlan/WIFICX/drivercode/memorymanagement.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#include "precomp.h" - -#ifndef _KERNEL_MODE -#include // for _ReturnAddress for user mode -#endif // UM - -typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT -{ - size_t cbMaxSize; - _Field_size_bytes_(cbMaxSize) void* pbBuffer; -} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; -typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; - -// for FreeWdfMemoryBuffer to correct get -// the handle to free the memory -struct WIFI_IHV_MEMORY_HEADER -{ - size_t HeaderSize; - WDFMEMORY WdfMemoryHandle; -}; - -// for tracking memory leaks -struct WIFI_IHV_MEMORY_CONTEXT -{ - size_t ContextSize; - void* pvCaller; -}; - -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); - - -void* AllocateWdfMemoryBuffer(size_t Size, _In_ void* CallerForMemoryLeakTracking) -{ - size_t totalSize = 0; - if (!NT_SUCCESS(Wifi::SizeTAddSafe(Size, sizeof(WIFI_IHV_MEMORY_HEADER), &totalSize))) - { - NT_ASSERT(FALSE); - WFCError("Failed to calculate total size"); - return nullptr; - } - - // allocate the context memory to store the WIFI_IHV_MEMORY_CONTEXT - WDF_OBJECT_ATTRIBUTES attributes; - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WIFI_IHV_MEMORY_CONTEXT); - WDFMEMORY wdfMemoryBufferHandle = WDF_NO_HANDLE; - void* pWdfMemoryBuffer = nullptr; - - if (!NT_SUCCESS(WdfMemoryCreate(&attributes, NonPagedPoolNx, WIFI_DRIVER_DEFAULT_POOL_TAG, totalSize, &wdfMemoryBufferHandle, &pWdfMemoryBuffer))) - { - WFCError("Failed to allocate memory buffer"); - return nullptr; - } - - RtlZeroMemory(pWdfMemoryBuffer, totalSize); - - // store the wdf memory handle in the header for FreeWdfMemoryBuffer to find the handle - WIFI_IHV_MEMORY_HEADER* pMemoryHeader = static_cast(pWdfMemoryBuffer); - pMemoryHeader->HeaderSize = sizeof(WIFI_IHV_MEMORY_HEADER); - pMemoryHeader->WdfMemoryHandle = wdfMemoryBufferHandle; - - // store the caller and caller's caller for tracking memory leaks - auto memoryContext = GetWificxIhvMemoryContextFromHandle(wdfMemoryBufferHandle); - RtlZeroMemory(memoryContext, sizeof(WIFI_IHV_MEMORY_CONTEXT)); - memoryContext->ContextSize = sizeof(WIFI_IHV_MEMORY_CONTEXT); - memoryContext->pvCaller = CallerForMemoryLeakTracking; - - // hide the wdf memory header to the caller. - const ULONG_PTR wdfMemoryWithHeaderBuffer = reinterpret_cast(pWdfMemoryBuffer); - ULONG_PTR wdfMemoryPayloadOnlyBuffer{ 0 }; - if (!NT_SUCCESS(Wifi::ULongPtrAddSafe(wdfMemoryWithHeaderBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryPayloadOnlyBuffer))) - { - NT_ASSERT(FALSE); - WFCError("Failed to calculate payload buffer address"); - return nullptr; - } - - return reinterpret_cast(wdfMemoryPayloadOnlyBuffer); -} - -void FreeWdfMemoryBuffer(_In_opt_ void* pBuffer) -{ - if (pBuffer == nullptr) // existing wdi code not checking for nullptr before delete, so we have to leave it as is - { - return; - } - const ULONG_PTR wdfMemoryPayloadOnlyBuffer = reinterpret_cast(pBuffer); - ULONG_PTR wdfMemoryWithHeaderBuffer{ 0 }; - if (!NT_SUCCESS(Wifi::ULongPtrSubSafe(wdfMemoryPayloadOnlyBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryWithHeaderBuffer))) - { - NT_ASSERT(FALSE); - WFCError("Failed to calculate header buffer address"); - return; - } - - const auto wificxMemoryHeader = static_cast(reinterpret_cast(wdfMemoryWithHeaderBuffer)); - - // This is memory corruption detection logic, - // keep it, don't remove it. - NT_ASSERT(wificxMemoryHeader->HeaderSize == sizeof(WIFI_IHV_MEMORY_HEADER)); - - WdfObjectDelete(wificxMemoryHeader->WdfMemoryHandle); -} - -_Ret_writes_bytes_maybenull_(_Size) void* PlacementNewHelper(size_t _Size, PCPLACEMENT_NEW_ALLOCATION_CONTEXT AllocationContext) -{ - if (_Size <= AllocationContext->cbMaxSize) - { - RtlZeroMemory(AllocationContext->pbBuffer, _Size); - return AllocationContext->pbBuffer; - } - WFCError( - "Placement operator new called with insufficient buffer space (desired: %Iu, availible: %Iu)", _Size, AllocationContext->cbMaxSize); - return nullptr; -} - -void* __cdecl operator new(size_t Size) noexcept -{ - return AllocateWdfMemoryBuffer(Size, _ReturnAddress()); -} - -__forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationContext) noexcept // for WIFICX TLV -{ - if (AllocationContext != 0) - { - return PlacementNewHelper(_Size, (PPLACEMENT_NEW_ALLOCATION_CONTEXT)AllocationContext); - } - return AllocateWdfMemoryBuffer(_Size, _ReturnAddress()); -} - -void __cdecl operator delete(void* pData) noexcept -{ - FreeWdfMemoryBuffer(pData); -} - -void __cdecl operator delete[](void* pData) noexcept -{ - FreeWdfMemoryBuffer(pData); -} - -void __cdecl operator delete(void* pData, ULONG_PTR) noexcept // For WIFICX TLV -{ - FreeWdfMemoryBuffer(pData); -} - -void __cdecl operator delete[](void* pData, ULONG_PTR) noexcept // For WIFICX TLV -{ - FreeWdfMemoryBuffer(pData); -} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/precomp.h b/network/wlan/WIFICX/drivercode/precomp.h deleted file mode 100644 index 1b0f808e..00000000 --- a/network/wlan/WIFICX/drivercode/precomp.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once - -#ifdef _KERNEL_MODE - #include -#else - #include - #include // For NDIS_STATUS - #include // For NDIS_STATUS codes - #include -#endif -// WDF Headers -#include - -// Network Device Headers -#include -#include - -// WIFI Device Headers -#include -#include "umkmfusion.h" -#include "dot11wificxintf.h" -#include "dot11wificxtypes.hpp" -#include "TLVGeneratorParser.hpp" -#include "SharedTypes.h" - -// WPP Tracing Headers -#include "trace.h" - -// Minimal placement-new to match operator new(size_t, void*) -// TLV generator/parser memory interface has the ULONG_PTR version -inline void* operator new(size_t, void* p) noexcept { return p; } -inline void operator delete(void*, void*) noexcept { /* no-op */ } diff --git a/network/wlan/WIFICX/drivercode/trace.h b/network/wlan/WIFICX/drivercode/trace.h deleted file mode 100644 index 324e1c87..00000000 --- a/network/wlan/WIFICX/drivercode/trace.h +++ /dev/null @@ -1,183 +0,0 @@ -// -// Copyright (C) Microsoft. All rights reserved. -// -#pragma once -#ifndef TRACE_H -#define TRACE_H - -#define WPP_USE_TRACE_LEVELS - -// 21BA7B61-05F8-41F1-9048-C09493DCFE38 -#define WPP_CONTROL_GUIDS \ - WPP_DEFINE_CONTROL_GUID(WdiLibraryCtlGuid, (21BA7B61, 05F8, 41F1, 9048, C09493DCFE38), WPP_DEFINE_BIT(DUMMY)) - -//#define WPP_LEVEL_EXP_ENABLED(LEVEL, EXP) WPP_LEVEL_ENABLED(LEVEL) -//#define WPP_LEVEL_EXP_LOGGER(LEVEL, EXP) WPP_LEVEL_LOGGER(LEVEL) - - -#define WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags) WPP_CONTROL(WPP_BIT_##flags).AutoLogContext, lvl, WPP_BIT_##flags -#define WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags) \ - (WPP_LEVEL_ENABLED(lvl) || lvl < TRACE_LEVEL_VERBOSE || WPP_CONTROL(WPP_BIT_##flags).AutoLogVerboseEnabled) - -#define WPP_RECORDER_LEVEL_ARGS(LEVEL) WPP_RECORDER_LEVEL_FLAGS_ARGS(LEVEL, DUMMY) -#define WPP_RECORDER_LEVEL_FILTER(LEVEL) WPP_RECORDER_LEVEL_FLAGS_FILTER(LEVEL, DUMMY) - -#define WPP_RECORDER_LEVEL_EXP_FILTER(LEVEL, EXP) WPP_RECORDER_LEVEL_FILTER(LEVEL) -#define WPP_RECORDER_LEVEL_EXP_ARGS(LEVEL, EXP) WPP_RECORDER_LEVEL_ARGS(LEVEL) - -// Suppress warnings about constants in logical expressions because the -// level is often a constant -#define WPP_LEVEL_PRE(LEVEL) __pragma(warning(suppress : 25039 25040)) -#define WPP_LEVEL_EXP_PRE(LEVEL, EXP) __pragma(warning(suppress : 25039 25040)) - -#define TraceEntry(...) -#define TraceExit(Status) -#define WFCTrace(Format, ...) -#define WFCError(Format, ...) -#define WFCInfo(Format, ...) - -// begin_wpp config -// USEPREFIX (TraceEntry, "%!STDPREFIX!"); -// FUNC TraceEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); -// USESUFFIX (TraceEntry, "--> %!FUNC!"); -// end_wpp - -// begin_wpp config -// USEPREFIX (TraceExit, "%!STDPREFIX!"); -// FUNC TraceExit{LEVEL=TRACE_LEVEL_VERBOSE}(EXP); -// USESUFFIX (TraceExit, "<-- %!FUNC!: 0x%x", EXP); -// end_wpp - -// -// Flat-C trace commands -// -// begin_wpp config -// -// USEPREFIX (WFCError, "%!STDPREFIX! %!FUNC!: [ERROR]"); -// FUNC WFCError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); -// -// USEPREFIX (WFCInfo, "%!STDPREFIX! %!FUNC!: [INFO]"); -// FUNC WFCInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); -// -// USEPREFIX (WFCTrace, "%!STDPREFIX! %!FUNC!: [TRACE]"); -// FUNC WFCTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); -// -// end_wpp -// - -#define MACRO_START \ - do \ - { -#define MACRO_END \ - } \ - while (0) - -// -// WPP Macros: WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG -// -// begin_wpp config -// FUNC WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(NTEXPR,MSG,...); -// USEPREFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); -// USESUFFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, " [status=%!STATUS!]", nt__wpp); -// end_wpp - -#define WPP_COMPNAME_LEVEL_NTEXPR_PRE(comp, level, ntexpr) \ - MACRO_START NTSTATUS nt__wpp = (ntexpr); \ - if (!NT_SUCCESS(nt__wpp)) \ - { -#define WPP_COMPNAME_LEVEL_NTEXPR_POST(comp, level, ntexpr) \ - ; \ - return nt__wpp; \ - } \ - MACRO_END -#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_FILTER(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) -#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_ARGS(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) - -// -// WPP Macros: WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG -// -// begin_wpp config -// FUNC WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR2,MSG,...); -// USEPREFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); -// USESUFFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!s! is null", #PTR2); -// end_wpp - -#define WPP_COMPNAME_LEVEL_PTR2_PRE(comp, level, ptr) \ - MACRO_START if ((ptr == nullptr)) \ - { -#define WPP_COMPNAME_LEVEL_PTR2_POST(comp, level, ptr) \ - ; \ - return STATUS_INSUFFICIENT_RESOURCES; \ - } \ - MACRO_END -#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) -#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) - -// -// WPP Macros: WX_RETURN_IF_NULL_MSG -// -// begin_wpp config -// FUNC WX_RETURN_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR3,MSG,...); -// USEPREFIX (WX_RETURN_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); -// USESUFFIX (WX_RETURN_IF_NULL_MSG, "%!s! is null", #PTR3); -// end_wpp - -#define WPP_COMPNAME_LEVEL_PTR3_PRE(comp, level, ptr) \ - MACRO_START if ((ptr == nullptr)) \ - { -#define WPP_COMPNAME_LEVEL_PTR3_POST(comp, level, ptr) \ - ; \ - return; \ - } \ - MACRO_END -#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) -#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) - -typedef struct _ByteArray -{ - USHORT usLength; - const void* pvBuffer; -} ByteArray; - -__inline ByteArray log_lenstr(ULONG len, const void* buf) -{ - ByteArray xs{}; - xs.usLength = (USHORT)len; - xs.pvBuffer = buf; - return xs; -} - -#define WPP_LOGHEXDUMP(x) \ - WPP_LOGPAIR(2, &((x).usLength)) \ - WPP_LOGPAIR((x).usLength, (x).pvBuffer) - -#define WPP_LOGANSISTRING(x) \ - WPP_LOGPAIR(2, &((x).usLength)) \ - WPP_LOGPAIR((x).usLength, (x).pvBuffer) - -#define WPP_LOGMACADDR(x) WPP_LOGPAIR(6, x) - -#define WPP_LOGDOT11SSID(x) \ - WPP_LOGPAIR(2, &((*(x)).uSSIDLength)) \ - WPP_LOGPAIR((*(x)).uSSIDLength, ((const char*)(*(x)).ucSSID)) - -// -// Custom types -// -// begin_wpp config -// -// DEFINE_CPLX_TYPE(HEXDUMP, WPP_LOGHEXDUMP, ByteArray, ItemHEXDump,"s", _HEX_, 0,2); -// WPP_FLAGS(-DLOG_HEXDUMP(len,str)=log_lenstr(len,str)); -// -// DEFINE_CPLX_TYPE(ANSISTRING, WPP_LOGANSISTRING, ByteArray, ItemPString,"s", _SSID_, 0,2); -// WPP_FLAGS(-DLOG_ANSISTRING(len,str)=log_lenstr(len,str)); -// -// DEFINE_CPLX_TYPE(DOT11SSID, WPP_LOGDOT11SSID, DOT11_SSID*, ItemPString,"s", _SSID_, 0,2); -// -// DEFINE_CPLX_TYPE(MACADDR, WPP_LOGMACADDR, DOT11_MAC_ADDRESS, ItemMACAddr,"s", _MAC_, 0); -// -// CUSTOM_TYPE(MESSAGE_ID, ItemEnum(WDI_TLV::ENUMS::MESSAGE_ID)); -// end_wpp -// - -#endif diff --git a/network/wlan/WIFICX/drivercode/umkmfusion.h b/network/wlan/WIFICX/drivercode/umkmfusion.h deleted file mode 100644 index 8f0db3f8..00000000 --- a/network/wlan/WIFICX/drivercode/umkmfusion.h +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once -#include "precomp.h" - -#include "winerror.h" - -#ifdef _KERNEL_MODE -#include "ntintsafe.h" -#else -#include "intsafe.h" -#endif - -namespace Wifi -{ - _inline - NTSTATUS ConvertHRESULTToNTSTATUS(HRESULT hr) { - if ((hr & FACILITY_NT_BIT) == FACILITY_NT_BIT) { - return static_cast(hr & ~FACILITY_NT_BIT); // Strip NT bit safely - } - - // Trace the HRESULT value for diagnostics - return SUCCEEDED(hr) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; - } - - __inline - NTSTATUS ConvertNDISSTATUSToNTSTATUS(NDIS_STATUS NdisStatus) - { - if (NT_SUCCESS(NdisStatus) && NdisStatus != NDIS_STATUS_SUCCESS && NdisStatus != NDIS_STATUS_PENDING && - NdisStatus != NDIS_STATUS_INDICATION_REQUIRED) - { - // Case where an NDIS error is incorrectly mapped as a success by NT_SUCCESS macro - return STATUS_UNSUCCESSFUL; - } - else - { - switch (NdisStatus) - { - case NDIS_STATUS_BUFFER_TOO_SHORT: - return STATUS_BUFFER_TOO_SMALL; - break; - default: - return (NTSTATUS)NdisStatus; - break; - } - } - } - - __inline - NDIS_STATUS ConvertNTSTATUSToNDISSTATUS(NTSTATUS NtStatus) - { - if (NT_SUCCESS(NtStatus) && NtStatus != STATUS_PENDING && NtStatus != STATUS_NDIS_INDICATION_REQUIRED) - { - return NDIS_STATUS_SUCCESS; - } - else - { - switch (NtStatus) - { - case STATUS_BUFFER_TOO_SMALL: - return NDIS_STATUS_BUFFER_TOO_SHORT; - break; - default: - return (NDIS_STATUS)NtStatus; - break; - } - } - } - - _Must_inspect_result_ - _inline - NTSTATUS SizeTAddSafe(_In_ size_t Augend, _In_ size_t Addend, _Out_ _Deref_out_range_(== , Augend + Addend) size_t* pResult) - { -#ifdef _KERNEL_MODE - return RtlSizeTAdd(Augend, Addend, pResult); -#else - return ConvertHRESULTToNTSTATUS(SizeTAdd(Augend, Addend, pResult)); -#endif - } - - _Must_inspect_result_ - __inline - NTSTATUS ULongPtrAddSafe( - _In_ ULONGLONG ullAugend, - _In_ ULONGLONG ullAddend, - _Out_ _Deref_out_range_(== , ullAugend + ullAddend) ULONGLONG* pullResult) - { -#ifdef _KERNEL_MODE - return RtlULongPtrAdd(ullAugend, ullAddend, pullResult); -#else - return ConvertHRESULTToNTSTATUS(ULongPtrAdd(ullAugend, ullAddend, pullResult)); -#endif - } - - _Must_inspect_result_ - __inline - NTSTATUS ULongPtrSubSafe( - _In_ ULONGLONG ullMinuend, - _In_ ULONGLONG ullSubtrahend, - _Out_ _Deref_out_range_(== , ullMinuend - ullSubtrahend) ULONGLONG* pullResult) - { -#ifdef _KERNEL_MODE - return RtlULongPtrSub(ullMinuend, ullSubtrahend, pullResult); -#else - return ConvertHRESULTToNTSTATUS(ULongPtrSub(ullMinuend, ullSubtrahend, pullResult)); -#endif - } -} - -#ifndef _KERNEL_MODE -// TODO: Cleanup when EWDK contains the payload of https://microsoft.visualstudio.com/OS/_workitems/edit/58447986 -typedef enum _NDIS_FRAME_HEADER -{ - NdisFrameHeaderUndefined, - NdisFrameHeaderMac, - NdisFrameHeaderArp, - NdisFrameHeaderIPv4, - NdisFrameHeaderIPv6, - NdisFrameHeaderUdp, - NdisFrameHeaderMaximum -}NDIS_FRAME_HEADER, * PNDIS_FRAME_HEADER; - -typedef enum _NDIS_RECEIVE_FILTER_TEST -{ - NdisReceiveFilterTestUndefined, - NdisReceiveFilterTestEqual, - NdisReceiveFilterTestMaskEqual, - NdisReceiveFilterTestNotEqual, - NdisReceiveFilterTestMaximum -}NDIS_RECEIVE_FILTER_TEST, * PNDIS_RECEIVE_FILTER_TEST; -// End of TODO -#endif // !_KERNEL_MODE \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifihal.cpp b/network/wlan/WIFICX/drivercode/wifihal.cpp deleted file mode 100644 index fead61b3..00000000 --- a/network/wlan/WIFICX/drivercode/wifihal.cpp +++ /dev/null @@ -1,984 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. - -#include "precomp.h" -#include "wifirequest.h" -#include "wifiHALtestdata.h" -#include "WifiHal.h" -#include "WifiHal.tmh" - -_Use_decl_annotations_ -NTSTATUS WifiHAL::_Create(WDFDEVICE Device) -{ - // Download firmware, initialize hardware, etc. - - // Create WifiHAL object and associate it with Device context after FW ready - WDF_OBJECT_ATTRIBUTES attributes; - WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WifiHAL); - attributes.EvtCleanupCallback = WifiHAL::_OnCleanup; - - void* memory = nullptr; - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WdfObjectAllocateContext(Device, &attributes, &memory), "Failed to allocate WifiHAL context. Device=%p", Device); - - // Obtain the context and initialize it - auto* wifiHal = reinterpret_cast(memory); - wifiHal->Initialize(Device, &WifiGetIhvDeviceContext(Device)->TlvContext); - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - wifiHal->WifiIhvSetDeviceCapabilities(), - "Failed to set device capabilities. Device=%p", Device); - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -void WifiHAL::_OnCleanup(WDFOBJECT Object) -{ - UNREFERENCED_PARAMETER(Object); -} - -_Use_decl_annotations_ -void WifiHAL::Initialize(WDFDEVICE Device, PCTLV_CONTEXT TlvContext) -{ - m_Device = Device; - m_TlvContext = TlvContext; - m_CurrentRadioState = 1; // On by default - m_LastConnectEntryId = 0; - m_LastConnectTransactionId = 0; - m_LastAuthAlgo = WDI_AUTH_ALGO_UNKNOWN; - RtlZeroMemory(&m_ConnectedPeer, sizeof(m_ConnectedPeer)); - // Initialize link addresses and supported bands (previously in-class const init) - m_LocalLinkAddresses[0] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x21 }; - m_LocalLinkAddresses[1] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x22 }; - m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); -} - -NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() -{ - NTSTATUS status = - ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) - && (WifiGetIhvDeviceContext(m_Device)->netAdapters[0] != WDF_NO_HANDLE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY);// In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized - if(NT_SUCCESS(status) == FALSE) - { - WFCError( - "Device not ready for request. Device=%p, primaryStaAdapter=%p", - m_Device, - (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->netAdapters[0] : WDF_NO_HANDLE); - } - return status; -} - -NTSTATUS WifiHAL::WifiIhvGetPendingTransitionStatus() -{ - return m_LastConnectTransactionId ==0 ? STATUS_SUCCESS : STATUS_PENDING; -} - -NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() -{ - WIFI_DEVICE_CAPABILITIES deviceCaps = {}; - WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); - - deviceCaps.HardwareRadioState = TRUE; - deviceCaps.SoftwareRadioState = TRUE; - RtlCopyMemory(deviceCaps.FirmwareVersion, "1.0.0", sizeof("1.0.0")); - deviceCaps.ActionFramesSupported = TRUE; - deviceCaps.NumRxStreams = 1; - deviceCaps.NumTxStreams = 1; - deviceCaps.Support_eCSA = FALSE; - deviceCaps.MACAddressRandomization = FALSE; - deviceCaps.MACAddressRandomizationMask.Address[0] = 0; - deviceCaps.MACAddressRandomizationMask.Address[1] = 0; - deviceCaps.MACAddressRandomizationMask.Address[2] = 0; - deviceCaps.MACAddressRandomizationMask.Address[3] = 0xFF; - deviceCaps.MACAddressRandomizationMask.Address[4] = 0; - deviceCaps.MACAddressRandomizationMask.Address[5] = 0; - deviceCaps.BluetoothCoexistenceSupport = WDI_BLUETOOTH_COEXISTENCE_PERFORMANCE_MAINTAINED; - deviceCaps.SupportsNonWdiOidRequests = FALSE; - deviceCaps.FastTransitionSupported = TRUE; - deviceCaps.MU_MIMOSupported = FALSE; - deviceCaps.SAEAuthenticationSupported = TRUE; - deviceCaps.BSSTransitionSupported = TRUE; - deviceCaps.MBOSupported = FALSE; - deviceCaps.BeaconReportsImplemented = FALSE; - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetDeviceCapabilities(m_Device, &deviceCaps), - "Failed to set device capabilities"); - - WIFI_STATION_CAPABILITIES StationCaps = {}; - WIFI_STATION_CAPABILITIES_INIT(&StationCaps); - - StationCaps.ScanSSIDListSize = 4; - StationCaps.DesiredSSIDListSize = 1; - StationCaps.PrivacyExemptionListSize = 1; - StationCaps.KeyMappingTableSize = 32; - StationCaps.DefaultKeyTableSize = 4; - StationCaps.WEPKeyValueMaxLength = 0x20; - StationCaps.MaxNumPerSTA = 4; - StationCaps.SupportedQOSFlags = 0; - StationCaps.HostFIPSModeImplemented = FALSE; - StationCaps.MFPCapable = TRUE; - StationCaps.AutoPowerSaveMode = FALSE; - StationCaps.BSSListCachemanagement = FALSE; - StationCaps.ConnectBSSSelectionOverride = FALSE; - StationCaps.MaxNetworkOffloadListSize = 0; - StationCaps.HESSIDConnectionSupported = FALSE; - StationCaps.FTMAsInitiatorSupport = FALSE; - StationCaps.FTMNumberOfSupportedTargets = 0; - - const DOT11_AUTH_CIPHER_PAIR UnicastAlgos[] = { - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_WEP}, - {DOT11_AUTH_ALGO_WPA_PSK, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_TKIP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_CCMP}, - {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_GCMP_256}, - {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_CCMP}, - }; - - const DOT11_AUTH_CIPHER_PAIR McastMgmtAlgos[] = { - {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, - {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_BIP}, - {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_BIP_GMAC_256}, - }; - - StationCaps.NumSupportedUnicastAlgorithms = ARRAYSIZE(UnicastAlgos); - StationCaps.UnicastAlgorithmsList = const_cast(UnicastAlgos); - StationCaps.NumSupportedMulticastDataAlgorithms = ARRAYSIZE(UnicastAlgos); - StationCaps.MulticastDataAlgorithmsList = const_cast(UnicastAlgos); - StationCaps.NumSupportedMulticastMgmtAlgorithms = ARRAYSIZE(McastMgmtAlgos); - StationCaps.MulticastMgmtAlgorithmsList = const_cast(McastMgmtAlgos); - - WIFI_STA_BANDS_COMBINATION SecondaryStaBandsCombinations[] = { - {2, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {2, {WDI_BAND_ID_2400, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {2, {WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, - {3, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN}}, - }; - - StationCaps.NumSecondaryStaBandCombinations = ARRAYSIZE(SecondaryStaBandsCombinations); - StationCaps.SecondaryStaBandsCombinations = SecondaryStaBandsCombinations; - - WDI_MAC_ADDRESS MLOAddresses[] = { - {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, - {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, - }; - StationCaps.MaxMLOLinksSupported = ARRAYSIZE(MLOAddresses); - StationCaps.MLOAddressesList = MLOAddresses; - - RSNA_AKM_SUITE AkmsList[] = { - rsna_akm_1x, - rsna_akm_psk, - rsna_akm_ft_1x_sha256, - rsna_akm_ft_psk_sha256, - rsna_akm_1x_sha256, - rsna_akm_psk_sha256, - rsna_akm_sae_pmk256, - rsna_akm_1x_suite_b_sha384, - rsna_akm_owe, - rsna_akm_1x_sha384, - rsna_akm_sae_pmk384, - }; - StationCaps.NumAkmsSupported = ARRAYSIZE(AkmsList); - StationCaps.AkmsList = AkmsList; - - if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)) - { - StationCaps.MSCSSupported = true; - } - if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)) - { - StationCaps.DSCPToUPMappingSupported = true; - } - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetStationCapabilities(m_Device, &StationCaps), - "Failed to set station capabilities"); - - WIFI_BAND_CAPABILITIES BandCaps = {}; - WIFI_BAND_CAPABILITIES_INIT(&BandCaps); - - const WDI_PHY_TYPE Phy24GHz[] = { WDI_PHY_TYPE_ERP, WDI_PHY_TYPE_HE }; // g, ax - const WDI_PHY_TYPE Phy5GHz[] = { WDI_PHY_TYPE_OFDM, WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // a, ax, be - const WDI_PHY_TYPE Phy6GHz[] = { WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // ax, be - const WDI_PHY_TYPE pPhy60GHz[] = { WDI_PHY_TYPE_DMG }; // ad - const WDI_PHY_TYPE phyIHV[2] = { WDI_PHY_TYPE_OFDM, static_cast(WDI_PHY_TYPE_IHV_START + 1) }; - - // clang-format off - - const WDI_CHANNEL_MAPPING_ENTRY ChannelMap24[] = { - {1, 2412}, - {2, 2417}, - {3, 2422}, - {4, 2427}, - {5, 2432}, - {6, 2437}, - {7, 2442}, - {8, 2447}, - {9, 2452}, - {10, 2457}, - {11, 2462}, - {12, 2467}, // Not used in US - {13, 2472}, // Not used in US - {14, 2484}, // Allowed in Japan only - }; - - const WDI_CHANNEL_MAPPING_ENTRY ChannelMap5[] = { - {7, 5035}, // Not used in US - {8, 5040}, // Not used in US - {9, 5045}, // Not used in US - {11, 5055}, // Not used in US - {12, 5060}, // Not used in US - {16, 5080}, // Not used in US - {32, 5160}, // Unknown status - {34, 5170}, // Not used in US - {36, 5180}, - {38, 5190}, - {40, 5200}, - {42, 5210}, - {44, 5220}, - {46, 5230}, - {48, 5240}, - {50, 5250}, // DFS - {52, 5260}, // DFS - {54, 5270}, // DFS - {56, 5280}, // DFS - {58, 5290}, // DFS - {60, 5300}, // DFS - {62, 5310}, // DFS - {64, 5320}, // DFS - {68, 5340}, // Unknown status - {96, 5480}, // Unknown status - {100, 5500}, // DFS - {102, 5510}, // DFS - {104, 5520}, // DFS - {106, 5530}, // DFS - {108, 5540}, // DFS - {110, 5550}, // DFS - {112, 5560}, // DFS - {114, 5570}, // DFS - {116, 5580}, // DFS - {118, 5590}, // DFS - {120, 5600}, // DFS - {122, 5610}, // DFS - {124, 5620}, // DFS - {126, 5630}, // DFS - {128, 5640}, // DFS - {132, 5660}, // DFS - {134, 5670}, // DFS - {136, 5680}, // DFS - {138, 5690}, // DFS - {140, 5700}, // DFS - {142, 5710}, // DFS - {142, 5720}, // DFS - {144, 5730}, // DFS - {149, 5745}, - {151, 5755}, - {153, 5765}, - {155, 5785}, - {157, 5785}, - {159, 5795}, - {161, 5805}, - {165, 5825}, - {169, 5845}, // Not used in US - {173, 5865}, // Not used in US - {183, 4915}, // Not used in US - {184, 4920}, // Not used in US - {185, 4925}, // Not used in US - {187, 4935}, // Not used in US - {188, 4940}, // Not used in US - {189, 4945}, // Not used in US - {192, 4960}, // Not used in US - {196, 4980}, // Not used in US - }; - - const WDI_CHANNEL_MAPPING_ENTRY channelMap6[] = { - {1, 5955}, - {5, 5975}, // PSC Channel (1) - {9, 5995}, - - {13, 6015}, - {17, 6035}, - {21, 6055}, // PSC Channel (2) - {25, 6075}, - {29, 6095}, - - {33, 6115}, - {37, 6135}, // PSC Channel (3) - {41, 6155}, - {45, 6175}, - {49, 6195}, - - {53, 6215}, // PSC Channel (4) - {57, 6235}, - {61, 6255}, - {65, 6275}, - {69, 6295}, // PSC Channel (5) - - {73, 6315}, - {77, 6335}, - {81, 6355}, - {85, 6375}, // PSC Channel (6) - {89, 6395}, - - {93, 6415}, - {97, 6435}, - {101, 6455}, // PSC Channel (7) - {105, 6475}, - {109, 6495}, - - {113, 6515}, - {117, 6535}, // PSC Channel (8) - {121, 6555}, - {125, 6575}, - {129, 6595}, - - {133, 6615}, // PSC Channel (9) - {137, 6635}, - {141, 6655}, - {145, 6675}, - {149, 6695}, // PSC Channel (10) - - {153, 6715}, - {157, 6735}, - {161, 6755}, - {165, 6775}, // PSC Channel (11) - {169, 6795}, - - {173, 6815}, - {177, 6835}, - {181, 6855}, // PSC Channel (12) - {185, 6875}, - {189, 6895}, - - {193, 6915}, - {197, 6935}, // PSC Channel (13) - {201, 6955}, - {205, 6975}, - {209, 6995}, - - {213, 7015}, // PSC Channel (14) - {217, 7035}, - {221, 7055}, - {225, 7075}, - {229, 7095}, // PSC Channel (15) - - {233, 7115}, - {237, 7135}, - {241, 7155}, - {245, 7175}, - {249, 7195}, - - {253, 7215}, - }; - - const WDI_CHANNEL_MAPPING_ENTRY channelMap60[] = { - {1, 58320}, - {2, 60480}, - {3, 62640}, - {4, 64800}, - {5, 66960}, - {6, 69120}, - }; - - // clang-format on - - UINT32 ChannelWidth10Mhz = 10; - UINT32 ChannelWidth20Mhz = 20; - UINT32 channelWidth2160Mhz = 2160; - UINT32 pChannelWidth6Ghz[] = { 20, 40, 80, 160, 320 }; - - WIFI_BAND_INFO BandInfo[4] = {}; // Upto 4 bands - UINT32 bandInfoCount = 0; - - if (m_SupportedBands & WDI_BAND_ID_2400) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_2400; - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy24GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy24GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap24); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap24); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth10Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 1); - - if (m_SupportedBands & WDI_BAND_ID_5000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_5000; - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy5GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy5GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap5); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap5); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth20Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 2); - - if (m_SupportedBands & WDI_BAND_ID_6000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_6000; // 6 - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy6GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy6GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap6); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap6); - BandInfo[bandInfoCount].NumChannelWidths = ARRAYSIZE(pChannelWidth6Ghz); - BandInfo[bandInfoCount].ChannelWidthList = pChannelWidth6Ghz; - bandInfoCount++; - } - - NT_ASSERT(bandInfoCount <= 3); - if (m_SupportedBands & WDI_BAND_ID_60000) - { - BandInfo[bandInfoCount].BandID = WDI_BAND_ID_60000; // 60 - BandInfo[bandInfoCount].BandState = TRUE; - BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(pPhy60GHz); - BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(pPhy60GHz); - BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap60); - BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap60); - BandInfo[bandInfoCount].NumChannelWidths = 1; - BandInfo[bandInfoCount].ChannelWidthList = &channelWidth2160Mhz; - bandInfoCount++; - } - NT_ASSERT(bandInfoCount <= 4); - - BandCaps.NumBands = bandInfoCount; - BandCaps.BandInfoList = BandInfo; - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetBandCapabilities(m_Device, &BandCaps), - "Failed to set band capabilities"); - - WIFI_PHY_CAPABILITIES PhyCaps = {}; - WIFI_PHY_CAPABILITIES_INIT(&PhyCaps); - - WIFI_PHY_INFO PhyInfoList[3]; - - const WDI_DATA_RATE_ENTRY DataRateListErp[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 4}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 22}, - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - const WDI_DATA_RATE_ENTRY DataRateListOfdm[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - const WDI_DATA_RATE_ENTRY DataRateListEht[] = { - {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; - - PhyInfoList[0].PhyType = WDI_PHY_TYPE_ERP; - PhyInfoList[0].NumberDataRateEntries = ARRAYSIZE(DataRateListErp); - RtlCopyMemory(&PhyInfoList[0].DataRateList, &DataRateListErp, sizeof(DataRateListErp)); - - PhyInfoList[1].PhyType = WDI_PHY_TYPE_HE; - PhyInfoList[1].NumberDataRateEntries = ARRAYSIZE(DataRateListOfdm); - RtlCopyMemory(&PhyInfoList[1].DataRateList, &DataRateListOfdm, sizeof(DataRateListOfdm)); - - PhyInfoList[2].PhyType = WDI_PHY_TYPE_EHT; - PhyInfoList[2].NumberDataRateEntries = ARRAYSIZE(DataRateListEht); - RtlCopyMemory(&PhyInfoList[2].DataRateList, &DataRateListEht, sizeof(DataRateListEht)); - - PhyCaps.NumPhyTypes = ARRAYSIZE(PhyInfoList); - PhyCaps.PhyInfoList = PhyInfoList; - - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( - WifiDeviceSetPhyCapabilities(m_Device, &PhyCaps), - "Failed to set PHY capabilities"); - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER, UINT) -{ - if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) - { - WFCTrace("DOT11 Reset, set default MIB = %d, no MAC Address specified\n", ResetParameters.Dot11ResetParameters.SetDefaultMIB); - } - else - { - WFCTrace( - "DOT11 Reset, set default MIB = %d, MAC Address = %2x:%2x:%2x:%2x:%2x:%2x\n", - ResetParameters.Dot11ResetParameters.SetDefaultMIB, - ResetParameters.ResetMACAddress.Address[0], - ResetParameters.ResetMACAddress.Address[1], - ResetParameters.ResetMACAddress.Address[2], - ResetParameters.ResetMACAddress.Address[3], - ResetParameters.ResetMACAddress.Address[4], - ResetParameters.ResetMACAddress.Address[5]); - } - - // Reset the connection ID in case the previous connection attempt did not complete - m_LastConnectEntryId = 0; - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) -{ - WFCInfo("Setting OS requested Radio State: SoftwareRadioState=%u\n", RadioState.SoftwareRadioState); - if (RadioState.SoftwareRadioState != m_CurrentRadioState) - { - // Change the radio state - m_CurrentRadioState = RadioState.SoftwareRadioState; - - // Send the radio state indication - WDI_INDICATION_RADIO_STATUS_PARAMETERS RadioStatusParams = {}; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - RadioStatusParams.RadioState.HardwareState = TRUE; - RadioStatusParams.RadioState.SoftwareState = m_CurrentRadioState; - if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, m_TlvContext, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) - { - WFCInfo("Indicate OS with Radio State: SoftwareRadioState=%u\n", m_CurrentRadioState); - WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, pOutput, cbOutput); - FreeGenerated(pOutput); - } - } - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvScan(const WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) -{ - for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) - { - if (m_SupportedBands & g_ConnectEntries[connectEntry].BandId) - { - PUCHAR pBssEntry = g_ConnectEntries[connectEntry].pTlvBssEntry; - // - // If currently connected, see if the connected entry should be skipped - // - if ((m_LastConnectEntryId != 0) && - (RtlCompareMemory(&m_ConnectedPeer, &pBssEntry[8], sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS))) - { - // Already connected, don't report this entry - continue; - } - - // TODO: Skip the IHV band as it is not being reported in capabilities - if (g_ConnectEntries[connectEntry].BandId == TESTMP_BAND_IHV) - { - continue; - } - - // Send the BSS entry indication - WifiIhvSendUnsolicitedIndicationToOs( - m_Device, - pWdiHeader, - WDI_INDICATION_BSS_ENTRY_LIST, - g_ConnectEntries[connectEntry].pTlvBssEntry, - g_ConnectEntries[connectEntry].TlvBssEntrySize); - } - } - - // - // See if the hidden network needs to be indicated - // - if ((ScanParameters.SSIDList.ElementCount > 0) && (ScanParameters.SSIDList.pElements[0].ElementCount == 8) && - (ScanParameters.SSIDList.pElements[0].pElements[4] == 'H') && (ScanParameters.SSIDList.pElements[0].pElements[5] == 'I') && - (ScanParameters.SSIDList.pElements[0].pElements[6] == 'D') && (ScanParameters.SSIDList.pElements[0].pElements[7] == 'E')) - { - WifiIhvSendUnsolicitedIndicationToOs( - m_Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); - } - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) -{ - NT_ASSERT(m_LastConnectEntryId == 0); -#ifdef NETV_SUPPORT_TX_DEMUXING - if (m_LastConnectEntryId != 0) // Not Disconnected State - { - WifiAdapterRemovePeer( - WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], - reinterpret_cast(&m_ConnectedPeer)); - } -#endif //NETV_SUPPORT_TX_DEMUXING - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( - &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), - "Failed to perform association"); - - // - // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete - // - if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) - { - m_LastConnectTransactionId = pWdiHeader->TransactionId; - } - else - { - m_LastConnectTransactionId = 0; - } - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) -{ - // Report link quality - NTSTATUS ntStatus = STATUS_SUCCESS; - PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); - WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; - WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - RtlCopyMemory( - &linkStateChangeParameters.LinkStateChangeParameters.PeerMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - linkStateChangeParameters.LinkStateChangeParameters.TxLinkSpeed = 30000; - linkStateChangeParameters.LinkStateChangeParameters.RxLinkSpeed = 30000; - linkStateChangeParameters.LinkStateChangeParameters.LinkQuality = 56; - - // Default linkId for non-Mlo connections is 0 - pLinkInfo[0].LinkID = 0; - RtlCopyMemory(&pLinkInfo[0].LocalLinkMACAddress, &m_LocalLinkAddresses[0], sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&pLinkInfo[0].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - pLinkInfo[0].ChannelNumber = 6; - pLinkInfo[0].BandId = WDI_BAND_ID_2400; - pLinkInfo[0].RSSI = -50; - pLinkInfo[0].Bandwidth = 40; - pLinkInfo[0].TxMCS = 3; - pLinkInfo[0].RxMCS = 4; - - if (numLinks > 1) - { - // For Mlo connections, set the link ID for the first link to 1 - pLinkInfo[0].LinkID = 1; - - pLinkInfo[1].LinkID = 2; - RtlCopyMemory(&pLinkInfo[1].LocalLinkMACAddress, &m_LocalLinkAddresses[1], sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&pLinkInfo[1].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - pLinkInfo[1].ChannelNumber = 36; - pLinkInfo[1].BandId = WDI_BAND_ID_5000; - pLinkInfo[1].RSSI = -30; - pLinkInfo[1].Bandwidth = 160; - pLinkInfo[1].TxMCS = 8; - pLinkInfo[1].RxMCS = 9; - } - - linkStateChangeParameters.LinkInfo.pElements = pLinkInfo; - linkStateChangeParameters.LinkInfo.ElementCount = numLinks > 1 ? 2 : 1; - - ntStatus = GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); - if (STATUS_SUCCESS == ntStatus) - { - WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, pOutput, cbOutput); - FreeGenerated(pOutput); - } - else - { - WFCError("Failed to generate WDI_INDICATION_LINK_STATE_CHANGE - 0x%08x\n", ntStatus); - } - - return ntStatus; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvPerformAssociation( - const struct ArrayOfElements* pPreferredBSSEntryList, - const struct ArrayOfElements* pAuthenticationAlgorithms, - const PWDI_MESSAGE_HEADER pWdiHeader) -{ - - ULONG bssIndex = 0; - ULONG connectEntry = ConnectEntryId_MAX; - NTSTATUS ntStatus = STATUS_SUCCESS; - UINT32 NewConnectEntryId = 0; // Disconnected State - WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; - UCHAR pucData[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10 }; - - PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); - - ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; - - do - { - // We search for the BSSID pattern to figure out what AP we are trying to connect to - for (bssIndex = 0; bssIndex < pPreferredBSSEntryList->ElementCount; bssIndex++) - { - for (connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) - { - if (RtlCompareMemory( - pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, - g_ConnectEntries[connectEntry].pMacAddress, - sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS)) - { - PUCHAR pAssociationResult = g_ConnectEntries[connectEntry].pTlvAssociationResult; - - NewConnectEntryId = connectEntry; - m_LastConnectTransactionId = pWdiHeader->TransactionId; -#ifdef NETV_SUPPORT_TX_DEMUXING - // add peer on datapath - WifiAdapterAddPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], - reinterpret_cast(g_ConnectEntries[connectEntry].pMacAddress)); -#endif // NETV_SUPPORT_TX_DEMUXING -#ifdef WIFI_IHV_HANDSHAKE - // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. - RecieveDatapathFrame(0x33, sizeof(pucData), pucData); -#endif // WIFI_IHV_HANDSHAKE - - if (NewAuthAlgo == WDI_AUTH_ALGO_WPA3_SAE) - { - WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; - - // - // Handle special case for WPA3-SAE - // Send the Indication to request additonal SAE params - // - g_dwSaeResendConfirmRequested = 0; - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_REQUEST_PARAMS_NEEDED; - RtlCopyMemory( - SAEAuthParamsNeeded.BssId.Address, g_ConnectEntries[connectEntry].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); - - ndisStatus = GenerateWdiIndicationSaeAuthParamsNeeded( - &SAEAuthParamsNeeded, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); - - WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); - - FreeGenerated(pOutput); - - break; - } - } - - // Get the assoc status - RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); - - // Send the association indication - WifiIhvSendUnsolicitedIndicationToOs( - m_Device, - pWdiHeader, - WDI_INDICATION_ASSOCIATION_RESULT, - g_ConnectEntries[connectEntry].pTlvAssociationResult, - g_ConnectEntries[connectEntry].TlvAssociationResultSize); - - break; - } - } - - // If we found a matching BSSID entry, we are done - if (connectEntry < ConnectEntryId_MAX) - { - break; - } - } - - } while (FALSE); - - if (WDI_ASSOC_STATUS_SUCCESS != assocStatus || 0 == NewConnectEntryId || bssIndex >= pPreferredBSSEntryList->ElementCount) - { - NewConnectEntryId = 0; // Disconnected State - NewAuthAlgo = WDI_AUTH_ALGO_80211_OPEN; - ntStatus = STATUS_UNSUCCESSFUL; - } - else - { - RtlCopyMemory(&m_ConnectedPeer, pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, sizeof(DOT11_MAC_ADDRESS)); - } - - m_LastConnectEntryId = NewConnectEntryId; - m_LastAuthAlgo = NewAuthAlgo; - - if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo)) - { - // Report link quality - ntStatus = WifiIhvSendLinkStateIndication(pWdiHeader, 2); - } - - return ntStatus; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) -{ - //Since this is DIRECT OID, need to check the m_LastConnectTransactionId match - if (pWdiHeader->TransactionId != m_LastConnectTransactionId) - { - WFCError("WDI_SET_SAE_AUTH_PARAMS called with invalid TransactionId: %llu, expected: %llu\n", - pWdiHeader->TransactionId, m_LastConnectTransactionId); - return STATUS_INVALID_DEVICE_REQUEST; - } - - WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded{}; - UINT8* pOutput = nullptr; - ULONG cbOutput = 0; - - // Commit frame when Status = 0: FiniteCyclicGroup + Scalar + Element - // Commit frame when Status = 76: FiniteCyclicGroup + AntiCloggingToken - WFCInfo("WDI_SET_SAE_AUTH_PARAMS called!!!\n"); - if (WDI_SAE_REQUEST_TYPE_COMMIT_PARAMS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Commit request for Tx, Setting CommitResponse for Rx\n"); - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - - // - // Send reflection attack first - // - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponseReflection); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponseReflection; - } - else if ( - (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) && - (WDI_SAE_STATUS_COMMIT_MESSAGE_REFLECTION_ATTACK_DETECTED == setSAEAuthParams.SAEStatus)) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS returned Reflection error -- Inidicate proper CommitResponse for Rx\n"); - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponse); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponse; - } - else if (WDI_SAE_REQUEST_TYPE_CONFIRM_PARAMS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Confirm request for Tx, Setting ConfirmResponse for Rx\n"); - - if (g_dwSaeResendConfirmRequested) - { - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; - SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; - SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAEConfirmResponse); - SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAEConfirmResponse; - } - else - { - g_dwSaeResendConfirmRequested = 1; - - SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_REQUEST_RESEND_REQUEST; - } - } - else - { - if (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated error - %d\n", setSAEAuthParams.SAEStatus); - } - else if (WDI_SAE_REQUEST_TYPE_SUCCESS == setSAEAuthParams.SAERequestType) - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated SAE success - %d\n", setSAEAuthParams.SAEStatus); - } - else - { - WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has set INVALID Request type = %d\n", setSAEAuthParams.SAERequestType); - } - - // Send the association indication - // This assumes that the association result fields are in the right order - if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) - { - g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_WPA3_SAE; - } - else - { - g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; - } - - WifiIhvSendUnsolicitedIndicationToOs( - m_Device, - pWdiHeader, - WDI_INDICATION_ASSOCIATION_RESULT, - g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult, - g_ConnectEntries[m_LastConnectEntryId].TlvAssociationResultSize); - RtlCopyMemory(&m_ConnectedPeer, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); - - // Report link quality - WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(pWdiHeader, 1), - "Failed WifiIhvSendLinkStateIndication"); - - // Complete the transaction to let the M4 hanlder WifiIhvGetPendingTransitionStatus know that association is complete - m_LastConnectTransactionId = 0; - -#ifdef WIFI_IHV_HANDSHAKE - // - // Receive M1 frame of 4-way handshake - // - RecieveDatapathFrame(0x33, sizeof(pucM1SaeFrame), pucM1SaeFrame); - - // - // Receive M3 frame of 4-way handshake - // - RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); -#endif - return STATUS_SUCCESS; - } - - RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); - - auto ndisStatus = - GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, m_TlvContext, &cbOutput, &pOutput); - if (ndisStatus == NDIS_STATUS_SUCCESS) - { - WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); - - FreeGenerated(pOutput); - } - else - { - WFCError("Failed to generate WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED - 0x%08x\n", ndisStatus); - } - - return STATUS_SUCCESS; -} - -_Use_decl_annotations_ -NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) -{ - UCHAR s_TLV_Disassociation[] = - { - // WDI_TLV_ASSOCIATION_RESULT - 0xBC, 0x00, - 0x0A, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - - // WDI_TLV Need Peer Cleanup Params - 0xb4, 0x00, - 0x01, 0x00, - - 0x00 - }; - WDI_ASSOC_STATUS DisassocStatus = WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST; - - RtlCopyMemory(&s_TLV_Disassociation[4], &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); - - // Send the disassociation indication - WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); - - m_LastConnectEntryId = 0; // Disconnected State - -#ifdef NETV_SUPPORT_TX_DEMUXING - WifiAdapterRemovePeer( - WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], - reinterpret_cast(&m_ConnectedPeer)); -#endif - RtlZeroMemory(&m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); - - return STATUS_SUCCESS; -} diff --git a/network/wlan/WIFICX/drivercode/wifihal.h b/network/wlan/WIFICX/drivercode/wifihal.h deleted file mode 100644 index 38e1166a..00000000 --- a/network/wlan/WIFICX/drivercode/wifihal.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once - -// The class for Wifi IHV device's HAL functionalities -class WifiHAL -{ -public: - static NTSTATUS _Create(_In_ WDFDEVICE Device); - static void _OnCleanup(_In_ WDFOBJECT Object); - - // Default ctor so context memory can be zeroed by WDF without placement new - WifiHAL() = default; - - // Initialization routine replacing the previous parameterized ctor usage - void Initialize(_In_ WDFDEVICE Device, _In_ PCTLV_CONTEXT TlvContext); - - // Wifi request M3 working condition verification function - NTSTATUS WifiIhvIsDeviceReadyForRequest(); - - // Wifi request pending transition status check function - // for example, during SAE authentication, the connect request is pending until SAE exchange is complete - NTSTATUS WifiIhvGetPendingTransitionStatus(); - - NTSTATUS WifiIhvSetDeviceCapabilities(); - NTSTATUS WifiIhvReset(_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); - NTSTATUS WifiIhvSetRadioState(_In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); - NTSTATUS WifiIhvScan(_In_ const WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); - NTSTATUS WifiIhvConnect(_In_ const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); - NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); - NTSTATUS WifiIhvDisconnect(_In_ const WDI_TASK_DISCONNECT_PARAMETERS& disconnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); -private: - NTSTATUS WifiIhvPerformAssociation(_In_ const struct ArrayOfElements* pPreferredBSSEntryList, _In_ const struct ArrayOfElements* pAuthenticationAlgorithms, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); - NTSTATUS WifiIhvSendLinkStateIndication(_In_ const PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); - - WDFDEVICE m_Device{}; - PCTLV_CONTEXT m_TlvContext{}; - - UCHAR m_CurrentRadioState{}; - UINT32 m_LastConnectEntryId{}; - UINT32 m_LastConnectTransactionId{}; - WDI_AUTH_ALGORITHM m_LastAuthAlgo{}; - DOT11_MAC_ADDRESS m_ConnectedPeer{}; - - // Removed const so we can initialize without running a constructor via placement new - WDI_MAC_ADDRESS m_LocalLinkAddresses[2]; - ULONG m_SupportedBands; -}; -WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiHAL, GetWifiHalFromHandle); diff --git a/network/wlan/WIFICX/drivercode/wifihaltestdata.h b/network/wlan/WIFICX/drivercode/wifihaltestdata.h deleted file mode 100644 index 7ded0f2b..00000000 --- a/network/wlan/WIFICX/drivercode/wifihaltestdata.h +++ /dev/null @@ -1,8290 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once - -#define TESTMP_BAND_IHV 0x00000010 - -// clang-format on - -#define ConnectEntryId_MAX ARRAYSIZE(g_ConnectEntries) - -// -//=============================================================================== -// Set alternate local addresses based on simulation parameters -//=============================================================================== -// -UCHAR s_ArubaSimLocalAddress[] = {0xd4, 0x6a, 0x6a, 0x52, 0x18, 0x07}; // For Wpa3SuiteB - Aruba -UCHAR g_IntelSimLocalAddress[] = {0x34, 0x13, 0xe8, 0xb3, 0x14, 0x4c}; // For Wpa3SuiteB - Intel -UCHAR g_SaeSimLocalAddress[] = {0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5}; // For Wpa3Sae - -#ifdef WPA3_ARUBA_SIM -PUCHAR g_AlternateLocalAddress = s_ArubaSimLocalAddress; -#elif WPA3_INTEL_SIM -PUCHAR g_AlternateLocalAddress = g_IntelSimLocalAddress; -#elif WPA3_SAE -PUCHAR g_AlternateLocalAddress = g_SaeSimLocalAddress; -#else -PUCHAR g_AlternateLocalAddress = NULL; -#endif - -// clang-format off - -// -//=============================================================================== -// - -UCHAR s_DeviceServiceTestBlob[] = -{ - 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa -}; - -// -//=============================================================================== -// - -UCHAR s_TLV_AssociationParametersRequestedType[] = -{ - // WDI_TLV_ASSOCIATION_PARAMETERS_REQUESTED_TYPE - 0xBB, 0x00, - 0x02, 0x00, - 0x9F, 0x00 // PMKID -}; - -UCHAR s_TLV_RoamingNeededIndication[] = -{ - // WDI_TLV_ROAMING_NEEDED_PARAMETERS - 0x55, 0x00, - 0x04, 0x00, - 0x0a, 0x00, 0x00, 0x00 -}; - -UCHAR s_TLV_NeighborReport[] = -{ - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ACTION_FRAME_BODY - 0xBE, 0x00, - 0x14, 0x00, - 0x05, // Category = Radio Measurement - 0x05, // Action = Neighbor Report Response - 0x01, // Dialog Token - 0x34, // Element ID = Neighbor Report - 0x0F, // Length - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, // BSSID - 0x00, 0x00, 0x00, 0x00, // BSSID Information - 0x00, // Operating class - 0x06, // Channel Number - 0x00, // PHY Type - 0x00, 0x00, // Optional IEs -}; - -// -//=============================================================================== -// - -// -//=============================================================================== -// BSs entries -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr = {0x00, 0x20, 0x30, 0x40, 0x50, 0x60}; - -UCHAR s_TLV_BSS_Entry_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - - -UCHAR s_TLV_OpenDisassociation[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0xBC, 0x00, - 0x0A, 0x00, - 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, - 0x01, 0x00, 0x00, 0x00, - - // WDI_TLV Need Peer Cleanup Params - 0xb4, 0x00, - 0x01, 0x00, - 0x00 -}; - -WDI_MAC_ADDRESS s_Connect_Addr_2_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2}; - -UCHAR s_TLV_BSS_Entry_2_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x59, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x26, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x28, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID - -}; - -UCHAR s_TLV_Success_AssociationResult_2_Open[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x25, 0x00, - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_3_WEP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3}; - -UCHAR s_TLV_BSS_Entry_3_WEP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x1f, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x03, 0x01, 0x01, // DSSS Parameter (Offset: 42) - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x3C, 0x00, 0x00, 0x00, // Link Quality (Offset: 57) - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel (Offset: 64) - 0x01, 0x00, 0x00, 0x00, // Band ID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_3_WEP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x32, 0x00, - 0x10, 0x04, // Capability - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_4_RSNA_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4}; - -#define WFA_TEST_MIN_RSN_IE 1 - -UCHAR s_TLV_BSS_Entry_4_RSNA_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type -#ifdef WFA_TEST_MIN_RSN_IE - 0x79, 0x00, //Len -#else - 0x8B, 0x00, //Len -#endif // WFA_TEST_MIN_RSN_IE - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, -#ifdef WFA_TEST_MIN_RSN_IE - 0x46, 0x00, -#else - 0x58, 0x00, -#endif // WFA_TEST_MIN_RSN_IE - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved -#ifdef WFA_TEST_MIN_RSN_IE - 0x30, 0x02, - 0x01, 0x00, -#else - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite -- RSNA_PSK - 0x00, 0x00, // RSN Capability -#endif // WFA_TEST_MIN_RSN_IE - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_4_RSNA_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x22, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x48, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x58, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_5_IHV = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5}; - -UCHAR s_TLV_BSS_Entry_5_IHV [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x1f, 0x00, - 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x03, 0x01, 0x01, // DSSS Parameter - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x3C, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel = 36 - 0x08, 0x00, 0x00, 0x00, // Band ID = Custom -// 0x02, 0x00, 0x00, 0x00, // Band ID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_5_IHV[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x02, 0x00, 0x00, 0x80, //AuthAlgorithm = Custom - 0x01, 0x00, 0x00, 0x80, //UnicastCipherAlgorithm - 0x01, 0x00, 0x00, 0x80, //MulticastDataCipherAlgorithm - 0x01, 0x00, 0x00, 0x80, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x80, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x32, 0x00, - 0x10, 0x04, // Capability - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x24, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x10, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x02, 0x00, 0x00, 0x80, // Phy = IHV Phy 2 - -}; - - -UCHAR s_TLV_IhvRequestComplete[] = -{ - // WDI_TLV_IHV_DATA - 0xBD, 0x00, - 0x0A, 0x00, - - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0x00, 0x00, 0x01 -}; - - -UCHAR s_TLV_IhvIndication[] = -{ - // WDI_TLV_IHV_DATA - 0xBD, 0x00, - 0x30, 0x00, - - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5 -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_6_FT_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6}; - -UCHAR s_TLV_BSS_Entry_6_FT_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xEA, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xB7, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x53, 0x8D, 0x5B, - 0x2A, 0x01, - 0x00, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x85, 0x1E, - 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x4A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_6_FT_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0C, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, - - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x06, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x3E, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT - 0x0C, 0x00, // RSN Capability - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0xDD, 0x07, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0xC5, 0x00, - 0x31, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, // Supported Rates - 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x26, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT - 0x28, 0x00, // RSN Capability - 0x01, 0x00, // PMKID Count -- PMKR1Name - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x37, 0x69, // FTE IE - 0x00, 0x00, // MIC Control - 0 => no MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x06, // R1KH-ID - 0xB4, 0xC7, 0x99, 0x8A, 0xB6, 0x30, - 0x03, 0x0D, // R0KH-ID - 'a', 'p', '8', '1', '3', '2', '-', '7', '3', '4', 'E', 'B', '0', - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xB7, 0x00, - 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x07, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT - 0x01, 0x08, - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x6E, 0x8D, 0x5B, - 0x2A, 0x01, // ERP - 0x00, - 0x30, 0x14, // RSN - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x03, // AKM Suite - 0x0C, 0x00, // RSN Capability - 0x32, 0x01, // Extended Supported Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x0B, 0x47, // MDID - 0x00, // FT Capability and Policy - 0x85, 0x1E, - 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_7_FT_PSK_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7}; - -UCHAR s_TLV_BSS_Entry_7_FT_PSK_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xED, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xBA, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x53, 0x8D, 0x5B, - 0x2A, 0x01, - 0x00, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x85, 0x1E, - 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x4A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_7_FT_PSK_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0C, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x41, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x14, // RSN IE - 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, - 0xAC, 0x01, 0x00, 0x00, - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0xDD, 0x07, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0xBF, 0x00, - 0x31, 0x04, // Capability - 0x00, 0x00, // Status - 0x01, 0xC0, // Association ID - 0x01, 0x08, // Supported Rates - 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x30, 0x26, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite -- FT-PSK - 0x28, 0x00, // RSN Capability - 0x01, 0x00, // PMKID Count -- PMKR1Name - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID - 0x32, 0x01, // Extended Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x37, 0x63, // FTE IE - 0x00, 0x02, // MIC Control - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x06, // R1KH-ID - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, - 0x03, 0x07, // R0KH-ID - 'x', '@', 'y', '.', 'c', 'o', 'm', - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xBA, 0x00, - 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK - 0x01, 0x08, - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - 0x03, 0x01, // DSS Parameters - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x07, 0x06, // Country - 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, - 0x0B, 0x05, - 0x00, 0x00, 0x6E, 0x8D, 0x5B, - 0x2A, 0x01, // ERP - 0x00, - 0x30, 0x14, // RSN - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x04, // AKM Suite - 0x28, 0x00, // RSN Capability - 0x32, 0x01, // Extended Supported Rates - 0x6C, - 0x36, 0x03, // MDID IE - 0x12, 0x34, // MDID - 0x80, // FT Capability and Policy - 0x85, 0x1E, - 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, - 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, - 0x96, 0x06, - 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x06, - 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x03, 0x05, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x0B, 0x09, - 0xDD, 0x05, - 0x00, 0x40, 0x96, 0x14, 0x01, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x06, 0x00, 0x00, 0x00 -}; - - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_8_Hidden = {0x00, 0xA0, 0xB0, 0xC0, 0xD0,0xE8}; - -UCHAR s_TLV_BSS_Entry_Beacon_8_Hidden [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x52, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x24, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x00, // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_BSS_Entry_ProbeResponse_8_Hidden [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x5a, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x2C, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - - -UCHAR s_TLV_Success_AssociationResult_8_Hidden[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, // SSID - 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) - // 0x00, 0x00, - // 0x04, 0x00, - // 0x00, 0x00, 0x00, 0x00 - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== -// -// 11ad -// -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_9_11ad_PSK = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9}; - -UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_Dmg_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x14, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // Dmg - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x17, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_9_11ad_PSK [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_10_11ad_1x = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA}; - -UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_Dmg_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x14, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x31, 0x04, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xCB, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x98, 0x00, // For WiFi Beacon - // Dmg - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x17, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_10_11ad_1x [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x31, 0x04, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_10_11ad_Dmg_1x [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x96, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x01, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x65, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x01, 0x08, // Supported Rates - 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, - - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x94, 11, - 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x47, 0x00, - 0x17, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x94, 0x11, // DMG Capabilities - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address - 0x03, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x98, 0x00, - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK - 0x03, 0x01, // DSS Parameters - 0x02, - 0x30, 0x14, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x08, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x01, // AKM Suite - 0x00, 0x00, // RSN Capability - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - 0xDD, 0x21, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_11_11ad_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB}; - -UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x3F, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x0C, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Dmg_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x47, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) - 0x0A, 0x00, - 0x05, 0x00, // For WiFi Beacon - // DMG Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) - 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) - 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) - 0x07, // 1 - DMG Parameters (9.4.1.47) - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC9, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) - 0x09, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xC1, 0xFF, 0xFF, 0xFF, // RSSI - 0x64, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x03, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_11_11ad_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x71, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x36, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x2E, 0x01, - 0x08, - 0x94, 11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x53, 0x00, - 0x07, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, // DMG Capabilities - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x02, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x2C, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -UCHAR s_TLV_Success_AssociationResult_11_11ad_Dmg_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x71, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x03, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x03, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x36, 0x00, - 0x05, 0x00, // Capabilities - 0x01, 0x00, // Listen Interval - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x2E, 0x01, - 0x08, - 0x94, 11, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x00, // AID - 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x53, 0x00, - 0x07, 0x00, // Capabilities - 0x00, 0x00, // Status code - 0x02, 0x00, // Association ID - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, // DMG Capabilities - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address - 0x02, // AID - 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO - 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x2C, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, - 0x96, 0x00, // For WiFi Beacon - // WiFi Beacon - 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) - 0x64, 0x00, // Beacon Interval (8.4.1.3) - 0x05, 0x00, // Capability - - 0x00, 0x09, // SSID - 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON - 0x03, 0x01, // DSS Parameters - 0x02, - 0x7F, 0x04, - 0x00, 0x00, 0x00, 0x02, - 0x94, 0x11, - 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, - 0x00, - 0x97, 0x0A, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, - 0xBE, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x0C, 0x12, - 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, - 0x10, 0x00, - 0x2E, 0x01, - 0x28, - 0xDD, 0x27, - 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, - 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, - 0xDD, 0x0F, - 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x09, 0x00, 0x00, 0x00 -}; - - -//=============================================================================== -// -// 11ax -// -//=============================================================================== - -// -// Open on 2.4 GHz -// -WDI_MAC_ADDRESS s_Connect_Addr_12_11ax_24_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC}; - - -UCHAR s_TLV_BSS_Entry_12_11ax_24_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x78, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x4A, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, - 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_Success_AssociationResult_12_11ax_24_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x28, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4E, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x45, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x43, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x11, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== - -// -// Open on 5 GHz -// -WDI_MAC_ADDRESS s_Connect_Addr_13_11ax_5_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED}; - - -UCHAR s_TLV_BSS_Entry_13_11ax_5_Open [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x76, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x48, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x0F, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x46, 0x05, - 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel 36 - 0x02, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_Success_AssociationResult_13_11ax_5_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0F, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4C, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0xF, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x24, 0x30, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x45, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xFF, 0x13, // Extension IE - 0x23, // HE Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities - 0x00, - 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x2C, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0xF, // SSID - 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', - 0x01, 0x04, - 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, - 0x01, // DSSS Parameter - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -//=============================================================================== -// - -// #define SAE_MIXED_MODE 1 - -WDI_MAC_ADDRESS s_Connect_Addr_14_WPA3_SAE_CCMP = { 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32 }; - -UCHAR s_TLV_BSS_Entry_14_WPA3_SAE_CCMP [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type -#ifdef SAE_MIXED_MODE - 0x91, 0x00, //Len -#else - 0x8D, 0x00, //Len -#endif // SAE_MIXED_MODE - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, -#ifdef SAE_MIXED_MODE - 0x5E, 0x00, -#else - 0x5A, 0x00, -#endif // SAE_MIXED_MODE - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved -#ifdef SAE_MIXED_MODE - 0x30, 0x18, -#else - 0x30, 0x14, -#endif // SAE_MIXED_MODE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -#ifdef SAE_MIXED_MODE - 0x02, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0x80, 0x00, // RSN Capability - no MFPR or MFPC -#else - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0xC0, 0x00, // RSN Capability = MFP-Capable -#endif // SAE_MIXED_MODE - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, -#ifdef SAE_MIXED_MODE - 0x2A, 0x01, -#else - 0x26, 0x01, -#endif // SAE_MIXED_MODE - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x4A, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AMK Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AMK Suite - WPA3SAE - 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, -#ifdef SAE_MIXED_MODE - 0x5E, 0x00, -#else - 0x5A, 0x00, -#endif // SAE_MIXED_MODE - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0C, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved -#ifdef SAE_MIXED_MODE - 0x30, 0x18, -#else - 0x30, 0x14, -#endif // SAE_MIXED_MODE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Multicast Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -#ifdef SAE_MIXED_MODE - 0x02, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0x80, 0x00, // RSN Cap = MFP-Capable -#else - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE - 0xC0, 0x00, // RSN Cap = MFP-Capable + MFP required -#endif // SAE_MIXED_MODE - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -// -// SAE-Specific definitions :: Start -// -DWORD g_dwSaeResendConfirmRequested = 0; - -UCHAR pucSAECommitResponse [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) - 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) -// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) - // [13] AP Scalar - 0x93, 0x48, 0x89, 0xab, 0x38, 0x6b, 0x72, 0xd5, 0xff, 0x0d, 0x3c, 0xaa, 0x09, 0x56, 0x50, 0x20, - 0x2b, 0xd0, 0x3e, 0x26, 0x96, 0xb5, 0x90, 0x5f, 0x7b, 0x49, 0x5f, 0x3b, 0x7d, 0xc3, 0x5b, 0x48, - - // [14] AP Element - 0x58, 0x54, 0x5e, 0x6c, 0xa0, 0xe8, 0x86, 0xef, 0xfb, 0x05, 0x2a, 0xfb, 0x63, 0x2c, 0xa2, 0x19, - 0x5b, 0xb0, 0xb0, 0xa8, 0x25, 0xe5, 0x9d, 0xba, 0x6b, 0xaa, 0x0e, 0x93, 0xaf, 0x04, 0x6e, 0xf4, - 0xc9, 0x45, 0x5f, 0xec, 0x43, 0xfe, 0x5e, 0xb0, 0x2a, 0x6b, 0x8a, 0xbc, 0x8f, 0xd7, 0x07, 0x87, - 0x87, 0x3d, 0xd1, 0xd5, 0xd7, 0xfd, 0xe3, 0x07, 0x3a, 0x4c, 0xf3, 0xc2, 0xc7, 0x6f, 0x59, 0x5c, - }; -UCHAR pucSAECommitResponseReflection [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) - 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) -// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) - // [13] AP Scalar - - 0x49, 0x5c, 0x2c, 0xb4, 0x20, 0xec, 0xc9, 0xe8, 0xe8, 0x03, 0x2d, 0x00, 0x8d, 0xab, 0x4d, 0x91, - 0x70, 0x16, 0x06, 0x28, 0x40, 0x83, 0xb9, 0x8d, 0x19, 0xc6, 0x43, 0xcb, 0x63, 0x29, 0x9f, 0x03, - - // [14] AP Element - 0x13, 0x2e, 0xfc, 0x90, 0xb9, 0xd7, 0xb5, 0xc1, 0x2a, 0x1d, 0xe9, 0x05, 0x9c, 0xb3, 0xba, 0xc8, - 0xa6, 0x93, 0xff, 0xbf, 0x23, 0x02, 0x42, 0x3e, 0x58, 0xc2, 0x0d, 0x00, 0x10, 0xe8, 0x44, 0x60, - 0x9d, 0xfc, 0x34, 0x5e, 0x98, 0x8e, 0xf2, 0x12, 0x67, 0x24, 0xd0, 0x80, 0xfb, 0x2f, 0x1e, 0x7a, - 0xe6, 0x54, 0x01, 0x00, 0x50, 0xd4, 0xfe, 0x66, 0x47, 0x62, 0xc0, 0x3c, 0x9f, 0x7a, 0x10, 0x27, - }; - -UCHAR pucSAEConfirmResponse [] = - { - 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) - 0x02, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) - 0x00, 0x00, // [3] usStatusCode = 0 or 76 (DOT11_FRAME_STATUS_ANTI_CLOGGING_TOKEN_REQUIRED) (not-Element, 2 octets) - 0x00, 0x00, // [12] SendConfirm (not-IE, 2 octets) - // [15] Confirm - 0xc7, 0xd1, 0x04, 0x94, 0x29, 0xec, 0xdf, 0x25, 0xda, 0xaa, 0x79, 0x6f, 0xda, 0xe9, 0x91, 0x9f, - 0x4b, 0x83, 0xad, 0xa3, 0x08, 0xde, 0x62, 0xca, 0xcd, 0x59, 0xfc, 0xf5, 0xc5, 0x4d, 0xeb, 0xd9, - }; - -UCHAR pucM1SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x02, // Frame Control: Version = 0x0, Type = DOT11_FRAME_TYPE_DATA, Subtype = DOT11_DATA_SUBTYPE_DATA - 0x30, 0x00, // Duration - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Address1: Receiver/Destination/STA address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address2: Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address3: Source address - 0x00, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype = DOT11_ETH_TYPE_EAPOL - // NWF_EAPOL_HEADER - 0x02, // Version = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 OR NWF_EAPOL_PROTOCOL_VERSION_V2 = 2 - 0x03, // Type = EAPOL_Key = 2 - 0x00, 0x75, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x00, 0x8a, // Info - 0x00, 0x10, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter - 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce - 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // MIC - 0x00, 0x16, // Key length - 0xdd, 0x14, // KeyData -> DOT11_INFO_ELEMENT_ID_VENDOR_SPECIFIC + Len - 0x00, 0x0f, 0xac, 0x04, // OUI -> RSN_KEY_DATA_OUI + RSN_KEY_DATA_OUI_TYPE_PMKID -> {0x00,0x0F,0xAC} + {0x04) - 0x37, 0xfb, 0x9a, 0x24, 0xc1, 0x57, 0x8c, 0xce, 0xc3, 0x60, 0x6c, 0x6f, 0x39, 0xe0, 0xb7, 0x02, // PMKID -}; - - -UCHAR pucExpectedM2SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x01, // Frame Control - 0x2c, 0x00, // Duration - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x00, 0x00, 0x07, 0x00, - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x01, // Version = bProtocolVersion = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 - 0x03, // Type = EAPOL_Key = 2 - 0x00, 0x75, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type = bKeyDesc = NWF_EAPOL_KEY_DESC_RSNA = 2 - 0x01, 0x0a, // Info = usKeyInfo, ResponseKeyInfo.Version = KEY_DESC_VERSION_AES, Type=RSN_KEY_TYPE_PAIRWISE, MIC=1, Secure=0 - 0x00, 0x00, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter - 0x80, 0xf8, 0x10, 0x83, 0x4f, 0x0f, 0x40, 0xa1, 0xe5, 0x5d, 0x51, 0x92, 0x83, 0x4f, 0x8e, 0x98, // Nonce - 0x09, 0xca, 0xd5, 0x14, 0xc6, 0x08, 0x4c, 0xa9, 0xed, 0xc3, 0xa8, 0xff, 0xce, 0xc9, 0x36, 0xb6, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0xa1, 0x79, 0x5f, 0x05, 0xa4, 0x12, 0x84, 0xf2, 0xf9, 0x0c, 0x79, 0x88, 0xeb, 0x92, 0x71, 0x62, // MIC - 0x00, 0x16, // Key Length - 0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, // Key Data = RSN - 0x00, 0x0f, 0xac, 0x08, 0x80, 0x00 - -}; - -UCHAR pucM3SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x02, // Frame Control - 0x30, 0x00, // Duration - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Receiver/Destination/STA address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x00, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x02, // Version - 0x03, // Type - 0x00, 0x97, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x13, 0xca, // Info - 0x00, 0x10, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter - 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce - 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0xa5, 0xea, 0xdc, 0xfd, 0x97, 0xc7, 0x72, 0x76, 0x24, 0xe2, 0x7e, 0x71, 0x45, 0x3a, 0x24, 0xca, // MIC - 0x00, 0x38, // Key Length - 0x6f, 0x39, 0x30, 0x2c, 0x46, 0xb4, 0x3c, 0xf8, 0x42, 0x07, 0x8e, 0xc9, 0x65, 0x05, 0x2c, 0xd0, // Encrypted Key data - 0xe1, 0x7b, 0xdd, 0x2e, 0xbd, 0x69, 0x09, 0x1e, 0x39, 0xcc, 0x1a, 0xb3, 0x6e, 0x55, 0xd1, 0xad, - 0x5c, 0x45, 0x52, 0x4b, 0x83, 0x5d, 0x39, 0xe3, 0x1c, 0xb6, 0xed, 0x35, 0x52, 0x76, 0xb1, 0xc6, - 0x5a, 0x2c, 0x96, 0x07, 0x77, 0x15, 0x15, 0x5c, -}; - - -UCHAR pucExpectedM4SaeFrame[] = -{ - // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER - 0x88, 0x01, // Frame Control - 0x2c, 0x00, // Duration - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address - 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address - 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address - 0x10, 0x00, 0x07, 0x00, // Sequence Control - // IEEE_8022_LLC_SNAP - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP - 0x88, 0x8e, // sh_etype - // NWF_EAPOL_HEADER - 0x01, // Version - 0x03, // Type - 0x00, 0x5f, // Length - // NWF_EAPOL_RSNA_KEY_DESC - 0x02, // Type - 0x03, 0x0a, // Info - 0x00, 0x00, // Length - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Nonce - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved - 0x52, 0x97, 0x0f, 0x90, 0x69, 0x7d, 0xcd, 0xeb, 0x98, 0xbf, 0xb1, 0x2a, 0xb2, 0x3e, 0xcc, 0x49, // MIC - 0x00, 0x00, // Key Length -}; - -// -// SAE-Specific definitions :: End -// - -// -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_15_WPA2PSK_SHA256 = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF}; - -UCHAR s_TLV_BSS_Entry_15_WPA2PSK_SHA256 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x91, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x5e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'H', 'A', '2', '5', '6', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x06, // AKM Suite - 0xCC, 0x00, // RSN Capability - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x28, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x48, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x14, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise cipher count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AMK Suite Count - 0x00, 0x0F, 0xAC, 0x06, // AMK Suite - WPA2PSK_SHA256 - 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x5e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0A, // SSID - 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - 0xCC, 0x00, // RSN Capability - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - - -// -//=============================================================================== -// - -#ifdef WPA3_ARUBA_SIM -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5}; // For Aruba -#elif WPA3_INTEL_SIM -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a}; // For Intel -#else -WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0}; -#endif - -UCHAR s_TLV_BSS_Entry_16_WPA3_SUITEB [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x97, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length -#ifdef WPA3_ARUBA_SIM - 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba -#elif WPA3_INTEL_SIM - 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel -#else - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, -#endif - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x64, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_16_WPA3_SUITEB[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x3A, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, -#ifdef WPA3_ARUBA_SIM - 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba -#elif WPA3_INTEL_SIM - 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel -#else - 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, -#endif - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_ENT_192 = 8 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x54, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, 0x07, 0x12, //Power Capability - 0x24, 0x02, 0x01, 0x0B, //Supported Channels - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x64, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// -// 6 GHz -// -//=============================================================================== - -// -// RNR IE has the following format (only care about TBTT length = 8 or 12): -// 0xc9, 0x -// 0x -> 2 bytes (contains number and size of each element) -// 0x, 0x -> 2 bytes (applies to all element in this list) -// 0x -> 1 byte -// 0x -> 6 bytes -// [0x] -> 4 bytes -// 0x -> 1 byte -// - -// -// Mac addresses have the following nomenclature for 6GHz Ssids -// -// 1st 3 bytes are 0x00 0xA1, 0xB0 -// 4th byte is for SSID: -// 01 = 6E__1 -// 02 = 6E__2 -// 03 = SSID3 -// 04 = SSID4 -// 5th Byte is for band: -// 02 = 2.4 GHz -// 05 = 5 GHz -// 06 = 6 GHz -// 6th byte is instance -// 01 = 1st instance -// 02 - 2nd instance -// : -// - -//=============================================================================== -// SIX_G: 6E__1: -// (1 * 2.4 GHz) + (1 * 5 GHz) + (2 * 6 GHz) -// 2.4 GHz: -// S1_24_1: S1_5_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) -// 5 GHz: -// S1_5_1: S1_24_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) -// 6 GHz: -// S1_6_1: S1_24_1 (In) + S1_5_1 (In) -// S1_6_2: S1_24_1 (In) + S1_5_1 (In) -//=============================================================================== - -// -// 6E__1: 1 * 2.4 GHz Bss's -// 1 RNR IE with 3 entries: Band:Channel = [5:36 + 6:101 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_17_6G_S1_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01}; -UCHAR s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xE9, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xB6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x01, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel / Freq = 2412 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0B, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x01, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x01, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 1 * 5 GHz Bss's -// 1 RNR IE with 3 entries: Band:Channel = [2.4:1 + 6:101 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_18_6G_S1_5_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01}; -UCHAR s_TLV_BSS_Entry_18_6G_S1_5_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xe9, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x24, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel / Freq = 36 / 5180 MHz - 0x02, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0B, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x24, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xb6, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x24, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x30, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 1/2 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_19_6G_S1a_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_19_6G_S1a_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x65, 0x00, 0x00, 0x00, // Channel / Freq = 101 / 6445 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xfD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x65, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x65, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__1: 2/2 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_20_6G_S1b_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02}; -UCHAR s_TLV_BSS_Entry_20_6G_S1b_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x85, 0x00, 0x00, 0x00, // Channel / Freq = 133 / 6605 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x85, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '1', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// SIX_G: 6E__2: -// (1 * 2.4 GHz) + (1 * 5 GHz) + (1 * 6 GHz) -// 2.4 GHz: -// S2_24_1: S2_5_1 (In+Out) + [S2_6_2 (Out)] -// 5 GHz: -// S2_5_1: S2_24_1 (In+Out) + S2_6_1 (Out) + [S2_6_2 (Out)] -// 6 GHz: -// S2_6_1: S2_5_1 (In) -//=============================================================================== - -// -// 6E__2: 1 * 2.4 GHz Bss's -// 2 RNR IEs with 1 entry each: Band:Channel = [5:44] + [6:101] -// -WDI_MAC_ADDRESS s_Connect_Addr_21_6G_S2_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x24, 0x01}; -UCHAR s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xD3, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xA0, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x06, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x0c, // RNR IE - 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x0c, // RNR IE - 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x06, 0x00, 0x00, 0x00, // Channel / Freq = 2437 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xF5, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x06, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xa0, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x06, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x0c, // RNR IE - 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x0c, // RNR IE - 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length - 0x83, 0x65, // Operating Class = 131, Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__2: 1 * 5 GHz Bss's -// 3 RNR IEs with 1 entry each: Band:Channel = [2.4:6] + [6:101] + [6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_22_6G_S2_5_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01}; -UCHAR s_TLV_BSS_Entry_22_6G_S2_5_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xed, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xba, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x2c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz - 0xc9, 0x10, // RNR IE - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x2c, 0x00, 0x00, 0x00, // Channel / Freq = 44 / 5220 MHz - 0x02, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x0F, 0x02, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x2c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xba, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x2c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc9, 0x10, // RNR IE - 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz - 0xc9, 0x10, // RNR IE - 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz - - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -// -// 6E__2: 1 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_23_6G_S2_6_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_23_6G_S2_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x79, 0x00, 0x00, 0x00, // Channel / Freq = 121 / 6545 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x79, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// SIX_G: SSID3: -// (1 * 2.4 GHz) -// 2.4 GHz: -// S3_24_1: *S2_5_1 (Out)* -//=============================================================================== - -// -// SSID3: 1 * 2.4 GHz Bss's -// 2 RNR IEs with 1 entry each Band:Channel = [5:44 + 6:133] -// -WDI_MAC_ADDRESS s_Connect_Addr_24_6G_S3_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01}; -UCHAR s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xDB, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xa8, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x0a, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel / Freq = 2457 MHz - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8B, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates - 0x30, 0x48, 0x60, 0x6c, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x78, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - 0x53, 0x53, 0x49, 0x44, 0x31, - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0x0a, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0xa8, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '3', - 0x01, 0x08, // Supported Rates - 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, - 0x03, 0x01, // DS Parameter Set - 0x0a, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0x6c, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) - 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] - 0x30, 0x48, 0x60, 0x6c, - 0x3d, 0x16, // HT Information (802.11n D1.10) - 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 - 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz - - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - - -//=============================================================================== -// SIX_G: SSID4 (non-colocated AP): -// (1 * 6 GHz) -// 6 GHz: -// S4_6_1: -//=============================================================================== - -// -// SSID4: 1 * 6 GHz Bss's -// -WDI_MAC_ADDRESS s_Connect_Addr_25_6G_S4_6_Ghz = {0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01}; -UCHAR s_TLV_BSS_Entry_25_6G_S4_6_Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xC6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0xe5, 0x00, 0x00, 0x00, // Channel / Freq = 229 / 7085 MHz - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xFD, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x8E, 0x00, - - 0x01, 0x11, // Capabilities - 0xfa, 0x00, // Listen Interval - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x21, 0x02, // Power Capability Min: 0, Max: 15 - 0x00, 0x0f, - 0x24, 0x32, // Supported Channels - 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, - 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, - 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, - 0xa5, 0x01, - 0x46, 0x05, // RM Enabled Capabilities - 0x72, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0x0a, // Extended Capabilities - 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element - 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, - 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0x7d, 0x02, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x8A, 0x00, - - 0x01, 0x11, // Capabilities - 0x00, 0x00, // Status Code: Successful - 0x00, 0xc0, // Association ID: 0x0000 - 0x00, 0x05, // SSID Parameter set - '6', 'E', '_', '_', '2', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x03, 0x01, // DS Parameter set: Current Channel: 10 - 0xe5, - 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x93, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Inteval - 0x01, 0x00, // Capabilities - 0x00, 0x05, // SSID - '6', 'E', '_', '_', '4', - 0x01, 0x08, // Supported Rates - 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, - 0x05, 0x04, // TIM - DTIM 0 of 0 - 0x00, 0x02, 0x00, 0xa4, - 0x0b, 0x05, - 0x00, 0x00, 0x00, 0x12, 0x7a, - 0x2a, 0x01, // ERP Information - 0x00, - 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element - 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, - 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, - 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) - 0x3b, - 0xbd, 0x02, - 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) - 0x23, - 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, - 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, - 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) - 0x24, - 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, - 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set - 0x26, - 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, - - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0A, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// WDI_OWE_RNR -//=============================================================================== - - -/// WDI_OWE_RNR -/// -/// Description -/// - Non-Transition mode OWE network -/// - Advertises Reduced Neighbor Reports (RNRs) for the OWE Transition Mode BSSes WDI_OWE_TM_OWE and WDI_OWE_TM_OPEN -/// - Note: The OWE TM BSSes do not advertise RNR IEs -/// - Definitions for these two Transition Mode networks follows this one -/// -/// Intention -/// - Test Non-Transition Mode OWE networks -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving beacon or probe -/// - Since the networks are indicated in order during scans (i.e. the OWE TM networks will be indicated after this one) -/// it is expected that RNR for the OWE TM networks will be received before their beacons and probes. -/// -/// Expectation -/// - Scan results display WDI_OWE_RNR as an Enhanced Open network to which connections are supported -/// - The RNR will not effect connections to or display of OWE Transition Mode networks that it contains -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_26_OWE_With_RNR = {00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF}; -UCHAR s_TLV_BSS_Entry_26_OWE_With_RNR [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xB6, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x83, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0B, // SSID - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'R', 'N', 'R', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE - 0xC0, 0x00, // RSN Capability - MFP Req + Capable - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B - 0x00, // TBTT Offset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // MAC Address --> OWE Transition Mode OWE (Defined below) - 0xFD, 0x1F, 0x3F, 0x49, // Short SSID for WDI_OWE_TM_OWE - 0x00, // BssParameters - - 0xc9, 0x10, // RNR IE - 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B - 0x00, // TBTT Offset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // MAC Address --> OWE Transition Mode Open (Defined below) - 0x21, 0x24, 0x6C, 0x85, // Short SSID for WDI_OWE_TM_OPEN - 0x00, // BssParameters - - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_26_OWE_With_RNR [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0xFF, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, // Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/// WDI_OWE_TM_OWE -/// Description -/// - OWE BSS of OWE Transition Mode network -/// - Auth Type is OWE -/// - Partner BSS is the OWE Transition Mode Open BSS "WDI_OWE_TM_OPEN" -/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS -/// - Listed in RNR of BSS WDI_OWE_RNR -/// - RNR IEs are not avertised by this BSS -/// -/// Intention -/// - Test OWE Transition Mode -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe -/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. -/// -/// Expectation -/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS -/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their -/// support for OWE, while also allowing the most secure connection to be made. -/// -/// - The UI will display: -/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) -/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected -/// - Security Description: "Enhanced Open" -/// - "Secured" or a lock icon should not be displayed -/// - No password prompt on connect -/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry -/// - In the entry containing the BSSID of the OWE TM OWE BSS, "netsh wlan show networks mode=bss" displays -/// - SSID: "WDI_OWE_TM_OPEN" -/// - Authentication: OWE -/// - Encryption: CCMP -/// - MFP Required: 1 -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_27_OWE_TM_OWE = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00}; -UCHAR s_TLV_BSS_Entry_27_OWE_TM_OWE [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xA1, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x6e, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, // RSN IE - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher - 0x01, 0x00, // AKM Suite count - 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE - 0xC0, 0x00, // RSN Capability - MFP Req + Capable - 0x00, 0x00, - 0x00, 0x0F, 0xAC, 0x06, // Group Cipher - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - 0xDD, 0x1A, // Vendor specific - OWE Transition Mode - 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // Partner BSS BSSID - 0x0F, // Partner BSS SSID Length - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', // Partner BSS SSID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented simulated OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_27_OWE_TM_OWE [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0x00, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/// WDI_OWE_TM_OPEN -/// Description -/// - Open BSS of OWE Transition Mode network -/// - Open network -/// - Partner BSS is the OWE Transition Mode OWE BSS "WDI_OWE_TM_OWE" -/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS -/// - Listed in RNR of BSS WDI_OWE_RNR -/// - RNR IEs are not avertised by this BSS -/// -/// Intention -/// - Test OWE Transition Mode -/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe -/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. -/// -/// Expectation -/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS -/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their -/// support for OWE, while also allowing the most secure connection to be made. -/// -/// - The UI will display: -/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) -/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected -/// - Security Description: "Enhanced Open" -/// - "Secured" or a lock icon should not be displayed -/// - No password prompt on connect -/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry -/// - In the entry containing the BSSID of this BSS, "netsh wlan show networks mode=bss" displays -/// - SSID: (Hidden) -/// - Authentication: Open -/// - Encryption: None -/// -/// Limitations -/// - Connections to this network will fail because the driver does not OWE DH Handshake -WDI_MAC_ADDRESS s_ConnectAddr_28_OWE_TM_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01}; -UCHAR s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x95, 0x00, // Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, - - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x62, 0x00, // Length - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x0F, // SSID - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', - 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - 0xDD, 0x19, // Vendor specific - OWE Transition Mode - 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // Partner BSS BSSID - 0x0E, // Partner BSS SSID Length - 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'W', 'E', // Partner BSS SSID - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x0B, 0x00, 0x00, 0x00, // Channel - 0x01, 0x00, 0x00, 0x00 // BandId -}; - -// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure -UCHAR s_TLV_Failure_AssociationResult_28_OWE_TM_Open [] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0x46, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x00, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -//=============================================================================== -// -// Wi-Fi 7 -// -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_29_WiFi7_Mixed_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02}; -WDI_MAC_ADDRESS s_Connect_Addr_30_WiFi7_Mixed_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03}; -WDI_MAC_ADDRESS s_Connect_Addr_31_WiFi7_Mixed_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04}; -WDI_MAC_ADDRESS s_Connect_Addr_32_WiFi7_Mixed_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05}; - -UCHAR s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xfa, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // Link 1 MAC address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0xc7, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x32, 0x01, // DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0xFB, // BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0x30, 0x2a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x03, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x03, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xc0, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x7e, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address - // STA Profile - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, - 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address - // STA Profile - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x9b, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0f, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x32, 0x01, - 0xFB, // H2E Only - 0x30, 0x2a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x03, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 - 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x03, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK - 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : MAC address - // STA Profile - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_33_WiFi7_Open_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06}; -WDI_MAC_ADDRESS s_Connect_Addr_34_WiFi7_Open_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07}; -WDI_MAC_ADDRESS s_Connect_Addr_35_WiFi7_Open_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08}; -WDI_MAC_ADDRESS s_Connect_Addr_36_WiFi7_Open_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09}; - -UCHAR s_TLV_BSS_Entry_34_WiFi7_Open_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xca, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x97, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x01, 0x00, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x9d, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -UCHAR s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xb3, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x75, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xff, 0x3d, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] - 0x0b, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) - // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] - 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address - // STA Profile - // Remaining STA Profile for Link 2 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length = 21 - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address - // STA Profile - // Remaining STA Profile for Link 3 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 2 MAC address - // STA Profile - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x97, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x01, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address - // STA Profile - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== - -WDI_MAC_ADDRESS s_Connect_Addr_37_WiFi7_Only_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a}; -WDI_MAC_ADDRESS s_Connect_Addr_38_WiFi7_Only_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b}; -WDI_MAC_ADDRESS s_Connect_Addr_39_WiFi7_Only_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c}; -WDI_MAC_ADDRESS s_Connect_Addr_40_WiFi7_Only_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d}; - -UCHAR s_TLV_BSS_Entry_38_WiFi7_Only_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xe8, 0x00, //Len - - // WDI_TLV_BSSID = 10 = 0xa - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // Link 1 MAC address - - // WDI_TLV_BEACON_FRAME = 143 = 0x8f - 0x0a, 0x00, - 0xb5, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0x30, 0x1a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x32, 0x01, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x32, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - - 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x01, 0x00, 0x00, 0x00, // Channel - 0x05, 0x00, 0x00, 0x00 // BandId -}; - -UCHAR s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xaf, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 - 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 - 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x01, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x7f, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0x30, 0x1A, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address - // STA Profile - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, - 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address - // STA Profile - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x89, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x10, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, 0x06, // DSS Parameters - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, 0x00, // ERP - 0x2F, 0x01, 0x00, // Reserved - 0x30, 0x1a, - 0x01, 0x00, // Version - 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP - 0x01, 0x00, // Pairwise Cipher Count - 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP - 0x01, 0x00, // AKM Suite Count - 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) - 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... - 0x00, 0x00, // PMKID Count - 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : MAC address - // STA Profile - 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES - 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== -// DualSta networks -//=============================================================================== -// - -WDI_MAC_ADDRESS s_Connect_Addr_41_DualSta_5Ghz = {0x00, 0x51, 0x30, 0x40, 0x50, 0x60}; -UCHAR s_TLV_BSS_Entry_41_DualSta_5Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x24, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - -// ----- - -WDI_MAC_ADDRESS s_Connect_Addr_42_DualSta_6Ghz = {0x00, 0x52, 0x30, 0x40, 0x50, 0x60}; -UCHAR s_TLV_BSS_Entry_42_DualSta_6Ghz [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0x63, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_PROBE_RESPONSE_FRAME - 0x09, 0x00, // Type - 0x35, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, // Supported Rates - 0x02, 0x04, 0x0B, 0x16, - 0x03, 0x01, // DSSS Parameter - 0x01, - 0x05, 0x04, // TIM - 0x00, 0x01, 0x00, 0x00, - 0x46, 0x05, // RM Enabled Capabilities - 0x02, 0x00, 0x00, 0x00, 0x00, - 0xDD, 0x07, // Vendor specific - MBO-OCE IE - 0x50, 0x6F, 0x9A, // WFA OUI - 0x16, // MBO-OCE IE OUI Type - 0x01, // Attribute ID - AP capability - 0x01, // Attrib length - 0x00, // Not cellular data aware - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x04, 0x00, - 0x04, 0x05, 0x06, 0x07, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_CHANNEL_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x09, 0x00, 0x00, 0x00, // Channel - 0x05, 0x00, 0x00, 0x00 // Band ID -}; - -UCHAR s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xD7, 0x00, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, //Association Status - 0x00, 0x00, 0x00, 0x00, //Status Code - 0x00, //ReAssociationRequest - 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm - 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm - 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm - 0x00, //FourAddressSupported - 0x00, //Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, //DSInfo - 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime - 0x05, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x30, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x08, // Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x21, 0x02, // Power Capability - 0x07, 0x12, - 0x24, 0x02, // Supported Channels - 0x01, 0x0B, - 0x32, 0x04, // Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x07, // WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x30, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, //Rates - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, - 0x32, 0x04, //Extended Rates - 0x0C, 0x12, 0x18, 0x60, - 0xDD, 0x18, //WMM settings - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, - 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, - - // WDI_TLV_BEACON_PROBE_RESPONSE - 0x30, 0x00, // Type - 0x25, 0x00, // Length - 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x00, 0x04, // Capability - 0x00, 0x08, - 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID - 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates - 0x03, 0x01, 0x01, // DSSS Parameter - 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x07, 0x00, 0x00, 0x00, - -}; - -//=============================================================================== -// Data throughput test networks -//=============================================================================== -// - -__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x01}; -__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x02}; -__declspec(selectany) UCHAR s_TLV_BSS_Entry_43_WiFi7_Open_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xca, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x22, 0x22, 0x22, 0X22, 0x00, 0x01, // AP Link 1 address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x97, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x01, 0x00, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x9d, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xb3, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x75, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xff, 0x3d, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] - 0x0b, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) - // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] - 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address - // STA Profile - // Remaining STA Profile for Link 2 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length = 21 - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address - // STA Profile - // Remaining STA Profile for Link 3 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address - // STA Profile - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x97, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x01, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address - // STA Profile - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - - -__declspec(selectany) UCHAR s_TLV_BSS_Entry_44_WiFi7_Open_Link_1 [] = -{ - // WDI_TLV_BSS_ENTRY - 0x08, 0x00, //Type - 0xca, 0x00, //Len - - // WDI_TLV_BSSID - 0x02, 0x00, // Type - 0x06, 0x00, // Length - 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 address - // WDI_TLV_BEACON_FRAME - 0x0a, 0x00, - 0x97, 0x00, - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x64, 0x00, // Beacon Interval - 0x01, 0x00, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // [B7-B4] [B3-B0] [B15-B12] [b11-B8] - // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] - 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address - // Remaining STA Profile for Link 2 - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address - // Remaining STA Profile for Link 3 - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT - 0x0d, 0x00, - 0x09, 0x00, - 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, - - // WDI_TLV_BSS_ENTRY_SIGNAL_INFO - 0x0b, 0x00, - 0x08, 0x00, - 0xCE, 0xFF, 0xFF, 0xFF, // RSSI - 0x5A, 0x00, 0x00, 0x00, // Link Quality - - // WDI_TLV_BSS_ENTRY_PHY_INFO - 0x3a, 0x00, - 0x08, 0x00, - 0x9d, 0x00, 0x00, 0x00, // Channel - 0x02, 0x00, 0x00, 0x00 // BandId - -}; - -__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1[] = -{ - // WDI_TLV_ASSOCIATION_RESULT - 0x35, 0x00, - 0xb3, 0x01, - - // WDI_TLV_BSSID - 0x02, 0x00, - 0x06, 0x00, - 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 Mac Address - - // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS - 0x2D, 0x00, - 0x30, 0x00, - 0x00, 0x00, 0x00, 0x00, // Association Status - 0x00, 0x00, 0x00, 0x00, // Status Code - 0x00, // ReAssociationRequest - 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 - 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 - 0x00, // FourAddressSupported - 0x00, // Port Authorized - 0x00, // WMM QoS Enabled - 0x00, 0x00, 0x00, 0x00, // DSInfo - 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime - 0x02, 0x00, 0x00, 0x00, // Band ID - 0x00, 0x00, 0x00, 0x00, // IHV Association Status - 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario - - // WDI_TLV_ASSOCIATION_REQUEST_FRAME - 0x2E, 0x00, - 0x75, 0x00, - 0x21, 0x04, // Capabilities - 0x0A, 0x00, // Listen Interval - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates - 0x21, 0x02, - 0x07, 0x12, //Power Capability - 0x24, 0x02, - 0x01, 0x0B, //Supported Channels - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x08, - 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings - 0xff, 0x3d, // Multilink Extension Element - 0x6B, // Multilink Extension ID - // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] - 0x0b, // Common Info length - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) - // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] - 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address - // STA Profile - // Remaining STA Profile for Link 2 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x15, // Length = 21 - // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] - 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] - 0x06, // Length - 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address - // STA Profile - // Remaining STA Profile for Link 3 - 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, - - - // WDI_TLV_ASSOCIATION_RESPONSE_FRAME - 0x2F, 0x00, - 0x55, 0x00, - 0x01, 0x04, //Capability - 0x00, 0x00, //Status - 0x01, 0xC0, //Association ID - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, //Extended Rates - 0xDD, 0x18, - 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address - // STA Profile - - - // WDI_TLV_BEACON_FRAME - 0x30, 0x00, - 0x97, 0x00, - - 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp - 0x01, 0x00, // Beacon Interval - 0x31, 0x04, // Capability - 0x00, 0x0e, // SSID - 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', - 0x01, 0x08, - 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates - 0x03, 0x01, - 0x06, // DSS Parameters - 0x05, 0x04, - 0x00, 0x01, 0x00, 0x00, // TIM - 0x2A, 0x01, - 0x00, // ERP - 0x2F, 0x01, - 0x00, // Reserved - 0xff, 0x23, // Multilink Extension Element - 0x6B, // Multilink Extension ID - 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) - 0x09, // Common Info length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) - 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] - // [ BSS Parameters Change Count (1 octet) - from AP only ] - // [ Medium Synchronization delay (2 octets) - from AP only] - // [ EML Capabilities (2 octets) ] - 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] - // Per-Sta profile - 1/2 (Link 2) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address - // STA Profile - // Per-Sta profile - 2/2 (Link 3) - 0x00, // Subelement ID = 0 for Per-Sta Profile Element - 0x09, // Length - 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 - 0x00, // STA Info : Length - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address - // STA Profile - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0xc9, 0x14, // RNR IE - 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length - 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 - 0x00, // TBTTOffset - 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid - 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid - 0x40, // BssParameters - 0x00, // 20 MHz - 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... - 0x32, 0x04, - 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates - 0xDD, 0x09, - 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific - - // WDI_TLV_PHY_TYPE_LIST - 0x19, 0x00, - 0x04, 0x00, - 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht - -}; - -//=============================================================================== -//=============================================================================== - -typedef struct -{ - UINT32 BandId; - WDI_MAC_ADDRESS* pMacAddress; - PUCHAR pTlvBssEntry; - UINT32 TlvBssEntrySize; - PUCHAR pTlvAssociationResult; - UINT32 TlvAssociationResultSize; - -} WdiTestConnectEntry, * PWdiTestConnectEntry; - -WdiTestConnectEntry g_ConnectEntries[] = -{ - // 0 - { // 0th Entry is disconnected state - 0, - nullptr, - nullptr, 0, - nullptr, 0, - }, - - // 1 - WFC_OPEN - { - WDI_BAND_ID_2400, - &s_Connect_Addr, - s_TLV_BSS_Entry_1, sizeof(s_TLV_BSS_Entry_1), - s_TLV_SuccessOpenAssociationResult, sizeof(s_TLV_SuccessOpenAssociationResult), - }, - - // 2 - WFC_OPEN - { - WDI_BAND_ID_2400, - &s_Connect_Addr_2_Open, - s_TLV_BSS_Entry_2_Open, sizeof(s_TLV_BSS_Entry_2_Open), - s_TLV_Success_AssociationResult_2_Open, sizeof(s_TLV_Success_AssociationResult_2_Open), - }, - - // 3 - WDI__WEP - { - WDI_BAND_ID_2400, - &s_Connect_Addr_3_WEP, - s_TLV_BSS_Entry_3_WEP, sizeof(s_TLV_BSS_Entry_3_WEP), - s_TLV_Success_AssociationResult_3_WEP, sizeof(s_TLV_Success_AssociationResult_3_WEP), - }, - - // 4 - WDI_SECURE - { - WDI_BAND_ID_2400, - &s_Connect_Addr_4_RSNA_CCMP, - s_TLV_BSS_Entry_4_RSNA_CCMP, sizeof(s_TLV_BSS_Entry_4_RSNA_CCMP), - s_TLV_Success_AssociationResult_4_RSNA_CCMP, sizeof(s_TLV_Success_AssociationResult_4_RSNA_CCMP), - }, - - // 5 - WDI__IHV - { - TESTMP_BAND_IHV, - &s_Connect_Addr_5_IHV, - s_TLV_BSS_Entry_5_IHV, sizeof(s_TLV_BSS_Entry_5_IHV), - s_TLV_Success_AssociationResult_5_IHV, sizeof(s_TLV_Success_AssociationResult_5_IHV), - }, - - // 6 - WDI__FT - { - WDI_BAND_ID_2400, - &s_Connect_Addr_6_FT_CCMP, - s_TLV_BSS_Entry_6_FT_CCMP, sizeof(s_TLV_BSS_Entry_6_FT_CCMP), - s_TLV_Success_AssociationResult_6_FT_CCMP, sizeof(s_TLV_Success_AssociationResult_6_FT_CCMP), - }, - - // 7 - WDI__FTPSK - { - WDI_BAND_ID_2400, - &s_Connect_Addr_7_FT_PSK_CCMP, - s_TLV_BSS_Entry_7_FT_PSK_CCMP, sizeof(s_TLV_BSS_Entry_7_FT_PSK_CCMP), - s_TLV_Success_AssociationResult_7_FT_PSK_CCMP, sizeof(s_TLV_Success_AssociationResult_7_FT_PSK_CCMP), - }, - - // 8 - - { - WDI_BAND_ID_2400, - &s_Connect_Addr_8_Hidden, - s_TLV_BSS_Entry_Beacon_8_Hidden, sizeof(s_TLV_BSS_Entry_Beacon_8_Hidden), - s_TLV_Success_AssociationResult_8_Hidden, sizeof(s_TLV_Success_AssociationResult_8_Hidden), - }, - - // 9 - WDI_adPSK - { - WDI_BAND_ID_60000, - &s_Connect_Addr_9_11ad_PSK, - s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK), - s_TLV_Success_AssociationResult_9_11ad_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_PSK), - }, - - // 10 - WDI_ad_1x - { - WDI_BAND_ID_60000, - &s_Connect_Addr_10_11ad_1x, - s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x), - s_TLV_Success_AssociationResult_10_11ad_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_1x), - }, - - // 11 - WDI_ad_ON - { - WDI_BAND_ID_60000, - &s_Connect_Addr_11_11ad_Open, - s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open), - s_TLV_Success_AssociationResult_11_11ad_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Open), - }, - - // 12 - WDI_OPEN_11ax.2.4 - { - WDI_BAND_ID_60000, - &s_Connect_Addr_12_11ax_24_Open, - s_TLV_BSS_Entry_12_11ax_24_Open, sizeof(s_TLV_BSS_Entry_12_11ax_24_Open), - s_TLV_Success_AssociationResult_12_11ax_24_Open, sizeof(s_TLV_Success_AssociationResult_12_11ax_24_Open), - }, - - // 13 - WDI_OPEN_11ax.5 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_13_11ax_5_Open, - s_TLV_BSS_Entry_13_11ax_5_Open, sizeof(s_TLV_BSS_Entry_13_11ax_5_Open), - s_TLV_Success_AssociationResult_13_11ax_5_Open, sizeof(s_TLV_Success_AssociationResult_13_11ax_5_Open), - }, - - // 14 - WDI_WPA3-SAE - { - WDI_BAND_ID_2400, - &s_Connect_Addr_14_WPA3_SAE_CCMP, - s_TLV_BSS_Entry_14_WPA3_SAE_CCMP, sizeof(s_TLV_BSS_Entry_14_WPA3_SAE_CCMP), - s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP), - }, - - // 15 - WDI_SHA256 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_15_WPA2PSK_SHA256, - s_TLV_BSS_Entry_15_WPA2PSK_SHA256, sizeof(s_TLV_BSS_Entry_15_WPA2PSK_SHA256), - s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256, sizeof(s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256), - }, - - // 16 - WDI_WPA3-SUITE_B - { - WDI_BAND_ID_2400, - &s_Connect_Addr_16_WPA3_SUITEB, - s_TLV_BSS_Entry_16_WPA3_SUITEB, sizeof(s_TLV_BSS_Entry_16_WPA3_SUITEB), - s_TLV_Success_AssociationResult_16_WPA3_SUITEB, sizeof(s_TLV_Success_AssociationResult_16_WPA3_SUITEB), - }, - - // 17 - 6E__1 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_17_6G_S1_2_4_Ghz, - s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz, sizeof(s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz), - s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz), - }, - - // 18 - 6E__1 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_18_6G_S1_5_Ghz, - s_TLV_BSS_Entry_18_6G_S1_5_Ghz, sizeof(s_TLV_BSS_Entry_18_6G_S1_5_Ghz), - s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz, sizeof(s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz), - }, - - // 19 - 6E__1 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_19_6G_S1a_6_Ghz, - s_TLV_BSS_Entry_19_6G_S1a_6_Ghz, sizeof(s_TLV_BSS_Entry_19_6G_S1a_6_Ghz), - s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz, sizeof(s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz), - }, - - // 20 - 6E__1 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_20_6G_S1b_6_Ghz, - s_TLV_BSS_Entry_20_6G_S1b_6_Ghz, sizeof(s_TLV_BSS_Entry_20_6G_S1b_6_Ghz), - s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz, sizeof(s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz), - }, - - // 21 - 6E__2 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_21_6G_S2_2_4_Ghz, - s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz, sizeof(s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz), - s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz), - }, - - // 22 - 6E__2 - { - WDI_BAND_ID_5000, - &s_Connect_Addr_22_6G_S2_5_Ghz, - s_TLV_BSS_Entry_22_6G_S2_5_Ghz, sizeof(s_TLV_BSS_Entry_22_6G_S2_5_Ghz), - s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz, sizeof(s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz), - }, - - // 23 - 6E__2 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_23_6G_S2_6_Ghz, - s_TLV_BSS_Entry_23_6G_S2_6_Ghz, sizeof(s_TLV_BSS_Entry_23_6G_S2_6_Ghz), - s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz, sizeof(s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz), - }, - - // 24 - 6E__3 - { - WDI_BAND_ID_2400, - &s_Connect_Addr_24_6G_S3_2_4_Ghz, - s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz, sizeof(s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz), - s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz), - }, - - // 25 - 6E__4 - { - WDI_BAND_ID_6000, - &s_Connect_Addr_25_6G_S4_6_Ghz, - s_TLV_BSS_Entry_25_6G_S4_6_Ghz, sizeof(s_TLV_BSS_Entry_25_6G_S4_6_Ghz), - s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz, sizeof(s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz), - }, - - // 26 - WDI_OWE_RNR - { - WDI_BAND_ID_2400, - &s_ConnectAddr_26_OWE_With_RNR, - s_TLV_BSS_Entry_26_OWE_With_RNR, sizeof(s_TLV_BSS_Entry_26_OWE_With_RNR), - s_TLV_Failure_AssociationResult_26_OWE_With_RNR, sizeof(s_TLV_Failure_AssociationResult_26_OWE_With_RNR) - }, - // 27 - - { - WDI_BAND_ID_2400, - &s_ConnectAddr_27_OWE_TM_OWE, - s_TLV_BSS_Entry_27_OWE_TM_OWE, sizeof(s_TLV_BSS_Entry_27_OWE_TM_OWE), - s_TLV_Failure_AssociationResult_27_OWE_TM_OWE, sizeof(s_TLV_Failure_AssociationResult_27_OWE_TM_OWE) - }, - // 28 - WDI_OWE_TM_OPEN - { - WDI_BAND_ID_2400, - &s_ConnectAddr_28_OWE_TM_Open, - s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon, sizeof(s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon), - s_TLV_Failure_AssociationResult_28_OWE_TM_Open, sizeof(s_TLV_Failure_AssociationResult_28_OWE_TM_Open) - }, - - // 29 is only MLD address for Wi-Fi 7 - // 30 - Wi-Fi 7 - Mixed - { - WDI_BAND_ID_5000, - &s_Connect_Addr_30_WiFi7_Mixed_Link_1, - s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1), - s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1), - }, - // 34 - Wi-Fi 7 - Open - { - WDI_BAND_ID_5000, - &s_Connect_Addr_34_WiFi7_Open_Link_1, - s_TLV_BSS_Entry_34_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_34_WiFi7_Open_Link_1), - s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1), - }, - // 38 - Wi-Fi 7 - Only - { - WDI_BAND_ID_6000, - &s_Connect_Addr_38_WiFi7_Only_Link_1, - s_TLV_BSS_Entry_38_WiFi7_Only_Link_1, sizeof(s_TLV_BSS_Entry_38_WiFi7_Only_Link_1), - s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1, sizeof(s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1), - }, - - // 41 - Dual-Sta - { - WDI_BAND_ID_5000, - &s_Connect_Addr_41_DualSta_5Ghz, - s_TLV_BSS_Entry_41_DualSta_5Ghz, sizeof(s_TLV_BSS_Entry_41_DualSta_5Ghz), - s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz), - }, - - // 42 - Dual-Sta - { - WDI_BAND_ID_6000, - &s_Connect_Addr_42_DualSta_6Ghz, - s_TLV_BSS_Entry_42_DualSta_6Ghz, sizeof(s_TLV_BSS_Entry_42_DualSta_6Ghz), - s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz), - }, - - // 43 - Speed Test(01) - { - WDI_BAND_ID_5000, - &s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1, - s_TLV_BSS_Entry_43_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_43_WiFi7_Open_Link_1), - s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1), - }, - - // 44 - Speed Test(02) - { - WDI_BAND_ID_5000, - &s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1, - s_TLV_BSS_Entry_44_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_44_WiFi7_Open_Link_1), - s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1), - }, -}; - -// clang-format on diff --git a/network/wlan/WIFICX/drivercode/wifirequest.cpp b/network/wlan/WIFICX/drivercode/wifirequest.cpp deleted file mode 100644 index fd02bd91..00000000 --- a/network/wlan/WIFICX/drivercode/wifirequest.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. - -#include "precomp.h" -#include "wifitransition.h" -#include "wifirequest.h" -#include "wifirequest.tmh" - -_Use_decl_annotations_ -void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) -{ - UINT InBufferLen = 0; - UINT OutBufferLen = 0; - void* Buffer = WifiRequestGetInOutBuffer(SendRequest, &InBufferLen, &OutBufferLen); - UINT16 MessageId = WifiRequestGetMessageId(SendRequest); - - TransitionContext tctx{ - Device, - WifiGetIhvDeviceContext(Device), - SendRequest, - static_cast(Buffer), - Buffer, - InBufferLen, - OutBufferLen - }; - - if(!NT_SUCCESS(RunTransitionByMessage(tctx, MessageId))) - { - WFCError("RunTransitionByMessage failed for MessageId: 0x%04X", MessageId); - return; - } -} - -void WifiIhvSendIndicationToOs( - _In_ WDFDEVICE Device, - _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, - _In_ UINT16 WifiRequestMessageId, - _In_ UINT32 WifiRequestTransactionId, - _In_ NTSTATUS WifiRquestM4Status, - _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, - _In_ UINT32 TlvDataSize) -{ - WDFMEMORY data = WDF_NO_HANDLE; - PUCHAR pIndicationBuffer = nullptr; - PWDI_MESSAGE_HEADER pIndicationHeader = nullptr; - SIZE_T indicationSize = sizeof(WDI_MESSAGE_HEADER) + TlvDataSize; - WDF_OBJECT_ATTRIBUTES objectAttribs; - - WDF_OBJECT_ATTRIBUTES_INIT(&objectAttribs); - objectAttribs.ParentObject = Device; - - if(!NT_SUCCESS(WdfMemoryCreate(&objectAttribs, NonPagedPoolNx, 0, indicationSize, &data, reinterpret_cast(&pIndicationBuffer)))) - { - WFCError("Failed to create indication buffer"); - return; - } - - RtlZeroMemory(pIndicationBuffer, indicationSize); - pIndicationHeader = reinterpret_cast(pIndicationBuffer); - pIndicationHeader->PortId = pOriginalWdiHeader->PortId; - pIndicationHeader->Reserved = pOriginalWdiHeader->Reserved; - pIndicationHeader->Status = Wifi::ConvertNDISSTATUSToNTSTATUS(WifiRquestM4Status); - pIndicationHeader->TransactionId = WifiRequestTransactionId; - pIndicationHeader->IhvSpecificId = pOriginalWdiHeader->IhvSpecificId; - - if (TlvDataSize > 0 && pTlvData != nullptr) - { - RtlCopyMemory(pIndicationBuffer + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); - } - - // Send the indication up to WifiCx - WifiDeviceReceiveIndication(Device, WifiRequestMessageId, data); - - // Don't need to keep this around - WdfObjectDelete(data); -} - -_Use_decl_annotations_ -void WifiIhvSendUnsolicitedIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, PUCHAR pTlvData, UINT32 TlvDataSize) -{ - WifiIhvSendIndicationToOs(Device, pWdiHeader, MessageId, 0, STATUS_SUCCESS, pTlvData, TlvDataSize); //TransactionId required to be 0 for unsolicited indications. -} -_Use_decl_annotations_ -void WifiIhvNotifyM3Completion(WIFIREQUEST Request, NTSTATUS WifiRequestM3Status, UINT BytesWritten) -{ - if(!NT_SUCCESS(WifiRequestM3Status)) - { - WFCError("WifiRequest M3 failed: %!STATUS!, BytesWritten: %d\n", WifiRequestM3Status, BytesWritten); - } - // Report the M3 status back to OS - // OS expects M3 before the M4 - WifiRequestComplete(Request, WifiRequestM3Status, BytesWritten); -} - -_Use_decl_annotations_ -void WifiIhvSendM4IndicationToOs(WDFDEVICE Device, UINT16 WifiRequestMessageId, const PWDI_MESSAGE_HEADER pWdiHeader, NTSTATUS WifiRequestM4Status) -{ - WifiIhvSendIndicationToOs(Device, pWdiHeader, WifiRequestMessageId, pWdiHeader->TransactionId, WifiRequestM4Status, nullptr, 0); -} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifirequest.h b/network/wlan/WIFICX/drivercode/wifirequest.h deleted file mode 100644 index 74380548..00000000 --- a/network/wlan/WIFICX/drivercode/wifirequest.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once -#include "device.h" - -EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; - -void WifiIhvSendUnsolicitedIndicationToOs( - _In_ WDFDEVICE Device, - _In_ PWDI_MESSAGE_HEADER pWdiHeader, - _In_ UINT16 MessageId, - _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, - _In_ UINT32 TlvDataSize); - -void WifiIhvNotifyM3Completion( - _In_ WIFIREQUEST Request, - _In_ NTSTATUS WifiRequestM3Status, - _In_ UINT BytesWritten); - -void WifiIhvSendM4IndicationToOs( - _In_ WDFDEVICE Device, - _In_ UINT16 WifiRequestMessageId, - _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, - _In_ NTSTATUS WifiRequestM4Status); \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifitransition.cpp b/network/wlan/WIFICX/drivercode/wifitransition.cpp deleted file mode 100644 index 41106932..00000000 --- a/network/wlan/WIFICX/drivercode/wifitransition.cpp +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. - -#include "wifitransition.h" - -// Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. -template -NTSTATUS ParseTlvCommon(TransitionContext& ctx, - UINT16 messageId, - ParserFn parser, - Param& outParams, - bool dumpStream = true) -{ - if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) - { - return STATUS_INVALID_PARAMETER; - } - - auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); - auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); - - if (dumpStream) - { - DumpMessageTlvByteStream( - messageId, - TRUE, - ctx.DevCtx->TlvContext.PeerVersion, - tlvLen, - tlvBytes, - 0, - nullptr); - } - - auto ndisStatus = parser(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &outParams); - return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); -} - - -// Primary traits template (specialize per MessageId) -template -struct TransitionTraits; - -// --- Generic pure-type traits template (add before existing specializations) --- -// WIFIREQUEST always needs M3 notification, so TPreM3Fn is mandatory. -// and WIFICX expectes the M3 then M4 order, so we always execute M3 then M4. -// using template parameters to configure parsing, cleanup, M3/M4 steps. -// to make sure that all transitions have consistent implementations. -template< - UINT16 TMsgId, - typename TParam, - UINT16 TCompleteIndication, - bool TDumpTlvStream, - NDIS_STATUS (*TParseFn)(ULONG, const UINT8*, PCTLV_CONTEXT, TParam*), - void (*TCleanupFn)(TParam*), - NTSTATUS (WifiHAL::*TPreM3Fn)(), // mandatory pre-M3 hook - NTSTATUS (WifiHAL::*THalM3Fn)(const TParam&, const PWDI_MESSAGE_HEADER, UINT BytesWriten), // optional HAL M3 (may be nullptr) - NTSTATUS (WifiHAL::*TPreM4Fn)(), // optional pre-M4 hook (may be nullptr) - NTSTATUS (WifiHAL::*THalM4Fn)(const PWDI_MESSAGE_HEADER) // optional HAL M4 (may be nullptr) -> -struct GenericTransitionTraits -{ - using ParamType = TParam; - enum : UINT16 { CompleteIndication = TCompleteIndication }; - - NTSTATUS Parse(TransitionContext& ctx, ParamType& p) - { - if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) - { - return STATUS_INVALID_PARAMETER; - } - - auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); - auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); - - if (TDumpTlvStream) - { - DumpMessageTlvByteStream( - TMsgId, - TRUE, - ctx.DevCtx->TlvContext.PeerVersion, - tlvLen, - tlvBytes, - 0, - nullptr); - } - - auto ndisStatus = TParseFn(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &p); - return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); - } - - void Cleanup(ParamType& p) { TCleanupFn(&p); } - - // Make static so pointer matches ExecuteSteps expected callable type (no implicit this) - static NTSTATUS StepM3(TransitionContext& c, ParamType& p, UINT& bytesWritten) - { - bytesWritten = sizeof(WDI_MESSAGE_HEADER); - ASSERT(TPreM3Fn); - - if (TPreM3Fn) - { - // Call member function pointer on WifiHAL instance - NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM3Fn)(); - if (!NT_SUCCESS(preStatus)) - { - return preStatus; - } - } - - if (THalM3Fn) - { - // Pass required third argument (BytesWriten) to HAL M3 function - return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM3Fn)(p, c.Header, bytesWritten); - } - - return STATUS_SUCCESS; - } - - static NTSTATUS StepM4(TransitionContext& c, ParamType&) - { - if (TPreM4Fn) - { - NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM4Fn)(); - if (!NT_SUCCESS(preStatus)) - { - return preStatus; - } - } - - if (THalM4Fn) - { - return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM4Fn)(c.Header); - } - - return (TPreM4Fn == nullptr && THalM4Fn == nullptr) ? STATUS_PENDING : STATUS_SUCCESS; - } - - NTSTATUS Handle(TransitionContext& ctx, ParamType& p) - { - return ExecuteSteps(ctx, p, &GenericTransitionTraits::StepM3, &GenericTransitionTraits::StepM4); - } - - bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } -}; - -// Execute two step callables. -// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) -// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) -// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. -// Skips StepM4 if StepM3 failed -template -NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) -{ - UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum - NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); - // Report the M3 status back to OS - // OS expects M3 before the M4 - WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); - if (!NT_SUCCESS(m3Status)) - { - return m3Status; - } - return stepM4(ctx, p); -} - -// -------- Generic runner (compile-time) -------- -template -NTSTATUS RunTransition(TransitionContext& ctx) -{ - TransitionTraits traits; - typename TransitionTraits::ParamType params{}; - NTSTATUS parseStatus = traits.Parse(ctx, params); - if (!NT_SUCCESS(parseStatus)) - { - traits.Cleanup(params); - // Report Failed M3 to OS - // Note: No M4 indication on parse failure - WifiIhvNotifyM3Completion(ctx.WifiRequest, parseStatus, 0); - return parseStatus; - } - - NTSTATUS m4Status = traits.Handle(ctx, params); - - if (traits.ShouldSendComplete(m4Status)) - { - WifiIhvSendM4IndicationToOs( - ctx.Device, - TransitionTraits::CompleteIndication, - ctx.Header, - m4Status); - } - - traits.Cleanup(params); - return m4Status; -} - -//// -------- SCENARIO: [Connect with a SAE WI-FI7 network -------- -/// Demo: Handle WDI_TASK_CONNECT + WDI_SET_SAE_AUTH_PARAMS then WDI_TASK_DISCONNECT -/// Scope: -/// -WifiRequest WDI_TASK_CONNECT & WDI_TASK_DISCONNECT are both WIFICX task commands, which is a two step M3/M4 transition -/// -The direct WifiRequest WDI_SET_SAE_AUTH_PARAMS, which is a single step transition but -/// is logically part of the connect scenario. since WDI_SET_SAE_AUTH_PARAMS is WIFICX property command, -/// it only has M3 step, no M4 step. -/// - The WifiCx unsolicited indication e.g. WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED is sent from the HAL during the connect process, -/// Notes: -/// - M3 and M4 status mainly used for WifiCx to track progress of the transition. e.g. the hung detection and trigger recovery. -/// - The actual scenario result is reported through unsolicited indication. -/// - -// -------- WDI_TASK_CONNECT -------- -template<> -struct TransitionTraits - : GenericTransitionTraits < - WDI_TASK_CONNECT, - WDI_TASK_CONNECT_PARAMETERS, - WDI_INDICATION_CONNECT_COMPLETE, - true, // dump TLV stream? (was true in original) - ParseWdiTaskConnect, - CleanupParsedWdiTaskConnect, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvConnect, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr - > -{ -}; - -// --- WDI_SET_SAE_AUTH_PARAMS --- -template<> -struct TransitionTraits - : GenericTransitionTraits< - WDI_SET_SAE_AUTH_PARAMS, - WDI_SET_SAE_AUTH_PARAMS_COMMAND, - WDI_INDICATION_CONNECT_COMPLETE, - false, // dump TLV stream? (was false in original) - ParseWdiSetSaeAuthParams, - CleanupParsedWdiSetSaeAuthParams, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvSetSaeAuthParams, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr// HAL M4 - > -{}; - -// -------- WDI_TASK_DISCONNECT -------- -template<> -struct TransitionTraits - : GenericTransitionTraits< - WDI_TASK_DISCONNECT, - WDI_TASK_DISCONNECT_PARAMETERS, - WDI_INDICATION_DISCONNECT_COMPLETE, - false, // dump TLV stream? (was false in original) - ParseWdiTaskDisconnect, - CleanupParsedWdiTaskDisconnect, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvDisconnect, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr // HAL M4 - > -{ -}; -/// ----- End of scenario [Connect with a SAE WI-FI7 network]----- - -// -------- WDI_TASK_DOT11_RESET -------- -template<> -struct TransitionTraits - : GenericTransitionTraits < - WDI_TASK_DOT11_RESET, - WDI_TASK_DOT11_RESET_PARAMETERS, - WDI_INDICATION_DOT11_RESET_COMPLETE, - false, // dump TLV stream? (was false in original) - ParseWdiTaskDot11Reset, - CleanupParsedWdiTaskDot11Reset, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvReset, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr // HAL M4 - > -{ -}; - -// -------- WDI_TASK_SCAN -------- -template<> -struct TransitionTraits - : GenericTransitionTraits < - WDI_TASK_SCAN, - WDI_SCAN_PARAMETERS, - WDI_INDICATION_SCAN_COMPLETE, - true, // dump TLV stream? (was true in original) - ParseWdiTaskScan, - CleanupParsedWdiTaskScan, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvScan, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr // HAL M4 - > -{ -}; - -// -------- WDI_TASK_SET_RADIO_STATE -------- -template<> -struct TransitionTraits - : GenericTransitionTraits < - WDI_TASK_SET_RADIO_STATE, - WDI_SET_RADIO_STATE_PARAMETERS, - WDI_INDICATION_SET_RADIO_STATE_COMPLETE, - true, // dump TLV stream? (was true in original) - ParseWdiTaskSetRadioState, - CleanupParsedWdiTaskSetRadioState, - &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 - &WifiHAL::WifiIhvSetRadioState, // HAL M3 - &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 - nullptr // HAL M4 - > -{ -}; - -// Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. -NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) -{ - switch (messageId) - { - case WDI_TASK_SET_RADIO_STATE: - return RunTransition(ctx); - case WDI_TASK_SCAN: - return RunTransition(ctx); - case WDI_TASK_DOT11_RESET: - return RunTransition(ctx); - case WDI_TASK_CONNECT: - return RunTransition(ctx); - case WDI_TASK_DISCONNECT: - return RunTransition(ctx); - case WDI_SET_SAE_AUTH_PARAMS: - return RunTransition(ctx); - default: - UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); - WifiRequestComplete(ctx.WifiRequest, STATUS_NOT_SUPPORTED, bytesWritten); - return STATUS_NOT_SUPPORTED; - } -} \ No newline at end of file diff --git a/network/wlan/WIFICX/drivercode/wifitransition.h b/network/wlan/WIFICX/drivercode/wifitransition.h deleted file mode 100644 index a0addf88..00000000 --- a/network/wlan/WIFICX/drivercode/wifitransition.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) Microsoft Corporation. All rights reserved. -#pragma once -#include "precomp.h" -#include "wifiHAL.h" -#include "wifirequest.h" - -// Generic execution context passed between steps and parse/handle -struct TransitionContext -{ - WDFDEVICE Device; - PWIFI_IHV_DEVICE_CONTEXT DevCtx; - WIFIREQUEST WifiRequest; - PWDI_MESSAGE_HEADER Header; - void* RawBuffer; - UINT InLen; - UINT OutLen; -}; - -// -------- Runtime dispatcher (decl) -------- -NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId); \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.inf b/network/wlan/WIFICX/km/wificxsampleclientkm.inf deleted file mode 100644 index 1968ff32..00000000 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.inf +++ /dev/null @@ -1,96 +0,0 @@ -;Copyright (c) Microsoft Corporation. All rights reserved. -; wificxsampleclientkm.inf -; - -[Version] -Signature = "$WINDOWS NT$" -Class = NET -ClassGuid = {4d36e972-e325-11ce-bfc1-08002be10318} -Provider = %ManufacturerName% -CatalogFile = wificxsampleclientkm.cat -DriverVer = ; TODO: set DriverVer in stampinf property pages -PnpLockdown = 1 - -[DestinationDirs] -DefaultDestDir = 13 - -[SourceDisksNames] -1 = %DiskName%,,,"" - -[SourceDisksFiles] -wificxsampleclientkm.sys = 1,, - -;***************************************** -; Install Section -;***************************************** - -[Manufacturer] -%ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299 - -[Standard.NT$ARCH$.10.0...16299] -%wificxsampleclientkm.DeviceDesc% = wificxsampleclientkm_Device.ndi, Root\wificxsampleclientkm - -; -; Normal device - Networking Section -; -[wificxsampleclientkm_Device.ndi.NT] -CopyFiles = File_Copy -Characteristics = 0x84 ; NCF_HAS_UI, NCF_PHYSICAL -BusType = 0 ; Internal -AddReg = wificxsampleclientkm.reg, netvadapter.params -*IfType = 71 ; IF_TYPE_IEEE80211 -*MediaType = 16 ; NdisMediumNative802_11 -*PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 - -[File_Copy] -wificxsampleclientkm.sys - -;-------------- Service installation -[wificxsampleclientkm_Device.ndi.NT.Services] -AddService = wificxsampleclientkm,%SPSVCINST_ASSOCSERVICE%, wificxsampleclientkm_Service_Inst - -; -------------- wificxsampleclientkm driver install sections -[wificxsampleclientkm_Service_Inst] -DisplayName = %wificxsampleclientkm.SVCDESC% -ServiceType = 1 ; SERVICE_KERNEL_DRIVER -StartType = 3 ; SERVICE_DEMAND_START -ErrorControl = 1 ; SERVICE_ERROR_NORMAL -ServiceBinary = %13%\wificxsampleclientkm.sys - -[wificxsampleclientkm_Device.ndi.NT.Wdf] -KmdfService = wificxsampleclientkm, wificxsampleclientkm_wdfsect - -[wificxsampleclientkm_wdfsect] -KmdfLibraryVersion = $KMDFVERSION$ - - -[wificxsampleclientkm.reg] -HKR, Ndi, Service, 0, "wificxsampleclientkm" -HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" -HKR, Ndi\Interfaces, LowerRange, 0, "wlan,ethernet" -; standard INF keywords for NetAdapter drivers -; using AddReg directive so they will work when this INF being Includes/Needs - -HKR, NetworkInterface, *IfConnectorPresent, 0x00010001, 1 -HKR, NetworkInterface, *ConnectionType, 0x00010001, 1 -HKR, NetworkInterface, *DirectionType, 0x00010001, 0 -HKR, NetworkInterface, *AccessType, 0x00010001, 2 -HKR, NetworkInterface, *HardwareLoopback, 0x00010001, 0 -HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 - -[Strings] -SPSVCINST_ASSOCSERVICE = 0x00000002 -ManufacturerName = "WDK Sample" -DiskName = "Wificxsampleclientkm Installation Disk" -wificxsampleclientkm.DeviceDesc = "[KMDF]Wificx Sample Client Device" -wificxsampleclientkm.SVCDESC = "Wificxsampleclientkm Service" - -[netvadapter.params] -; MACLastByte - HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" - HKR, Ndi\params\MACLastByte, default, 0, "1" - HKR, Ndi\params\MACLastByte, type, 0, "int" - HKR, Ndi\params\MACLastByte, min, 0, "1" - HKR, Ndi\params\MACLastByte, max, 0, "254" - HKR, Ndi\params\MACLastByte, step, 0, "1" - HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj deleted file mode 100644 index e5bd720c..00000000 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - Debug - ARM64 - - - Release - ARM64 - - - - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777} - {1bc93793-694f-48fe-9372-81e2b05556fd} - v4.5 - 12.0 - Debug - x64 - wificxsampleclientkm - - - - Windows10 - true - WindowsKernelModeDriver10.0 - Driver - KMDF - Windows Driver - 1 - 33 - 33 - true - 2 - 5 - 4 - true - 1 - 2 - true - - - Windows10 - false - WindowsKernelModeDriver10.0 - Driver - KMDF - Windows Driver - 1 - 33 - 33 - true - 2 - 5 - 4 - true - 1 - 2 - true - - - Windows10 - true - WindowsKernelModeDriver10.0 - Driver - KMDF - Windows Driver - 1 - 33 - 33 - true - 2 - 5 - 4 - true - 1 - 2 - true - - - Windows10 - false - WindowsKernelModeDriver10.0 - Driver - KMDF - Windows Driver - 1 - 33 - 33 - true - 2 - 5 - 4 - true - 1 - 2 - true - - - - - - - - - - - DbgengKernelDebugger - false - false - - - DbgengKernelDebugger - false - false - - - DbgengKernelDebugger - false - false - - - DbgengKernelDebugger - false - false - - - - sha256 - - - true - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) - true - ..\drivercode\trace.h - false - _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) - - - $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - 1.0 - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) - true - true - ..\drivercode\trace.h - false - _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) - - - $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - 1.0 - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) - true - true - ..\drivercode\trace.h - false - _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) - - - $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - 1.0 - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) - true - true - ..\drivercode\trace.h - false - _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) - - - $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - 1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e2a65efd-25cc-4af0-b180-0cd56ee277a9} - - - - \ No newline at end of file diff --git a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters b/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters deleted file mode 100644 index 2930b24d..00000000 --- a/network/wlan/WIFICX/km/wificxsampleclientkm.vcxproj.filters +++ /dev/null @@ -1,84 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {8E41214B-6785-4CFE-B992-037D68949A14} - inf;inv;inx;mof;mc; - - - - - Driver Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.inf b/network/wlan/WIFICX/um/wificxsampleclientum.inf deleted file mode 100644 index 98633234..00000000 --- a/network/wlan/WIFICX/um/wificxsampleclientum.inf +++ /dev/null @@ -1,107 +0,0 @@ -;Copyright (c) Microsoft Corporation. All rights reserved. -; wificxsampleclientum.inf -; - -[Version] -Signature = $Windows NT$ -Class = NET -ClassGuid = {4d36e972-e325-11ce-bfc1-08002be10318} -Provider = %ManufacturerName% -CatalogFile = wificxsampleclientum.cat -DriverVer = ; TODO: set DriverVer in stampinf property pages -PnpLockdown = 1 - -[Manufacturer] -; This driver package is only installable on Win11+ -%ManufacturerName% = Standard,NT$ARCH$.10.0...22000 ; wudfrd.inf introduced in build 22000 - -[Standard.NT$ARCH$.10.0...22000] -%DeviceName% = Wificxsampleclientum_Device.ndi, Root\wificxsampleclientum - -; -; Normal device - Networking Section -; -[Wificxsampleclientum_Device.ndi] -Include=wudfrd.inf, netcxrd.inf -Needs=WUDFRD.NT, netcxrd_Filter.NT - -Characteristics = 0x1 ; NCF_VIRTUAL -*IfType = 71 ; IF_TYPE_IEEE80211 -*MediaType = 16 ; NdisMediumNative802_11 -*PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 -BusType = 15 ; PnpBus -NumberOfNetworkInterfaces = 5 -AddReg = Wificxsampleclientum.reg, netvadapter.params -CopyFiles = Wificxsampleclientum.Copy - -[Wificxsampleclientum_Device.ndi.Hw] -Include=wudfrd.inf, netcxrd.inf -Needs=WUDFRD.NT.HW, netcxrd_Filter.NT.HW - -[Wificxsampleclientum_Device.ndi.Filters] -Include=netcxrd.inf -Needs=netcxrd_Filter.NT.Filters - -[Wificxsampleclientum_Device.ndi.Services] -Include=wudfrd.inf, netcxrd.inf -Needs=WUDFRD.NT.Services, netcxrd_Filter.NT.Services - -[Wificxsampleclientum_Device.ndi.Wdf] -UmdfService = "Wificxsampleclientum", wdf -UmdfServiceOrder=wificxsampleclientum -UmdfHostProcessSharing=ProcessSharingDisabled -UmdfKernelModeClientPolicy=AllowKernelModeClients -UmdfDirectHardwareAccess=AllowDirectHardwareAccessAndDma -UmdfRegisterAccessMode=RegisterAccessUsingUserModeMapping -UmdfFsContextUsePolicy=CanUseFsContext2 - -[wdf] -UmdfLibraryVersion = 2.33.0 -UmdfExtensions = NetAdapterCx0202,WifiCx0102 -ServiceBinary=%13%\wificxtestclient.dll -; -; Common - Generic INF sections -; -[Wificxsampleclientum.reg] -HKR, , BusNumber, 0, "0" -HKR, Ndi, Service, 0, "Wificxsampleclientum" -HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" -HKR, Ndi\Interfaces, LowerRange, 0, "wlan,ethernet" - -; standard INF keywords for NetAdapter drivers -; using AddReg directive so they will work when this INF being Includes/Needs -HKR, NetworkInterface, *IfConnectorPresent, 0x00010001, 1 -HKR, NetworkInterface, *ConnectionType, 0x00010001, 1 -HKR, NetworkInterface, *DirectionType, 0x00010001, 0 -HKR, NetworkInterface, *AccessType, 0x00010001, 2 -HKR, NetworkInterface, *HardwareLoopback, 0x00010001, 0 -HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 - -[Wificxsampleclientum.Copy] -wificxsampleclientum.dll - -[SourceDisksNames] -1 = %DiskName%,,,"" - -[DestinationDirs] -Wificxsampleclientum.Copy = 13 - -[SourceDisksFiles] -wificxsampleclientum.dll = 1 - -; =================== Generic ================================== - -[Strings] -ManufacturerName = "WDK Sample" -DiskName = "wificxsampleclientum Installation Disk" -DeviceName = "[UMDF] Wificx Sample Client Device" - -[netvadapter.params] -; MACLastByte - HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" - HKR, Ndi\params\MACLastByte, default, 0, "1" - HKR, Ndi\params\MACLastByte, type, 0, "int" - HKR, Ndi\params\MACLastByte, min, 0, "1" - HKR, Ndi\params\MACLastByte, max, 0, "254" - HKR, Ndi\params\MACLastByte, step, 0, "1" - HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj deleted file mode 100644 index 70836086..00000000 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - Debug - ARM64 - - - Release - ARM64 - - - - - - - {C804D7D0-80D8-1409-44DA-91EF3260D07F} - {2177f19c-eb4c-4687-9e7f-f9eec1f12cf1} - v4.5 - 12.0 - Debug - x64 - wificxsampleclientum - - - WindowsUserModeDriver10.0 - DynamicLibrary - Universal - - - WindowsUserModeDriver10.0 - DynamicLibrary - Universal - - - WindowsUserModeDriver10.0 - DynamicLibrary - Universal - - - WindowsUserModeDriver10.0 - DynamicLibrary - Universal - - - - Windows10 - true - 2 - 35 - 35 - true - 2 - 5 - true - 1 - 2 - - - Windows10 - false - 2 - 35 - 35 - true - 2 - 5 - true - 1 - 2 - - - Windows10 - true - 2 - 35 - 35 - true - 2 - 5 - true - 1 - 2 - - - Windows10 - false - 2 - 35 - 35 - true - 2 - 5 - true - 1 - 2 - - - - - - - - - - - DbgengRemoteDebugger - false - - - DbgengRemoteDebugger - false - - - DbgengRemoteDebugger - false - - - DbgengRemoteDebugger - false - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) - WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) - true - ..\drivercode\trace.h - false - false - true - - - $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) - WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) - true - ..\drivercode\trace.h - false - false - true - - - $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) - WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) - true - ..\drivercode\trace.h - false - false - true - - - $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - - - sha256 - - - ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) - WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) - true - ..\drivercode\trace.h - false - false - true - - - $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {612f33ad-430c-4fe7-8000-35e15a5eb757} - - - - \ No newline at end of file diff --git a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters b/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters deleted file mode 100644 index a10fb659..00000000 --- a/network/wlan/WIFICX/um/wificxsampleclientum.vcxproj.filters +++ /dev/null @@ -1,84 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {8E41214B-6785-4CFE-B992-037D68949A14} - inf;inv;inx;mof;mc; - - - - - Driver Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/network/wlan/WIFICX/video/ControlPath.mp4 b/network/wlan/WIFICX/video/ControlPath.mp4 deleted file mode 100644 index 15ec3d62..00000000 Binary files a/network/wlan/WIFICX/video/ControlPath.mp4 and /dev/null differ diff --git a/network/wlan/WIFICX/video/DataPath.mp4 b/network/wlan/WIFICX/video/DataPath.mp4 deleted file mode 100644 index fda748e5..00000000 Binary files a/network/wlan/WIFICX/video/DataPath.mp4 and /dev/null differ diff --git a/network/wlan/WIFICX/wificxsampleclient.sln b/network/wlan/WIFICX/wificxsampleclient.sln deleted file mode 100644 index d484d08c..00000000 --- a/network/wlan/WIFICX/wificxsampleclient.sln +++ /dev/null @@ -1,82 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 -MinimumVisualStudioVersion = 12.0 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" - ProjectSection(ProjectDependencies) = postProject - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} = {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientum", "um\wificxsampleclientum.vcxproj", "{C804D7D0-80D8-1409-44DA-91EF3260D07F}" - ProjectSection(ProjectDependencies) = postProject - {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\..\netadaptercx\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Build.0 = Debug|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.ActiveCfg = Debug|x64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Build.0 = Debug|x64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Deploy.0 = Debug|x64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.ActiveCfg = Release|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Build.0 = Release|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Deploy.0 = Release|ARM64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.ActiveCfg = Release|x64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Build.0 = Release|x64 - {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Deploy.0 = Release|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Build.0 = Debug|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.ActiveCfg = Debug|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Build.0 = Debug|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Deploy.0 = Debug|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.ActiveCfg = Release|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Build.0 = Release|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Deploy.0 = Release|ARM64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.ActiveCfg = Release|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Build.0 = Release|x64 - {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Deploy.0 = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Deploy.0 = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.ActiveCfg = Release|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Build.0 = Release|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Deploy.0 = Release|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Deploy.0 = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Build.0 = Debug|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Deploy.0 = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.ActiveCfg = Release|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Build.0 = Release|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Deploy.0 = Release|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {37680CDC-EACB-499B-BA11-7C376F53DB71} - EndGlobalSection -EndGlobal diff --git a/network/wlan/wificx/README.md b/network/wlan/wificx/README.md new file mode 100644 index 00000000..fb4ca92a --- /dev/null +++ b/network/wlan/wificx/README.md @@ -0,0 +1,50 @@ +--- +page_type: sample +description: "Demonstrates how to use WIFICX for control flow and NetAdapterCx for data flow." +languages: +- cpp +products: +- windows +- windows-wdk +--- + +# WIFICX and NetAdapterCx Samples + +This sample illustrates how to leverage **WIFICX** for control flow and **NetAdapterCx** for data flow. It supports both **KMDF** and **UMDF(In Preview Stage)** drivers. + +## How to Build +1. Mount the EWDK ISO from a local drive (network share paths are not supported). +2. Run `LaunchBuildEnv.cmd`. +3. In the environment created in step 2, type `SetupVSEnv` and press **Enter**. +4. Navigate to the current folder and open the solution file, for example: + `X:\Windows-driver-samples\network\wlan\WIFICX\wificxsampleclient.sln` +5. Build the solution from the Visual Studio UI. + +## Interfaces and Abstraction +The sample interacts with three OS components: + +- **WDF** + `driver.cpp`, `device.cpp`, and `adapter.cpp` demonstrate proper registration for PnP and power event callbacks. WDF manages system PnP and power requests (e.g., power IRPs), so IHV drivers should follow the flow triggered through these callbacks. + +- **WDF Wi-Fi Class Extension (WIFICX)** + `wifixxxxx.cpp` files implement the **control path**, handling commands sent to Wi-Fi firmware (e.g., scan access points, connect, disconnect). + +- **WDF NetAdapter Class Extension (NetAdapterCx)** + `netvxxxx` files and classes implement the **data path**, managing network buffers and synchronizing with the control path for transfer start/stop operations. + +## Data Buffers from Firmware +The control path uses hardcoded data since this sample does not target real hardware. The data path uses **Emulated Network Link (ENL)**, which connects two virtual network adapters directly. Packets sent over one adapter are delivered to the other and vice versa. + +## Supported Scenarios +- [x] Scan access points and report BSS entries to the Windows UI. +- [x] Connect to an open access point from the Windows UI. +- [x] Disconnect from the connected access point. +- [x] Transfer data between two Wi-Fi device instances (e.g., ping and throughput test). + +## 🎥 Control & Data Path Demo Video +A walkthrough video demonstrating the Control & Data Path flow are available here: + +[▶ Watch Control Path Demo](video/ControlPath.mp4) + +[▶ Watch Data Path Demo](video/DataPath.mp4) + diff --git a/network/wlan/wificx/drivercode/SharedTypes.h b/network/wlan/wificx/drivercode/SharedTypes.h new file mode 100644 index 00000000..43fd815a --- /dev/null +++ b/network/wlan/wificx/drivercode/SharedTypes.h @@ -0,0 +1,16 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +// +// SharedTypes.h +// Central header for global definitions, macros, and shared structures. +// +#include "precomp.h" +#include // for GUID defination + +// ============================= +// GUIDs or Constants +// ============================= +// {bb67559a-06f6-4eb0-81e9-21fdc3b60efb} +DEFINE_GUID(GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, 0xbb67559a, 0x06f6, 0x4eb0, 0x81, 0xe9, 0x21, 0xfd, 0xc3, 0xb6, 0x0e, 0xfb); +#define WIFI_DRIVER_DEFAULT_POOL_TAG 'shiW' // WIFI IHV Sample Driver \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/adapter.cpp b/network/wlan/wificx/drivercode/adapter.cpp new file mode 100644 index 00000000..fd44c72b --- /dev/null +++ b/network/wlan/wificx/drivercode/adapter.cpp @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +#include "precomp.h" +#include "adapter.h" +#include "adapter.tmh" + +extern UCHAR NetvMacAddressBase[MAC_ADDR_LEN]; + +NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter) +{ + WifiNetvAdapter* wifiNetvAdapter = WifiNetvAdapterGetContext(netAdapter); + NetvAdapter* netvAdapter{ wifiNetvAdapter }; + return netvAdapter; +} + +WifiNetvAdapter::WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device) : NetvAdapter(Handle, Device) +{ +} + +NTSTATUS WifiNetvAdapter::Initialize() +{ + if (WifiGetIhvDeviceContext(m_device)->netAdapters[WifiAdapterGetPortId(m_handle)] != WDF_NO_HANDLE) + { + return STATUS_SUCCESS; + } + return NetvAdapter::Initialize(); +} + +NTSTATUS WifiNetvAdapter::AdapterStart() +{ + TraceEntry(); + + NTSTATUS status = STATUS_SUCCESS; + + NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES wakeMediaChangeCapabilities; + NET_ADAPTER_WAKE_MEDIA_CHANGE_CAPABILITIES_INIT(&wakeMediaChangeCapabilities); + + wakeMediaChangeCapabilities.MediaConnect = TRUE; + wakeMediaChangeCapabilities.MediaDisconnect = TRUE; + + NetAdapterWakeSetMediaChangeCapabilities(m_handle, &wakeMediaChangeCapabilities); + + WIFI_ADAPTER_WAKE_CAPABILITIES wakeCap{}; + WIFI_ADAPTER_WAKE_CAPABILITIES_INIT(&wakeCap); + if (WIFI_IS_FIELD_AVAILABLE(WIFI_ADAPTER_WAKE_CAPABILITIES, ClientDriverDiagnostic)) + { + wakeCap.ClientDriverDiagnostic = true; + } + WifiAdapterSetWakeCapabilities(m_handle, &wakeCap); + + status = NetvAdapter::ConfigureDataCapabilities(); + if (!NT_SUCCESS(status)) + { + WFCError("%!FUNC!: NetvAdapter::ConfigureDataCapabilities failed with %!STATUS!", status); + return status; + } + + status = NetAdapterStart(m_handle); + if (!NT_SUCCESS(status)) + { + WFCError("%!FUNC!: NetAdapterStart failed with %!STATUS!", status); + return status; + } + + ASSERT(STATUS_SUCCESS == status); + TraceExit(status); + + return status; +} + +NTSTATUS WifiNetvAdapter::CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit) +{ + return NetvAdapter::CreateRxQueue(NetRxQueueInit); +} + +NTSTATUS WifiNetvAdapter::CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit) +{ + return NetvAdapter::CreateTxQueue(NetTxQueueInit); +} + +void WifiNetvAdapter::Destroy(void) +{ + return NetvAdapter::Destroy(); +} \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/adapter.h b/network/wlan/wificx/drivercode/adapter.h new file mode 100644 index 00000000..0b7aa093 --- /dev/null +++ b/network/wlan/wificx/drivercode/adapter.h @@ -0,0 +1,42 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "device.h" +#include "netvadapter.h" + +// for STA TX DEMUX +#define MaxNumOfPeers 1 + +// Context for each "Wdi Port"[NetAdapter] instance. +// Each NetAdapter instance corresponds to an IP interface +typedef struct _WIFI_IHV_NETADAPTER_CONTEXT +{ + PWIFI_IHV_DEVICE_CONTEXT WifiDeviceContext; // Wdf Ihv device context + NETADAPTER NetAdapter; // NetAdapter object +} WIFI_IHV_NETADAPTER_CONTEXT, * PWIFI_IHV_NETADAPTER_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_NETADAPTER_CONTEXT, WifiGetIhvNetAdapterContext); + +class WifiNetvAdapter : public NetvAdapter +{ +public: + WifiNetvAdapter(NETADAPTER Handle, WDFDEVICE Device); + + NTSTATUS + Initialize(); + + NTSTATUS + AdapterStart(); + + NTSTATUS + CreateRxQueue(NETRXQUEUE_INIT* NetRxQueueInit); + + NTSTATUS + CreateTxQueue(NETTXQUEUE_INIT* NetTxQueueInit); + + void Destroy(void); + + bool CanReportWifiWakeSourceTypeClientDriverDiagnostic; + +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiNetvAdapter, WifiNetvAdapterGetContext); \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/device.cpp b/network/wlan/wificx/drivercode/device.cpp new file mode 100644 index 00000000..0e04d562 --- /dev/null +++ b/network/wlan/wificx/drivercode/device.cpp @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +#include "precomp.h" + +#include "adapter.h" +#include "device.h" +#include "device.tmh" + +_Use_decl_annotations_ +NTSTATUS EvtDevicePrepareHardware(WDFDEVICE device, WDFCMRESLIST resourcesRaw, WDFCMRESLIST resourcesTranslated) +{ + UNREFERENCED_PARAMETER(resourcesRaw); + UNREFERENCED_PARAMETER(resourcesTranslated); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiHAL::_Create(device), + "WifiHAL::_Create failed"); + + WFCInfo("Device=0x%p", device); + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS EvtDeviceReleaseHardware(WDFDEVICE device, WDFCMRESLIST resourcesTranslated) +{ + UNREFERENCED_PARAMETER(resourcesTranslated); + + WFCInfo("Device=0x%p", device); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS EvtWifiDeviceCreateAdapter(WDFDEVICE Device, NETADAPTER_INIT* AdapterInit) +{ + if (WifiAdapterInitGetType(AdapterInit) != WIFI_ADAPTER_EXTENSIBLE_STATION) + { + WFCError("%!FUNC!: Unsupported adapter type = 0x%x != 0x%x", WifiAdapterInitGetType(AdapterInit), WIFI_ADAPTER_EXTENSIBLE_STATION); + return STATUS_NOT_SUPPORTED; + } + + NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; + NET_ADAPTER_DATAPATH_CALLBACKS_INIT(&datapathCallbacks, EvtAdapterCreateTxQueue, EvtAdapterCreateRxQueue); + + NetAdapterInitSetDatapathCallbacks(AdapterInit, &datapathCallbacks); + + WDF_OBJECT_ATTRIBUTES adapterAttributes; + WDF_OBJECT_ATTRIBUTES_INIT(&adapterAttributes); + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, WifiNetvAdapter); + adapterAttributes.EvtCleanupCallback = EvtAdapterCleanup; + +#ifdef NETV_SUPPORT_TX_DEMUXING + WIFI_ADAPTER_TX_DEMUX peerInfoDemux; + WIFI_ADAPTER_TX_PEER_ADDRESS_DEMUX_INIT(&peerInfoDemux, MaxNumOfPeers); + WifiAdapterInitAddTxDemux(AdapterInit, &peerInfoDemux); +#endif // NETV_SUPPORT_TX_DEMUXING + + + NETADAPTER netAdapter; + NTSTATUS ntStatus = NetAdapterCreate(AdapterInit, &adapterAttributes, &netAdapter); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: NetAdapterCreate failed, status=0x%x", ntStatus); + return ntStatus; + } + + ntStatus = WifiAdapterInitialize(netAdapter); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiAdapterInitialize failed with %!STATUS!", ntStatus); + return ntStatus; + } + auto wifiNetvAdapter = new (reinterpret_cast(WifiNetvAdapterGetContext(netAdapter))) WifiNetvAdapter(netAdapter, Device); + ntStatus = wifiNetvAdapter->Initialize(); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiNetvAdapter::Initialize failed with %!STATUS!", ntStatus); + return ntStatus; + } + + ntStatus = wifiNetvAdapter->AdapterStart(); + ASSERT(NT_SUCCESS(ntStatus)); + if (!NT_SUCCESS(ntStatus)) + { + WFCError("%!FUNC!: WifiNetvAdapter::AdapterStart failed with %!STATUS!", ntStatus); + return ntStatus; + } + + auto wifiNetvDevice = WifiGetIhvDeviceContext(Device); + wifiNetvDevice->netAdapters[WifiAdapterGetPortId(netAdapter)] = netAdapter; + + WFCInfo("%!FUNC!: Success!"); + return ntStatus; +} + +_Use_decl_annotations_ +void EvtAdapterCleanup(_In_ WDFOBJECT NetAdapter) +{ + TraceEntry(); + auto wifiNetvAdapter = WifiNetvAdapterGetContext(NetAdapter); + wifiNetvAdapter->Destroy(); + TraceExit(STATUS_SUCCESS); +} + + +_Use_decl_annotations_ +NTSTATUS EvtWifiDeviceCreateWifiDirectDevice(WDFDEVICE, WIFIDIRECT_DEVICE_INIT*) +{ + NTSTATUS status = STATUS_SUCCESS; + TraceEntry(); + TraceExit(status); + return status; +} + + +_Use_decl_annotations_ +NTSTATUS +EvtAdapterCreateTxQueue(NETADAPTER Adapter, NETTXQUEUE_INIT* Init) +{ + TraceEntry(); + return WifiNetvAdapterGetContext(Adapter)->CreateTxQueue(Init); +} + +_Use_decl_annotations_ +NTSTATUS +EvtAdapterCreateRxQueue(NETADAPTER Adapter, NETRXQUEUE_INIT* Init) +{ + TraceEntry(); + return WifiNetvAdapterGetContext(Adapter)->CreateRxQueue(Init); +} diff --git a/network/wlan/wificx/drivercode/device.h b/network/wlan/wificx/drivercode/device.h new file mode 100644 index 00000000..c0dfac3c --- /dev/null +++ b/network/wlan/wificx/drivercode/device.h @@ -0,0 +1,29 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "wifiHAL.h" +EVT_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware; +EVT_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware; + +EVT_WIFI_DEVICE_CREATE_ADAPTER EvtWifiDeviceCreateAdapter; +EVT_WIFI_DEVICE_CREATE_WIFIDIRECTDEVICE EvtWifiDeviceCreateWifiDirectDevice; +EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; +EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtAdapterCleanup; + +EVT_NET_ADAPTER_CREATE_TXQUEUE EvtAdapterCreateTxQueue; +EVT_NET_ADAPTER_CREATE_RXQUEUE EvtAdapterCreateRxQueue; + +typedef struct _WIFI_IHV_DEVICE_CONTEXT +{ + // + // Do not add field variable before WdfTriageInfoPtr. + // NetAdapterCx carving code requires the first field of WDF context + // to be a pointer to WDF_TRIAGE_INFO. + // + void* WdfTriageInfoPtr; + WDFDEVICE WdfDevice; + TLV_CONTEXT TlvContext; + NETADAPTER netAdapters[5]{}; +} WIFI_IHV_DEVICE_CONTEXT, * PWIFI_IHV_DEVICE_CONTEXT; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_DEVICE_CONTEXT, WifiGetIhvDeviceContext); +static_assert(FIELD_OFFSET(WIFI_IHV_DEVICE_CONTEXT, WdfTriageInfoPtr) == 0); diff --git a/network/wlan/wificx/drivercode/driver.cpp b/network/wlan/wificx/drivercode/driver.cpp new file mode 100644 index 00000000..bbc4d151 --- /dev/null +++ b/network/wlan/wificx/drivercode/driver.cpp @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +#include "precomp.h" + +#include "device.h" +#include "driver.h" +#include "driver.tmh" + +NTSTATUS DriverEntry( + _In_ PDRIVER_OBJECT driverObject, + _In_ PUNICODE_STRING registryPath) +/*++ + +Routine Description: + DriverEntry initializes the driver and is the first routine called by the + system after the driver is loaded. DriverEntry specifies the other entry + points in the function driver, such as EvtDevice and DriverUnload. + +Parameters Description: + + DriverObject - represents the instance of the function driver that is loaded + into memory. DriverEntry must initialize members of DriverObject before it + returns to the caller. DriverObject is allocated by the system before the + driver is loaded, and it is released by the system after the system unloads + the function driver from memory. + + RegistryPath - represents the driver specific path in the Registry. + The function driver can use the path to store driver related data between + reboots. The path does not store hardware instance specific data. + +Return Value: + + STATUS_SUCCESS if successful, + STATUS_UNSUCCESSFUL otherwise. + +--*/ +{ + NTSTATUS status = STATUS_SUCCESS; + WDF_DRIVER_CONFIG driverConfig{}; + WDF_OBJECT_ATTRIBUTES attributes; + + // + // Initialize WPP Tracing + // + WPP_INIT_TRACING(driverObject, registryPath); + + // Since WPP tracing is now initialized, we can use Trace functions + TraceEntry(); + + // + // Register a cleanup callback so that we can call WPP_CLEANUP when + // the framework driver object is deleted during driver unload. + // + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + attributes.EvtCleanupCallback = EvtWifiDriverContextCleanup; + + WDF_DRIVER_CONFIG_INIT(&driverConfig, EvtWifiDriverDeviceAdd); + driverConfig.DriverPoolTag = WIFI_DRIVER_DEFAULT_POOL_TAG; + + status = WdfDriverCreate(driverObject, registryPath, &attributes, &driverConfig, WDF_NO_HANDLE); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDriverCreate failed %!STATUS!", status); + WPP_CLEANUP(driverObject); + return status; + } + + TraceExit(status); + + return status; +} + +NTSTATUS EvtWifiDriverDeviceAdd(_In_ WDFDRIVER driver, _Inout_ PWDFDEVICE_INIT deviceInit) +/*++ +Routine Description: + + EvtWifiDriverDeviceAdd is called by the framework in response to AddDevice + call from the PnP manager. We create and initialize a device object to + represent a new instance of the device. + +Arguments: + + Driver - Handle to a framework driver object created in DriverEntry + + DeviceInit - Pointer to a framework-allocated WDFDEVICE_INIT structure. + +Return Value: + + NTSTATUS + +--*/ +{ + UNREFERENCED_PARAMETER(driver); + + TraceEntry(); + + NTSTATUS status = STATUS_SUCCESS; + + // Configure the device init for NetAdapterCx (Data Path) + status = NetDeviceInitConfig(deviceInit); + if (!NT_SUCCESS(status)) + { + WFCError("NetDeviceInitConfig failed, status=0x%x", status); + goto Exit; + } + + // Configure the device init for WifiCx (Control Path) + status = WifiDeviceInitConfig(deviceInit); + if (!NT_SUCCESS(status)) + { + WFCError("WifiDeviceInitConfig failed, status=0x%x", status); + goto Exit; + } + + // Set PnP and Power Callbacks. + // [Scope: Only PrepareHardware and ReleaseHardware are implemented in this sample.] + WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks; + WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks); + pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware; + pnpPowerCallbacks.EvtDeviceReleaseHardware = EvtDeviceReleaseHardware; + WdfDeviceInitSetPnpPowerEventCallbacks(deviceInit, &pnpPowerCallbacks); + + // [Scope: ArmWake and DisarmWake are not implemented in this sample.] + //WDF_POWER_POLICY_EVENT_CALLBACKS powerPolicyCallbacks; + //WdfDeviceInitSetPowerPolicyEventCallbacks(deviceInit, &powerPolicyCallbacks); + + WDFDEVICE wdfIhvDevice{}; + // Create the device object context to store the device specific information + WDF_OBJECT_ATTRIBUTES ihvDeviceAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&ihvDeviceAttributes, WIFI_IHV_DEVICE_CONTEXT); + + status = WdfDeviceCreate(&deviceInit, &ihvDeviceAttributes, &wdfIhvDevice); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDeviceCreate failed, status=0x%x", status); + goto Exit; + } + + // + // Create a device interface so that applications can find and talk + // to us. + // + status = WdfDeviceCreateDeviceInterface(wdfIhvDevice, &GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, nullptr); + if (!NT_SUCCESS(status)) + { + WFCError("WdfDeviceCreateDeviceInterface failed with status=0x%x", status); + goto Exit; + } + + // Initialize WifiCx device now that the WDFDEVICE has been created. + // In short the WifICx is the "wdf managed WDI", so the Wdi core + // concepts still applies. + WIFI_DEVICE_CONFIG wifiDeviceConfig; + WIFI_DEVICE_CONFIG_INIT( + &wifiDeviceConfig, + WDI_VERSION_LATEST, // The "WDI" version supported by this Ihv driver + EvtWifiDeviceSendCommand, // The Wdi command and task, now called "wifirequest". + EvtWifiDeviceCreateAdapter, // The Wdi "ports", now support by the netadapter instances. + EvtWifiDeviceCreateWifiDirectDevice); // [Scope: No WiFi Direct support in this sample] + + // Initialize the WifiCx device with the configuration above to let OS side ready. + status = WifiDeviceInitialize(wdfIhvDevice, &wifiDeviceConfig); + if (!NT_SUCCESS(status)) + { + WFCError("WifiDeviceInitialize failed, status=0x%x", status); + goto Exit; + } + + // Get a pointer to the device context structure that we just associated + // with the device object. We define this structure in the device.h + // header file. WifiGetIhvDeviceContext is an inline function generated by + // using the WDF_DECLARE_CONTEXT_TYPE_WITH_NAME macro in device.h. + // This function will do the type checking and return the device context. + // If you pass a wrong object handle it will return NULL and assert if + // run under framework verifier mode. + auto deviceIhvContext = WifiGetIhvDeviceContext(wdfIhvDevice); + deviceIhvContext->WdfDevice = wdfIhvDevice; + deviceIhvContext->WdfTriageInfoPtr = WdfGetTriageInfo(); + + deviceIhvContext->TlvContext.AllocationContext = 0; + deviceIhvContext->TlvContext.PeerVersion = WifiDeviceGetOsWdiVersion(wdfIhvDevice); + +Exit: + TraceExit(status); + return status; +} + +void EvtWifiDriverContextCleanup(_In_ WDFOBJECT DriverObject) +/*++ +Routine Description: + + Free all the resources allocated in DriverEntry. + +Arguments: + + DriverObject - handle to a WDF Driver object. + +Return Value: + + VOID. + +--*/ +{ +#ifndef _KERNEL_MODE + // follow https://github.com/MicrosoftDocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/wdf/using-wpp-software-tracing-in-kmdf-and-umdf-2-drivers.md + // because UMDF drivers use the kernel-mode signatures of these macros for initializing and cleaning up tracing, the calls look identical for KMDF and UMDF. + UNREFERENCED_PARAMETER(DriverObject); +#endif // !_KERNEL_MODE + + WPP_CLEANUP(WdfDriverWdmGetDriverObject(static_cast(DriverObject))); +} diff --git a/network/wlan/wificx/drivercode/driver.h b/network/wlan/wificx/drivercode/driver.h new file mode 100644 index 00000000..8573b30e --- /dev/null +++ b/network/wlan/wificx/drivercode/driver.h @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +#pragma once +#include "precomp.h" + +WDF_EXTERN_C_START + +DRIVER_INITIALIZE DriverEntry; + +EVT_WDF_DRIVER_DEVICE_ADD EvtWifiDriverDeviceAdd; +EVT_WDF_OBJECT_CONTEXT_CLEANUP EvtWifiDriverContextCleanup; + +WDF_EXTERN_C_END \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/memorymanagement.cpp b/network/wlan/wificx/drivercode/memorymanagement.cpp new file mode 100644 index 00000000..088bad88 --- /dev/null +++ b/network/wlan/wificx/drivercode/memorymanagement.cpp @@ -0,0 +1,149 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#include "precomp.h" + +#ifndef _KERNEL_MODE +#include // for _ReturnAddress for user mode +#endif // UM + +typedef struct _PLACEMENT_NEW_ALLOCATION_CONTEXT +{ + size_t cbMaxSize; + _Field_size_bytes_(cbMaxSize) void* pbBuffer; +} PLACEMENT_NEW_ALLOCATION_CONTEXT, * PPLACEMENT_NEW_ALLOCATION_CONTEXT; +typedef const PLACEMENT_NEW_ALLOCATION_CONTEXT* PCPLACEMENT_NEW_ALLOCATION_CONTEXT; + +// for FreeWdfMemoryBuffer to correct get +// the handle to free the memory +struct WIFI_IHV_MEMORY_HEADER +{ + size_t HeaderSize; + WDFMEMORY WdfMemoryHandle; +}; + +// for tracking memory leaks +struct WIFI_IHV_MEMORY_CONTEXT +{ + size_t ContextSize; + void* pvCaller; +}; + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WIFI_IHV_MEMORY_CONTEXT, GetWificxIhvMemoryContextFromHandle); + + +void* AllocateWdfMemoryBuffer(size_t Size, _In_ void* CallerForMemoryLeakTracking) +{ + size_t totalSize = 0; + if (!NT_SUCCESS(Wifi::SizeTAddSafe(Size, sizeof(WIFI_IHV_MEMORY_HEADER), &totalSize))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate total size"); + return nullptr; + } + + // allocate the context memory to store the WIFI_IHV_MEMORY_CONTEXT + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WIFI_IHV_MEMORY_CONTEXT); + WDFMEMORY wdfMemoryBufferHandle = WDF_NO_HANDLE; + void* pWdfMemoryBuffer = nullptr; + + if (!NT_SUCCESS(WdfMemoryCreate(&attributes, NonPagedPoolNx, WIFI_DRIVER_DEFAULT_POOL_TAG, totalSize, &wdfMemoryBufferHandle, &pWdfMemoryBuffer))) + { + WFCError("Failed to allocate memory buffer"); + return nullptr; + } + + RtlZeroMemory(pWdfMemoryBuffer, totalSize); + + // store the wdf memory handle in the header for FreeWdfMemoryBuffer to find the handle + WIFI_IHV_MEMORY_HEADER* pMemoryHeader = static_cast(pWdfMemoryBuffer); + pMemoryHeader->HeaderSize = sizeof(WIFI_IHV_MEMORY_HEADER); + pMemoryHeader->WdfMemoryHandle = wdfMemoryBufferHandle; + + // store the caller and caller's caller for tracking memory leaks + auto memoryContext = GetWificxIhvMemoryContextFromHandle(wdfMemoryBufferHandle); + RtlZeroMemory(memoryContext, sizeof(WIFI_IHV_MEMORY_CONTEXT)); + memoryContext->ContextSize = sizeof(WIFI_IHV_MEMORY_CONTEXT); + memoryContext->pvCaller = CallerForMemoryLeakTracking; + + // hide the wdf memory header to the caller. + const ULONG_PTR wdfMemoryWithHeaderBuffer = reinterpret_cast(pWdfMemoryBuffer); + ULONG_PTR wdfMemoryPayloadOnlyBuffer{ 0 }; + if (!NT_SUCCESS(Wifi::ULongPtrAddSafe(wdfMemoryWithHeaderBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryPayloadOnlyBuffer))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate payload buffer address"); + return nullptr; + } + + return reinterpret_cast(wdfMemoryPayloadOnlyBuffer); +} + +void FreeWdfMemoryBuffer(_In_opt_ void* pBuffer) +{ + if (pBuffer == nullptr) // existing wdi code not checking for nullptr before delete, so we have to leave it as is + { + return; + } + const ULONG_PTR wdfMemoryPayloadOnlyBuffer = reinterpret_cast(pBuffer); + ULONG_PTR wdfMemoryWithHeaderBuffer{ 0 }; + if (!NT_SUCCESS(Wifi::ULongPtrSubSafe(wdfMemoryPayloadOnlyBuffer, sizeof(WIFI_IHV_MEMORY_HEADER), &wdfMemoryWithHeaderBuffer))) + { + NT_ASSERT(FALSE); + WFCError("Failed to calculate header buffer address"); + return; + } + + const auto wificxMemoryHeader = static_cast(reinterpret_cast(wdfMemoryWithHeaderBuffer)); + + // This is memory corruption detection logic, + // keep it, don't remove it. + NT_ASSERT(wificxMemoryHeader->HeaderSize == sizeof(WIFI_IHV_MEMORY_HEADER)); + + WdfObjectDelete(wificxMemoryHeader->WdfMemoryHandle); +} + +_Ret_writes_bytes_maybenull_(_Size) void* PlacementNewHelper(size_t _Size, PCPLACEMENT_NEW_ALLOCATION_CONTEXT AllocationContext) +{ + if (_Size <= AllocationContext->cbMaxSize) + { + RtlZeroMemory(AllocationContext->pbBuffer, _Size); + return AllocationContext->pbBuffer; + } + WFCError( + "Placement operator new called with insufficient buffer space (desired: %Iu, availible: %Iu)", _Size, AllocationContext->cbMaxSize); + return nullptr; +} + +void* __cdecl operator new(size_t Size) noexcept +{ + return AllocateWdfMemoryBuffer(Size, _ReturnAddress()); +} + +__forceinline void* __cdecl operator new(size_t _Size, ULONG_PTR AllocationContext) noexcept // for WIFICX TLV +{ + if (AllocationContext != 0) + { + return PlacementNewHelper(_Size, (PPLACEMENT_NEW_ALLOCATION_CONTEXT)AllocationContext); + } + return AllocateWdfMemoryBuffer(_Size, _ReturnAddress()); +} + +void __cdecl operator delete(void* pData) noexcept +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete[](void* pData) noexcept +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete(void* pData, ULONG_PTR) noexcept // For WIFICX TLV +{ + FreeWdfMemoryBuffer(pData); +} + +void __cdecl operator delete[](void* pData, ULONG_PTR) noexcept // For WIFICX TLV +{ + FreeWdfMemoryBuffer(pData); +} \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/precomp.h b/network/wlan/wificx/drivercode/precomp.h new file mode 100644 index 00000000..1b0f808e --- /dev/null +++ b/network/wlan/wificx/drivercode/precomp.h @@ -0,0 +1,33 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +#ifdef _KERNEL_MODE + #include +#else + #include + #include // For NDIS_STATUS + #include // For NDIS_STATUS codes + #include +#endif +// WDF Headers +#include + +// Network Device Headers +#include +#include + +// WIFI Device Headers +#include +#include "umkmfusion.h" +#include "dot11wificxintf.h" +#include "dot11wificxtypes.hpp" +#include "TLVGeneratorParser.hpp" +#include "SharedTypes.h" + +// WPP Tracing Headers +#include "trace.h" + +// Minimal placement-new to match operator new(size_t, void*) +// TLV generator/parser memory interface has the ULONG_PTR version +inline void* operator new(size_t, void* p) noexcept { return p; } +inline void operator delete(void*, void*) noexcept { /* no-op */ } diff --git a/network/wlan/wificx/drivercode/trace.h b/network/wlan/wificx/drivercode/trace.h new file mode 100644 index 00000000..324e1c87 --- /dev/null +++ b/network/wlan/wificx/drivercode/trace.h @@ -0,0 +1,183 @@ +// +// Copyright (C) Microsoft. All rights reserved. +// +#pragma once +#ifndef TRACE_H +#define TRACE_H + +#define WPP_USE_TRACE_LEVELS + +// 21BA7B61-05F8-41F1-9048-C09493DCFE38 +#define WPP_CONTROL_GUIDS \ + WPP_DEFINE_CONTROL_GUID(WdiLibraryCtlGuid, (21BA7B61, 05F8, 41F1, 9048, C09493DCFE38), WPP_DEFINE_BIT(DUMMY)) + +//#define WPP_LEVEL_EXP_ENABLED(LEVEL, EXP) WPP_LEVEL_ENABLED(LEVEL) +//#define WPP_LEVEL_EXP_LOGGER(LEVEL, EXP) WPP_LEVEL_LOGGER(LEVEL) + + +#define WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags) WPP_CONTROL(WPP_BIT_##flags).AutoLogContext, lvl, WPP_BIT_##flags +#define WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags) \ + (WPP_LEVEL_ENABLED(lvl) || lvl < TRACE_LEVEL_VERBOSE || WPP_CONTROL(WPP_BIT_##flags).AutoLogVerboseEnabled) + +#define WPP_RECORDER_LEVEL_ARGS(LEVEL) WPP_RECORDER_LEVEL_FLAGS_ARGS(LEVEL, DUMMY) +#define WPP_RECORDER_LEVEL_FILTER(LEVEL) WPP_RECORDER_LEVEL_FLAGS_FILTER(LEVEL, DUMMY) + +#define WPP_RECORDER_LEVEL_EXP_FILTER(LEVEL, EXP) WPP_RECORDER_LEVEL_FILTER(LEVEL) +#define WPP_RECORDER_LEVEL_EXP_ARGS(LEVEL, EXP) WPP_RECORDER_LEVEL_ARGS(LEVEL) + +// Suppress warnings about constants in logical expressions because the +// level is often a constant +#define WPP_LEVEL_PRE(LEVEL) __pragma(warning(suppress : 25039 25040)) +#define WPP_LEVEL_EXP_PRE(LEVEL, EXP) __pragma(warning(suppress : 25039 25040)) + +#define TraceEntry(...) +#define TraceExit(Status) +#define WFCTrace(Format, ...) +#define WFCError(Format, ...) +#define WFCInfo(Format, ...) + +// begin_wpp config +// USEPREFIX (TraceEntry, "%!STDPREFIX!"); +// FUNC TraceEntry{LEVEL=TRACE_LEVEL_VERBOSE}(...); +// USESUFFIX (TraceEntry, "--> %!FUNC!"); +// end_wpp + +// begin_wpp config +// USEPREFIX (TraceExit, "%!STDPREFIX!"); +// FUNC TraceExit{LEVEL=TRACE_LEVEL_VERBOSE}(EXP); +// USESUFFIX (TraceExit, "<-- %!FUNC!: 0x%x", EXP); +// end_wpp + +// +// Flat-C trace commands +// +// begin_wpp config +// +// USEPREFIX (WFCError, "%!STDPREFIX! %!FUNC!: [ERROR]"); +// FUNC WFCError{LEVEL=TRACE_LEVEL_ERROR}(MSG, ...); +// +// USEPREFIX (WFCInfo, "%!STDPREFIX! %!FUNC!: [INFO]"); +// FUNC WFCInfo{LEVEL=TRACE_LEVEL_INFORMATION}(MSG, ...); +// +// USEPREFIX (WFCTrace, "%!STDPREFIX! %!FUNC!: [TRACE]"); +// FUNC WFCTrace{LEVEL=TRACE_LEVEL_VERBOSE}(MSG, ...); +// +// end_wpp +// + +#define MACRO_START \ + do \ + { +#define MACRO_END \ + } \ + while (0) + +// +// WPP Macros: WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG +// +// begin_wpp config +// FUNC WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(NTEXPR,MSG,...); +// USEPREFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); +// USESUFFIX (WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG, " [status=%!STATUS!]", nt__wpp); +// end_wpp + +#define WPP_COMPNAME_LEVEL_NTEXPR_PRE(comp, level, ntexpr) \ + MACRO_START NTSTATUS nt__wpp = (ntexpr); \ + if (!NT_SUCCESS(nt__wpp)) \ + { +#define WPP_COMPNAME_LEVEL_NTEXPR_POST(comp, level, ntexpr) \ + ; \ + return nt__wpp; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_FILTER(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_NTEXPR_ARGS(comp, level, ntexpr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +// +// WPP Macros: WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG +// +// begin_wpp config +// FUNC WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR2,MSG,...); +// USEPREFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); +// USESUFFIX (WX_RETURN_INSUFFICIENT_RESOURCES_IF_NULL_MSG, "%!s! is null", #PTR2); +// end_wpp + +#define WPP_COMPNAME_LEVEL_PTR2_PRE(comp, level, ptr) \ + MACRO_START if ((ptr == nullptr)) \ + { +#define WPP_COMPNAME_LEVEL_PTR2_POST(comp, level, ptr) \ + ; \ + return STATUS_INSUFFICIENT_RESOURCES; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_PTR2_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +// +// WPP Macros: WX_RETURN_IF_NULL_MSG +// +// begin_wpp config +// FUNC WX_RETURN_IF_NULL_MSG{COMPNAME=DUMMY,LEVEL=TRACE_LEVEL_ERROR}(PTR3,MSG,...); +// USEPREFIX (WX_RETURN_IF_NULL_MSG, "%!STDPREFIX! !! WifiIhv - %!FUNC!: "); +// USESUFFIX (WX_RETURN_IF_NULL_MSG, "%!s! is null", #PTR3); +// end_wpp + +#define WPP_COMPNAME_LEVEL_PTR3_PRE(comp, level, ptr) \ + MACRO_START if ((ptr == nullptr)) \ + { +#define WPP_COMPNAME_LEVEL_PTR3_POST(comp, level, ptr) \ + ; \ + return; \ + } \ + MACRO_END +#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_FILTER(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_FILTER(level, comp) +#define WPP_RECORDER_COMPNAME_LEVEL_PTR3_ARGS(comp, level, ptr) WPP_RECORDER_LEVEL_FLAGS_ARGS(level, comp) + +typedef struct _ByteArray +{ + USHORT usLength; + const void* pvBuffer; +} ByteArray; + +__inline ByteArray log_lenstr(ULONG len, const void* buf) +{ + ByteArray xs{}; + xs.usLength = (USHORT)len; + xs.pvBuffer = buf; + return xs; +} + +#define WPP_LOGHEXDUMP(x) \ + WPP_LOGPAIR(2, &((x).usLength)) \ + WPP_LOGPAIR((x).usLength, (x).pvBuffer) + +#define WPP_LOGANSISTRING(x) \ + WPP_LOGPAIR(2, &((x).usLength)) \ + WPP_LOGPAIR((x).usLength, (x).pvBuffer) + +#define WPP_LOGMACADDR(x) WPP_LOGPAIR(6, x) + +#define WPP_LOGDOT11SSID(x) \ + WPP_LOGPAIR(2, &((*(x)).uSSIDLength)) \ + WPP_LOGPAIR((*(x)).uSSIDLength, ((const char*)(*(x)).ucSSID)) + +// +// Custom types +// +// begin_wpp config +// +// DEFINE_CPLX_TYPE(HEXDUMP, WPP_LOGHEXDUMP, ByteArray, ItemHEXDump,"s", _HEX_, 0,2); +// WPP_FLAGS(-DLOG_HEXDUMP(len,str)=log_lenstr(len,str)); +// +// DEFINE_CPLX_TYPE(ANSISTRING, WPP_LOGANSISTRING, ByteArray, ItemPString,"s", _SSID_, 0,2); +// WPP_FLAGS(-DLOG_ANSISTRING(len,str)=log_lenstr(len,str)); +// +// DEFINE_CPLX_TYPE(DOT11SSID, WPP_LOGDOT11SSID, DOT11_SSID*, ItemPString,"s", _SSID_, 0,2); +// +// DEFINE_CPLX_TYPE(MACADDR, WPP_LOGMACADDR, DOT11_MAC_ADDRESS, ItemMACAddr,"s", _MAC_, 0); +// +// CUSTOM_TYPE(MESSAGE_ID, ItemEnum(WDI_TLV::ENUMS::MESSAGE_ID)); +// end_wpp +// + +#endif diff --git a/network/wlan/wificx/drivercode/umkmfusion.h b/network/wlan/wificx/drivercode/umkmfusion.h new file mode 100644 index 00000000..8f0db3f8 --- /dev/null +++ b/network/wlan/wificx/drivercode/umkmfusion.h @@ -0,0 +1,131 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "precomp.h" + +#include "winerror.h" + +#ifdef _KERNEL_MODE +#include "ntintsafe.h" +#else +#include "intsafe.h" +#endif + +namespace Wifi +{ + _inline + NTSTATUS ConvertHRESULTToNTSTATUS(HRESULT hr) { + if ((hr & FACILITY_NT_BIT) == FACILITY_NT_BIT) { + return static_cast(hr & ~FACILITY_NT_BIT); // Strip NT bit safely + } + + // Trace the HRESULT value for diagnostics + return SUCCEEDED(hr) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + } + + __inline + NTSTATUS ConvertNDISSTATUSToNTSTATUS(NDIS_STATUS NdisStatus) + { + if (NT_SUCCESS(NdisStatus) && NdisStatus != NDIS_STATUS_SUCCESS && NdisStatus != NDIS_STATUS_PENDING && + NdisStatus != NDIS_STATUS_INDICATION_REQUIRED) + { + // Case where an NDIS error is incorrectly mapped as a success by NT_SUCCESS macro + return STATUS_UNSUCCESSFUL; + } + else + { + switch (NdisStatus) + { + case NDIS_STATUS_BUFFER_TOO_SHORT: + return STATUS_BUFFER_TOO_SMALL; + break; + default: + return (NTSTATUS)NdisStatus; + break; + } + } + } + + __inline + NDIS_STATUS ConvertNTSTATUSToNDISSTATUS(NTSTATUS NtStatus) + { + if (NT_SUCCESS(NtStatus) && NtStatus != STATUS_PENDING && NtStatus != STATUS_NDIS_INDICATION_REQUIRED) + { + return NDIS_STATUS_SUCCESS; + } + else + { + switch (NtStatus) + { + case STATUS_BUFFER_TOO_SMALL: + return NDIS_STATUS_BUFFER_TOO_SHORT; + break; + default: + return (NDIS_STATUS)NtStatus; + break; + } + } + } + + _Must_inspect_result_ + _inline + NTSTATUS SizeTAddSafe(_In_ size_t Augend, _In_ size_t Addend, _Out_ _Deref_out_range_(== , Augend + Addend) size_t* pResult) + { +#ifdef _KERNEL_MODE + return RtlSizeTAdd(Augend, Addend, pResult); +#else + return ConvertHRESULTToNTSTATUS(SizeTAdd(Augend, Addend, pResult)); +#endif + } + + _Must_inspect_result_ + __inline + NTSTATUS ULongPtrAddSafe( + _In_ ULONGLONG ullAugend, + _In_ ULONGLONG ullAddend, + _Out_ _Deref_out_range_(== , ullAugend + ullAddend) ULONGLONG* pullResult) + { +#ifdef _KERNEL_MODE + return RtlULongPtrAdd(ullAugend, ullAddend, pullResult); +#else + return ConvertHRESULTToNTSTATUS(ULongPtrAdd(ullAugend, ullAddend, pullResult)); +#endif + } + + _Must_inspect_result_ + __inline + NTSTATUS ULongPtrSubSafe( + _In_ ULONGLONG ullMinuend, + _In_ ULONGLONG ullSubtrahend, + _Out_ _Deref_out_range_(== , ullMinuend - ullSubtrahend) ULONGLONG* pullResult) + { +#ifdef _KERNEL_MODE + return RtlULongPtrSub(ullMinuend, ullSubtrahend, pullResult); +#else + return ConvertHRESULTToNTSTATUS(ULongPtrSub(ullMinuend, ullSubtrahend, pullResult)); +#endif + } +} + +#ifndef _KERNEL_MODE +// TODO: Cleanup when EWDK contains the payload of https://microsoft.visualstudio.com/OS/_workitems/edit/58447986 +typedef enum _NDIS_FRAME_HEADER +{ + NdisFrameHeaderUndefined, + NdisFrameHeaderMac, + NdisFrameHeaderArp, + NdisFrameHeaderIPv4, + NdisFrameHeaderIPv6, + NdisFrameHeaderUdp, + NdisFrameHeaderMaximum +}NDIS_FRAME_HEADER, * PNDIS_FRAME_HEADER; + +typedef enum _NDIS_RECEIVE_FILTER_TEST +{ + NdisReceiveFilterTestUndefined, + NdisReceiveFilterTestEqual, + NdisReceiveFilterTestMaskEqual, + NdisReceiveFilterTestNotEqual, + NdisReceiveFilterTestMaximum +}NDIS_RECEIVE_FILTER_TEST, * PNDIS_RECEIVE_FILTER_TEST; +// End of TODO +#endif // !_KERNEL_MODE \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/wifihal.cpp b/network/wlan/wificx/drivercode/wifihal.cpp new file mode 100644 index 00000000..fead61b3 --- /dev/null +++ b/network/wlan/wificx/drivercode/wifihal.cpp @@ -0,0 +1,984 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#include "precomp.h" +#include "wifirequest.h" +#include "wifiHALtestdata.h" +#include "WifiHal.h" +#include "WifiHal.tmh" + +_Use_decl_annotations_ +NTSTATUS WifiHAL::_Create(WDFDEVICE Device) +{ + // Download firmware, initialize hardware, etc. + + // Create WifiHAL object and associate it with Device context after FW ready + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, WifiHAL); + attributes.EvtCleanupCallback = WifiHAL::_OnCleanup; + + void* memory = nullptr; + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WdfObjectAllocateContext(Device, &attributes, &memory), "Failed to allocate WifiHAL context. Device=%p", Device); + + // Obtain the context and initialize it + auto* wifiHal = reinterpret_cast(memory); + wifiHal->Initialize(Device, &WifiGetIhvDeviceContext(Device)->TlvContext); + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + wifiHal->WifiIhvSetDeviceCapabilities(), + "Failed to set device capabilities. Device=%p", Device); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +void WifiHAL::_OnCleanup(WDFOBJECT Object) +{ + UNREFERENCED_PARAMETER(Object); +} + +_Use_decl_annotations_ +void WifiHAL::Initialize(WDFDEVICE Device, PCTLV_CONTEXT TlvContext) +{ + m_Device = Device; + m_TlvContext = TlvContext; + m_CurrentRadioState = 1; // On by default + m_LastConnectEntryId = 0; + m_LastConnectTransactionId = 0; + m_LastAuthAlgo = WDI_AUTH_ALGO_UNKNOWN; + RtlZeroMemory(&m_ConnectedPeer, sizeof(m_ConnectedPeer)); + // Initialize link addresses and supported bands (previously in-class const init) + m_LocalLinkAddresses[0] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x21 }; + m_LocalLinkAddresses[1] = { 0x11, 0x01, 0x02, 0x03, 0x04, 0x22 }; + m_SupportedBands = (WDI_BAND_ID_2400 | WDI_BAND_ID_5000 | WDI_BAND_ID_6000); +} + +NTSTATUS WifiHAL::WifiIhvIsDeviceReadyForRequest() +{ + NTSTATUS status = + ((m_Device != WDF_NO_HANDLE) // Make sure device is initialized (since this is hardware abstraction layer, IHV can replace with firmware state) + && (WifiGetIhvDeviceContext(m_Device)->netAdapters[0] != WDF_NO_HANDLE) ? STATUS_SUCCESS : STATUS_DEVICE_NOT_READY);// In WIFICX, the logic sits on top of primary STA adapter, make sure it is initialized + if(NT_SUCCESS(status) == FALSE) + { + WFCError( + "Device not ready for request. Device=%p, primaryStaAdapter=%p", + m_Device, + (m_Device != WDF_NO_HANDLE) ? WifiGetIhvDeviceContext(m_Device)->netAdapters[0] : WDF_NO_HANDLE); + } + return status; +} + +NTSTATUS WifiHAL::WifiIhvGetPendingTransitionStatus() +{ + return m_LastConnectTransactionId ==0 ? STATUS_SUCCESS : STATUS_PENDING; +} + +NTSTATUS WifiHAL::WifiIhvSetDeviceCapabilities() +{ + WIFI_DEVICE_CAPABILITIES deviceCaps = {}; + WIFI_DEVICE_CAPABILITIES_INIT(&deviceCaps); + + deviceCaps.HardwareRadioState = TRUE; + deviceCaps.SoftwareRadioState = TRUE; + RtlCopyMemory(deviceCaps.FirmwareVersion, "1.0.0", sizeof("1.0.0")); + deviceCaps.ActionFramesSupported = TRUE; + deviceCaps.NumRxStreams = 1; + deviceCaps.NumTxStreams = 1; + deviceCaps.Support_eCSA = FALSE; + deviceCaps.MACAddressRandomization = FALSE; + deviceCaps.MACAddressRandomizationMask.Address[0] = 0; + deviceCaps.MACAddressRandomizationMask.Address[1] = 0; + deviceCaps.MACAddressRandomizationMask.Address[2] = 0; + deviceCaps.MACAddressRandomizationMask.Address[3] = 0xFF; + deviceCaps.MACAddressRandomizationMask.Address[4] = 0; + deviceCaps.MACAddressRandomizationMask.Address[5] = 0; + deviceCaps.BluetoothCoexistenceSupport = WDI_BLUETOOTH_COEXISTENCE_PERFORMANCE_MAINTAINED; + deviceCaps.SupportsNonWdiOidRequests = FALSE; + deviceCaps.FastTransitionSupported = TRUE; + deviceCaps.MU_MIMOSupported = FALSE; + deviceCaps.SAEAuthenticationSupported = TRUE; + deviceCaps.BSSTransitionSupported = TRUE; + deviceCaps.MBOSupported = FALSE; + deviceCaps.BeaconReportsImplemented = FALSE; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetDeviceCapabilities(m_Device, &deviceCaps), + "Failed to set device capabilities"); + + WIFI_STATION_CAPABILITIES StationCaps = {}; + WIFI_STATION_CAPABILITIES_INIT(&StationCaps); + + StationCaps.ScanSSIDListSize = 4; + StationCaps.DesiredSSIDListSize = 1; + StationCaps.PrivacyExemptionListSize = 1; + StationCaps.KeyMappingTableSize = 32; + StationCaps.DefaultKeyTableSize = 4; + StationCaps.WEPKeyValueMaxLength = 0x20; + StationCaps.MaxNumPerSTA = 4; + StationCaps.SupportedQOSFlags = 0; + StationCaps.HostFIPSModeImplemented = FALSE; + StationCaps.MFPCapable = TRUE; + StationCaps.AutoPowerSaveMode = FALSE; + StationCaps.BSSListCachemanagement = FALSE; + StationCaps.ConnectBSSSelectionOverride = FALSE; + StationCaps.MaxNetworkOffloadListSize = 0; + StationCaps.HESSIDConnectionSupported = FALSE; + StationCaps.FTMAsInitiatorSupport = FALSE; + StationCaps.FTMNumberOfSupportedTargets = 0; + + const DOT11_AUTH_CIPHER_PAIR UnicastAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_WEP}, + {DOT11_AUTH_ALGO_WPA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_TKIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_CCMP}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_GCMP_256}, + {DOT11_AUTH_ALGO_OWE, DOT11_CIPHER_ALGO_CCMP}, + }; + + const DOT11_AUTH_CIPHER_PAIR McastMgmtAlgos[] = { + {DOT11_AUTH_ALGO_80211_OPEN, DOT11_CIPHER_ALGO_NONE}, + {DOT11_AUTH_ALGO_RSNA, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_RSNA_PSK, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_SAE, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT, DOT11_CIPHER_ALGO_BIP}, + {DOT11_AUTH_ALGO_WPA3_ENT_192, DOT11_CIPHER_ALGO_BIP_GMAC_256}, + }; + + StationCaps.NumSupportedUnicastAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.UnicastAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastDataAlgorithms = ARRAYSIZE(UnicastAlgos); + StationCaps.MulticastDataAlgorithmsList = const_cast(UnicastAlgos); + StationCaps.NumSupportedMulticastMgmtAlgorithms = ARRAYSIZE(McastMgmtAlgos); + StationCaps.MulticastMgmtAlgorithmsList = const_cast(McastMgmtAlgos); + + WIFI_STA_BANDS_COMBINATION SecondaryStaBandsCombinations[] = { + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_2400, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {2, {WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN, WDI_BAND_ID_UNKNOWN}}, + {3, {WDI_BAND_ID_2400, WDI_BAND_ID_5000, WDI_BAND_ID_6000, WDI_BAND_ID_UNKNOWN}}, + }; + + StationCaps.NumSecondaryStaBandCombinations = ARRAYSIZE(SecondaryStaBandsCombinations); + StationCaps.SecondaryStaBandsCombinations = SecondaryStaBandsCombinations; + + WDI_MAC_ADDRESS MLOAddresses[] = { + {0x11, 0x01, 0x02, 0x03, 0x04, 0x21}, + {0x11, 0x01, 0x02, 0x03, 0x04, 0x22}, + }; + StationCaps.MaxMLOLinksSupported = ARRAYSIZE(MLOAddresses); + StationCaps.MLOAddressesList = MLOAddresses; + + RSNA_AKM_SUITE AkmsList[] = { + rsna_akm_1x, + rsna_akm_psk, + rsna_akm_ft_1x_sha256, + rsna_akm_ft_psk_sha256, + rsna_akm_1x_sha256, + rsna_akm_psk_sha256, + rsna_akm_sae_pmk256, + rsna_akm_1x_suite_b_sha384, + rsna_akm_owe, + rsna_akm_1x_sha384, + rsna_akm_sae_pmk384, + }; + StationCaps.NumAkmsSupported = ARRAYSIZE(AkmsList); + StationCaps.AkmsList = AkmsList; + + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, MSCSSupported)) + { + StationCaps.MSCSSupported = true; + } + if (WIFI_IS_FIELD_AVAILABLE(WIFI_STATION_CAPABILITIES, DSCPToUPMappingSupported)) + { + StationCaps.DSCPToUPMappingSupported = true; + } + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetStationCapabilities(m_Device, &StationCaps), + "Failed to set station capabilities"); + + WIFI_BAND_CAPABILITIES BandCaps = {}; + WIFI_BAND_CAPABILITIES_INIT(&BandCaps); + + const WDI_PHY_TYPE Phy24GHz[] = { WDI_PHY_TYPE_ERP, WDI_PHY_TYPE_HE }; // g, ax + const WDI_PHY_TYPE Phy5GHz[] = { WDI_PHY_TYPE_OFDM, WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // a, ax, be + const WDI_PHY_TYPE Phy6GHz[] = { WDI_PHY_TYPE_HE, WDI_PHY_TYPE_EHT }; // ax, be + const WDI_PHY_TYPE pPhy60GHz[] = { WDI_PHY_TYPE_DMG }; // ad + const WDI_PHY_TYPE phyIHV[2] = { WDI_PHY_TYPE_OFDM, static_cast(WDI_PHY_TYPE_IHV_START + 1) }; + + // clang-format off + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap24[] = { + {1, 2412}, + {2, 2417}, + {3, 2422}, + {4, 2427}, + {5, 2432}, + {6, 2437}, + {7, 2442}, + {8, 2447}, + {9, 2452}, + {10, 2457}, + {11, 2462}, + {12, 2467}, // Not used in US + {13, 2472}, // Not used in US + {14, 2484}, // Allowed in Japan only + }; + + const WDI_CHANNEL_MAPPING_ENTRY ChannelMap5[] = { + {7, 5035}, // Not used in US + {8, 5040}, // Not used in US + {9, 5045}, // Not used in US + {11, 5055}, // Not used in US + {12, 5060}, // Not used in US + {16, 5080}, // Not used in US + {32, 5160}, // Unknown status + {34, 5170}, // Not used in US + {36, 5180}, + {38, 5190}, + {40, 5200}, + {42, 5210}, + {44, 5220}, + {46, 5230}, + {48, 5240}, + {50, 5250}, // DFS + {52, 5260}, // DFS + {54, 5270}, // DFS + {56, 5280}, // DFS + {58, 5290}, // DFS + {60, 5300}, // DFS + {62, 5310}, // DFS + {64, 5320}, // DFS + {68, 5340}, // Unknown status + {96, 5480}, // Unknown status + {100, 5500}, // DFS + {102, 5510}, // DFS + {104, 5520}, // DFS + {106, 5530}, // DFS + {108, 5540}, // DFS + {110, 5550}, // DFS + {112, 5560}, // DFS + {114, 5570}, // DFS + {116, 5580}, // DFS + {118, 5590}, // DFS + {120, 5600}, // DFS + {122, 5610}, // DFS + {124, 5620}, // DFS + {126, 5630}, // DFS + {128, 5640}, // DFS + {132, 5660}, // DFS + {134, 5670}, // DFS + {136, 5680}, // DFS + {138, 5690}, // DFS + {140, 5700}, // DFS + {142, 5710}, // DFS + {142, 5720}, // DFS + {144, 5730}, // DFS + {149, 5745}, + {151, 5755}, + {153, 5765}, + {155, 5785}, + {157, 5785}, + {159, 5795}, + {161, 5805}, + {165, 5825}, + {169, 5845}, // Not used in US + {173, 5865}, // Not used in US + {183, 4915}, // Not used in US + {184, 4920}, // Not used in US + {185, 4925}, // Not used in US + {187, 4935}, // Not used in US + {188, 4940}, // Not used in US + {189, 4945}, // Not used in US + {192, 4960}, // Not used in US + {196, 4980}, // Not used in US + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap6[] = { + {1, 5955}, + {5, 5975}, // PSC Channel (1) + {9, 5995}, + + {13, 6015}, + {17, 6035}, + {21, 6055}, // PSC Channel (2) + {25, 6075}, + {29, 6095}, + + {33, 6115}, + {37, 6135}, // PSC Channel (3) + {41, 6155}, + {45, 6175}, + {49, 6195}, + + {53, 6215}, // PSC Channel (4) + {57, 6235}, + {61, 6255}, + {65, 6275}, + {69, 6295}, // PSC Channel (5) + + {73, 6315}, + {77, 6335}, + {81, 6355}, + {85, 6375}, // PSC Channel (6) + {89, 6395}, + + {93, 6415}, + {97, 6435}, + {101, 6455}, // PSC Channel (7) + {105, 6475}, + {109, 6495}, + + {113, 6515}, + {117, 6535}, // PSC Channel (8) + {121, 6555}, + {125, 6575}, + {129, 6595}, + + {133, 6615}, // PSC Channel (9) + {137, 6635}, + {141, 6655}, + {145, 6675}, + {149, 6695}, // PSC Channel (10) + + {153, 6715}, + {157, 6735}, + {161, 6755}, + {165, 6775}, // PSC Channel (11) + {169, 6795}, + + {173, 6815}, + {177, 6835}, + {181, 6855}, // PSC Channel (12) + {185, 6875}, + {189, 6895}, + + {193, 6915}, + {197, 6935}, // PSC Channel (13) + {201, 6955}, + {205, 6975}, + {209, 6995}, + + {213, 7015}, // PSC Channel (14) + {217, 7035}, + {221, 7055}, + {225, 7075}, + {229, 7095}, // PSC Channel (15) + + {233, 7115}, + {237, 7135}, + {241, 7155}, + {245, 7175}, + {249, 7195}, + + {253, 7215}, + }; + + const WDI_CHANNEL_MAPPING_ENTRY channelMap60[] = { + {1, 58320}, + {2, 60480}, + {3, 62640}, + {4, 64800}, + {5, 66960}, + {6, 69120}, + }; + + // clang-format on + + UINT32 ChannelWidth10Mhz = 10; + UINT32 ChannelWidth20Mhz = 20; + UINT32 channelWidth2160Mhz = 2160; + UINT32 pChannelWidth6Ghz[] = { 20, 40, 80, 160, 320 }; + + WIFI_BAND_INFO BandInfo[4] = {}; // Upto 4 bands + UINT32 bandInfoCount = 0; + + if (m_SupportedBands & WDI_BAND_ID_2400) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_2400; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy24GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy24GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap24); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap24); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth10Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 1); + + if (m_SupportedBands & WDI_BAND_ID_5000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_5000; + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy5GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy5GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(ChannelMap5); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(ChannelMap5); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &ChannelWidth20Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 2); + + if (m_SupportedBands & WDI_BAND_ID_6000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_6000; // 6 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(Phy6GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(Phy6GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap6); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap6); + BandInfo[bandInfoCount].NumChannelWidths = ARRAYSIZE(pChannelWidth6Ghz); + BandInfo[bandInfoCount].ChannelWidthList = pChannelWidth6Ghz; + bandInfoCount++; + } + + NT_ASSERT(bandInfoCount <= 3); + if (m_SupportedBands & WDI_BAND_ID_60000) + { + BandInfo[bandInfoCount].BandID = WDI_BAND_ID_60000; // 60 + BandInfo[bandInfoCount].BandState = TRUE; + BandInfo[bandInfoCount].NumValidPhyTypes = ARRAYSIZE(pPhy60GHz); + BandInfo[bandInfoCount].ValidPhyTypeList = const_cast(pPhy60GHz); + BandInfo[bandInfoCount].NumValidChannelTypes = ARRAYSIZE(channelMap60); + BandInfo[bandInfoCount].ValidChannelTypes = const_cast(channelMap60); + BandInfo[bandInfoCount].NumChannelWidths = 1; + BandInfo[bandInfoCount].ChannelWidthList = &channelWidth2160Mhz; + bandInfoCount++; + } + NT_ASSERT(bandInfoCount <= 4); + + BandCaps.NumBands = bandInfoCount; + BandCaps.BandInfoList = BandInfo; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetBandCapabilities(m_Device, &BandCaps), + "Failed to set band capabilities"); + + WIFI_PHY_CAPABILITIES PhyCaps = {}; + WIFI_PHY_CAPABILITIES_INIT(&PhyCaps); + + WIFI_PHY_INFO PhyInfoList[3]; + + const WDI_DATA_RATE_ENTRY DataRateListErp[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 4}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 22}, + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListOfdm[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + const WDI_DATA_RATE_ENTRY DataRateListEht[] = { + {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 2}, {WDI_DATA_RATE_RX_RATE | WDI_DATA_RATE_TX_RATE, 108} }; + + PhyInfoList[0].PhyType = WDI_PHY_TYPE_ERP; + PhyInfoList[0].NumberDataRateEntries = ARRAYSIZE(DataRateListErp); + RtlCopyMemory(&PhyInfoList[0].DataRateList, &DataRateListErp, sizeof(DataRateListErp)); + + PhyInfoList[1].PhyType = WDI_PHY_TYPE_HE; + PhyInfoList[1].NumberDataRateEntries = ARRAYSIZE(DataRateListOfdm); + RtlCopyMemory(&PhyInfoList[1].DataRateList, &DataRateListOfdm, sizeof(DataRateListOfdm)); + + PhyInfoList[2].PhyType = WDI_PHY_TYPE_EHT; + PhyInfoList[2].NumberDataRateEntries = ARRAYSIZE(DataRateListEht); + RtlCopyMemory(&PhyInfoList[2].DataRateList, &DataRateListEht, sizeof(DataRateListEht)); + + PhyCaps.NumPhyTypes = ARRAYSIZE(PhyInfoList); + PhyCaps.PhyInfoList = PhyInfoList; + + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG( + WifiDeviceSetPhyCapabilities(m_Device, &PhyCaps), + "Failed to set PHY capabilities"); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvReset(const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, const PWDI_MESSAGE_HEADER, UINT) +{ + if (0 == ResetParameters.Optional.ResetMACAddress_IsPresent) + { + WFCTrace("DOT11 Reset, set default MIB = %d, no MAC Address specified\n", ResetParameters.Dot11ResetParameters.SetDefaultMIB); + } + else + { + WFCTrace( + "DOT11 Reset, set default MIB = %d, MAC Address = %2x:%2x:%2x:%2x:%2x:%2x\n", + ResetParameters.Dot11ResetParameters.SetDefaultMIB, + ResetParameters.ResetMACAddress.Address[0], + ResetParameters.ResetMACAddress.Address[1], + ResetParameters.ResetMACAddress.Address[2], + ResetParameters.ResetMACAddress.Address[3], + ResetParameters.ResetMACAddress.Address[4], + ResetParameters.ResetMACAddress.Address[5]); + } + + // Reset the connection ID in case the previous connection attempt did not complete + m_LastConnectEntryId = 0; + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvSetRadioState(const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) +{ + WFCInfo("Setting OS requested Radio State: SoftwareRadioState=%u\n", RadioState.SoftwareRadioState); + if (RadioState.SoftwareRadioState != m_CurrentRadioState) + { + // Change the radio state + m_CurrentRadioState = RadioState.SoftwareRadioState; + + // Send the radio state indication + WDI_INDICATION_RADIO_STATUS_PARAMETERS RadioStatusParams = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RadioStatusParams.RadioState.HardwareState = TRUE; + RadioStatusParams.RadioState.SoftwareState = m_CurrentRadioState; + if (GenerateWdiIndicationRadioStatus(&RadioStatusParams, 0, m_TlvContext, &cbOutput, &pOutput) == NDIS_STATUS_SUCCESS) + { + WFCInfo("Indicate OS with Radio State: SoftwareRadioState=%u\n", m_CurrentRadioState); + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_RADIO_STATUS, pOutput, cbOutput); + FreeGenerated(pOutput); + } + } + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvScan(const WDI_SCAN_PARAMETERS& ScanParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) +{ + for (UINT8 connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (m_SupportedBands & g_ConnectEntries[connectEntry].BandId) + { + PUCHAR pBssEntry = g_ConnectEntries[connectEntry].pTlvBssEntry; + // + // If currently connected, see if the connected entry should be skipped + // + if ((m_LastConnectEntryId != 0) && + (RtlCompareMemory(&m_ConnectedPeer, &pBssEntry[8], sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS))) + { + // Already connected, don't report this entry + continue; + } + + // TODO: Skip the IHV band as it is not being reported in capabilities + if (g_ConnectEntries[connectEntry].BandId == TESTMP_BAND_IHV) + { + continue; + } + + // Send the BSS entry indication + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, + pWdiHeader, + WDI_INDICATION_BSS_ENTRY_LIST, + g_ConnectEntries[connectEntry].pTlvBssEntry, + g_ConnectEntries[connectEntry].TlvBssEntrySize); + } + } + + // + // See if the hidden network needs to be indicated + // + if ((ScanParameters.SSIDList.ElementCount > 0) && (ScanParameters.SSIDList.pElements[0].ElementCount == 8) && + (ScanParameters.SSIDList.pElements[0].pElements[4] == 'H') && (ScanParameters.SSIDList.pElements[0].pElements[5] == 'I') && + (ScanParameters.SSIDList.pElements[0].pElements[6] == 'D') && (ScanParameters.SSIDList.pElements[0].pElements[7] == 'E')) + { + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, pWdiHeader, WDI_INDICATION_BSS_ENTRY_LIST, s_TLV_BSS_Entry_ProbeResponse_8_Hidden, sizeof(s_TLV_BSS_Entry_ProbeResponse_8_Hidden)); + } + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvConnect(const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) +{ + NT_ASSERT(m_LastConnectEntryId == 0); +#ifdef NETV_SUPPORT_TX_DEMUXING + if (m_LastConnectEntryId != 0) // Not Disconnected State + { + WifiAdapterRemovePeer( + WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], + reinterpret_cast(&m_ConnectedPeer)); + } +#endif //NETV_SUPPORT_TX_DEMUXING + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvPerformAssociation( + &ConnectParameters.PreferredBSSEntryList, &ConnectParameters.ConnectParameters.AuthenticationAlgorithms, pWdiHeader), + "Failed to perform association"); + + // + // WPA3-SAE requires the SAE Exchange, so do not complete the Connection request until the SAE exchange is complete + // + if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) + { + m_LastConnectTransactionId = pWdiHeader->TransactionId; + } + else + { + m_LastConnectTransactionId = 0; + } + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvSendLinkStateIndication(_In_ PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks) +{ + // Report link quality + NTSTATUS ntStatus = STATUS_SUCCESS; + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); + WDI_INDICATION_LINK_STATE_CHANGE_PARAMETERS linkStateChangeParameters = {}; + WDI_LINK_INFO_CONTAINER pLinkInfo[2] = {}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + RtlCopyMemory( + &linkStateChangeParameters.LinkStateChangeParameters.PeerMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + linkStateChangeParameters.LinkStateChangeParameters.TxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.RxLinkSpeed = 30000; + linkStateChangeParameters.LinkStateChangeParameters.LinkQuality = 56; + + // Default linkId for non-Mlo connections is 0 + pLinkInfo[0].LinkID = 0; + RtlCopyMemory(&pLinkInfo[0].LocalLinkMACAddress, &m_LocalLinkAddresses[0], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[0].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[0].ChannelNumber = 6; + pLinkInfo[0].BandId = WDI_BAND_ID_2400; + pLinkInfo[0].RSSI = -50; + pLinkInfo[0].Bandwidth = 40; + pLinkInfo[0].TxMCS = 3; + pLinkInfo[0].RxMCS = 4; + + if (numLinks > 1) + { + // For Mlo connections, set the link ID for the first link to 1 + pLinkInfo[0].LinkID = 1; + + pLinkInfo[1].LinkID = 2; + RtlCopyMemory(&pLinkInfo[1].LocalLinkMACAddress, &m_LocalLinkAddresses[1], sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&pLinkInfo[1].PeerLinkMACAddress, &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + pLinkInfo[1].ChannelNumber = 36; + pLinkInfo[1].BandId = WDI_BAND_ID_5000; + pLinkInfo[1].RSSI = -30; + pLinkInfo[1].Bandwidth = 160; + pLinkInfo[1].TxMCS = 8; + pLinkInfo[1].RxMCS = 9; + } + + linkStateChangeParameters.LinkInfo.pElements = pLinkInfo; + linkStateChangeParameters.LinkInfo.ElementCount = numLinks > 1 ? 2 : 1; + + ntStatus = GenerateWdiIndicationLinkStateChangeFromIhv(&linkStateChangeParameters, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (STATUS_SUCCESS == ntStatus) + { + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_LINK_STATE_CHANGE, pOutput, cbOutput); + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_LINK_STATE_CHANGE - 0x%08x\n", ntStatus); + } + + return ntStatus; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvPerformAssociation( + const struct ArrayOfElements* pPreferredBSSEntryList, + const struct ArrayOfElements* pAuthenticationAlgorithms, + const PWDI_MESSAGE_HEADER pWdiHeader) +{ + + ULONG bssIndex = 0; + ULONG connectEntry = ConnectEntryId_MAX; + NTSTATUS ntStatus = STATUS_SUCCESS; + UINT32 NewConnectEntryId = 0; // Disconnected State + WDI_AUTH_ALGORITHM NewAuthAlgo = pAuthenticationAlgorithms->pElements[0]; + UCHAR pucData[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10 }; + + PWIFI_IHV_DEVICE_CONTEXT pDeviceContext = WifiGetIhvDeviceContext(m_Device); + + ULONG assocStatus = WDI_ASSOC_STATUS_SUCCESS; + + do + { + // We search for the BSSID pattern to figure out what AP we are trying to connect to + for (bssIndex = 0; bssIndex < pPreferredBSSEntryList->ElementCount; bssIndex++) + { + for (connectEntry = 1; connectEntry < ConnectEntryId_MAX; connectEntry++) + { + if (RtlCompareMemory( + pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, + g_ConnectEntries[connectEntry].pMacAddress, + sizeof(DOT11_MAC_ADDRESS)) == sizeof(DOT11_MAC_ADDRESS)) + { + PUCHAR pAssociationResult = g_ConnectEntries[connectEntry].pTlvAssociationResult; + + NewConnectEntryId = connectEntry; + m_LastConnectTransactionId = pWdiHeader->TransactionId; +#ifdef NETV_SUPPORT_TX_DEMUXING + // add peer on datapath + WifiAdapterAddPeer(pDeviceContext->netAdapters[pWdiHeader->PortId], + reinterpret_cast(g_ConnectEntries[connectEntry].pMacAddress)); +#endif // NETV_SUPPORT_TX_DEMUXING +#ifdef WIFI_IHV_HANDSHAKE + // Pretend to recieve M1 on datapath before, the association complete has made it up the control path. + RecieveDatapathFrame(0x33, sizeof(pucData), pucData); +#endif // WIFI_IHV_HANDSHAKE + + if (NewAuthAlgo == WDI_AUTH_ALGO_WPA3_SAE) + { + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; + + // + // Handle special case for WPA3-SAE + // Send the Indication to request additonal SAE params + // + g_dwSaeResendConfirmRequested = 0; + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_REQUEST_PARAMS_NEEDED; + RtlCopyMemory( + SAEAuthParamsNeeded.BssId.Address, g_ConnectEntries[connectEntry].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + ndisStatus = GenerateWdiIndicationSaeAuthParamsNeeded( + &SAEAuthParamsNeeded, 0, &pDeviceContext->TlvContext, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WFCInfo("[SAE] Indicating request for COMMIT_REQUEST_PARAMS_NEEDED ..."); + + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); + + FreeGenerated(pOutput); + + break; + } + } + + // Get the assoc status + RtlCopyMemory(&assocStatus, &pAssociationResult[18], sizeof(ULONG)); + + // Send the association indication + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + g_ConnectEntries[connectEntry].pTlvAssociationResult, + g_ConnectEntries[connectEntry].TlvAssociationResultSize); + + break; + } + } + + // If we found a matching BSSID entry, we are done + if (connectEntry < ConnectEntryId_MAX) + { + break; + } + } + + } while (FALSE); + + if (WDI_ASSOC_STATUS_SUCCESS != assocStatus || 0 == NewConnectEntryId || bssIndex >= pPreferredBSSEntryList->ElementCount) + { + NewConnectEntryId = 0; // Disconnected State + NewAuthAlgo = WDI_AUTH_ALGO_80211_OPEN; + ntStatus = STATUS_UNSUCCESSFUL; + } + else + { + RtlCopyMemory(&m_ConnectedPeer, pPreferredBSSEntryList->pElements[bssIndex].BSSID.Address, sizeof(DOT11_MAC_ADDRESS)); + } + + m_LastConnectEntryId = NewConnectEntryId; + m_LastAuthAlgo = NewAuthAlgo; + + if (STATUS_SUCCESS == ntStatus && (WDI_AUTH_ALGO_WPA3_SAE != m_LastAuthAlgo)) + { + // Report link quality + ntStatus = WifiIhvSendLinkStateIndication(pWdiHeader, 2); + } + + return ntStatus; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvSetSaeAuthParams(const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) +{ + //Since this is DIRECT OID, need to check the m_LastConnectTransactionId match + if (pWdiHeader->TransactionId != m_LastConnectTransactionId) + { + WFCError("WDI_SET_SAE_AUTH_PARAMS called with invalid TransactionId: %llu, expected: %llu\n", + pWdiHeader->TransactionId, m_LastConnectTransactionId); + return STATUS_INVALID_DEVICE_REQUEST; + } + + WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED_PARAMETERS SAEAuthParamsNeeded{}; + UINT8* pOutput = nullptr; + ULONG cbOutput = 0; + + // Commit frame when Status = 0: FiniteCyclicGroup + Scalar + Element + // Commit frame when Status = 76: FiniteCyclicGroup + AntiCloggingToken + WFCInfo("WDI_SET_SAE_AUTH_PARAMS called!!!\n"); + if (WDI_SAE_REQUEST_TYPE_COMMIT_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Commit request for Tx, Setting CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_COMMIT_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + + // + // Send reflection attack first + // + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponseReflection); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponseReflection; + } + else if ( + (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) && + (WDI_SAE_STATUS_COMMIT_MESSAGE_REFLECTION_ATTACK_DETECTED == setSAEAuthParams.SAEStatus)) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS returned Reflection error -- Inidicate proper CommitResponse for Rx\n"); + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAECommitResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAECommitResponse; + } + else if (WDI_SAE_REQUEST_TYPE_CONFIRM_PARAMS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] WDI_SET_SAE_AUTH_PARAMS has Confirm request for Tx, Setting ConfirmResponse for Rx\n"); + + if (g_dwSaeResendConfirmRequested) + { + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_FRAME; + SAEAuthParamsNeeded.Optional.SAECommitFrame_IsPresent = 1; + SAEAuthParamsNeeded.SAECommitFrame.ElementCount = sizeof(pucSAEConfirmResponse); + SAEAuthParamsNeeded.SAECommitFrame.pElements = pucSAEConfirmResponse; + } + else + { + g_dwSaeResendConfirmRequested = 1; + + SAEAuthParamsNeeded.SAEIndicationType = WDI_SAE_INDICATION_TYPE_CONFIRM_REQUEST_RESEND_REQUEST; + } + } + else + { + if (WDI_SAE_REQUEST_TYPE_FAILURE == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated error - %d\n", setSAEAuthParams.SAEStatus); + } + else if (WDI_SAE_REQUEST_TYPE_SUCCESS == setSAEAuthParams.SAERequestType) + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has indicated SAE success - %d\n", setSAEAuthParams.SAEStatus); + } + else + { + WFCInfo("[SAE] OID_WDI_SET_SAE_AUTH_PARAMS has set INVALID Request type = %d\n", setSAEAuthParams.SAERequestType); + } + + // Send the association indication + // This assumes that the association result fields are in the right order + if (WDI_AUTH_ALGO_WPA3_SAE == m_LastAuthAlgo) + { + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_WPA3_SAE; + } + else + { + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult[27] = (UCHAR)WDI_AUTH_ALGO_RSNA_PSK; + } + + WifiIhvSendUnsolicitedIndicationToOs( + m_Device, + pWdiHeader, + WDI_INDICATION_ASSOCIATION_RESULT, + g_ConnectEntries[m_LastConnectEntryId].pTlvAssociationResult, + g_ConnectEntries[m_LastConnectEntryId].TlvAssociationResultSize); + RtlCopyMemory(&m_ConnectedPeer, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + // Report link quality + WX_RETURN_NTSTATUS_IF_NOT_NT_SUCCESS_MSG(WifiIhvSendLinkStateIndication(pWdiHeader, 1), + "Failed WifiIhvSendLinkStateIndication"); + + // Complete the transaction to let the M4 hanlder WifiIhvGetPendingTransitionStatus know that association is complete + m_LastConnectTransactionId = 0; + +#ifdef WIFI_IHV_HANDSHAKE + // + // Receive M1 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM1SaeFrame), pucM1SaeFrame); + + // + // Receive M3 frame of 4-way handshake + // + RecieveDatapathFrame(0x33, sizeof(pucM3SaeFrame), pucM3SaeFrame); +#endif + return STATUS_SUCCESS; + } + + RtlCopyMemory(SAEAuthParamsNeeded.BssId.Address, &g_ConnectEntries[m_LastConnectEntryId].pMacAddress, sizeof(DOT11_MAC_ADDRESS)); + + auto ndisStatus = + GenerateWdiIndicationSaeAuthParamsNeeded(&SAEAuthParamsNeeded, 0, m_TlvContext, &cbOutput, &pOutput); + if (ndisStatus == NDIS_STATUS_SUCCESS) + { + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED, pOutput, cbOutput); + + FreeGenerated(pOutput); + } + else + { + WFCError("Failed to generate WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED - 0x%08x\n", ndisStatus); + } + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const PWDI_MESSAGE_HEADER pWdiHeader, UINT) +{ + UCHAR s_TLV_Disassociation[] = + { + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + + 0x00 + }; + WDI_ASSOC_STATUS DisassocStatus = WDI_ASSOC_STATUS_DISASSOCIATED_BY_HOST; + + RtlCopyMemory(&s_TLV_Disassociation[4], &m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + RtlCopyMemory(&s_TLV_Disassociation[10], &DisassocStatus, sizeof(ULONG)); + + // Send the disassociation indication + WifiIhvSendUnsolicitedIndicationToOs(m_Device, pWdiHeader, WDI_INDICATION_DISASSOCIATION, s_TLV_Disassociation, sizeof(s_TLV_Disassociation)); + + m_LastConnectEntryId = 0; // Disconnected State + +#ifdef NETV_SUPPORT_TX_DEMUXING + WifiAdapterRemovePeer( + WifiGetIhvDeviceContext(m_Device)->netAdapters[pWdiHeader->PortId], + reinterpret_cast(&m_ConnectedPeer)); +#endif + RtlZeroMemory(&m_ConnectedPeer, sizeof(DOT11_MAC_ADDRESS)); + + return STATUS_SUCCESS; +} diff --git a/network/wlan/wificx/drivercode/wifihal.h b/network/wlan/wificx/drivercode/wifihal.h new file mode 100644 index 00000000..38e1166a --- /dev/null +++ b/network/wlan/wificx/drivercode/wifihal.h @@ -0,0 +1,48 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +// The class for Wifi IHV device's HAL functionalities +class WifiHAL +{ +public: + static NTSTATUS _Create(_In_ WDFDEVICE Device); + static void _OnCleanup(_In_ WDFOBJECT Object); + + // Default ctor so context memory can be zeroed by WDF without placement new + WifiHAL() = default; + + // Initialization routine replacing the previous parameterized ctor usage + void Initialize(_In_ WDFDEVICE Device, _In_ PCTLV_CONTEXT TlvContext); + + // Wifi request M3 working condition verification function + NTSTATUS WifiIhvIsDeviceReadyForRequest(); + + // Wifi request pending transition status check function + // for example, during SAE authentication, the connect request is pending until SAE exchange is complete + NTSTATUS WifiIhvGetPendingTransitionStatus(); + + NTSTATUS WifiIhvSetDeviceCapabilities(); + NTSTATUS WifiIhvReset(_In_ const WDI_TASK_DOT11_RESET_PARAMETERS& ResetParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvSetRadioState(_In_ const WDI_SET_RADIO_STATE_PARAMETERS& RadioState, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvScan(_In_ const WDI_SCAN_PARAMETERS& ScanParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvConnect(_In_ const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + NTSTATUS WifiIhvDisconnect(_In_ const WDI_TASK_DISCONNECT_PARAMETERS& disconnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); +private: + NTSTATUS WifiIhvPerformAssociation(_In_ const struct ArrayOfElements* pPreferredBSSEntryList, _In_ const struct ArrayOfElements* pAuthenticationAlgorithms, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); + NTSTATUS WifiIhvSendLinkStateIndication(_In_ const PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); + + WDFDEVICE m_Device{}; + PCTLV_CONTEXT m_TlvContext{}; + + UCHAR m_CurrentRadioState{}; + UINT32 m_LastConnectEntryId{}; + UINT32 m_LastConnectTransactionId{}; + WDI_AUTH_ALGORITHM m_LastAuthAlgo{}; + DOT11_MAC_ADDRESS m_ConnectedPeer{}; + + // Removed const so we can initialize without running a constructor via placement new + WDI_MAC_ADDRESS m_LocalLinkAddresses[2]; + ULONG m_SupportedBands; +}; +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(WifiHAL, GetWifiHalFromHandle); diff --git a/network/wlan/wificx/drivercode/wifihaltestdata.h b/network/wlan/wificx/drivercode/wifihaltestdata.h new file mode 100644 index 00000000..7ded0f2b --- /dev/null +++ b/network/wlan/wificx/drivercode/wifihaltestdata.h @@ -0,0 +1,8290 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once + +#define TESTMP_BAND_IHV 0x00000010 + +// clang-format on + +#define ConnectEntryId_MAX ARRAYSIZE(g_ConnectEntries) + +// +//=============================================================================== +// Set alternate local addresses based on simulation parameters +//=============================================================================== +// +UCHAR s_ArubaSimLocalAddress[] = {0xd4, 0x6a, 0x6a, 0x52, 0x18, 0x07}; // For Wpa3SuiteB - Aruba +UCHAR g_IntelSimLocalAddress[] = {0x34, 0x13, 0xe8, 0xb3, 0x14, 0x4c}; // For Wpa3SuiteB - Intel +UCHAR g_SaeSimLocalAddress[] = {0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5}; // For Wpa3Sae + +#ifdef WPA3_ARUBA_SIM +PUCHAR g_AlternateLocalAddress = s_ArubaSimLocalAddress; +#elif WPA3_INTEL_SIM +PUCHAR g_AlternateLocalAddress = g_IntelSimLocalAddress; +#elif WPA3_SAE +PUCHAR g_AlternateLocalAddress = g_SaeSimLocalAddress; +#else +PUCHAR g_AlternateLocalAddress = NULL; +#endif + +// clang-format off + +// +//=============================================================================== +// + +UCHAR s_DeviceServiceTestBlob[] = +{ + 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa +}; + +// +//=============================================================================== +// + +UCHAR s_TLV_AssociationParametersRequestedType[] = +{ + // WDI_TLV_ASSOCIATION_PARAMETERS_REQUESTED_TYPE + 0xBB, 0x00, + 0x02, 0x00, + 0x9F, 0x00 // PMKID +}; + +UCHAR s_TLV_RoamingNeededIndication[] = +{ + // WDI_TLV_ROAMING_NEEDED_PARAMETERS + 0x55, 0x00, + 0x04, 0x00, + 0x0a, 0x00, 0x00, 0x00 +}; + +UCHAR s_TLV_NeighborReport[] = +{ + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ACTION_FRAME_BODY + 0xBE, 0x00, + 0x14, 0x00, + 0x05, // Category = Radio Measurement + 0x05, // Action = Neighbor Report Response + 0x01, // Dialog Token + 0x34, // Element ID = Neighbor Report + 0x0F, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, // BSSID + 0x00, 0x00, 0x00, 0x00, // BSSID Information + 0x00, // Operating class + 0x06, // Channel Number + 0x00, // PHY Type + 0x00, 0x00, // Optional IEs +}; + +// +//=============================================================================== +// + +// +//=============================================================================== +// BSs entries +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr = {0x00, 0x20, 0x30, 0x40, 0x50, 0x60}; + +UCHAR s_TLV_BSS_Entry_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'W', 'F', 'C', '_', 'O', 'P', 'E', 'N', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + + +UCHAR s_TLV_OpenDisassociation[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0xBC, 0x00, + 0x0A, 0x00, + 0x00, 0x20, 0x30, 0x40, 0x50, 0x60, + 0x01, 0x00, 0x00, 0x00, + + // WDI_TLV Need Peer Cleanup Params + 0xb4, 0x00, + 0x01, 0x00, + 0x00 +}; + +WDI_MAC_ADDRESS s_Connect_Addr_2_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2}; + +UCHAR s_TLV_BSS_Entry_2_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x59, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x26, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x28, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID + +}; + +UCHAR s_TLV_Success_AssociationResult_2_Open[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE2, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x25, 0x00, + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_3_WEP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3}; + +UCHAR s_TLV_BSS_Entry_3_WEP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x03, 0x01, 0x01, // DSSS Parameter (Offset: 42) + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality (Offset: 57) + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel (Offset: 64) + 0x01, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_3_WEP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE3, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'W', 'E', 'P', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_4_RSNA_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4}; + +#define WFA_TEST_MIN_RSN_IE 1 + +UCHAR s_TLV_BSS_Entry_4_RSNA_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef WFA_TEST_MIN_RSN_IE + 0x79, 0x00, //Len +#else + 0x8B, 0x00, //Len +#endif // WFA_TEST_MIN_RSN_IE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef WFA_TEST_MIN_RSN_IE + 0x46, 0x00, +#else + 0x58, 0x00, +#endif // WFA_TEST_MIN_RSN_IE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved +#ifdef WFA_TEST_MIN_RSN_IE + 0x30, 0x02, + 0x01, 0x00, +#else + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite -- RSNA_PSK + 0x00, 0x00, // RSN Capability +#endif // WFA_TEST_MIN_RSN_IE + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_4_RSNA_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x22, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE4, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x58, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x02, 0x00, 0x00, // RSN + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_5_IHV = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5}; + +UCHAR s_TLV_BSS_Entry_5_IHV [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x1f, 0x00, + 0x44, 0x55, 0x66, 0x77, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x03, 0x01, 0x01, // DSSS Parameter + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x3C, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel = 36 + 0x08, 0x00, 0x00, 0x00, // Band ID = Custom +// 0x02, 0x00, 0x00, 0x00, // Band ID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_5_IHV[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x02, 0x00, 0x00, 0x80, //AuthAlgorithm = Custom + 0x01, 0x00, 0x00, 0x80, //UnicastCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastDataCipherAlgorithm + 0x01, 0x00, 0x00, 0x80, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x80, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x32, 0x00, + 0x10, 0x04, // Capability + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x24, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x10, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', '_', 'I', 'H', 'V', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x02, 0x00, 0x00, 0x80, // Phy = IHV Phy 2 + +}; + + +UCHAR s_TLV_IhvRequestComplete[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x0A, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0x00, 0x00, 0x01 +}; + + +UCHAR s_TLV_IhvIndication[] = +{ + // WDI_TLV_IHV_DATA + 0xBD, 0x00, + 0x30, 0x00, + + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE5 +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_6_FT_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6}; + +UCHAR s_TLV_BSS_Entry_6_FT_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xEA, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB7, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_6_FT_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE6, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x06, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x3E, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xC5, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite -- FT + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x37, 0x69, // FTE IE + 0x00, 0x00, // MIC Control - 0 => no MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0xB4, 0xC7, 0x99, 0x8A, 0xB6, 0x30, + 0x03, 0x0D, // R0KH-ID + 'a', 'p', '8', '1', '3', '2', '-', '7', '3', '4', 'E', 'B', '0', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xB7, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x07, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', // WDI__FT + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x03, // AKM Suite + 0x0C, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x0B, 0x47, // MDID + 0x00, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_7_FT_PSK_CCMP = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7}; + +UCHAR s_TLV_BSS_Entry_7_FT_PSK_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xED, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xBA, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x53, 0x8D, 0x5B, + 0x2A, 0x01, + 0x00, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x00, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0B, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x4A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_7_FT_PSK_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0C, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x41, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x14, // RSN IE + 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, 0xAC, 0x04, 0x01, 0x00, 0x00, 0x0F, + 0xAC, 0x01, 0x00, 0x00, + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0xDD, 0x07, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0xBF, 0x00, + 0x31, 0x04, // Capability + 0x00, 0x00, // Status + 0x01, 0xC0, // Association ID + 0x01, 0x08, // Supported Rates + 0x96, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x30, 0x26, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher -- CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher -- CCMP + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite -- FT-PSK + 0x28, 0x00, // RSN Capability + 0x01, 0x00, // PMKID Count -- PMKR1Name + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //PMKID + 0x32, 0x01, // Extended Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x37, 0x63, // FTE IE + 0x00, 0x02, // MIC Control + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //MIC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //ANonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //SNonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x06, // R1KH-ID + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE7, + 0x03, 0x07, // R0KH-ID + 'x', '@', 'y', '.', 'c', 'o', 'm', + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xBA, 0x00, + 0xDD, 0x50, 0x3D, 0xF7, 0xE2, 0x01, 0x00, 0x00, // Supported Rates + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', '_', 'F', 'T', 'P', 'S', 'K', // WDI__FTPSK + 0x01, 0x08, + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + 0x03, 0x01, // DSS Parameters + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x07, 0x06, // Country + 0x55, 0x53, 0x20, 0x01, 0x0B, 0x1E, + 0x0B, 0x05, + 0x00, 0x00, 0x6E, 0x8D, 0x5B, + 0x2A, 0x01, // ERP + 0x00, + 0x30, 0x14, // RSN + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise cipher + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x04, // AKM Suite + 0x28, 0x00, // RSN Capability + 0x32, 0x01, // Extended Supported Rates + 0x6C, + 0x36, 0x03, // MDID IE + 0x12, 0x34, // MDID + 0x80, // FT Capability and Policy + 0x85, 0x1E, + 0x03, 0x00, 0x8F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0x59, 0x00, 0x41, 0x50, 0x30, 0x30, 0x31, 0x34, + 0x2E, 0x36, 0x39, 0x34, 0x30, 0x2E, 0x38, 0x31, 0x65, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x96, 0x06, + 0x00, 0x40, 0x96, 0x00, 0x0E, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x06, + 0x00, 0x40, 0x96, 0x01, 0x01, 0x04, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x03, 0x05, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x0B, 0x09, + 0xDD, 0x05, + 0x00, 0x40, 0x96, 0x14, 0x01, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x06, 0x00, 0x00, 0x00 +}; + + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_8_Hidden = {0x00, 0xA0, 0xB0, 0xC0, 0xD0,0xE8}; + +UCHAR s_TLV_BSS_Entry_Beacon_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x52, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x24, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x00, // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_BSS_Entry_ProbeResponse_8_Hidden [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x5a, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + + +UCHAR s_TLV_Success_AssociationResult_8_Hidden[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE8, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x07, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, // SSID + 'W', 'D', 'I', '_', 'H', 'I', 'D', 'E', + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_ETHERTYPE_ENCAP_TABLE (optional) + // 0x00, 0x00, + // 0x04, 0x00, + // 0x00, 0x00, 0x00, 0x00 + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// +// 11ad +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_9_11ad_PSK = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_Beacon_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_9_11ad_ProbeResponse_Dmg_PSK [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_9_11ad_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_9_11ad_Dmg_PSK [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xE9, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_10_11ad_1x = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_Beacon_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x14, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x31, 0x04, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_10_11ad_ProbeResponse_Dmg_1x [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xCB, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x98, 0x00, // For WiFi Beacon + // Dmg + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x17, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_10_11ad_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x31, 0x04, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', '1', 'x', // WDI_ad_1x + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_10_11ad_Dmg_1x [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x96, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEA, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x08, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x08, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x01, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x65, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x01, 0x08, // Supported Rates + 0x0C, 0x12, 0x96, 0x18, 0x24, 0x30, 0x48, 0x60, + + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x94, 11, + 0x04, 0xCE, 0x14, 0x0A, 0x3B, 0x61, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x47, 0x00, + 0x17, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x94, 0x11, // DMG Capabilities + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, // STA address + 0x03, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x98, 0x00, + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', 'P', 'S', 'K', // WDI_adPSK + 0x03, 0x01, // DSS Parameters + 0x02, + 0x30, 0x14, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x08, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x01, // AKM Suite + 0x00, 0x00, // RSN Capability + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0x34, 0x6B, 0x01, 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x00, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + 0xDD, 0x21, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_11_11ad_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x3F, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x0C, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_Beacon_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x47, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_BEACON_FRAME (8.3.3.2, Table 8-33a) + 0x0A, 0x00, + 0x05, 0x00, // For WiFi Beacon + // DMG Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x00, 0x0c, 0x38, // 3 - Sector Sweep (9.5.1) + 0x64, 0x00, // 2 - Beacon Interval (9.4.1.3) + 0xc0, 0x7c, 0x18, 0x08, 0x20, 0x18, // 6 - Beacon Interval Control (Fig 9-60) + 0x07, // 1 - DMG Parameters (9.4.1.47) + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_BSS_Entry_11_11ad_ProbeResponse_Dmg_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC9, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_PROBE_RESPONSE_FRAME (8.3.3.2, Table 8-33a) + 0x09, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xC1, 0xFF, 0xFF, 0xFF, // RSSI + 0x64, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x03, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +UCHAR s_TLV_Success_AssociationResult_11_11ad_Dmg_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x71, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm -- RSNA_PSK + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x03, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x03, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x36, 0x00, + 0x05, 0x00, // Capabilities + 0x01, 0x00, // Listen Interval + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x2E, 0x01, + 0x08, + 0x94, 11, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x00, // AID + 0x11, 0xD1, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0x49, 0x2D, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x53, 0x00, + 0x07, 0x00, // Capabilities + 0x00, 0x00, // Status code + 0x02, 0x00, // Association ID + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, // DMG Capabilities + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEB, // STA address + 0x02, // AID + 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, // DOT11_DMG_STA_CAPABILITY_INFO + 0x00, 0x00, // DOT11_DMG_PCP_AP_CAPABILITY_INFO + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x2C, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, + 0x96, 0x00, // For WiFi Beacon + // WiFi Beacon + 0x38, 0xE3, 0x3B, 0x64, 0x11, 0x00, 0x00, 0x00, // TimeStamp (9.4.1.10) + 0x64, 0x00, // Beacon Interval (8.4.1.3) + 0x05, 0x00, // Capability + + 0x00, 0x09, // SSID + 'W', 'D', 'I', '_', 'a', 'd', '_', 'O', 'N', // WDI_ad_ON + 0x03, 0x01, // DSS Parameters + 0x02, + 0x7F, 0x04, + 0x00, 0x00, 0x00, 0x02, + 0x94, 0x11, + 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, 0x01, 0xD2, 0xB7, 0x06, 0x00, 0x00, 0x40, 0x10, 0x00, + 0x00, + 0x97, 0x0A, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, + 0xBE, 0x04, + 0x00, 0x00, 0x00, 0x00, + 0x0C, 0x12, + 0x00, 0x00, 0x03, 0xA4, 0x28, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x40, 0x00, 0x62, 0x32, + 0x10, 0x00, + 0x2E, 0x01, + 0x28, + 0xDD, 0x27, + 0x04, 0xCE, 0x14, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x05, + 0x00, 0x07, 0x00, 0x02, 0x00, 0x01, 0x00, + 0xDD, 0x0F, + 0x50, 0x6F, 0x9A, 0x17, 0x01, 0x09, 0x00, 0x07, 0x04, 0xCE, 0x14, 0x07, 0xA3, 0x66, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x09, 0x00, 0x00, 0x00 +}; + + +//=============================================================================== +// +// 11ax +// +//=============================================================================== + +// +// Open on 2.4 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_12_11ax_24_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC}; + + +UCHAR s_TLV_BSS_Entry_12_11ax_24_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x78, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x4A, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_12_11ax_24_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEC, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4E, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x43, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x11, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '2', '.', '4', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== + +// +// Open on 5 GHz +// +WDI_MAC_ADDRESS s_Connect_Addr_13_11ax_5_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED}; + + +UCHAR s_TLV_BSS_Entry_13_11ax_5_Open [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x76, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x48, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x46, 0x05, + 0x02, 0x00, 0x00, 0x00, 0x00, // RM Enabled Capabilities + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel 36 + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_Success_AssociationResult_13_11ax_5_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xED, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4C, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x24, 0x30, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x45, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xFF, 0x13, // Extension IE + 0x23, // HE Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, // MAC Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // PHY Capabilities + 0x00, + 0x00, 0x00, 0x00, 0x00, // HE-MCS and NSS + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x2C, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0xF, // SSID + 'W', 'D', 'I', '_', 'O', 'P', 'E', 'N', '_', '1', '1', 'a', 'x', '.', '5', + 0x01, 0x04, + 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, + 0x01, // DSSS Parameter + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +//=============================================================================== +// + +// #define SAE_MIXED_MODE 1 + +WDI_MAC_ADDRESS s_Connect_Addr_14_WPA3_SAE_CCMP = { 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32 }; + +UCHAR s_TLV_BSS_Entry_14_WPA3_SAE_CCMP [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type +#ifdef SAE_MIXED_MODE + 0x91, 0x00, //Len +#else + 0x8D, 0x00, //Len +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Capability - no MFPR or MFPC +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, +#ifdef SAE_MIXED_MODE + 0x2A, 0x01, +#else + 0x26, 0x01, +#endif // SAE_MIXED_MODE + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x4A, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AMK Suite - WPA3SAE + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, +#ifdef SAE_MIXED_MODE + 0x5E, 0x00, +#else + 0x5A, 0x00, +#endif // SAE_MIXED_MODE + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0C, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'A', 'E', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved +#ifdef SAE_MIXED_MODE + 0x30, 0x18, +#else + 0x30, 0x14, +#endif // SAE_MIXED_MODE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Multicast Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher +#ifdef SAE_MIXED_MODE + 0x02, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - WPA2PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0x80, 0x00, // RSN Cap = MFP-Capable +#else + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - WPA3SAE + 0xC0, 0x00, // RSN Cap = MFP-Capable + MFP required +#endif // SAE_MIXED_MODE + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +// +// SAE-Specific definitions :: Start +// +DWORD g_dwSaeResendConfirmRequested = 0; + +UCHAR pucSAECommitResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + 0x93, 0x48, 0x89, 0xab, 0x38, 0x6b, 0x72, 0xd5, 0xff, 0x0d, 0x3c, 0xaa, 0x09, 0x56, 0x50, 0x20, + 0x2b, 0xd0, 0x3e, 0x26, 0x96, 0xb5, 0x90, 0x5f, 0x7b, 0x49, 0x5f, 0x3b, 0x7d, 0xc3, 0x5b, 0x48, + + // [14] AP Element + 0x58, 0x54, 0x5e, 0x6c, 0xa0, 0xe8, 0x86, 0xef, 0xfb, 0x05, 0x2a, 0xfb, 0x63, 0x2c, 0xa2, 0x19, + 0x5b, 0xb0, 0xb0, 0xa8, 0x25, 0xe5, 0x9d, 0xba, 0x6b, 0xaa, 0x0e, 0x93, 0xaf, 0x04, 0x6e, 0xf4, + 0xc9, 0x45, 0x5f, 0xec, 0x43, 0xfe, 0x5e, 0xb0, 0x2a, 0x6b, 0x8a, 0xbc, 0x8f, 0xd7, 0x07, 0x87, + 0x87, 0x3d, 0xd1, 0xd5, 0xd7, 0xfd, 0xe3, 0x07, 0x3a, 0x4c, 0xf3, 0xc2, 0xc7, 0x6f, 0x59, 0x5c, + }; +UCHAR pucSAECommitResponseReflection [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x01, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (ANTI_CLOGGING_TOKEN_REQUIRED) (not-IE, 2 octets) + 0x13, 0x00, // [10] FiniteCyclicGroup (not-IE, 2 octets) +// 0x00, 0x00, 0x00, 0x00, // [11] AntiCloggingToken (not-IE, variable octets) + // [13] AP Scalar + + 0x49, 0x5c, 0x2c, 0xb4, 0x20, 0xec, 0xc9, 0xe8, 0xe8, 0x03, 0x2d, 0x00, 0x8d, 0xab, 0x4d, 0x91, + 0x70, 0x16, 0x06, 0x28, 0x40, 0x83, 0xb9, 0x8d, 0x19, 0xc6, 0x43, 0xcb, 0x63, 0x29, 0x9f, 0x03, + + // [14] AP Element + 0x13, 0x2e, 0xfc, 0x90, 0xb9, 0xd7, 0xb5, 0xc1, 0x2a, 0x1d, 0xe9, 0x05, 0x9c, 0xb3, 0xba, 0xc8, + 0xa6, 0x93, 0xff, 0xbf, 0x23, 0x02, 0x42, 0x3e, 0x58, 0xc2, 0x0d, 0x00, 0x10, 0xe8, 0x44, 0x60, + 0x9d, 0xfc, 0x34, 0x5e, 0x98, 0x8e, 0xf2, 0x12, 0x67, 0x24, 0xd0, 0x80, 0xfb, 0x2f, 0x1e, 0x7a, + 0xe6, 0x54, 0x01, 0x00, 0x50, 0xd4, 0xfe, 0x66, 0x47, 0x62, 0xc0, 0x3c, 0x9f, 0x7a, 0x10, 0x27, + }; + +UCHAR pucSAEConfirmResponse [] = + { + 0x03, 0x00, // [1] usAlgorithmNumber = DOT11_AUTH_SAE (not-IE, 2 octets) + 0x02, 0x00, // [2] usXid: Commit=1, Confirm=2 (not-IE, 2 octets) + 0x00, 0x00, // [3] usStatusCode = 0 or 76 (DOT11_FRAME_STATUS_ANTI_CLOGGING_TOKEN_REQUIRED) (not-Element, 2 octets) + 0x00, 0x00, // [12] SendConfirm (not-IE, 2 octets) + // [15] Confirm + 0xc7, 0xd1, 0x04, 0x94, 0x29, 0xec, 0xdf, 0x25, 0xda, 0xaa, 0x79, 0x6f, 0xda, 0xe9, 0x91, 0x9f, + 0x4b, 0x83, 0xad, 0xa3, 0x08, 0xde, 0x62, 0xca, 0xcd, 0x59, 0xfc, 0xf5, 0xc5, 0x4d, 0xeb, 0xd9, + }; + +UCHAR pucM1SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control: Version = 0x0, Type = DOT11_FRAME_TYPE_DATA, Subtype = DOT11_DATA_SUBTYPE_DATA + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Address1: Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address2: Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Address3: Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype = DOT11_ETH_TYPE_EAPOL + // NWF_EAPOL_HEADER + 0x02, // Version = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 OR NWF_EAPOL_PROTOCOL_VERSION_V2 = 2 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x00, 0x8a, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // MIC + 0x00, 0x16, // Key length + 0xdd, 0x14, // KeyData -> DOT11_INFO_ELEMENT_ID_VENDOR_SPECIFIC + Len + 0x00, 0x0f, 0xac, 0x04, // OUI -> RSN_KEY_DATA_OUI + RSN_KEY_DATA_OUI_TYPE_PMKID -> {0x00,0x0F,0xAC} + {0x04) + 0x37, 0xfb, 0x9a, 0x24, 0xc1, 0x57, 0x8c, 0xce, 0xc3, 0x60, 0x6c, 0x6f, 0x39, 0xe0, 0xb7, 0x02, // PMKID +}; + + +UCHAR pucExpectedM2SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version = bProtocolVersion = NWF_EAPOL_PROTOCOL_VERSION_V1 = 1 + 0x03, // Type = EAPOL_Key = 2 + 0x00, 0x75, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type = bKeyDesc = NWF_EAPOL_KEY_DESC_RSNA = 2 + 0x01, 0x0a, // Info = usKeyInfo, ResponseKeyInfo.Version = KEY_DESC_VERSION_AES, Type=RSN_KEY_TYPE_PAIRWISE, MIC=1, Secure=0 + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // Replay Counter + 0x80, 0xf8, 0x10, 0x83, 0x4f, 0x0f, 0x40, 0xa1, 0xe5, 0x5d, 0x51, 0x92, 0x83, 0x4f, 0x8e, 0x98, // Nonce + 0x09, 0xca, 0xd5, 0x14, 0xc6, 0x08, 0x4c, 0xa9, 0xed, 0xc3, 0xa8, 0xff, 0xce, 0xc9, 0x36, 0xb6, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa1, 0x79, 0x5f, 0x05, 0xa4, 0x12, 0x84, 0xf2, 0xf9, 0x0c, 0x79, 0x88, 0xeb, 0x92, 0x71, 0x62, // MIC + 0x00, 0x16, // Key Length + 0x30, 0x14, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, 0x00, 0x0f, 0xac, 0x04, 0x01, 0x00, // Key Data = RSN + 0x00, 0x0f, 0xac, 0x08, 0x80, 0x00 + +}; + +UCHAR pucM3SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x02, // Frame Control + 0x30, 0x00, // Duration + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Receiver/Destination/STA address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x00, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x02, // Version + 0x03, // Type + 0x00, 0x97, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x13, 0xca, // Info + 0x00, 0x10, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x57, 0x63, 0xf3, 0xb6, 0x6e, 0xc8, 0x90, 0xe4, 0xae, 0xfc, 0x2c, 0x50, 0xb0, 0xa9, 0x04, 0x29, // Nonce + 0x97, 0xb9, 0x80, 0x26, 0x13, 0x1a, 0xe2, 0xf0, 0x24, 0x30, 0x4b, 0x87, 0x57, 0x15, 0xcf, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0xa5, 0xea, 0xdc, 0xfd, 0x97, 0xc7, 0x72, 0x76, 0x24, 0xe2, 0x7e, 0x71, 0x45, 0x3a, 0x24, 0xca, // MIC + 0x00, 0x38, // Key Length + 0x6f, 0x39, 0x30, 0x2c, 0x46, 0xb4, 0x3c, 0xf8, 0x42, 0x07, 0x8e, 0xc9, 0x65, 0x05, 0x2c, 0xd0, // Encrypted Key data + 0xe1, 0x7b, 0xdd, 0x2e, 0xbd, 0x69, 0x09, 0x1e, 0x39, 0xcc, 0x1a, 0xb3, 0x6e, 0x55, 0xd1, 0xad, + 0x5c, 0x45, 0x52, 0x4b, 0x83, 0x5d, 0x39, 0xe3, 0x1c, 0xb6, 0xed, 0x35, 0x52, 0x76, 0xb1, 0xc6, + 0x5a, 0x2c, 0x96, 0x07, 0x77, 0x15, 0x15, 0x5c, +}; + + +UCHAR pucExpectedM4SaeFrame[] = +{ + // DOT11_MGMT_HEADER - DOT11_DATA_SHORT_HEADER + 0x88, 0x01, // Frame Control + 0x2c, 0x00, // Duration + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Receiver/Destination/STA address + 0x9c, 0xda, 0x3e, 0xf2, 0x7d, 0xd5, // Transmittor/Bssid address + 0x34, 0x13, 0xe8, 0xbc, 0x4d, 0x32, // Source address + 0x10, 0x00, 0x07, 0x00, // Sequence Control + // IEEE_8022_LLC_SNAP + 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, // NWF_802_LLC_SNAP + 0x88, 0x8e, // sh_etype + // NWF_EAPOL_HEADER + 0x01, // Version + 0x03, // Type + 0x00, 0x5f, // Length + // NWF_EAPOL_RSNA_KEY_DESC + 0x02, // Type + 0x03, 0x0a, // Info + 0x00, 0x00, // Length + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, // Replay Counter + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Nonce + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // IV + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // RSC + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Reserved + 0x52, 0x97, 0x0f, 0x90, 0x69, 0x7d, 0xcd, 0xeb, 0x98, 0xbf, 0xb1, 0x2a, 0xb2, 0x3e, 0xcc, 0x49, // MIC + 0x00, 0x00, // Key Length +}; + +// +// SAE-Specific definitions :: End +// + +// +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_15_WPA2PSK_SHA256 = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF}; + +UCHAR s_TLV_BSS_Entry_15_WPA2PSK_SHA256 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x91, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'H', 'A', '2', '5', '6', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x06, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x28, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xEF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x48, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x14, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise cipher count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AMK Suite Count + 0x00, 0x0F, 0xAC, 0x06, // AMK Suite - WPA2PSK_SHA256 + 0xC0, 0x00, // RSN Capability = MFP-Capable + MFP-Required + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x5e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0A, // SSID + 'W', 'D', 'I', '_', 'S', 'E', 'C', 'U', 'R', 'E', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite + 0xCC, 0x00, // RSN Capability + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + + +// +//=============================================================================== +// + +#ifdef WPA3_ARUBA_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5}; // For Aruba +#elif WPA3_INTEL_SIM +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a}; // For Intel +#else +WDI_MAC_ADDRESS s_Connect_Addr_16_WPA3_SUITEB = {0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0}; +#endif + +UCHAR s_TLV_BSS_Entry_16_WPA3_SUITEB [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x97, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_16_WPA3_SUITEB[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x3A, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, +#ifdef WPA3_ARUBA_SIM + 0xa8, 0xbd, 0x27, 0xcd, 0xe0, 0xa5, // For Aruba +#elif WPA3_INTEL_SIM + 0x8c, 0xfd, 0xf0, 0x0f, 0x7f, 0x4a, // For Intel +#else + 0x00, 0xA0, 0xB0, 0xC0, 0xD0, 0xF0, +#endif + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_ENT_192 = 8 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x54, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, 0x07, 0x12, //Power Capability + 0x24, 0x02, 0x01, 0x0B, //Supported Channels + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x64, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'D', 'I', '_', 'W', 'P', 'A', '3', '-', 'S', 'U', 'I', 'T', 'E', '_', 'B', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x0C, // AKM Suite - WPA3-SuiteB + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x04, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// +// 6 GHz +// +//=============================================================================== + +// +// RNR IE has the following format (only care about TBTT length = 8 or 12): +// 0xc9, 0x +// 0x -> 2 bytes (contains number and size of each element) +// 0x, 0x -> 2 bytes (applies to all element in this list) +// 0x -> 1 byte +// 0x -> 6 bytes +// [0x] -> 4 bytes +// 0x -> 1 byte +// + +// +// Mac addresses have the following nomenclature for 6GHz Ssids +// +// 1st 3 bytes are 0x00 0xA1, 0xB0 +// 4th byte is for SSID: +// 01 = 6E__1 +// 02 = 6E__2 +// 03 = SSID3 +// 04 = SSID4 +// 5th Byte is for band: +// 02 = 2.4 GHz +// 05 = 5 GHz +// 06 = 6 GHz +// 6th byte is instance +// 01 = 1st instance +// 02 - 2nd instance +// : +// + +//=============================================================================== +// SIX_G: 6E__1: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (2 * 6 GHz) +// 2.4 GHz: +// S1_24_1: S1_5_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 5 GHz: +// S1_5_1: S1_24_1 (In+Out) + S1_6_1 (Out) + S1_6_2 (Out) +// 6 GHz: +// S1_6_1: S1_24_1 (In) + S1_5_1 (In) +// S1_6_2: S1_24_1 (In) + S1_5_1 (In) +//=============================================================================== + +// +// 6E__1: 1 * 2.4 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [5:36 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_17_6G_S1_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xE9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xB6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel / Freq = 2412 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x01, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x01, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x24, // Operating Class = 115 (5 GHz), Channel = 36 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 5 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1 * 5 GHz Bss's +// 1 RNR IE with 3 entries: Band:Channel = [2.4:1 + 6:101 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_18_6G_S1_5_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_18_6G_S1_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe9, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel / Freq = 36 / 5180 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0B, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x24, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xb6, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x24, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x30, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x01, // Operating Class = 81 (2.4 GHz), Channel = 1 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x02, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 2.4 GHz + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 Ghz + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, 0x18, 0x3a, 0x94, 0x4f, 0x40, // 6E__1 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 1/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_19_6G_S1a_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_19_6G_S1a_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x65, 0x00, 0x00, 0x00, // Channel / Freq = 101 / 6445 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xfD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x65, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x65, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__1: 2/2 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_20_6G_S1b_6_Ghz = {0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02}; +UCHAR s_TLV_BSS_Entry_20_6G_S1b_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x85, 0x00, 0x00, 0x00, // Channel / Freq = 133 / 6605 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x01, 0x06, 0x02, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x85, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '1', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: 6E__2: +// (1 * 2.4 GHz) + (1 * 5 GHz) + (1 * 6 GHz) +// 2.4 GHz: +// S2_24_1: S2_5_1 (In+Out) + [S2_6_2 (Out)] +// 5 GHz: +// S2_5_1: S2_24_1 (In+Out) + S2_6_1 (Out) + [S2_6_2 (Out)] +// 6 GHz: +// S2_6_1: S2_5_1 (In) +//=============================================================================== + +// +// 6E__2: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each: Band:Channel = [5:44] + [6:101] +// +WDI_MAC_ADDRESS s_Connect_Addr_21_6G_S2_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x24, 0x01}; +UCHAR s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xD3, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xA0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x06, 0x00, 0x00, 0x00, // Channel / Freq = 2437 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xF5, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x06, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa0, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x06, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x0c, // RNR IE + 0x04, 0x08, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x0c, // RNR IE + 0x00, 0x08, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x08 = TBTT Length + 0x83, 0x65, // Operating Class = 131, Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0x42, // 6E__2 on 6 Ghz (Sabe Ssid) + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 5 GHz Bss's +// 3 RNR IEs with 1 entry each: Band:Channel = [2.4:6] + [6:101] + [6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_22_6G_S2_5_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01}; +UCHAR s_TLV_BSS_Entry_22_6G_S2_5_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xed, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x2c, 0x00, 0x00, 0x00, // Channel / Freq = 44 / 5220 MHz + 0x02, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x0F, 0x02, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x2c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xba, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x2c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc9, 0x10, // RNR IE + 0x04, 0x0c, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x02, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 2.4 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00 => B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x65, // Operating Class = 131, (6 GHz) Channel = 101 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x42, // 6E__2 on 6 Ghz + 0xc9, 0x10, // RNR IE + 0x0c, 0x0c, // TBTT: 0x0c => B2:3=1(FilteredAP:Reserved),B4-B7=f(TBTT Information Count=3+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131, (6 GHz) Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x00, // 6E__2 on 6 GHz + + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +// +// 6E__2: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_23_6G_S2_6_Ghz = {0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_23_6G_S2_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x79, 0x00, 0x00, 0x00, // Channel / Freq = 121 / 6545 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x79, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// SIX_G: SSID3: +// (1 * 2.4 GHz) +// 2.4 GHz: +// S3_24_1: *S2_5_1 (Out)* +//=============================================================================== + +// +// SSID3: 1 * 2.4 GHz Bss's +// 2 RNR IEs with 1 entry each Band:Channel = [5:44 + 6:133] +// +WDI_MAC_ADDRESS s_Connect_Addr_24_6G_S3_2_4_Ghz = {0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01}; +UCHAR s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xDB, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel / Freq = 2457 MHz + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x03, 0x02, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8B, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0xa5, 0x09, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates + 0x30, 0x48, 0x60, 0x6c, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x78, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + 0x53, 0x53, 0x49, 0x44, 0x31, + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0x0a, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbit/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0xa8, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '3', + 0x01, 0x08, // Supported Rates + 0x82, 0x84, 0x0b, 0x16, 0x8c, 0x12, 0x98, 0xa4, + 0x03, 0x01, // DS Parameter Set + 0x0a, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0x6c, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0x2d, 0x1a, // HT Capabilities (802.11n D1.10) + 0x76, 0x08, 0x17, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x04, // Extended Supported Rates 24, 36, 48, 54 [Mbits/sec] + 0x30, 0x48, 0x60, 0x6c, + 0x3d, 0x16, // HT Information (802.11n D1.10) + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x73, 0x2e, // Operating Class = 115 (5 GHz), Channel = 44 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x05, 0x01, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 5 GHz + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x83, 0x85, // Operating Class = 131 (6 GHz), Channel = 133 + 0x00, 0x00, 0xA1, 0xB0, 0x02, 0x06, 0x02, 0xa2, 0x6b, 0x9d, 0xd6, 0x40, // 6E__2 on 6 GHz + + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + + +//=============================================================================== +// SIX_G: SSID4 (non-colocated AP): +// (1 * 6 GHz) +// 6 GHz: +// S4_6_1: +//=============================================================================== + +// +// SSID4: 1 * 6 GHz Bss's +// +WDI_MAC_ADDRESS s_Connect_Addr_25_6G_S4_6_Ghz = {0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01}; +UCHAR s_TLV_BSS_Entry_25_6G_S4_6_Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xC6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0xe5, 0x00, 0x00, 0x00, // Channel / Freq = 229 / 7085 MHz + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xFD, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0x04, 0x06, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x07, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x04, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x04, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x8E, 0x00, + + 0x01, 0x11, // Capabilities + 0xfa, 0x00, // Listen Interval + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x21, 0x02, // Power Capability Min: 0, Max: 15 + 0x00, 0x0f, + 0x24, 0x32, // Supported Channels + 0x24, 0x01, 0x28, 0x01, 0x2c, 0x01, 0x30, 0x01, 0x34, 0x01, 0x38, 0x01, 0x3c, 0x01, 0x40, 0x01, + 0x64, 0x01, 0x68, 0x01, 0x6c, 0x01, 0x70, 0x01, 0x74, 0x01, 0x78, 0x01, 0x7c, 0x01, 0x80, 0x01, + 0x84, 0x01, 0x88, 0x01, 0x8c, 0x01, 0x90, 0x01, 0x95, 0x01, 0x99, 0x01, 0x9d, 0x01, 0xa1, 0x01, + 0xa5, 0x01, + 0x46, 0x05, // RM Enabled Capabilities + 0x72, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x0a, // Extended Capabilities + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdd, 0x07, // Vendor Specific: Microsoft Corp.: WMM/WME: Information Element + 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00, + 0xff, 0x1e, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0x01, 0x78, 0x20, 0x0a, 0xc0, 0x8b, 0x0e, 0x30, 0x02, 0x00, 0xfd, 0x09, 0x8c, 0x0e, 0xcf, 0xf2, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x61, 0x1c, 0xc7, 0x71, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0x7d, 0x02, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x8A, 0x00, + + 0x01, 0x11, // Capabilities + 0x00, 0x00, // Status Code: Successful + 0x00, 0xc0, // Association ID: 0x0000 + 0x00, 0x05, // SSID Parameter set + '6', 'E', '_', '_', '2', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x03, 0x01, // DS Parameter set: Current Channel: 10 + 0xe5, + 0x0b, 0x05, // QBSS Load Element 802.11e CCA Version + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x93, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Inteval + 0x01, 0x00, // Capabilities + 0x00, 0x05, // SSID + '6', 'E', '_', '_', '4', + 0x01, 0x08, // Supported Rates + 0x8c, 0x12, 0x98, 0xa4, 0x30, 0x48, 0x60, 0x6c, + 0x05, 0x04, // TIM - DTIM 0 of 0 + 0x00, 0x02, 0x00, 0xa4, + 0x0b, 0x05, + 0x00, 0x00, 0x00, 0x12, 0x7a, + 0x2a, 0x01, // ERP Information + 0x00, + 0xdd, 0x18, // Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element + 0x00, 0x50, 0xf2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xa4, 0x00, 0x00, 0x27, 0xa4, 0x00, 0x00, + 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, + 0xff, 0x03, // Ext Tag: HE Extended Capabilities (802.11ax/D3.0) + 0x3b, + 0xbd, 0x02, + 0xff, 0x27, // Ext Tag: HE Capabilities (802.11ax/D3.0) + 0x23, + 0xf7, 0x70, 0x99, 0x16, 0x64, 0x00, 0x0e, 0x30, 0x0c, 0xb6, 0x02, 0x1b, 0xb4, 0x0c, 0xcf, 0x30, + 0x00, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0xfa, 0xff, 0x7b, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, + 0xff, 0x0c, // Ext Tag: HE Operation (802.11ax/D3.0) + 0x24, + 0xf4, 0x3f, 0x02, 0x00, 0xf0, 0xff, 0x05, 0x03, 0x07, 0x0f, 0x00, + 0xff, 0x0e, // Ext Tag: MU EDCA Parameter Set + 0x26, + 0xc0, 0x07, 0xa4, 0x01, 0x23, 0xa4, 0x01, 0x42, 0x43, 0x01, 0x62, 0x32, 0x01, + + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0A, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// WDI_OWE_RNR +//=============================================================================== + + +/// WDI_OWE_RNR +/// +/// Description +/// - Non-Transition mode OWE network +/// - Advertises Reduced Neighbor Reports (RNRs) for the OWE Transition Mode BSSes WDI_OWE_TM_OWE and WDI_OWE_TM_OPEN +/// - Note: The OWE TM BSSes do not advertise RNR IEs +/// - Definitions for these two Transition Mode networks follows this one +/// +/// Intention +/// - Test Non-Transition Mode OWE networks +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving beacon or probe +/// - Since the networks are indicated in order during scans (i.e. the OWE TM networks will be indicated after this one) +/// it is expected that RNR for the OWE TM networks will be received before their beacons and probes. +/// +/// Expectation +/// - Scan results display WDI_OWE_RNR as an Enhanced Open network to which connections are supported +/// - The RNR will not effect connections to or display of OWE Transition Mode networks that it contains +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_26_OWE_With_RNR = {00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF}; +UCHAR s_TLV_BSS_Entry_26_OWE_With_RNR [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xB6, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x83, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0B, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'R', 'N', 'R', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // MAC Address --> OWE Transition Mode OWE (Defined below) + 0xFD, 0x1F, 0x3F, 0x49, // Short SSID for WDI_OWE_TM_OWE + 0x00, // BssParameters + + 0xc9, 0x10, // RNR IE + 0x00, 0x0c, // TBTT: 0x00,B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x0B, // Operating Class = 81 (2.4 GHz), Channel = B + 0x00, // TBTT Offset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // MAC Address --> OWE Transition Mode Open (Defined below) + 0x21, 0x24, 0x6C, 0x85, // Short SSID for WDI_OWE_TM_OPEN + 0x00, // BssParameters + + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_26_OWE_With_RNR [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0xFF, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, // Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OWE +/// Description +/// - OWE BSS of OWE Transition Mode network +/// - Auth Type is OWE +/// - Partner BSS is the OWE Transition Mode Open BSS "WDI_OWE_TM_OPEN" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of the OWE TM OWE BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: "WDI_OWE_TM_OPEN" +/// - Authentication: OWE +/// - Encryption: CCMP +/// - MFP Required: 1 +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_27_OWE_TM_OWE = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00}; +UCHAR s_TLV_BSS_Entry_27_OWE_TM_OWE [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xA1, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x6e, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, // RSN IE + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher + 0x01, 0x00, // AKM Suite count + 0x00, 0x0F, 0xAC, 0x12, // AKM Suite - OWE + 0xC0, 0x00, // RSN Capability - MFP Req + Capable + 0x00, 0x00, + 0x00, 0x0F, 0xAC, 0x06, // Group Cipher + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x1A, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, // Partner BSS BSSID + 0x0F, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented simulated OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_27_OWE_TM_OWE [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA1, 0xB0, 0xC0, 0xD1, 0x00, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +/// WDI_OWE_TM_OPEN +/// Description +/// - Open BSS of OWE Transition Mode network +/// - Open network +/// - Partner BSS is the OWE Transition Mode OWE BSS "WDI_OWE_TM_OWE" +/// - Per the spec, this network is hidden and contains an OWE TM element listing information about the partner BSS +/// - Listed in RNR of BSS WDI_OWE_RNR +/// - RNR IEs are not avertised by this BSS +/// +/// Intention +/// - Test OWE Transition Mode +/// - Test discovery of OWE Transition Mode network via RNR prior to receiving a beacon or probe +/// - Since the networks are indicated in order during scans, the RNR for this network will be received before its beacon. +/// +/// Expectation +/// - The OWE spec requires the STA to display the SSID of the Open BSS to the user for interoperability. User initiated connections to the SSID of the Open BSS +/// will initiate a connection to the OWE BSS and this is reflected in the security type in the UI. This allows STAs to view the same network SSID regardless of their +/// support for OWE, while also allowing the most secure connection to be made. +/// +/// - The UI will display: +/// - SSID: "WDI_OWE_TM_OPEN" (The SSID of the Open BSS) +/// - A hidden BSS may also be displayed, but only a single entry with an SSID is expected +/// - Security Description: "Enhanced Open" +/// - "Secured" or a lock icon should not be displayed +/// - No password prompt on connect +/// - "Connect" will initiate a connection to the OWE Transition Mode BSS Entry +/// - In the entry containing the BSSID of this BSS, "netsh wlan show networks mode=bss" displays +/// - SSID: (Hidden) +/// - Authentication: Open +/// - Encryption: None +/// +/// Limitations +/// - Connections to this network will fail because the driver does not OWE DH Handshake +WDI_MAC_ADDRESS s_ConnectAddr_28_OWE_TM_Open = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01}; +UCHAR s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x95, 0x00, // Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x62, 0x00, // Length + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x0F, // SSID + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'P', 'E', 'N', + 0x01, 0x08, 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x04, 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + 0xDD, 0x19, // Vendor specific - OWE Transition Mode + 0x50, 0x6F, 0x9A, 0x1C, // WFA OUI + OWE TM OUI (0x1C) + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x00, // Partner BSS BSSID + 0x0E, // Partner BSS SSID Length + 'W', 'D', 'I', '_', 'O', 'W', 'E', '_', 'T', 'M', '_', 'O', 'W', 'E', // Partner BSS SSID + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x0B, 0x00, 0x00, 0x00, // Channel + 0x01, 0x00, 0x00, 0x00 // BandId +}; + +// Test client hasn't implemented OWE DH handshake, so just indicate assoc failure +UCHAR s_TLV_Failure_AssociationResult_28_OWE_TM_Open [] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0x46, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x01, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x01, 0x00, 0x00, 0x00, //Association Status: WDI_ASSOC_STATUS_FAILURE + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x00, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, // DisableDataPathOffloadsScenario + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +//=============================================================================== +// +// Wi-Fi 7 +// +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_29_WiFi7_Mixed_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02}; +WDI_MAC_ADDRESS s_Connect_Addr_30_WiFi7_Mixed_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03}; +WDI_MAC_ADDRESS s_Connect_Addr_31_WiFi7_Mixed_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04}; +WDI_MAC_ADDRESS s_Connect_Addr_32_WiFi7_Mixed_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05}; + +UCHAR s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xfa, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // Link 1 MAC address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0xc7, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x32, 0x01, // DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0xFB, // BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xc0, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x03, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7e, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x9b, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0f, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'M', 'i', 'x', 'e', 'd', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x32, 0x01, + 0xFB, // H2E Only + 0x30, 0x2a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x03, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x04, // Pairwise Cipher = CCMP-128 + 0x00, 0x0F, 0xAC, 0x08, // Pairwise Cipher = GCMP-128 + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x03, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x02, // AKM Suite - PSK + 0x00, 0x0F, 0xAC, 0x08, // AKM Suite - SAE-256 + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x02, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x04, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x05, // STA Info : MAC address + // STA Profile + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_33_WiFi7_Open_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06}; +WDI_MAC_ADDRESS s_Connect_Addr_34_WiFi7_Open_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07}; +WDI_MAC_ADDRESS s_Connect_Addr_35_WiFi7_Open_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08}; +WDI_MAC_ADDRESS s_Connect_Addr_36_WiFi7_Open_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09}; + +UCHAR s_TLV_BSS_Entry_34_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +UCHAR s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x07, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'O', 'p', 'e', 'n', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== + +WDI_MAC_ADDRESS s_Connect_Addr_37_WiFi7_Only_MLD = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a}; +WDI_MAC_ADDRESS s_Connect_Addr_38_WiFi7_Only_Link_1 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b}; +WDI_MAC_ADDRESS s_Connect_Addr_39_WiFi7_Only_Link_2 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c}; +WDI_MAC_ADDRESS s_Connect_Addr_40_WiFi7_Only_Link_3 = {0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d}; + +UCHAR s_TLV_BSS_Entry_38_WiFi7_Only_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xe8, 0x00, //Len + + // WDI_TLV_BSSID = 10 = 0xa + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // Link 1 MAC address + + // WDI_TLV_BEACON_FRAME = 143 = 0x8f + 0x0a, 0x00, + 0xb5, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP-256 + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xCC, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x01, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x32, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // BandId +}; + +UCHAR s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xaf, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0b, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x08, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_AUTH_ALGO_WPA3_SAE = 9 + 0x09, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x09, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_CIPHER_ALGO_GCMP_256 = 9 + 0x0C, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_CIPHER_ALGO_BIP_GMAC_256 = C + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x01, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x7f, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0x30, 0x1A, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x04, // Group Cipher = CCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Sta MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : STA Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Sta Link 2 MAC address + // STA Profile + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, + 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : AP Link 2 MAC address + // STA Profile + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x89, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x10, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'a', 'k', 'm', ':', '2', '4', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, 0x06, // DSS Parameters + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, 0x00, // ERP + 0x2F, 0x01, 0x00, // Reserved + 0x30, 0x1a, + 0x01, 0x00, // Version + 0x00, 0x0F, 0xAC, 0x09, // Group Cipher = GCMP + 0x01, 0x00, // Pairwise Cipher Count + 0x00, 0x0F, 0xAC, 0x09, // Pairwise Cipher = GCMP + 0x01, 0x00, // AKM Suite Count + 0x00, 0x0F, 0xAC, 0x18, // AKM Suite - SAE-384 (Wi-Fi 7) + 0xC0, 0x00, // RSN Capability = MFPC + MFPR + ... + 0x00, 0x00, // PMKID Count + 0x00, 0x0F, 0xAC, 0x0C, // Group Mgmt Cipher = GMAC + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0a, // MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0c, // STA Info : MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x0d, // STA Info : MAC address + // STA Profile + 0x32, 0x04, // Extended Supported Rates: DOT11_INFO_ELEMENT_ID_EXTD_SUPPORTED_RATES + 0x0C, 0x12, 0x18, 0xFB, // 0xFB = BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== +// DualSta networks +//=============================================================================== +// + +WDI_MAC_ADDRESS s_Connect_Addr_41_DualSta_5Ghz = {0x00, 0x51, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_41_DualSta_5Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x24, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x51, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +// ----- + +WDI_MAC_ADDRESS s_Connect_Addr_42_DualSta_6Ghz = {0x00, 0x52, 0x30, 0x40, 0x50, 0x60}; +UCHAR s_TLV_BSS_Entry_42_DualSta_6Ghz [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0x63, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_PROBE_RESPONSE_FRAME + 0x09, 0x00, // Type + 0x35, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, // Supported Rates + 0x02, 0x04, 0x0B, 0x16, + 0x03, 0x01, // DSSS Parameter + 0x01, + 0x05, 0x04, // TIM + 0x00, 0x01, 0x00, 0x00, + 0x46, 0x05, // RM Enabled Capabilities + 0x02, 0x00, 0x00, 0x00, 0x00, + 0xDD, 0x07, // Vendor specific - MBO-OCE IE + 0x50, 0x6F, 0x9A, // WFA OUI + 0x16, // MBO-OCE IE OUI Type + 0x01, // Attribute ID - AP capability + 0x01, // Attrib length + 0x00, // Not cellular data aware + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x04, 0x00, + 0x04, 0x05, 0x06, 0x07, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_CHANNEL_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x09, 0x00, 0x00, 0x00, // Channel + 0x05, 0x00, 0x00, 0x00 // Band ID +}; + +UCHAR s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xD7, 0x00, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x00, 0x52, 0x30, 0x40, 0x50, 0x60, + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, //Association Status + 0x00, 0x00, 0x00, 0x00, //Status Code + 0x00, //ReAssociationRequest + 0x01, 0x00, 0x00, 0x00, //AuthAlgorithm + 0x00, 0x00, 0x00, 0x00, //UnicastCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastDataCipherAlgorithm + 0x00, 0x00, 0x00, 0x00, //MulticastMgmtCipherAlgorithm + 0x00, //FourAddressSupported + 0x00, //Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, //DSInfo + 0x00, 0x00, 0x00, 0x00, //AssociationComebackTime + 0x05, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x30, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x08, // Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x21, 0x02, // Power Capability + 0x07, 0x12, + 0x24, 0x02, // Supported Channels + 0x01, 0x0B, + 0x32, 0x04, // Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x07, // WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x30, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, //Rates + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, + 0x32, 0x04, //Extended Rates + 0x0C, 0x12, 0x18, 0x60, + 0xDD, 0x18, //WMM settings + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, + 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, + + // WDI_TLV_BEACON_PROBE_RESPONSE + 0x30, 0x00, // Type + 0x25, 0x00, // Length + 0x00, 0x11, 0x22, 0x33, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x00, 0x04, // Capability + 0x00, 0x08, + 'D', 'u', 'a', 'l', '-', 'S', 't', 'a', // SSID + 0x01, 0x04, 0x02, 0x04, 0x0B, 0x16, // Supported Rates + 0x03, 0x01, 0x01, // DSSS Parameter + 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, // TIM + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x07, 0x00, 0x00, 0x00, + +}; + +//=============================================================================== +// Data throughput test networks +//=============================================================================== +// + +__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x01}; +__declspec(selectany) WDI_MAC_ADDRESS s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1 = {0x22, 0x22, 0x22, 0x22, 0x00, 0x02}; +__declspec(selectany) UCHAR s_TLV_BSS_Entry_43_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x22, 0x22, 0x22, 0X22, 0x00, 0x01, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '1', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + + +__declspec(selectany) UCHAR s_TLV_BSS_Entry_44_WiFi7_Open_Link_1 [] = +{ + // WDI_TLV_BSS_ENTRY + 0x08, 0x00, //Type + 0xca, 0x00, //Len + + // WDI_TLV_BSSID + 0x02, 0x00, // Type + 0x06, 0x00, // Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 address + // WDI_TLV_BEACON_FRAME + 0x0a, 0x00, + 0x97, 0x00, + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x64, 0x00, // Beacon Interval + 0x01, 0x00, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // [B7-B4] [B3-B0] [B15-B12] [b11-B8] + // [EML=0 + Medium=0 + BSS=1 + LinkID=1] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=0] + 0x20, 0x00, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link2 MAC address + // Remaining STA Profile for Link 2 + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x37, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 3 MAC address + // Remaining STA Profile for Link 3 + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_BSS_ENTRY_DEVICE_CONTEXT + 0x0d, 0x00, + 0x09, 0x00, + 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07, 0x00, + + // WDI_TLV_BSS_ENTRY_SIGNAL_INFO + 0x0b, 0x00, + 0x08, 0x00, + 0xCE, 0xFF, 0xFF, 0xFF, // RSSI + 0x5A, 0x00, 0x00, 0x00, // Link Quality + + // WDI_TLV_BSS_ENTRY_PHY_INFO + 0x3a, 0x00, + 0x08, 0x00, + 0x9d, 0x00, 0x00, 0x00, // Channel + 0x02, 0x00, 0x00, 0x00 // BandId + +}; + +__declspec(selectany) UCHAR s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1[] = +{ + // WDI_TLV_ASSOCIATION_RESULT + 0x35, 0x00, + 0xb3, 0x01, + + // WDI_TLV_BSSID + 0x02, 0x00, + 0x06, 0x00, + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // AP Link 1 Mac Address + + // WDI_TLV_ASSOCIATION_RESULT_PARAMETERS + 0x2D, 0x00, + 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, // Association Status + 0x00, 0x00, 0x00, 0x00, // Status Code + 0x00, // ReAssociationRequest + 0x00, 0x00, 0x00, 0x00, // AuthAlgorithm = WDI_CIPHER_ALGO_NONE = 0 + 0x00, 0x00, 0x00, 0x00, // UnicastCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastDataCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, 0x00, 0x00, 0x00, // MulticastMgmtCipherAlgorithm = WDI_AUTH_ALGO_80211_OPEN = 0 + 0x00, // FourAddressSupported + 0x00, // Port Authorized + 0x00, // WMM QoS Enabled + 0x00, 0x00, 0x00, 0x00, // DSInfo + 0x00, 0x00, 0x00, 0x00, // AssociationComebackTime + 0x02, 0x00, 0x00, 0x00, // Band ID + 0x00, 0x00, 0x00, 0x00, // IHV Association Status + 0x00, 0x00, 0x00, 0x00, //DisableDataPathOffloadsScenario + + // WDI_TLV_ASSOCIATION_REQUEST_FRAME + 0x2E, 0x00, + 0x75, 0x00, + 0x21, 0x04, // Capabilities + 0x0A, 0x00, // Listen Interval + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Rates + 0x21, 0x02, + 0x07, 0x12, //Power Capability + 0x24, 0x02, + 0x01, 0x0B, //Supported Channels + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x08, + 0x00, 0x50, 0xF2, 0x02, 0x00, 0x01, 0x00, 0x03, // WMM settings + 0xff, 0x3d, // Multilink Extension Element + 0x6B, // Multilink Extension ID + // Multi-Link Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x80, 0x01, // [EML=1 + Medium=0 + BSS=0 + LinkID=0] [Reserved=0 + Basic=0] [Reserved=0000] [Reserved=000 MLD=1] + 0x0b, // Common Info length + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Local STA MLD Mac address (required for Basic) + // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + 0x81, 0x00, 0x00, // [ EML Capabilities (3 octets) ] + 0x02, 0x00, // [ MLD Capabilities (2 octets) - (2 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x32, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0010] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x21, // STA Info : Local Link 1 MAC address + // STA Profile + // Remaining STA Profile for Link 2 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x15, // Length = 21 + // STA Control = [B7-B4] [B3-B0] [B15-B12] [b11-B8] + 0x33, 0x00, // [DTIM=0 + BeaconInt=0 + MAC=1 + Complete=1] [LinkID=0011] [Reserved=0000] [Reserved=0 + BSS=0 + NTSRBit=0 + NTSRPres=0] + 0x06, // Length + 0x11, 0x01, 0x02, 0x03, 0x04, 0x22, // STA Info : Local Sta Link 2 MAC address + // STA Profile + // Remaining STA Profile for Link 3 + 0x11, 0x15, 0x21, 0x02, 0x00, 0x0e, 0xff, 0x03, 0x38, 0x01, 0x30, 0x00, + + + // WDI_TLV_ASSOCIATION_RESPONSE_FRAME + 0x2F, 0x00, + 0x55, 0x00, + 0x01, 0x04, //Capability + 0x00, 0x00, //Status + 0x01, 0xC0, //Association ID + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, //Rates + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, //Extended Rates + 0xDD, 0x18, + 0x00, 0x50, 0xF2, 0x02, 0x01, 0x01, 0x80, 0x00, 0x03, 0xA4, 0x00, 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62, 0x32, 0x2F, 0x00, //WMM settings + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x01, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x22, 0x22, 0x22, 0x22, 0x00, 0x02, // STA Info : AP Link 2 MAC address + // STA Profile + + + // WDI_TLV_BEACON_FRAME + 0x30, 0x00, + 0x97, 0x00, + + 0x22, 0x02, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, // Timestamp + 0x01, 0x00, // Beacon Interval + 0x31, 0x04, // Capability + 0x00, 0x0e, // SSID + 'W', 'i', '-', 'F', 'i', ' ', '7', ' ', '-', ' ', 'D', 'T', '0', '2', + 0x01, 0x08, + 0x82, 0x84, 0x8B, 0x96, 0x24, 0x30, 0x48, 0x6C, // Supported Rates + 0x03, 0x01, + 0x06, // DSS Parameters + 0x05, 0x04, + 0x00, 0x01, 0x00, 0x00, // TIM + 0x2A, 0x01, + 0x00, // ERP + 0x2F, 0x01, + 0x00, // Reserved + 0xff, 0x23, // Multilink Extension Element + 0x6B, // Multilink Extension ID + 0x01, 0x10, // MultiLink Control ([Reserved=0000000 + MLDCapabilities=1 + 000 + LinkID=1 + Reserved=0 + Basic=000] = 0000000 1 000 1 0 000 = 0x0110) + 0x09, // Common Info length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x06, // AP MLD Mac address (required for Basic) + 0x01, // [ Link ID (1 octet) - in Beacon/ProbeResp/(Re)AssocResp frames ] + // [ BSS Parameters Change Count (1 octet) - from AP only ] + // [ Medium Synchronization delay (2 octets) - from AP only] + // [ EML Capabilities (2 octets) ] + 0x00, 0x03, // [ MLD Capabilities (2 octets) - (3 links max) in Beacon/ProbeResp/(Re)AssocReq/(Re)AssocResp frames ] + // Per-Sta profile - 1/2 (Link 2) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x22, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // STA Info : AP Link 1 MAC address + // STA Profile + // Per-Sta profile - 2/2 (Link 3) + 0x00, // Subelement ID = 0 for Per-Sta Profile Element + 0x09, // Length + 0x00, 0x23, // STA Control = (Reserved=00000+BSSParam=0+NTSRBS=0+NTSRLP=0+DTIM=0+BeaconInt=0+MAC=1+CompleteP=0+LinkID=0001) = 0x0021 + 0x00, // STA Info : Length + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // STA Info : AP Link 2 MAC address + // STA Profile + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x08, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x03, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0xc9, 0x14, // RNR IE + 0x04, 0x10, // TBTT: 0x04 => B2=1(FilteredAP),B4-B7=0(TBTT Information Count=0+1) :: 0x0c = TBTT Length + 0x51, 0x06, // Operating Class = 81 (2.4 GHz), Channel = 6 + 0x00, // TBTTOffset + 0x00, 0xA0, 0xB0, 0xC0, 0xD1, 0x09, // Bssid + 0x1d, 0xc5, 0x3b, 0x12, // ShortSsid + 0x40, // BssParameters + 0x00, // 20 MHz + 0x12, 0x07, 0x56, // Mld Parameters: MLD ID(8 bits) : LinkID (4 bits) + ... + 0x32, 0x04, + 0x0C, 0x12, 0x18, 0x60, // Extended Supported Rates + 0xDD, 0x09, + 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // Vendor Specific + + // WDI_TLV_PHY_TYPE_LIST + 0x19, 0x00, + 0x04, 0x00, + 0x0b, 0x00, 0x00, 0x00, // dot11_phy_type_eht + +}; + +//=============================================================================== +//=============================================================================== + +typedef struct +{ + UINT32 BandId; + WDI_MAC_ADDRESS* pMacAddress; + PUCHAR pTlvBssEntry; + UINT32 TlvBssEntrySize; + PUCHAR pTlvAssociationResult; + UINT32 TlvAssociationResultSize; + +} WdiTestConnectEntry, * PWdiTestConnectEntry; + +WdiTestConnectEntry g_ConnectEntries[] = +{ + // 0 + { // 0th Entry is disconnected state + 0, + nullptr, + nullptr, 0, + nullptr, 0, + }, + + // 1 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr, + s_TLV_BSS_Entry_1, sizeof(s_TLV_BSS_Entry_1), + s_TLV_SuccessOpenAssociationResult, sizeof(s_TLV_SuccessOpenAssociationResult), + }, + + // 2 - WFC_OPEN + { + WDI_BAND_ID_2400, + &s_Connect_Addr_2_Open, + s_TLV_BSS_Entry_2_Open, sizeof(s_TLV_BSS_Entry_2_Open), + s_TLV_Success_AssociationResult_2_Open, sizeof(s_TLV_Success_AssociationResult_2_Open), + }, + + // 3 - WDI__WEP + { + WDI_BAND_ID_2400, + &s_Connect_Addr_3_WEP, + s_TLV_BSS_Entry_3_WEP, sizeof(s_TLV_BSS_Entry_3_WEP), + s_TLV_Success_AssociationResult_3_WEP, sizeof(s_TLV_Success_AssociationResult_3_WEP), + }, + + // 4 - WDI_SECURE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_4_RSNA_CCMP, + s_TLV_BSS_Entry_4_RSNA_CCMP, sizeof(s_TLV_BSS_Entry_4_RSNA_CCMP), + s_TLV_Success_AssociationResult_4_RSNA_CCMP, sizeof(s_TLV_Success_AssociationResult_4_RSNA_CCMP), + }, + + // 5 - WDI__IHV + { + TESTMP_BAND_IHV, + &s_Connect_Addr_5_IHV, + s_TLV_BSS_Entry_5_IHV, sizeof(s_TLV_BSS_Entry_5_IHV), + s_TLV_Success_AssociationResult_5_IHV, sizeof(s_TLV_Success_AssociationResult_5_IHV), + }, + + // 6 - WDI__FT + { + WDI_BAND_ID_2400, + &s_Connect_Addr_6_FT_CCMP, + s_TLV_BSS_Entry_6_FT_CCMP, sizeof(s_TLV_BSS_Entry_6_FT_CCMP), + s_TLV_Success_AssociationResult_6_FT_CCMP, sizeof(s_TLV_Success_AssociationResult_6_FT_CCMP), + }, + + // 7 - WDI__FTPSK + { + WDI_BAND_ID_2400, + &s_Connect_Addr_7_FT_PSK_CCMP, + s_TLV_BSS_Entry_7_FT_PSK_CCMP, sizeof(s_TLV_BSS_Entry_7_FT_PSK_CCMP), + s_TLV_Success_AssociationResult_7_FT_PSK_CCMP, sizeof(s_TLV_Success_AssociationResult_7_FT_PSK_CCMP), + }, + + // 8 - + { + WDI_BAND_ID_2400, + &s_Connect_Addr_8_Hidden, + s_TLV_BSS_Entry_Beacon_8_Hidden, sizeof(s_TLV_BSS_Entry_Beacon_8_Hidden), + s_TLV_Success_AssociationResult_8_Hidden, sizeof(s_TLV_Success_AssociationResult_8_Hidden), + }, + + // 9 - WDI_adPSK + { + WDI_BAND_ID_60000, + &s_Connect_Addr_9_11ad_PSK, + s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK, sizeof(s_TLV_BSS_Entry_9_11ad_ProbeResponse_PSK), + s_TLV_Success_AssociationResult_9_11ad_PSK, sizeof(s_TLV_Success_AssociationResult_9_11ad_PSK), + }, + + // 10 - WDI_ad_1x + { + WDI_BAND_ID_60000, + &s_Connect_Addr_10_11ad_1x, + s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x, sizeof(s_TLV_BSS_Entry_10_11ad_ProbeResponse_1x), + s_TLV_Success_AssociationResult_10_11ad_1x, sizeof(s_TLV_Success_AssociationResult_10_11ad_1x), + }, + + // 11 - WDI_ad_ON + { + WDI_BAND_ID_60000, + &s_Connect_Addr_11_11ad_Open, + s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open, sizeof(s_TLV_BSS_Entry_11_11ad_ProbeResponse_Open), + s_TLV_Success_AssociationResult_11_11ad_Open, sizeof(s_TLV_Success_AssociationResult_11_11ad_Open), + }, + + // 12 - WDI_OPEN_11ax.2.4 + { + WDI_BAND_ID_60000, + &s_Connect_Addr_12_11ax_24_Open, + s_TLV_BSS_Entry_12_11ax_24_Open, sizeof(s_TLV_BSS_Entry_12_11ax_24_Open), + s_TLV_Success_AssociationResult_12_11ax_24_Open, sizeof(s_TLV_Success_AssociationResult_12_11ax_24_Open), + }, + + // 13 - WDI_OPEN_11ax.5 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_13_11ax_5_Open, + s_TLV_BSS_Entry_13_11ax_5_Open, sizeof(s_TLV_BSS_Entry_13_11ax_5_Open), + s_TLV_Success_AssociationResult_13_11ax_5_Open, sizeof(s_TLV_Success_AssociationResult_13_11ax_5_Open), + }, + + // 14 - WDI_WPA3-SAE + { + WDI_BAND_ID_2400, + &s_Connect_Addr_14_WPA3_SAE_CCMP, + s_TLV_BSS_Entry_14_WPA3_SAE_CCMP, sizeof(s_TLV_BSS_Entry_14_WPA3_SAE_CCMP), + s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP, sizeof(s_TLV_Success_AssociationResult_14_WPA3_SAE_CCMP), + }, + + // 15 - WDI_SHA256 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_15_WPA2PSK_SHA256, + s_TLV_BSS_Entry_15_WPA2PSK_SHA256, sizeof(s_TLV_BSS_Entry_15_WPA2PSK_SHA256), + s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256, sizeof(s_TLV_Success_AssociationResult_15_WPA2PSK_SHA256), + }, + + // 16 - WDI_WPA3-SUITE_B + { + WDI_BAND_ID_2400, + &s_Connect_Addr_16_WPA3_SUITEB, + s_TLV_BSS_Entry_16_WPA3_SUITEB, sizeof(s_TLV_BSS_Entry_16_WPA3_SUITEB), + s_TLV_Success_AssociationResult_16_WPA3_SUITEB, sizeof(s_TLV_Success_AssociationResult_16_WPA3_SUITEB), + }, + + // 17 - 6E__1 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_17_6G_S1_2_4_Ghz, + s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz, sizeof(s_TLV_BSS_Entry_17_6G_S1_2_4_Ghz), + s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_17_6G_S1_2_4_Ghz), + }, + + // 18 - 6E__1 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_18_6G_S1_5_Ghz, + s_TLV_BSS_Entry_18_6G_S1_5_Ghz, sizeof(s_TLV_BSS_Entry_18_6G_S1_5_Ghz), + s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz, sizeof(s_TLV_Success_AssociationResult_18_6G_S1_5_Ghz), + }, + + // 19 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_19_6G_S1a_6_Ghz, + s_TLV_BSS_Entry_19_6G_S1a_6_Ghz, sizeof(s_TLV_BSS_Entry_19_6G_S1a_6_Ghz), + s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz, sizeof(s_TLV_Success_AssociationResult_19_6G_S1a_6_Ghz), + }, + + // 20 - 6E__1 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_20_6G_S1b_6_Ghz, + s_TLV_BSS_Entry_20_6G_S1b_6_Ghz, sizeof(s_TLV_BSS_Entry_20_6G_S1b_6_Ghz), + s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz, sizeof(s_TLV_Success_AssociationResult_20_6G_S1b_6_Ghz), + }, + + // 21 - 6E__2 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_21_6G_S2_2_4_Ghz, + s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz, sizeof(s_TLV_BSS_Entry_21_6G_S2_2_4_Ghz), + s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_21_6G_S2_2_4_Ghz), + }, + + // 22 - 6E__2 + { + WDI_BAND_ID_5000, + &s_Connect_Addr_22_6G_S2_5_Ghz, + s_TLV_BSS_Entry_22_6G_S2_5_Ghz, sizeof(s_TLV_BSS_Entry_22_6G_S2_5_Ghz), + s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz, sizeof(s_TLV_Success_AssociationResult_22_6G_S2_5_Ghz), + }, + + // 23 - 6E__2 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_23_6G_S2_6_Ghz, + s_TLV_BSS_Entry_23_6G_S2_6_Ghz, sizeof(s_TLV_BSS_Entry_23_6G_S2_6_Ghz), + s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz, sizeof(s_TLV_Success_AssociationResult_23_6G_S2_6_Ghz), + }, + + // 24 - 6E__3 + { + WDI_BAND_ID_2400, + &s_Connect_Addr_24_6G_S3_2_4_Ghz, + s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz, sizeof(s_TLV_BSS_Entry_24_6G_S3_2_4_Ghz), + s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz, sizeof(s_TLV_Success_AssociationResult_24_6G_S3_2_4_Ghz), + }, + + // 25 - 6E__4 + { + WDI_BAND_ID_6000, + &s_Connect_Addr_25_6G_S4_6_Ghz, + s_TLV_BSS_Entry_25_6G_S4_6_Ghz, sizeof(s_TLV_BSS_Entry_25_6G_S4_6_Ghz), + s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz, sizeof(s_TLV_Success_AssociationResult_25_6G_S4_6_Ghz), + }, + + // 26 - WDI_OWE_RNR + { + WDI_BAND_ID_2400, + &s_ConnectAddr_26_OWE_With_RNR, + s_TLV_BSS_Entry_26_OWE_With_RNR, sizeof(s_TLV_BSS_Entry_26_OWE_With_RNR), + s_TLV_Failure_AssociationResult_26_OWE_With_RNR, sizeof(s_TLV_Failure_AssociationResult_26_OWE_With_RNR) + }, + // 27 - + { + WDI_BAND_ID_2400, + &s_ConnectAddr_27_OWE_TM_OWE, + s_TLV_BSS_Entry_27_OWE_TM_OWE, sizeof(s_TLV_BSS_Entry_27_OWE_TM_OWE), + s_TLV_Failure_AssociationResult_27_OWE_TM_OWE, sizeof(s_TLV_Failure_AssociationResult_27_OWE_TM_OWE) + }, + // 28 - WDI_OWE_TM_OPEN + { + WDI_BAND_ID_2400, + &s_ConnectAddr_28_OWE_TM_Open, + s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon, sizeof(s_TLV_BSS_Entry_28_OWE_TM_Open_Beacon), + s_TLV_Failure_AssociationResult_28_OWE_TM_Open, sizeof(s_TLV_Failure_AssociationResult_28_OWE_TM_Open) + }, + + // 29 is only MLD address for Wi-Fi 7 + // 30 - Wi-Fi 7 - Mixed + { + WDI_BAND_ID_5000, + &s_Connect_Addr_30_WiFi7_Mixed_Link_1, + s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_BSS_Entry_30_WiFi7_Mixed_Link_1), + s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1, sizeof(s_TLV_Success_AssociationResult_30_WiFi7_Mixed_Link_1), + }, + // 34 - Wi-Fi 7 - Open + { + WDI_BAND_ID_5000, + &s_Connect_Addr_34_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_34_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_34_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_34_WiFi7_Open_Link_1), + }, + // 38 - Wi-Fi 7 - Only + { + WDI_BAND_ID_6000, + &s_Connect_Addr_38_WiFi7_Only_Link_1, + s_TLV_BSS_Entry_38_WiFi7_Only_Link_1, sizeof(s_TLV_BSS_Entry_38_WiFi7_Only_Link_1), + s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1, sizeof(s_TLV_Success_AssociationResult_38_WiFi7_Only_Link_1), + }, + + // 41 - Dual-Sta + { + WDI_BAND_ID_5000, + &s_Connect_Addr_41_DualSta_5Ghz, + s_TLV_BSS_Entry_41_DualSta_5Ghz, sizeof(s_TLV_BSS_Entry_41_DualSta_5Ghz), + s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_41_DualSta_5Ghz), + }, + + // 42 - Dual-Sta + { + WDI_BAND_ID_6000, + &s_Connect_Addr_42_DualSta_6Ghz, + s_TLV_BSS_Entry_42_DualSta_6Ghz, sizeof(s_TLV_BSS_Entry_42_DualSta_6Ghz), + s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz, sizeof(s_TLV_SuccessOpenAssociationResult_42_DualSta_6Ghz), + }, + + // 43 - Speed Test(01) + { + WDI_BAND_ID_5000, + &s_Connect_Addr_43_Speed_01_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_43_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_43_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_43_WiFi7_Open_Link_1), + }, + + // 44 - Speed Test(02) + { + WDI_BAND_ID_5000, + &s_Connect_Addr_44_Speed_02_WiFi7_Open_Link_1, + s_TLV_BSS_Entry_44_WiFi7_Open_Link_1, sizeof(s_TLV_BSS_Entry_44_WiFi7_Open_Link_1), + s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1, sizeof(s_TLV_Success_AssociationResult_44_WiFi7_Open_Link_1), + }, +}; + +// clang-format on diff --git a/network/wlan/wificx/drivercode/wifirequest.cpp b/network/wlan/wificx/drivercode/wifirequest.cpp new file mode 100644 index 00000000..fd02bd91 --- /dev/null +++ b/network/wlan/wificx/drivercode/wifirequest.cpp @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +#include "precomp.h" +#include "wifitransition.h" +#include "wifirequest.h" +#include "wifirequest.tmh" + +_Use_decl_annotations_ +void EvtWifiDeviceSendCommand(WDFDEVICE Device, WIFIREQUEST SendRequest) +{ + UINT InBufferLen = 0; + UINT OutBufferLen = 0; + void* Buffer = WifiRequestGetInOutBuffer(SendRequest, &InBufferLen, &OutBufferLen); + UINT16 MessageId = WifiRequestGetMessageId(SendRequest); + + TransitionContext tctx{ + Device, + WifiGetIhvDeviceContext(Device), + SendRequest, + static_cast(Buffer), + Buffer, + InBufferLen, + OutBufferLen + }; + + if(!NT_SUCCESS(RunTransitionByMessage(tctx, MessageId))) + { + WFCError("RunTransitionByMessage failed for MessageId: 0x%04X", MessageId); + return; + } +} + +void WifiIhvSendIndicationToOs( + _In_ WDFDEVICE Device, + _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, + _In_ UINT16 WifiRequestMessageId, + _In_ UINT32 WifiRequestTransactionId, + _In_ NTSTATUS WifiRquestM4Status, + _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, + _In_ UINT32 TlvDataSize) +{ + WDFMEMORY data = WDF_NO_HANDLE; + PUCHAR pIndicationBuffer = nullptr; + PWDI_MESSAGE_HEADER pIndicationHeader = nullptr; + SIZE_T indicationSize = sizeof(WDI_MESSAGE_HEADER) + TlvDataSize; + WDF_OBJECT_ATTRIBUTES objectAttribs; + + WDF_OBJECT_ATTRIBUTES_INIT(&objectAttribs); + objectAttribs.ParentObject = Device; + + if(!NT_SUCCESS(WdfMemoryCreate(&objectAttribs, NonPagedPoolNx, 0, indicationSize, &data, reinterpret_cast(&pIndicationBuffer)))) + { + WFCError("Failed to create indication buffer"); + return; + } + + RtlZeroMemory(pIndicationBuffer, indicationSize); + pIndicationHeader = reinterpret_cast(pIndicationBuffer); + pIndicationHeader->PortId = pOriginalWdiHeader->PortId; + pIndicationHeader->Reserved = pOriginalWdiHeader->Reserved; + pIndicationHeader->Status = Wifi::ConvertNDISSTATUSToNTSTATUS(WifiRquestM4Status); + pIndicationHeader->TransactionId = WifiRequestTransactionId; + pIndicationHeader->IhvSpecificId = pOriginalWdiHeader->IhvSpecificId; + + if (TlvDataSize > 0 && pTlvData != nullptr) + { + RtlCopyMemory(pIndicationBuffer + sizeof(WDI_MESSAGE_HEADER), pTlvData, TlvDataSize); + } + + // Send the indication up to WifiCx + WifiDeviceReceiveIndication(Device, WifiRequestMessageId, data); + + // Don't need to keep this around + WdfObjectDelete(data); +} + +_Use_decl_annotations_ +void WifiIhvSendUnsolicitedIndicationToOs(WDFDEVICE Device, PWDI_MESSAGE_HEADER pWdiHeader, UINT16 MessageId, PUCHAR pTlvData, UINT32 TlvDataSize) +{ + WifiIhvSendIndicationToOs(Device, pWdiHeader, MessageId, 0, STATUS_SUCCESS, pTlvData, TlvDataSize); //TransactionId required to be 0 for unsolicited indications. +} +_Use_decl_annotations_ +void WifiIhvNotifyM3Completion(WIFIREQUEST Request, NTSTATUS WifiRequestM3Status, UINT BytesWritten) +{ + if(!NT_SUCCESS(WifiRequestM3Status)) + { + WFCError("WifiRequest M3 failed: %!STATUS!, BytesWritten: %d\n", WifiRequestM3Status, BytesWritten); + } + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiRequestComplete(Request, WifiRequestM3Status, BytesWritten); +} + +_Use_decl_annotations_ +void WifiIhvSendM4IndicationToOs(WDFDEVICE Device, UINT16 WifiRequestMessageId, const PWDI_MESSAGE_HEADER pWdiHeader, NTSTATUS WifiRequestM4Status) +{ + WifiIhvSendIndicationToOs(Device, pWdiHeader, WifiRequestMessageId, pWdiHeader->TransactionId, WifiRequestM4Status, nullptr, 0); +} \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/wifirequest.h b/network/wlan/wificx/drivercode/wifirequest.h new file mode 100644 index 00000000..74380548 --- /dev/null +++ b/network/wlan/wificx/drivercode/wifirequest.h @@ -0,0 +1,23 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "device.h" + +EVT_WIFI_DEVICE_SEND_COMMAND EvtWifiDeviceSendCommand; + +void WifiIhvSendUnsolicitedIndicationToOs( + _In_ WDFDEVICE Device, + _In_ PWDI_MESSAGE_HEADER pWdiHeader, + _In_ UINT16 MessageId, + _In_opt_bytecount_(TlvDataSize) PUCHAR pTlvData, + _In_ UINT32 TlvDataSize); + +void WifiIhvNotifyM3Completion( + _In_ WIFIREQUEST Request, + _In_ NTSTATUS WifiRequestM3Status, + _In_ UINT BytesWritten); + +void WifiIhvSendM4IndicationToOs( + _In_ WDFDEVICE Device, + _In_ UINT16 WifiRequestMessageId, + _In_ const PWDI_MESSAGE_HEADER pOriginalWdiHeader, + _In_ NTSTATUS WifiRequestM4Status); \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/wifitransition.cpp b/network/wlan/wificx/drivercode/wifitransition.cpp new file mode 100644 index 00000000..41106932 --- /dev/null +++ b/network/wlan/wificx/drivercode/wifitransition.cpp @@ -0,0 +1,338 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. + +#include "wifitransition.h" + +// Common TLV parsing helper: computes TLV span, optional dump, calls a parser, converts status. +template +NTSTATUS ParseTlvCommon(TransitionContext& ctx, + UINT16 messageId, + ParserFn parser, + Param& outParams, + bool dumpStream = true) +{ + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); + + if (dumpStream) + { + DumpMessageTlvByteStream( + messageId, + TRUE, + ctx.DevCtx->TlvContext.PeerVersion, + tlvLen, + tlvBytes, + 0, + nullptr); + } + + auto ndisStatus = parser(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &outParams); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); +} + + +// Primary traits template (specialize per MessageId) +template +struct TransitionTraits; + +// --- Generic pure-type traits template (add before existing specializations) --- +// WIFIREQUEST always needs M3 notification, so TPreM3Fn is mandatory. +// and WIFICX expectes the M3 then M4 order, so we always execute M3 then M4. +// using template parameters to configure parsing, cleanup, M3/M4 steps. +// to make sure that all transitions have consistent implementations. +template< + UINT16 TMsgId, + typename TParam, + UINT16 TCompleteIndication, + bool TDumpTlvStream, + NDIS_STATUS (*TParseFn)(ULONG, const UINT8*, PCTLV_CONTEXT, TParam*), + void (*TCleanupFn)(TParam*), + NTSTATUS (WifiHAL::*TPreM3Fn)(), // mandatory pre-M3 hook + NTSTATUS (WifiHAL::*THalM3Fn)(const TParam&, const PWDI_MESSAGE_HEADER, UINT BytesWriten), // optional HAL M3 (may be nullptr) + NTSTATUS (WifiHAL::*TPreM4Fn)(), // optional pre-M4 hook (may be nullptr) + NTSTATUS (WifiHAL::*THalM4Fn)(const PWDI_MESSAGE_HEADER) // optional HAL M4 (may be nullptr) +> +struct GenericTransitionTraits +{ + using ParamType = TParam; + enum : UINT16 { CompleteIndication = TCompleteIndication }; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); + + if (TDumpTlvStream) + { + DumpMessageTlvByteStream( + TMsgId, + TRUE, + ctx.DevCtx->TlvContext.PeerVersion, + tlvLen, + tlvBytes, + 0, + nullptr); + } + + auto ndisStatus = TParseFn(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &p); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); + } + + void Cleanup(ParamType& p) { TCleanupFn(&p); } + + // Make static so pointer matches ExecuteSteps expected callable type (no implicit this) + static NTSTATUS StepM3(TransitionContext& c, ParamType& p, UINT& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + ASSERT(TPreM3Fn); + + if (TPreM3Fn) + { + // Call member function pointer on WifiHAL instance + NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM3Fn)(); + if (!NT_SUCCESS(preStatus)) + { + return preStatus; + } + } + + if (THalM3Fn) + { + // Pass required third argument (BytesWriten) to HAL M3 function + return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM3Fn)(p, c.Header, bytesWritten); + } + + return STATUS_SUCCESS; + } + + static NTSTATUS StepM4(TransitionContext& c, ParamType&) + { + if (TPreM4Fn) + { + NTSTATUS preStatus = (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*TPreM4Fn)(); + if (!NT_SUCCESS(preStatus)) + { + return preStatus; + } + } + + if (THalM4Fn) + { + return (GetWifiHalFromHandle(c.DevCtx->WdfDevice)->*THalM4Fn)(c.Header); + } + + return (TPreM4Fn == nullptr && THalM4Fn == nullptr) ? STATUS_PENDING : STATUS_SUCCESS; + } + + NTSTATUS Handle(TransitionContext& ctx, ParamType& p) + { + return ExecuteSteps(ctx, p, &GenericTransitionTraits::StepM3, &GenericTransitionTraits::StepM4); + } + + bool ShouldSendComplete(NTSTATUS s) const { return s != STATUS_PENDING; } +}; + +// Execute two step callables. +// StepM3Fn signature: NTSTATUS (TransitionContext&, Param&, UINT& bytesWritten) +// StepM4Fn signature: NTSTATUS (TransitionContext&, Param&) +// Always calls WifiRequestComplete after StepM3 with the bytesWritten produced by StepM3. +// Skips StepM4 if StepM3 failed +template +NTSTATUS ExecuteSteps(TransitionContext& ctx, Param& p, StepM3Fn stepM3, StepM4Fn stepM4) +{ + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); // default minimum + NTSTATUS m3Status = stepM3(ctx, p, bytesWritten); + // Report the M3 status back to OS + // OS expects M3 before the M4 + WifiIhvNotifyM3Completion(ctx.WifiRequest, m3Status, bytesWritten); + if (!NT_SUCCESS(m3Status)) + { + return m3Status; + } + return stepM4(ctx, p); +} + +// -------- Generic runner (compile-time) -------- +template +NTSTATUS RunTransition(TransitionContext& ctx) +{ + TransitionTraits traits; + typename TransitionTraits::ParamType params{}; + NTSTATUS parseStatus = traits.Parse(ctx, params); + if (!NT_SUCCESS(parseStatus)) + { + traits.Cleanup(params); + // Report Failed M3 to OS + // Note: No M4 indication on parse failure + WifiIhvNotifyM3Completion(ctx.WifiRequest, parseStatus, 0); + return parseStatus; + } + + NTSTATUS m4Status = traits.Handle(ctx, params); + + if (traits.ShouldSendComplete(m4Status)) + { + WifiIhvSendM4IndicationToOs( + ctx.Device, + TransitionTraits::CompleteIndication, + ctx.Header, + m4Status); + } + + traits.Cleanup(params); + return m4Status; +} + +//// -------- SCENARIO: [Connect with a SAE WI-FI7 network -------- +/// Demo: Handle WDI_TASK_CONNECT + WDI_SET_SAE_AUTH_PARAMS then WDI_TASK_DISCONNECT +/// Scope: +/// -WifiRequest WDI_TASK_CONNECT & WDI_TASK_DISCONNECT are both WIFICX task commands, which is a two step M3/M4 transition +/// -The direct WifiRequest WDI_SET_SAE_AUTH_PARAMS, which is a single step transition but +/// is logically part of the connect scenario. since WDI_SET_SAE_AUTH_PARAMS is WIFICX property command, +/// it only has M3 step, no M4 step. +/// - The WifiCx unsolicited indication e.g. WDI_INDICATION_SAE_AUTH_PARAMS_NEEDED is sent from the HAL during the connect process, +/// Notes: +/// - M3 and M4 status mainly used for WifiCx to track progress of the transition. e.g. the hung detection and trigger recovery. +/// - The actual scenario result is reported through unsolicited indication. +/// + +// -------- WDI_TASK_CONNECT -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_CONNECT, + WDI_TASK_CONNECT_PARAMETERS, + WDI_INDICATION_CONNECT_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskConnect, + CleanupParsedWdiTaskConnect, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvConnect, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr + > +{ +}; + +// --- WDI_SET_SAE_AUTH_PARAMS --- +template<> +struct TransitionTraits + : GenericTransitionTraits< + WDI_SET_SAE_AUTH_PARAMS, + WDI_SET_SAE_AUTH_PARAMS_COMMAND, + WDI_INDICATION_CONNECT_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiSetSaeAuthParams, + CleanupParsedWdiSetSaeAuthParams, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvSetSaeAuthParams, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr// HAL M4 + > +{}; + +// -------- WDI_TASK_DISCONNECT -------- +template<> +struct TransitionTraits + : GenericTransitionTraits< + WDI_TASK_DISCONNECT, + WDI_TASK_DISCONNECT_PARAMETERS, + WDI_INDICATION_DISCONNECT_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiTaskDisconnect, + CleanupParsedWdiTaskDisconnect, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvDisconnect, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; +/// ----- End of scenario [Connect with a SAE WI-FI7 network]----- + +// -------- WDI_TASK_DOT11_RESET -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_DOT11_RESET, + WDI_TASK_DOT11_RESET_PARAMETERS, + WDI_INDICATION_DOT11_RESET_COMPLETE, + false, // dump TLV stream? (was false in original) + ParseWdiTaskDot11Reset, + CleanupParsedWdiTaskDot11Reset, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvReset, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; + +// -------- WDI_TASK_SCAN -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_SCAN, + WDI_SCAN_PARAMETERS, + WDI_INDICATION_SCAN_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskScan, + CleanupParsedWdiTaskScan, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvScan, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; + +// -------- WDI_TASK_SET_RADIO_STATE -------- +template<> +struct TransitionTraits + : GenericTransitionTraits < + WDI_TASK_SET_RADIO_STATE, + WDI_SET_RADIO_STATE_PARAMETERS, + WDI_INDICATION_SET_RADIO_STATE_COMPLETE, + true, // dump TLV stream? (was true in original) + ParseWdiTaskSetRadioState, + CleanupParsedWdiTaskSetRadioState, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-M3 + &WifiHAL::WifiIhvSetRadioState, // HAL M3 + &WifiHAL::WifiIhvGetPendingTransitionStatus, // pre-M4 + nullptr // HAL M4 + > +{ +}; + +// Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. +NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) +{ + switch (messageId) + { + case WDI_TASK_SET_RADIO_STATE: + return RunTransition(ctx); + case WDI_TASK_SCAN: + return RunTransition(ctx); + case WDI_TASK_DOT11_RESET: + return RunTransition(ctx); + case WDI_TASK_CONNECT: + return RunTransition(ctx); + case WDI_TASK_DISCONNECT: + return RunTransition(ctx); + case WDI_SET_SAE_AUTH_PARAMS: + return RunTransition(ctx); + default: + UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); + WifiRequestComplete(ctx.WifiRequest, STATUS_NOT_SUPPORTED, bytesWritten); + return STATUS_NOT_SUPPORTED; + } +} \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/wifitransition.h b/network/wlan/wificx/drivercode/wifitransition.h new file mode 100644 index 00000000..a0addf88 --- /dev/null +++ b/network/wlan/wificx/drivercode/wifitransition.h @@ -0,0 +1,20 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +#pragma once +#include "precomp.h" +#include "wifiHAL.h" +#include "wifirequest.h" + +// Generic execution context passed between steps and parse/handle +struct TransitionContext +{ + WDFDEVICE Device; + PWIFI_IHV_DEVICE_CONTEXT DevCtx; + WIFIREQUEST WifiRequest; + PWDI_MESSAGE_HEADER Header; + void* RawBuffer; + UINT InLen; + UINT OutLen; +}; + +// -------- Runtime dispatcher (decl) -------- +NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId); \ No newline at end of file diff --git a/network/wlan/wificx/km/wificxsampleclientkm.inf b/network/wlan/wificx/km/wificxsampleclientkm.inf new file mode 100644 index 00000000..1968ff32 --- /dev/null +++ b/network/wlan/wificx/km/wificxsampleclientkm.inf @@ -0,0 +1,96 @@ +;Copyright (c) Microsoft Corporation. All rights reserved. +; wificxsampleclientkm.inf +; + +[Version] +Signature = "$WINDOWS NT$" +Class = NET +ClassGuid = {4d36e972-e325-11ce-bfc1-08002be10318} +Provider = %ManufacturerName% +CatalogFile = wificxsampleclientkm.cat +DriverVer = ; TODO: set DriverVer in stampinf property pages +PnpLockdown = 1 + +[DestinationDirs] +DefaultDestDir = 13 + +[SourceDisksNames] +1 = %DiskName%,,,"" + +[SourceDisksFiles] +wificxsampleclientkm.sys = 1,, + +;***************************************** +; Install Section +;***************************************** + +[Manufacturer] +%ManufacturerName% = Standard,NT$ARCH$.10.0...16299 ; %13% support introduced in build 16299 + +[Standard.NT$ARCH$.10.0...16299] +%wificxsampleclientkm.DeviceDesc% = wificxsampleclientkm_Device.ndi, Root\wificxsampleclientkm + +; +; Normal device - Networking Section +; +[wificxsampleclientkm_Device.ndi.NT] +CopyFiles = File_Copy +Characteristics = 0x84 ; NCF_HAS_UI, NCF_PHYSICAL +BusType = 0 ; Internal +AddReg = wificxsampleclientkm.reg, netvadapter.params +*IfType = 71 ; IF_TYPE_IEEE80211 +*MediaType = 16 ; NdisMediumNative802_11 +*PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 + +[File_Copy] +wificxsampleclientkm.sys + +;-------------- Service installation +[wificxsampleclientkm_Device.ndi.NT.Services] +AddService = wificxsampleclientkm,%SPSVCINST_ASSOCSERVICE%, wificxsampleclientkm_Service_Inst + +; -------------- wificxsampleclientkm driver install sections +[wificxsampleclientkm_Service_Inst] +DisplayName = %wificxsampleclientkm.SVCDESC% +ServiceType = 1 ; SERVICE_KERNEL_DRIVER +StartType = 3 ; SERVICE_DEMAND_START +ErrorControl = 1 ; SERVICE_ERROR_NORMAL +ServiceBinary = %13%\wificxsampleclientkm.sys + +[wificxsampleclientkm_Device.ndi.NT.Wdf] +KmdfService = wificxsampleclientkm, wificxsampleclientkm_wdfsect + +[wificxsampleclientkm_wdfsect] +KmdfLibraryVersion = $KMDFVERSION$ + + +[wificxsampleclientkm.reg] +HKR, Ndi, Service, 0, "wificxsampleclientkm" +HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" +HKR, Ndi\Interfaces, LowerRange, 0, "wlan,ethernet" +; standard INF keywords for NetAdapter drivers +; using AddReg directive so they will work when this INF being Includes/Needs + +HKR, NetworkInterface, *IfConnectorPresent, 0x00010001, 1 +HKR, NetworkInterface, *ConnectionType, 0x00010001, 1 +HKR, NetworkInterface, *DirectionType, 0x00010001, 0 +HKR, NetworkInterface, *AccessType, 0x00010001, 2 +HKR, NetworkInterface, *HardwareLoopback, 0x00010001, 0 +HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 + +[Strings] +SPSVCINST_ASSOCSERVICE = 0x00000002 +ManufacturerName = "WDK Sample" +DiskName = "Wificxsampleclientkm Installation Disk" +wificxsampleclientkm.DeviceDesc = "[KMDF]Wificx Sample Client Device" +wificxsampleclientkm.SVCDESC = "Wificxsampleclientkm Service" + +[netvadapter.params] +; MACLastByte + HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" + HKR, Ndi\params\MACLastByte, default, 0, "1" + HKR, Ndi\params\MACLastByte, type, 0, "int" + HKR, Ndi\params\MACLastByte, min, 0, "1" + HKR, Ndi\params\MACLastByte, max, 0, "254" + HKR, Ndi\params\MACLastByte, step, 0, "1" + HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file diff --git a/network/wlan/wificx/km/wificxsampleclientkm.vcxproj b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj new file mode 100644 index 00000000..e5bd720c --- /dev/null +++ b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj @@ -0,0 +1,245 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + wificxsampleclientkm + + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + 1 + 2 + true + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + 1 + 2 + true + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + 1 + 2 + true + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + 1 + 2 + true + + + + + + + + + + + DbgengKernelDebugger + false + false + + + DbgengKernelDebugger + false + false + + + DbgengKernelDebugger + false + false + + + DbgengKernelDebugger + false + false + + + + sha256 + + + true + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + ..\drivercode\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + 1.0 + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + 1.0 + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + 1.0 + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(DDK_INC_PATH)wlan\2.0;%(AdditionalIncludeDirectories) + true + true + ..\drivercode\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + $(DDK_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + 1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e2a65efd-25cc-4af0-b180-0cd56ee277a9} + + + + \ No newline at end of file diff --git a/network/wlan/wificx/km/wificxsampleclientkm.vcxproj.filters b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj.filters new file mode 100644 index 00000000..2930b24d --- /dev/null +++ b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj.filters @@ -0,0 +1,84 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/network/wlan/wificx/um/wificxsampleclientum.inf b/network/wlan/wificx/um/wificxsampleclientum.inf new file mode 100644 index 00000000..98633234 --- /dev/null +++ b/network/wlan/wificx/um/wificxsampleclientum.inf @@ -0,0 +1,107 @@ +;Copyright (c) Microsoft Corporation. All rights reserved. +; wificxsampleclientum.inf +; + +[Version] +Signature = $Windows NT$ +Class = NET +ClassGuid = {4d36e972-e325-11ce-bfc1-08002be10318} +Provider = %ManufacturerName% +CatalogFile = wificxsampleclientum.cat +DriverVer = ; TODO: set DriverVer in stampinf property pages +PnpLockdown = 1 + +[Manufacturer] +; This driver package is only installable on Win11+ +%ManufacturerName% = Standard,NT$ARCH$.10.0...22000 ; wudfrd.inf introduced in build 22000 + +[Standard.NT$ARCH$.10.0...22000] +%DeviceName% = Wificxsampleclientum_Device.ndi, Root\wificxsampleclientum + +; +; Normal device - Networking Section +; +[Wificxsampleclientum_Device.ndi] +Include=wudfrd.inf, netcxrd.inf +Needs=WUDFRD.NT, netcxrd_Filter.NT + +Characteristics = 0x1 ; NCF_VIRTUAL +*IfType = 71 ; IF_TYPE_IEEE80211 +*MediaType = 16 ; NdisMediumNative802_11 +*PhysicalMediaType = 9 ; NdisPhysicalMediumNative802_11 +BusType = 15 ; PnpBus +NumberOfNetworkInterfaces = 5 +AddReg = Wificxsampleclientum.reg, netvadapter.params +CopyFiles = Wificxsampleclientum.Copy + +[Wificxsampleclientum_Device.ndi.Hw] +Include=wudfrd.inf, netcxrd.inf +Needs=WUDFRD.NT.HW, netcxrd_Filter.NT.HW + +[Wificxsampleclientum_Device.ndi.Filters] +Include=netcxrd.inf +Needs=netcxrd_Filter.NT.Filters + +[Wificxsampleclientum_Device.ndi.Services] +Include=wudfrd.inf, netcxrd.inf +Needs=WUDFRD.NT.Services, netcxrd_Filter.NT.Services + +[Wificxsampleclientum_Device.ndi.Wdf] +UmdfService = "Wificxsampleclientum", wdf +UmdfServiceOrder=wificxsampleclientum +UmdfHostProcessSharing=ProcessSharingDisabled +UmdfKernelModeClientPolicy=AllowKernelModeClients +UmdfDirectHardwareAccess=AllowDirectHardwareAccessAndDma +UmdfRegisterAccessMode=RegisterAccessUsingUserModeMapping +UmdfFsContextUsePolicy=CanUseFsContext2 + +[wdf] +UmdfLibraryVersion = 2.33.0 +UmdfExtensions = NetAdapterCx0202,WifiCx0102 +ServiceBinary=%13%\wificxtestclient.dll +; +; Common - Generic INF sections +; +[Wificxsampleclientum.reg] +HKR, , BusNumber, 0, "0" +HKR, Ndi, Service, 0, "Wificxsampleclientum" +HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" +HKR, Ndi\Interfaces, LowerRange, 0, "wlan,ethernet" + +; standard INF keywords for NetAdapter drivers +; using AddReg directive so they will work when this INF being Includes/Needs +HKR, NetworkInterface, *IfConnectorPresent, 0x00010001, 1 +HKR, NetworkInterface, *ConnectionType, 0x00010001, 1 +HKR, NetworkInterface, *DirectionType, 0x00010001, 0 +HKR, NetworkInterface, *AccessType, 0x00010001, 2 +HKR, NetworkInterface, *HardwareLoopback, 0x00010001, 0 +HKR, , NumberOfNetworkInterfaces, 0x00010001, 11 + +[Wificxsampleclientum.Copy] +wificxsampleclientum.dll + +[SourceDisksNames] +1 = %DiskName%,,,"" + +[DestinationDirs] +Wificxsampleclientum.Copy = 13 + +[SourceDisksFiles] +wificxsampleclientum.dll = 1 + +; =================== Generic ================================== + +[Strings] +ManufacturerName = "WDK Sample" +DiskName = "wificxsampleclientum Installation Disk" +DeviceName = "[UMDF] Wificx Sample Client Device" + +[netvadapter.params] +; MACLastByte + HKR, Ndi\params\MACLastByte, ParamDesc, 0, "MACLastByte" + HKR, Ndi\params\MACLastByte, default, 0, "1" + HKR, Ndi\params\MACLastByte, type, 0, "int" + HKR, Ndi\params\MACLastByte, min, 0, "1" + HKR, Ndi\params\MACLastByte, max, 0, "254" + HKR, Ndi\params\MACLastByte, step, 0, "1" + HKR, Ndi\params\MACLastByte, Optional, 0, "0" \ No newline at end of file diff --git a/network/wlan/wificx/um/wificxsampleclientum.vcxproj b/network/wlan/wificx/um/wificxsampleclientum.vcxproj new file mode 100644 index 00000000..70836086 --- /dev/null +++ b/network/wlan/wificx/um/wificxsampleclientum.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + + + + {C804D7D0-80D8-1409-44DA-91EF3260D07F} + {2177f19c-eb4c-4687-9e7f-f9eec1f12cf1} + v4.5 + 12.0 + Debug + x64 + wificxsampleclientum + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + + Windows10 + true + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + false + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + true + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + Windows10 + false + 2 + 35 + 35 + true + 2 + 5 + true + 1 + 2 + + + + + + + + + + + DbgengRemoteDebugger + false + + + DbgengRemoteDebugger + false + + + DbgengRemoteDebugger + false + + + DbgengRemoteDebugger + false + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + ..\drivercode\trace.h + false + false + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + ..\drivercode\trace.h + false + false + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + ..\drivercode\trace.h + false + false + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + sha256 + + + ..\..\..\netadaptercx\netvadapterlibrary\Interface;$(WDK_UM_INC_PATH)wlan\2.0;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + WIFICX_TEMPORARY_REMOVED_FOR_USERMODE;%(PreprocessorDefinitions) + true + ..\drivercode\trace.h + false + false + true + + + $(WDK_UM_LIB_PATH)wlan\2.0\WificxTLVGenParse.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {612f33ad-430c-4fe7-8000-35e15a5eb757} + + + + \ No newline at end of file diff --git a/network/wlan/wificx/um/wificxsampleclientum.vcxproj.filters b/network/wlan/wificx/um/wificxsampleclientum.vcxproj.filters new file mode 100644 index 00000000..a10fb659 --- /dev/null +++ b/network/wlan/wificx/um/wificxsampleclientum.vcxproj.filters @@ -0,0 +1,84 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/network/wlan/wificx/video/ControlPath.mp4 b/network/wlan/wificx/video/ControlPath.mp4 new file mode 100644 index 00000000..15ec3d62 Binary files /dev/null and b/network/wlan/wificx/video/ControlPath.mp4 differ diff --git a/network/wlan/wificx/video/DataPath.mp4 b/network/wlan/wificx/video/DataPath.mp4 new file mode 100644 index 00000000..fda748e5 Binary files /dev/null and b/network/wlan/wificx/video/DataPath.mp4 differ diff --git a/network/wlan/wificx/wificxsampleclient.sln b/network/wlan/wificx/wificxsampleclient.sln new file mode 100644 index 00000000..d484d08c --- /dev/null +++ b/network/wlan/wificx/wificxsampleclient.sln @@ -0,0 +1,82 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 12.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" + ProjectSection(ProjectDependencies) = postProject + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} = {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientum", "um\wificxsampleclientum.vcxproj", "{C804D7D0-80D8-1409-44DA-91EF3260D07F}" + ProjectSection(ProjectDependencies) = postProject + {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\..\netadaptercx\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Build.0 = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.ActiveCfg = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Build.0 = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Debug|x64.Deploy.0 = Debug|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.ActiveCfg = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Build.0 = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|ARM64.Deploy.0 = Release|ARM64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.ActiveCfg = Release|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Build.0 = Release|x64 + {272D3E7B-C7BA-66D1-E05D-B9723A6F0777}.Release|x64.Deploy.0 = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Build.0 = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.ActiveCfg = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Build.0 = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Debug|x64.Deploy.0 = Debug|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.ActiveCfg = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Build.0 = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|ARM64.Deploy.0 = Release|ARM64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.ActiveCfg = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Build.0 = Release|x64 + {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Deploy.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Deploy.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.ActiveCfg = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Build.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Deploy.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Deploy.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Build.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Deploy.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.ActiveCfg = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Build.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Deploy.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {37680CDC-EACB-499B-BA11-7C376F53DB71} + EndGlobalSection +EndGlobal -- cgit v1.3.1 From 5426a647c3f86885e4b9d8679d4a4c108933b5ee Mon Sep 17 00:00:00 2001 From: Alex Bozhko Date: Thu, 11 Jun 2026 16:13:41 -0700 Subject: Netvadapter: virtual NIC sample for KMDF and UMDF --- network/netadaptercx/netvadapter/README.md | 113 +++++++++++ network/netadaptercx/netvadapter/build.cmd | 25 +++ .../netadaptercx/netvadapter/drivercode/device.cpp | 126 ++++++++++++ .../netadaptercx/netvadapter/drivercode/device.h | 50 +++++ .../netadaptercx/netvadapter/drivercode/driver.cpp | 98 ++++++++++ .../netvadapter/drivercode/memorymanagement.cpp | 89 +++++++++ .../netadaptercx/netvadapter/drivercode/pch.hpp | 14 ++ .../netadaptercx/netvadapter/drivercode/power.cpp | 73 +++++++ .../netadaptercx/netvadapter/drivercode/power.h | 10 + .../netadaptercx/netvadapter/km/netvadapter.inf | Bin 0 -> 21214 bytes .../netvadapter/km/netvadapterkm.vcxproj | 217 +++++++++++++++++++++ .../netvadapter/km/netvadapterkm.vcxproj.filters | 51 +++++ network/netadaptercx/netvadapter/netvadapter.sln | 82 ++++++++ .../netadaptercx/netvadapter/um/netvadapterum.inf | Bin 0 -> 24594 bytes .../netvadapter/um/netvadapterum.vcxproj | 197 +++++++++++++++++++ .../netvadapter/um/netvadapterum.vcxproj.filters | 51 +++++ 16 files changed, 1196 insertions(+) create mode 100644 network/netadaptercx/netvadapter/README.md create mode 100644 network/netadaptercx/netvadapter/build.cmd create mode 100644 network/netadaptercx/netvadapter/drivercode/device.cpp create mode 100644 network/netadaptercx/netvadapter/drivercode/device.h create mode 100644 network/netadaptercx/netvadapter/drivercode/driver.cpp create mode 100644 network/netadaptercx/netvadapter/drivercode/memorymanagement.cpp create mode 100644 network/netadaptercx/netvadapter/drivercode/pch.hpp create mode 100644 network/netadaptercx/netvadapter/drivercode/power.cpp create mode 100644 network/netadaptercx/netvadapter/drivercode/power.h create mode 100644 network/netadaptercx/netvadapter/km/netvadapter.inf create mode 100644 network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj create mode 100644 network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj.filters create mode 100644 network/netadaptercx/netvadapter/netvadapter.sln create mode 100644 network/netadaptercx/netvadapter/um/netvadapterum.inf create mode 100644 network/netadaptercx/netvadapter/um/netvadapterum.vcxproj create mode 100644 network/netadaptercx/netvadapter/um/netvadapterum.vcxproj.filters diff --git a/network/netadaptercx/netvadapter/README.md b/network/netadaptercx/netvadapter/README.md new file mode 100644 index 00000000..894f5e40 --- /dev/null +++ b/network/netadaptercx/netvadapter/README.md @@ -0,0 +1,113 @@ +--- +page_type: sample +description: "A virtual NIC (NetAdapterCx) miniport driver built on top of netvadapterlibrary, in both KMDF and UMDF flavors." +languages: +- cpp +products: +- windows +- windows-wdk +--- + +# netvadapter — Virtual NIC Sample + +`netvadapter` is a **virtual Ethernet NIC** driver that uses **NetAdapterCx** for its data +path. It links against the shared **netvadapterlibrary** static library (the same library used +by the WIFICX sample) and ships in both **KMDF** and **UMDF** flavors. + +Two `netvadapter` instances can be paired together through the library's **Emulated Network +Link (ENL)**: packets sent on one adapter are delivered to the other and vice‑versa, so you can +run connectivity tests (ping, throughput) entirely in software with no physical hardware. + +--- + +## Layout + +| Path | Description | +| --- | --- | +| `netvadapter.sln` | Solution containing both drivers + the library project references. | +| `build.cmd` | Build wrapper (see **Building** — pins UMDF to 2.33). | +| `km\netvadapterkm.vcxproj` | KMDF driver → `netvadapter.sys` (INF: `km\netvadapter.inf`). | +| `um\netvadapterum.vcxproj` | UMDF driver → `netvadapterum.dll` (INF: `um\netvadapterum.inf`). | +| `drivercode\` | Shared driver source (see below). | + +## Building + +The UMDF driver targets **UMDF 2.33** (to match `netvadapterum.inf`'s +`UmdfLibraryVersion = 2.33.0`), while the shared `netvadapterlibrary` is checked in at **UMDF +2.35** (so the WIFICX sample is unaffected). Because the WDF version must match within a single +binary, **build through `build.cmd`**, which forces the library and driver to 2.33 for this +solution only: + +```cmd +build.cmd :: Debug x64 (defaults) +build.cmd Release x64 +``` + +> A plain `msbuild netvadapter.sln` or a Visual Studio IDE build will fail to link with an +> unresolved `WdfFunctions_02035` symbol, because it does not apply the 2.33 override. + +### Signing the package (test signing) + +The build signs the binaries but does **not** produce a catalog. To create and test‑sign the +catalogs (required to install while in test‑signing mode): + +```cmd +:: From an EWDK environment, for each package folder under x64\\: +Inf2Cat /driver:.\netvadapterkm /os:10_X64,Server10_X64 +Inf2Cat /driver:.\netvadapterum /os:10_X64,Server10_X64 + +signtool sign /fd SHA256 /sha1 /tr http://timestamp.digicert.com /td SHA256 .\netvadapterkm\netvadapter.cat +signtool sign /fd SHA256 /sha1 /tr http://timestamp.digicert.com /td SHA256 .\netvadapterum\netvadapterum.cat +``` + +--- + +## Installing + +Enable test signing once (elevated, then reboot), and install the test certificate into the +**Root** and **TrustedPublisher** stores on the target machine. Then install the driver with +`devcon`: + +```cmd +.\devcon.exe install .\netvadapterum.inf root\netvadapterum +``` + +If the command fails, inspect the device‑install log at: + +``` +C:\Windows\INF\setupapi.dev.log +``` + +### Pairing two adapters + +A working link requires **two** `netvadapter` instances. Create both by running the install +command **twice**: + +```cmd +.\devcon.exe install .\netvadapterum.inf root\netvadapterum +.\devcon.exe install .\netvadapterum.inf root\netvadapterum +``` + +Then set the **`MACLastByte`** advanced keyword to 1 and 2 on both adapters via Device Manager → adapter → **Advanced**, or the network adapter +property pages. + +> ⚠️ `MACLastByte` defaults to **0**. If an adapter is left at the default, the device fails +> to start and shows a **yellow bang** (error) in Device Manager. Assign distinct values such as +> `1` and `2` for the pair to link correctly. + +--- + +## Managing the driver + +List installed `net`‑class drivers (to find the `oemNN.inf` published name): + +```cmd +pnputil /enum-drivers /class net +``` + +Remove the driver and prepare for a clean reinstall (substitute the `oemNN.inf` from the command +above): + +```cmd +pnputil /delete-driver oem2.inf /uninstall /force +``` diff --git a/network/netadaptercx/netvadapter/build.cmd b/network/netadaptercx/netvadapter/build.cmd new file mode 100644 index 00000000..3f7c8e5d --- /dev/null +++ b/network/netadaptercx/netvadapter/build.cmd @@ -0,0 +1,25 @@ +@echo off +REM ============================================================================ +REM Build wrapper for netvadapter.sln +REM +REM The netvadapter UM driver targets UMDF 2.33 (matching netvadapterum.inf's +REM UmdfLibraryVersion = 2.33.0). It links the shared netvadapterlibrary, whose +REM checked-in project targets UMDF 2.35 (so the wificx sample is unaffected). +REM +REM WDF version must match within a single binary, so this script forces the +REM library + driver to 2.33 *for this solution's build only* via a global +REM MSBuild property. A plain "msbuild netvadapter.sln" (without these props) +REM will fail to link with an unresolved WdfFunctions_02035 symbol. +REM +REM Usage: build.cmd [Configuration] [Platform] (defaults: Debug x64) +REM Example: build.cmd Release x64 +REM ============================================================================ + +setlocal +set CONFIG=%~1 +set PLAT=%~2 +if "%CONFIG%"=="" set CONFIG=Debug +if "%PLAT%"=="" set PLAT=x64 + +msbuild "%~dp0netvadapter.sln" /t:Build /p:Configuration=%CONFIG% /p:Platform=%PLAT% /p:UMDF_VERSION_MINOR=33 /p:UMDF_MINIMUM_VERSION_REQUIRED=33 /m +endlocal diff --git a/network/netadaptercx/netvadapter/drivercode/device.cpp b/network/netadaptercx/netvadapter/drivercode/device.cpp new file mode 100644 index 00000000..6cbad327 --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/device.cpp @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" + +#include + +#include "netvadapter.h" +#include "device.h" +#include "trace.h" +#include "device.tmh" +#include "power.h" + +static +EVT_NET_ADAPTER_CREATE_TXQUEUE + EvtAdapterCreateTxQueue; + +static +EVT_NET_ADAPTER_CREATE_RXQUEUE + EvtAdapterCreateRxQueue; + +NetvDevice::NetvDevice( + WDFDEVICE Handle +) + : m_triage(WdfGetTriageInfo()) + , m_handle(Handle) +{ +} + +_Use_decl_annotations_ +NTSTATUS +NetvDevice::Initialize( + void +) +{ + using unique_adapterinit = wil::unique_any; + + unique_adapterinit adapterInit{NetAdapterInitAllocate(m_handle)}; + RETURN_NTSTATUS_IF( + STATUS_INSUFFICIENT_RESOURCES, + ! adapterInit); + + NET_ADAPTER_DATAPATH_CALLBACKS datapathCallbacks; + NET_ADAPTER_DATAPATH_CALLBACKS_INIT( + &datapathCallbacks, + EvtAdapterCreateTxQueue, + EvtAdapterCreateRxQueue); + + NetAdapterInitSetDatapathCallbacks( + adapterInit.get(), + &datapathCallbacks); + + WDF_OBJECT_ATTRIBUTES adapterAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&adapterAttributes, NetvAdapter); + adapterAttributes.EvtDestroyCallback = [](WDFOBJECT Handle) { + NetvAdapterGetContext(static_cast(Handle))->Destroy(); + }; + + NETADAPTER netAdapter; + RETURN_IF_NOT_STATUS_SUCCESS( + NetAdapterCreate(adapterInit.get(), &adapterAttributes, &netAdapter)); + + m_adapter = new (NetvAdapterGetContext(netAdapter)) NetvAdapter(netAdapter, m_handle); + + RETURN_IF_NOT_STATUS_SUCCESS( + m_adapter->Initialize()); + + RETURN_STATUS_SUCCESS(); +} + +NTSTATUS +NetvDevice::PrepareHardware( + WDFCMRESLIST ResourcesRaw, + WDFCMRESLIST ResourcesTranslated +) +{ + UNREFERENCED_PARAMETER(ResourcesRaw); + UNREFERENCED_PARAMETER(ResourcesTranslated); + + NetvDeviceInitializePowerManagement(this); + + RETURN_IF_NOT_STATUS_SUCCESS( + m_adapter->ConfigureDataCapabilities()); + + RETURN_IF_NOT_STATUS_SUCCESS( + NetAdapterStart(m_adapter->m_handle)); + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +NTSTATUS +EvtDevicePrepareHardware( + WDFDEVICE Device, + WDFCMRESLIST ResourcesRaw, + WDFCMRESLIST ResourcesTranslated + ) +{ + return NetvDeviceGetContext(Device)->PrepareHardware(ResourcesRaw, ResourcesTranslated); +} + +_Use_decl_annotations_ +NTSTATUS +EvtAdapterCreateTxQueue( + NETADAPTER Adapter, + NETTXQUEUE_INIT * Init +) +{ + return NetvAdapterGetContext(Adapter)->CreateTxQueue(Init); +} + +_Use_decl_annotations_ +NTSTATUS +EvtAdapterCreateRxQueue( + NETADAPTER Adapter, + NETRXQUEUE_INIT * Init +) +{ + return NetvAdapterGetContext(Adapter)->CreateRxQueue(Init); +} + +NetvAdapter* NetvAdapterGetContextFromWDFObject(NETADAPTER netAdapter) +{ + return NetvAdapterGetContext(netAdapter); +} diff --git a/network/netadaptercx/netvadapter/drivercode/device.h b/network/netadaptercx/netvadapter/drivercode/device.h new file mode 100644 index 00000000..3b8e5d2d --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/device.h @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#pragma once + +#include "netvadapter.h" + +class NetvDevice +{ + +public: + + // + // Do not add variable before WdfTriageInfoPtr. + // NetAdapterCx carving code requires the first field of + // WDF context to be a pointer to WDF_TRIAGE_INFO. + // + void * + m_triage = nullptr; + + NetvDevice( + WDFDEVICE Handle + ); + + NTSTATUS + Initialize( + void + ); + + NTSTATUS + PrepareHardware( + WDFCMRESLIST ResourcesRaw, + WDFCMRESLIST ResourcesTranslated + ); + +public: // private: + + WDFDEVICE + m_handle = WDF_NO_HANDLE; + + NetvAdapter * + m_adapter = nullptr; + +}; +static_assert(FIELD_OFFSET(NetvDevice, m_triage) == 0u); + +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(NetvDevice, NetvDeviceGetContext); +WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(NetvAdapter, NetvAdapterGetContext); + +EVT_WDF_DEVICE_PREPARE_HARDWARE + EvtDevicePrepareHardware; diff --git a/network/netadaptercx/netvadapter/drivercode/driver.cpp b/network/netadaptercx/netvadapter/drivercode/driver.cpp new file mode 100644 index 00000000..393292c1 --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/driver.cpp @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" + +#include + +#include "netvadapter.h" +#include "trace.h" +#include "driver.tmh" +#include "device.h" +#include "power.h" + +GLOBAL_CONTEXT NetvGlobalContext; + +EXTERN_C +DRIVER_INITIALIZE + DriverEntry; + +EVT_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; +EVT_WDF_DRIVER_UNLOAD EvtDriverUnload; + +_Use_decl_annotations_ +NTSTATUS +DriverEntry( + PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath + ) +{ + WPP_INIT_TRACING(DriverObject, RegistryPath); + + WDF_DRIVER_CONFIG config; + WDF_DRIVER_CONFIG_INIT(&config, EvtDriverDeviceAdd); + config.EvtDriverUnload = EvtDriverUnload; + + NTSTATUS status = WdfDriverCreate(DriverObject, + RegistryPath, + WDF_NO_OBJECT_ATTRIBUTES, + &config, + NULL); + + if (!NT_SUCCESS(status)) + { + LogError(FLAG_DRIVER, "%!STATUS! WdfDriverCreate", status); + WPP_CLEANUP(DriverObject); + + return status; + } + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +NTSTATUS +EvtDriverDeviceAdd( + WDFDRIVER Driver, + PWDFDEVICE_INIT DeviceInit + ) +{ + UNREFERENCED_PARAMETER(Driver); + + RETURN_IF_NOT_STATUS_SUCCESS( + NetDeviceInitConfig(DeviceInit)); + + WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks; + WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks); + pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware; + WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks); + + WDF_POWER_POLICY_EVENT_CALLBACKS powerPolicyCallbacks; + WDF_POWER_POLICY_EVENT_CALLBACKS_INIT(&powerPolicyCallbacks); + powerPolicyCallbacks.EvtDeviceArmWakeFromS0 = EvtDeviceArmWakeFromS0; + powerPolicyCallbacks.EvtDeviceDisarmWakeFromS0 = EvtDeviceDisarmWakeFromS0; + WdfDeviceInitSetPowerPolicyEventCallbacks(DeviceInit, &powerPolicyCallbacks); + + WDF_OBJECT_ATTRIBUTES deviceAttributes; + WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, NetvDevice); + + WDFDEVICE wdfDevice; + RETURN_IF_NOT_STATUS_SUCCESS( + WdfDeviceCreate(&DeviceInit, &deviceAttributes, &wdfDevice)); + + auto device = new (NetvDeviceGetContext(wdfDevice)) NetvDevice(wdfDevice); + + RETURN_IF_NOT_STATUS_SUCCESS( + device->Initialize()); + + RETURN_STATUS_SUCCESS(); +} + +_Use_decl_annotations_ +VOID +EvtDriverUnload( + WDFDRIVER Driver +) +{ + UNREFERENCED_PARAMETER(Driver); + WPP_CLEANUP(WdfDriverWdmGetDriverObject(Driver)); +} diff --git a/network/netadaptercx/netvadapter/drivercode/memorymanagement.cpp b/network/netadaptercx/netvadapter/drivercode/memorymanagement.cpp new file mode 100644 index 00000000..29a2006a --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/memorymanagement.cpp @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +// +// Global operator new / delete for the driver. +// +// The shared netvadapterlibrary routes its allocations through the global +// operator new (see memory.cpp in the library, which provides the nothrow +// variant that forwards to operator new(size_t)). The client driver is +// responsible for providing the backing implementation. We use WDF managed +// memory so that the same implementation works for both KMDF and UMDF, the +// same approach used by the WIFICX sample. + +#include "pch.hpp" + +#define NETV_POOL_TAG 'vteN' + +struct NETV_MEMORY_HEADER +{ + size_t HeaderSize; + WDFMEMORY WdfMemoryHandle; +}; + +static void* AllocateBuffer(size_t Size) +{ + const size_t totalSize = Size + sizeof(NETV_MEMORY_HEADER); + + WDF_OBJECT_ATTRIBUTES attributes; + WDF_OBJECT_ATTRIBUTES_INIT(&attributes); + + WDFMEMORY wdfMemory = WDF_NO_HANDLE; + void* buffer = nullptr; + + if (!NT_SUCCESS(WdfMemoryCreate(&attributes, NonPagedPoolNx, NETV_POOL_TAG, totalSize, &wdfMemory, &buffer))) + { + return nullptr; + } + + RtlZeroMemory(buffer, totalSize); + + auto header = static_cast(buffer); + header->HeaderSize = sizeof(NETV_MEMORY_HEADER); + header->WdfMemoryHandle = wdfMemory; + + return reinterpret_cast(reinterpret_cast(buffer) + sizeof(NETV_MEMORY_HEADER)); +} + +static void FreeBuffer(void* Buffer) +{ + if (Buffer == nullptr) + { + return; + } + + auto header = reinterpret_cast( + reinterpret_cast(Buffer) - sizeof(NETV_MEMORY_HEADER)); + + NT_ASSERT(header->HeaderSize == sizeof(NETV_MEMORY_HEADER)); + + WdfObjectDelete(header->WdfMemoryHandle); +} + +void* __cdecl operator new(size_t Size) +{ + return AllocateBuffer(Size); +} + +void* __cdecl operator new[](size_t Size) +{ + return AllocateBuffer(Size); +} + +void __cdecl operator delete(void* Buffer) noexcept +{ + FreeBuffer(Buffer); +} + +void __cdecl operator delete[](void* Buffer) noexcept +{ + FreeBuffer(Buffer); +} + +void __cdecl operator delete(void* Buffer, size_t) noexcept +{ + FreeBuffer(Buffer); +} + +void __cdecl operator delete[](void* Buffer, size_t) noexcept +{ + FreeBuffer(Buffer); +} diff --git a/network/netadaptercx/netvadapter/drivercode/pch.hpp b/network/netadaptercx/netvadapter/drivercode/pch.hpp new file mode 100644 index 00000000..b0e017ef --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/pch.hpp @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +#include + +#ifdef _KERNEL_MODE +#include +#else +#include +#include +#endif + +#include +#include diff --git a/network/netadaptercx/netvadapter/drivercode/power.cpp b/network/netadaptercx/netvadapter/drivercode/power.cpp new file mode 100644 index 00000000..68b057ff --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/power.cpp @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved + +#include "pch.hpp" +#include "netvadapter.h" +#include "device.h" +#include "trace.h" +#include "power.h" +#include "power.tmh" + +void +NetvDeviceInitializePowerManagement( + _In_ NetvDevice * Device +) +{ +#ifdef _KERNEL_MODE + WDFDEVICE wdfDevice = Device->m_handle; + NetvAdapter * adapter = Device->m_adapter; + + if (!adapter->S0Idle) + { + return; + } + + WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings; + WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT( + &idleSettings, + IdleCanWakeFromS0); + + idleSettings.IdleTimeout = 3000; + idleSettings.IdleTimeoutType = SystemManagedIdleTimeoutWithHint; + + NTSTATUS ntStatus = WdfDeviceAssignS0IdleSettings( + wdfDevice, + &idleSettings); + + if (ntStatus != STATUS_SUCCESS) + { + // MSDN says we should ignore error codes from assign S0 idle settings, do that + return; + } + + // Now tell NetAdapterCx we support wake on packet filter match + NET_ADAPTER_WAKE_PACKET_FILTER_CAPABILITIES wakeOnPacketFilterMatch; + NET_ADAPTER_WAKE_PACKET_FILTER_CAPABILITIES_INIT(&wakeOnPacketFilterMatch); + wakeOnPacketFilterMatch.PacketFilterMatch = TRUE; + + NetAdapterWakeSetPacketFilterCapabilities(adapter->m_handle, &wakeOnPacketFilterMatch); +#else + UNREFERENCED_PARAMETER(Device); +#endif +} + +_Use_decl_annotations_ +NTSTATUS +EvtDeviceArmWakeFromS0( + WDFDEVICE Device +) +{ + auto adapter = NetvDeviceGetContext(Device)->m_adapter; + adapter->ArmWakeFromS0(); + + return STATUS_SUCCESS; +} + +_Use_decl_annotations_ +void +EvtDeviceDisarmWakeFromS0( + WDFDEVICE Device +) +{ + auto adapter = NetvDeviceGetContext(Device)->m_adapter; + adapter->DisarmWakeFromS0(); +} diff --git a/network/netadaptercx/netvadapter/drivercode/power.h b/network/netadaptercx/netvadapter/drivercode/power.h new file mode 100644 index 00000000..6a5e2399 --- /dev/null +++ b/network/netadaptercx/netvadapter/drivercode/power.h @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved +#pragma once + +EVT_WDF_DEVICE_ARM_WAKE_FROM_S0 EvtDeviceArmWakeFromS0; +EVT_WDF_DEVICE_DISARM_WAKE_FROM_S0 EvtDeviceDisarmWakeFromS0; + +void +NetvDeviceInitializePowerManagement( + _In_ NetvDevice * Device +); diff --git a/network/netadaptercx/netvadapter/km/netvadapter.inf b/network/netadaptercx/netvadapter/km/netvadapter.inf new file mode 100644 index 00000000..a5565a86 Binary files /dev/null and b/network/netadaptercx/netvadapter/km/netvadapter.inf differ diff --git a/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj new file mode 100644 index 00000000..c5381da8 --- /dev/null +++ b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj @@ -0,0 +1,217 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {B4044984-19DD-456F-9D47-565F59A47F5E} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + netvadapterkm + + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + KMDF + Windows Driver + 1 + 33 + 33 + true + 2 + 5 + 4 + true + + + + + + + + + + + true + + + DbgengKernelDebugger + false + false + netvadapter + + + DbgengKernelDebugger + false + false + netvadapter + + + DbgengKernelDebugger + false + false + netvadapter + + + DbgengKernelDebugger + false + false + netvadapter + + + + sha256 + + + true + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + 1.0 + + + + + sha256 + + + true + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + 1.0 + + + + + sha256 + + + true + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + 1.0 + + + + + sha256 + + + true + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + _HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) + + + 1.0 + + + + + + + + + + + + + + + + + + + + + + {e2a65efd-25cc-4af0-b180-0cd56ee277a9} + + + + diff --git a/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj.filters b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj.filters new file mode 100644 index 00000000..3d80c128 --- /dev/null +++ b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + diff --git a/network/netadaptercx/netvadapter/netvadapter.sln b/network/netadaptercx/netvadapter/netvadapter.sln new file mode 100644 index 00000000..866a8ac2 --- /dev/null +++ b/network/netadaptercx/netvadapter/netvadapter.sln @@ -0,0 +1,82 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 12.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterkm", "km\netvadapterkm.vcxproj", "{B4044984-19DD-456F-9D47-565F59A47F5E}" + ProjectSection(ProjectDependencies) = postProject + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} = {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterum", "um\netvadapterum.vcxproj", "{1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}" + ProjectSection(ProjectDependencies) = postProject + {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|ARM64.Build.0 = Debug|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|x64.ActiveCfg = Debug|x64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|x64.Build.0 = Debug|x64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Debug|x64.Deploy.0 = Debug|x64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|ARM64.ActiveCfg = Release|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|ARM64.Build.0 = Release|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|ARM64.Deploy.0 = Release|ARM64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|x64.ActiveCfg = Release|x64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|x64.Build.0 = Release|x64 + {B4044984-19DD-456F-9D47-565F59A47F5E}.Release|x64.Deploy.0 = Release|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|ARM64.Build.0 = Debug|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|x64.ActiveCfg = Debug|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|x64.Build.0 = Debug|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Debug|x64.Deploy.0 = Debug|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|ARM64.ActiveCfg = Release|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|ARM64.Build.0 = Release|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|ARM64.Deploy.0 = Release|ARM64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|x64.ActiveCfg = Release|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|x64.Build.0 = Release|x64 + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|x64.Deploy.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Deploy.0 = Debug|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.ActiveCfg = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Build.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Deploy.0 = Release|ARM64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Deploy.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Build.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Deploy.0 = Debug|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.ActiveCfg = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Build.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Deploy.0 = Release|ARM64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 + {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B869660E-4622-49A7-A458-819E1C98599D} + EndGlobalSection +EndGlobal diff --git a/network/netadaptercx/netvadapter/um/netvadapterum.inf b/network/netadaptercx/netvadapter/um/netvadapterum.inf new file mode 100644 index 00000000..4b55d229 Binary files /dev/null and b/network/netadaptercx/netvadapter/um/netvadapterum.inf differ diff --git a/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj new file mode 100644 index 00000000..0dfc43d3 --- /dev/null +++ b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj @@ -0,0 +1,197 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + + + + {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3} + {2177f19c-eb4c-4687-9e7f-f9eec1f12cf1} + v4.5 + 12.0 + Debug + x64 + netvadapterum + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + WindowsUserModeDriver10.0 + DynamicLibrary + Universal + + + + Windows10 + true + 2 + 33 + 33 + true + 2 + 5 + + + Windows10 + false + 2 + 33 + 33 + true + 2 + 5 + + + Windows10 + true + 2 + 33 + 33 + true + 2 + 5 + + + Windows10 + false + 2 + 33 + 33 + true + 2 + 5 + + + + + + + + + + + true + + + DbgengRemoteDebugger + false + netvadapterum + + + DbgengRemoteDebugger + false + netvadapterum + + + DbgengRemoteDebugger + false + netvadapterum + + + DbgengRemoteDebugger + false + netvadapterum + + + + sha256 + + + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + false + true + + + + + sha256 + + + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + false + true + + + + + sha256 + + + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + false + true + + + + + sha256 + + + ..\..\netvadapterlibrary\Interface;..\..\netvadapterlibrary\code;..\..\..\..\wil\include;$(KIT_SHARED_INC_PATH_WDK);%(AdditionalIncludeDirectories) + true + ..\..\netvadapterlibrary\code\trace.h + false + false + true + + + + + + + + + + + + + + + + + + + {612f33ad-430c-4fe7-8000-35e15a5eb757} + + + + diff --git a/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj.filters b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj.filters new file mode 100644 index 00000000..b43c1b22 --- /dev/null +++ b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj.filters @@ -0,0 +1,51 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + -- cgit v1.3.1 From 4c89b2cd0cf2e94bc2e933e9ccf7d35c7b26a140 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Wed, 17 Jun 2026 10:33:03 -0700 Subject: check in the demo for OEM solution based on Service Command channel. --- network/wlan/wificx/OEM/OemDeviceService.vcxproj | 50 +++++++ network/wlan/wificx/OEM/OemDeviceServiceApp.cpp | 158 ++++++++++++++++++++++ network/wlan/wificx/OEM/README.md | 90 ++++++++++++ network/wlan/wificx/drivercode/SharedTypes.h | 17 ++- network/wlan/wificx/drivercode/wifihal.cpp | 134 ++++++++++++++++++ network/wlan/wificx/drivercode/wifihal.h | 15 ++ network/wlan/wificx/drivercode/wifirequest.cpp | 2 +- network/wlan/wificx/drivercode/wifitransition.cpp | 128 ++++++++++++++++++ network/wlan/wificx/drivercode/wifitransition.h | 2 +- network/wlan/wificx/wificxsampleclient.sln | 14 +- 10 files changed, 605 insertions(+), 5 deletions(-) create mode 100644 network/wlan/wificx/OEM/OemDeviceService.vcxproj create mode 100644 network/wlan/wificx/OEM/OemDeviceServiceApp.cpp create mode 100644 network/wlan/wificx/OEM/README.md diff --git a/network/wlan/wificx/OEM/OemDeviceService.vcxproj b/network/wlan/wificx/OEM/OemDeviceService.vcxproj new file mode 100644 index 00000000..c48f5bb8 --- /dev/null +++ b/network/wlan/wificx/OEM/OemDeviceService.vcxproj @@ -0,0 +1,50 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F} + OemDeviceService + Application + Unicode + OemDeviceServiceApplication + + + + WindowsApplicationForDrivers10.0 + + + + + Level4 + _UNICODE;UNICODE;%(PreprocessorDefinitions) + + + Console + wlanapi.lib;ole32.lib;%(AdditionalDependencies) + + + + + + + + + + \ No newline at end of file diff --git a/network/wlan/wificx/OEM/OemDeviceServiceApp.cpp b/network/wlan/wificx/OEM/OemDeviceServiceApp.cpp new file mode 100644 index 00000000..74c0e3d3 --- /dev/null +++ b/network/wlan/wificx/OEM/OemDeviceServiceApp.cpp @@ -0,0 +1,158 @@ +// Copyright (C) Microsoft Corporation. All rights reserved. +// +// OEM sample: enumerates supported device services, then sends "Hello, My Driver" +// to the WiFiCx sample driver via WlanDeviceServiceCommand and prints the +// driver's "Nice to meet you, My OEM". + +#define NOMINMAX // use std::min/std::max instead of the windows.h min/max macros +#include +#include +#include // StringFromGUID2 +#include // std::min +#include + +#pragma comment(lib, "wlanapi.lib") +#pragma comment(lib, "ole32.lib") // StringFromGUID2 + +// WlanGetSupportedDeviceServices, WlanDeviceServiceCommand and +// WLAN_DEVICE_SERVICE_GUID_LIST are all declared by wlanapi.h. + +// This GUID/opcode pair MUST match the driver (drivercode\SharedTypes.h). +// {2d6f9a14-3a1d-4f0a-9b7e-1c2e3a4b5c6d} +static const GUID GUID_OEM_SAMPLE_DEVICE_SERVICE = +{ 0x2d6f9a14, 0x3a1d, 0x4f0a, { 0x9b, 0x7e, 0x1c, 0x2e, 0x3a, 0x4b, 0x5c, 0x6d } }; + +#define OEM_DEVICE_SERVICE_OPCODE_HELLO 0x00000001 +#define OEM_DEVICE_SERVICE_REQUEST_STRING "Hello, My Driver" + +static void PrintGuid(const GUID& g) +{ + wchar_t buf[64] = { 0 }; + StringFromGUID2(g, buf, ARRAYSIZE(buf)); + wprintf(L"%s", buf); +} + +// Enumerate the device services the driver advertises (via WDI_GET_SUPPORTED_DEVICE_SERVICES). +static bool QuerySupportedServices(HANDLE hClient, const GUID& interfaceGuid) +{ + PWLAN_DEVICE_SERVICE_GUID_LIST pList = nullptr; + DWORD result = WlanGetSupportedDeviceServices(hClient, &interfaceGuid, &pList); + if (result != ERROR_SUCCESS || pList == nullptr) + { + printf("WlanGetSupportedDeviceServices failed with error %u\n", result); + return false; + } + + bool found = false; + printf("Supported device services: %u\n", pList->dwNumberOfItems); + for (DWORD i = 0; i < pList->dwNumberOfItems; i++) + { + printf(" [%u] ", i); + PrintGuid(pList->DeviceService[i]); + if (IsEqualGUID(pList->DeviceService[i], GUID_OEM_SAMPLE_DEVICE_SERVICE)) + { + found = true; + printf(" <-- OEM sample service"); + } + printf("\n"); + } + + WlanFreeMemory(pList); + return found; +} + +static void SendHelloToInterface(HANDLE hClient, const GUID& interfaceGuid) +{ + char inBuffer[] = OEM_DEVICE_SERVICE_REQUEST_STRING; // includes null terminator + DWORD inBufferSize = static_cast(sizeof(inBuffer)); + + BYTE outBuffer[256] = { 0 }; + DWORD outBufferSize = static_cast(sizeof(outBuffer)); + DWORD bytesReturned = 0; + + printf("Sending device service command: \"%s\"\n", inBuffer); + + DWORD result = WlanDeviceServiceCommand( + hClient, + &interfaceGuid, + const_cast(&GUID_OEM_SAMPLE_DEVICE_SERVICE), + OEM_DEVICE_SERVICE_OPCODE_HELLO, + inBufferSize, + inBuffer, + outBufferSize, + outBuffer, + &bytesReturned); + + if (result != ERROR_SUCCESS) + { + printf("WlanDeviceServiceCommand failed with error %u\n", result); + return; + } + + if (bytesReturned > 0) + { + outBuffer[std::min(bytesReturned, static_cast(sizeof(outBuffer) - 1))] = '\0'; + printf("Driver responded: \"%s\" (%u bytes)\n", reinterpret_cast(outBuffer), bytesReturned); + } + else + { + printf("Driver returned no data.\n"); + } +} + +int __cdecl main() +{ + HANDLE hClient = nullptr; + DWORD negotiatedVersion = 0; + PWLAN_INTERFACE_INFO_LIST pIfList = nullptr; + + // 1) WlanOpenHandle + DWORD result = WlanOpenHandle(WLAN_API_VERSION_2_0, nullptr, &negotiatedVersion, &hClient); + if (result != ERROR_SUCCESS) + { + printf("WlanOpenHandle failed with error %u\n", result); + return 1; + } + + // 2) WlanEnumInterfaces + result = WlanEnumInterfaces(hClient, nullptr, &pIfList); + if (result != ERROR_SUCCESS) + { + printf("WlanEnumInterfaces failed with error %u\n", result); + WlanCloseHandle(hClient, nullptr); + return 1; + } + + printf("Found %u WLAN interface(s).\n", pIfList->dwNumberOfItems); + + for (DWORD i = 0; i < pIfList->dwNumberOfItems; i++) + { + const WLAN_INTERFACE_INFO& ifInfo = pIfList->InterfaceInfo[i]; + printf("\nInterface[%u]: %ws\n", i, ifInfo.strInterfaceDescription); + + // Enumerate supported device services first. + bool supported = QuerySupportedServices(hClient, ifInfo.InterfaceGuid); + + // 3) WlanDeviceServiceCommand (only if our service is advertised) + if (supported) + { + SendHelloToInterface(hClient, ifInfo.InterfaceGuid); + } + else + { + printf("OEM sample device service not advertised on this interface; skipping command.\n"); + } + } + + // 4) WlanFreeMemory(pIfList); + if (pIfList != nullptr) + { + WlanFreeMemory(pIfList); + pIfList = nullptr; + } + + // 5) WlanCloseHandle(hClient, nullptr); + WlanCloseHandle(hClient, nullptr); + + return 0; +} diff --git a/network/wlan/wificx/OEM/README.md b/network/wlan/wificx/OEM/README.md new file mode 100644 index 00000000..98419932 --- /dev/null +++ b/network/wlan/wificx/OEM/README.md @@ -0,0 +1,90 @@ +# OEM Device Service Sample (`OemDeviceServiceApplication`) + +A user-mode console application that demonstrates how an OEM/IHV utility communicates +with the WiFiCx sample driver through a **WLAN device service**. The app sends the +request string `"Hello, My Driver"` and prints the driver's reply +`"Nice to meet you, My OEM"`. + +## What it does + +The tool walks through the standard WLAN client flow: + +1. **`WlanOpenHandle`** — opens a client handle using `WLAN_API_VERSION_2_0`. +2. **`WlanEnumInterfaces`** — enumerates all WLAN interfaces on the machine. +3. **`WlanGetSupportedDeviceServices`** — for each interface, enumerates the device + service GUIDs the driver advertises and checks whether the OEM sample service + (`GUID_OEM_SAMPLE_DEVICE_SERVICE`) is present. +4. **`WlanDeviceServiceCommand`** — when the service is advertised, sends the + `OEM_DEVICE_SERVICE_OPCODE_HELLO` opcode with the request payload and prints the + bytes returned by the driver. +5. **`WlanFreeMemory` / `WlanCloseHandle`** — releases the interface list and the + client handle. + +If the OEM sample device service is not advertised on an interface, the command is +skipped for that interface. + +## Device service contract + +These values **must stay in sync** with the driver-side definitions in +[`drivercode/SharedTypes.h`](../drivercode/SharedTypes.h): + +| Item | Value | +| --- | --- | +| Service GUID | `{2d6f9a14-3a1d-4f0a-9b7e-1c2e3a4b5c6d}` (`GUID_OEM_SAMPLE_DEVICE_SERVICE`) | +| Opcode | `0x00000001` (`OEM_DEVICE_SERVICE_OPCODE_HELLO`) | +| Request string | `"Hello, My Driver"` | +| Response string | `"Nice to meet you, My OEM"` | + +The driver advertises the service GUID via `WDI_GET_SUPPORTED_DEVICE_SERVICES`, so the +GUID must match on both sides for the exchange to succeed. + +## Source layout + +| File | Purpose | +| --- | --- | +| [`OemDeviceServiceApp.cpp`](OemDeviceServiceApp.cpp) | Application entry point and device service logic. | +| [`OemDeviceService.vcxproj`](OemDeviceService.vcxproj) | MSBuild project for the console app. | + +## Build + +The project (`OemDeviceService.vcxproj`) builds as a console **Application** using the +`WindowsApplicationForDrivers10.0` platform toolset. + +- **Configurations:** `Debug`, `Release` +- **Platforms:** `x64`, `ARM64` +- **Linked libraries:** `wlanapi.lib`, `ole32.lib` + +Build it from Visual Studio as part of the solution, or from the command line: + +```cmd +msbuild OEM\OemDeviceService.vcxproj /p:Configuration=Release /p:Platform=x64 +``` + +## Run + +Run the resulting executable from an elevated command prompt on a machine where the +WiFiCx sample driver is installed: + +```cmd +OemDeviceServiceApplication.exe +``` + +### Example output + +```text +Found 1 WLAN interface(s). + +Interface[0]: WiFiCx Sample Client Device +Supported device services: 1 + [0] {2D6F9A14-3A1D-4F0A-9B7E-1C2E3A4B5C6D} <-- OEM sample service +Sending device service command: "Hello, My Driver" +Driver responded: "Nice to meet you, My OEM" (25 bytes) +``` + +## Requirements + +- The WiFiCx sample driver must be installed and the adapter present. +- The driver must advertise `GUID_OEM_SAMPLE_DEVICE_SERVICE`; otherwise the app prints + that the service is not advertised and skips the command. +- WLAN API (`wlanapi.lib`) and COM (`ole32.lib` for `StringFromGUID2`) are available on + the host. diff --git a/network/wlan/wificx/drivercode/SharedTypes.h b/network/wlan/wificx/drivercode/SharedTypes.h index 43fd815a..e454378b 100644 --- a/network/wlan/wificx/drivercode/SharedTypes.h +++ b/network/wlan/wificx/drivercode/SharedTypes.h @@ -13,4 +13,19 @@ // ============================= // {bb67559a-06f6-4eb0-81e9-21fdc3b60efb} DEFINE_GUID(GUID_WIFICX_SAMPLE_CLIENT_INTERFACE, 0xbb67559a, 0x06f6, 0x4eb0, 0x81, 0xe9, 0x21, 0xfd, 0xc3, 0xb6, 0x0e, 0xfb); -#define WIFI_DRIVER_DEFAULT_POOL_TAG 'shiW' // WIFI IHV Sample Driver \ No newline at end of file +#define WIFI_DRIVER_DEFAULT_POOL_TAG 'shiW' // WIFI IHV Sample Driver + +// ============================= +// OEM Device Service contract +// ============================= +// This GUID/opcode pair MUST match the OEM user-mode app (OEM\OemDeviceService.cpp). +// {2d6f9a14-3a1d-4f0a-9b7e-1c2e3a4b5c6d} +DEFINE_GUID(GUID_OEM_SAMPLE_DEVICE_SERVICE, + 0x2d6f9a14, 0x3a1d, 0x4f0a, 0x9b, 0x7e, 0x1c, 0x2e, 0x3a, 0x4b, 0x5c, 0x6d); + +// Opcode understood by the driver for the "hello / nice to meet you" exchange. +#define OEM_DEVICE_SERVICE_OPCODE_HELLO 0x00000001 + +// Payload strings exchanged with the OEM app. +#define OEM_DEVICE_SERVICE_REQUEST_STRING "Hello, My Driver" +#define OEM_DEVICE_SERVICE_RESPONSE_STRING "Nice to meet you, My OEM" \ No newline at end of file diff --git a/network/wlan/wificx/drivercode/wifihal.cpp b/network/wlan/wificx/drivercode/wifihal.cpp index fead61b3..e7aaec1f 100644 --- a/network/wlan/wificx/drivercode/wifihal.cpp +++ b/network/wlan/wificx/drivercode/wifihal.cpp @@ -982,3 +982,137 @@ NTSTATUS WifiHAL::WifiIhvDisconnect(const WDI_TASK_DISCONNECT_PARAMETERS&, const return STATUS_SUCCESS; } + +// -------- WDI_GET_SUPPORTED_DEVICE_SERVICES (OID_WDI_GET_SUPPORTED_DEVICES) -------- +// Property GET: the request has no input (Inputs is empty). Builds the +// WDI_TLV_DEVICE_SERVICE_GUID_LIST result advertising GUID_OEM_SAMPLE_DEVICE_SERVICE and +// serializes it via the generated TLV generator, so the OS learns which device services +// this driver supports. +// OutBuffer receives the full WDI message (header + TLVs); BytesWritten = total length. +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvGetSupportedDeviceServices(const WDI_GET_SUPPORTED_DEVICE_SERVICES_INPUTS& Inputs, void* OutBuffer, ULONG OutBufferLen, ULONG& BytesWritten) +{ + UNREFERENCED_PARAMETER(Inputs); // GET request carries no input data + + BytesWritten = sizeof(WDI_MESSAGE_HEADER); + + if (OutBuffer == nullptr || OutBufferLen < sizeof(WDI_MESSAGE_HEADER)) + { + WFCError("GetSupportedDeviceServices: invalid out buffer (OutBufferLen=%u)", OutBufferLen); + return STATUS_INVALID_PARAMETER; + } + + // WDI_TLV_DEVICE_SERVICE_GUID_LIST: a list containing our single device service GUID. + // WDI_GUID_LIST_CONTAINER is ArrayOfElements; SimpleAssign points it at our + // stack array (the generator copies the data while serializing the TLV). + GUID supportedServices[] = { GUID_OEM_SAMPLE_DEVICE_SERVICE }; + + WDI_GET_SUPPORTED_DEVICE_SERVICES_PARAMETERS results{}; + results.DeviceServiceGUIDList.SimpleAssign(supportedServices, ARRAYSIZE(supportedServices)); + + // Generate the TLV byte stream. ReservedHeaderLength reserves room for the + // WDI_MESSAGE_HEADER at the front of the produced buffer. + ULONG generatedLength = 0; + UINT8* pGenerated = nullptr; + + NDIS_STATUS genStatus = GenerateWdiGetSupportedDeviceServices( + &results, sizeof(WDI_MESSAGE_HEADER), m_TlvContext, &generatedLength, &pGenerated); + + NTSTATUS ntStatus = Wifi::ConvertNDISSTATUSToNTSTATUS(genStatus); + if (!NT_SUCCESS(ntStatus) || pGenerated == nullptr) + { + WFCError("GetSupportedDeviceServices: Generate failed, status=%!STATUS!", ntStatus); + return ntStatus; + } + + if (OutBufferLen < generatedLength) + { + WFCError("GetSupportedDeviceServices: out buffer too small (have=%u need=%u)", + OutBufferLen, generatedLength); + FreeGenerated(pGenerated); + return STATUS_BUFFER_TOO_SMALL; + } + + RtlCopyMemory(OutBuffer, pGenerated, generatedLength); + BytesWritten = generatedLength; + FreeGenerated(pGenerated); + + WFCInfo("GetSupportedDeviceServices: advertised %u device service(s), %u bytes", + ARRAYSIZE(supportedServices), BytesWritten); + return STATUS_SUCCESS; +} + +// -------- OEM Device Service Command (OID_WDI_DEVICE_SERVICE_COMMAND) -------- +// Reads the request data blob (WDI_TLV_DEVICE_SERVICE_PARAMS_DATA_BLOB) parsed into +// Inputs.Params, expects "Hello, My Driver", and returns "Nice to meet you, My OEM" +// as the response data blob, serialized via the generated TLV generator. +// OutBuffer receives the full WDI message (header + TLVs); BytesWritten = total length. +_Use_decl_annotations_ +NTSTATUS WifiHAL::WifiIhvDeviceServiceCommand(const WDI_DEVICE_SERVICE_COMMAND_INPUTS& Inputs, void* OutBuffer, ULONG OutBufferLen, ULONG& BytesWritten) +{ + BytesWritten = sizeof(WDI_MESSAGE_HEADER); + + if (OutBuffer == nullptr || OutBufferLen < sizeof(WDI_MESSAGE_HEADER)) + { + WFCError("OEM device service: invalid out buffer (OutBufferLen=%u)", OutBufferLen); + return STATUS_INVALID_PARAMETER; + } + + // Log the request data blob ("Hello, My Driver"), if present. + if (Inputs.Optional.Params_IsPresent && + Inputs.Params.ElementCount > 0 && + Inputs.Params.pElements[0].ElementCount > 0 && + Inputs.Params.pElements[0].pElements != nullptr) + { + WFCInfo("OEM device service: opcode=0x%08X, received %u-byte data blob: %hs", + Inputs.Opcode, + Inputs.Params.pElements[0].ElementCount, + reinterpret_cast(Inputs.Params.pElements[0].pElements)); + } + else + { + WFCInfo("OEM device service: opcode=0x%08X, no input data blob", Inputs.Opcode); + } + + // Build the response data blob ("Nice to meet you, My OEM"), including the null terminator. + // SimpleAssign points the blob at this buffer (no copy); the generator copies the bytes + // while serializing, and the buffer outlives that call. + UINT8 responseBytes[] = OEM_DEVICE_SERVICE_RESPONSE_STRING; + + WDI_BYTE_BLOB responseBlob{}; + responseBlob.SimpleAssign(responseBytes, static_cast(sizeof(responseBytes))); + + WDI_DEVICE_SERVICE_COMMAND_PARAMETERS params{}; + params.Optional.Params_IsPresent = TRUE; + params.Params.SimpleAssign(&responseBlob, 1); + + // Serialize WDI_TLV_DEVICE_SERVICE_PARAMS_DATA_BLOB into the response message. + ULONG generatedLength = 0; + UINT8* pGenerated = nullptr; + + NDIS_STATUS genStatus = GenerateWdiDeviceServiceCommand( + ¶ms, sizeof(WDI_MESSAGE_HEADER), m_TlvContext, &generatedLength, &pGenerated); + + NTSTATUS ntStatus = Wifi::ConvertNDISSTATUSToNTSTATUS(genStatus); + if (!NT_SUCCESS(ntStatus) || pGenerated == nullptr) + { + WFCError("OEM device service: Generate failed, status=%!STATUS!", ntStatus); + return ntStatus; + } + + if (OutBufferLen < generatedLength) + { + WFCError("OEM device service: out buffer too small (have=%u need=%u)", + OutBufferLen, generatedLength); + FreeGenerated(pGenerated); + return STATUS_BUFFER_TOO_SMALL; + } + + RtlCopyMemory(OutBuffer, pGenerated, generatedLength); + BytesWritten = generatedLength; + FreeGenerated(pGenerated); + + WFCInfo("OEM device service: responded with \"%hs\" (%u bytes)", + reinterpret_cast(responseBytes), BytesWritten); + return STATUS_SUCCESS; +} diff --git a/network/wlan/wificx/drivercode/wifihal.h b/network/wlan/wificx/drivercode/wifihal.h index 38e1166a..f776f425 100644 --- a/network/wlan/wificx/drivercode/wifihal.h +++ b/network/wlan/wificx/drivercode/wifihal.h @@ -28,6 +28,21 @@ public: NTSTATUS WifiIhvConnect(_In_ const WDI_TASK_CONNECT_PARAMETERS& ConnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); NTSTATUS WifiIhvSetSaeAuthParams(_In_ const WDI_SET_SAE_AUTH_PARAMS_COMMAND& setSAEAuthParams, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); NTSTATUS WifiIhvDisconnect(_In_ const WDI_TASK_DISCONNECT_PARAMETERS& disconnectParameters, _In_ const PWDI_MESSAGE_HEADER pWdiHeader, _In_ UINT BytesWritten); + + // Device service property handlers (OID_WDI_GET_SUPPORTED_DEVICES / OID_WDI_DEVICE_SERVICE_COMMAND). + // Match the PropertyTransitionTraits handler shape: (const parsed input&, out-buffer, + // out-buffer length, bytesWritten&). The handler serializes the response TLV stream into + // OutBuffer and reports the number of bytes written; the dispatch layer completes the request. + NTSTATUS WifiIhvGetSupportedDeviceServices( + _In_ const WDI_GET_SUPPORTED_DEVICE_SERVICES_INPUTS& Inputs, + _Out_writes_bytes_to_(OutBufferLen, BytesWritten) void* OutBuffer, + _In_ ULONG OutBufferLen, + _Out_ ULONG& BytesWritten); + NTSTATUS WifiIhvDeviceServiceCommand( + _In_ const WDI_DEVICE_SERVICE_COMMAND_INPUTS& Inputs, + _Out_writes_bytes_to_(OutBufferLen, BytesWritten) void* OutBuffer, + _In_ ULONG OutBufferLen, + _Out_ ULONG& BytesWritten); private: NTSTATUS WifiIhvPerformAssociation(_In_ const struct ArrayOfElements* pPreferredBSSEntryList, _In_ const struct ArrayOfElements* pAuthenticationAlgorithms, _In_ const PWDI_MESSAGE_HEADER pWdiHeader); NTSTATUS WifiIhvSendLinkStateIndication(_In_ const PWDI_MESSAGE_HEADER pWdiHeader, ULONG numLinks); diff --git a/network/wlan/wificx/drivercode/wifirequest.cpp b/network/wlan/wificx/drivercode/wifirequest.cpp index fd02bd91..c84c1d97 100644 --- a/network/wlan/wificx/drivercode/wifirequest.cpp +++ b/network/wlan/wificx/drivercode/wifirequest.cpp @@ -95,4 +95,4 @@ _Use_decl_annotations_ void WifiIhvSendM4IndicationToOs(WDFDEVICE Device, UINT16 WifiRequestMessageId, const PWDI_MESSAGE_HEADER pWdiHeader, NTSTATUS WifiRequestM4Status) { WifiIhvSendIndicationToOs(Device, pWdiHeader, WifiRequestMessageId, pWdiHeader->TransactionId, WifiRequestM4Status, nullptr, 0); -} \ No newline at end of file +} diff --git a/network/wlan/wificx/drivercode/wifitransition.cpp b/network/wlan/wificx/drivercode/wifitransition.cpp index 41106932..2e1b7ef2 100644 --- a/network/wlan/wificx/drivercode/wifitransition.cpp +++ b/network/wlan/wificx/drivercode/wifitransition.cpp @@ -192,6 +192,98 @@ NTSTATUS RunTransition(TransitionContext& ctx) return m4Status; } +// ============================================================================ +// Property GET/SET messages (single M3 completion) +// ---------------------------------------------------------------------------- +// Unlike the M3/M4 task flow above, a property GET/SET is a single M3 step that +// returns its result synchronously in the request's in/out buffer. The HAL +// handler writes the response TLV stream and reports the real number of bytes +// written (by reference); the request is completed (M3) with that length. +// No M4 indication. +// ============================================================================ +template< + UINT16 TMsgId, + typename TParam, + bool TDumpTlvStream, + NDIS_STATUS (*TParseFn)(ULONG, const UINT8*, PCTLV_CONTEXT, TParam*), + void (*TCleanupFn)(TParam*), + NTSTATUS (WifiHAL::*TPreFn)(), // optional pre-check hook (may be nullptr) + NTSTATUS (WifiHAL::*TPropertyFn)(const TParam&, void*, ULONG, ULONG&) // mandatory property HAL handler +> +struct PropertyM3Traits +{ + using ParamType = TParam; + + NTSTATUS Parse(TransitionContext& ctx, ParamType& p) + { + if (ctx.InLen < sizeof(WDI_MESSAGE_HEADER)) + { + return STATUS_INVALID_PARAMETER; + } + + auto* tlvBytes = static_cast(ctx.RawBuffer) + sizeof(WDI_MESSAGE_HEADER); + auto tlvLen = static_cast(ctx.InLen - sizeof(WDI_MESSAGE_HEADER)); + + if (TDumpTlvStream) + { + DumpMessageTlvByteStream(TMsgId, TRUE, ctx.DevCtx->TlvContext.PeerVersion, tlvLen, tlvBytes, 0, nullptr); + } + + auto ndisStatus = TParseFn(tlvLen, tlvBytes, &ctx.DevCtx->TlvContext, &p); + return Wifi::ConvertNDISSTATUSToNTSTATUS(ndisStatus); + } + + void Cleanup(ParamType& p) { TCleanupFn(&p); } + + // Runs the optional pre-check then the property handler. The handler writes the + // out-buffer and reports the number of bytes written. + NTSTATUS Handle(TransitionContext& ctx, ParamType& p, ULONG& bytesWritten) + { + bytesWritten = sizeof(WDI_MESSAGE_HEADER); + + WifiHAL* hal = GetWifiHalFromHandle(ctx.Device); + + if (TPreFn) + { + NTSTATUS preStatus = (hal->*TPreFn)(); + if (!NT_SUCCESS(preStatus)) + { + return preStatus; + } + } + + return (hal->*TPropertyFn)(p, ctx.RawBuffer, ctx.OutLen, bytesWritten); + } +}; + +// Primary traits template for property GET/SET messages (specialize per MessageId) +template +struct PropertyTraits; + +// Generic runner for property GET/SET messages: parse -> handle -> complete (M3). +// Completes the request synchronously with the number of bytes the HAL wrote. +template +NTSTATUS RunPropertyM3(TransitionContext& ctx) +{ + PropertyTraits traits; + typename PropertyTraits::ParamType params{}; + + NTSTATUS status = traits.Parse(ctx, params); + if (!NT_SUCCESS(status)) + { + traits.Cleanup(params); + WifiRequestComplete(ctx.WifiRequest, status, sizeof(WDI_MESSAGE_HEADER)); + return status; + } + + ULONG bytesWritten = sizeof(WDI_MESSAGE_HEADER); + status = traits.Handle(ctx, params, bytesWritten); + + traits.Cleanup(params); + WifiRequestComplete(ctx.WifiRequest, status, bytesWritten); + return status; +} + //// -------- SCENARIO: [Connect with a SAE WI-FI7 network -------- /// Demo: Handle WDI_TASK_CONNECT + WDI_SET_SAE_AUTH_PARAMS then WDI_TASK_DISCONNECT /// Scope: @@ -313,6 +405,38 @@ struct TransitionTraits { }; +// -------- WDI_GET_SUPPORTED_DEVICE_SERVICES (property GET) -------- +// Request body is empty (header sufficient); the HAL produces the +// WDI_TLV_DEVICE_SERVICE_GUID_LIST result into the out-buffer. +template<> +struct PropertyTraits + : PropertyM3Traits< + WDI_GET_SUPPORTED_DEVICE_SERVICES, + WDI_GET_SUPPORTED_DEVICE_SERVICES_INPUTS, + true, // dump TLV stream + ParseWdiGetSupportedDeviceServices, + CleanupParsedWdiGetSupportedDeviceServices, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-check + &WifiHAL::WifiIhvGetSupportedDeviceServices // property handler + > +{}; + +// -------- WDI_DEVICE_SERVICE_COMMAND (property SET/GET) -------- +// Reads the request data blob (WDI_TLV_DEVICE_SERVICE_PARAMS_*) and the HAL writes +// the response data blob into the out-buffer. +template<> +struct PropertyTraits + : PropertyM3Traits< + WDI_DEVICE_SERVICE_COMMAND, + WDI_DEVICE_SERVICE_COMMAND_INPUTS, + true, // dump TLV stream + ParseWdiDeviceServiceCommand, + CleanupParsedWdiDeviceServiceCommand, + &WifiHAL::WifiIhvIsDeviceReadyForRequest, // pre-check + &WifiHAL::WifiIhvDeviceServiceCommand // property handler + > +{}; + // Runtime dispatcher switches on MessageId and invokes the matching compile-time runner. NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) { @@ -330,6 +454,10 @@ NTSTATUS RunTransitionByMessage(TransitionContext& ctx, UINT16 messageId) return RunTransition(ctx); case WDI_SET_SAE_AUTH_PARAMS: return RunTransition(ctx); + case WDI_GET_SUPPORTED_DEVICE_SERVICES: + return RunPropertyM3(ctx); + case WDI_DEVICE_SERVICE_COMMAND: + return RunPropertyM3(ctx); default: UINT bytesWritten = sizeof(WDI_MESSAGE_HEADER); WifiRequestComplete(ctx.WifiRequest, STATUS_NOT_SUPPORTED, bytesWritten); diff --git a/network/wlan/wificx/drivercode/wifitransition.h b/network/wlan/wificx/drivercode/wifitransition.h index a0addf88..c48d4a78 100644 --- a/network/wlan/wificx/drivercode/wifitransition.h +++ b/network/wlan/wificx/drivercode/wifitransition.h @@ -11,7 +11,7 @@ struct TransitionContext PWIFI_IHV_DEVICE_CONTEXT DevCtx; WIFIREQUEST WifiRequest; PWDI_MESSAGE_HEADER Header; - void* RawBuffer; + void* RawBuffer; // from WifiRequestGetInOutBuffer in EvtWifiDeviceSendCommand UINT InLen; UINT OutLen; }; diff --git a/network/wlan/wificx/wificxsampleclient.sln b/network/wlan/wificx/wificxsampleclient.sln index d484d08c..ddcf190c 100644 --- a/network/wlan/wificx/wificxsampleclient.sln +++ b/network/wlan/wificx/wificxsampleclient.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 +# Visual Studio Version 18 +VisualStudioVersion = 18.7.11903.348 stable MinimumVisualStudioVersion = 12.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" ProjectSection(ProjectDependencies) = postProject @@ -16,6 +16,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OemDeviceService", "OEM\OemDeviceService.vcxproj", "{B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM64 = Debug|ARM64 @@ -72,6 +74,14 @@ Global {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.Build.0 = Debug|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.ActiveCfg = Debug|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.Build.0 = Debug|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.ActiveCfg = Release|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.Build.0 = Release|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.ActiveCfg = Release|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.3.1 From 8315a48cc6aac0c02d2218b0147457a01de4f885 Mon Sep 17 00:00:00 2001 From: "Yang You (UU)" Date: Fri, 19 Jun 2026 13:12:38 -0700 Subject: Add variants to the NetVAdapterLibrary to support the requirements of different adapter types. --- .../netvadapter/km/netvadapterkm.vcxproj | 4 +- network/netadaptercx/netvadapter/netvadapter.sln | 16 +- .../netvadapter/um/netvadapterum.vcxproj | 4 +- .../ethernet_km/netvadapterlibrarykm.filters | 26 +++ .../ethernet_km/netvadapterlibrarykm.vcxproj | 189 +++++++++++++++++++++ .../ethernet_um/netvadapterlibraryum.filters | 26 +++ .../ethernet_um/netvadapterlibraryum.vcxproj | 185 ++++++++++++++++++++ .../km/netvadapterlibrarykm.filters | 26 --- .../km/netvadapterlibrarykm.vcxproj | 189 --------------------- .../um/netvadapterlibraryum.filters | 26 --- .../um/netvadapterlibraryum.vcxproj | 189 --------------------- .../wifi_km/netvadapterlibrarykm.filters | 26 +++ .../wifi_km/netvadapterlibrarykm.vcxproj | 189 +++++++++++++++++++++ .../wifi_um/netvadapterlibraryum.filters | 26 +++ .../wifi_um/netvadapterlibraryum.vcxproj | 189 +++++++++++++++++++++ .../wlan/wificx/km/wificxsampleclientkm.vcxproj | 7 +- .../wlan/wificx/um/wificxsampleclientum.vcxproj | 4 +- network/wlan/wificx/wificxsampleclient.sln | 24 +-- 18 files changed, 882 insertions(+), 463 deletions(-) create mode 100644 network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.filters create mode 100644 network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.vcxproj create mode 100644 network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.filters create mode 100644 network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.vcxproj delete mode 100644 network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters delete mode 100644 network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj delete mode 100644 network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters delete mode 100644 network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj create mode 100644 network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.filters create mode 100644 network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.vcxproj create mode 100644 network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.filters create mode 100644 network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.vcxproj diff --git a/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj index c5381da8..b9414ab8 100644 --- a/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj +++ b/network/netadaptercx/netvadapter/km/netvadapterkm.vcxproj @@ -209,9 +209,9 @@ - + {e2a65efd-25cc-4af0-b180-0cd56ee277a9} - + \ No newline at end of file diff --git a/network/netadaptercx/netvadapter/netvadapter.sln b/network/netadaptercx/netvadapter/netvadapter.sln index 866a8ac2..e41c436d 100644 --- a/network/netadaptercx/netvadapter/netvadapter.sln +++ b/network/netadaptercx/netvadapter/netvadapter.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34221.43 +# Visual Studio Version 18 +VisualStudioVersion = 18.7.11911.148 stable MinimumVisualStudioVersion = 12.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterkm", "km\netvadapterkm.vcxproj", "{B4044984-19DD-456F-9D47-565F59A47F5E}" ProjectSection(ProjectDependencies) = postProject @@ -12,9 +12,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterum", "um\netvada {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\netvadapterlibrary\ethernet_km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\netvadapterlibrary\ethernet_um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -50,28 +50,20 @@ Global {1CDC2CE3-19F3-4200-87C7-C343FB2D8ED3}.Release|x64.Deploy.0 = Release|x64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.ActiveCfg = Debug|x64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Build.0 = Debug|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|x64.Deploy.0 = Debug|x64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.ActiveCfg = Release|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Build.0 = Release|ARM64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|ARM64.Deploy.0 = Release|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.ActiveCfg = Release|x64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Build.0 = Release|x64 - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Release|x64.Deploy.0 = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.ActiveCfg = Debug|ARM64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Build.0 = Debug|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|ARM64.Deploy.0 = Debug|ARM64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.ActiveCfg = Debug|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Build.0 = Debug|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Debug|x64.Deploy.0 = Debug|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.ActiveCfg = Release|ARM64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Build.0 = Release|ARM64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|ARM64.Deploy.0 = Release|ARM64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 - {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj index 0dfc43d3..84579613 100644 --- a/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj +++ b/network/netadaptercx/netvadapter/um/netvadapterum.vcxproj @@ -189,9 +189,9 @@ - + {612f33ad-430c-4fe7-8000-35e15a5eb757} - + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.filters b/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.vcxproj b/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.vcxproj new file mode 100644 index 00000000..8167e906 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/ethernet_km/netvadapterlibrarykm.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.filters b/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.vcxproj new file mode 100644 index 00000000..0ed7a371 --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/ethernet_um/netvadapterlibraryum.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {612F33AD-430C-4FE7-8000-35E15A5EB757} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + KMDF_Driver1 + + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + Universal + 2 + 33 + true + 2 + 5 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + Universal + 2 + 33 + true + 2 + 5 + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + Universal + 2 + 33 + true + 2 + 5 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + Universal + 2 + 33 + true + 2 + 5 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters deleted file mode 100644 index 1b227cbb..00000000 --- a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {8E41214B-6785-4CFE-B992-037D68949A14} - inf;inv;inx;mof;mc; - - - - - Driver Files - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj b/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj deleted file mode 100644 index 8167e906..00000000 --- a/network/netadaptercx/netvadapterlibrary/km/netvadapterlibrarykm.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - Debug - ARM64 - - - Release - ARM64 - - - - {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} - {1bc93793-694f-48fe-9372-81e2b05556fd} - v4.5 - 12.0 - Debug - x64 - - - - Windows10 - true - WindowsKernelModeDriver10.0 - StaticLibrary - KMDF - Windows Driver - 1 - 33 - true - 2 - 5 - - - Windows10 - false - WindowsKernelModeDriver10.0 - StaticLibrary - KMDF - Windows Driver - 1 - 33 - true - 2 - 5 - - - Windows10 - true - WindowsKernelModeDriver10.0 - StaticLibrary - KMDF - Windows Driver - 1 - 33 - true - 2 - 5 - - - Windows10 - false - WindowsKernelModeDriver10.0 - StaticLibrary - KMDF - Windows Driver - 1 - 33 - true - 2 - 5 - - - - - - - - - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - - sha256 - - - true - - - false - ..\code\trace.h - true - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - ..\code\trace.h - true - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - ..\code\trace.h - true - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - ..\code\trace.h - true - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters deleted file mode 100644 index 1b227cbb..00000000 --- a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.filters +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {8E41214B-6785-4CFE-B992-037D68949A14} - inf;inv;inx;mof;mc; - - - - - Driver Files - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj deleted file mode 100644 index 9edcd75b..00000000 --- a/network/netadaptercx/netvadapterlibrary/um/netvadapterlibraryum.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - Debug - ARM64 - - - Release - ARM64 - - - - {612F33AD-430C-4FE7-8000-35E15A5EB757} - {1bc93793-694f-48fe-9372-81e2b05556fd} - v4.5 - 12.0 - Debug - x64 - KMDF_Driver1 - - - - Windows10 - true - WindowsUserModeDriver10.0 - StaticLibrary - KMDF - Universal - 2 - 35 - true - 2 - 5 - - - Windows10 - false - WindowsUserModeDriver10.0 - StaticLibrary - KMDF - Universal - 2 - 35 - true - 2 - 5 - - - Windows10 - true - WindowsUserModeDriver10.0 - StaticLibrary - KMDF - Universal - 2 - 35 - true - 2 - 5 - - - Windows10 - false - WindowsUserModeDriver10.0 - StaticLibrary - KMDF - Universal - 2 - 35 - true - 2 - 5 - - - - - - - - - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - DbgengKernelDebugger - $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) - - - - sha256 - - - true - - - false - true - ..\code\trace.h - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - true - ..\code\trace.h - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - true - ..\code\trace.h - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - sha256 - - - true - - - false - true - ..\code\trace.h - ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.filters b/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.vcxproj b/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.vcxproj new file mode 100644 index 00000000..f674c91a --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/wifi_km/netvadapterlibrarykm.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 6 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + Windows10 + true + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + Windows10 + false + WindowsKernelModeDriver10.0 + StaticLibrary + KMDF + Windows Driver + 1 + 33 + true + 2 + 5 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + ..\code\trace.h + true + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.filters b/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.filters new file mode 100644 index 00000000..1b227cbb --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.filters @@ -0,0 +1,26 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8E41214B-6785-4CFE-B992-037D68949A14} + inf;inv;inx;mof;mc; + + + + + Driver Files + + + \ No newline at end of file diff --git a/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.vcxproj b/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.vcxproj new file mode 100644 index 00000000..e7c260cf --- /dev/null +++ b/network/netadaptercx/netvadapterlibrary/wifi_um/netvadapterlibraryum.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + {612F33AD-430C-4FE7-8000-35E15A5EB757} + {1bc93793-694f-48fe-9372-81e2b05556fd} + v4.5 + 12.0 + Debug + x64 + KMDF_Driver1 + + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 35 + true + 2 + 6 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 35 + true + 2 + 5 + + + Windows10 + true + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 35 + true + 2 + 5 + + + Windows10 + false + WindowsUserModeDriver10.0 + StaticLibrary + KMDF + Universal + 2 + 35 + true + 2 + 5 + + + + + + + + + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + DbgengKernelDebugger + $(MSBuildProjectDirectory)\..\Interface;$(MSBuildProjectDirectory)\..\code\rtl;$(IncludePath) + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + sha256 + + + true + + + false + true + ..\code\trace.h + ..\..\..\..\wil\include;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/network/wlan/wificx/km/wificxsampleclientkm.vcxproj b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj index e5bd720c..08f69e0f 100644 --- a/network/wlan/wificx/km/wificxsampleclientkm.vcxproj +++ b/network/wlan/wificx/km/wificxsampleclientkm.vcxproj @@ -40,8 +40,9 @@ 33 true 2 - 5 - 4 + 6 + + true 1 2 @@ -237,7 +238,7 @@ - + {e2a65efd-25cc-4af0-b180-0cd56ee277a9} diff --git a/network/wlan/wificx/um/wificxsampleclientum.vcxproj b/network/wlan/wificx/um/wificxsampleclientum.vcxproj index 70836086..5bb17f54 100644 --- a/network/wlan/wificx/um/wificxsampleclientum.vcxproj +++ b/network/wlan/wificx/um/wificxsampleclientum.vcxproj @@ -59,7 +59,7 @@ 35 true 2 - 5 + 6 true 1 2 @@ -221,7 +221,7 @@ - + {612f33ad-430c-4fe7-8000-35e15a5eb757} diff --git a/network/wlan/wificx/wificxsampleclient.sln b/network/wlan/wificx/wificxsampleclient.sln index ddcf190c..c3bf1f22 100644 --- a/network/wlan/wificx/wificxsampleclient.sln +++ b/network/wlan/wificx/wificxsampleclient.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.7.11903.348 stable +VisualStudioVersion = 18.7.11903.348 MinimumVisualStudioVersion = 12.0 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientkm", "km\wificxsampleclientkm.vcxproj", "{272D3E7B-C7BA-66D1-E05D-B9723A6F0777}" ProjectSection(ProjectDependencies) = postProject @@ -12,11 +12,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wificxsampleclientum", "um\ {612F33AD-430C-4FE7-8000-35E15A5EB757} = {612F33AD-430C-4FE7-8000-35E15A5EB757} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\..\netadaptercx\netvadapterlibrary\km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OemDeviceServiceApplication", "OEM\OemDeviceService.vcxproj", "{B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibrarykm", "..\..\netadaptercx\netvadapterlibrary\wifi_km\netvadapterlibrarykm.vcxproj", "{E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OemDeviceService", "OEM\OemDeviceService.vcxproj", "{B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netvadapterlibraryum", "..\..\netadaptercx\netvadapterlibrary\wifi_um\netvadapterlibraryum.vcxproj", "{612F33AD-430C-4FE7-8000-35E15A5EB757}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -50,6 +50,14 @@ Global {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.ActiveCfg = Release|x64 {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Build.0 = Release|x64 {C804D7D0-80D8-1409-44DA-91EF3260D07F}.Release|x64.Deploy.0 = Release|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.Build.0 = Debug|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.ActiveCfg = Debug|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.Build.0 = Debug|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.ActiveCfg = Release|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.Build.0 = Release|ARM64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.ActiveCfg = Release|x64 + {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.Build.0 = Release|x64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.ActiveCfg = Debug|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Build.0 = Debug|ARM64 {E2A65EFD-25CC-4AF0-B180-0CD56EE277A9}.Debug|ARM64.Deploy.0 = Debug|ARM64 @@ -74,14 +82,6 @@ Global {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.ActiveCfg = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Build.0 = Release|x64 {612F33AD-430C-4FE7-8000-35E15A5EB757}.Release|x64.Deploy.0 = Release|x64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|ARM64.Build.0 = Debug|ARM64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.ActiveCfg = Debug|x64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Debug|x64.Build.0 = Debug|x64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.ActiveCfg = Release|ARM64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|ARM64.Build.0 = Release|ARM64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.ActiveCfg = Release|x64 - {B3C9A1E2-7F4D-4B2A-9C5E-1A2B3C4D5E6F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.3.1