public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V3 0/3] IPMI changes for Redfish
@ 2022-12-29  1:54 Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 1/3] MdePkg/IndustryStandard: Update IPMI definitions Chang, Abner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chang, Abner @ 2022-12-29  1:54 UTC (permalink / raw)
  To: devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Nickle Wang,
	Igor Kulchytskyy, Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

In V3: Addressd the comments on V1 2/3
In V2: Addressd the comments on V1 3/3

This patch updates IPMI related definitions for supporting
Redfish Host interface Credential bootstrapping spec and
building up SMBIOS 42 record for the USB NIC host
interface exposed by BMC.
The corresponding updates on IpmiFeaturePkg is in the
separate pacth for edk2-platforms.

This is the part I of upstream, the follow up patche sets are:
- RedfishPlatformCredentialLib contributed by NVidia.
- Relocate IpmiCommandLib.h from edk2-platforms
  to edk2/MdePkg. A NULL instance of IpmiCommandLib is created
  and located under MdePkg. With above, RedfishPkg doesn't have the
  dependence with edk2-platforms. The implementation of IpmiCommandLib
  stays in edk2-platforms without relocation, which can be pulled in
  to platform DSC as needed.
- PlatformHostInterfaceBmcUsbNic would be upstream to edk2-staging
  temporarily because some requirements are necessray to be spec out
  in the Redfish section in UEFI spec.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Abner Chang (3):
  MdePkg/IndustryStandard: Update IPMI definitions
  RedfishPkg/Include: Add Redfish IPMI definitions
  RedfishPkg/Include: Redfish USB Interface V2 update

 MdePkg/Include/IndustryStandard/Ipmi.h        | 17 +++++++
 .../Include/IndustryStandard/IpmiNetFnApp.h   | 37 ++++++++++++--
 .../IndustryStandard/IpmiNetFnTransport.h     | 32 ++++++++++++
 .../IndustryStandard/RedfishHostInterface.h   | 25 ++++++++-
 .../RedfishHostInterfaceIpmi.h                | 51 +++++++++++++++++++
 5 files changed, 157 insertions(+), 5 deletions(-)
 create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h

-- 
2.37.1.windows.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V3 1/3] MdePkg/IndustryStandard: Update IPMI definitions
  2022-12-29  1:54 [PATCH V3 0/3] IPMI changes for Redfish Chang, Abner
