aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README2
-rw-r--r--common.c4
-rw-r--r--lib/access.c4
-rw-r--r--lib/aix-device.c4
-rw-r--r--lib/caps.c4
-rw-r--r--lib/darwin.c4
-rw-r--r--lib/dump.c4
-rw-r--r--lib/ecam.c4
-rw-r--r--lib/emulated.c4
-rw-r--r--lib/fbsd-device.c4
-rw-r--r--lib/filter.c4
-rw-r--r--lib/generic.c4
-rw-r--r--lib/header.h18
-rw-r--r--lib/hurd.c4
-rw-r--r--lib/i386-io-beos.h4
-rw-r--r--lib/i386-io-cygwin.h4
-rw-r--r--lib/i386-io-djgpp.h4
-rw-r--r--lib/i386-io-haiku.h4
-rw-r--r--lib/i386-io-hurd.h4
-rw-r--r--lib/i386-io-linux.h4
-rw-r--r--lib/i386-io-sunos.h4
-rw-r--r--lib/i386-io-windows.h4
-rw-r--r--lib/i386-ports.c4
-rw-r--r--lib/init.c4
-rw-r--r--lib/internal.h4
-rw-r--r--lib/mmio-ports.c4
-rw-r--r--lib/names-cache.c4
-rw-r--r--lib/names-hash.c4
-rw-r--r--lib/names-hwdb.c4
-rw-r--r--lib/names-net.c4
-rw-r--r--lib/names-parse.c4
-rw-r--r--lib/names.c4
-rw-r--r--lib/names.h4
-rw-r--r--lib/nbsd-libpci.c4
-rw-r--r--lib/obsd-device.c4
-rw-r--r--lib/params.c4
-rw-r--r--lib/pci.h4
-rw-r--r--lib/pread.h4
-rw-r--r--lib/proc.c4
-rw-r--r--lib/sylixos-device.c8
-rw-r--r--lib/sysdep.h4
-rw-r--r--lib/sysfs.c6
-rw-r--r--lib/types.h4
-rw-r--r--lib/win32-cfgmgr32.c4
-rw-r--r--lib/win32-kldbg.c4
-rw-r--r--lib/win32-sysdbg.c4
-rw-r--r--ls-caps-vendor.c10
-rw-r--r--ls-caps.c28
-rw-r--r--ls-ecaps.c23
-rw-r--r--ls-kernel.c4
-rw-r--r--ls-map.c4
-rw-r--r--ls-tree.c4
-rw-r--r--ls-vpd.c4
-rw-r--r--lspci.c4
-rw-r--r--lspci.h4
-rw-r--r--pciutils.h4
-rw-r--r--setpci.c4
-rw-r--r--setpci.man2
-rw-r--r--tests/pri-pasid325
-rwxr-xr-xupdate-pciids.sh51
61 files changed, 575 insertions, 100 deletions
diff --git a/Makefile b/Makefile
index 0e878a6..228cb56 100644
--- a/Makefile
+++ b/Makefile
@@ -103,7 +103,7 @@ lspci$(EXEEXT): LDLIBS+=$(LIBKMOD_LIBS)
ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
update-pciids: update-pciids.sh
- sed <$< >$@ "s@^DEST=.*@DEST=$(if $(IDSDIR),$(IDSDIR)/,)$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
+ sed <$< >$@ "s@^DEST=.*@DEST=$(if $(IDSDIR),$(IDSDIR)/,)$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@;s@VERSION=.*@VERSION=$(VERSION)@"
chmod +x $@
# The example of use of libpci
diff --git a/README b/README
index 1a981c2..04e9348 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
This package contains the PCI Utilities, version @VERSION@.
-Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
+Copyright (c) 1997--2023 Martin Mares <mj@ucw.cz>
All files in this package can be freely distributed and used according
to the terms of the GNU General Public License, either version 2 or
diff --git a/common.c b/common.c
index 3d69dd0..748e5a4 100644
--- a/common.c
+++ b/common.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2016 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/access.c b/lib/access.c
index b8fdbe2..7d66123 100644
--- a/lib/access.c
+++ b/lib/access.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/aix-device.c b/lib/aix-device.c
index 9355395..028d92a 100644
--- a/lib/aix-device.c
+++ b/lib/aix-device.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1999 Jari Kirma <kirma@cs.hut.fi>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
diff --git a/lib/caps.c b/lib/caps.c
index 039c86f..cf1df5d 100644
--- a/lib/caps.c
+++ b/lib/caps.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <string.h>
diff --git a/lib/darwin.c b/lib/darwin.c
index 9167393..8ae9008 100644
--- a/lib/darwin.c
+++ b/lib/darwin.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2013 Apple, Inc.
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <errno.h>
diff --git a/lib/dump.c b/lib/dump.c
index c0f9291..8b7320a 100644
--- a/lib/dump.c
+++ b/lib/dump.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/ecam.c b/lib/ecam.c
index aa3b60a..961e416 100644
--- a/lib/ecam.c
+++ b/lib/ecam.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2023 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
diff --git a/lib/emulated.c b/lib/emulated.c
index d15c8f7..92cd06e 100644
--- a/lib/emulated.c
+++ b/lib/emulated.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2022 Pali Rohár
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "internal.h"
diff --git a/lib/fbsd-device.c b/lib/fbsd-device.c
index 604c8f0..2ea5e84 100644
--- a/lib/fbsd-device.c
+++ b/lib/fbsd-device.c
@@ -5,7 +5,9 @@
* Updated in 2003 by Samy Al Bahra <samy@kerneled.com>
* Updated in 2017 by Imre Vadász <imrevdsz@gmail.com>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <errno.h>
diff --git a/lib/filter.c b/lib/filter.c
index 86486d3..0301f49 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1998--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdlib.h>
diff --git a/lib/generic.c b/lib/generic.c
index 6211c90..f7340a2 100644
--- a/lib/generic.c
+++ b/lib/generic.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <string.h>
diff --git a/lib/header.h b/lib/header.h
index 332c97b..2bace93 100644
--- a/lib/header.h
+++ b/lib/header.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2010 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
@@ -252,6 +254,7 @@
#define PCI_EXT_CAP_ID_LMR 0x27 /* Lane Margining at Receiver */
#define PCI_EXT_CAP_ID_HIER_ID 0x28 /* Hierarchy ID */
#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */
+#define PCI_EXT_CAP_ID_32GT 0x2a /* Physical Layer 32.0 GT/s */
#define PCI_EXT_CAP_ID_DOE 0x2e /* Data Object Exchange */
/*** Definitions of capabilities ***/
@@ -900,9 +903,13 @@
#define PCI_EXP_DEVCTL2_ARI 0x0020 /* ARI Forwarding */
#define PCI_EXP_DEVCTL2_ATOMICOP_REQUESTER_EN 0x0040 /* AtomicOp RequesterEnable */
#define PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK 0x0080 /* AtomicOp Egress Blocking */
+#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */
+#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */
#define PCI_EXP_DEVCTL2_LTR 0x0400 /* LTR enabled */
+#define PCI_EXP_DEVCTL2_EPR_REQ 0x0800 /* Emergency Power Reduction Request */
#define PCI_EXP_DEVCTL2_10BIT_TAG_REQ 0x1000 /* 10 Bit Tag Requester enabled */
#define PCI_EXP_DEVCTL2_OBFF(x) (((x) >> 13) & 3) /* OBFF enabled */
+#define PCI_EXP_DEVCTL2_EE_TLP_BLK 0x8000 /* End-End TLP Prefix Blocking */
#define PCI_EXP_DEVSTA2 0x2a /* Device Status */
#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities */
#define PCI_EXP_LNKCAP2_SPEED(x) (((x) >> 1) & 0x7f)
@@ -1312,9 +1319,10 @@
#define PCI_PRI_CTRL_ENABLE 0x01 /* Enable */
#define PCI_PRI_CTRL_RESET 0x02 /* Reset */
#define PCI_PRI_STATUS 0x06 /* PRI status register */
-#define PCI_PRI_STATUS_RF 0x001 /* Response Failure */
-#define PCI_PRI_STATUS_UPRGI 0x002 /* Unexpected PRG index */
-#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
+#define PCI_PRI_STATUS_RF 0x0001 /* Response Failure */
+#define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */
+#define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */
+#define PCI_PRI_STATUS_PASID 0x8000 /* PASID required in PRG response */
#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
@@ -1403,7 +1411,7 @@
#define PCI_DOE_STS 0xC /* DOE Status Register */
#define PCI_DOE_STS_BUSY 0x1 /* DOE Busy */
#define PCI_DOE_STS_INT 0x2 /* DOE Interrupt Status */
-#define PCI_DOE_STS_ERROR 0x3 /* DOE Error */
+#define PCI_DOE_STS_ERROR 0x4 /* DOE Error */
#define PCI_DOE_STS_OBJECT_READY 0x80000000 /* Data Object Ready */
/*
diff --git a/lib/hurd.c b/lib/hurd.c
index c5a381e..a9c9b89 100644
--- a/lib/hurd.c
+++ b/lib/hurd.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2017 Joan Lledó <jlledom@member.fsf.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define _GNU_SOURCE
diff --git a/lib/i386-io-beos.h b/lib/i386-io-beos.h
index 15f391b..49b7094 100644
--- a/lib/i386-io-beos.h
+++ b/lib/i386-io-beos.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 2009 Francois Revol <revol@free.fr>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/* those are private syscalls */
diff --git a/lib/i386-io-cygwin.h b/lib/i386-io-cygwin.h
index a8501cc..0b71d16 100644
--- a/lib/i386-io-cygwin.h
+++ b/lib/i386-io-cygwin.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <sys/io.h>
diff --git a/lib/i386-io-djgpp.h b/lib/i386-io-djgpp.h
index 53f2f4e..bb29526 100644
--- a/lib/i386-io-djgpp.h
+++ b/lib/i386-io-djgpp.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 2010, 2017 Rudolf Marek <r.marek@assembler.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <pc.h>
diff --git a/lib/i386-io-haiku.h b/lib/i386-io-haiku.h
index dd00941..ce5362b 100644
--- a/lib/i386-io-haiku.h
+++ b/lib/i386-io-haiku.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 2009 Francois Revol <revol@free.fr>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <Drivers.h>
diff --git a/lib/i386-io-hurd.h b/lib/i386-io-hurd.h
index 000fd42..d44b2f5 100644
--- a/lib/i386-io-hurd.h
+++ b/lib/i386-io-hurd.h
@@ -7,7 +7,9 @@
* Thomas Schwinge <tschwinge@gnu.org>
* Copyright (c) 2007 Thomas Schwinge <tschwinge@gnu.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <sys/io.h>
diff --git a/lib/i386-io-linux.h b/lib/i386-io-linux.h
index a2fd69e..e6bb9b6 100644
--- a/lib/i386-io-linux.h
+++ b/lib/i386-io-linux.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <sys/io.h>
diff --git a/lib/i386-io-sunos.h b/lib/i386-io-sunos.h
index 903ad7c..86948d9 100644
--- a/lib/i386-io-sunos.h
+++ b/lib/i386-io-sunos.h
@@ -4,7 +4,9 @@
* Copyright (c) 2003 Bill Moore <billm@eng.sun.com>
* Copyright (c) 2003--2006 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <sys/sysi86.h>
diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h
index 6bb578c..fd1a54e 100644
--- a/lib/i386-io-windows.h
+++ b/lib/i386-io-windows.h
@@ -5,7 +5,9 @@
* Copyright (c) 2006 Martin Mares <mj@ucw.cz>
* Copyright (c) 2021 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <io.h>
diff --git a/lib/i386-ports.c b/lib/i386-ports.c
index 0ca87dd..1e2c402 100644
--- a/lib/i386-ports.c
+++ b/lib/i386-ports.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define _GNU_SOURCE
diff --git a/lib/init.c b/lib/init.c
index fe40f91..3476681 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/internal.h b/lib/internal.h
index ebd16f4..00ac401 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
diff --git a/lib/mmio-ports.c b/lib/mmio-ports.c
index a9e23c3..f380cb3 100644
--- a/lib/mmio-ports.c
+++ b/lib/mmio-ports.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2022 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
diff --git a/lib/names-cache.c b/lib/names-cache.c
index ba5de6d..65bfb85 100644
--- a/lib/names-cache.c
+++ b/lib/names-cache.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2008--2009 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "internal.h"
diff --git a/lib/names-hash.c b/lib/names-hash.c
index 2f5bc3c..8c75676 100644
--- a/lib/names-hash.c
+++ b/lib/names-hash.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <string.h>
diff --git a/lib/names-hwdb.c b/lib/names-hwdb.c
index 171723b..71e7229 100644
--- a/lib/names-hwdb.c
+++ b/lib/names-hwdb.c
@@ -4,7 +4,9 @@
* Copyright (c) 2013--2014 Tom Gundersen <teg@jklm.no>
* Copyright (c) 2014 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <string.h>
diff --git a/lib/names-net.c b/lib/names-net.c
index 95a6fd2..14141f4 100644
--- a/lib/names-net.c
+++ b/lib/names-net.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2007--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <string.h>
diff --git a/lib/names-parse.c b/lib/names-parse.c
index c86f8af..f50b8ec 100644
--- a/lib/names-parse.c
+++ b/lib/names-parse.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/names.c b/lib/names.c
index a4314f6..f8d3997 100644
--- a/lib/names.c
+++ b/lib/names.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2014 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/names.h b/lib/names.h
index d7e71ff..b34e3e6 100644
--- a/lib/names.h
+++ b/lib/names.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2014 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define MAX_LINE 1024
diff --git a/lib/nbsd-libpci.c b/lib/nbsd-libpci.c
index 2b2ca41..0f9f27b 100644
--- a/lib/nbsd-libpci.c
+++ b/lib/nbsd-libpci.c
@@ -6,7 +6,9 @@
* Copyright (c) 2002 Quentin Garnier <cube@cubidou.net>
* Copyright (c) 2002 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
diff --git a/lib/obsd-device.c b/lib/obsd-device.c
index 71cde5e..e2e7652 100644
--- a/lib/obsd-device.c
+++ b/lib/obsd-device.c
@@ -3,7 +3,9 @@
*
* Adapted from fbsd-device.c by Matthieu Herrb <matthieu.herrb@laas.fr>, 2006
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <fcntl.h>
diff --git a/lib/params.c b/lib/params.c
index 979fb16..ac756ad 100644
--- a/lib/params.c
+++ b/lib/params.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2008--2023 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lib/pci.h b/lib/pci.h
index cb032a1..2322bf7 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2023 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _PCI_LIB_H
diff --git a/lib/pread.h b/lib/pread.h
index 3db90e3..99a91b2 100644
--- a/lib/pread.h
+++ b/lib/pread.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
diff --git a/lib/proc.c b/lib/proc.c
index 9b33863..2eb5dc5 100644
--- a/lib/proc.c
+++ b/lib/proc.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define _GNU_SOURCE
diff --git a/lib/sylixos-device.c b/lib/sylixos-device.c
index 07195d5..170ae02 100644
--- a/lib/sylixos-device.c
+++ b/lib/sylixos-device.c
@@ -1,9 +1,11 @@
/*
- * The PCI Library -- Direct Configuration access via SylixOS Ports
+ * The PCI Library -- Direct Configuration access via SylixOS Ports
*
- * Copyright (c) 2018 YuJian.Gong <gongyujian@acoinfo.com>
+ * Copyright (c) 2018 YuJian.Gong <gongyujian@acoinfo.com>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define _GNU_SOURCE
diff --git a/lib/sysdep.h b/lib/sysdep.h
index bdeb34a..7502035 100644
--- a/lib/sysdep.h
+++ b/lib/sysdep.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2020 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifdef __GNUC__
diff --git a/lib/sysfs.c b/lib/sysfs.c
index ffa4f9d..1bb4ae9 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -4,7 +4,9 @@
* Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx>
* Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define _GNU_SOURCE
@@ -564,7 +566,7 @@ static int sysfs_write(struct pci_dev *d, int pos, byte *buf, int len)
/* pread() is not available and do_read() only works for a single fd, so we
* cannot implement read_vpd properly. */
-static int sysfs_read_vpd(struct pci_dev *d, int pos, byte *buf, int len)
+static int sysfs_read_vpd(struct pci_dev *d UNUSED, int pos UNUSED, byte *buf UNUSED, int len UNUSED)
{
return 0;
}
diff --git a/lib/types.h b/lib/types.h
index ab53f7c..2004906 100644
--- a/lib/types.h
+++ b/lib/types.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <sys/types.h>
diff --git a/lib/win32-cfgmgr32.c b/lib/win32-cfgmgr32.c
index 9743002..0bcc0aa 100644
--- a/lib/win32-cfgmgr32.c
+++ b/lib/win32-cfgmgr32.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2021 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <windows.h>
diff --git a/lib/win32-kldbg.c b/lib/win32-kldbg.c
index 4c8ee54..9593a05 100644
--- a/lib/win32-kldbg.c
+++ b/lib/win32-kldbg.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2022 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <windows.h>
diff --git a/lib/win32-sysdbg.c b/lib/win32-sysdbg.c
index 5d0c07a..6b17f37 100644
--- a/lib/win32-sysdbg.c
+++ b/lib/win32-sysdbg.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2022 Pali Rohár <pali@kernel.org>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <windows.h>
diff --git a/ls-caps-vendor.c b/ls-caps-vendor.c
index dc24f90..62ee586 100644
--- a/ls-caps-vendor.c
+++ b/ls-caps-vendor.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 2014 Gerd Hoffmann <kraxel@redhat.com>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
@@ -62,11 +64,11 @@ show_vendor_caps_virtio(struct device *d, int where, int cap)
static int
do_show_vendor_caps(struct device *d, int where, int cap)
{
- switch (get_conf_word(d, PCI_VENDOR_ID))
+ switch (d->dev->vendor_id)
{
case 0x1af4: /* Red Hat */
- if (get_conf_word(d, PCI_DEVICE_ID) >= 0x1000 &&
- get_conf_word(d, PCI_DEVICE_ID) <= 0x107f)
+ if (d->dev->device_id >= 0x1000 &&
+ d->dev->device_id <= 0x107f)
return show_vendor_caps_virtio(d, where, cap);
break;
}
diff --git a/ls-caps.c b/ls-caps.c
index a481b16..2c99812 100644
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
@@ -839,7 +841,7 @@ static void cap_express_link(struct device *d, int where, int type)
if ((type == PCI_EXP_TYPE_ROOT_PORT) || (type == PCI_EXP_TYPE_ENDPOINT) ||
(type == PCI_EXP_TYPE_LEG_END) || (type == PCI_EXP_TYPE_PCI_BRIDGE))
printf(" RCB %d bytes,", w & PCI_EXP_LNKCTL_RCB ? 128 : 64);
- printf(" Disabled%c CommClk%c\n\t\t\tExtSynch%c ClockPM%c AutWidDis%c BWInt%c AutBWInt%c\n",
+ printf(" LnkDisable%c CommClk%c\n\t\t\tExtSynch%c ClockPM%c AutWidDis%c BWInt%c AutBWInt%c\n",
FLAG(w, PCI_EXP_LNKCTL_DISABLE),
FLAG(w, PCI_EXP_LNKCTL_CLOCK),
FLAG(w, PCI_EXP_LNKCTL_XSYNCH),
@@ -1151,12 +1153,9 @@ static void cap_express_dev2(struct device *d, int where, int type)
}
w = get_conf_word(d, where + PCI_EXP_DEVCTL2);
- printf("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c LTR%c 10BitTagReq%c OBFF %s,",
+ printf("\t\tDevCtl2: Completion Timeout: %s, TimeoutDis%c",
cap_express_dev2_timeout_value(PCI_EXP_DEVCTL2_TIMEOUT_VALUE(w)),
- FLAG(w, PCI_EXP_DEVCTL2_TIMEOUT_DIS),
- FLAG(w, PCI_EXP_DEVCTL2_LTR),
- FLAG(w, PCI_EXP_DEVCTL2_10BIT_TAG_REQ),
- cap_express_devctl2_obff(PCI_EXP_DEVCTL2_OBFF(w)));
+ FLAG(w, PCI_EXP_DEVCTL2_TIMEOUT_DIS));
if (type == PCI_EXP_TYPE_ROOT_PORT || type == PCI_EXP_TYPE_DOWNSTREAM)
printf(" ARIFwd%c\n", FLAG(w, PCI_EXP_DEVCTL2_ARI));
else
@@ -1174,6 +1173,15 @@ static void cap_express_dev2(struct device *d, int where, int type)
printf(" EgressBlck%c", FLAG(w, PCI_EXP_DEVCTL2_ATOMICOP_EGRESS_BLOCK));
printf("\n");
}
+ printf("\t\t\t IDOReq%c IDOCompl%c LTR%c EmergencyPowerReductionReq%c\n",
+ FLAG(w, PCI_EXP_DEVCTL2_IDO_REQ_EN),
+ FLAG(w, PCI_EXP_DEVCTL2_IDO_CMP_EN),
+ FLAG(w, PCI_EXP_DEVCTL2_LTR),
+ FLAG(w, PCI_EXP_DEVCTL2_EPR_REQ));
+ printf("\t\t\t 10BitTagReq%c OBFF %s, EETLPPrefixBlk%c\n",
+ FLAG(w, PCI_EXP_DEVCTL2_10BIT_TAG_REQ),
+ cap_express_devctl2_obff(PCI_EXP_DEVCTL2_OBFF(w)),
+ FLAG(w, PCI_EXP_DEVCTL2_EE_TLP_BLK));
}
static const char *cap_express_link2_speed_cap(int vector)
@@ -1183,8 +1191,10 @@ static const char *cap_express_link2_speed_cap(int vector)
* permitted to skip support for any data rates between 2.5GT/s and the
* highest supported rate.
*/
- if (vector & 0x60)
+ if (vector & 0x40)
return "RsvdP";
+ if (vector & 0x20)
+ return "2.5-64GT/s";
if (vector & 0x10)
return "2.5-32GT/s";
if (vector & 0x08)
@@ -1428,7 +1438,7 @@ cap_express(struct device *d, int where, int cap)
default:
printf("Unknown type %d", type);
}
- printf(", MSI %02x\n", (cap & PCI_EXP_FLAGS_IRQ) >> 9);
+ printf(", IntMsgNum %d\n", (cap & PCI_EXP_FLAGS_IRQ) >> 9);
if (verbose < 2)
return type;
diff --git a/ls-ecaps.c b/ls-ecaps.c
index f58a5ff..77381c9 100644
--- a/ls-ecaps.c
+++ b/ls-ecaps.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2022 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
@@ -189,7 +191,7 @@ cap_aer(struct device *d, int where, int type)
l = get_conf_long(d, where + PCI_ERR_ROOT_STATUS);
printf("\t\tRootSta: CERcvd%c MultCERcvd%c UERcvd%c MultUERcvd%c\n"
- "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsg %d\n",
+ "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsgNum %d\n",
FLAG(l, PCI_ERR_ROOT_COR_RCV),
FLAG(l, PCI_ERR_ROOT_MULTI_COR_RCV),
FLAG(l, PCI_ERR_ROOT_UNCOR_RCV),
@@ -219,7 +221,7 @@ static void cap_dpc(struct device *d, int where)
return;
l = get_conf_word(d, where + PCI_DPC_CAP);
- printf("\t\tDpcCap:\tINT Msg #%d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n",
+ printf("\t\tDpcCap:\tIntMsgNum %d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n",
PCI_DPC_CAP_INT_MSG(l), FLAG(l, PCI_DPC_CAP_RP_EXT), FLAG(l, PCI_DPC_CAP_TLP_BLOCK),
FLAG(l, PCI_DPC_CAP_SW_TRIGGER), PCI_DPC_CAP_RP_LOG(l), FLAG(l, PCI_DPC_CAP_DL_ACT_ERR));
@@ -322,9 +324,9 @@ cap_pri(struct device *d, int where)
printf("\t\tPRICtl: Enable%c Reset%c\n",
FLAG(w, PCI_PRI_CTRL_ENABLE), FLAG(w, PCI_PRI_CTRL_RESET));
w = get_conf_word(d, where + PCI_PRI_STATUS);
- printf("\t\tPRISta: RF%c UPRGI%c Stopped%c\n",
+ printf("\t\tPRISta: RF%c UPRGI%c Stopped%c PASID%c\n",
FLAG(w, PCI_PRI_STATUS_RF), FLAG(w, PCI_PRI_STATUS_UPRGI),
- FLAG(w, PCI_PRI_STATUS_STOPPED));
+ FLAG(w, PCI_PRI_STATUS_STOPPED), FLAG(w, PCI_PRI_STATUS_PASID));
l = get_conf_long(d, where + PCI_PRI_MAX_REQ);
printf("\t\tPage Request Capacity: %08x, ", l);
l = get_conf_long(d, where + PCI_PRI_ALLOC_REQ);
@@ -369,7 +371,7 @@ cap_sriov(struct device *d, int where)
return;
l = get_conf_long(d, where + PCI_IOV_CAP);
- printf("\t\tIOVCap:\tMigration%c 10BitTagReq%c Interrupt Message Number: %03x\n",
+ printf("\t\tIOVCap:\tMigration%c 10BitTagReq%c IntMsgNum %d\n",
FLAG(l, PCI_IOV_CAP_VFM), FLAG(l, PCI_IOV_CAP_VF_10BIT_TAG_REQ), PCI_IOV_CAP_IMN(l));
w = get_conf_word(d, where + PCI_IOV_CTRL);
printf("\t\tIOVCtl:\tEnable%c Migration%c Interrupt%c MSE%c ARIHierarchy%c 10BitTagReq%c\n",
@@ -1310,7 +1312,7 @@ cap_ptm(struct device *d, int where)
buff = get_conf_long(d, where + 4);
printf("\t\tPTMCap: ");
- printf("Requester:%c Responder:%c Root:%c\n",
+ printf("Requester%c Responder%c Root%c\n",
FLAG(buff, 0x1),
FLAG(buff, 0x2),
FLAG(buff, 0x4));
@@ -1331,7 +1333,7 @@ cap_ptm(struct device *d, int where)
buff = get_conf_long(d, where + 8);
printf("\t\tPTMControl: ");
- printf("Enabled:%c RootSelected:%c\n",
+ printf("Enabled%c RootSelected%c\n",
FLAG(buff, 0x1),
FLAG(buff, 0x2));
@@ -1459,7 +1461,7 @@ cap_doe(struct device *d, int where)
printf("\t\tDOECap: IntSup%c\n",
FLAG(l, PCI_DOE_CAP_INT_SUPP));
if (l & PCI_DOE_CAP_INT_SUPP)
- printf("\t\t\tInterrupt Message Number %03x\n",
+ printf("\t\t\tIntMsgNum %d\n",
PCI_DOE_CAP_INT_MSG(l));
l = get_conf_long(d, where + PCI_DOE_CTL);
@@ -1621,6 +1623,9 @@ show_ext_caps(struct device *d, int type)
case PCI_EXT_CAP_ID_NPEM:
printf("Native PCIe Enclosure Management <?>\n");
break;
+ case PCI_EXT_CAP_ID_32GT:
+ printf("Physical Layer 32.0 GT/s <?>\n");
+ break;
case PCI_EXT_CAP_ID_DOE:
cap_doe(d, where);
break;
diff --git a/ls-kernel.c b/ls-kernel.c
index b90a469..c939c52 100644
--- a/ls-kernel.c
+++ b/ls-kernel.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2013 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/ls-map.c b/ls-map.c
index 9b2cc8c..a77eb0c 100644
--- a/ls-map.c
+++ b/ls-map.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/ls-tree.c b/ls-tree.c
index e21e44c..5189930 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2021 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdarg.h>
diff --git a/ls-vpd.c b/ls-vpd.c
index 92627e4..fcb80ae 100644
--- a/ls-vpd.c
+++ b/ls-vpd.c
@@ -6,7 +6,9 @@
* Written by Ben Hutchings <bhutchings@solarflare.com>
* Improved by Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lspci.c b/lspci.c
index 0a96260..9452cd3 100644
--- a/lspci.c
+++ b/lspci.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2020 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/lspci.h b/lspci.h
index 160c65a..c5a9ec7 100644
--- a/lspci.h
+++ b/lspci.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#define PCIUTILS_LSPCI
diff --git a/pciutils.h b/pciutils.h
index 17e02c9..95c26e6 100644
--- a/pciutils.h
+++ b/pciutils.h
@@ -3,7 +3,9 @@
*
* Copyright (c) 1997--2018 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "lib/pci.h"
diff --git a/setpci.c b/setpci.c
index ca1f31d..d2df573 100644
--- a/setpci.c
+++ b/setpci.c
@@ -3,7 +3,9 @@
*
* Copyright (c) 1998--2020 Martin Mares <mj@ucw.cz>
*
- * Can be freely distributed and used under the terms of the GNU GPL.
+ * Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <stdio.h>
diff --git a/setpci.man b/setpci.man
index 9e4e1d8..fd4495f 100644
--- a/setpci.man
+++ b/setpci.man
@@ -135,7 +135,7 @@ are hexadecimal numbers. In the latter case, only the bits corresponding to bina
ones in the \fImask\fP are changed (technically, this is a read-modify-write operation).
.PP
-There are several ways how to identity a register:
+There are several ways to identify a register:
.IP \(bu
Tell its address in hexadecimal.
.IP \(bu
diff --git a/tests/pri-pasid b/tests/pri-pasid
new file mode 100644
index 0000000..9fc8c09
--- /dev/null
+++ b/tests/pri-pasid
@@ -0,0 +1,325 @@
+6a:01.0 Class 0880: Device 8086:0b25
+ Subsystem: Device 8086:0000
+ Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-
+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
+ Latency: 0
+ NUMA node: 0
+ IOMMU group: 38
+ Region 0: Memory at 206ffff40000 (64-bit, prefetchable) [size=64K]
+ Region 2: Memory at 206ffff00000 (64-bit, prefetchable) [size=128K]
+ Capabilities: [40] Express (v2) Root Complex Integrated Endpoint, MSI 00
+ DevCap: MaxPayload 512 bytes, PhantFunc 0
+ ExtTag+ RBE+ FLReset+
+ DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq-
+ RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ FLReset-
+ MaxPayload 512 bytes, MaxReadReq 4096 bytes
+ DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
+ DevCap2: Completion Timeout: Not Supported, TimeoutDis+ NROPrPrP- LTR+
+ 10BitTagComp+ 10BitTagReq+ OBFF Not Supported, ExtFmt+ EETLPPrefix+, MaxEETLPPrefixes 1
+ EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
+ FRS-
+ AtomicOpsCap: 32bit- 64bit- 128bitCAS-
+ DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+ LTR- 10BitTagReq+ OBFF Disabled,
+ AtomicOpsCtl: ReqEn-
+ Capabilities: [80] MSI-X: Enable+ Count=9 Masked-
+ Vector table: BAR=0 offset=00002000
+ PBA: BAR=0 offset=00003000
+ Capabilities: [90] Power Management version 3
+ Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
+ Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
+ Capabilities: [100 v2] Advanced Error Reporting
+ UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
+ UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
+ UESvrt: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP+ ECRC- UnsupReq- ACSViol-
+ CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
+ CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
+ AERCap: First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
+ MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
+ HeaderLog: 00000000 00000000 00000000 00000000
+ Capabilities: [150 v1] Latency Tolerance Reporting
+ Max snoop latency: 0ns
+ Max no snoop latency: 0ns
+ Capabilities: [160 v1] Transaction Processing Hints
+ Device specific mode supported
+ Steering table in TPH capability structure
+ Capabilities: [170 v1] Virtual Channel
+ Caps: LPEVC=1 RefClk=100ns PATEntryBits=1
+ Arb: Fixed+ WRR32- WRR64- WRR128-
+ Ctrl: ArbSelect=Fixed
+ Status: InProgress-
+ VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
+ Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
+ Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=fd
+ Status: NegoPending- InProgress-
+ VC1: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
+ Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
+ Ctrl: Enable+ ID=1 ArbSelect=Fixed TC/VC=02
+ Status: NegoPending- InProgress-
+ Capabilities: [200 v1] Designated Vendor-Specific: Vendor=8086 ID=0005 Rev=0 Len=24 <?>
+ Capabilities: [220 v1] Address Translation Service (ATS)
+ ATSCap: Invalidate Queue Depth: 00
+ ATSCtl: Enable+, Smallest Translation Unit: 00
+ Capabilities: [230 v1] Process Address Space ID (PASID)
+ PASIDCap: Exec- Priv+, Max PASID Width: 14
+ PASIDCtl: Enable+ Exec- Priv+
+ Capabilities: [240 v1] Page Request Interface (PRI)
+ PRICtl: Enable- Reset-
+ PRISta: RF- UPRGI- Stopped+ PASID+
+ Page Request Capacity: 00000200, Page Request Allocation: 00000000
+ Kernel driver in use: idxd
+00: 86 80 25 0b 46 01 10 00 00 00 80 08 00 00 00 00
+10: 0c 00 f4 ff 6f 20 00 00 0c 00 f0 ff 6f 20 00 00
+20: 00 00 00 00 00 00 00 00 00 00 00 00 86 80 00 00
+30: 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00
+40: 10 80 92 00 22 80 00 10 57 59 00 00 00 00 00 00
+50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+60: 00 00 00 00 10 08 73 10 10 10 00 00 00 00 00 00
+70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+80: 11 90 08 80 00 20 00 00 00 30 00 00 00 00 00 00
+90: 01 00 03 00 08 00 00 00 00 00 00 00 00 00 00 00
+a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+100: 01 00 02 15 00 00 00 00 00 00 10 00 00 00 04 00
+110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+150: 18 00 01 16 00 00 00 00 00 00 00 00 00 00 00 00
+160: 17 00 01 17 05 02 01 00 02 01 00 00 00 00 0a 00
+170: 02 00 01 20 11 00 00 00 01 00 00 00 00 00 00 00
+180: 00 00 00 00 fd 00 00 80 00 00 00 00 00 00 00 00
+190: 02 00 00 81 00 00 00 00 00 00 00 00 00 00 00 00
+1a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+200: 23 00 01 22 86 80 80 01 05 00 00 00 01 00 00 00
+210: 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
+220: 0f 00 01 23 60 00 00 80 00 00 00 00 00 00 00 00
+230: 1b 00 01 24 04 14 05 00 00 00 00 00 00 00 00 00
+240: 13 00 01 00 00 00 00 81 00 02 00 00 00 00 00 00
+250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+2f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+3f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+4f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+500: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+5f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+6f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+7f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+8f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+aa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+df0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+e90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
diff --git a/update-pciids.sh b/update-pciids.sh
index 929f6af..607502a 100755
--- a/update-pciids.sh
+++ b/update-pciids.sh
@@ -6,6 +6,9 @@ SRC="https://pci-ids.ucw.cz/v2.2/pci.ids"
DEST=pci.ids
PCI_COMPRESSED_IDS=
GREP=grep
+VERSION=unknown
+USER_AGENT=update-pciids/$VERSION
+QUIET=
[ "$1" = "-q" ] && quiet=true || quiet=false
@@ -16,10 +19,9 @@ if ! touch ${DEST} >/dev/null 2>&1 ; then
exit 1
fi
-if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then
- DECOMP="cat"
- SRC="$SRC.gz"
- GREP=zgrep
+if command -v xz >/dev/null 2>&1 ; then
+ DECOMP="xz -d"
+ SRC="$SRC.xz"
elif command -v bzip2 >/dev/null 2>&1 ; then
DECOMP="bzip2 -d"
SRC="$SRC.bz2"
@@ -31,30 +33,39 @@ else
fi
if command -v curl >/dev/null 2>&1 ; then
- DL="curl -o $DEST.new $SRC"
- ${quiet} && DL="$DL -s -S"
+ ${quiet} && QUIET="-s -S"
+ dl ()
+ {
+ curl -o $DEST.new --user-agent "$USER_AGENT curl" $QUIET $SRC
+ }
elif command -v wget >/dev/null 2>&1 ; then
- DL="wget --no-timestamping -O $DEST.new $SRC"
- ${quiet} && DL="$DL -q"
+ ${quiet} && QUIET="-q"
+ dl ()
+ {
+ wget --no-timestamping -O $DEST.new --user-agent "$USER_AGENT wget" $QUIET $SRC
+ }
elif command -v lynx >/dev/null 2>&1 ; then
- DL="eval lynx -source $SRC >$DEST.new"
+ dl ()
+ {
+ lynx -source -useragent="$USER_AGENT lynx" $SRC >$DEST.new
+ }
else
echo >&2 "update-pciids: cannot find curl, wget or lynx"
exit 1
fi
-if ! $DL ; then
+if ! dl ; then
echo >&2 "update-pciids: download failed"
rm -f $DEST.new
exit 1
fi
-if ! $DECOMP <$DEST.new >$DEST.neww ; then
+if ! $DECOMP <$DEST.new >$DEST.new.plain ; then
echo >&2 "update-pciids: decompression failed, probably truncated file"
exit 1
fi
-if ! $GREP >/dev/null "^C " $DEST.neww ; then
+if ! $GREP >/dev/null "^C " $DEST.new.plain ; then
echo >&2 "update-pciids: missing class info, probably truncated file"
exit 1
fi
@@ -62,10 +73,20 @@ fi
if [ -f $DEST ] ; then
ln -f $DEST $DEST.old
# --reference is supported only by chmod from GNU file, so let's ignore any errors
- chmod -f --reference=$DEST.old $DEST.neww 2>/dev/null || true
+ chmod -f --reference=$DEST.old $DEST.new $DEST.new.plain 2>/dev/null || true
+fi
+
+if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then
+ if [ "${SRC%.gz}" != .gz ] ; then
+ # Recompress to gzip
+ gzip <$DEST.new.plain >$DEST.new
+ fi
+ mv $DEST.new $DEST
+ rm -f $DEST.new.plain
+else
+ mv $DEST.new.plain $DEST
+ rm -f $DEST.new
fi
-mv $DEST.neww $DEST
-rm $DEST.new
# Older versions did not compress the ids file, so let's make sure we
# clean that up.