summaryrefslogtreecommitdiff
path: root/network/wlan/WIFICX/drivercode/adapter.cpp
diff options
context:
space:
mode:
authorYang You (UU) <[email protected]>2025-11-10 12:29:39 -0800
committerYang You (UU) <[email protected]>2025-11-10 12:29:39 -0800
commitbddbce760509546060b3ccc28a9891b2412d2824 (patch)
treecaa3a743eea9f388e5e4eb4258416259a22834e3 /network/wlan/WIFICX/drivercode/adapter.cpp
parentaf60c12439cf289a8fcb670abc4e7cca76e32a4f (diff)
have the buildable KM and UM solutions for Wifi only scenarios.
Diffstat (limited to 'network/wlan/WIFICX/drivercode/adapter.cpp')
-rw-r--r--network/wlan/WIFICX/drivercode/adapter.cpp43
1 files changed, 43 insertions, 0 deletions
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;
+}