@ 2022-12-29  1:54 ` Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 2/3] RedfishPkg/Include: Add Redfish " Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update Chang, Abner
  2 siblings, 0 replies; 7+ messages in thread
From: Chang, Abner @ 2022-12-29  1:54 UTC (permalink / raw)
  To: devel
  Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Nickle Wang,
	Igor Kulchytskyy, Isaac Oram, Nate DeSimone

From: Abner Chang <abner.chang@amd.com>

This change updates IPMI header files to support
build up SMBIOS 42 Redfish Host Interface record
using the information retrieved via IPMI App/Net
Function.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 MdePkg/Include/IndustryStandard/Ipmi.h        | 17 +++++++++
 .../Include/IndustryStandard/IpmiNetFnApp.h   | 37 +++++++++++++++++--
 .../IndustryStandard/IpmiNetFnTransport.h     | 32 ++++++++++++++++
 3 files changed, 82 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/Ipmi.h b/MdePkg/Include/IndustryStandard/Ipmi.h
index 9d1d412b53e..e16c1281862 100644
--- a/MdePkg/Include/IndustryStandard/Ipmi.h
+++ b/MdePkg/Include/IndustryStandard/Ipmi.h
@@ -6,6 +6,7 @@
   and Appendix H, Sub-function Assignments.
 
   Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -52,4 +53,20 @@
 #define IPMI_COMP_CODE_SUBFUNCTION_DISABLED             0xD6
 #define IPMI_COMP_CODE_UNSPECIFIED                      0xFF
 
+#define IPMI_CHANNEL_NUMBER_PRIMARY_IPMB                0x00
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_1   0x01
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_2   0x02
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_3   0x03
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_4   0x04
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_5   0x05
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_6   0x06
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_7   0x07
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_8   0x08
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_9   0x09
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_10  0x0A
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_SPECIFIC_11  0x0B
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_RESERVED_12  0x0C
+#define IPMI_CHANNEL_NUMBER_IMPLEMENTATION_RESERVED_13  0x0D
+#define IPMI_CHANNEL_NUMBER_PRIMARY_PRESENT_IF          0x0E
+#define IPMI_CHANNEL_NUMBER_PRIMARY_SYSTEM_INTERFACE    0x0F
 #endif
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
index 0721bc6b271..08f977f2087 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnApp.h
@@ -12,6 +12,7 @@
   and Appendix H, Sub-function Assignments.
 
   Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -486,6 +487,11 @@ typedef struct {
 //
 #define IPMI_APP_GET_SYSTEM_GUID  0x37
 
+typedef struct {
+  UINT8       CompletionCode;
+  EFI_GUID    SystemUuid;
+} IPMI_GET_SYSTEM_UUID_RESPONSE;
+
 //
 //  Constants and Structure definitions for "Get System GUID" command to follow here
 //
@@ -671,6 +677,30 @@ typedef struct {
 #define IPMI_CHANNEL_MEDIA_TYPE_OEM_START  0x60
 #define IPMI_CHANNEL_MEDIA_TYPE_OEM_END    0x7F
 
+//
+//  Definitions for channel protocol type
+//
+// Not available
+#define IPMI_CHANNEL_PROTOCOL_TYPE_NA  0x00
+// IPMB-1.0
+#define IPMI_CHANNEL_PROTOCOL_TYPE_IPMB_1_0  0x01
+// ICMB-1.0
+#define IPMI_CHANNEL_PROTOCOL_TYPE_ICMB_1_0  0x02
+// Reserved
+#define IPMI_CHANNEL_PROTOCOL_TYPE_RESERVED  0x03
+// IPMI SMBUS
+#define IPMI_CHANNEL_PROTOCOL_TYPE_IPMI_SMBUS  0x04
+// KCS
+#define IPMI_CHANNEL_PROTOCOL_TYPE_KCS  0x05
+// SMIC
+#define IPMI_CHANNEL_PROTOCOL_TYPE_SMIC  0x06
+// BT-10
+#define IPMI_CHANNEL_PROTOCOL_TYPE_BT_10  0x07
+// BT-15
+#define IPMI_CHANNEL_PROTOCOL_TYPE_BT_15  0x08
+// TMode
+#define IPMI_CHANNEL_PROTOCOL_TYPE_TMODE  0x09
+
 typedef union {
   struct {
     UINT8    ChannelNo : 4;
@@ -713,10 +743,9 @@ typedef struct {
   UINT16                               AuxChannelInfo;
 } IPMI_GET_CHANNEL_INFO_RESPONSE;
 
-//
-//  Definitions for Get Channel Info command
-//
-#define IPMI_APP_GET_CHANNEL_INFO  0x42
+typedef struct {
+  IPMI_CHANNEL_INFO_CHANNEL_NUMBER    ChannelNumber;
+} IPMI_GET_CHANNEL_INFO_REQUEST;
 
 //
 //  Constants and Structure definitions for "Get Channel Info" command to follow here
diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnTransport.h b/MdePkg/Include/IndustryStandard/IpmiNetFnTransport.h
index 19db84e5122..2eb6cd9b344 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnTransport.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnTransport.h
@@ -11,6 +11,7 @@
   and Appendix H, Sub-function Assignments.
 
   Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
@@ -60,6 +61,7 @@ typedef enum {
   IpmiLanReserved3,
   IpmiLanDestinationType,
   IpmiLanDestinationAddress,
+  IpmiLanVlanId         = 0x14,
   IpmiIpv4OrIpv6Support = 0x32,
   IpmiIpv4OrIpv6AddressEnable,
   IpmiIpv6HdrStatTrafficClass,
@@ -103,6 +105,14 @@ typedef enum {
   IpmiOem2
 } IPMI_LAN_DEST_TYPE_DEST_TYPE;
 
+//
+// Destination address format
+//
+typedef enum {
+  IpmiDestinationAddressVersion4,
+  IpmiDestinationAddressVersion6
+} IPMI_LAN_DEST_ADDRESS_VERSION;
+
 typedef union {
   struct {
     UINT8    NoAuth       : 1;
@@ -177,6 +187,10 @@ typedef struct {
   UINT8    ArpInterval;
 } IPMI_LAN_ARP_INTERVAL;
 
+typedef struct {
+  UINT8    IpAddress[4];
+} IPMI_LAN_DEFAULT_GATEWAY;
+
 typedef struct {
   UINT8    Data[18];
 } IPMI_LAN_COMMUNITY_STRING;
@@ -227,6 +241,24 @@ typedef struct {
   IPMI_LAN_MAC_ADDRESS         AlertingMacAddress;
 } IPMI_LAN_DEST_ADDRESS;
 
+typedef struct {
+  UINT8    VanIdLowByte;
+} IPMI_LAN_VLAN_ID_DATA1;
+
+typedef union {
+  struct {
+    UINT8    VanIdHighByte : 4;
+    UINT8    Reserved      : 3;
+    UINT8    Enabled       : 1;
+  } Bits;
+  UINT8    Uint8;
+} IPMI_LAN_VLAN_ID_DATA2;
+
+typedef struct {
+  IPMI_LAN_VLAN_ID_DATA1    Data1;
+  IPMI_LAN_VLAN_ID_DATA2    Data2;
+} IPMI_LAN_VLAN_ID;
+
 typedef union {
   IPMI_LAN_AUTH_TYPE                    IpmiLanAuthType;
   IPMI_LAN_IP_ADDRESS                   IpmiLanIpAddress;
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 2/3] RedfishPkg/Include: Add Redfish IPMI definitions
  2022-12-29  1:54 [PATCH V3 0/3] IPMI changes for Redfish Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 1/3] MdePkg/IndustryStandard: Update IPMI definitions Chang, Abner
@ 2022-12-29  1:54 ` Chang, Abner
  2022-12-29  2:40   ` Igor Kulchytskyy
  2022-12-29  1:54 ` [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update Chang, Abner
  2 siblings, 1 reply; 7+ messages in thread
From: Chang, Abner @ 2022-12-29  1:54 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy

From: Abner Chang <abner.chang@amd.com>

Add the definitions of Redfish Host Interface
credential bootstrapping IPMI commands.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
 .../RedfishHostInterfaceIpmi.h                | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h
new file mode 100644
index 00000000000..1428a7809f1
--- /dev/null
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h
@@ -0,0 +1,51 @@
+/** @file
+  Redfish Host Interface IPMI command
+
+  Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef REDFISH_HOST_INTERFACE_IPMI_H_
+#define REDFISH_HOST_INTERFACE_IPMI_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/IpmiNetFnGroupExtension.h>
+
+#define REDFISH_IPMI_GROUP_EXTENSION                          0x52
+#define REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD            0x02
+#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE              0xA5
+#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE             0x00
+#define REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED  0x80
+
+///
+/// Per Redfish Host Interface Specification 1.3, The maximum lenght of
+/// username and password is 16 characters long.
+///
+#define USERNAME_MAX_LENGTH  16
+#define PASSWORD_MAX_LENGTH  16
+#define USERNAME_MAX_SIZE    (USERNAME_MAX_LENGTH + 1)  // NULL terminator
+#define PASSWORD_MAX_SIZE    (PASSWORD_MAX_LENGTH + 1)  // NULL terminator
+
+#pragma pack(1)
+
+///
+/// The definition of IPMI command to get bootstrap account credentials
+///
+typedef struct {
+  UINT8    GroupExtensionId;
+  UINT8    DisableBootstrapControl;
+} IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA;
+
+///
+/// The response data of getting bootstrap credential
+///
+typedef struct {
+  UINT8    CompletionCode;
+  UINT8    GroupExtensionId;
+  CHAR8    Username[USERNAME_MAX_LENGTH];
+  CHAR8    Password[PASSWORD_MAX_LENGTH];
+} IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE;
+
+#pragma pack()
+
+#endif
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
  2022-12-29  1:54 [PATCH V3 0/3] IPMI changes for Redfish Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 1/3] MdePkg/IndustryStandard: Update IPMI definitions Chang, Abner
  2022-12-29  1:54 ` [PATCH V3 2/3] RedfishPkg/Include: Add Redfish " Chang, Abner
@ 2022-12-29  1:54 ` Chang, Abner
  2022-12-29  2:40   ` Igor Kulchytskyy
  2 siblings, 1 reply; 7+ messages in thread
From: Chang, Abner @ 2022-12-29  1:54 UTC (permalink / raw)
  To: devel; +Cc: Nickle Wang, Igor Kulchytskyy

From: Abner Chang <abner.chang@amd.com>

Support USB_INTERFACE_DEVICE_DESCRIPTOR_V2 which
is updated in Redfish Host Interface spec v1.3.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Igor Kulchytskyy<igork@ami.com>
Reviewed-by: Nickle Wang<nicklew@nvidia.com>
---
 .../IndustryStandard/RedfishHostInterface.h   | 25 ++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
index 49b3ceee39c..022bd1f36ef 100644
--- a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -29,6 +30,18 @@
 #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4      0x01
 #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6      0x02
 
+///
+/// Definitions for IP assignment tyeps.
+///
+typedef enum {
+  RedfishHostIpAssignmentUnknown,
+  RedfishHostIpAssignmentStatic,
+  RedfishHostIpAssignmentDhcp,
+  RedfishHostIpAssignmentAutoConfigure,
+  RedfishHostIpAssignmentHostSelected,
+  RedfishHostIpAssignmentReserved
+} REDFISH_HOST_IP_ASSIGNMENT;
+
 #pragma pack(1)
 ///
 /// Structure definitions of Host Interface device type 04h (USB Network Interface V2)
@@ -40,12 +53,18 @@ typedef struct {
                                            ///< idVendor field of the USB descriptor.
   UINT16    IdProduct;                     ///< The Product ID of the device, as read from the
                                            ///< idProduct field of the USB descriptor.
-  UINT8     SecialNumberStr;               ///< The string number for the Serial Number of the
+  UINT8     SerialNumberStr;               ///< The string number for the Serial Number of the
                                            ///< device. The string data is read from the
                                            ///< iSerialNumber.bDescriptorType field of the USB
                                            ///< descriptor, and is converted from Unicode to ASCII
                                            ///< and is NULL terminated.
   UINT8     MacAddress[6];                 ///< The MAC address of the PCI/PCIe network device.
+
+  ///
+  /// Below is defined in Redfish Host Interface spec v1.3
+  ///
+  UINT16    Characteristics;               ///< Additional device characteristics.
+  UINT16    CredentialBootstrappingHandle; ///< Credential bootstrapping handle.
 } USB_INTERFACE_DEVICE_DESCRIPTOR_V2;
 
 //
@@ -74,6 +93,10 @@ typedef struct {
 ///
 /// Define union for the Host Interface Device Descriptor
 ///
+#define USB_INTERFACE_DEVICE_DESCRIPTOR_V2_SIZE_1_3  0x11        ///< Length USB interface device v2 defined in
+                                                                 ///< Redfish host interface spec v1.3
+#define USB_INTERFACE_DEVICE_DESCRIPTOR_V2_SIZE_1_2  0x0d        ///< Length USB interface device v2 defined in
+                                                                 ///< Redfish host interface spec v1.2
 typedef union {
   USB_INTERFACE_DEVICE_DESCRIPTOR_V2            UsbDeviceV2;     ///< Device type USB V2 device discriptor.
   PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2    PciPcieDeviceV2; ///< Device type PCI/PCIe V2 device discriptor.
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 2/3] RedfishPkg/Include: Add Redfish IPMI definitions
  2022-12-29  1:54 ` [PATCH V3 2/3] RedfishPkg/Include: Add Redfish " Chang, Abner
@ 2022-12-29  2:40   ` Igor Kulchytskyy
  2023-01-05 18:20     ` [edk2-devel] " Isaac Oram
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Kulchytskyy @ 2022-12-29  2:40 UTC (permalink / raw)
  To: abner.chang@amd.com, devel@edk2.groups.io

Reviewed-by: Igor Kulchytskyy<igork@ami.com>

-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com>
Sent: Wednesday, December 28, 2022 8:55 PM
To: devel@edk2.groups.io
Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] [PATCH V3 2/3] RedfishPkg/Include: Add Redfish IPMI definitions


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

From: Abner Chang <abner.chang@amd.com>

Add the definitions of Redfish Host Interface credential bootstrapping IPMI commands.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
 .../RedfishHostInterfaceIpmi.h                | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h
new file mode 100644
index 00000000000..1428a7809f1
--- /dev/null
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterfaceIpmi.h
@@ -0,0 +1,51 @@
+/** @file
+  Redfish Host Interface IPMI command
+
+  Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef REDFISH_HOST_INTERFACE_IPMI_H_
+#define REDFISH_HOST_INTERFACE_IPMI_H_
+
+#include <Uefi.h>
+#include <IndustryStandard/IpmiNetFnGroupExtension.h>
+
+#define REDFISH_IPMI_GROUP_EXTENSION                          0x52
+#define REDFISH_IPMI_GET_BOOTSTRAP_CREDENTIALS_CMD            0x02
+#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_ENABLE              0xA5
+#define REDFISH_IPMI_BOOTSTRAP_CREDENTIAL_DISABLE             0x00
+#define REDFISH_IPMI_COMP_CODE_BOOTSTRAP_CREDENTIAL_DISABLED  0x80
+
+///
+/// Per Redfish Host Interface Specification 1.3, The maximum lenght of
+/// username and password is 16 characters long.
+///
+#define USERNAME_MAX_LENGTH  16
+#define PASSWORD_MAX_LENGTH  16
+#define USERNAME_MAX_SIZE    (USERNAME_MAX_LENGTH + 1)  // NULL terminator
+#define PASSWORD_MAX_SIZE    (PASSWORD_MAX_LENGTH + 1)  // NULL terminator
+
+#pragma pack(1)
+
+///
+/// The definition of IPMI command to get bootstrap account credentials
+/// typedef struct {
+  UINT8    GroupExtensionId;
+  UINT8    DisableBootstrapControl;
+} IPMI_BOOTSTRAP_CREDENTIALS_COMMAND_DATA;
+
+///
+/// The response data of getting bootstrap credential /// typedef
+struct {
+  UINT8    CompletionCode;
+  UINT8    GroupExtensionId;
+  CHAR8    Username[USERNAME_MAX_LENGTH];
+  CHAR8    Password[PASSWORD_MAX_LENGTH];
+} IPMI_BOOTSTRAP_CREDENTIALS_RESULT_RESPONSE;
+
+#pragma pack()
+
+#endif
--
2.37.1.windows.1

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
  2022-12-29  1:54 ` [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update Chang, Abner
@ 2022-12-29  2:40   ` Igor Kulchytskyy
  0 siblings, 0 replies; 7+ messages in thread
From: Igor Kulchytskyy @ 2022-12-29  2:40 UTC (permalink / raw)
  To: abner.chang@amd.com, devel@edk2.groups.io; +Cc: Nickle Wang

Reviewed-by: Igor Kulchytskyy<igork@ami.com>

-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com>
Sent: Wednesday, December 28, 2022 8:55 PM
To: devel@edk2.groups.io
Cc: Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**

From: Abner Chang <abner.chang@amd.com>

Support USB_INTERFACE_DEVICE_DESCRIPTOR_V2 which is updated in Redfish Host Interface spec v1.3.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Igor Kulchytskyy<igork@ami.com>
Reviewed-by: Nickle Wang<nicklew@nvidia.com>
---
 .../IndustryStandard/RedfishHostInterface.h   | 25 ++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
index 49b3ceee39c..022bd1f36ef 100644
--- a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
+++ b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
@@ -3,6 +3,7 @@

   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (C) 2022 Advanced Micro Devices, Inc. All rights
+ reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent  **/ @@ -29,6 +30,18 @@
 #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4      0x01
 #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6      0x02

+///
+/// Definitions for IP assignment tyeps.
+///
+typedef enum {
+  RedfishHostIpAssignmentUnknown,
+  RedfishHostIpAssignmentStatic,
+  RedfishHostIpAssignmentDhcp,
+  RedfishHostIpAssignmentAutoConfigure,
+  RedfishHostIpAssignmentHostSelected,
+  RedfishHostIpAssignmentReserved
+} REDFISH_HOST_IP_ASSIGNMENT;
+
 #pragma pack(1)
 ///
 /// Structure definitions of Host Interface device type 04h (USB Network Interface V2) @@ -40,12 +53,18 @@ typedef struct {
                                            ///< idVendor field of the USB descriptor.
   UINT16    IdProduct;                     ///< The Product ID of the device, as read from the
                                            ///< idProduct field of the USB descriptor.
-  UINT8     SecialNumberStr;               ///< The string number for the Serial Number of the
+  UINT8     SerialNumberStr;               ///< The string number for the Serial Number of the
                                            ///< device. The string data is read from the
                                            ///< iSerialNumber.bDescriptorType field of the USB
                                            ///< descriptor, and is converted from Unicode to ASCII
                                            ///< and is NULL terminated.
   UINT8     MacAddress[6];                 ///< The MAC address of the PCI/PCIe network device.
+
+  ///
+  /// Below is defined in Redfish Host Interface spec v1.3  ///
+  UINT16    Characteristics;               ///< Additional device characteristics.
+  UINT16    CredentialBootstrappingHandle; ///< Credential bootstrapping handle.
 } USB_INTERFACE_DEVICE_DESCRIPTOR_V2;

 //
