From: vanjeff Date: Thu, 4 Sep 2008 03:15:52 +0000 (+0000) Subject: 1. Remove unnecessary CONST. X-Git-Tag: edk2-stable201903~20414 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=11227adb144cd32be11d3e3064876ea1a8992665 1. Remove unnecessary CONST. 2. Remove Unnecessarily including . 3. Add comments for struct definition. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5806 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Include/Ppi/PciCfg2.h b/MdePkg/Include/Ppi/PciCfg2.h index b741cb7279..fbf6fa787d 100644 --- a/MdePkg/Include/Ppi/PciCfg2.h +++ b/MdePkg/Include/Ppi/PciCfg2.h @@ -22,7 +22,6 @@ #ifndef __PEI_PCI_CFG2_H__ #define __PEI_PCI_CFG2_H__ -#include #include #define EFI_PEI_PCI_CFG2_PPI_GUID \ @@ -52,10 +51,29 @@ typedef enum { /// EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS /// typedef struct { + /// + /// 8-bit register offset within the PCI configuration space for a given device's function + /// space. + /// UINT8 Register; + /// + /// Only the 3 least-significant bits are used to encode one of 8 possible functions within a + /// given device. + /// UINT8 Function; + /// + /// Only the 5 least-significant bits are used to encode one of 32 possible devices. + /// UINT8 Device; + /// + /// 8-bit value to encode between 0 and 255 buses. + /// UINT8 Bus; + /// + /// Register number in PCI configuration space. If this field is zero, then Register is used + /// for the register number. If this field is non-zero, then Register is ignored and this field + /// is used for the register number. + /// UINT32 ExtendedRegister; } EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS; @@ -131,8 +149,8 @@ EFI_STATUS IN CONST EFI_PEI_PCI_CFG2_PPI *This, IN EFI_PEI_PCI_CFG_PPI_WIDTH Width, IN UINT64 Address, - IN CONST VOID *SetBits, - IN CONST VOID *ClearBits + IN VOID *SetBits, + IN VOID *ClearBits ); /** diff --git a/MdePkg/Include/Ppi/Smbus2.h b/MdePkg/Include/Ppi/Smbus2.h index e2c3756405..e27ded9a2b 100644 --- a/MdePkg/Include/Ppi/Smbus2.h +++ b/MdePkg/Include/Ppi/Smbus2.h @@ -20,6 +20,7 @@ #ifndef __PEI_SMBUS2_PPI_H__ #define __PEI_SMBUS2_PPI_H__ + #include #include @@ -47,19 +48,15 @@ typedef UINTN EFI_SMBUS_DEVICE_COMMAND; It can mean the offset to a list of functions inside an SMBus slave device. Not all operations or slave devices support this command's registers. - @param Operation Signifies which particular SMBus hardware protocol instance that it will use to execute the SMBus transactions. This SMBus hardware protocol is defined by the System Management Bus (SMBus) Specification and is not related to UEFI. - @param PecCheck Defines if Packet Error Code (PEC) checking is required for this operation. - @param Length Signifies the number of bytes that this operation will do. The maximum number of bytes can be revision specific and operation specific. This parameter will contain the actual number of bytes that are executed for this operation. Not all operations require this argument. - @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations require this argument. The length of this buffer is identified by Length. @@ -85,10 +82,10 @@ typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION)( IN CONST EFI_PEI_SMBUS2_PPI *This, - IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, - IN CONST EFI_SMBUS_DEVICE_COMMAND Command, - IN CONST EFI_SMBUS_OPERATION Operation, - IN CONST BOOLEAN PecCheck, + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN EFI_SMBUS_DEVICE_COMMAND Command, + IN EFI_SMBUS_OPERATION Operation, + IN BOOLEAN PecCheck, IN OUT UINTN *Length, IN OUT VOID *Buffer ); @@ -121,14 +118,22 @@ typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE)( IN CONST EFI_PEI_SMBUS2_PPI *This, - IN CONST BOOLEAN ArpAll, - IN CONST EFI_SMBUS_UDID *SmbusUdid, OPTIONAL + IN BOOLEAN ArpAll, + IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL ); typedef struct { + /// + /// The SMBUS hardware address to which the SMBUS device is preassigned or + /// allocated. Type EFI_SMBUS_DEVICE_ADDRESS is defined in EFI_PEI_SMBUS2_PPI.Execute(). + /// EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress; + /// + /// The SMBUS Unique Device Identifier (UDID) as defined in EFI_SMBUS_UDID. + /// Type EFI_SMBUS_UDID is defined in EFI_PEI_SMBUS2_PPI.ArpDevice(). + /// EFI_SMBUS_UDID SmbusDeviceUdid; } EFI_SMBUS_DEVICE_MAP; @@ -162,14 +167,17 @@ EFI_STATUS @param Data Data of the SMBus host notify command that the caller wants to be called. - @return Status + @retval EFI_SUCCESS NotifyFunction has been registered. + @retval EFI_UNSUPPORTED ArpDevice, GetArpMap, and Notify are not + implemented by this PEIM. + **/ typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION)( IN CONST EFI_PEI_SMBUS2_PPI *SmbusPpi, - IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, - IN CONST UINTN Data + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN UINTN Data ); /** @@ -191,40 +199,38 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY)( - IN CONST EFI_PEI_SMBUS2_PPI *This, - IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, - IN CONST UINTN Data, - IN CONST EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction + IN CONST EFI_PEI_SMBUS2_PPI *This, + IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, + IN UINTN Data, + IN EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction ); -/** - @par Ppi Description: - Provides the basic I/O interfaces that a PEIM uses to access - its SMBus controller and the slave devices attached to it. - - @param Execute - Executes the SMBus operation to an SMBus slave device. - - @param ArpDevice - Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP) - - @param GetArpMap - Allows a PEIM to retrieve the address that was allocated by the SMBus - host controller during enumeration/ARP. - - @param Notify - Allows a driver to register for a callback to the SMBus host - controller driver when the bus issues a notification to the bus controller PEIM. - - @param Identifier - Identifier which uniquely identifies this SMBus controller in a system. - -**/ +/// +/// Provides the basic I/O interfaces that a PEIM uses to access +/// its SMBus controller and the slave devices attached to it. +/// struct _EFI_PEI_SMBUS2_PPI { + /// + /// Executes the SMBus operation to an SMBus slave device. + /// EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute; + /// + /// Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP). + /// EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice; + /// + /// Allows a PEIM to retrieve the address that was allocated by the SMBus + /// host controller during enumeration/ARP. + /// EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap; + /// + /// Allows a driver to register for a callback to the SMBus host + /// controller driver when the bus issues a notification to the bus controller PEIM. + /// EFI_PEI_SMBUS2_PPI_NOTIFY Notify; + /// + /// Identifier which uniquely identifies this SMBus controller in a system. + /// EFI_GUID Identifier; };