File lsslot-Add-new-DRC-type-description-strings.patch of Package powerpc-utils.23196

From fe7c23df64d5679a01dfe52eeaae2cfec8cdead1 Mon Sep 17 00:00:00 2001
From: Tyrel Datwyler <tyreld@linux.ibm.com>
Date: Wed, 23 Feb 2022 12:39:37 -0800
Subject: [PATCH] lsslot: Add new DRC type description strings for latest PCIe
 slot types

Upstream: Submitted https://github.com/ibm-power-utilities/powerpc-utils/issues/78

The following Rev 4 and Rev 5 type PCIe slots can be reported by
firmware on machines with such capable slots.

DRC-TYPE	Description
45	A U.2 PCI Express Rev 4 4x lane slot with 2x lanes connected
46	A PCI Express Rev 5 8x lane slot with 1 lane connected
47	A PCI Express Rev 5 8x lane slot with 4x lanes connected
48	A PCI Express Rev 5 8x lane slot with 8x lanes connected
49	A PCI Express Rev 5 16x lane slot with 1 lane connected
50	A PCI Express Rev 5 16x lane slot with 4x lanes connected
51	A PCI Express Rev 5 16x lane slot with 8x lanes connected
52	A U.2 PCI Express Rev 5 4x lane slot with 2x lanes connected
53	A U.2 PCI Express Rev 5 4x lane slot with 4x lanes connected

Currently, the lsslot utility reports "Unknown" for the description of
these pci devices. Update the php_slot_type_msg[] with these new slot
descriptions so that lsslot correctly reports them.

Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
 src/drmgr/common.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/drmgr/common.c b/src/drmgr/common.c
index ccc62a3..1f2168d 100644
--- a/src/drmgr/common.c
+++ b/src/drmgr/common.c
@@ -984,6 +984,15 @@ char *php_slot_type_msg[]={
 	"PCI-E capable, Rev 4, 16x lanes with 16x lanes connected",
 	"U.2 PCI-E capable, Rev 3, 4x lanes with 4x lanes connected",
 	"U.2 PCI-E capable, Rev 4, 4x lanes with 4x lanes connected",
+	"U.2 PCI-E capable, Rev 4, 4x lanes with 2x lanes connected", 	/* 45 */
+	"PCI-E capable, Rev 5, 8x lanes with 1 lane connected",
+	"PCI-E capable, Rev 5, 8x lanes with 4x lanes connected",
+	"PCI-E capable, Rev 5, 8x lanes with 8x lanes connected",
+	"PCI-E capable, Rev 5, 16x lanes with 1 lane connected",
+	"PCI-E capable, Rev 5, 16x lanes with 4x lanes connected",	/* 50 */
+	"PCI-E capable, Rev 5, 16x lanes with 8x lanes connected",
+	"U.2 PCI-E capable, Rev 5, 4x lanes with 2x lanes connected",
+	"U.2 PCI-E capable, Rev 5, 4x lanes with 4x lanes connected",
 };
 
 char *
@@ -994,7 +1003,7 @@ node_type(struct dr_node *node)
 
 	desc_msg_num = atoi(node->drc_type);
 	if ((desc_msg_num >= 1 &&  desc_msg_num <= 8) ||
-	    (desc_msg_num >= 11 && desc_msg_num <= 44))
+	    (desc_msg_num >= 11 && desc_msg_num <= 53))
 		desc = php_slot_type_msg[desc_msg_num];
 	else {
 		switch (node->dev_type) {
-- 
2.35.1

openSUSE Build Service is sponsored by