public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2] RedfishPkg: RedfishDiscoverDxe: USB Redfish host interface is not supported
@ 2022-08-10 20:11 Igor Kulchytskyy
  2022-08-12  5:28 ` Chang, Abner
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Kulchytskyy @ 2022-08-10 20:11 UTC (permalink / raw)
  To: devel@edk2.groups.io
  Cc: Abner.Chang@amd.com, nickle.wang@hpe.com, Igor Kulchytskyy,
	Abner Chang

Host Interface details are described by the SMBIOS Type 43 table.
The table is published by the RedfishHostInterfaceDxe driver.
That driver supports PCI-E and USB host interface types.
The table is comsumed by the RedfishGetHostInterfaceProtocolData function
in the RedfishDiscoverDxe driver.
The function only supports PCI-E interface.

Cc: Abner Chang <abner.chang@amd.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Signed-off-by: Igor Kulchytskyy <igork@ami.com>
---
 RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
index d79750b..636a1ac 100644
--- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
+++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
@@ -65,10 +65,15 @@ RedfishGetHostInterfaceProtocolData (
         RecordTmp       = (UINT8 *)Record + Offset;

         //
-        // Check Device Type, only PCI/PCIe Network Interface v2 is supported now.
+        // Check Device Type, PCI/PCIe and USB Network Interface v2 is supported.
         //
-        if (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
-          ASSERT (SpecificDataLen == sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
+        if ((*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) || (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) {
+          if (*RecordTmp == REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2){
+              ASSERT (SpecificDataLen == sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
+          }
+          else{
+              ASSERT (SpecificDataLen > sizeof (REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) + 1);
+          }
           *DeviceDescriptor = (REDFISH_INTERFACE_DATA *)RecordTmp;
           Offset            = Offset + SpecificDataLen;
           RecordTmp         = (UINT8 *)Record + Offset;
--
2.6.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] 2+ messages in thread

* Re: [PATCH V2] RedfishPkg: RedfishDiscoverDxe: USB Redfish host interface is not supported
  2022-08-10 20:11 [PATCH V2] RedfishPkg: RedfishDiscoverDxe: USB Redfish host interface is not supported Igor Kulchytskyy
@ 2022-08-12  5:28 ` Chang, Abner
  0 siblings, 0 replies; 2+ messages in thread
From: Chang, Abner @ 2022-08-12  5:28 UTC (permalink / raw)
  To: Igor Kulchytskyy, devel@edk2.groups.io; +Cc: nickle.wang@hpe.com

[AMD Official Use Only - General]

Three comments inline to coding standard.

> -----Original Message-----
> From: Igor Kulchytskyy <igork@ami.com>
> Sent: Thursday, August 11, 2022 4:11 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; nickle.wang@hpe.com; Igor
> Kulchytskyy <igork@ami.com>; Chang, Abner <Abner.Chang@amd.com>
> Subject: [PATCH V2] RedfishPkg: RedfishDiscoverDxe: USB Redfish host
> interface is not supported
> 
> [CAUTION: External Email]
> 
> Host Interface details are described by the SMBIOS Type 43 table.
> The table is published by the RedfishHostInterfaceDxe driver.
> That driver supports PCI-E and USB host interface types.
> The table is comsumed by the RedfishGetHostInterfaceProtocolData
> function in the RedfishDiscoverDxe driver.
> The function only supports PCI-E interface.
> 
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> Signed-off-by: Igor Kulchytskyy <igork@ami.com>
> ---
>  RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c | 11
> ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
> b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
> index d79750b..636a1ac 100644
> --- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
> +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c
> @@ -65,10 +65,15 @@ RedfishGetHostInterfaceProtocolData (
>          RecordTmp       = (UINT8 *)Record + Offset;
> 
>          //
> -        // Check Device Type, only PCI/PCIe Network Interface v2 is supported
> now.
> +        // Check Device Type, PCI/PCIe and USB Network Interface v2 is
> supported.
>          //
> -        if (*RecordTmp ==
> REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) {
> -          ASSERT (SpecificDataLen == sizeof
> (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
> +        if ((*RecordTmp ==
> REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) || (*RecordTmp ==
> REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) {
> +          if (*RecordTmp ==
> REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2){
Space between ')'. and '{'.

> +              ASSERT (SpecificDataLen == sizeof
> (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1);
> +          }
Please have 'else' share the same line with '}'
> +          else{
Please have space between 'else' and '{'.

Thanks
Abner

> +              ASSERT (SpecificDataLen > sizeof
> (REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) + 1);
> +          }
>            *DeviceDescriptor = (REDFISH_INTERFACE_DATA *)RecordTmp;
>            Offset            = Offset + SpecificDataLen;
>            RecordTmp         = (UINT8 *)Record + Offset;
> --
> 2.6.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	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-12  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-10 20:11 [PATCH V2] RedfishPkg: RedfishDiscoverDxe: USB Redfish host interface is not supported Igor Kulchytskyy
2022-08-12  5:28 ` Chang, Abner

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