[edk2] [PATCH v5 0/8] Add Ipmi related libraries.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header file and MdeModulePkg.dsc
file for Ipmi libraries. Add Ipmi realted libraries to support
generic Ipmi submit command. Also add Ppi/Protocol definitions
that will be produced by Ipmi Peim and drivers.
In V5, change for coding style.

Daocheng Bu (8):
  MdePkg: Update Ipmi2.0 definitions header file.
  MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.
  MdeModulePkg: White space clean up for MdeModulePkg.dec
  MdeModulePkg: Add BaseIpmiLib Null Library Instance.
  MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.
  MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.
  MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.
  MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

 MdeModulePkg/Include/Library/IpmiLib.h |  51 +++
 MdeModulePkg/Include/Ppi/IpmiPpi.h |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h   |  72 +++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  |  53 +++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf|  38 
 .../DxeIpmiLibIpmiProtocol.c   |  81 +
 .../DxeIpmiLibIpmiProtocol.inf |  40 
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  |  81 +
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf|  41 +
 .../SmmIpmiLibSmmIpmiProtocol.c|  82 +
 .../SmmIpmiLibSmmIpmiProtocol.inf  |  40 
 MdeModulePkg/MdeModulePkg.dec  | 101 -
 MdeModulePkg/MdeModulePkg.dsc  |   4 +
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h |  61 +++--
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h |  31 +++
 .../IndustryStandard/IpmiNetFnSensorEvent.h|   2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h |  80 
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |   4 +-
 18 files changed, 799 insertions(+), 128 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v5 7/8] MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add SmmIpmiLibSmmIpmiProtocol Library Instance based on
Ipmi smm protocol in SMM mode.

