diff options
| author | Yang You (UU) <[email protected]> | 2025-12-08 13:17:58 -0800 |
|---|---|---|
| committer | Yang You (UU) <[email protected]> | 2025-12-08 13:17:58 -0800 |
| commit | 4372ea08facd248da112eec0aed34d4e512b6236 (patch) | |
| tree | 9e4fbb18d0e4e0b261b8d26a78e2d18ad0c494be /network/wlan/WIFICX/drivercode/adapter.cpp | |
| parent | 5d296ca7451db754f37261df544a032bf23b12fb (diff) | |
have the last Mac byte feature
Diffstat (limited to 'network/wlan/WIFICX/drivercode/adapter.cpp')
| -rw-r--r-- | network/wlan/WIFICX/drivercode/adapter.cpp | 55 |
1 files changed, 0 insertions, 55 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(); |
