summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-19 09:36:44 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-19 09:36:44 +0000
commit391a0724f2f91ae544492c2902e1e5f387ee62b7 (patch)
tree3195f4867ee55673a975689c90abf0ef5fef14bb /MdeModulePkg/Universal/Network
parent6e3f5b2aa919512aea5c4c8298df3a907572a95a (diff)
downloadedk2-platforms-391a0724f2f91ae544492c2902e1e5f387ee62b7.tar.xz
1.fixed some issue to pass HII sct
2.supported more route table accessed by HII service. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8338 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c22
-rw-r--r--MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h2
2 files changed, 20 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
index c25e682320..3bcad8352c 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
@@ -345,6 +345,13 @@ Ip4DeviceExtractConfig (
*Progress = Request;
+ //
+ // Check Request data in <ConfigHdr>.
+ //
+ if (!HiiIsConfigHdrMatch (Request, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {
+ return EFI_NOT_FOUND;
+ }
+
Private = IP4CONFIG_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_IP4FORM_CALLBACK_INFO (Private);
@@ -372,7 +379,6 @@ Ip4DeviceExtractConfig (
Progress
);
- *Progress = Request + StrLen (Request);
FreePool (IfrDeviceNvData);
return Status;
@@ -422,6 +428,7 @@ Ip4DeviceRouteConfig (
EFI_STATUS Status;
UINTN BufferSize;
NIC_IP4_CONFIG_INFO *IfrDeviceNvData;
+ NIC_IP4_CONFIG_INFO *NicInfo;
IP4_FORM_CALLBACK_INFO *Private;
EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
IP4_CONFIG_INSTANCE *Ip4ConfigInstance;
@@ -433,6 +440,13 @@ Ip4DeviceRouteConfig (
*Progress = Configuration;
+ //
+ // Check Routing data in <ConfigHdr>.
+ //
+ if (!HiiIsConfigHdrMatch (Configuration, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {
+ return EFI_NOT_FOUND;
+ }
+
Private = IP4CONFIG_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK (This);
Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_IP4FORM_CALLBACK_INFO (Private);
@@ -456,13 +470,14 @@ Ip4DeviceRouteConfig (
if (!EFI_ERROR (Status)) {
ZeroMem (&ZeroMac, sizeof (EFI_MAC_ADDRESS));
if (CompareMem (&IfrDeviceNvData->NicAddr.MacAddr, &ZeroMac, IfrDeviceNvData->NicAddr.Len) != 0) {
- Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, IfrDeviceNvData, TRUE);
+ BufferSize = sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * IfrDeviceNvData->Ip4Info.RouteTableSize;
+ NicInfo = AllocateCopyPool (BufferSize, IfrDeviceNvData);
+ Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NicInfo, TRUE);
} else {
Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);
}
}
- *Progress = Configuration + StrLen (Configuration);
FreePool (IfrDeviceNvData);
return Status;
@@ -539,6 +554,7 @@ Ip4FormExtractConfig (
OUT EFI_STRING *Results
)
{
+ *Progress = Request;
return EFI_NOT_FOUND;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h
index 991fc73a8d..ba30a2ccf5 100644
--- a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h
+++ b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h
@@ -21,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
extern UINT8 Ip4ConfigDxeBin[];
extern UINT8 Ip4ConfigDxeStrings[];
-#define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * 2
+#define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE
///