In V5, change for code style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 .../SmmIpmiLibSmmIpmiProtocol.c| 82 ++
 .../SmmIpmiLibSmmIpmiProtocol.inf  | 40 +++
 2 files changed, 122 insertions(+)
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
new file mode 100644
index 000..70d12a2
--- /dev/null
+++ b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
@@ -0,0 +1,82 @@
+/** @file
+  Implementation of Ipmi Library for SMM.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gSmst->SmmLocateProtocol (
+  &gSmmIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Smm Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
new file mode 100644
index 000..f13e5a4
--- /dev/null
+++ 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of SMM IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME 

[edk2] [PATCH v5 6/8] MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add DxeIpmiLibIpmiProtocol Library Instance based on
Ipmi Protocol in DXE phase.

In V5,change for coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 .../DxeIpmiLibIpmiProtocol.c   | 81 ++
 .../DxeIpmiLibIpmiProtocol.inf | 40 +++
 2 files changed, 121 insertions(+)
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
new file mode 100644
index 000..d15c6bd
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
@@ -0,0 +1,81 @@
+/** @file
+  Implementation of Ipmi Library in DXE Phase for SMS.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gBS->LocateProtocol (
+  &gIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Dxe Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Dxe Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
new file mode 100644
index 000..5b56b39
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of IPMI Library in DXE phase for SMS.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = DxeIpmiLibIpmiProtocol

[edk2] [PATCH v5 5/8] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.

2015-12-22 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

In V5, change for code style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 81 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 +++
 2 files changed, 122 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..cb6a007
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,81 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS   Status;
+  PEI_IPMI_PPI *IpmiPpi;
+
+  Status = PeiServicesLocatePpi(
+&gPeiIpmiPpiGuid,
+0,
+NULL,
+(VOID **) &IpmiPpi
+);
+  if (EFI_ERROR (Status)) {
+//
+// Ipmi Ppi is not installed. So, IPMI device is not present.
+//
+DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+return EFI_NOT_FOUND;
+  }
+
+  Status = IpmiPpi->IpmiSubmitCommand (
+IpmiPpi,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..e2e2646
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS

[edk2] [PATCH v5 4/8] MdeModulePkg: Add BaseIpmiLib Null Library Instance.

2015-12-22 Thread Daocheng Bu
Add BaseIpmiLib Null Library Instance for BMC-LESS
platform.

In V5, change for coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  | 53 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf| 38 
 2 files changed, 91 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
new file mode 100644
index 000..a7db3f1
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -0,0 +1,53 @@
+/** @file
+  A emptry template implementation of Ipmi Library.
+
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  //
+  // Do nothing, just return EFI_UNSUPPORTED.
+  //
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
new file mode 100644
index 000..fc9d06d
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -0,0 +1,38 @@
+## @file
+#  Null Instance of IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BaseIpmiLibNull
+  FILE_GUID = 46805D61-0BB8-4680-A9BE-C96C751AB5A4
+  MODULE_TYPE   = BASE
+  VERSION_STRING= 1.0
+  LIBRARY_CLASS = IpmiLib
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  BaseIpmiLibNull.c
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v5 8/8] MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

2015-12-22 Thread Daocheng Bu
Update MdeModulePkg.dsc file to include Ipmi Libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index b31c02e..0e3e5eb 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -291,6 +291,10 @@
   MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
   MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.inf
+  MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
+  MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
+  MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
+  MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v5 3/8] MdeModulePkg: White space clean up for MdeModulePkg.dec

2015-12-22 Thread Daocheng Bu
White space clean up for MdeModulePkg.dec

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dec | 90 +--
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index cb7d254..68686cf 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -4,13 +4,13 @@
 # and libraries instances, which are used for those modules.
 #
 # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
-# This program and the accompanying materials are licensed and made available 
under 
-# the terms and conditions of the BSD License that accompanies this 
distribution.  
+# This program and the accompanying materials are licensed and made available 
under
+# the terms and conditions of the BSD License that accompanies this 
distribution.
 # The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.  

-# 
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.  
+# http://opensource.org/licenses/bsd-license.php.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 ##
 
@@ -97,11 +97,11 @@
   ##  @libraryclass  Provide capability to maintain the data integrity cross 
S3 phase.
   #
   LockBoxLib|Include/Library/LockBoxLib.h
-  
+
   ##  @libraryclass  Provide the CPU exception handler.
   #
   CpuExceptionHandlerLib|Include/Library/CpuExceptionHandlerLib.h
-  
+
   ##  @libraryclassProvides platform specific display interface.
   #
   CustomizedDisplayLib|Include/Library/CustomizedDisplayLib.h
@@ -130,7 +130,7 @@
   ## @libraryclass  Provides services to get variable error flag and do 
platform variable cleanup.
   #
   PlatformVarCleanupLib|Include/Library/PlatformVarCleanupLib.h
-  
+
   ## @libraryclass  Provides services to get do the file explorer.
   #
   FileExplorerLib|Include/Library/FileExplorerLib.h
@@ -214,7 +214,7 @@
   ## Guid is defined for SMM variable module to notify SMM variable wrapper 
module when variable write service was ready.
   #  Include/Guid/SmmVariableCommon.h
   gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 
0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
-  
+
   ## Performance protocol guid that also acts as the performance HOB guid and 
performance variable GUID
   #  Include/Guid/Performance.h
   gPerformanceProtocolGuid   = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 
0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
@@ -237,14 +237,14 @@
   #  Include/Guid/StatusCodeDataTypeDebug.h
   gEfiStatusCodeDataTypeDebugGuid  = { 0x9A4E9246, 0xD553, 0x11D5, { 0x87, 
0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9 }}
 
-  ##  A configuration Table Guid for Load module at fixed address 
+  ##  A configuration Table Guid for Load module at fixed address
   #  Include/Guid/LoadModuleAtFixedAddress.h
   gLoadFixedAddressConfigurationTableGuid  = { 0x2CA88B53,0xD296,0x4080, { 
0xA4,0xA5,0xCA,0xD9,0xBA,0xE2,0x4B,0x9 } }
 
   ## GUID used to store the global debug mask value into an EFI Variable
-  # Include/Guid/DebugMask.h  
+  # Include/Guid/DebugMask.h
   gEfiGenericVariableGuid = { 0x59d1c24f, 0x50f1, 0x401a, {0xb1, 0x01, 0xf3, 
0x3e, 0x0d, 0xae, 0xd4, 0x43} }
-  
+
   ##  Event for the DXE Core to signal idle events
   #  Include/Guid/EventIdle.h
   gIdleLoopEventGuid  = { 0x3c8d294c, 0x5fc3, 0x4451, { 0xbb, 0x31, 0xc4, 
0xc0, 0x32, 0x29, 0x5e, 0x6c } }
@@ -277,7 +277,7 @@
   ## Include/Guid/UsbKeyBoardLayout.h
   gUsbKeyboardLayoutPackageGuid  = { 0xc0f3b43, 0x44de, 0x4907, { 0xb4, 
0x78, 0x22, 0x5f, 0x6f, 0x62, 0x89, 0xdc }}
   gUsbKeyboardLayoutKeyGuid  = { 0x3a4d7a7c, 0x18a, 0x4b42, { 0x81, 
0xb3, 0xdc, 0x10, 0xe3, 0xb5, 0x91, 0xbd }}
-  
+
   ## Include/Guid/HiiResourceSampleHii.h
   gHiiResourceSamleFormSetGuid   = { 0x4f4ef7f0, 0xaa29, 0x4ce9, { 0xba, 
0x41, 0x64, 0x3e, 0x1, 0x23, 0xa9, 0x9f }}
 
@@ -301,7 +301,7 @@
 
   ## Include/Guid/ZeroGuid.h
   gZeroGuid  = { 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0, 0x0}}
-  
+
   ## Include/Guid/MtcVendor.h
   gMtcVendorGuid = { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 
0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }}
 
@@ -318,7 +318,7 @@
 
   ## Include/Guid/StatusCodeDataTypeVariable.h
   gEdkiiStatusCodeDataTypeVariableGuid = { 0xf6ee6dbb, 0xd67f, 0x4ea0, { 0x8b, 
0x96, 0x6a, 0x71, 0xb1, 0x9d, 0x84, 0xad }}
-  
+
   ## Include/Guid/MemoryProfile.h
   gEdkiiMemoryProfileGuid  = { 0x821c9a09, 0x541a, 0x40f6, { 0x9f, 
0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe }}
 
@@ -338,7 +338,7 @@
 
   

[edk2] [PATCH v5 2/8] MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol header file. Update dec file
for new IpmiLib and Ppi/Protocol header file.

In V5,change for coding style.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 MdeModulePkg/Include/Library/IpmiLib.h   | 51 
 MdeModulePkg/Include/Ppi/IpmiPpi.h   | 65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h | 72 
 MdeModulePkg/MdeModulePkg.dec| 11 +
 4 files changed, 199 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..71b0c1a
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,51 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..b8f7063
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,65 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] This  This point for PEI_IPMI_PPI structure.
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in, out]ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command

[edk2] [PATCH v5 1/8] MdePkg: Update Ipmi2.0 definitions header file.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header files for data structure
name suffix for request/response data and completion code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Reviewed-by: Liming Gao 
---
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 61 +
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 31 -
 .../IndustryStandard/IpmiNetFnSensorEvent.h|  2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h | 80 --
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |  4 +-
 5 files changed, 95 insertions(+), 83 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index c0865da..31f9e83 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -43,6 +43,7 @@
 //  Constants and Structure definitions for "Get Device ID" command to follow 
here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   DeviceId;
   UINT8   DeviceRevision : 4;
   UINT8   Reserved : 3;
@@ -62,7 +63,7 @@ typedef struct {
   UINT8   ManufacturerId[3];
   UINT16  ProductId;
   UINT32  AuxFirmwareRevInfo;
-} IPMI_MSG_GET_DEVICE_ID_RSP;
+} IPMI_GET_DEVICE_ID_RESPONSE;
 
 
 //
@@ -89,12 +90,13 @@ typedef struct {
 #define IPMI_APP_GET_SELFTEST_RESULTS  0x4
 
 //
-//  Constants and Structure definitions for "Get Self Results" command to 
follow here
+//  Constants and Structure definitions for "Get Self Test Results" command to 
follow here
 //
 typedef struct {
+  UINT8  CompletionCode;
   UINT8  Result;
   UINT8  Param;
-} IPMI_MSG_SELFTEST_RESULT_RSP;
+} IPMI_SELF_TEST_RESULT_RESPONSE;
 
 #define IPMI_APP_SELFTEST_NO_ERROR 0x55
 #define IPMI_APP_SELFTEST_NOT_IMPLEMENTED  0x56
@@ -127,11 +129,11 @@ typedef struct {
 //  Constants and Structure definitions for "Set ACPI Power State" command to 
follow here
 //
 typedef struct {
-  UINT8 SystemPowerState : 7;
-  UINT8 SystemStateChange : 1;
-  UINT8 DevicePowerState : 7;
-  UINT8 DeviceStateChange : 1;
-} IPMI_ACPI_POWER_STATE;
+  UINT8  AcpiSystemPowerState  : 7;
+  UINT8  AcpiSystemStateChange : 1;
+  UINT8  AcpiDevicePowerState  : 7;
+  UINT8  AcpiDeviceStateChange : 1;
+} IPMI_SET_ACPI_POWER_STATE_REQUEST;
 
 //
 //  Definitions for Get ACPI Power State command
@@ -154,8 +156,9 @@ typedef struct {
 //  Message structure definition for "Get Device Guid" IPMI command
 //
 typedef struct {
-  UINT8 Guid[16];
-} IPMI_MSG_GET_DEVICE_GUID_RSP;
+  UINT8  CompletionCode;
+  UINT8  Guid[16];
+} IPMI_GET_DEVICE_GUID_RESPONSE;
 
 //
 //  Below is Definitions for BMC Watchdog Timer Commands (Chapter 27)
@@ -190,7 +193,7 @@ typedef struct {
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
-} IPMI_SET_WATCHDOG_TIMER;
+} IPMI_SET_WATCHDOG_TIMER_REQUEST;
 
 //
 //  Definitions for Get WatchDog Timer command
@@ -201,13 +204,14 @@ typedef struct {
 //  Constants and Structure definitions for "Get WatchDog Timer" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   IPMI_WATCHDOG_TIMER_USE TimerUse;
   UINT8   TimerActions;
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
   UINT16  PresentCountdownValue;
-} IPMI_GET_WATCHDOG_TIMER;
+} IPMI_GET_WATCHDOG_TIMER_RESPONSE;
 
 //
 //  Below is Definitions for IPMI Messaging Support Commands (Chapter 22)
@@ -384,20 +388,21 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Access" command to 
follow here
 //
 typedef struct {
-  UINT8 ChannelNo : 4;
-  UINT8 Reserve1 : 4;
-  UINT8 Reserve2 : 6;
-  UINT8 MemoryType : 2;
-} IPMI_GET_CHANNEL_ACCESS_COMMAND;
+  UINT8  ChannelNo : 4;
+  UINT8  Reserve1 : 4;
+  UINT8  Reserve2 : 6;
+  UINT8  MemoryType : 2;
+} IPMI_GET_CHANNEL_ACCESS_REQUEST;
 
 typedef struct {
-  UINT8 AccessMode : 3;
-  UINT8 UserLevelAuthEnabled : 1;
-  UINT8 MessageAuthEnable : 1;
-  UINT8 Alert : 1;
-  UINT8 Reserve1 : 2;
-  UINT8 ChannelPriviledgeLimit : 4;
-  UINT8 Reserve2 : 4;
+  UINT8  CompletionCode;
+  UINT8  AccessMode : 3;
+  UINT8  UserLevelAuthEnabled : 1;
+  UINT8  MessageAuthEnable : 1;
+  UINT8  Alert : 1;
+  UINT8  Reserve1 : 2;
+  UINT8  ChannelPriviledgeLimit : 4;
+  UINT8  Reserve2 : 4;
 } IPMI_GET_CHANNEL_ACCESS_RESPONSE;
 
 //
@@ -409,6 +414,7 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Info" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   ChannelNo : 4;
   UINT8   Reserve1 : 4;
   UINT8   ChannelMediumType : 7;
@@ -417,10 +423,9 @@ typedef struct {
   UI

[edk2] [PATCH v4 1/3] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library instance.

2015-12-22 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

In V4, update local variable name to IpmiPpi.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 80 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 +++
 2 files changed, 121 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..0de9c0f
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS   Status;
+  PEI_IPMI_PPI *IpmiPpi;
+
+  Status = PeiServicesLocatePpi(
+&gPeiIpmiPpiGuid,
+0,
+NULL,
+(VOID **) &IpmiPpi
+);
+  if (EFI_ERROR (Status)) {
+//
+// Ipmi Ppi is not installed. So, IPMI device is not present.
+//
+DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+return EFI_NOT_FOUND;
+  }
+
+  Status = IpmiPpi->IpmiSubmitCommand (
+IpmiPpi,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..94c6432
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS

[edk2] [PATCH v4 3/3] MdeModulePkg: White space clean up for MdeModulePkg.dec

2015-12-22 Thread Daocheng Bu
White space clean up for MdeModulePkg.dec

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dec | 90 +--
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index cb7d254..68686cf 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -4,13 +4,13 @@
 # and libraries instances, which are used for those modules.
 #
 # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
-# This program and the accompanying materials are licensed and made available 
under 
-# the terms and conditions of the BSD License that accompanies this 
distribution.  
+# This program and the accompanying materials are licensed and made available 
under
+# the terms and conditions of the BSD License that accompanies this 
distribution.
 # The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.  

-# 
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.  
+# http://opensource.org/licenses/bsd-license.php.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 ##
 
@@ -97,11 +97,11 @@
   ##  @libraryclass  Provide capability to maintain the data integrity cross 
S3 phase.
   #
   LockBoxLib|Include/Library/LockBoxLib.h
-  
+
   ##  @libraryclass  Provide the CPU exception handler.
   #
   CpuExceptionHandlerLib|Include/Library/CpuExceptionHandlerLib.h
-  
+
   ##  @libraryclassProvides platform specific display interface.
   #
   CustomizedDisplayLib|Include/Library/CustomizedDisplayLib.h
@@ -130,7 +130,7 @@
   ## @libraryclass  Provides services to get variable error flag and do 
platform variable cleanup.
   #
   PlatformVarCleanupLib|Include/Library/PlatformVarCleanupLib.h
-  
+
   ## @libraryclass  Provides services to get do the file explorer.
   #
   FileExplorerLib|Include/Library/FileExplorerLib.h
@@ -214,7 +214,7 @@
   ## Guid is defined for SMM variable module to notify SMM variable wrapper 
module when variable write service was ready.
   #  Include/Guid/SmmVariableCommon.h
   gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 
0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
-  
+
   ## Performance protocol guid that also acts as the performance HOB guid and 
performance variable GUID
   #  Include/Guid/Performance.h
   gPerformanceProtocolGuid   = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 
0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
@@ -237,14 +237,14 @@
   #  Include/Guid/StatusCodeDataTypeDebug.h
   gEfiStatusCodeDataTypeDebugGuid  = { 0x9A4E9246, 0xD553, 0x11D5, { 0x87, 
0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9 }}
 
-  ##  A configuration Table Guid for Load module at fixed address 
+  ##  A configuration Table Guid for Load module at fixed address
   #  Include/Guid/LoadModuleAtFixedAddress.h
   gLoadFixedAddressConfigurationTableGuid  = { 0x2CA88B53,0xD296,0x4080, { 
0xA4,0xA5,0xCA,0xD9,0xBA,0xE2,0x4B,0x9 } }
 
   ## GUID used to store the global debug mask value into an EFI Variable
-  # Include/Guid/DebugMask.h  
+  # Include/Guid/DebugMask.h
   gEfiGenericVariableGuid = { 0x59d1c24f, 0x50f1, 0x401a, {0xb1, 0x01, 0xf3, 
0x3e, 0x0d, 0xae, 0xd4, 0x43} }
-  
+
   ##  Event for the DXE Core to signal idle events
   #  Include/Guid/EventIdle.h
   gIdleLoopEventGuid  = { 0x3c8d294c, 0x5fc3, 0x4451, { 0xbb, 0x31, 0xc4, 
0xc0, 0x32, 0x29, 0x5e, 0x6c } }
@@ -277,7 +277,7 @@
   ## Include/Guid/UsbKeyBoardLayout.h
   gUsbKeyboardLayoutPackageGuid  = { 0xc0f3b43, 0x44de, 0x4907, { 0xb4, 
0x78, 0x22, 0x5f, 0x6f, 0x62, 0x89, 0xdc }}
   gUsbKeyboardLayoutKeyGuid  = { 0x3a4d7a7c, 0x18a, 0x4b42, { 0x81, 
0xb3, 0xdc, 0x10, 0xe3, 0xb5, 0x91, 0xbd }}
-  
+
   ## Include/Guid/HiiResourceSampleHii.h
   gHiiResourceSamleFormSetGuid   = { 0x4f4ef7f0, 0xaa29, 0x4ce9, { 0xba, 
0x41, 0x64, 0x3e, 0x1, 0x23, 0xa9, 0x9f }}
 
@@ -301,7 +301,7 @@
 
   ## Include/Guid/ZeroGuid.h
   gZeroGuid  = { 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0, 0x0}}
-  
+
   ## Include/Guid/MtcVendor.h
   gMtcVendorGuid = { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 
0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }}
 
@@ -318,7 +318,7 @@
 
   ## Include/Guid/StatusCodeDataTypeVariable.h
   gEdkiiStatusCodeDataTypeVariableGuid = { 0xf6ee6dbb, 0xd67f, 0x4ea0, { 0x8b, 
0x96, 0x6a, 0x71, 0xb1, 0x9d, 0x84, 0xad }}
-  
+
   ## Include/Guid/MemoryProfile.h
   gEdkiiMemoryProfileGuid  = { 0x821c9a09, 0x541a, 0x40f6, { 0x9f, 
0x43, 0xa, 0xd1, 0x93, 0xa1, 0x2c, 0xfe }}
 
@@ -338,7 +338,7 @@
 
   

[edk2] [PATCH v4 0/3] Add Ipmi related libraries.

2015-12-22 Thread Daocheng Bu
Daocheng Bu (3):
  MdeModulePkg: Add PeiIpmiLibIpmiPpi Library instance.
  MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.
  MdeModulePkg: White space clean up for MdeModulePkg.dec

 MdeModulePkg/Include/Library/IpmiLib.h |  51 +++
 MdeModulePkg/Include/Ppi/IpmiPpi.h |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h   |  72 +++
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  |  80 
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf|  41 +
 MdeModulePkg/MdeModulePkg.dec  | 101 -
 6 files changed, 365 insertions(+), 45 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v4 2/3] MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol header file. Update dec file
for new IpmiLib and Ppi/Protocol header file.

In V4,split white space from V3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/Include/Library/IpmiLib.h   | 51 
 MdeModulePkg/Include/Ppi/IpmiPpi.h   | 65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h | 72 
 MdeModulePkg/MdeModulePkg.dec| 11 +
 4 files changed, 199 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..2909adb
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,51 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..b743b61
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,65 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] This  This point for PEI_IPMI_PPI structure.
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command

[edk2] [PATCH v4 3/3] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.

2015-12-22 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

In V4, update local variable name to IpmiPpi.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 80 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 +++
 2 files changed, 121 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..0de9c0f
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS   Status;
+  PEI_IPMI_PPI *IpmiPpi;
+
+  Status = PeiServicesLocatePpi(
+&gPeiIpmiPpiGuid,
+0,
+NULL,
+(VOID **) &IpmiPpi
+);
+  if (EFI_ERROR (Status)) {
+//
+// Ipmi Ppi is not installed. So, IPMI device is not present.
+//
+DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+return EFI_NOT_FOUND;
+  }
+
+  Status = IpmiPpi->IpmiSubmitCommand (
+IpmiPpi,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..94c6432
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS

[edk2] [PATCH v4 2/3] MdeModulePkg: Add IpmiLib and Ppi/Protocol into MdeModulePkg.dec.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol into MdeModulePkg.dec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dec | 101 +++---
 1 file changed, 56 insertions(+), 45 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 5ec37c5..5821961 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -4,13 +4,13 @@
 # and libraries instances, which are used for those modules.
 #
 # Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
-# This program and the accompanying materials are licensed and made available 
under 
-# the terms and conditions of the BSD License that accompanies this 
distribution.  
+# This program and the accompanying materials are licensed and made available 
under
+# the terms and conditions of the BSD License that accompanies this 
distribution.
 # The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php.  

-# 
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.  
+# http://opensource.org/licenses/bsd-license.php.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
 ##
 
@@ -97,11 +97,11 @@
   ##  @libraryclass  Provide capability to maintain the data integrity cross 
S3 phase.
   #
   LockBoxLib|Include/Library/LockBoxLib.h
-  
+
   ##  @libraryclass  Provide the CPU exception handler.
   #
   CpuExceptionHandlerLib|Include/Library/CpuExceptionHandlerLib.h
-  
+
   ##  @libraryclassProvides platform specific display interface.
   #
   CustomizedDisplayLib|Include/Library/CustomizedDisplayLib.h
@@ -130,7 +130,7 @@
   ## @libraryclass  Provides services to get variable error flag and do 
platform variable cleanup.
   #
   PlatformVarCleanupLib|Include/Library/PlatformVarCleanupLib.h
-  
+
   ## @libraryclass  Provides services to get do the file explorer.
   #
   FileExplorerLib|Include/Library/FileExplorerLib.h
@@ -143,6 +143,10 @@
   #
   BootLogoLib|Include/Library/BootLogoLib.h
 
+  ## @libraryclass  Provides interfaces about Ipmi submit generic commond.
+  #
+  IpmiLib|Include/Library/IpmiLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
@@ -210,7 +214,7 @@
   ## Guid is defined for SMM variable module to notify SMM variable wrapper 
module when variable write service was ready.
   #  Include/Guid/SmmVariableCommon.h
   gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 
0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
-  
+
   ## Performance protocol guid that also acts as the performance HOB guid and 
performance variable GUID
   #  Include/Guid/Performance.h
   gPerformanceProtocolGuid   = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 
0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
@@ -233,14 +237,14 @@
   #  Include/Guid/StatusCodeDataTypeDebug.h
   gEfiStatusCodeDataTypeDebugGuid  = { 0x9A4E9246, 0xD553, 0x11D5, { 0x87, 
0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9 }}
 
-  ##  A configuration Table Guid for Load module at fixed address 
+  ##  A configuration Table Guid for Load module at fixed address
   #  Include/Guid/LoadModuleAtFixedAddress.h
   gLoadFixedAddressConfigurationTableGuid  = { 0x2CA88B53,0xD296,0x4080, { 
0xA4,0xA5,0xCA,0xD9,0xBA,0xE2,0x4B,0x9 } }
 
   ## GUID used to store the global debug mask value into an EFI Variable
-  # Include/Guid/DebugMask.h  
+  # Include/Guid/DebugMask.h
   gEfiGenericVariableGuid = { 0x59d1c24f, 0x50f1, 0x401a, {0xb1, 0x01, 0xf3, 
0x3e, 0x0d, 0xae, 0xd4, 0x43} }
-  
+
   ##  Event for the DXE Core to signal idle events
   #  Include/Guid/EventIdle.h
   gIdleLoopEventGuid  = { 0x3c8d294c, 0x5fc3, 0x4451, { 0xbb, 0x31, 0xc4, 
0xc0, 0x32, 0x29, 0x5e, 0x6c } }
@@ -273,7 +277,7 @@
   ## Include/Guid/UsbKeyBoardLayout.h
   gUsbKeyboardLayoutPackageGuid  = { 0xc0f3b43, 0x44de, 0x4907, { 0xb4, 
0x78, 0x22, 0x5f, 0x6f, 0x62, 0x89, 0xdc }}
   gUsbKeyboardLayoutKeyGuid  = { 0x3a4d7a7c, 0x18a, 0x4b42, { 0x81, 
0xb3, 0xdc, 0x10, 0xe3, 0xb5, 0x91, 0xbd }}
-  
+
   ## Include/Guid/HiiResourceSampleHii.h
   gHiiResourceSamleFormSetGuid   = { 0x4f4ef7f0, 0xaa29, 0x4ce9, { 0xba, 
0x41, 0x64, 0x3e, 0x1, 0x23, 0xa9, 0x9f }}
 
@@ -297,7 +301,7 @@
 
   ## Include/Guid/ZeroGuid.h
   gZeroGuid  = { 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 
0x0, 0x0, 0x0, 0x0}}
-  
+
   ## Include/Guid/MtcVendor.h
   gMtcVendorGuid = { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 
0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }}
 
@@ -314,7 +318,7 @@
 
   ## Include/Guid/StatusCodeDataTypeVariable.h
   gEdkiiStatusCodeDataTypeVariableGuid = 

[edk2] [PATCH v4 0/3] Add Ipmi related libraries.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 MdeModulePkg.dec as 1 patch.
Update local variable name to IpmiPpi.

Daocheng Bu (3):
  MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.
  MdeModulePkg: Add IpmiLib and Ppi/Protocol into MdeModulePkg.dec.
  MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.

 MdeModulePkg/Include/Library/IpmiLib.h |  51 +++
 MdeModulePkg/Include/Ppi/IpmiPpi.h |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h   |  72 +++
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  |  80 
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf|  41 +
 MdeModulePkg/MdeModulePkg.dec  | 101 -
 6 files changed, 365 insertions(+), 45 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v4 1/3] MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol header file. Update dec file
for new IpmiLib and Ppi/Protocol header file.

In V4,Split header file and Dec file in new patch.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/Include/Library/IpmiLib.h   | 51 
 MdeModulePkg/Include/Ppi/IpmiPpi.h   | 65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h | 72 
 3 files changed, 188 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..2909adb
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,51 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..b743b61
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,65 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] This  This point for PEI_IPMI_PPI structure.
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   

[edk2] [PATCH v3 1/7] MdePkg: Update Ipmi2.0 definitions header file.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header files for data structure
name suffix for request/response data and completion code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 61 +
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 45 ++--
 .../IndustryStandard/IpmiNetFnSensorEvent.h|  2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h | 80 --
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |  4 +-
 5 files changed, 102 insertions(+), 90 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index c0865da..31f9e83 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -43,6 +43,7 @@
 //  Constants and Structure definitions for "Get Device ID" command to follow 
here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   DeviceId;
   UINT8   DeviceRevision : 4;
   UINT8   Reserved : 3;
@@ -62,7 +63,7 @@ typedef struct {
   UINT8   ManufacturerId[3];
   UINT16  ProductId;
   UINT32  AuxFirmwareRevInfo;
-} IPMI_MSG_GET_DEVICE_ID_RSP;
+} IPMI_GET_DEVICE_ID_RESPONSE;
 
 
 //
@@ -89,12 +90,13 @@ typedef struct {
 #define IPMI_APP_GET_SELFTEST_RESULTS  0x4
 
 //
-//  Constants and Structure definitions for "Get Self Results" command to 
follow here
+//  Constants and Structure definitions for "Get Self Test Results" command to 
follow here
 //
 typedef struct {
+  UINT8  CompletionCode;
   UINT8  Result;
   UINT8  Param;
-} IPMI_MSG_SELFTEST_RESULT_RSP;
+} IPMI_SELF_TEST_RESULT_RESPONSE;
 
 #define IPMI_APP_SELFTEST_NO_ERROR 0x55
 #define IPMI_APP_SELFTEST_NOT_IMPLEMENTED  0x56
@@ -127,11 +129,11 @@ typedef struct {
 //  Constants and Structure definitions for "Set ACPI Power State" command to 
follow here
 //
 typedef struct {
-  UINT8 SystemPowerState : 7;
-  UINT8 SystemStateChange : 1;
-  UINT8 DevicePowerState : 7;
-  UINT8 DeviceStateChange : 1;
-} IPMI_ACPI_POWER_STATE;
+  UINT8  AcpiSystemPowerState  : 7;
+  UINT8  AcpiSystemStateChange : 1;
+  UINT8  AcpiDevicePowerState  : 7;
+  UINT8  AcpiDeviceStateChange : 1;
+} IPMI_SET_ACPI_POWER_STATE_REQUEST;
 
 //
 //  Definitions for Get ACPI Power State command
@@ -154,8 +156,9 @@ typedef struct {
 //  Message structure definition for "Get Device Guid" IPMI command
 //
 typedef struct {
-  UINT8 Guid[16];
-} IPMI_MSG_GET_DEVICE_GUID_RSP;
+  UINT8  CompletionCode;
+  UINT8  Guid[16];
+} IPMI_GET_DEVICE_GUID_RESPONSE;
 
 //
 //  Below is Definitions for BMC Watchdog Timer Commands (Chapter 27)
@@ -190,7 +193,7 @@ typedef struct {
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
-} IPMI_SET_WATCHDOG_TIMER;
+} IPMI_SET_WATCHDOG_TIMER_REQUEST;
 
 //
 //  Definitions for Get WatchDog Timer command
@@ -201,13 +204,14 @@ typedef struct {
 //  Constants and Structure definitions for "Get WatchDog Timer" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   IPMI_WATCHDOG_TIMER_USE TimerUse;
   UINT8   TimerActions;
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
   UINT16  PresentCountdownValue;
-} IPMI_GET_WATCHDOG_TIMER;
+} IPMI_GET_WATCHDOG_TIMER_RESPONSE;
 
 //
 //  Below is Definitions for IPMI Messaging Support Commands (Chapter 22)
@@ -384,20 +388,21 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Access" command to 
follow here
 //
 typedef struct {
-  UINT8 ChannelNo : 4;
-  UINT8 Reserve1 : 4;
-  UINT8 Reserve2 : 6;
-  UINT8 MemoryType : 2;
-} IPMI_GET_CHANNEL_ACCESS_COMMAND;
+  UINT8  ChannelNo : 4;
+  UINT8  Reserve1 : 4;
+  UINT8  Reserve2 : 6;
+  UINT8  MemoryType : 2;
+} IPMI_GET_CHANNEL_ACCESS_REQUEST;
 
 typedef struct {
-  UINT8 AccessMode : 3;
-  UINT8 UserLevelAuthEnabled : 1;
-  UINT8 MessageAuthEnable : 1;
-  UINT8 Alert : 1;
-  UINT8 Reserve1 : 2;
-  UINT8 ChannelPriviledgeLimit : 4;
-  UINT8 Reserve2 : 4;
+  UINT8  CompletionCode;
+  UINT8  AccessMode : 3;
+  UINT8  UserLevelAuthEnabled : 1;
+  UINT8  MessageAuthEnable : 1;
+  UINT8  Alert : 1;
+  UINT8  Reserve1 : 2;
+  UINT8  ChannelPriviledgeLimit : 4;
+  UINT8  Reserve2 : 4;
 } IPMI_GET_CHANNEL_ACCESS_RESPONSE;
 
 //
@@ -409,6 +414,7 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Info" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   ChannelNo : 4;
   UINT8   Reserve1 : 4;
   UINT8   ChannelMediumType : 7;
@@ -417,10 +423,9 @@ typedef struct {
   UINT8 

[edk2] [PATCH v3 6/7] MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add SmmIpmiLibSmmIpmiProtocol Library Instance based on
Ipmi smm protocol in SMM mode.

In V3, use right header file  for SMM driver and
remove unused UefiBootServicesTableLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../SmmIpmiLibSmmIpmiProtocol.c| 81 ++
 .../SmmIpmiLibSmmIpmiProtocol.inf  | 40 +++
 2 files changed, 121 insertions(+)
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
new file mode 100644
index 000..8992a9e
--- /dev/null
+++ b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
@@ -0,0 +1,81 @@
+/** @file
+  Implementation of Ipmi Library for SMM.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gSmst->SmmLocateProtocol (
+  &gSmmIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Smm Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
new file mode 100644
index 000..b8d6e83
--- /dev/null
+++ 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of SMM IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION 

[edk2] [PATCH v3 4/7] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.

2015-12-22 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

In V3, change mIpmiPpi from static global variable to
local variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 80 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 +++
 2 files changed, 121 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..4af7605
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS   Status;
+  PEI_IPMI_PPI *mIpmiPpi;
+
+  Status = PeiServicesLocatePpi(
+&gPeiIpmiPpiGuid,
+0,
+NULL,
+(VOID **) &mIpmiPpi
+);
+  if (EFI_ERROR (Status)) {
+//
+// Ipmi Ppi is not installed. So, IPMI device is not present.
+//
+DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+return EFI_NOT_FOUND;
+  }
+
+  Status = mIpmiPpi->IpmiSubmitCommand (
+mIpmiPpi,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..94c6432
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBR

[edk2] [PATCH v3 5/7] MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add DxeIpmiLibIpmiProtocol Library Instance based on
Ipmi Protocol in DXE phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../DxeIpmiLibIpmiProtocol.c   | 80 ++
 .../DxeIpmiLibIpmiProtocol.inf | 40 +++
 2 files changed, 120 insertions(+)
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
new file mode 100644
index 000..9f80aa3
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in DXE Phase for SMS.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gBS->LocateProtocol (
+  &gIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Dxe Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Dxe Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
new file mode 100644
index 000..3e8b6ba
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of IPMI Library in DXE phase for SMS.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = DxeIpmiLibIpmiProtocol
+  FILE_GUID  = 62408AD

[edk2] [PATCH v3 7/7] MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

2015-12-22 Thread Daocheng Bu
Update MdeModulePkg.dsc file to include Ipmi Libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index b31c02e..0e3e5eb 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -291,6 +291,10 @@
   MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
   MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.inf
+  MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
+  MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
+  MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
+  MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 3/7] MdeModulePkg: Add BaseIpmiLib Null Library Instance.

2015-12-22 Thread Daocheng Bu
Add BaseIpmiLib Null Library Instance for BMC-LESS
platform.

In V3, change return value from 0 to EFI_STATUS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  | 53 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf| 38 
 2 files changed, 91 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
new file mode 100644
index 000..fa658a0
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -0,0 +1,53 @@
+/** @file
+  A emptry template implementation of Ipmi Library.
+
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  //
+  // Do nothing, just return EFI_UNSUPPORTED.
+  //
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
new file mode 100644
index 000..fc9d06d
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -0,0 +1,38 @@
+## @file
+#  Null Instance of IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BaseIpmiLibNull
+  FILE_GUID = 46805D61-0BB8-4680-A9BE-C96C751AB5A4
+  MODULE_TYPE   = BASE
+  VERSION_STRING= 1.0
+  LIBRARY_CLASS = IpmiLib
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  BaseIpmiLibNull.c
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 0/7] Add Ipmi related libraries.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header file and MdeModulePkg.dsc
file for Ipmi libraries. Add Ipmi realted libraries to support
generic Ipmi submit command. Also add Ppi/Protocol definitions
that will be produced by Ipmi Peim and drivers.

Daocheng Bu (7):
  MdePkg: Update Ipmi2.0 definitions header file.
  MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.
  MdeModulePkg: Add BaseIpmiLib Null Library Instance.
  MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.
  MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.
  MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.
  MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

 MdeModulePkg/Include/Library/IpmiLib.h |  51 +++
 MdeModulePkg/Include/Ppi/IpmiPpi.h |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h   |  72 +++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  |  53 +++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf|  38 
 .../DxeIpmiLibIpmiProtocol.c   |  80 
 .../DxeIpmiLibIpmiProtocol.inf |  40 
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  |  80 
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf|  41 +
 .../SmmIpmiLibSmmIpmiProtocol.c|  81 +
 .../SmmIpmiLibSmmIpmiProtocol.inf  |  40 
 MdeModulePkg/MdeModulePkg.dec  | 101 -
 MdeModulePkg/MdeModulePkg.dsc  |   4 +
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h |  61 +++--
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h |  45 +
 .../IndustryStandard/IpmiNetFnSensorEvent.h|   2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h |  80 
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |   4 +-
 18 files changed, 803 insertions(+), 135 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v3 2/7] MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol header file. Update dec file
for new IpmiLib and Ppi/Protocol header file.

In V3,removed the first '_' in GUID name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/Include/Library/IpmiLib.h   |  51 ++
 MdeModulePkg/Include/Ppi/IpmiPpi.h   |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h |  72 +++
 MdeModulePkg/MdeModulePkg.dec| 101 +++
 4 files changed, 244 insertions(+), 45 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..2909adb
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,51 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..b743b61
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,65 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] This  This point for PEI_IPMI_PPI structure.
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipm

[edk2] [PATCH v2 6/7] MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add SmmIpmiLibSmmIpmiProtocol Library Instance based on
Ipmi smm protocol in SMM mode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../SmmIpmiLibSmmIpmiProtocol.c| 82 ++
 .../SmmIpmiLibSmmIpmiProtocol.inf  | 41 +++
 2 files changed, 123 insertions(+)
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
new file mode 100644
index 000..f2932ec
--- /dev/null
+++ b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
@@ -0,0 +1,82 @@
+/** @file
+  Implementation of Ipmi Library for SMM.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gSmst->SmmLocateProtocol (
+  &gSmmIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Smm Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
new file mode 100644
index 000..fdf9c2d
--- /dev/null
+++ 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of SMM IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  

[edk2] [PATCH v2 7/7] MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

2015-12-22 Thread Daocheng Bu
Update MdeModulePkg.dsc file to include Ipmi Libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 
 1 file changed, 4 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index b31c02e..0e3e5eb 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -291,6 +291,10 @@
   MdeModulePkg/Library/PlatformVarCleanupLib/PlatformVarCleanupLib.inf
   MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   MdeModulePkg/Library/DxeFileExplorerProtocol/DxeFileExplorerProtocol.inf
+  MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
+  MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
+  MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
+  MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 0/7] Add Ipmi related libraries.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header file and MdeModulePkg.dsc
file for Ipmi libraries. Add Ipmi realted libraries to support
generic Ipmi submit command. Also add Ppi/Protocol definitions
that will be produced by Ipmi Peim and drivers.

Daocheng Bu (7):
  MdePkg: Update Ipmi2.0 definitions header file.
  MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.
  MdeModulePkg: Add BaseIpmiLib Null Library Instance.
  MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.
  MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.
  MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Instance.
  MdeModulePkg: Update MdeModulePkg.dsc file for IpmiLib.

 MdeModulePkg/Include/Library/IpmiLib.h |  51 +++
 MdeModulePkg/Include/Ppi/IpmiPpi.h |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h   |  72 +++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  |  50 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf|  38 
 .../DxeIpmiLibIpmiProtocol.c   |  80 
 .../DxeIpmiLibIpmiProtocol.inf |  40 
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  |  80 
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf|  41 +
 .../SmmIpmiLibSmmIpmiProtocol.c|  82 +
 .../SmmIpmiLibSmmIpmiProtocol.inf  |  41 +
 MdeModulePkg/MdeModulePkg.dec  | 101 -
 MdeModulePkg/MdeModulePkg.dsc  |   4 +
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h |  61 +++--
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h |  45 +
 .../IndustryStandard/IpmiNetFnSensorEvent.h|   2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h |  80 
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |   4 +-
 18 files changed, 802 insertions(+), 135 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 4/7] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Instance.

2015-12-22 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Instance based on Ipmi Ppi.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 80 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 +++
 2 files changed, 121 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..5176ff2
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+STATIC PEI_IPMI_PPI *mIpmiPpi = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  Status = PeiServicesLocatePpi(
+&gPeiIpmiPpiGuid,
+0,
+NULL,
+(VOID **) &mIpmiPpi
+);
+  if (EFI_ERROR (Status)) {
+//
+// Ipmi Ppi is not installed. So, IPMI device is not present.
+//
+DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+return EFI_NOT_FOUND;
+  }
+
+  Status = mIpmiPpi->IpmiSubmitCommand (
+mIpmiPpi,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..94c6432
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiLib|PEIM PEI_CORE
+
+#
+#

[edk2] [PATCH v2 1/7] MdePkg: Update Ipmi2.0 definitions header file.

2015-12-22 Thread Daocheng Bu
Update Ipmi2.0 definitions header files for data structure
name suffix for request/response data and completion code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 61 +
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 45 ++--
 .../IndustryStandard/IpmiNetFnSensorEvent.h|  2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h | 80 --
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |  4 +-
 5 files changed, 102 insertions(+), 90 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index c0865da..31f9e83 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -43,6 +43,7 @@
 //  Constants and Structure definitions for "Get Device ID" command to follow 
here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   DeviceId;
   UINT8   DeviceRevision : 4;
   UINT8   Reserved : 3;
@@ -62,7 +63,7 @@ typedef struct {
   UINT8   ManufacturerId[3];
   UINT16  ProductId;
   UINT32  AuxFirmwareRevInfo;
-} IPMI_MSG_GET_DEVICE_ID_RSP;
+} IPMI_GET_DEVICE_ID_RESPONSE;
 
 
 //
@@ -89,12 +90,13 @@ typedef struct {
 #define IPMI_APP_GET_SELFTEST_RESULTS  0x4
 
 //
-//  Constants and Structure definitions for "Get Self Results" command to 
follow here
+//  Constants and Structure definitions for "Get Self Test Results" command to 
follow here
 //
 typedef struct {
+  UINT8  CompletionCode;
   UINT8  Result;
   UINT8  Param;
-} IPMI_MSG_SELFTEST_RESULT_RSP;
+} IPMI_SELF_TEST_RESULT_RESPONSE;
 
 #define IPMI_APP_SELFTEST_NO_ERROR 0x55
 #define IPMI_APP_SELFTEST_NOT_IMPLEMENTED  0x56
@@ -127,11 +129,11 @@ typedef struct {
 //  Constants and Structure definitions for "Set ACPI Power State" command to 
follow here
 //
 typedef struct {
-  UINT8 SystemPowerState : 7;
-  UINT8 SystemStateChange : 1;
-  UINT8 DevicePowerState : 7;
-  UINT8 DeviceStateChange : 1;
-} IPMI_ACPI_POWER_STATE;
+  UINT8  AcpiSystemPowerState  : 7;
+  UINT8  AcpiSystemStateChange : 1;
+  UINT8  AcpiDevicePowerState  : 7;
+  UINT8  AcpiDeviceStateChange : 1;
+} IPMI_SET_ACPI_POWER_STATE_REQUEST;
 
 //
 //  Definitions for Get ACPI Power State command
@@ -154,8 +156,9 @@ typedef struct {
 //  Message structure definition for "Get Device Guid" IPMI command
 //
 typedef struct {
-  UINT8 Guid[16];
-} IPMI_MSG_GET_DEVICE_GUID_RSP;
+  UINT8  CompletionCode;
+  UINT8  Guid[16];
+} IPMI_GET_DEVICE_GUID_RESPONSE;
 
 //
 //  Below is Definitions for BMC Watchdog Timer Commands (Chapter 27)
@@ -190,7 +193,7 @@ typedef struct {
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
-} IPMI_SET_WATCHDOG_TIMER;
+} IPMI_SET_WATCHDOG_TIMER_REQUEST;
 
 //
 //  Definitions for Get WatchDog Timer command
@@ -201,13 +204,14 @@ typedef struct {
 //  Constants and Structure definitions for "Get WatchDog Timer" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   IPMI_WATCHDOG_TIMER_USE TimerUse;
   UINT8   TimerActions;
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
   UINT16  PresentCountdownValue;
-} IPMI_GET_WATCHDOG_TIMER;
+} IPMI_GET_WATCHDOG_TIMER_RESPONSE;
 
 //
 //  Below is Definitions for IPMI Messaging Support Commands (Chapter 22)
@@ -384,20 +388,21 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Access" command to 
follow here
 //
 typedef struct {
-  UINT8 ChannelNo : 4;
-  UINT8 Reserve1 : 4;
-  UINT8 Reserve2 : 6;
-  UINT8 MemoryType : 2;
-} IPMI_GET_CHANNEL_ACCESS_COMMAND;
+  UINT8  ChannelNo : 4;
+  UINT8  Reserve1 : 4;
+  UINT8  Reserve2 : 6;
+  UINT8  MemoryType : 2;
+} IPMI_GET_CHANNEL_ACCESS_REQUEST;
 
 typedef struct {
-  UINT8 AccessMode : 3;
-  UINT8 UserLevelAuthEnabled : 1;
-  UINT8 MessageAuthEnable : 1;
-  UINT8 Alert : 1;
-  UINT8 Reserve1 : 2;
-  UINT8 ChannelPriviledgeLimit : 4;
-  UINT8 Reserve2 : 4;
+  UINT8  CompletionCode;
+  UINT8  AccessMode : 3;
+  UINT8  UserLevelAuthEnabled : 1;
+  UINT8  MessageAuthEnable : 1;
+  UINT8  Alert : 1;
+  UINT8  Reserve1 : 2;
+  UINT8  ChannelPriviledgeLimit : 4;
+  UINT8  Reserve2 : 4;
 } IPMI_GET_CHANNEL_ACCESS_RESPONSE;
 
 //
@@ -409,6 +414,7 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Info" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   ChannelNo : 4;
   UINT8   Reserve1 : 4;
   UINT8   ChannelMediumType : 7;
@@ -417,10 +423,9 @@ typedef struct {
   UINT8 

[edk2] [PATCH v2 2/7] MdeModulePkg: Add IpmiLib and Ppi/Protocol header file.

2015-12-22 Thread Daocheng Bu
Add IpmiLib and Ppi/Protocol header file. Update dec file
for new IpmiLib and Ppi/Protocol header file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 MdeModulePkg/Include/Library/IpmiLib.h   |  51 ++
 MdeModulePkg/Include/Ppi/IpmiPpi.h   |  65 +
 MdeModulePkg/Include/Protocol/IpmiProtocol.h |  72 +++
 MdeModulePkg/MdeModulePkg.dec| 101 +++
 4 files changed, 244 insertions(+), 45 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..2909adb
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,51 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..b743b61
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,65 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] This  This point for PEI_IPMI_PPI structure.
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @ret

[edk2] [PATCH v2 5/7] MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Instance.

2015-12-22 Thread Daocheng Bu
Add DxeIpmiLibIpmiProtocol Library Instance based on
Ipmi Protocol in DXE phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../DxeIpmiLibIpmiProtocol.c   | 80 ++
 .../DxeIpmiLibIpmiProtocol.inf | 40 +++
 2 files changed, 120 insertions(+)
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
new file mode 100644
index 000..9f80aa3
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
@@ -0,0 +1,80 @@
+/** @file
+  Implementation of Ipmi Library in DXE Phase for SMS.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gBS->LocateProtocol (
+  &gIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Dxe Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Dxe Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->IpmiSubmitCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+RequestData,
+RequestDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
new file mode 100644
index 000..3e8b6ba
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of IPMI Library in DXE phase for SMS.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = DxeIpmiLibIpmiProtocol
+  FILE_GUID  = 62408AD

[edk2] [PATCH v2 3/7] MdeModulePkg: Add BaseIpmiLib Null Library Instance.

2015-12-22 Thread Daocheng Bu
Add BaseIpmiLib Null Library Instance for BMC-LESS
platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
Cc: Liming Gao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  | 50 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf| 38 
 2 files changed, 88 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
new file mode 100644
index 000..0e80fd9
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -0,0 +1,50 @@
+/** @file
+  A emptry template implementation of Ipmi Library.
+
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out.
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *RequestData,
+  IN UINT32RequestDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT32*ResponseDataSize
+  )
+{
+  return 0;
+}
diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
new file mode 100644
index 000..fc9d06d
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -0,0 +1,38 @@
+## @file
+#  Null Instance of IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BaseIpmiLibNull
+  FILE_GUID = 46805D61-0BB8-4680-A9BE-C96C751AB5A4
+  MODULE_TYPE   = BASE
+  VERSION_STRING= 1.0
+  LIBRARY_CLASS = IpmiLib
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  BaseIpmiLibNull.c
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add BaseIpmiLibNull Library Class.

2015-12-17 Thread Daocheng Bu
Add BaseIpmiLibNull Library Class for BMC-Less platform.
In V2, change for aligning with IpmiLib.h changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c   | 21 +
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
index 05f5a91..763633e 100644
--- a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -24,23 +24,28 @@
 
   @param[in] NetFunction   Net function of the command.
   @param[in] Command   IPMI Command.
-  @param[in] CommandData   Command Data.
-  @param[in] CommandDataSize   Size of Command Data.
-  @param[out]ResponseData  Command Response Data.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
   @param[in out] ResponseDataSize  Size of Command Response Data.
 
-  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
-  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.  
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out. 
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
 **/
 EFI_STATUS
 EFIAPI
 IpmiSubmitCommand (
   IN UINT8 NetFunction,
   IN UINT8 Command,
-  IN UINT8 *CommandData,
-  IN UINT8 CommandDataSize,
+  IN UINT8 *RequestData,
+  IN UINT  RequestDataSize,
  OUT UINT8 *ResponseData,
-  IN OUT UINT8 *ResponseDataSize
+  IN OUT UINT  *ResponseDataSize
   )
 {
   return 0;
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add IpmiLib header file.

2015-12-17 Thread Daocheng Bu
Add IpmiLib header file for ipmi command submit.
In V3, change ';' position.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdeModulePkg/Include/Library/IpmiLib.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
index aae8276..f5557a7 100644
--- a/MdeModulePkg/Include/Library/IpmiLib.h
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -46,7 +46,6 @@ IpmiSubmitCommand (
   IN UINT  RequestDataSize,
  OUT UINT8 *ResponseData,
   IN OUT UINT  *ResponseDataSize
-  )
-;
+  );
 
 #endif
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add IpmiLib header file.

