Trying to run Address Change HLK test . I am getting some different MAC address while running the test .
I am supporting NDIS_MAC_OPTION_SUPPORTS_MAC_ADDRESS_OVERWRITE in OID_GEN_MAC_OPTIONS OID .
Following are the logs when the test :
Validate MAC options after a device pause/restart
We check for NDIS_MAC_OPTION_SUPPORTS_MAC_ADDRESS_OVERWRITE after a miniport restart because NDIS must preserve this flag across restarts (if it added the flag) for devices that support overwriting the local MAC (which is the purpose of this AddressChange test in general).
Adapter::NdisIOControl
- Device: Virtual Network Driver
- Oid: OID_GEN_MAC_OPTIONS
- Buffer Length: 4
MAC Options: 0x000002D8
NDIS_MAC_OPTION_SUPPORTS_MAC_ADDRESS_OVERWRITE is present
Check network addresses on the test adapter after modifying the registry with new network address
Obtain new current address on Virtual Network Driver
Obtain new current address on Virtual Network Driver
Open::NdisRequest
- Name: Test open for receiving
- RequestType: QueryInformation
- OID: OID_802_3_CURRENT_ADDRESS
- RequestId: 0
- BufferLength: 6
- Flags: 0x00000000
- PortNumber: 0
Results - Status: NDIS_STATUS_SUCCESS (0x0)
- Bytes Written: 6
- Bytes Needed: 1737485104
Current address from test adapter is 00-13-EC-08-68-5C
New network address under test is 02-02-04-06-08-02
50009 Current network address did not change after driver was reloaded. The driver should have picked up a new network address from the registry.
Obtain new permanent address on Virtual Network Driver
Open::NdisRequest
- Name: Test open for receiving
- RequestType: QueryInformation
- OID: OID_802_3_PERMANENT_ADDRESS
- RequestId: 0
- BufferLength: 6
- Flags: 0x00000000
- PortNumber: 0
Results - Status: NDIS_STATUS_SUCCESS (0x0)
- Bytes Written: 6
- Bytes Needed: 1737485104
New permanent address from test adapter is 00-13-EC-08-68-5C
Original permanent address is 00-13-EC-08-68-5C
*******************************************************
I am handling the MAC address during initialization of miniport by:
*******************************************************
UCHAR* pMacAddress = NULL;
UINT nMacAddressLength = 0;
NdisReadNetworkAddress(&status, (PVOID*) &pMacAddress, &nMacAddressLength, hConfiguration);
if ((status == NDIS_STATUS_SUCCESS) && (nMacAddressLength == 6)) {
NdisMoveMemory(m_pMiniport->m_aMacAddress, pMacAddress, 6);
}
and handling OID queries by :
******************************************************
MacOptions = NDIS_MAC_OPTION_NO_LOOPBACK | NDIS_MAC_OPTION_FULL_DUPLEX | NDIS_MAC_OPTION_8021P_PRIORITY | NDIS_MAC_OPTION_SUPPORTS_MAC_ADDRESS_OVERWRITE;
case OID_GEN_MAC_OPTIONS:
pInformation = (PVOID)&MacOptions;
ulInformationLength = sizeof(MacOptions);
break;
case OID_802_3_PERMANENT_ADDRESS:
case OID_802_3_CURRENT_ADDRESS:
pInformation = &m_aMacAddress;
ulInformationLength = sizeof(m_aMacAddress);
break;
Why driver can’t get Current network after driver was reloaded ?
Anything missing ? Any suggestions ?
Thanks