[edk2-devel] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface V2 update

Chang, Abner via groups.io posted 3 patches 1 year, 10 months ago
There is a newer version of this series
[edk2-devel] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
Posted by Chang, Abner via groups.io 1 year, 10 months ago
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>
---
 .../IndustryStandard/RedfishHostInterface.h   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
index 49b3ceee39c..5337c3234b2 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)
@@ -46,6 +59,12 @@ typedef struct {
                                            ///< 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97735): https://edk2.groups.io/g/devel/message/97735
Mute This Topic: https://groups.io/mt/95843861/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
Posted by Nickle Wang via groups.io 1 year, 10 months ago
Hi Abner,

Could you please also fix the typo in USB_INTERFACE_DEVICE_DESCRIPTOR_V2 structure together? 

There is typo at line 43: https://github.com/tianocore/edk2/blob/a086f4a63bc0295b0b02f8ee76381c6b437122bf/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h#L43

UINT8     SecialNumberStr;

It should be SerialNumberStr.

Thanks,
Nickle

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

External email: Use caution opening links or attachments


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>
---
 .../IndustryStandard/RedfishHostInterface.h   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
index 49b3ceee39c..5337c3234b2 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) @@ -46,6 +59,12 @@ typedef struct {
                                            ///< 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97766): https://edk2.groups.io/g/devel/message/97766
Mute This Topic: https://groups.io/mt/95843861/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
Posted by Igor Kulchytskyy via groups.io 1 year, 10 months ago
Hi Abner,
I'm not sure if I did something wrong, but when I tried to apply that patch I got an error:
error: corrupt patch at line 30
Thank you,
Igor

-----Original Message-----
From: abner.chang@amd.com <abner.chang@amd.com>
Sent: Friday, December 23, 2022 7:34 AM
To: devel@edk2.groups.io
Cc: Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
Subject: [EXTERNAL] [PATCH 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>
---
 .../IndustryStandard/RedfishHostInterface.h   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
index 49b3ceee39c..5337c3234b2 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) @@ -46,6 +59,12 @@ typedef struct {
                                            ///< 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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97744): https://edk2.groups.io/g/devel/message/97744
Mute This Topic: https://groups.io/mt/95843861/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface V2 update
Posted by Chang, Abner via groups.io 1 year, 10 months ago
[AMD Official Use Only - General]

Hi Igor,
I just tried it and applied patch successfully, however I got the patch from group.io (copy and paste to Notepad++) but not from the email. Outlook often breaks the content. Please also check if your code is up to data (specifically to RedfishPkg for patch 3/3). The patch was created based on the master branch of edk2.

Thanks and happy new year!! 😊
Abner

> -----Original Message-----
> From: Igor Kulchytskyy <igork@ami.com>
> Sent: Saturday, December 24, 2022 1:32 AM
> To: Chang, Abner <Abner.Chang@amd.com>; devel@edk2.groups.io
> Cc: Nickle Wang <nicklew@nvidia.com>
> Subject: RE: [EXTERNAL] [PATCH 3/3] RedfishPkg/Include: Redfish USB Interface
> V2 update
> 
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> I'm not sure if I did something wrong, but when I tried to apply that patch I got
> an error:
> error: corrupt patch at line 30
> Thank you,
> Igor
> 
> -----Original Message-----
> From: abner.chang@amd.com <abner.chang@amd.com>
> Sent: Friday, December 23, 2022 7:34 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang <nicklew@nvidia.com>; Igor Kulchytskyy <igork@ami.com>
> Subject: [EXTERNAL] [PATCH 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>
> ---
>  .../IndustryStandard/RedfishHostInterface.h   | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
> b/RedfishPkg/Include/IndustryStandard/RedfishHostInterface.h
> index 49b3ceee39c..5337c3234b2 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) @@ -46,6 +59,12 @@ typedef struct {
>                                             ///< 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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97746): https://edk2.groups.io/g/devel/message/97746
Mute This Topic: https://groups.io/mt/95843861/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-