@@ -74,6 +93,10 @@ typedef struct {
 ///
 /// Define union for the Host Interface Device Descriptor  ///
+#define USB_INTERFACE_DEVICE_DESCRIPTOR_V2_SIZE_1_3  0x11        ///< Length USB interface device v2 defined in
+                                                                 ///< Redfish host interface spec v1.3
+#define USB_INTERFACE_DEVICE_DESCRIPTOR_V2_SIZE_1_2  0x0d        ///< Length USB interface device v2 defined in
+                                                                 ///<
+Redfish host interface spec v1.2
 typedef union {
   USB_INTERFACE_DEVICE_DESCRIPTOR_V2            UsbDeviceV2;     ///< Device type USB V2 device discriptor.
   PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2    PciPcieDeviceV2; ///< Device type PCI/PCIe V2 device discriptor.
--
2.37.1.windows.1

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH V3 2/3] RedfishPkg/Include: Add Redfish IPMI definitions
  2022-12-29  2:40   ` Igor Kulchytskyy
@ 2023-01-05 18:20     ` Isaac Oram
  0 siblings, 0 replies; 7+ messages in thread
From: Isaac Oram @ 2023-01-05 18:20 UTC (permalink / raw)
  To: Igor Kulchytskyy, devel

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Reviewed-by: Isaac Oram < isaac.w.oram@intel.com >

Nit comment, there is a typo in "lenght", line 21.

[-- Attachment #2: Type: text/html, Size: 244 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-05 18:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-29  1:54 [PATCH V3 0/3] IPMI changes for Redfish Chang, Abner
2022-12-29  1:54 ` [PATCH V3 1/3] MdePkg/IndustryStandard: Update IPMI definitions Chang, Abner
2022-12-29  1:54 ` [PATCH V3 2/3] RedfishPkg/Include: Add Redfish " Chang, Abner
2022-12-29  2:40   ` Igor Kulchytskyy
2023-01-05 18:20     ` [edk2-devel] " Isaac Oram
2022-12-29  1:54 ` [PATCH V3 3/3] RedfishPkg/Include: Redfish USB Interface V2 update Chang, Abner
2022-12-29  2:40   ` Igor Kulchytskyy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox