[Open-FCoE] [RFC PATCH] libhbalinux: Support description string for unknown HBA

Steve Ma steve.ma at intel.com
Wed Apr 15 19:45:42 UTC 2009


For new HBA that have not had a description in the pci.ids file,
the description will be shown as Unknown in the "fcoeadm -i"
output. This patch is to show the following string instead of
"Unknown": [<A>:<B>]-[<C>:<D>]-(<E>)
where A = vendor_id, B = device_id, C = subsystem_vendor_id,
D = subsystem_device_id, E = device_class
---

 lport.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lport.c b/lport.c
index 7b46f83..7b1b18a 100644
--- a/lport.c
+++ b/lport.c
@@ -358,6 +358,14 @@ sysfs_scan(struct dirent *dp, void *arg)
 	sa_strncpy_safe(atp->ModelDescription, sizeof(atp->ModelDescription),
 			hba_info.ModelDescription,
 			sizeof(hba_info.ModelDescription));
+	if (!strncmp(hba_info.ModelDescription, "Unknown",
+		 sizeof(hba_info.ModelDescription))) {
+		snprintf(atp->ModelDescription, sizeof(atp->ModelDescription),
+			"[%04x:%04x]-[%04x:%04x]-(%04x)",
+			hba_info.vendor_id, hba_info.device_id,
+			hba_info.subsystem_vendor_id, hba_info.subsystem_device_id,
+			hba_info.device_class);
+	}
 
 	/* Get HardwareVersion */
 	sa_strncpy_safe(atp->HardwareVersion, sizeof(atp->HardwareVersion),




More information about the devel mailing list