Blob Blame History Raw
From 0ecb16b406007b31cd03f41be106fadfc25078f7 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Thu, 14 Jun 2018 19:17:26 +0200
Subject: [PATCH 04/10] merge Github PR #40 and #41

Properly handle scsi device type 0x14 (== 20) to add ZBC and ZAC host
managed zoned block devices to the "disk" class. While at it, also add
in scsi_type() the missing type name string for the device
type 0xe (== 14).

---
 lshw.spec.in     | 2 +-
 src/core/scsi.cc | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lshw.spec.in b/lshw.spec.in
index c597379..f7f88b3 100644
--- a/lshw.spec.in
+++ b/lshw.spec.in
@@ -12,7 +12,7 @@ Group: Applications/System
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
-lshw (Hardware Lister) is a small tool to provide detailed informaton on
+lshw (Hardware Lister) is a small tool to provide detailed information on
 the hardware configuration of the machine. It can report exact memory
 configuration, firmware version, mainboard configuration, CPU version
 and speed, cache configuration, bus speed, etc. on DMI-capable x86s
diff --git a/src/core/scsi.cc b/src/core/scsi.cc
index b38dda2..a94d18f 100644
--- a/src/core/scsi.cc
+++ b/src/core/scsi.cc
@@ -260,6 +260,10 @@ static const char *scsi_type(int type)
       return "Medium Changer";
     case 0xd:
       return "Enclosure";
+    case 0xe:
+      return "Simplified direct-access device";
+    case 0x14:
+      return "Host managed zoned block device";
     default:
       return "";
   }
@@ -706,6 +710,7 @@ static void scan_sg(hwNode & n)
   {
     case 0:
     case 14:
+    case 20:
       device = hwNode("disk", hw::disk);
       break;
     case 1:
@@ -752,7 +757,8 @@ static void scan_sg(hwNode & n)
   }
   if ((m_id.scsi_type == 4) || (m_id.scsi_type == 5))
     scan_cdrom(device);
-  if ((m_id.scsi_type == 0) || (m_id.scsi_type == 7) || (m_id.scsi_type == 14))
+  if ((m_id.scsi_type == 0) || (m_id.scsi_type == 7) ||
+      (m_id.scsi_type == 14) || (m_id.scsi_type == 20))
     scan_disk(device);
 
   if (!adapter_businfo.empty())
-- 
2.17.1