\r
/**\r
Update the list of iSCSI devices the iSCSI driver is controlling.\r
- \r
+\r
@retval EFI_SUCCESS The callback successfully handled the action.\r
@retval Others Other errors as indicated. \r
**/\r
UINTN HandleIndex;\r
UINTN Index;\r
UINTN LastDeviceIndex;\r
- EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
- EFI_SIMPLE_NETWORK_MODE *Mode;\r
+ EFI_MAC_ADDRESS MacAddress;\r
+ UINTN HwAddressSize;\r
+ UINT16 VlanId;\r
ISCSI_MAC_INFO *CurMacInfo;\r
ISCSI_MAC_INFO TempMacInfo;\r
- CHAR16 MacString[65];\r
+ CHAR16 MacString[70];\r
UINTN DeviceListSize;\r
\r
//\r
- // Dump all the handles the Simple Network Protocol is installed on.\r
+ // Dump all the handles the Managed Network Service Binding Protocol is installed on.\r
//\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r
- &gEfiSimpleNetworkProtocolGuid,\r
+ &gEfiManagedNetworkServiceBindingProtocolGuid,\r
NULL,\r
&NumHandles,\r
&Handles\r
LastDeviceIndex = 0;\r
\r
for (HandleIndex = 0; HandleIndex < NumHandles; HandleIndex++) {\r
- gBS->HandleProtocol (Handles[HandleIndex], &gEfiSimpleNetworkProtocolGuid, (VOID **)&Snp);\r
-\r
- Mode = Snp->Mode;\r
+ Status = NetLibGetMacAddress (Handles[HandleIndex], &MacAddress, &HwAddressSize);\r
+ ASSERT (Status == EFI_SUCCESS);\r
+ VlanId = NetLibGetVlanId (Handles[HandleIndex]);\r
\r
for (Index = LastDeviceIndex; Index < DeviceList->NumDevice; Index++) {\r
CurMacInfo = &DeviceList->MacInfo[Index];\r
- if ((CurMacInfo->Len == Mode->HwAddressSize) &&\r
- (NET_MAC_EQUAL (&CurMacInfo->Mac, &Mode->PermanentAddress, Mode->HwAddressSize))\r
+ if ((CurMacInfo->Len == HwAddressSize) &&\r
+ (CurMacInfo->VlanId == VlanId) &&\r
+ (NET_MAC_EQUAL (&CurMacInfo->Mac, MacAddress.Addr, HwAddressSize))\r
) {\r
//\r
// The previous configured NIC is still here.\r
// delete the variables\r
//\r
CurMacInfo = &DeviceList->MacInfo[Index];\r
- IScsiMacAddrToStr (&CurMacInfo->Mac, CurMacInfo->Len, MacString);\r
+ IScsiMacAddrToStr (&CurMacInfo->Mac, CurMacInfo->Len, CurMacInfo->VlanId, MacString);\r
gRT->SetVariable (MacString, &gEfiIScsiInitiatorNameProtocolGuid, 0, 0, NULL);\r
gRT->SetVariable (MacString, &mIScsiCHAPAuthInfoGuid, 0, 0, NULL);\r
}\r
DeviceList->NumDevice = (UINT8) NumHandles;\r
\r
for (Index = 0; Index < NumHandles; Index++) {\r
- gBS->HandleProtocol (Handles[Index], &gEfiSimpleNetworkProtocolGuid, (VOID **)&Snp);\r
- Mode = Snp->Mode;\r
+ NetLibGetMacAddress (Handles[Index], &MacAddress, &HwAddressSize);\r
\r
CurMacInfo = &DeviceList->MacInfo[Index];\r
- CopyMem (&CurMacInfo->Mac, &Mode->PermanentAddress, Mode->HwAddressSize);\r
- CurMacInfo->Len = (UINT8) Mode->HwAddressSize;\r
+ CopyMem (&CurMacInfo->Mac, MacAddress.Addr, HwAddressSize);\r
+ CurMacInfo->Len = (UINT8) HwAddressSize;\r
+ CurMacInfo->VlanId = NetLibGetVlanId (Handles[Index]);\r
}\r
\r
gRT->SetVariable (\r
ISCSI_CONFIG_FORM_ENTRY *ConfigFormEntry;\r
BOOLEAN EntryExisted;\r
EFI_STATUS Status;\r
- EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
+ EFI_MAC_ADDRESS MacAddress;\r
+ UINTN HwAddressSize;\r
+ UINT16 VlanId;\r
CHAR16 PortString[128];\r
UINT16 FormIndex;\r
UINTN BufferSize;\r
ConfigFormEntry->Controller = Controller;\r
\r
//\r
- // Get the simple network protocol and convert the MAC address into\r
- // the formatted string.\r
+ // Get the MAC address and convert it into the formatted string.\r
//\r
- Status = gBS->HandleProtocol (\r
- Controller,\r
- &gEfiSimpleNetworkProtocolGuid,\r
- (VOID **)&Snp\r
- );\r
+ Status = NetLibGetMacAddress (Controller, &MacAddress, &HwAddressSize);\r
ASSERT (Status == EFI_SUCCESS);\r
+ VlanId = NetLibGetVlanId (Controller);\r
\r
- IScsiMacAddrToStr (&Snp->Mode->PermanentAddress, Snp->Mode->HwAddressSize, ConfigFormEntry->MacString);\r
+ IScsiMacAddrToStr (&MacAddress, (UINT32) HwAddressSize, VlanId, ConfigFormEntry->MacString);\r
\r
//\r
// Get the normal session configuration data.\r