2015-12-17 Thread Daocheng Bu
Add IpmiLib header file for ipmi command submit.
In V2, change the buffer length for OEM extension.
Add more return status for robustness.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdeModulePkg/Include/Library/IpmiLib.h | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
index 18ed506..aae8276 100644
--- a/MdeModulePkg/Include/Library/IpmiLib.h
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -24,23 +24,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 
   @param[in] NetFunction   Net function of the command.
   @param[in] Command   IPMI Command.
-  @param[in] CommandData   Command Data.
-  @param[in] CommandDataSize   Size of Command Data.
-  @param[out]ResponseData  Command Response Data.
+  @param[in] RequestData   Command Request Data.
+  @param[in] RequestDataSize   Size of Command Request Data.
+  @param[out]ResponseData  Command Response Data. The completion 
code is the first byte of response data.
   @param[in out] ResponseDataSize  Size of Command Response Data.
 
   @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
   @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+  @retval EFI_NOT_READY  Ipmi Device is not ready for Ipmi command 
access.  
+  @retval EFI_DEVICE_ERROR   Ipmi Device hardware error.
+  @retval EFI_TIMEOUTThe command time out. 
+  @retval EFI_UNSUPPORTEDThe command was not successfully sent to the 
device.
+  @retval EFI_OUT_OF_RESOURCES   The resource allcation is out of resource or 
data size error.
 **/
 EFI_STATUS
 EFIAPI
 IpmiSubmitCommand (
   IN UINT8 NetFunction,
   IN UINT8 Command,
-  IN UINT8 *CommandData,
-  IN UINT8 CommandDataSize,
+  IN UINT8 *RequestData,
+  IN UINT  RequestDataSize,
  OUT UINT8 *ResponseData,
-  IN OUT UINT8 *ResponseDataSize
+  IN OUT UINT  *ResponseDataSize
   )
 ;
 
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Class.

