diff options
Diffstat (limited to 'network/wlan/WIFICX/drivercode')
| -rw-r--r-- | network/wlan/WIFICX/drivercode/adapter.cpp | 55 | ||||
| -rw-r--r-- | network/wlan/WIFICX/drivercode/adapter.h | 11 | ||||
| -rw-r--r-- | network/wlan/WIFICX/drivercode/device.cpp | 4 |
3 files changed, 6 insertions, 64 deletions
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)) |
