From c8d8f1e3320ebbfc1a4a26cb232cbe54d865b814 Mon Sep 17 00:00:00 2001 From: jgong5 Date: Tue, 30 Dec 2008 02:21:34 +0000 Subject: code scrub for Ip4ConfigDxe git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7149 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Include/Protocol/NicIp4Config.h | 102 +++++++++++++++++++++------ 1 file changed, 81 insertions(+), 21 deletions(-) (limited to 'MdeModulePkg/Include/Protocol') diff --git a/MdeModulePkg/Include/Protocol/NicIp4Config.h b/MdeModulePkg/Include/Protocol/NicIp4Config.h index 71bd7c4ebe..28284febda 100644 --- a/MdeModulePkg/Include/Protocol/NicIp4Config.h +++ b/MdeModulePkg/Include/Protocol/NicIp4Config.h @@ -1,5 +1,6 @@ /** @file This file defines NicIp4Config Protocol. + EFI_NIC_IP4_CONFIG_PROTOCOL is a proprietary protocol, not defined by UEFI2.0. Copyright (c) 2006 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials @@ -54,34 +55,58 @@ typedef enum { // because it don't know how to configure the default IP address even // it has got the address. // -// NIC_ADDR contains the interface's type and MAC address to identify -// a specific NIC. NIC_IP4_CONFIG_INFO contains the IP4 configure -// parameters for that NIC. IP4_CONFIG_VARIABLE is the EFI variable to -// save the configuration. NIC_IP4_CONFIG_INFO and IP4_CONFIG_VARIABLE -// is of variable length. -// -// EFI_NIC_IP4_CONFIG_PROTOCOL is a priority protocol, not defined by UEFI2.0 -// + +/// +/// NIC_ADDR contains the interface's type and MAC address to identify +/// a specific NIC. +/// typedef struct { - UINT16 Type; - UINT8 Len; - EFI_MAC_ADDRESS MacAddr; + UINT16 Type; ///< Interface type + UINT8 Len; ///< Length of MAC address + EFI_MAC_ADDRESS MacAddr; ///< MAC address of interface } NIC_ADDR; +/// +/// NIC_IP4_CONFIG_INFO contains the IP4 configure +/// parameters for that NIC. NIC_IP4_CONFIG_INFO is +/// of variable length. +/// typedef struct { - NIC_ADDR NicAddr; // Link layer address to identify the NIC - UINT32 Source; // Static or DHCP - BOOLEAN Perment; // Survive the reboot or not - EFI_IP4_IPCONFIG_DATA Ip4Info; // IP addresses + NIC_ADDR NicAddr; ///< Link layer address to identify the NIC + UINT32 Source; ///< Static or DHCP + BOOLEAN Perment; ///< Survive the reboot or not + EFI_IP4_IPCONFIG_DATA Ip4Info; ///< IP addresses } NIC_IP4_CONFIG_INFO; +/// +/// IP4_CONFIG_VARIABLE is the EFI variable to +/// save the configuration. IP4_CONFIG_VARIABLE is +/// of variable length. +/// typedef struct { - UINT32 Len; // Total length of the variable - UINT16 CheckSum; // CheckSum, the same as IP4 head checksum - UINT32 Count; // Number of NIC_IP4_CONFIG_INFO follows + UINT32 Len; ///< Total length of the variable + UINT16 CheckSum; ///< CheckSum, the same as IP4 head checksum + UINT32 Count; ///< Number of NIC_IP4_CONFIG_INFO follows NIC_IP4_CONFIG_INFO ConfigInfo; } IP4_CONFIG_VARIABLE; +/** + Get the configure parameter for this NIC. + + @param This The NIC IP4 CONFIG protocol. + @param Len The length of the NicConfig buffer. + @param NicConfig The buffer to receive the NIC's configure + parameter. + + @retval EFI_SUCCESS The configure parameter for this NIC was + obtained successfully . + @retval EFI_INVALID_PARAMETER This or ConfigLen is NULL. + @retval EFI_NOT_FOUND There is no configure parameter for the NIC in + NVRam. + @retval EFI_BUFFER_TOO_SMALL The ConfigLen is too small or the NicConfig is + NULL. + +**/ typedef EFI_STATUS (EFIAPI *EFI_NIC_IP4_CONFIG_GET_INFO)( @@ -90,20 +115,55 @@ EFI_STATUS OUT NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL ); +/** + Set the IP configure parameters for this NIC. + + If Reconfig is TRUE, the IP driver will be informed to discard current + auto configure parameter and restart the auto configuration process. + If current there is a pending auto configuration, EFI_ALREADY_STARTED is + returned. You can only change the configure setting when either + the configure has finished or not started yet. If NicConfig, the + NIC's configure parameter is removed from the variable. + + @param This The NIC IP4 CONFIG protocol + @param NicConfig The new NIC IP4 configure parameter + @param Reconfig Inform the IP4 driver to restart the auto + configuration + + @retval EFI_SUCCESS The configure parameter for this NIC was + set successfully . + @retval EFI_INVALID_PARAMETER This is NULL or the configure parameter is + invalid. + @retval EFI_ALREADY_STARTED There is a pending auto configuration. + @retval EFI_NOT_FOUND No auto configure parameter is found + +**/ typedef EFI_STATUS (EFIAPI *EFI_NIC_IP4_CONFIG_SET_INFO)( IN EFI_NIC_IP4_CONFIG_PROTOCOL *This, - IN NIC_IP4_CONFIG_INFO *NicConfig, OPTIONAL + IN NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL, IN BOOLEAN ReConfig ); +/** + Return the name and MAC address for the NIC. The Name, if not NULL, + has at least IP4_NIC_NAME_LENGTH bytes. + + @param This The NIC IP4 CONFIG protocol + @param Name The buffer to return the name + @param NicAddr The buffer to return the MAC addr + + @retval EFI_INVALID_PARAMETER This is NULL + @retval EFI_SUCCESS The name or address of the NIC are returned. + +**/ typedef EFI_STATUS (EFIAPI *EFI_NIC_IP4_CONFIG_GET_NAME)( IN EFI_NIC_IP4_CONFIG_PROTOCOL *This, - IN UINT16 *Name, OPTIONAL - IN NIC_ADDR *NicAddr OPTIONAL + OUT UINT16 *Name OPTIONAL, + OUT NIC_ADDR *NicAddr OPTIONAL ); struct _EFI_NIC_IP4_CONFIG_PROTOCOL { -- cgit v1.2.3