2015-12-17 Thread Daocheng Bu
Add DxeIpmiLibIpmiProtocol Library Class that will depend on
Ipmi stack driver produces Ipmi Protocol in Dxe Phase under SMS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../DxeIpmiLibIpmiProtocol.c   | 74 ++
 .../DxeIpmiLibIpmiProtocol.inf | 40 
 2 files changed, 114 insertions(+)
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
new file mode 100644
index 000..a9bd716
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
@@ -0,0 +1,74 @@
+/** @file
+  Implementation of Ipmi Library in DXE Phase for SMS.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gBS->LocateProtocol (
+  &gIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Dxe Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Dxe Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->SendIpmiCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+CommandData,
+CommandDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
\ No newline at end of file
diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
new file mode 100644
index 000..c57e779
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of IPMI Library in DXE phase for SMS.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = DxeIpmiLibIpmiProtocol
+  FILE_GUID  = 62408AD5-4EAC-432B-AB9B-C4B85BFAED02
+  MODULE_TYPE= DXE_RUNTIME_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiLib|DXE_RUNTIME_DRIVER DXE_DRIVER
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  DxeIpmiLibIpmiProtocol.c
+  
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  UefiBoo

[edk2] [Patch] MdeModulePkg: Add BaseIpmiLibNull Library Class.

2015-12-17 Thread Daocheng Bu
Add BaseIpmiLibNull Library Class for BMC-Less platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  | 47 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf| 40 ++
 2 files changed, 87 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
new file mode 100644
index 000..05f5a91
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -0,0 +1,47 @@
+/** @file
+  A emptry template implementation of Ipmi Library.
+
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+  )
+{
+  return 0;
+}
\ No newline at end of file
diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
new file mode 100644
index 000..b74be3c
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -0,0 +1,40 @@
+## @file
+#  Null Instance of IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BaseIpmiLibNull
+  FILE_GUID = 46805D61-0BB8-4680-A9BE-C96C751AB5A4
+  MODULE_TYPE   = BASE
+  VERSION_STRING= 1.0
+  LIBRARY_CLASS = IpmiLib
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  BaseIpmiLibNull.c
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  UefiBootServicesTableLib
+  DxeServicesLib
+  DebugLib
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdePkg: Modify Ipmi2.0 definitions header files for data structure name suffix.

2015-12-17 Thread Daocheng Bu
Modify Ipmi2.0 definitions header files for data structure name suffix
for request/response data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 61 +
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 31 -
 .../IndustryStandard/IpmiNetFnSensorEvent.h|  2 +-
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h | 80 --
 .../Include/IndustryStandard/IpmiNetFnTransport.h  |  4 +-
 5 files changed, 95 insertions(+), 83 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index c0865da..31f9e83 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -43,6 +43,7 @@
 //  Constants and Structure definitions for "Get Device ID" command to follow 
here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   DeviceId;
   UINT8   DeviceRevision : 4;
   UINT8   Reserved : 3;
@@ -62,7 +63,7 @@ typedef struct {
   UINT8   ManufacturerId[3];
   UINT16  ProductId;
   UINT32  AuxFirmwareRevInfo;
-} IPMI_MSG_GET_DEVICE_ID_RSP;
+} IPMI_GET_DEVICE_ID_RESPONSE;
 
 
 //
@@ -89,12 +90,13 @@ typedef struct {
 #define IPMI_APP_GET_SELFTEST_RESULTS  0x4
 
 //
-//  Constants and Structure definitions for "Get Self Results" command to 
follow here
+//  Constants and Structure definitions for "Get Self Test Results" command to 
follow here
 //
 typedef struct {
+  UINT8  CompletionCode;
   UINT8  Result;
   UINT8  Param;
-} IPMI_MSG_SELFTEST_RESULT_RSP;
+} IPMI_SELF_TEST_RESULT_RESPONSE;
 
 #define IPMI_APP_SELFTEST_NO_ERROR 0x55
 #define IPMI_APP_SELFTEST_NOT_IMPLEMENTED  0x56
@@ -127,11 +129,11 @@ typedef struct {
 //  Constants and Structure definitions for "Set ACPI Power State" command to 
follow here
 //
 typedef struct {
-  UINT8 SystemPowerState : 7;
-  UINT8 SystemStateChange : 1;
-  UINT8 DevicePowerState : 7;
-  UINT8 DeviceStateChange : 1;
-} IPMI_ACPI_POWER_STATE;
+  UINT8  AcpiSystemPowerState  : 7;
+  UINT8  AcpiSystemStateChange : 1;
+  UINT8  AcpiDevicePowerState  : 7;
+  UINT8  AcpiDeviceStateChange : 1;
+} IPMI_SET_ACPI_POWER_STATE_REQUEST;
 
 //
 //  Definitions for Get ACPI Power State command
@@ -154,8 +156,9 @@ typedef struct {
 //  Message structure definition for "Get Device Guid" IPMI command
 //
 typedef struct {
-  UINT8 Guid[16];
-} IPMI_MSG_GET_DEVICE_GUID_RSP;
+  UINT8  CompletionCode;
+  UINT8  Guid[16];
+} IPMI_GET_DEVICE_GUID_RESPONSE;
 
 //
 //  Below is Definitions for BMC Watchdog Timer Commands (Chapter 27)
@@ -190,7 +193,7 @@ typedef struct {
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
-} IPMI_SET_WATCHDOG_TIMER;
+} IPMI_SET_WATCHDOG_TIMER_REQUEST;
 
 //
 //  Definitions for Get WatchDog Timer command
@@ -201,13 +204,14 @@ typedef struct {
 //  Constants and Structure definitions for "Get WatchDog Timer" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   IPMI_WATCHDOG_TIMER_USE TimerUse;
   UINT8   TimerActions;
   UINT8   PretimeoutInterval;
   UINT8   TimerUseExpirationFlagsClear;
   UINT16  InitialCountdownValue;
   UINT16  PresentCountdownValue;
-} IPMI_GET_WATCHDOG_TIMER;
+} IPMI_GET_WATCHDOG_TIMER_RESPONSE;
 
 //
 //  Below is Definitions for IPMI Messaging Support Commands (Chapter 22)
@@ -384,20 +388,21 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Access" command to 
follow here
 //
 typedef struct {
-  UINT8 ChannelNo : 4;
-  UINT8 Reserve1 : 4;
-  UINT8 Reserve2 : 6;
-  UINT8 MemoryType : 2;
-} IPMI_GET_CHANNEL_ACCESS_COMMAND;
+  UINT8  ChannelNo : 4;
+  UINT8  Reserve1 : 4;
+  UINT8  Reserve2 : 6;
+  UINT8  MemoryType : 2;
+} IPMI_GET_CHANNEL_ACCESS_REQUEST;
 
 typedef struct {
-  UINT8 AccessMode : 3;
-  UINT8 UserLevelAuthEnabled : 1;
-  UINT8 MessageAuthEnable : 1;
-  UINT8 Alert : 1;
-  UINT8 Reserve1 : 2;
-  UINT8 ChannelPriviledgeLimit : 4;
-  UINT8 Reserve2 : 4;
+  UINT8  CompletionCode;
+  UINT8  AccessMode : 3;
+  UINT8  UserLevelAuthEnabled : 1;
+  UINT8  MessageAuthEnable : 1;
+  UINT8  Alert : 1;
+  UINT8  Reserve1 : 2;
+  UINT8  ChannelPriviledgeLimit : 4;
+  UINT8  Reserve2 : 4;
 } IPMI_GET_CHANNEL_ACCESS_RESPONSE;
 
 //
@@ -409,6 +414,7 @@ typedef struct {
 //  Constants and Structure definitions for "Get Channel Info" command to 
follow here
 //
 typedef struct {
+  UINT8   CompletionCode;
   UINT8   ChannelNo : 4;
   UINT8   Reserve1 : 4;
   UINT8   ChannelMediumType : 7;
@@ -417,10 +423,9 @@ typedef struct {
   UINT8   Reserve3 : 3;
   UI

[edk2] [Patch] MdeModulePkg: Add SmmIpmiLibSmmIpmiProtocol Library Class.

2015-12-16 Thread Daocheng Bu
Add SmmIpmiLibSmmIpmiProtocol Library Class that will depend on
Ipmi stack smm driver produces Ipmi Protocol in SMM mode.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../SmmIpmiLibSmmIpmiProtocol.c| 76 ++
 .../SmmIpmiLibSmmIpmiProtocol.inf  | 41 
 2 files changed, 117 insertions(+)
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
new file mode 100644
index 000..d9f6365
--- /dev/null
+++ b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.c
@@ -0,0 +1,76 @@
+/** @file
+  Implementation of Ipmi Library for SMM.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gSmst->SmmLocateProtocol (
+  &gSmmIpmiProtocolGuidx,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Smm Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand for SMM Status - %r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->SendIpmiCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+CommandData,
+CommandDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
\ No newline at end of file
diff --git 
a/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
new file mode 100644
index 000..34a3888
--- /dev/null
+++ 
b/MdeModulePkg/Library/SmmIpmiLibSmmIpmiProtocol/SmmIpmiLibSmmIpmiProtocol.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of SMM IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = SmmIpmiLibSmmIpmiProtocol
+  FILE_GUID  = B422FB70-E835-448D-A921-EBA460E105B6
+  MODULE_TYPE= DXE_SMM_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiLib|DXE_SMM_DRIVER SMM_CORE
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+   
+[Sources]
+  SmmIpmiLibSmmIpmiProtocol.c
+  
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+

[edk2] [Patch] MdeModulePkg: Add PeiIpmiLibIpmiPpi Library Class.

2015-12-16 Thread Daocheng Bu
Add PeiIpmiLibIpmiPpi Library Class that will depend on
Ipmi stack PEIM produces Ipmi Ppi in Pei Phase under SMS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c  | 76 ++
 .../PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf| 41 
 2 files changed, 117 insertions(+)
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
 create mode 100644 MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf

diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
new file mode 100644
index 000..e8baf6c
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.c
@@ -0,0 +1,76 @@
+/** @file
+  Implementation of Ipmi Library in PEI Phase for SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+STATIC PEI_IPMI_PPI *mIpmiPpi = NULL;
+
+/**
+  This service enables sumitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiPpi == NULL) {
+Status = PeiServicesLocatePpi(
+  &gPeiIpmiPpiGuid,
+  0,
+  NULL,
+  (VOID **) &mIpmiPpi
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Ipmi Ppi is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Pei Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiPpi->SendIpmiCommand (
+mIpmiPpi,
+NetFunction,
+Command,
+CommandData,
+CommandDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf 
b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
new file mode 100644
index 000..7fa3ed2
--- /dev/null
+++ b/MdeModulePkg/Library/PeiIpmiLibIpmiPpi/PeiIpmiLibIpmiPpi.inf
@@ -0,0 +1,41 @@
+## @file
+#  Instance of IPMI Library in PEI phase for SMS.
+#
+#  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiIpmiLibIpmiPpi
+  FILE_GUID  = 43679142-87C4-44AD-AF02-B47F782D6CF3
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiLib|PEIM PEI_CORE
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  PeiIpmiLibIpmiPpi.c
+  
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  BaseMemoryLib
+  PeiServicesLib
+
+[Ppis]
+  gPeiIpmiPpiGuid
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
h

[edk2] [Patch] MdeModulePkg: Add DxeIpmiLibIpmiProtocol Library Class.

2015-12-16 Thread Daocheng Bu
Add DxeIpmiLibIpmiProtocol Library Class that will depend on
Ipmi stack driver produces Ipmi Protocol in Dxe Phase under SMS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../DxeIpmiLibIpmiProtocol.c   | 74 ++
 .../DxeIpmiLibIpmiProtocol.inf | 40 
 2 files changed, 114 insertions(+)
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
 create mode 100644 
MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf

diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
new file mode 100644
index 000..a9bd716
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.c
@@ -0,0 +1,74 @@
+/** @file
+  Implementation of Ipmi Library in DXE Phase for SMS.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+IPMI_PROTOCOL *mIpmiProtocol = NULL;
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+{
+  EFI_STATUS  Status;
+
+  if (mIpmiProtocol == NULL) {
+Status = gBS->LocateProtocol (
+  &gIpmiProtocolGuid,
+  NULL,
+  (VOID **) &mIpmiProtocol
+  );
+if (EFI_ERROR (Status)) {
+  //
+  // Dxe Ipmi Protocol is not installed. So, IPMI device is not present.
+  //
+  DEBUG ((EFI_D_ERROR, "IpmiSubmitCommand in Dxe Phase under SMS Status - 
%r\n", Status));
+  return EFI_NOT_FOUND;
+}
+  }
+
+  Status = mIpmiProtocol->SendIpmiCommand (
+mIpmiProtocol,
+NetFunction,
+Command,
+CommandData,
+CommandDataSize,
+ResponseData,
+ResponseDataSize
+);
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+  return EFI_SUCCESS;
+}
\ No newline at end of file
diff --git 
a/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf 
b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
new file mode 100644
index 000..c57e779
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIpmiLibIpmiProtocol/DxeIpmiLibIpmiProtocol.inf
@@ -0,0 +1,40 @@
+## @file
+#  Instance of IPMI Library in DXE phase for SMS.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = DxeIpmiLibIpmiProtocol
+  FILE_GUID  = 62408AD5-4EAC-432B-AB9B-C4B85BFAED02
+  MODULE_TYPE= DXE_RUNTIME_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiLib|DXE_RUNTIME_DRIVER DXE_DRIVER
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  DxeIpmiLibIpmiProtocol.c
+  
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  UefiBoo

[edk2] [Patch] MdeModulePkg: Add BaseIpmiLibNull Library Class.

2015-12-16 Thread Daocheng Bu
Add BaseIpmiLibNull Library Class for BMC-Less platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.c  | 47 ++
 .../Library/BaseIpmiLibNull/BaseIpmiLibNull.inf| 40 ++
 2 files changed, 87 insertions(+)
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
 create mode 100644 MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf

diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
new file mode 100644
index 000..05f5a91
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.c
@@ -0,0 +1,47 @@
+/** @file
+  A emptry template implementation of Ipmi Library.
+
+  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESS The command byte stream was successfully sent to 
the device and a response was successfully received.
+  @retval EFI_NOT_FOUND   The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+  )
+{
+  return 0;
+}
\ No newline at end of file
diff --git a/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf 
b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
new file mode 100644
index 000..b74be3c
--- /dev/null
+++ b/MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -0,0 +1,40 @@
+## @file
+#  Null Instance of IPMI Library.
+#
+#  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php.
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BaseIpmiLibNull
+  FILE_GUID = 46805D61-0BB8-4680-A9BE-C96C751AB5A4
+  MODULE_TYPE   = BASE
+  VERSION_STRING= 1.0
+  LIBRARY_CLASS = IpmiLib
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  BaseIpmiLibNull.c
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseLib
+  UefiBootServicesTableLib
+  DxeServicesLib
+  DebugLib
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add Ipmi Protocol header file.

2015-12-16 Thread Daocheng Bu
Add Ipmi Protocol header file for both DXE and SMM.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdeModulePkg/Include/Protocol/IpmiProtocol.h | 56 
 1 file changed, 56 insertions(+)
 create mode 100644 MdeModulePkg/Include/Protocol/IpmiProtocol.h

diff --git a/MdeModulePkg/Include/Protocol/IpmiProtocol.h 
b/MdeModulePkg/Include/Protocol/IpmiProtocol.h
new file mode 100644
index 000..9f99c11
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/IpmiProtocol.h
@@ -0,0 +1,56 @@
+/** @file
+  Protocol of Ipmi for both SMS and SMM.
+
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PROTOCOL_H_
+#define _IPMI_PROTOCOL_H_
+
+typedef struct _IPMI_PROTOCOL IPMI_PROTOCOL;
+
+#define _IPMI_PROTOCOL_GUID \
+  { \
+0xdbc6381f, 0x5554, 0x4d14, 0x8f, 0xfd, 0x76, 0xd7, 0x87, 0xb8, 0xac, 0xbf 
\
+  }
+
+#define _SMM_IPMI_PROTOCOL_GUID \
+  { \
+0x5169af60, 0x8c5a, 0x4243, 0xb3, 0xe9, 0x56, 0xc5, 0x6d, 0x18, 0xee, 0x26 
\
+  }
+
+
+//
+// IPMI Submit Command Function Prototype
+//
+typedef
+EFI_STATUS
+(EFIAPI *IPMI_SUBMIT_COMMAND) (
+  IN IPMI_PROTOCOL *This,
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+  );
+
+//
+// IPMI COMMAND PROTOCOL
+//
+typedef struct _IPMI_PROTOCOL{
+  IPMI_SUBMIT_COMMAND   IpmiSubmitCommand;
+};
+
+extern EFI_GUID gIpmiProtocolGuid;
+extern EFI_GUID gSmmIpmiProtocolGuid;
+
+#endif
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add Ipmi Ppi header file.

2015-12-16 Thread Daocheng Bu
Add Ipmi Ppi header file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdeModulePkg/Include/Ppi/IpmiPpi.h | 49 ++
 1 file changed, 49 insertions(+)
 create mode 100644 MdeModulePkg/Include/Ppi/IpmiPpi.h

diff --git a/MdeModulePkg/Include/Ppi/IpmiPpi.h 
b/MdeModulePkg/Include/Ppi/IpmiPpi.h
new file mode 100644
index 000..8bd2919
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/IpmiPpi.h
@@ -0,0 +1,49 @@
+/** @file
+  Ppi for Ipmi of SMS.
+
+  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_PPI_H_
+#define _IPMI_PPI_H_
+
+typedef struct _PEI_IPMI_PPI PEI_IPMI_PPI;
+
+#define PEI_IPMI_PPI_GUID \
+  { \
+0xa9731431, 0xd968, 0x4277, 0xb7, 0x52, 0xa3, 0xa9, 0xa6, 0xae, 0x18, 0x98 
\
+  }  
+
+//
+//  IPMI Submit Command Function Prototype
+//
+typedef
+EFI_STATUS
+(EFIAPI *PEI_IPMI_SUBMIT_COMMAND) (
+  IN PEI_IPMI_PPI  *This,
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+  );
+
+//
+// IPMI PPI
+//
+typedef struct _PEI_IPMI_PPI {
+  PEI_IPMI_SUBMIT_COMMAND   IpmiSubmitCommand;
+};
+
+extern EFI_GUID gPeiIpmiPpiGuid;
+
+#endif
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg: Add IpmiLib header file.

2015-12-16 Thread Daocheng Bu
Add IpmiLib header file for ipmi command submit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdeModulePkg/Include/Library/IpmiLib.h | 47 ++
 1 file changed, 47 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/IpmiLib.h

diff --git a/MdeModulePkg/Include/Library/IpmiLib.h 
b/MdeModulePkg/Include/Library/IpmiLib.h
new file mode 100644
index 000..18ed506
--- /dev/null
+++ b/MdeModulePkg/Include/Library/IpmiLib.h
@@ -0,0 +1,47 @@
+/** @file
+  This library abstract how to access IPMI device via IPMI command.
+
+Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved. 
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _IPMI_LIB_H_
+#define _IPMI_LIB_H_
+
+#include 
+#include 
+
+
+/**
+  This service enables submitting commands via Ipmi.
+
+  @param[in] NetFunction   Net function of the command.
+  @param[in] Command   IPMI Command.
+  @param[in] CommandData   Command Data.
+  @param[in] CommandDataSize   Size of Command Data.
+  @param[out]ResponseData  Command Response Data.
+  @param[in out] ResponseDataSize  Size of Command Response Data.
+
+  @retval EFI_SUCCESSThe command byte stream was successfully 
submit to the device and a response was successfully received.
+  @retval EFI_NOT_FOUND  The command was not successfully sent to the 
device or a response was not successfully received from the device.
+**/
+EFI_STATUS
+EFIAPI
+IpmiSubmitCommand (
+  IN UINT8 NetFunction,
+  IN UINT8 Command,
+  IN UINT8 *CommandData,
+  IN UINT8 CommandDataSize,
+ OUT UINT8 *ResponseData,
+  IN OUT UINT8 *ResponseDataSize
+  )
+;
+
+#endif
\ No newline at end of file
-- 
2.5.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdePkg: Add Ipmi2.0 definitions head file.

