return (UINT16) ((Bus << 8) | (Device << 3) | Function);\r
}\r
\r
-/**\r
- Get the MAC address of the controller.\r
- \r
- @param[in] Controller The handle of the controller.\r
-\r
- @return EFI_MAC_ADDRESS * The mac address.\r
-**/\r
-EFI_MAC_ADDRESS *\r
-IScsiGetMacAddress (\r
- IN EFI_HANDLE Controller\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
-\r
- Status = gBS->HandleProtocol (\r
- Controller,\r
- &gEfiSimpleNetworkProtocolGuid,\r
- (VOID **) &Snp\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return &Snp->Mode->PermanentAddress;\r
-}\r
-\r
/**\r
Fill the NIC and target sections in iSCSI Boot Firmware Table.\r
\r
UINT16 *SectionOffset;\r
UINTN Index;\r
UINT16 Length;\r
- EFI_MAC_ADDRESS *Mac;\r
+ EFI_MAC_ADDRESS MacAddress;\r
+ UINTN HwAddressSize;\r
ISCSI_PRIVATE_PROTOCOL *IScsiIdentifier;\r
EFI_STATUS Status;\r
\r
IScsiMapV4ToV6Addr (&SessionConfigData->SecondaryDns, &Nic->SecondaryDns);\r
IScsiMapV4ToV6Addr (&SessionConfigData->DhcpServer, &Nic->DhcpServer);\r
\r
- Mac = IScsiGetMacAddress (DriverData->Controller);\r
- CopyMem (Nic->Mac, Mac, sizeof (Nic->Mac));\r
+ Nic->VLanTag = NetLibGetVlanId (DriverData->Controller);\r
+\r
+ Status = NetLibGetMacAddress (DriverData->Controller, &MacAddress, &HwAddressSize);\r
+ ASSERT (Status == EFI_SUCCESS);\r
+ CopyMem (Nic->Mac, MacAddress.Addr, sizeof (Nic->Mac));\r
\r
//\r
// Get the PCI location of the Nic.\r