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 --- network/wlan/WIFICX/drivercode/adapter.cpp | 55 ------------------------------ 1 file changed, 55 deletions(-) (limited to 'network/wlan/WIFICX/drivercode/adapter.cpp') 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(); -- cgit v1.3.1