2015-12-13 Thread Daocheng Bu
Re-add Ipmi2.0 definitions header files based on Ipmi category:
App, Storage and etc.
In V3, the file name has been changed for short.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Liming Gao 
---
 MdePkg/Include/IndustryStandard/Ipmi.h |  29 +
 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h | 618 +
 MdePkg/Include/IndustryStandard/IpmiNetFnBridge.h  | 243 
 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 304 ++
 .../Include/IndustryStandard/IpmiNetFnFirmware.h   |  26 +
 .../IndustryStandard/IpmiNetFnGroupExtension.h |  26 +
 .../IndustryStandard/IpmiNetFnSensorEvent.h|  52 ++
 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h | 534 ++
 .../Include/IndustryStandard/IpmiNetFnTransport.h  | 566 +++
 9 files changed, 2398 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Ipmi.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnBridge.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnGroupExtension.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnSensorEvent.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnStorage.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnTransport.h

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h 
b/MdePkg/Include/IndustryStandard/Ipmi.h
new file mode 100644
index 000..00b106a
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Ipmi.h
@@ -0,0 +1,29 @@
+/** @file
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef _IPMI_H_
+#define _IPMI_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#endif
\ No newline at end of file
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
new file mode 100644
index 000..9bf4e54
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -0,0 +1,618 @@
+/** @file
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  This file contains all NetFn App commands, including:
+IPM Device "Global" Commands (Chapter 20)
+Firmware Firewall & Command Discovery Commands (Chapter 21)
+BMC Watchdog Timer Commands (Chapter 27)
+IPMI Messaging Support Commands (Chapter 22)
+RMCP+ Support and Payload Commands (Chapter 24)
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef _IPMI_NET_FN_APP_H_
+#define _IPMI_NET_FN_APP_H_
+
+#pragma pack(1)
+//
+// Net function definition for App command
+//
+#define IPMI_NETFN_APP  0x06
+
+//
+//  Below is Definitions for IPM Device "Global" Commands  (Chapter 20)
+//
+
+//
+//  Definitions for Get Device ID command
+//
+#define IPMI_APP_GET_DEVICE_ID 0x1
+
+//
+//  Constants and Structure definitions for "Get Device ID" command to follow 
here
+//
+typedef struct {
+  UINT8   DeviceId;
+  UINT8   DeviceRevision : 4;
+  UINT8   Reserved : 3;
+  UINT8   DeviceSdr : 1;
+  UINT8   MajorFirmwareRev : 7;
+  UINT8   UpdateMode : 1;
+  UINT8   MinorFirmwareRev;
+  UINT8   SpecificationVersion;
+  UINT8   SensorDeviceSupport : 1;
+  UINT8   SdrRepositorySupport : 1;
+  UINT8   SelDeviceSupport : 1;
+  UINT8   FruInventorySupport : 1;
+  UINT8   IpmbMessageReceiver : 1;
+  UINT8   IpmbMessageGenerator : 1;
+  UINT8   BridgeSupport : 1;
+  UINT8   ChassisSupport : 1;
+  UINT8   ManufacturerId[3];
+  UINT16  ProductId;
+  UINT32  AuxFirmwareRevInfo;
+} IPMI_MSG_GET_DEVICE_ID_RSP;
+
+
+/

[edk2] [Patch] MdePkg: backout Ipmi2.0 definitions header file.

2015-12-11 Thread Daocheng Bu
The file name is too long and with "Definitions" word
that is duplicated meanings for the header file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Liming Gao 
---
 MdePkg/Include/IndustryStandard/Ipmi.h |  29 -
 .../IndustryStandard/IpmiNetFnAppDefinitions.h | 647 -
 .../IndustryStandard/IpmiNetFnBridgeDefinitions.h  | 243 
 .../IndustryStandard/IpmiNetFnChassisDefinitions.h | 304 --
 .../IpmiNetFnFirmwareDefinitions.h |  26 -
 .../IpmiNetFnGroupExtensionDefinitions.h   |  26 -
 .../IpmiNetFnSensorEventDefinitions.h  |  52 --
 .../IndustryStandard/IpmiNetFnStorageDefinitions.h | 534 -
 .../IpmiNetFnTransportDefinitions.h| 556 --
 9 files changed, 2417 deletions(-)
 delete mode 100644 MdePkg/Include/IndustryStandard/Ipmi.h
 delete mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
 delete mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnBridgeDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnChassisDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnFirmwareDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnGroupExtensionDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnSensorEventDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnStorageDefinitions.h
 delete mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnTransportDefinitions.h

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h 
b/MdePkg/Include/IndustryStandard/Ipmi.h
deleted file mode 100644
index fbf55c8..000
--- a/MdePkg/Include/IndustryStandard/Ipmi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/** @file
-  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
-
-  See IPMI specification, Appendix G, Command Assignments
-  and Appendix H, Sub-function Assignments.
-
-  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD 
License
-  which accompanies this distribution.  The full text of the license may be 
found at
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef _IPMIDEFINITIONS_H_
-#define _IPMIDEFINITIONS_H_
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#endif
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
deleted file mode 100644
index d722c9e..000
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
+++ /dev/null
@@ -1,647 +0,0 @@
-/** @file
-  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
-
-  This file contains all NetFn App commands, including:
-IPM Device "Global" Commands (Chapter 20)
-Firmware Firewall & Command Discovery Commands (Chapter 21)
-BMC Watchdog Timer Commands (Chapter 27)
-IPMI Messaging Support Commands (Chapter 22)
-RMCP+ Support and Payload Commands (Chapter 24)
-
-  See IPMI specification, Appendix G, Command Assignments
-  and Appendix H, Sub-function Assignments.
-
-  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD 
License
-  which accompanies this distribution.  The full text of the license may be 
found at
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef _IPMINETFNAPPDEFINITIONS_H_
-#define _IPMINETFNAPPDEFINITIONS_H_
-
-#pragma pack(1)
-//
-// Net function definition for App command
-//
-#define IPMI_NETFN_APP  0x06
-
-//
-//  Below is Definitions for IPM Device "Global" Commands  (Chapter 20)
-//
-
-//
-//  Definitions for Get Device ID command
-//
-#define IPMI_APP_GET_DEVICE_ID 0x1
-
-//
-//  Constants and Structure definitions for "Get Device ID" command to follow 
here
-//
-typedef struct {
-  UINT8   DeviceId;
-  UINT8   DeviceRevision : 4;
-  UINT8   Reserved : 3;
-  UINT8   DeviceSdr : 1;
-  UINT8   MajorFirmwareRev : 7;
-  UINT8   UpdateMode : 1;
-  UINT8   MinorFirmwareRev;
-  UINT8   SpecificationVersion;
-  UINT8   SensorDeviceSupport : 1;
-  UINT8   SdrRepositorySupport : 1;
-  UINT8   SelDeviceSupport : 1;
-  UINT8   FruInventorySupport : 1;
-  UINT8   IpmbMessageReceiver : 1;
-  UINT8   IpmbMessageGenerator : 1;
-  UINT8   BridgeSupport : 1;
-  UINT8   ChassisSupport : 

[edk2] [Patch] MdePkg: Add Ipmi2.0 definitions head file.

2015-12-03 Thread Daocheng Bu
Add Ipmi2.0 definitions head file based on Ipmi category:
App, Storage and etc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdePkg/Include/IndustryStandard/Ipmi.h |  29 +
 .../IndustryStandard/IpmiNetFnAppDefinitions.h | 647 +
 .../IndustryStandard/IpmiNetFnBridgeDefinitions.h  | 243 
 .../IndustryStandard/IpmiNetFnChassisDefinitions.h | 304 ++
 .../IpmiNetFnFirmwareDefinitions.h |  26 +
 .../IpmiNetFnGroupExtensionDefinitions.h   |  26 +
 .../IpmiNetFnSensorEventDefinitions.h  |  52 ++
 .../IndustryStandard/IpmiNetFnStorageDefinitions.h | 534 +
 .../IpmiNetFnTransportDefinitions.h| 556 ++
 9 files changed, 2417 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Ipmi.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnBridgeDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnChassisDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnFirmwareDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnGroupExtensionDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnSensorEventDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnStorageDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnTransportDefinitions.h

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h 
b/MdePkg/Include/IndustryStandard/Ipmi.h
new file mode 100644
index 000..b9465a1
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Ipmi.h
@@ -0,0 +1,29 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMIDEFINITIONS_H_
+#define _IPMIDEFINITIONS_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#endif
\ No newline at end of file
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
new file mode 100644
index 000..760467d
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
@@ -0,0 +1,647 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  This file contains all NetFn App commands, including:
+IPM Device "Global" Commands (Chapter 20)
+Firmware Firewall & Command Discovery Commands (Chapter 21)
+BMC Watchdog Timer Commands (Chapter 27)
+IPMI Messaging Support Commands (Chapter 22)
+RMCP+ Support and Payload Commands (Chapter 24)
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMINETFNAPPDEFINITIONS_H_
+#define _IPMINETFNAPPDEFINITIONS_H_
+
+#pragma pack(1)
+//
+// Net function definition for App command
+//
+#define IPMI_NETFN_APP  0x06
+
+//
+//  Below is Definitions for IPM Device "Global" Commands  (Chapter 20)
+//
+
+//
+//  Definitions for Get Device ID command   
+//
+#define IPMI_APP_GET_DEVICE_ID 0x1
+
+//
+//  Constants and Structure definitions for "Get Device ID" command to follow 
here
+//
+typedef struct {
+  UINT8   DeviceId;
+  UINT8   DeviceRevision : 4;
+  UINT8   Reserved : 3;
+  UINT8   DeviceSdr : 1;
+  UINT8   MajorFirmwareRev : 7;
+  UINT8   UpdateMode : 1;
+  UINT8   MinorFirmwareRev;
+  UINT8   SpecificationVersion;
+  UINT8   SensorDeviceSupp

[edk2] [Patch] MdePkg: Add Ipmi2.0 definitions head file.

2015-12-02 Thread Daocheng Bu
Add Ipmi2.0 definitions head file based on Ipmi category:
App, Storage and etc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdePkg/Include/IndustryStandard/Ipmi.h |  29 +
 .../IndustryStandard/IpmiNetFnAppDefinitions.h | 647 +
 .../IndustryStandard/IpmiNetFnBridgeDefinitions.h  | 243 
 .../IndustryStandard/IpmiNetFnChassisDefinitions.h | 304 ++
 .../IpmiNetFnFirmwareDefinitions.h |  26 +
 .../IpmiNetFnGroupExtensionDefinitions.h   |  26 +
 .../IpmiNetFnSensorEventDefinitions.h  |  52 ++
 .../IndustryStandard/IpmiNetFnStorageDefinitions.h | 534 +
 .../IpmiNetFnTransportDefinitions.h| 556 ++
 9 files changed, 2417 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Ipmi.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnBridgeDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnChassisDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnFirmwareDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnGroupExtensionDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnSensorEventDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnStorageDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnTransportDefinitions.h

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h 
b/MdePkg/Include/IndustryStandard/Ipmi.h
new file mode 100644
index 000..04e6807
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Ipmi.h
@@ -0,0 +1,29 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMIDEFINITIONS_H_
+#define _IPMIDEFINITIONS_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#endif
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
new file mode 100644
index 000..3e31b10
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
@@ -0,0 +1,647 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
+
+  This file contains all NetFn App commands, including:
+IPM Device "Global" Commands (Chapter 20)
+Firmware Firewall & Command Discovery Commands (Chapter 21)
+BMC Watchdog Timer Commands (Chapter 27)
+IPMI Messaging Support Commands (Chapter 22)
+RMCP+ Support and Payload Commands (Chapter 24)
+
+  See IPMI specification, Appendix G, Command Assignments
+  and Appendix H, Sub-function Assignments.
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMINETFNAPPDEFINITIONS_H_
+#define _IPMINETFNAPPDEFINITIONS_H_
+
+#pragma pack(1)
+//
+// Net function definition for App command
+//
+#define IPMI_NETFN_APP  0x06
+
+//
+//  Below is Definitions for IPM Device "Global" Commands  (Chapter 20)
+//
+
+//
+//  Definitions for Get Device ID command   
+//
+#define IPMI_APP_GET_DEVICE_ID 0x1
+
+//
+//  Constants and Structure definitions for "Get Device ID" command to follow 
here
+//
+typedef struct {
+  UINT8   DeviceId;
+  UINT8   DeviceRevision : 4;
+  UINT8   Reserved : 3;
+  UINT8   DeviceSdr : 1;
+  UINT8   MajorFirmwareRev : 7;
+  UINT8   UpdateMode : 1;
+  UINT8   MinorFirmwareRev;
+  UINT8   SpecificationVersion;
+  UINT8   SensorDeviceSupport : 1;
+  UINT8   SdrRepository

[edk2] [Patch] MdePkg: Add Ipmi2.0 definitions head file.

2015-11-26 Thread Daocheng Bu
Add Ipmi2.0 definitions head file based on Ipmi category:
App, Storage and etc.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daocheng Bu 
CC: Jiewen Yao 
---
 MdePkg/Include/IndustryStandard/Ipmi.h |  26 +
 .../IndustryStandard/IpmiNetFnAppDefinitions.h | 614 +
 .../IndustryStandard/IpmiNetFnBridgeDefinitions.h  | 238 
 .../IndustryStandard/IpmiNetFnChassisDefinitions.h | 294 ++
 .../IpmiNetFnFirmwareDefinitions.h |  26 +
 .../IpmiNetFnGroupExtDefinitions.h |  26 +
 .../IpmiNetFnSensorEventDefinitions.h  |  44 ++
 .../IndustryStandard/IpmiNetFnStorageDefinitions.h | 514 +
 .../IpmiNetFnTransportDefinitions.h| 531 ++
 9 files changed, 2313 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Ipmi.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnBridgeDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnChassisDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnFirmwareDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnGroupExtDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnSensorEventDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnStorageDefinitions.h
 create mode 100644 
MdePkg/Include/IndustryStandard/IpmiNetFnTransportDefinitions.h

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h 
b/MdePkg/Include/IndustryStandard/Ipmi.h
new file mode 100644
index 000..de72bcc
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Ipmi.h
@@ -0,0 +1,26 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification, revision 2.0
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMIDEFINITIONS_H_
+#define _IPMIDEFINITIONS_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#endif
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h 
b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
new file mode 100644
index 000..77582e2
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnAppDefinitions.h
@@ -0,0 +1,614 @@
+/** @file   
+  IPMI 2.0 definitions from the IPMI Specification, revision 2.0
+
+  Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved.
+  This program and the accompanying materials  
+  are licensed and made available under the terms and conditions of the BSD 
License 
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php   
 
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED. 
+**/
+
+#ifndef _IPMINETFNAPPDEFINITIONS_H_
+#define _IPMINETFNAPPDEFINITIONS_H_
+
+#pragma pack(1)
+//
+// Net function definition for App command
+//
+#define IPMI_NETFN_APP  0x06
+
+//
+//  Definitions for Get Device ID command   
+//
+#define IPMI_APP_GET_DEVICE_ID 0x1
+
+//
+//  Constants and Structure definitions for "Get Device ID" command to follow 
here
+//
+typedef struct {
+  UINT8   DeviceId;
+  UINT8   DeviceRevision : 4;
+  UINT8   Reserved : 3;
+  UINT8   DeviceSdr : 1;
+  UINT8   MajorFirmwareRev : 7;
+  UINT8   UpdateMode : 1;
+  UINT8   MinorFirmwareRev;
+  UINT8   SpecificationVersion;
+  UINT8   SensorDeviceSupport : 1;
+  UINT8   SdrRepositorySupport : 1;
+  UINT8   SelDeviceSupport : 1;
+  UINT8   FruInventorySupport : 1;
+  UINT8   IpmbMessageReceiver : 1;
+  UINT8   IpmbMessageGenerator : 1;
+  UINT8   BridgeSupport : 1;
+  UINT8   ChassisSupport : 1;
+  UINT8   ManufacturerId[3];
+  UINT16  ProductId;
+  UINT32  AuxFirmwareRevInfo;
+} IPMI_MSG_GET_DEVICE_ID_RSP;
+
+
+//
+//  Definitions for Cold Reset command  
+//
+#define IPMI_APP_COLD_RESET  0x2
+
+//
+//  Constants and Structure definitions for "Cold Reset" command to follow here
+//
+
+//
+//  Definitions for Warm Reset command  
+//
+#define IPMI_APP_WARM_RESET  0x3
+
+//
+//  Constants and Structure definitions for "Warm Reset" com