Enhance iSCSI ibft table for copy oemid and oemtableID from acpi tables.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8752 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy 2009-07-06 03:06:50 +00:00
parent e5fe626f52
commit 54fbbbd7e9
4 changed files with 40 additions and 4 deletions

View File

@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //
// Vfr has a limit on the size, it's 255 bytes. // Vfr has a limit on the size, it's 255 bytes.
// //
#define ISCSI_NAME_IFR_MAX_SIZE 126 #define ISCSI_NAME_IFR_MAX_SIZE 223
#define IP_MIN_SIZE 7 #define IP_MIN_SIZE 7
#define IP_MAX_SIZE 15 #define IP_MAX_SIZE 15

View File

@ -95,4 +95,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
[Guids] [Guids]
gEfiEventExitBootServicesGuid gEfiEventExitBootServicesGuid
gEfiIfrTianoGuid ## CONSUMES ## Guid gEfiIfrTianoGuid ## CONSUMES ## GUID
gEfiAcpiTableGuid ## CONSUMES ## GUID
gEfiAcpi10TableGuid ## CONSUMES ## GUID
gEfiAcpi20TableGuid ## CONSUMES ## GUID

View File

@ -24,7 +24,9 @@ UINTN mTableKey;
**/ **/
VOID VOID
IScsiInitIbfTableHeader ( IScsiInitIbfTableHeader (
OUT EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Header OUT EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Header,
IN UINT8 *OemId,
IN UINT64 *OemTableId
) )
{ {
ZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER)); ZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER));
@ -39,6 +41,9 @@ IScsiInitIbfTableHeader (
Header->OemId[2] = 'T'; Header->OemId[2] = 'T';
Header->OemId[3] = 'E'; Header->OemId[3] = 'E';
Header->OemId[4] = 'L'; Header->OemId[4] = 'L';
CopyMem (Header->OemId, OemId, sizeof (Header->OemId));
Header->OemTableId = *OemTableId;
} }
/** /**
@ -449,12 +454,39 @@ IScsiPublishIbft (
EFI_HANDLE *HandleBuffer; EFI_HANDLE *HandleBuffer;
UINT8 *Heap; UINT8 *Heap;
UINT8 Checksum; UINT8 Checksum;
UINTN Index;
EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp;
EFI_ACPI_DESCRIPTION_HEADER *Rsdt;
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol); Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return ; return ;
} }
//
// Find ACPI table RSD_PTR from system table
//
for (Index = 0, Rsdp = NULL; Index < gST->NumberOfTableEntries; Index++) {
if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi20TableGuid) ||
CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpi10TableGuid) ||
CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), &gEfiAcpiTableGuid)
) {
//
// A match was found.
//
Rsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) gST->ConfigurationTable[Index].VendorTable;
break;
}
}
if (Rsdp == NULL) {
return ;
} else {
Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress;
}
if (mIbftInstalled) { if (mIbftInstalled) {
Status = AcpiTableProtocol->UninstallAcpiTable ( Status = AcpiTableProtocol->UninstallAcpiTable (
AcpiTableProtocol, AcpiTableProtocol,
@ -492,7 +524,7 @@ IScsiPublishIbft (
// //
// Fill in the various section of the iSCSI Boot Firmware Table. // Fill in the various section of the iSCSI Boot Firmware Table.
// //
IScsiInitIbfTableHeader (Table); IScsiInitIbfTableHeader (Table, Rsdt->OemId, &Rsdt->OemTableId);
IScsiInitControlSection (Table, HandleCount); IScsiInitControlSection (Table, HandleCount);
IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]); IScsiFillInitiatorSection (Table, &Heap, HandleBuffer[0]);
IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer); IScsiFillNICAndTargetSections (Table, &Heap, HandleCount, HandleBuffer);

View File

@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiRuntimeServicesTableLib.h> #include <Library/UefiRuntimeServicesTableLib.h>
#include <Guid/EventGroup.h> #include <Guid/EventGroup.h>
#include <Guid/Acpi.h>
#include "IScsiCommon.h" #include "IScsiCommon.h"
#include "IScsiDriver.h" #include "IScsiDriver.h"