summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2022-01-31 10:14:55 +0000
committermsaitoh <msaitoh@NetBSD.org>2022-01-31 10:14:55 +0000
commitbdf84b8b7e4f83234e50a67401b2c064a2a9a195 (patch)
tree8bd848e7730ab181f56e0db0fb6056628f608701 /sys/dev
parenta1462ab2046c544832cdd4c2df9e5001ad799943 (diff)
Decode SCSI programming interface. Whitespace fix.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci_subr.c26
-rw-r--r--sys/dev/pci/pcireg.h7
2 files changed, 25 insertions, 8 deletions
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
index e1888262db5..28dbece8c2a 100644
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_subr.c,v 1.240 2022/01/31 10:11:33 msaitoh Exp $ */
+/* $NetBSD: pci_subr.c,v 1.241 2022/01/31 10:14:55 msaitoh Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.240 2022/01/31 10:11:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.241 2022/01/31 10:14:55 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -155,6 +155,17 @@ static const struct pci_class pci_subclass_prehistoric[] = {
* Mass storage controller
*/
+/* SCSI programming interface */
+static const struct pci_class pci_interface_scsi[] = {
+ { "vendor specifi", PCI_INTERFACE_SCSI_VND, NULL, },
+ { "PQI storage", PCI_INTERFACE_SCSI_PQI_STORAGE, NULL, },
+ { "PQI controller", PCI_INTERFACE_SCSI_PQI_CNTRL, NULL, },
+ { "PQI storage and controller", PCI_INTERFACE_SCSI_PQI_STORAGE_CNTRL,
+ NULL, },
+ { "NVME", PCI_INTERFACE_SCSI_NVME, NULL, },
+ { NULL, 0, NULL, },
+};
+
/* ATA programming interface */
static const struct pci_class pci_interface_ata[] = {
{ "with single DMA", PCI_INTERFACE_ATA_SINGLEDMA, NULL, },
@@ -188,15 +199,16 @@ static const struct pci_class pci_interface_ufs[] = {
/* Subclasses */
static const struct pci_class pci_subclass_mass_storage[] = {
- { "SCSI", PCI_SUBCLASS_MASS_STORAGE_SCSI, NULL, },
+ { "SCSI", PCI_SUBCLASS_MASS_STORAGE_SCSI,
+ pci_interface_scsi },
{ "IDE", PCI_SUBCLASS_MASS_STORAGE_IDE, NULL, },
{ "floppy", PCI_SUBCLASS_MASS_STORAGE_FLOPPY, NULL, },
{ "IPI", PCI_SUBCLASS_MASS_STORAGE_IPI, NULL, },
{ "RAID", PCI_SUBCLASS_MASS_STORAGE_RAID, NULL, },
{ "ATA", PCI_SUBCLASS_MASS_STORAGE_ATA,
- pci_interface_ata, },
+ pci_interface_ata },
{ "SATA", PCI_SUBCLASS_MASS_STORAGE_SATA,
- pci_interface_sata, },
+ pci_interface_sata },
{ "SAS", PCI_SUBCLASS_MASS_STORAGE_SAS, NULL, },
{ "Flash", PCI_SUBCLASS_MASS_STORAGE_NVM,
pci_interface_nvm, },
@@ -310,13 +322,13 @@ static const struct pci_class pci_subclass_bridge[] = {
{ "EISA", PCI_SUBCLASS_BRIDGE_EISA, NULL, },
{ "MicroChannel", PCI_SUBCLASS_BRIDGE_MC, NULL, },
{ "PCI", PCI_SUBCLASS_BRIDGE_PCI,
- pci_interface_pcibridge, },
+ pci_interface_pcibridge },
{ "PCMCIA", PCI_SUBCLASS_BRIDGE_PCMCIA, NULL, },
{ "NuBus", PCI_SUBCLASS_BRIDGE_NUBUS, NULL, },
{ "CardBus", PCI_SUBCLASS_BRIDGE_CARDBUS, NULL, },
{ "RACEway", PCI_SUBCLASS_BRIDGE_RACEWAY, NULL, },
{ "Semi-transparent PCI", PCI_SUBCLASS_BRIDGE_STPCI,
- pci_interface_stpci, },
+ pci_interface_stpci, },
{ "InfiniBand", PCI_SUBCLASS_BRIDGE_INFINIBAND, NULL, },
{ "advanced switching", PCI_SUBCLASS_BRIDGE_ADVSW,
pci_interface_advsw, },
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h
index c82d2864fe3..8f6557c8705 100644
--- a/sys/dev/pci/pcireg.h
+++ b/sys/dev/pci/pcireg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pcireg.h,v 1.164 2022/01/31 10:11:33 msaitoh Exp $ */
+/* $NetBSD: pcireg.h,v 1.165 2022/01/31 10:14:55 msaitoh Exp $ */
/*
* Copyright (c) 1995, 1996, 1999, 2000
@@ -188,6 +188,11 @@ typedef u_int8_t pci_revision_t;
/* 0x01 mass storage subclasses */
#define PCI_SUBCLASS_MASS_STORAGE_SCSI 0x00
+#define PCI_INTERFACE_SCSI_VND 0x00
+#define PCI_INTERFACE_SCSI_PQI_STORAGE 0x11
+#define PCI_INTERFACE_SCSI_PQI_CNTRL 0x12
+#define PCI_INTERFACE_SCSI_PQI_STORAGE_CNTRL 0x13
+#define PCI_INTERFACE_SCSI_NVME 0x21
#define PCI_SUBCLASS_MASS_STORAGE_IDE 0x01
#define PCI_SUBCLASS_MASS_STORAGE_FLOPPY 0x02
#define PCI_SUBCLASS_MASS_STORAGE_IPI 0x03