Module Name: src
Committed By: msaitoh
Date: Mon Jan 31 10:14:55 UTC 2022
Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h
Log Message:
Decode SCSI programming interface. Whitespace fix.
To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.164 -r1.165 src/sys/dev/pci/pcireg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.240 src/sys/dev/pci/pci_subr.c:1.241
--- src/sys/dev/pci/pci_subr.c:1.240 Mon Jan 31 10:11:33 2022
+++ src/sys/dev/pci/pci_subr.c Mon Jan 31 10:14:55 2022
@@ -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_subcla
* 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_interf
/* 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_subcla
{ "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, },
Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.164 src/sys/dev/pci/pcireg.h:1.165
--- src/sys/dev/pci/pcireg.h:1.164 Mon Jan 31 10:11:33 2022
+++ src/sys/dev/pci/pcireg.h Mon Jan 31 10:14:55 2022
@@ -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