CVS commit: src/sys/dev/pci/ixgbe

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:43:55 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.

 PCI device ID 0x15c8 also use X557-AT PHY, so create the thermal sensor
sysctl for it, too.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/sys/dev/pci/ixgbe/ixgbe.c

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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.324 src/sys/dev/pci/ixgbe/ixgbe.c:1.325
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.324	Fri Oct 28 01:10:41 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Feb  3 05:43:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.325 2023/02/03 05:43:55 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.325 2023/02/03 05:43:55 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3515,7 +3515,8 @@ ixgbe_add_device_sysctls(struct adapter 
 	}
 
 	/* for X552/X557-AT devices */
-	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) ||
+	(hw->device_id == IXGBE_DEV_ID_X550EM_A_10G_T)) {
 		const struct sysctlnode *phy_node;
 
 		if (sysctl_createv(log, 0, , _node, 0, CTLTYPE_NODE,
@@ -5954,7 +5955,8 @@ ixgbe_sysctl_phy_temp(SYSCTLFN_ARGS)
 	if (ixgbe_fw_recovery_mode_swflag(adapter))
 		return (EPERM);
 
-	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+	(hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)) {
 		device_printf(adapter->dev,
 		"Device has no supported external thermal sensor.\n");
 		return (ENODEV);
@@ -5997,7 +5999,8 @@ ixgbe_sysctl_phy_overtemp_occurred(SYSCT
 	if (ixgbe_fw_recovery_mode_swflag(adapter))
 		return (EPERM);
 
-	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+	if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+	(hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)){
 		device_printf(adapter->dev,
 		"Device has no supported external thermal sensor.\n");
 		return (ENODEV);



CVS commit: src/sys/dev/pci/ixgbe

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:43:55 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.

 PCI device ID 0x15c8 also use X557-AT PHY, so create the thermal sensor
sysctl for it, too.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:32:11 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1458 -r1.1459 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1457 -r1.1458 src/sys/dev/pci/pcidevs_data.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/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1458 src/sys/dev/pci/pcidevs.h:1.1459
--- src/sys/dev/pci/pcidevs.h:1.1458	Sun Jan 29 15:08:02 2023
+++ src/sys/dev/pci/pcidevs.h	Fri Feb  3 05:32:11 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1458 2023/01/29 15:08:02 thorpej Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1459 2023/02/03 05:32:11 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp
+ *	NetBSD: pcidevs,v 1.1478 2023/02/03 05:31:52 msaitoh Exp
  */
 
 /*
@@ -9030,6 +9030,7 @@
 #define	PCI_PRODUCT_SAMSUNGELEC3_SM981	0xa808		/* SM981 M.2 NVMe SSD */
 #define	PCI_PRODUCT_SAMSUNGELEC3_SM980	0xa809		/* SM980 M.2 NVMe SSD */
 #define	PCI_PRODUCT_SAMSUNGELEC3_PM9A1	0xa80a		/* PM9A1 M.2 NVMe SSD */
+#define	PCI_PRODUCT_SAMSUNGELEC3_SM990	0xa80c		/* SM990 M.2 NVMe SSD */
 #define	PCI_PRODUCT_SAMSUNGELEC3_171X	0xa820		/* NVMe SSD Controller 171X */
 #define	PCI_PRODUCT_SAMSUNGELEC3_172X	0xa821		/* NVMe SSD Controller 172X */
 #define	PCI_PRODUCT_SAMSUNGELEC3_172XAB	0xa822		/* NVMe SSD Controller 172Xa/172Xb */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1457 src/sys/dev/pci/pcidevs_data.h:1.1458
--- src/sys/dev/pci/pcidevs_data.h:1.1457	Sun Jan 29 15:08:02 2023
+++ src/sys/dev/pci/pcidevs_data.h	Fri Feb  3 05:32:10 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1457 2023/01/29 15:08:02 thorpej Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1458 2023/02/03 05:32:10 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp
+ *	NetBSD: pcidevs,v 1.1478 2023/02/03 05:31:52 msaitoh Exp
  */
 
 /*
@@ -16359,260 +16359,262 @@ static const uint32_t pci_products[] = {
 	38431, 38409, 7915, 7920, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_PM9A1, 
 	38437, 38409, 7915, 7920, 0,
+	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_SM990, 
+	38443, 38409, 7915, 7920, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_171X, 
-	7915, 7920, 6413, 38443, 0,
+	7915, 7920, 6413, 38449, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_172X, 
-	7915, 7920, 6413, 38448, 0,
+	7915, 7920, 6413, 38454, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_172XAB, 
-	7915, 7920, 6413, 38453, 0,
+	7915, 7920, 6413, 38459, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_PM173X, 
-	7915, 7920, 6413, 38465, 0,
+	7915, 7920, 6413, 38471, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_PM173Xa, 
-	7915, 7920, 6413, 38472, 0,
+	7915, 7920, 6413, 38478, 0,
 	PCI_VENDOR_SAMSUNGELEC3, PCI_PRODUCT_SAMSUNGELEC3_PM174X, 
-	7915, 7920, 6413, 38480, 0,
+	7915, 7920, 6413, 38486, 0,
 	PCI_VENDOR_SAMSUNGSEMI, PCI_PRODUCT_SAMSUNGSEMI_KS8920, 
-	38487, 5777, 5675, 0,
+	38493, 5777, 5675, 0,
 	PCI_VENDOR_SANDBURST, PCI_PRODUCT_SANDBURST_QE1000, 
-	38494, 0,
+	38500, 0,
 	PCI_VENDOR_SANDBURST, PCI_PRODUCT_SANDBURST_FE1000, 
-	38501, 0,
+	38507, 0,
 	PCI_VENDOR_SANDISK, PCI_PRODUCT_SANDISK_WDBLACK_NVME, 
-	38508, 38511, 7915, 7920, 0,
+	38514, 38517, 7915, 7920, 0,
 	PCI_VENDOR_SANDISK, PCI_PRODUCT_SANDISK_WDBLUE_SN550, 
-	38508, 38517, 38522, 7915, 7920, 0,
+	38514, 38523, 38528, 7915, 7920, 0,
 	PCI_VENDOR_SEGA, PCI_PRODUCT_SEGA_BROADBAND, 
-	38528, 5867, 0,
+	38534, 5867, 0,
 	PCI_VENDOR_SERVERENGINES, PCI_PRODUCT_SERVERENGINES_BE2, 
-	38538, 8468, 0,
+	38544, 8468, 0,
 	PCI_VENDOR_SERVERENGINES, PCI_PRODUCT_SERVERENGINES_BE3, 
-	38551, 8468, 0,
+	38557, 8468, 0,
 	PCI_VENDOR_SERVERENGINES, PCI_PRODUCT_SERVERENGINES_OCBE2, 
-	38538, 8468, 0,
+	38544, 8468, 0,
 	PCI_VENDOR_SERVERENGINES, PCI_PRODUCT_SERVERENGINES_OCBE3, 
-	38551, 8468, 0,
+	38557, 8468, 0,
 	PCI_VENDOR_SERVERENGINES, PCI_PRODUCT_SERVERENGINES_IRMC, 
-	38564, 0,
+	38570, 0,
 	PCI_VENDOR_SERVERWORKS, PCI_PRODUCT_SERVERWORKS_CNB20_LE_AGP, 
-	38569, 38578, 6521, 0,
+	38575, 38584, 6521, 0,
 	PCI_VENDOR_SERVERWORKS, PCI_PRODUCT_SERVERWORKS_CNB30_LE_PCI, 
-	38586, 615, 6521, 0,
+	38592, 615, 6521, 0,
 	PCI_VENDOR_SERVERWORKS, PCI_PRODUCT_SERVERWORKS_CNB20_LE_PCI, 
-	38569, 615, 6521, 0,
+	38575, 615, 6521, 0,
 	PCI_VENDOR_SERVERWORKS, PCI_PRODUCT_SERVERWORKS_CNB20_HE_PCI, 

CVS commit: src/sys/dev/pci

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:32:11 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1458 -r1.1459 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1457 -r1.1458 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:31:52 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Samsung SM990.


To generate a diff of this commit:
cvs rdiff -u -r1.1477 -r1.1478 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1477 src/sys/dev/pci/pcidevs:1.1478
--- src/sys/dev/pci/pcidevs:1.1477	Sun Jan 29 15:07:32 2023
+++ src/sys/dev/pci/pcidevs	Fri Feb  3 05:31:52 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp $
+$NetBSD: pcidevs,v 1.1478 2023/02/03 05:31:52 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -9023,6 +9023,7 @@ product SAMSUNGELEC3	SM961		0xa804	SM961
 product SAMSUNGELEC3	SM981		0xa808	SM981 M.2 NVMe SSD
 product SAMSUNGELEC3	SM980		0xa809	SM980 M.2 NVMe SSD
 product SAMSUNGELEC3	PM9A1		0xa80a	PM9A1 M.2 NVMe SSD
+product SAMSUNGELEC3	SM990		0xa80c	SM990 M.2 NVMe SSD
 product SAMSUNGELEC3	171X		0xa820	NVMe SSD Controller 171X
 product SAMSUNGELEC3	172X		0xa821	NVMe SSD Controller 172X
 product SAMSUNGELEC3	172XAB		0xa822	NVMe SSD Controller 172Xa/172Xb



CVS commit: src/sys/dev/pci

2023-02-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Feb  3 05:31:52 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Samsung SM990.


To generate a diff of this commit:
cvs rdiff -u -r1.1477 -r1.1478 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 29 15:08:03 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen for EXAR XR17V354.

PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1457 -r1.1458 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1456 -r1.1457 src/sys/dev/pci/pcidevs_data.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/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1457 src/sys/dev/pci/pcidevs.h:1.1458
--- src/sys/dev/pci/pcidevs.h:1.1457	Wed Jan 18 11:53:25 2023
+++ src/sys/dev/pci/pcidevs.h	Sun Jan 29 15:08:02 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1457 2023/01/18 11:53:25 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1458 2023/01/29 15:08:02 thorpej Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1476 2023/01/18 11:52:38 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp
  */
 
 /*
@@ -3212,6 +3212,7 @@
 #define	PCI_PRODUCT_EXAR_XR17D152	0x0152		/* dual-channel Universal PCI UART */
 #define	PCI_PRODUCT_EXAR_XR17D154	0x0154		/* quad-channel Universal PCI UART */
 #define	PCI_PRODUCT_EXAR_XR17D158	0x0158		/* octal-channel Universal PCI UART */
+#define	PCI_PRODUCT_EXAR_XR17V354	0x0354		/* quad-channel Universal PCIe UART */
 
 /* FORE products */
 #define	PCI_PRODUCT_FORE_PCA200	0x0210		/* ATM PCA-200 */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1456 src/sys/dev/pci/pcidevs_data.h:1.1457
--- src/sys/dev/pci/pcidevs_data.h:1.1456	Wed Jan 18 11:53:25 2023
+++ src/sys/dev/pci/pcidevs_data.h	Sun Jan 29 15:08:02 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1456 2023/01/18 11:53:25 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1457 2023/01/29 15:08:02 thorpej Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1476 2023/01/18 11:52:38 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp
  */
 
 /*
@@ -5243,6 +5243,8 @@ static const uint32_t pci_products[] = {
 	15140, 20295, 615, 7941, 0,
 	PCI_VENDOR_EXAR, PCI_PRODUCT_EXAR_XR17D158, 
 	15153, 20295, 615, 7941, 0,
+	PCI_VENDOR_EXAR, PCI_PRODUCT_EXAR_XR17V354, 
+	15140, 20295, 8154, 7941, 0,
 	PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200, 
 	7083, 20305, 0,
 	PCI_VENDOR_FORE, PCI_PRODUCT_FORE_PCA200E, 
@@ -18827,7 +18829,7 @@ static const char pci_words[] = { "." 
 	"NVMe\0" /* 24 refs @ 7915 */
 	"SSD\0" /* 27 refs @ 7920 */
 	"16650-compatible\0" /* 1 refs @ 7924 */
-	"UART\0" /* 96 refs @ 7941 */
+	"UART\0" /* 97 refs @ 7941 */
 	"Elastic\0" /* 1 refs @ 7946 */
 	"K8\0" /* 4 refs @ 7954 */
 	"AMD64\0" /* 14 refs @ 7957 */
@@ -18856,7 +18858,7 @@ static const char pci_words[] = { "." 
 	"Fabric\0" /* 64 refs @ 8129 */
 	"17h/6xh\0" /* 20 refs @ 8136 */
 	"Family17h\0" /* 21 refs @ 8144 */
-	"PCIe\0" /* 669 refs @ 8154 */
+	"PCIe\0" /* 670 refs @ 8154 */
 	"17h/Axh\0" /* 19 refs @ 8159 */
 	"Dummy\0" /* 6 refs @ 8167 */
 	"Crypto\0" /* 6 refs @ 8173 */
@@ -19902,7 +19904,7 @@ static const char pci_words[] = { "." 
 	"single-channel\0" /* 2 refs @ 15105 */
 	"RS-485\0" /* 8 refs @ 15120 */
 	"dual-channel\0" /* 3 refs @ 15127 */
-	"quad-channel\0" /* 3 refs @ 15140 */
+	"quad-channel\0" /* 4 refs @ 15140 */
 	"octal-channel\0" /* 3 refs @ 15153 */
 	"Isolated\0" /* 4 refs @ 15167 */
 	"PBlaze4\0" /* 1 refs @ 15176 */
@@ -20566,7 +20568,7 @@ static const char pci_words[] = { "." 
 	"OZ711E0\0" /* 1 refs @ 20270 */
 	"Freedom\0" /* 1 refs @ 20278 */
 	"PCI-GBus\0" /* 1 refs @ 20286 */
-	"Universal\0" /* 3 refs @ 20295 */
+	"Universal\0" /* 4 refs @ 20295 */
 	"PCA-200\0" /* 1 refs @ 20305 */
 	"PCA-200e\0" /* 1 refs @ 20313 */
 	"801\0" /* 1 refs @ 20322 */



CVS commit: src/sys/dev/pci

2023-01-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 29 15:08:03 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen for EXAR XR17V354.

PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1457 -r1.1458 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1456 -r1.1457 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 29 15:07:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add ID for the EXAR XR17V354 PCIe UART.

>From Håkan Engvall.
PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1476 -r1.1477 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1476 src/sys/dev/pci/pcidevs:1.1477
--- src/sys/dev/pci/pcidevs:1.1476	Wed Jan 18 11:52:38 2023
+++ src/sys/dev/pci/pcidevs	Sun Jan 29 15:07:32 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1476 2023/01/18 11:52:38 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1477 2023/01/29 15:07:32 thorpej Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3205,6 +3205,7 @@ product ES FREEDOM	0x0001	Freedom PCI-GB
 product EXAR XR17D152	0x0152	dual-channel Universal PCI UART
 product EXAR XR17D154	0x0154	quad-channel Universal PCI UART
 product EXAR XR17D158	0x0158	octal-channel Universal PCI UART
+product EXAR XR17V354	0x0354	quad-channel Universal PCIe UART
 
 /* FORE products */
 product FORE PCA200	0x0210	ATM PCA-200



CVS commit: src/sys/dev/pci

2023-01-29 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jan 29 15:07:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add ID for the EXAR XR17V354 PCIe UART.

>From Håkan Engvall.
PR kern/57202


To generate a diff of this commit:
cvs rdiff -u -r1.1476 -r1.1477 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-25 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jan 26 01:24:19 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
- Don't discard a packet even if the TX descriptor is temporarily not enough,
  and error messages are not output.
- The argument to aq_encap_txring() need not be an mbuf reference, pass an 
entity.

pointed out by nisimura@. thanks


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.43 src/sys/dev/pci/if_aq.c:1.44
--- src/sys/dev/pci/if_aq.c:1.43	Sat Jan 14 13:20:15 2023
+++ src/sys/dev/pci/if_aq.c	Thu Jan 26 01:24:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.43 2023/01/14 13:20:15 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.44 2023/01/26 01:24:19 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.43 2023/01/14 13:20:15 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.44 2023/01/26 01:24:19 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -5323,10 +5323,9 @@ aq_rxring_reset(struct aq_softc *sc, str
 	(((idx) >= (AQ_RXD_NUM - 1)) ? 0 : ((idx) + 1))
 
 static int
-aq_encap_txring(struct aq_softc *sc, struct aq_txring *txring, struct mbuf **mp)
+aq_encap_txring(struct aq_softc *sc, struct aq_txring *txring, struct mbuf *m)
 {
 	bus_dmamap_t map;
-	struct mbuf *m = *mp;
 	uint32_t ctl1, ctl1_ctx, ctl2;
 	int idx, i, error;
 
@@ -5353,11 +5352,8 @@ aq_encap_txring(struct aq_softc *sc, str
 	 * +1 is additional descriptor for context (vlan, etc,.)
 	 */
 	if ((map->dm_nsegs + 1) > txring->txr_nfree) {
-		device_printf(sc->sc_dev,
-		"TX: not enough descriptors left %d for %d segs\n",
-		txring->txr_nfree, map->dm_nsegs + 1);
 		bus_dmamap_unload(sc->sc_dmat, map);
-		return ENOBUFS;
+		return EAGAIN;
 	}
 
 	/* sync dma for mbuf */
@@ -5823,7 +5819,7 @@ static void
 aq_send_common_locked(struct ifnet *ifp, struct aq_softc *sc,
 struct aq_txring *txring, bool is_transmit)
 {
-	struct mbuf *m;
+	struct mbuf *m, *n;
 	int npkt, error;
 
 	if (txring->txr_nfree < AQ_TXD_MIN)
@@ -5834,18 +5830,22 @@ aq_send_common_locked(struct ifnet *ifp,
 			m = pcq_peek(txring->txr_pcq);
 		else
 			IFQ_POLL(>if_snd, m);
-
 		if (m == NULL)
 			break;
 
+		error = aq_encap_txring(sc, txring, m);
+		if (error == EAGAIN) {
+			/* Not enough descriptors available. try again later */
+			break;
+		}
+
 		if (is_transmit)
 			pcq_get(txring->txr_pcq);
 		else
-			IFQ_DEQUEUE(>if_snd, m);
+			IFQ_DEQUEUE(>if_snd, n);
 
-		error = aq_encap_txring(sc, txring, );
 		if (error != 0) {
-			/* too many mbuf chains? or not enough descriptors? */
+			/* too many mbuf chains? or other errors. */
 			m_freem(m);
 			if_statinc(ifp, if_oerrors);
 			break;



CVS commit: src/sys/dev/pci

2023-01-25 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Jan 26 01:24:19 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
- Don't discard a packet even if the TX descriptor is temporarily not enough,
  and error messages are not output.
- The argument to aq_encap_txring() need not be an mbuf reference, pass an 
entity.

pointed out by nisimura@. thanks


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 08:45:47 UTC 2023

Modified Files:
src/sys/dev/pci: xhci_pci.c

Log Message:
Consistently use cached chipset tag value.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/xhci_pci.c

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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.32 src/sys/dev/pci/xhci_pci.c:1.33
--- src/sys/dev/pci/xhci_pci.c:1.32	Fri Oct 28 21:57:58 2022
+++ src/sys/dev/pci/xhci_pci.c	Tue Jan 24 08:45:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.32 2022/10/28 21:57:58 riastradh Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.33 2023/01/24 08:45:47 mlelstv Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.32 2022/10/28 21:57:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.33 2023/01/24 08:45:47 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -229,7 +229,7 @@ xhci_pci_attach(device_t parent, device_
 	}
 	intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf,
 	sizeof(intrbuf));
-	pci_intr_setattr(pa->pa_pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
+	pci_intr_setattr(pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
 	psc->sc_ih = pci_intr_establish_xname(pc, psc->sc_pihp[0], IPL_USB,
 	xhci_intr, sc, device_xname(sc->sc_dev));
 	if (psc->sc_ih == NULL) {



CVS commit: src/sys/dev/pci

2023-01-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 08:45:47 UTC 2023

Modified Files:
src/sys/dev/pci: xhci_pci.c

Log Message:
Consistently use cached chipset tag value.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/xhci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 08:40:46 UTC 2023

Modified Files:
src/sys/dev/pci: ehci_pci.c

Log Message:
Consistently use cached chipset tag value.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/ehci_pci.c

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/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.75 src/sys/dev/pci/ehci_pci.c:1.76
--- src/sys/dev/pci/ehci_pci.c:1.75	Fri Oct 28 21:56:44 2022
+++ src/sys/dev/pci/ehci_pci.c	Tue Jan 24 08:40:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.75 2022/10/28 21:56:44 riastradh Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.76 2023/01/24 08:40:46 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.75 2022/10/28 21:56:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.76 2023/01/24 08:40:46 mlelstv Exp $");
 
 #include 
 #include 
@@ -196,7 +196,7 @@ ehci_pci_attach(device_t parent, device_
 	 * Allocate IRQ
 	 */
 	intrstr = pci_intr_string(pc, sc->sc_pihp[0], intrbuf, sizeof(intrbuf));
-	pci_intr_setattr(pa->pa_pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
+	pci_intr_setattr(pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
 	sc->sc_ih = pci_intr_establish_xname(pc, sc->sc_pihp[0], IPL_USB,
 	ehci_intr, sc, device_xname(self));
 	if (sc->sc_ih == NULL) {



CVS commit: src/sys/dev/pci

2023-01-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 08:40:46 UTC 2023

Modified Files:
src/sys/dev/pci: ehci_pci.c

Log Message:
Consistently use cached chipset tag value.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/ehci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 11:53:26 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1456 -r1.1457 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1455 -r1.1456 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2023-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 11:53:26 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1456 -r1.1457 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1455 -r1.1456 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 11:52:38 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD Family 19h/1xh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1475 -r1.1476 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 18 11:52:38 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD Family 19h/1xh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1475 -r1.1476 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1475 src/sys/dev/pci/pcidevs:1.1476
--- src/sys/dev/pci/pcidevs:1.1475	Sat Jan 14 13:18:17 2023
+++ src/sys/dev/pci/pcidevs	Wed Jan 18 11:52:38 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1475 2023/01/14 13:18:17 ryo Exp $
+$NetBSD: pcidevs,v 1.1476 2023/01/18 11:52:38 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1054,11 +1054,38 @@ product AMD F17_7X_RESV_SPP	0x1485	Famil
 product AMD F17_7X_CCP		0x1486	Family17h/7xh Crypto
 product AMD F17_3X_HDA		0x1487	17h/7xh HD Audio
 product AMD F17_7X_USB3		0x149c	Family17h/7xh USB 3.0 Host Controller
+product AMD F19_1X_IOMMU	0x149e	19h/7xh IOMMU
+product AMD F19_1X_PCIE_DUMMY_HB 0x149f	19h/7xh PCIe Dummy Host Bridge
+product AMD F19_1X_RC		0x14a4	19h/1xh Root Complex
+product AMD F19_1X_GPPB_0	0x14a5	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_RCEC		0x14a6	19h/1xh RCEC
+product AMD F19_1X_INTNL_GPPB	0x14a7	19h/1xh Internal PCIe GPP Bridge
+product AMD F19_1X_GPPB_1	0x14aa	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_GPPB_2	0x14ab	19h/1xh PCIe GPP Bridge
+product AMD F19_1X_PCIE_DUMMY_0	0x14ac	19h/1xh PCIe Dummy Function
+product AMD F19_1X_DF_0		0x14ad	19h/1xh Data Fabric
+product AMD F19_1X_DF_1		0x14ae	19h/1xh Data Fabric
+product AMD F19_1X_DF_2		0x14af	19h/1xh Data Fabric
+product AMD F19_1X_DF_3		0x14b0	19h/1xh Data Fabric
+product AMD F19_1X_DF_4		0x14b1	19h/1xh Data Fabric
+product AMD F19_1X_DF_5		0x14b2	19h/1xh Data Fabric
+product AMD F19_1X_DF_6		0x14b3	19h/1xh Data Fabric
+product AMD F19_1X_DF_7		0x14b4	19h/1xh Data Fabric
 product AMD F17_AX_RC		0x14b5	17h/Axh Root Complex
 product AMD F17_AX_IOMMU	0x14b6	17h/Axh IOMMU
 product AMD F17_AX_PCIE_DUMMY_HB 0x14b7	17h/Axh PCIe Dummy Host Bridge
 product AMD F17_AX_INTNL_GPPB_0	0x14b9	17h/Axh Internal GPP Bridge 0
 product AMD F17_AX_GPPB		0x14ba	17h/Axh PCIe GPP Bridge
+product AMD F19_1X_NTB_0	0x14c0	19h/1xh Primary PCIe Non Transparent Bridge
+product AMD F19_1X_VNTB		0x14c1	19h/1xh Secondary vNTB
+product AMD F19_1X_PCIE_DUMMY_1	0x14c2	19h/1xh PCIe Dummy Function
+product AMD F19_1X_NTB_1	0x14c3	19h/1xh PCIe Non Transparent Bridge
+product AMD F19_1X_SWDS		0x14c4	19h/1xh Swith NBIF DS
+product AMD F19_1X_NVME		0x14c5	19h/1xh NVMe
+product AMD F19_1X_SWUS		0x14c6	19h/1xh Swith US in PCIe
+product AMD F19_1X_PSP		0x14ca	19h/1xh PSP
+product AMD F19_1X_ACP		0x14cb	19h/1xh ACP
+product AMD F19_1X_HDA		0x14cc	19h/1xh HD Audio
 product AMD F19_6X_RC		0x14d8	19h/6xh Root Complex
 product AMD F17_AX_XHCI_0	0x1503	17h/Axh USB 3.1 xHCI
 product AMD F17_AX_XHCI_1	0x1504	17h/Axh USB 3.1 xHCI
@@ -1095,6 +1122,7 @@ product AMD F15_6X_HDA		0x157a	15h/6xh A
 product AMD F15_6X_HB		0x157b	15h/6xh Host Bridge
 product AMD F15_6X_RP		0x157c	15h/6xh Root Port
 product AMD F15_6X_HB_2		0x157d	15h/6xh Host Bridge
+product AMD F19_1X_XHCI		0x157f	19h/1xh USB 3.2
 product AMD F16_30_HT		0x1580	Family16h HyperTransport Configuration
 product AMD F16_30_ADDR		0x1581	Family16h Address Map Configuration
 product AMD F16_30_DRAM		0x1582	Family16h DRAM Configuration



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:20:15 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
Added support for the Aquantia (Marvell) AQC113 10G Network Adapter and the 
variants, to aq(4)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.42 src/sys/dev/pci/if_aq.c:1.43
--- src/sys/dev/pci/if_aq.c:1.42	Sat Jan 14 13:17:50 2023
+++ src/sys/dev/pci/if_aq.c	Sat Jan 14 13:20:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.42 2023/01/14 13:17:50 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.43 2023/01/14 13:20:15 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.42 2023/01/14 13:17:50 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.43 2023/01/14 13:20:15 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -116,19 +116,29 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 #define AQ_RSS_HASHKEY_SIZE		40
 #define AQ_RSS_INDIRECTION_TABLE_MAX	64
 
-#define AQ_JUMBO_MTU_REV_A		9000
-#define AQ_JUMBO_MTU_REV_B		16338
+#define AQ1_JUMBO_MTU_REV_A		9000
+#define AQ1_JUMBO_MTU_REV_B		16338
+#define AQ2_JUMBO_MTU			16338
 
 /*
  * TERMINOLOGY
+ *	ATL  (AQ1) = Atlantic.  AQC100,107-109,111,112.
+ *	ATL2 (AQ2) = Atlantic2. AQC113-116.
  *	MPI = MAC PHY INTERFACE?
  *	RPO = RX Protocol Offloading
  *	TPO = TX Protocol Offloading
  *	RPF = RX Packet Filter
  *	TPB = TX Packet buffer
  *	RPB = RX Packet buffer
+ *	ART = Action Resolver Table
+ *	TC  = Traffic Class
  */
 
+enum aq_hwtype {
+	HWTYPE_AQ1,
+	HWTYPE_AQ2
+};
+
 /* registers */
 #define AQ_FW_SOFTRESET_REG			0x
 #define  AQ_FW_SOFTRESET_RESET			__BIT(15) /* soft reset bit */
@@ -136,6 +146,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 
 #define AQ_FW_VERSION_REG			0x0018
 #define AQ_HW_REVISION_REG			0x001c
+#define AQ2_HW_FPGA_VERSION_REG			0x00f4	/* AQ2 */
 #define AQ_GLB_NVR_INTERFACE1_REG		0x0100
 
 #define AQ_FW_MBOX_CMD_REG			0x0200
@@ -182,7 +193,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 #define  RBL_STATUS_HOST_BOOT			0xf1a7
 
 #define AQ_FW_GLB_CPU_SEM_REG(i)		(0x03a0 + (i) * 4)
-#define AQ_FW_SEM_RAM_REG			AQ_FW_GLB_CPU_SEM_REG(2)
+#define AQ1_FW_SEM_RAM_REG			AQ_FW_GLB_CPU_SEM_REG(2)
+#define AQ2_ART_SEM_REGAQ_FW_GLB_CPU_SEM_REG(3)
 
 #define AQ_FW_GLB_CTL2_REG			0x0404
 #define  AQ_FW_GLB_CTL2_MCP_UP_FORCE_INTERRUPT	__BIT(1)
@@ -194,7 +206,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 
 #define AQ_PCI_REG_CONTROL_6_REG		0x1014
 
-// msix bitmap */
+/* msix bitmap */
 #define AQ_INTR_STATUS_REG			0x2000	/* intr status */
 #define AQ_INTR_STATUS_CLR_REG			0x2050	/* intr status clear */
 #define AQ_INTR_MASK_REG			0x2060	/* intr mask set */
@@ -212,7 +224,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 
 /* AQ_GEN_INTR_MAP_REG[AQ_RINGS_NUM] 0x2180-0x2200 */
 #define AQ_GEN_INTR_MAP_REG(i)			(0x2180 + (i) * 4)
-#define  AQ_B0_ERR_INT8U
+#define  AQ_B0_ERR_INT8
 
 #define AQ_INTR_CTRL_REG			0x2300
 #define  AQ_INTR_CTRL_IRQMODE			__BITS(1,0)
@@ -231,8 +243,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 #define  FW_MPI_RESETCTRL_RESET_DIS		__BIT(29)
 
 #define RX_SYSCONTROL_REG			0x5000
-#define  RX_SYSCONTROL_RPB_DMA_LOOPBACK		__BIT(6)
-#define  RX_SYSCONTROL_RPF_TPO_LOOPBACK		__BIT(8)
+#define  RX_SYSCONTROL_RPF_TPO_SYS_LOOPBACK	__BIT(8)
+#define  RX_SYSCONTROL_RPB_DMA_SYS_LOOPBACK	__BIT(6)
+#define  RX_SYSCONTROL_RPB_DMA_NET_LOOPBACK	__BIT(4)
 #define  RX_SYSCONTROL_RESET_DIS		__BIT(29)
 
 #define RX_TCP_RSS_HASH_REG			0x5040
@@ -252,14 +265,19 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 #define  RPF_L2BC_ACTION			__BITS(12,14)
 #define  RPF_L2BC_THRESHOLD			__BITS(31,16)
 
-/* RPF_L2UC_*_REG[34] (actual [38]?) */
+/* RPF_L2UC_*_REG[34] (AQ2 has [38]) */
 #define RPF_L2UC_LSW_REG(i)			(0x5110 + (i) * 8)
 #define RPF_L2UC_MSW_REG(i)			(0x5114 + (i) * 8)
 #define  RPF_L2UC_MSW_MACADDR_HI		__BITS(15,0)
 #define  RPF_L2UC_MSW_ACTION			__BITS(18,16)
+#define  RPF_L2UC_MSW_TAG			__BITS(27,22)	/* AQ2 */
 #define  RPF_L2UC_MSW_EN			__BIT(31)
-#define AQ_HW_MAC_OWN			0	/* index of own address */
-#define AQ_HW_MAC_NUM			34
+
+#define AQ_HW_MAC_OWN0 /* index of own address */
+#define AQ1_HW_MAC_NUM34
+#define AQ2_HW_MAC_NUM38
+#define AQ_HW_MAC_NUM(sc)			\
+	(HWTYPE_AQ2_P((sc)) ? AQ2_HW_MAC_NUM : AQ1_HW_MAC_NUM)
 
 /* RPF_MCAST_FILTER_REG[8] 0x5250-0x5270 */
 #define RPF_MCAST_FILTER_REG(i)			(0x5250 + (i) * 4)
@@ -283,6 +301,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 #define  RPF_VLAN_FILTER_RXQ_EN			__BIT(28)
 #define  RPF_VLAN_FILTER_RXQ			__BITS(24,20)
 #define  RPF_VLAN_FILTER_ACTION			__BITS(18,16)
+#define  RPF_VLAN_FILTER_TAG			__BITS(15,12)	/* AQ2 */
 #define  RPF_VLAN_FILTER_ID			__BITS(11,0)
 
 /* RPF_ETHERTYPE_FILTER_REG[AQ_RINGS_NUM] 

CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:20:15 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
Added support for the Aquantia (Marvell) AQC113 10G Network Adapter and the 
variants, to aq(4)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:19:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1455 -r1.1456 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1454 -r1.1455 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:19:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1455 -r1.1456 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1454 -r1.1455 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:18:17 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add Aquantia (Marvell) AQC113 ethernet devices and the variants


To generate a diff of this commit:
cvs rdiff -u -r1.1474 -r1.1475 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1474 src/sys/dev/pci/pcidevs:1.1475
--- src/sys/dev/pci/pcidevs:1.1474	Wed Jan  4 03:12:09 2023
+++ src/sys/dev/pci/pcidevs	Sat Jan 14 13:18:17 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1474 2023/01/04 03:12:09 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1475 2023/01/14 13:18:17 ryo Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1404,17 +1404,25 @@ product APPLE BCM5701		0x1645	BCM5701
 
 /* Aquantia Corp. */
 product AQUANTIA AQC100		0x00b1	AQC100 10 Gigabit Network Adapter
+product AQUANTIA AQC113DEV	0x00c0	AQC113DEV 10 Gigabit Network Adapter
+product AQUANTIA AQC113		0x04c0	AQC113 10 Gigabit Network Adapter
 product AQUANTIA AQC107		0x07b1	AQC107 10 Gigabit Network Adapter
 product AQUANTIA AQC108		0x08b1	AQC108 5 Gigabit Network Adapter
 product AQUANTIA AQC109		0x09b1	AQC109 2.5 Gigabit Network Adapter
 product AQUANTIA AQC111		0x11b1	AQC111 5 Gigabit Network Adapter
+product AQUANTIA AQC116C	0x11c0	AQC116C Gigabit Network Adapter
 product AQUANTIA AQC112		0x12b1	AQC112 2.5 Gigabit Network Adapter
+product AQUANTIA AQC115C	0x12c0	AQC115C 2.5 Gigabit Network Adapter
+product AQUANTIA AQC113C	0x14c0	AQC113C 10 Gigabit Network Adapter
+product AQUANTIA AQC113CA	0x34c0	AQC113CA 10 Gigabit Network Adapter
 product AQUANTIA AQC100S	0x80b1	AQC100S 10 Gigabit Network Adapter
 product AQUANTIA AQC107S	0x87b1	AQC107S 10 Gigabit Network Adapter
 product AQUANTIA AQC108S	0x88b1	AQC108S 5 Gigabit Network Adapter
 product AQUANTIA AQC109S	0x89b1	AQC109S 2.5 Gigabit Network Adapter
 product AQUANTIA AQC111S	0x91b1	AQC111S 5 Gigabit Network Adapter
 product AQUANTIA AQC112S	0x92b1	AQC112S 2.5 Gigabit Network Adapter
+product AQUANTIA AQC114CS	0x93c0	AQC114CS 5 Gigabit Network Adapter
+product AQUANTIA AQC113CS	0x94c0	AQC113CS 10 Gigabit Network Adapter
 product AQUANTIA D100		0xd100	D100 10 Gigabit Network Adapter
 product AQUANTIA D107		0xd107	D107 10 Gigabit Network Adapter
 product AQUANTIA D108		0xd108	D108 5 Gigabit Network Adapter



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:18:17 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add Aquantia (Marvell) AQC113 ethernet devices and the variants


To generate a diff of this commit:
cvs rdiff -u -r1.1474 -r1.1475 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:17:50 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.41 src/sys/dev/pci/if_aq.c:1.42
--- src/sys/dev/pci/if_aq.c:1.41	Sat Jan 14 13:17:20 2023
+++ src/sys/dev/pci/if_aq.c	Sat Jan 14 13:17:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.41 2023/01/14 13:17:20 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.42 2023/01/14 13:17:50 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.41 2023/01/14 13:17:20 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.42 2023/01/14 13:17:50 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -5003,10 +5003,10 @@ aq_ioctl(struct ifnet *ifp, unsigned lon
 	case SIOCDELMULTI:
 		AQ_LOCK(sc);
 		if ((sc->sc_if_flags & IFF_RUNNING) != 0) {
-		   /*
-			* Multicast list has changed; set the hardware filter
-			* accordingly.
-			*/
+			/*
+			 * Multicast list has changed; set the hardware filter
+			 * accordingly.
+			 */
 			error = aq_set_filter(sc);
 		}
 		AQ_UNLOCK(sc);



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:17:50 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:17:20 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
- avoid panic when failing during attach or detach with modload/drvctl.
- free workqueue resources when detaching.
- remove debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.40 src/sys/dev/pci/if_aq.c:1.41
--- src/sys/dev/pci/if_aq.c:1.40	Sat Jan 14 13:16:27 2023
+++ src/sys/dev/pci/if_aq.c	Sat Jan 14 13:17:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.40 2023/01/14 13:16:27 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.41 2023/01/14 13:17:20 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.40 2023/01/14 13:16:27 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.41 2023/01/14 13:17:20 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -931,7 +931,8 @@ struct aq_firmware_ops {
 #define AQ_EVCNT_ATTACH_MISC(sc, name, desc)\
 	AQ_EVCNT_ATTACH(sc, name, desc, EVCNT_TYPE_MISC)
 #define AQ_EVCNT_DETACH(sc, name)	\
-	evcnt_detach(&(sc)->sc_evcount_##name##_ev)
+	if ((sc)->sc_evcount_##name##_name[0] != '\0')			\
+		evcnt_detach(&(sc)->sc_evcount_##name##_ev)
 #define AQ_EVCNT_ADD(sc, name, val)	\
 	((sc)->sc_evcount_##name##_ev.ev_count += (val))
 #endif /* AQ_EVENT_COUNTERS */
@@ -1587,6 +1588,9 @@ aq_detach(device_t self, int flags __unu
 	struct ifnet * const ifp = >sc_ethercom.ec_if;
 	int i;
 
+	if (sc->sc_dev == NULL)
+		return 0;
+
 	if (sc->sc_iosize != 0) {
 		if (ifp->if_softc != NULL) {
 			IFNET_LOCK(ifp);
@@ -1601,12 +1605,19 @@ aq_detach(device_t self, int flags __unu
 			}
 		}
 		if (sc->sc_nintrs > 0) {
+			callout_stop(>sc_tick_ch);
+
 			pci_intr_release(sc->sc_pc, sc->sc_intrs,
 			sc->sc_nintrs);
 			sc->sc_intrs = NULL;
 			sc->sc_nintrs = 0;
 		}
 
+		if (sc->sc_reset_wq != NULL) {
+			workqueue_destroy(sc->sc_reset_wq);
+			sc->sc_reset_wq = NULL;
+		}
+
 		aq_txrx_rings_free(sc);
 
 		if (ifp->if_softc != NULL) {
@@ -1614,7 +1625,6 @@ aq_detach(device_t self, int flags __unu
 			if_detach(ifp);
 		}
 
-		aprint_debug_dev(sc->sc_dev, "%s: bus_space_unmap\n", __func__);
 		bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_iosize);
 		sc->sc_iosize = 0;
 	}
@@ -1647,10 +1657,14 @@ aq_detach(device_t self, int flags __unu
 	AQ_EVCNT_DETACH(sc, cprc);
 #endif
 
-	ifmedia_fini(>sc_media);
+	if (sc->sc_ethercom.ec_ifmedia != NULL) {
+		ifmedia_fini(>sc_media);
+		sc->sc_ethercom.ec_ifmedia = NULL;
+	}
 
 	mutex_destroy(>sc_mpi_mutex);
 	mutex_destroy(>sc_mutex);
+	sc->sc_dev = NULL;
 
 	return 0;
 }



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:17:20 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
- avoid panic when failing during attach or detach with modload/drvctl.
- free workqueue resources when detaching.
- remove debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:16:27 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
fix build error in sys/module/if_aq/

avoid error of "comparison of integer expressions of different signedness" and 
-Werror=sign-compare


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Jan 14 13:16:27 UTC 2023

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
fix build error in sys/module/if_aq/

avoid error of "comparison of integer expressions of different signedness" and 
-Werror=sign-compare


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.39 src/sys/dev/pci/if_aq.c:1.40
--- src/sys/dev/pci/if_aq.c:1.39	Wed Nov  2 20:38:22 2022
+++ src/sys/dev/pci/if_aq.c	Sat Jan 14 13:16:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.39 2022/11/02 20:38:22 andvar Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.40 2023/01/14 13:16:27 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.39 2022/11/02 20:38:22 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.40 2023/01/14 13:16:27 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -1008,7 +1008,7 @@ struct aq_softc {
 #define FEATURES_REV_B0		0x2000
 #define FEATURES_REV_B1		0x4000
 #define FEATURES_REV_B		(FEATURES_REV_B0|FEATURES_REV_B1)
-	uint32_t sc_max_mtu;
+	int sc_max_mtu;
 	uint32_t sc_mbox_addr;
 
 	bool sc_rbl_enabled;
@@ -3874,7 +3874,7 @@ aq_watchdog_check(struct aq_softc * cons
 	AQ_LOCKED(sc);
 
 	bool ok = true;
-	for (u_int n = 0; n < sc->sc_nqueues; n++) {
+	for (int n = 0; n < sc->sc_nqueues; n++) {
 		struct aq_txring *txring = >sc_queue[n].txring;
 
 		mutex_enter(>txr_mutex);
@@ -4810,7 +4810,7 @@ aq_unset_stopping_flags(struct aq_softc 
 	AQ_LOCKED(sc);
 
 	/* Must unset stopping flags in ascending order. */
-	for (unsigned i = 0; i < sc->sc_nqueues; i++) {
+	for (int i = 0; i < sc->sc_nqueues; i++) {
 		struct aq_txring *txr = >sc_queue[i].txring;
 		struct aq_rxring *rxr = >sc_queue[i].rxring;
 
@@ -4833,7 +4833,7 @@ aq_set_stopping_flags(struct aq_softc *s
 	AQ_LOCKED(sc);
 
 	/* Must unset stopping flags in ascending order. */
-	for (unsigned i = 0; i < sc->sc_nqueues; i++) {
+	for (int i = 0; i < sc->sc_nqueues; i++) {
 		struct aq_txring *txr = >sc_queue[i].txring;
 		struct aq_rxring *rxr = >sc_queue[i].rxring;
 
@@ -4920,7 +4920,7 @@ aq_handle_reset_work(struct work *work, 
 	__func__, AQ_READ_REG(sc, AQ_INTR_MASK_REG),
 	AQ_READ_REG(sc, AQ_INTR_STATUS_REG));
 
-	for (u_int n = 0; n < sc->sc_nqueues; n++) {
+	for (int n = 0; n < sc->sc_nqueues; n++) {
 		struct aq_txring *txring = >sc_queue[n].txring;
 		u_int head = AQ_READ_REG_BIT(sc,
 		TX_DMA_DESC_HEAD_PTR_REG(txring->txr_index),



CVS commit: src/sys/dev/pci

2023-01-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 12 10:10:10 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify error message to match the current behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/piixpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 12 10:10:10 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify error message to match the current behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/piixpm.c

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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.71 src/sys/dev/pci/piixpm.c:1.72
--- src/sys/dev/pci/piixpm.c:1.71	Tue Jan 10 00:05:53 2023
+++ src/sys/dev/pci/piixpm.c	Thu Jan 12 10:10:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.71 2023/01/10 00:05:53 msaitoh Exp $ */
+/* $NetBSD: piixpm.c,v 1.72 2023/01/12 10:10:10 msaitoh Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.71 2023/01/10 00:05:53 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.72 2023/01/12 10:10:10 msaitoh Exp $");
 
 #include 
 #include 
@@ -461,7 +461,7 @@ piixpm_sb800_init(struct piixpm_softc *s
 		rv = bus_space_map(sbt, SB800_INDIRECTIO_BASE,
 		SB800_INDIRECTIO_SIZE, 0, );
 	if (rv != 0) {
-		device_printf(sc->sc_dev, "couldn't map indirect I/O space\n");
+		device_printf(sc->sc_dev, "couldn't map indirect space\n");
 		return EBUSY;
 	}
 	sc->sc_sb800_bh = sbh;



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 10 00:05:53 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c piixpmreg.h

Log Message:
Use MMIO for PM register access on newer revision's devices.

 Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/piixpmreg.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.70 src/sys/dev/pci/piixpm.c:1.71
--- src/sys/dev/pci/piixpm.c:1.70	Mon Jan  9 16:29:39 2023
+++ src/sys/dev/pci/piixpm.c	Tue Jan 10 00:05:53 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.70 2023/01/09 16:29:39 msaitoh Exp $ */
+/* $NetBSD: piixpm.c,v 1.71 2023/01/10 00:05:53 msaitoh Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.70 2023/01/09 16:29:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.71 2023/01/10 00:05:53 msaitoh Exp $");
 
 #include 
 #include 
@@ -83,11 +83,13 @@ struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
+	bus_space_tag_t		sc_sb800_bt;
 	bus_space_handle_t	sc_pm_ioh;
 	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
+	bool			sc_sb800_mmio;	/* Use MMIO access */
 	bool			sc_sb800_selen; /* Use SMBUS0SEL */
 
 	pci_chipset_tag_t	sc_pc;
@@ -123,6 +125,7 @@ static void	piixpm_chdet(device_t, devic
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static uint8_t	piixpm_sb800_pmread(struct piixpm_softc *, bus_size_t);
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_sb800_acquire_bus(void *, int);
@@ -239,6 +242,15 @@ nopowermanagement:
 
 	/* SB800 rev 0x40+, AMD HUDSON and newer need special initialization */
 	if (PIIXPM_IS_FCHGRP(sc) || PIIXPM_IS_SB800GRP(sc)) {
+		/* Newer chips don't support I/O access */
+		if (PIIXPM_IS_KERNCZ(sc) && (sc->sc_rev >= 0x51)) {
+			sc->sc_sb800_mmio = true;
+			sc->sc_sb800_bt = pa->pa_memt;
+		} else {
+			sc->sc_sb800_mmio = false;
+			sc->sc_sb800_bt = pa->pa_iot;
+		}
+
 		if (piixpm_sb800_init(sc) == 0) {
 			/* Read configuration */
 			conf = bus_space_read_1(sc->sc_iot,
@@ -402,18 +414,37 @@ piixpm_resume(device_t dv, const pmf_qua
 	return true;
 }
 
+static uint8_t
+piixpm_sb800_pmread(struct piixpm_softc *sc, bus_size_t offset)
+{
+	bus_space_tag_t sbt = sc->sc_sb800_bt;
+	bus_space_handle_t sbh = sc->sc_sb800_bh;
+	uint8_t val;
+
+	if (sc->sc_sb800_mmio)
+		val = bus_space_read_1(sbt, sbh, offset);
+	else {
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX, offset);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
+	}
+
+	return val;
+}
+
 /*
  * Extract SMBus base address from SB800 Power Management (PM) registers.
  * The PM registers can be accessed either through indirect I/O (CD6/CD7) or
- * direct mapping if AcpiMMioDecodeEn is enabled. Since this function is only
- * called once it uses indirect I/O for simplicity.
+ * direct mapping if AcpiMMioDecodeEn is enabled. Newer devices support MMIO
+ * access only.
  */
 static int
 piixpm_sb800_init(struct piixpm_softc *sc)
 {
-	bus_space_tag_t sbt = sc->sc_iot;
-	bus_space_handle_t sbh;	/* indirect I/O handle */
-	uint16_t val, base_addr;
+	bus_space_tag_t sbt = sc->sc_sb800_bt;
+	bus_space_handle_t sbh;	/* indirect memory or I/O handle */
+	int rv;
+	uint16_t base_addr;
+	uint8_t lo, hi;
 	bool enabled;
 
 	if (PIIXPM_IS_KERNCZ(sc) ||
@@ -423,37 +454,35 @@ piixpm_sb800_init(struct piixpm_softc *s
 		sc->sc_numbusses = 4;
 
 	/* Check SMBus enable bit and Fetch SMB base address */
-	if (bus_space_map(sbt,
-	SB800_INDIRECTIO_BASE, SB800_INDIRECTIO_SIZE, 0, )) {
+	if (sc->sc_sb800_mmio)
+		rv = bus_space_map(sbt, SB800_FCH_PM_BASE,
+		SB800_FCH_PM_SIZE, 0, );
+	else
+		rv = bus_space_map(sbt, SB800_INDIRECTIO_BASE,
+		SB800_INDIRECTIO_SIZE, 0, );
+	if (rv != 0) {
 		device_printf(sc->sc_dev, "couldn't map indirect I/O space\n");
 		return EBUSY;
 	}
+	sc->sc_sb800_bh = sbh;
 	if (PIIXPM_IS_FCHGRP(sc)) {
-		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
-		AMDFCH41_PM_DECODE_EN0);
-		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
-		enabled = val & AMDFCH41_SMBUS_EN;
+		lo = piixpm_sb800_pmread(sc, AMDFCH41_PM_DECODE_EN0);
+		enabled = lo & AMDFCH41_SMBUS_EN;
 		if (!enabled)
 			return ENOENT;
 
-		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
-		

CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 10 00:05:53 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c piixpmreg.h

Log Message:
Use MMIO for PM register access on newer revision's devices.

 Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/piixpmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:29:39 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify for following MMIO support. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/piixpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:29:39 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify for following MMIO support. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/pci/piixpm.c

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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.69 src/sys/dev/pci/piixpm.c:1.70
--- src/sys/dev/pci/piixpm.c:1.69	Mon Jan  9 16:27:10 2023
+++ src/sys/dev/pci/piixpm.c	Mon Jan  9 16:29:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.69 2023/01/09 16:27:10 msaitoh Exp $ */
+/* $NetBSD: piixpm.c,v 1.70 2023/01/09 16:29:39 msaitoh Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.69 2023/01/09 16:27:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.70 2023/01/09 16:29:39 msaitoh Exp $");
 
 #include 
 #include 
@@ -411,8 +411,8 @@ piixpm_resume(device_t dv, const pmf_qua
 static int
 piixpm_sb800_init(struct piixpm_softc *sc)
 {
-	bus_space_tag_t iot = sc->sc_iot;
-	bus_space_handle_t ioh;	/* indirect I/O handle */
+	bus_space_tag_t sbt = sc->sc_iot;
+	bus_space_handle_t sbh;	/* indirect I/O handle */
 	uint16_t val, base_addr;
 	bool enabled;
 
@@ -423,49 +423,49 @@ piixpm_sb800_init(struct piixpm_softc *s
 		sc->sc_numbusses = 4;
 
 	/* Check SMBus enable bit and Fetch SMB base address */
-	if (bus_space_map(iot,
-	SB800_INDIRECTIO_BASE, SB800_INDIRECTIO_SIZE, 0, )) {
+	if (bus_space_map(sbt,
+	SB800_INDIRECTIO_BASE, SB800_INDIRECTIO_SIZE, 0, )) {
 		device_printf(sc->sc_dev, "couldn't map indirect I/O space\n");
 		return EBUSY;
 	}
 	if (PIIXPM_IS_FCHGRP(sc)) {
-		bus_space_write_1(iot, ioh, SB800_INDIRECTIO_INDEX,
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
 		AMDFCH41_PM_DECODE_EN0);
-		val = bus_space_read_1(iot, ioh, SB800_INDIRECTIO_DATA);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
 		enabled = val & AMDFCH41_SMBUS_EN;
 		if (!enabled)
 			return ENOENT;
 
-		bus_space_write_1(iot, ioh, SB800_INDIRECTIO_INDEX,
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
 		AMDFCH41_PM_DECODE_EN1);
-		val = bus_space_read_1(iot, ioh, SB800_INDIRECTIO_DATA) << 8;
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA) << 8;
 		base_addr = val;
 	} else {
 		uint8_t data;
 
-		bus_space_write_1(iot, ioh, SB800_INDIRECTIO_INDEX,
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
 		SB800_PM_SMBUS0EN_LO);
-		val = bus_space_read_1(iot, ioh, SB800_INDIRECTIO_DATA);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
 		enabled = val & SB800_PM_SMBUS0EN_ENABLE;
 		if (!enabled)
 			return ENOENT;
 
-		bus_space_write_1(iot, ioh, SB800_INDIRECTIO_INDEX,
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
 		SB800_PM_SMBUS0EN_HI);
-		val |= bus_space_read_1(iot, ioh, SB800_INDIRECTIO_DATA) << 8;
+		val |= bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA) << 8;
 		base_addr = val & SB800_PM_SMBUS0EN_BADDR;
 
-		bus_space_write_1(iot, ioh, SB800_INDIRECTIO_INDEX,
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX,
 		SB800_PM_SMBUS0SELEN);
-		data = bus_space_read_1(iot, ioh, SB800_INDIRECTIO_DATA);
+		data = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
 		if ((data & SB800_PM_USE_SMBUS0SEL) != 0)
 			sc->sc_sb800_selen = true;
 	}
 
-	sc->sc_sb800_bh = ioh;
+	sc->sc_sb800_bh = sbh;
 	aprint_debug_dev(sc->sc_dev, "SMBus @ 0x%04x\n", base_addr);
 
-	if (bus_space_map(iot, PCI_MAPREG_IO_ADDR(base_addr),
+	if (bus_space_map(sbt, PCI_MAPREG_IO_ADDR(base_addr),
 	SB800_SMB_SIZE, 0, >sc_smb_ioh)) {
 		aprint_error_dev(sc->sc_dev, "can't map smbus I/O space\n");
 		return EBUSY;



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:27:10 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Simplify and modify for following MMIO support. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/piixpm.c

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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.68 src/sys/dev/pci/piixpm.c:1.69
--- src/sys/dev/pci/piixpm.c:1.68	Mon Jan  9 16:26:08 2023
+++ src/sys/dev/pci/piixpm.c	Mon Jan  9 16:27:10 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.68 2023/01/09 16:26:08 msaitoh Exp $ */
+/* $NetBSD: piixpm.c,v 1.69 2023/01/09 16:27:10 msaitoh Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.68 2023/01/09 16:26:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.69 2023/01/09 16:27:10 msaitoh Exp $");
 
 #include 
 #include 
@@ -83,10 +83,8 @@ struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
-#define	sc_pm_iot sc_iot
-#define sc_smb_iot sc_iot
 	bus_space_handle_t	sc_pm_ioh;
-	bus_space_handle_t	sc_sb800_ioh;
+	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
@@ -222,7 +220,7 @@ piixpm_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
-	if (base == 0 || bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
+	if (base == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_PM_SIZE, 0, >sc_pm_ioh)) {
 		aprint_error_dev(self,
 		"can't map power management I/O space\n");
@@ -234,7 +232,7 @@ piixpm_attach(device_t parent, device_t 
 	 * PIIX4 and PIIX4E have a bug in the timer latch, see Errata #20
 	 * in the "Specification update" (document #297738).
 	 */
-	acpipmtimer_attach(self, sc->sc_pm_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
+	acpipmtimer_attach(self, sc->sc_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
 	(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0);
 
 nopowermanagement:
@@ -265,7 +263,7 @@ nopowermanagement:
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0x;
 	if (base == 0 ||
-	bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
+	bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_SMB_SIZE, 0, >sc_smb_ioh)) {
 		aprint_error_dev(self, "can't map smbus I/O space\n");
 		return;
@@ -464,7 +462,7 @@ piixpm_sb800_init(struct piixpm_softc *s
 			sc->sc_sb800_selen = true;
 	}
 
-	sc->sc_sb800_ioh = ioh;
+	sc->sc_sb800_bh = ioh;
 	aprint_debug_dev(sc->sc_dev, "SMBus @ 0x%04x\n", base_addr);
 
 	if (bus_space_map(iot, PCI_MAPREG_IO_ADDR(base_addr),
@@ -505,14 +503,14 @@ piixpm_i2c_sb800_acquire_bus(void *cooki
 	uint8_t sctl, old_sda, index, mask, reg;
 	int i;
 
-	sctl = bus_space_read_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_SC);
+	sctl = bus_space_read_1(sc->sc_iot, sc->sc_smb_ioh, PIIX_SMB_SC);
 	for (i = 0; i < PIIX_SB800_TIMEOUT; i++) {
 		/* Try to acquire the host semaphore */
 		sctl &= ~PIIX_SMB_SC_SEMMASK;
-		bus_space_write_1(sc->sc_smb_iot, sc->sc_smb_ioh, PIIX_SMB_SC,
+		bus_space_write_1(sc->sc_iot, sc->sc_smb_ioh, PIIX_SMB_SC,
 		sctl | PIIX_SMB_SC_HOSTSEM);
 
-		sctl = bus_space_read_1(sc->sc_smb_iot, sc->sc_smb_ioh,
+		sctl = bus_space_read_1(sc->sc_iot, sc->sc_smb_ioh,
 		PIIX_SMB_SC);
 		if ((sctl & PIIX_SMB_SC_HOSTSEM) != 0)
 			break;
@@ -537,16 +535,16 @@ piixpm_i2c_sb800_acquire_bus(void *cooki
 		mask = SB800_PM_SMBUS0_MASK_C;
 	}
 
-	bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh,
+	bus_space_write_1(sc->sc_iot, sc->sc_sb800_bh,
 	SB800_INDIRECTIO_INDEX, index);
-	reg = bus_space_read_1(sc->sc_iot, sc->sc_sb800_ioh,
+	reg = bus_space_read_1(sc->sc_iot, sc->sc_sb800_bh,
 	SB800_INDIRECTIO_DATA);
 
 	old_sda = __SHIFTOUT(reg, mask);
 	if (smbus->sda != old_sda) {
 		reg &= ~mask;
 		reg |= __SHIFTIN(smbus->sda, mask);
-		bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh,
+		bus_space_write_1(sc->sc_iot, sc->sc_sb800_bh,
 		SB800_INDIRECTIO_DATA, reg);
 	}
 
@@ -575,22 +573,22 @@ piixpm_i2c_sb800_release_bus(void *cooki
 		mask = SB800_PM_SMBUS0_MASK_C;
 	}
 
-	bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh,
+	bus_space_write_1(sc->sc_iot, sc->sc_sb800_bh,
 	SB800_INDIRECTIO_INDEX, index);
 	if (smbus->sda != smbus->sda_save) {
 		/* Restore the port number */
-		reg = bus_space_read_1(sc->sc_iot, sc->sc_sb800_ioh,
+		reg = bus_space_read_1(sc->sc_iot, sc->sc_sb800_bh,
 		SB800_INDIRECTIO_DATA);
 		reg &= ~mask;
 		reg |= __SHIFTIN(smbus->sda_save, mask);
-		bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh,
+		bus_space_write_1(sc->sc_iot, sc->sc_sb800_bh,
 		SB800_INDIRECTIO_DATA, reg);
 	}
 
 	/* Release the host semaphore */
-	sctl = bus_space_read_1(sc->sc_smb_iot, 

CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:27:10 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Simplify and modify for following MMIO support. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/piixpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:26:08 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify comment. Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/piixpm.c

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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.67 src/sys/dev/pci/piixpm.c:1.68
--- src/sys/dev/pci/piixpm.c:1.67	Fri Apr  1 15:34:34 2022
+++ src/sys/dev/pci/piixpm.c	Mon Jan  9 16:26:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $ */
+/* $NetBSD: piixpm.c,v 1.68 2023/01/09 16:26:08 msaitoh Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.68 2023/01/09 16:26:08 msaitoh Exp $");
 
 #include 
 #include 
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 
 #define PIIXPM_IS_CSB5(sc)		  \
 	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
-	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -76,7 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 struct piixpm_smbus {
 	int			sda;
 	int			sda_save;
-	struct			piixpm_softc *softc;
+	struct piixpm_softc	*softc;
 };
 
 struct piixpm_softc {
@@ -424,7 +424,7 @@ piixpm_sb800_init(struct piixpm_softc *s
 	else
 		sc->sc_numbusses = 4;
 
-	/* Fetch SMB base address */
+	/* Check SMBus enable bit and Fetch SMB base address */
 	if (bus_space_map(iot,
 	SB800_INDIRECTIO_BASE, SB800_INDIRECTIO_SIZE, 0, )) {
 		device_printf(sc->sc_dev, "couldn't map indirect I/O space\n");



CVS commit: src/sys/dev/pci

2023-01-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan  9 16:26:08 UTC 2023

Modified Files:
src/sys/dev/pci: piixpm.c

Log Message:
Modify comment. Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/piixpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan  5 14:50:14 UTC 2023

Modified Files:
src/sys/dev/pci: sdhc_pci.c

Log Message:
Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.
This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/sdhc_pci.c

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/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.20 src/sys/dev/pci/sdhc_pci.c:1.21
--- src/sys/dev/pci/sdhc_pci.c:1.20	Wed Jan  4 03:24:00 2023
+++ src/sys/dev/pci/sdhc_pci.c	Thu Jan  5 14:50:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.20 2023/01/04 03:24:00 msaitoh Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.21 2023/01/05 14:50:14 msaitoh Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.20 2023/01/04 03:24:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.21 2023/01/05 14:50:14 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -161,7 +161,8 @@ static const struct sdhc_pci_quirk {
 		0x,
 		0x,
 		~0,
-		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
 	},
 
 	{
@@ -172,6 +173,97 @@ static const struct sdhc_pci_quirk {
 		~0,
 		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET
 	},
+
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_C3K_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_BAYTRAIL_SCC_MMC2,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_APL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_GLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_3HS_U_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_495_YU_PCIE_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_CMTLK_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_JSL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
+	{
+		PCI_VENDOR_INTEL,
+		PCI_PRODUCT_INTEL_EHL_EMMC,
+		0x,
+		0x,
+		~0,
+		SDHC_PCI_QUIRK_INTEL_EMMC_HW_RESET |
+		SDHC_PCI_QUIRK_NO_PWR0
+	},
 };
 
 static void sdhc_pci_quirk_ti_hack(struct pci_attach_args *);



CVS commit: src/sys/dev/pci

2023-01-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan  5 14:50:14 UTC 2023

Modified Files:
src/sys/dev/pci: sdhc_pci.c

Log Message:
Add quirk setting for some Intel eMMC devices.

 On some Intel eMMC controllers, the driver reports "autoconfiguration error:
couldn't enable card: 60" even though they really have eMMC device.
This change fixes the problem on some machines. It might be required more
quirks for newer devices (or HS400 support). At least, this change fixes the
problem on GIGABYTE MA10-ST0.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:24:00 UTC 2023

Modified Files:
src/sys/dev/pci: sdhc_pci.c

Log Message:
Fix typo. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/sdhc_pci.c

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/sdhc_pci.c
diff -u src/sys/dev/pci/sdhc_pci.c:1.19 src/sys/dev/pci/sdhc_pci.c:1.20
--- src/sys/dev/pci/sdhc_pci.c:1.19	Fri Oct 14 07:54:49 2022
+++ src/sys/dev/pci/sdhc_pci.c	Wed Jan  4 03:24:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.19 2022/10/14 07:54:49 jmcneill Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.20 2023/01/04 03:24:00 msaitoh Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.19 2022/10/14 07:54:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.20 2023/01/04 03:24:00 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -157,7 +157,7 @@ static const struct sdhc_pci_quirk {
 
 	{
 		PCI_VENDOR_INTEL,
-		PCI_PRODUCT_INTEL_BSW_SSC_MMC,
+		PCI_PRODUCT_INTEL_BSW_SCC_MMC,
 		0x,
 		0x,
 		~0,



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:24:00 UTC 2023

Modified Files:
src/sys/dev/pci: sdhc_pci.c

Log Message:
Fix typo. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/sdhc_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:12:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1454 -r1.1455 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1453 -r1.1454 src/sys/dev/pci/pcidevs_data.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/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1454 src/sys/dev/pci/pcidevs.h:1.1455
--- src/sys/dev/pci/pcidevs.h:1.1454	Fri Dec 30 15:25:14 2022
+++ src/sys/dev/pci/pcidevs.h	Wed Jan  4 03:12:31 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1454 2022/12/30 15:25:14 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1455 2023/01/04 03:12:31 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1474 2023/01/04 03:12:09 msaitoh Exp
  */
 
 /*
@@ -4667,9 +4667,9 @@
 #define	PCI_PRODUCT_INTEL_Z8K_LPIO1_SPI_1	0x228e		/* Atom Z8000 LPIO1 SPI1 */
 #define	PCI_PRODUCT_INTEL_Z8K_LPIO1_SPI_2	0x2290		/* Atom Z8000 LPIO1 SPI2 */
 #define	PCI_PRODUCT_INTEL_BSW_PCU_SMB	0x2292		/* Braswell PCU SMBus */
-#define	PCI_PRODUCT_INTEL_BSW_SSC_MMC	0x2294		/* Braswell SCC MMC Port */
-#define	PCI_PRODUCT_INTEL_BSW_SSC_SDIO	0x2295		/* Braswell SCC SDIO Port */
-#define	PCI_PRODUCT_INTEL_BSW_SSC_SD	0x2296		/* Braswell SCC SD Port */
+#define	PCI_PRODUCT_INTEL_BSW_SCC_MMC	0x2294		/* Braswell SCC MMC Port */
+#define	PCI_PRODUCT_INTEL_BSW_SCC_SDIO	0x2295		/* Braswell SCC SDIO Port */
+#define	PCI_PRODUCT_INTEL_BSW_SCC_SD	0x2296		/* Braswell SCC SD Port */
 #define	PCI_PRODUCT_INTEL_BSW_TXE	0x2298		/* Braswell TXE */
 #define	PCI_PRODUCT_INTEL_BSW_PCU_LPC	0x229c		/* Braswell PCU LPC */
 #define	PCI_PRODUCT_INTEL_BSW_AHCI	0x22a3		/* Braswell AHCI */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1453 src/sys/dev/pci/pcidevs_data.h:1.1454
--- src/sys/dev/pci/pcidevs_data.h:1.1453	Fri Dec 30 15:25:14 2022
+++ src/sys/dev/pci/pcidevs_data.h	Wed Jan  4 03:12:31 2023
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1453 2022/12/30 15:25:14 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1454 2023/01/04 03:12:31 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1474 2023/01/04 03:12:09 msaitoh Exp
  */
 
 /*
@@ -8035,11 +8035,11 @@ static const uint32_t pci_products[] = {
 	23855, 26628, 26634, 26655, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_PCU_SMB, 
 	26611, 24145, 8807, 0,
-	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SSC_MMC, 
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SCC_MMC, 
 	26611, 22797, 26660, 8096, 0,
-	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SSC_SDIO, 
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SCC_SDIO, 
 	26611, 22797, 26664, 8096, 0,
-	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SSC_SD, 
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_SCC_SD, 
 	26611, 22797, 8862, 8096, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_BSW_TXE, 
 	26611, 26669, 0,



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:12:32 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1454 -r1.1455 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1453 -r1.1454 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:12:09 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Fix typo. s/SSC/SCC/.


To generate a diff of this commit:
cvs rdiff -u -r1.1473 -r1.1474 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1473 src/sys/dev/pci/pcidevs:1.1474
--- src/sys/dev/pci/pcidevs:1.1473	Fri Dec 30 15:24:38 2022
+++ src/sys/dev/pci/pcidevs	Wed Jan  4 03:12:09 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1474 2023/01/04 03:12:09 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4660,9 +4660,9 @@ product INTEL BSW_SIO_HSUART_2	0x228c	Br
 product INTEL Z8K_LPIO1_SPI_1	0x228e	Atom Z8000 LPIO1 SPI1
 product INTEL Z8K_LPIO1_SPI_2	0x2290	Atom Z8000 LPIO1 SPI2
 product INTEL BSW_PCU_SMB	0x2292	Braswell PCU SMBus
-product INTEL BSW_SSC_MMC	0x2294	Braswell SCC MMC Port
-product INTEL BSW_SSC_SDIO	0x2295	Braswell SCC SDIO Port
-product INTEL BSW_SSC_SD	0x2296	Braswell SCC SD Port
+product INTEL BSW_SCC_MMC	0x2294	Braswell SCC MMC Port
+product INTEL BSW_SCC_SDIO	0x2295	Braswell SCC SDIO Port
+product INTEL BSW_SCC_SD	0x2296	Braswell SCC SD Port
 product INTEL BSW_TXE		0x2298	Braswell TXE
 product INTEL BSW_PCU_LPC	0x229c	Braswell PCU LPC
 product INTEL BSW_AHCI		0x22a3	Braswell AHCI



CVS commit: src/sys/dev/pci

2023-01-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  4 03:12:09 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Fix typo. s/SSC/SCC/.


To generate a diff of this commit:
cvs rdiff -u -r1.1473 -r1.1474 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Jan  3 19:33:32 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Subtly adjust criteria for notification of Virtio devices in
VIRTIO_F_RING_EVENT_IDX mode.

This fixes stalls in the vioif(4) transmit path that would happen sooner
or later, depending on interface transmit utilization, and were
particularly noticable with a NetBSD guest transmitting to its x86 KVM
host at multi-gigabit speeds.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-01-03 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Jan  3 19:33:32 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Subtly adjust criteria for notification of Virtio devices in
VIRTIO_F_RING_EVENT_IDX mode.

This fixes stalls in the vioif(4) transmit path that would happen sooner
or later, depending on interface transmit utilization, and were
particularly noticable with a NetBSD guest transmitting to its x86 KVM
host at multi-gigabit speeds.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/virtio.c

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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.64 src/sys/dev/pci/virtio.c:1.65
--- src/sys/dev/pci/virtio.c:1.64	Fri Dec 30 21:38:13 2022
+++ src/sys/dev/pci/virtio.c	Tue Jan  3 19:33:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $	*/
+/*	$NetBSD: virtio.c,v 1.65 2023/01/03 19:33:31 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.65 2023/01/03 19:33:31 jakllsch Exp $");
 
 #include 
 #include 
@@ -1148,7 +1148,7 @@ notify:
 		uint16_t o, n, t;
 		uint16_t flags;
 
-		o = virtio_rw16(sc, vq->vq_avail->idx);
+		o = virtio_rw16(sc, vq->vq_avail->idx) - 1;
 		n = vq->vq_avail_idx;
 
 		/*



CVS commit: src/sys/dev/pci

2022-12-30 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec 30 21:38:13 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Fix dmamap_syncs more; the number of ring elements is vq->vq_num, not
sc->sc_nvqs.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/virtio.c

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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.63 src/sys/dev/pci/virtio.c:1.64
--- src/sys/dev/pci/virtio.c:1.63	Mon Oct 31 13:00:34 2022
+++ src/sys/dev/pci/virtio.c	Fri Dec 30 21:38:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.63 2022/10/31 13:00:34 simonb Exp $	*/
+/*	$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.63 2022/10/31 13:00:34 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $");
 
 #include 
 #include 
@@ -450,7 +450,7 @@ static inline void
 vq_sync_aring_all(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_avail, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(uint16_t);
+	size_t payloadlen = vq->vq_num * sizeof(uint16_t);
 	size_t usedlen = 0;
 
 	if (sc->sc_active_features & VIRTIO_F_RING_EVENT_IDX)
@@ -472,7 +472,7 @@ static inline void
 vq_sync_aring_payload(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_avail, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(uint16_t);
+	size_t payloadlen = vq->vq_num * sizeof(uint16_t);
 
 	bus_dmamap_sync(sc->sc_dmat, vq->vq_dmamap,
 	vq->vq_availoffset + hdrlen, payloadlen, ops);
@@ -482,7 +482,7 @@ static inline void
 vq_sync_aring_used(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_avail, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(uint16_t);
+	size_t payloadlen = vq->vq_num * sizeof(uint16_t);
 	size_t usedlen = sizeof(uint16_t);
 
 	if ((sc->sc_active_features & VIRTIO_F_RING_EVENT_IDX) == 0)
@@ -495,7 +495,7 @@ static inline void
 vq_sync_uring_all(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_used, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(struct vring_used_elem);
+	size_t payloadlen = vq->vq_num * sizeof(struct vring_used_elem);
 	size_t availlen = 0;
 
 	if (sc->sc_active_features & VIRTIO_F_RING_EVENT_IDX)
@@ -517,7 +517,7 @@ static inline void
 vq_sync_uring_payload(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_used, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(struct vring_used_elem);
+	size_t payloadlen = vq->vq_num * sizeof(struct vring_used_elem);
 
 	bus_dmamap_sync(sc->sc_dmat, vq->vq_dmamap,
 	vq->vq_usedoffset + hdrlen, payloadlen, ops);
@@ -527,7 +527,7 @@ static inline void
 vq_sync_uring_avail(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 	uint16_t hdrlen = offsetof(struct vring_used, ring);
-	size_t payloadlen = sc->sc_nvqs * sizeof(struct vring_used_elem);
+	size_t payloadlen = vq->vq_num * sizeof(struct vring_used_elem);
 	size_t availlen = sizeof(uint16_t);
 
 	if ((sc->sc_active_features & VIRTIO_F_RING_EVENT_IDX) == 0)



CVS commit: src/sys/dev/pci

2022-12-30 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Dec 30 21:38:13 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Fix dmamap_syncs more; the number of ring elements is vq->vq_num, not
sc->sc_nvqs.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 30 15:25:15 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1453 -r1.1454 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1452 -r1.1453 src/sys/dev/pci/pcidevs_data.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/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1453 src/sys/dev/pci/pcidevs.h:1.1454
--- src/sys/dev/pci/pcidevs.h:1.1453	Wed Dec 28 13:27:11 2022
+++ src/sys/dev/pci/pcidevs.h	Fri Dec 30 15:25:14 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1453 2022/12/28 13:27:11 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1454 2022/12/30 15:25:14 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1472 2022/12/28 13:26:44 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp
  */
 
 /*
@@ -5919,6 +5919,7 @@
 #define	PCI_PRODUCT_INTEL_EHL_SIO_I2C_3	0x4b7b		/* Elkhart Lake SIO I2C 3 */
 #define	PCI_PRODUCT_INTEL_EHL_XHCI	0x4b7d		/* Elkhart Lake xHCI */
 #define	PCI_PRODUCT_INTEL_EHL_XDCI	0x4b7e		/* Elkhart Lake xDCI */
+#define	PCI_PRODUCT_INTEL_EHL_SSRAM	0x4b7f		/* Elkhart Lake Shared SRAM */
 #define	PCI_PRODUCT_INTEL_EHL_PSE_QEP_1	0x4b81		/* Elkhart Lake PSE QEP 1 */
 #define	PCI_PRODUCT_INTEL_EHL_PSE_QEP_2	0x4b82		/* Elkhart Lake PSE QEP 2 */
 #define	PCI_PRODUCT_INTEL_EHL_PSE_QEP_3	0x4b83		/* Elkhart Lake PSE QEP 3 */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1452 src/sys/dev/pci/pcidevs_data.h:1.1453
--- src/sys/dev/pci/pcidevs_data.h:1.1452	Wed Dec 28 13:27:10 2022
+++ src/sys/dev/pci/pcidevs_data.h	Fri Dec 30 15:25:14 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1452 2022/12/28 13:27:10 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1453 2022/12/30 15:25:14 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1472 2022/12/28 13:26:44 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp
  */
 
 /*
@@ -10539,6 +10539,8 @@ static const uint32_t pci_products[] = {
 	28757, 23042, 8183, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EHL_XDCI, 
 	28757, 23042, 23258, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EHL_SSRAM, 
+	28757, 23042, 23263, 23270, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EHL_PSE_QEP_1, 
 	28757, 23042, 29240, 29244, 8079, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_EHL_PSE_QEP_2, 
@@ -20858,7 +20860,7 @@ static const char pci_words[] = { "." 
 	"TwinTurbo\0" /* 1 refs @ 23022 */
 	"128M\0" /* 1 refs @ 23032 */
 	"Iron\0" /* 6 refs @ 23037 */
-	"Lake\0" /* 408 refs @ 23042 */
+	"Lake\0" /* 409 refs @ 23042 */
 	"Core\0" /* 181 refs @ 23047 */
 	"Centrino\0" /* 28 refs @ 23052 */
 	"Advanced-N\0" /* 10 refs @ 23061 */
@@ -20898,8 +20900,8 @@ static const char pci_words[] = { "." 
 	"2x1\0" /* 5 refs @ 23250 */
 	"1x1\0" /* 7 refs @ 23254 */
 	"xDCI\0" /* 8 refs @ 23258 */
-	"Shared\0" /* 12 refs @ 23263 */
-	"SRAM\0" /* 12 refs @ 23270 */
+	"Shared\0" /* 13 refs @ 23263 */
+	"SRAM\0" /* 13 refs @ 23270 */
 	"CNVi\0" /* 8 refs @ 23275 */
 	"SDXC\0" /* 5 refs @ 23280 */
 	"Thermal\0" /* 45 refs @ 23285 */
@@ -21698,7 +21700,7 @@ static const char pci_words[] = { "." 
 	"mobile)\0" /* 4 refs @ 28738 */
 	"(RAID,\0" /* 6 refs @ 28746 */
 	"2x2\0" /* 2 refs @ 28753 */
-	"Elkhart\0" /* 119 refs @ 28757 */
+	"Elkhart\0" /* 120 refs @ 28757 */
 	"(2C,\0" /* 1 refs @ 28765 */
 	"(SKU\0" /* 25 refs @ 28770 */
 	"8)\0" /* 1 refs @ 28775 */



CVS commit: src/sys/dev/pci

2022-12-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 30 15:25:15 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1453 -r1.1454 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1452 -r1.1453 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 30 15:24:38 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Elkhart Lake Shared SRAM.


To generate a diff of this commit:
cvs rdiff -u -r1.1472 -r1.1473 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1472 src/sys/dev/pci/pcidevs:1.1473
--- src/sys/dev/pci/pcidevs:1.1472	Wed Dec 28 13:26:44 2022
+++ src/sys/dev/pci/pcidevs	Fri Dec 30 15:24:38 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1472 2022/12/28 13:26:44 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1473 2022/12/30 15:24:38 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5912,6 +5912,7 @@ product INTEL EHL_SIO_I2C_2	0x4b7a	Elkha
 product INTEL EHL_SIO_I2C_3	0x4b7b	Elkhart Lake SIO I2C 3
 product INTEL EHL_XHCI		0x4b7d	Elkhart Lake xHCI
 product INTEL EHL_XDCI		0x4b7e	Elkhart Lake xDCI
+product INTEL EHL_SSRAM		0x4b7f	Elkhart Lake Shared SRAM
 product INTEL EHL_PSE_QEP_1	0x4b81	Elkhart Lake PSE QEP 1
 product INTEL EHL_PSE_QEP_2	0x4b82	Elkhart Lake PSE QEP 2
 product INTEL EHL_PSE_QEP_3	0x4b83	Elkhart Lake PSE QEP 3



CVS commit: src/sys/dev/pci

2022-12-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 30 15:24:38 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Elkhart Lake Shared SRAM.


To generate a diff of this commit:
cvs rdiff -u -r1.1472 -r1.1473 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 13:27:11 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1452 -r1.1453 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1451 -r1.1452 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 13:26:44 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Update Intel Elkhart Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1471 -r1.1472 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1471 src/sys/dev/pci/pcidevs:1.1472
--- src/sys/dev/pci/pcidevs:1.1471	Tue Nov 22 14:55:28 2022
+++ src/sys/dev/pci/pcidevs	Wed Dec 28 13:26:44 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1471 2022/11/22 14:55:28 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1472 2022/12/28 13:26:44 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5782,25 +5782,33 @@ product INTEL 5HS_H_GSPI_2	0x43fb	500 Se
 product INTEL 5HS_H_ISH		0x43fc	500 Series PCH-H Integrated Sensor Hub
 product INTEL 5HS_H_GSPI_3	0x43fd	500 Series PCH-H GSPI 3
 product INTEL EHL_DPTF		0x4503	Elkhart Lake DPTF
+product INTEL EHL_TROUTER_2C_S	0x4510	Elkhart Lake Transaction Router (2C, Super SKU)
 product INTEL EHL_GNA		0x4511	Elkhart Lake GNA
 product INTEL EHL_TROUTER_3	0x4512	Elkhart Lake Transaction Router (SKU 3)
 product INTEL EHL_TROUTER_5	0x4514	Elkhart Lake Transaction Router (SKU 5)
 product INTEL EHL_TROUTER_8	0x4516	Elkhart Lake Transaction Router (SKU 8)
 product INTEL EHL_TROUTER_12	0x4518	Elkhart Lake Transaction Router (SKU 12)
 product INTEL EHL_TROUTER_3A	0x451e	Elkhart Lake Transaction Router (SKU 3A)
+product INTEL EHL_TROUTER_4C_S	0x4520	Elkhart Lake Transaction Router (4C, Super SKU)
 product INTEL EHL_TROUTER_1	0x4522	Elkhart Lake Transaction Router (SKU 1)
+product INTEL EHL_TROUTER_2_PREQS 0x4524 Elkhart Lake Transaction Router (SKU 2, pre-QS)
 product INTEL EHL_TROUTER_4	0x4526	Elkhart Lake Transaction Router (SKU 4)
 product INTEL EHL_TROUTER_6	0x4528	Elkhart Lake Transaction Router (SKU 6)
 product INTEL EHL_TRACE_2	0x4529	Elkhart Lake Trace Hub (Compute Die)
 product INTEL EHL_TROUTER_7	0x452a	Elkhart Lake Transaction Router (SKU 7)
 product INTEL EHL_TROUTER_9	0x452c	Elkhart Lake Transaction Router (SKU 9)
 product INTEL EHL_TROUTER_10	0x452e	Elkhart Lake Transaction Router (SKU 10)
+product INTEL EHL_TROUTER_4C_S_2 0x4530	Elkhart Lake Transaction Router (4C, Super SKU)
 product INTEL EHL_TROUTER_11	0x4532	Elkhart Lake Transaction Router (SKU 11)
 product INTEL EHL_TROUTER_1A	0x4538	Elkhart Lake Transaction Router (SKU 1A)
 product INTEL EHL_TROUTER_2	0x453a	Elkhart Lake Transaction Router (SKU 2)
-product INTEL EHL_GPU_16	0x4551	Elkhart Lake GPU (16EU)
-product INTEL EHL_GPU_32_SUPER	0x4551	Elkhart Lake GPU (32EU Super)
-product INTEL EHL_GPU_32	0x4551	Elkhart Lake GPU (32EU)
+product INTEL EHL_GPU_8EU_S	0x4540	Elkhart Lake GPU (8EU Super)
+product INTEL EHL_GPU_8EU	0x4541	Elkhart Lake GPU (8EU Super)
+product INTEL EHL_GPU_16EU_S	0x4550	Elkhart Lake GPU (16EU Super)
+product INTEL EHL_GPU_16EU_OLD	0x4551	Elkhart Lake GPU (16EU)
+product INTEL EHL_GPU_16EU	0x4555	Elkhart Lake GPU (16EU)
+product INTEL EHL_GPU_32_S	0x4570	Elkhart Lake GPU (32EU Super)
+product INTEL EHL_GPU_32	0x4571	Elkhart Lake GPU (32EU)
 product INTEL ADL_U15_2_8_HOST	0x4601	Alder Lake (U15,2+8) Host
 product INTEL ADL_U9_2_8_HOST	0x4602	Alder Lake (U9,2+8) Host
 product INTEL ADL_U15_2_4_HOST	0x4609	Alder Lake (U15,2+4) Host
@@ -5889,6 +5897,7 @@ product INTEL EHL_CAVS_6	0x4b5a	Elkhart 
 product INTEL EHL_CAVS_7	0x4b5b	Elkhart Lake cAVS
 product INTEL EHL_CAVS_8	0x4b5c	Elkhart Lake cAVS
 product INTEL EHL_AHCI		0x4b60	Elkhart Lake AHCI
+product INTEL EHL_AHCI_2	0x4b63	Elkhart Lake AHCI
 product INTEL EHL_HPET		0x4b68	Elkhart Lake HPET
 product INTEL EHL_IOAPIC	0x4b69	Elkhart Lake IOAPIC
 product INTEL EHL_CSE_PTTDMA	0x4b6b	Elkhart Lake CSE PTT DMA
@@ -5925,7 +5934,7 @@ product INTEL EHL_PSE_ETH_0_SGMII_1G 0x4
 product INTEL EHL_PSE_ETH_0_SGMII_2_5G 0x4ba2 Elkhart Lake PSE Ethernet 0 (SGMII 2.5G)
 product INTEL EHL_PSE_ETH_1_RGMII 0x4bb0 Elkhart Lake PSE Ethernet 1 (RGMII 1G)
 product INTEL EHL_PSE_ETH_1_SGMII_1G 0x4bb1 Elkhart Lake PSE Ethernet 1 (SGMII 1G)
-product INTEL EHL_PSE_ETH_1_SGMII_2_5G 0x4bb2 Elkhart Lake PSE Ethernet 1 (SGMII 1G)
+product INTEL EHL_PSE_ETH_1_SGMII_2_5G 0x4bb2 Elkhart Lake PSE Ethernet 1 (SGMII 2.5G)
 product INTEL EHL_PSE_LH2OSE	0x4bb3	Elkhart Lake PSE LH2OSE
 product INTEL EHL_PSE_DMA_0	0x4bb4	Elkhart Lake PSE DMA 0
 product INTEL EHL_PSE_DMA_1	0x4bb5	Elkhart Lake PSE DMA 1



CVS commit: src/sys/dev/pci

2022-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 13:26:44 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Update Intel Elkhart Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1471 -r1.1472 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed Dec 21 05:19:15 UTC 2022

Modified Files:
src/sys/dev/pci: if_rge.c if_rgereg.h

Log Message:
Update the Rx descriptor based on the vendor driver for Linux.

This fixes a panic on RTL8125.
Patch from OpenBSD if_rge.c r1.20, if_rgereg.h r1.8.

Tested by msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_rge.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_rgereg.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/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.24 src/sys/dev/pci/if_rge.c:1.25
--- src/sys/dev/pci/if_rge.c:1.24	Sat Sep 24 18:12:42 2022
+++ src/sys/dev/pci/if_rge.c	Wed Dec 21 05:19:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.24 2022/09/24 18:12:42 thorpej Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.25 2022/12/21 05:19:15 nonaka Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.24 2022/09/24 18:12:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.25 2022/12/21 05:19:15 nonaka Exp $");
 
 #include 
 
@@ -1132,22 +1132,16 @@ rge_newbuf(struct rge_softc *sc, int idx
 	/* Map the segments into RX descriptors. */
 	r = >rge_ldata.rge_rx_list[idx];
 
-	if (RGE_OWN(r)) {
-		device_printf(sc->sc_dev, "tried to map busy RX descriptor\n");
-		goto out;
-	}
-
 	rxq->rxq_mbuf = m;
 
-	r->rge_extsts = 0;
-	r->rge_addrlo = htole32(RGE_ADDR_LO(rxmap->dm_segs[0].ds_addr));
-	r->rge_addrhi = htole32(RGE_ADDR_HI(rxmap->dm_segs[0].ds_addr));
+	r->hi_qword1.rx_qword4.rge_extsts = 0;
+	r->hi_qword0.rge_addr = htole64(rxmap->dm_segs[0].ds_addr);
 
-	r->rge_cmdsts = htole32(rxmap->dm_segs[0].ds_len);
+	r->hi_qword1.rx_qword4.rge_cmdsts = htole32(rxmap->dm_segs[0].ds_len);
 	if (idx == RGE_RX_LIST_CNT - 1)
-		r->rge_cmdsts |= htole32(RGE_RDCMDSTS_EOR);
+		r->hi_qword1.rx_qword4.rge_cmdsts |= htole32(RGE_RDCMDSTS_EOR);
 
-	r->rge_cmdsts |= htole32(RGE_RDCMDSTS_OWN);
+	r->hi_qword1.rx_qword4.rge_cmdsts |= htole32(RGE_RDCMDSTS_OWN);
 
 	bus_dmamap_sync(sc->sc_dmat, sc->rge_ldata.rge_rx_list_map,
 	idx * sizeof(struct rge_rx_desc), sizeof(struct rge_rx_desc),
@@ -1167,11 +1161,11 @@ rge_discard_rxbuf(struct rge_softc *sc, 
 
 	r = >rge_ldata.rge_rx_list[idx];
 
-	r->rge_cmdsts = htole32(RGE_JUMBO_FRAMELEN);
-	r->rge_extsts = 0;
+	r->hi_qword1.rx_qword4.rge_cmdsts = htole32(RGE_JUMBO_FRAMELEN);
+	r->hi_qword1.rx_qword4.rge_extsts = 0;
 	if (idx == RGE_RX_LIST_CNT - 1)
-		r->rge_cmdsts |= htole32(RGE_RDCMDSTS_EOR);
-	r->rge_cmdsts |= htole32(RGE_RDCMDSTS_OWN);
+		r->hi_qword1.rx_qword4.rge_cmdsts |= htole32(RGE_RDCMDSTS_EOR);
+	r->hi_qword1.rx_qword4.rge_cmdsts |= htole32(RGE_RDCMDSTS_OWN);
 
 	bus_dmamap_sync(sc->sc_dmat, sc->rge_ldata.rge_rx_list_map,
 	idx * sizeof(struct rge_rx_desc), sizeof(struct rge_rx_desc),
@@ -1235,8 +1229,8 @@ rge_rxeof(struct rge_softc *sc)
 		if (RGE_OWN(cur_rx))
 			break;
 
-		rxstat = letoh32(cur_rx->rge_cmdsts);
-		extsts = letoh32(cur_rx->rge_extsts);
+		rxstat = letoh32(cur_rx->hi_qword1.rx_qword4.rge_cmdsts);
+		extsts = letoh32(cur_rx->hi_qword1.rx_qword4.rge_extsts);
 
 		total_len = RGE_RXBYTES(cur_rx);
 		rxq = >rge_ldata.rge_rxq[i];
@@ -1317,16 +1311,16 @@ rge_rxeof(struct rge_softc *sc)
 
 #if notyet
 		/* Check IP header checksum. */
-		if (!(rxstat & RGE_RDCMDSTS_IPCSUMERR) &&
+		if (!(extsts & RGE_RDEXTSTS_IPCSUMERR) &&
 		(extsts & RGE_RDEXTSTS_IPV4))
 			m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK;
 
 		/* Check TCP/UDP checksum. */
 		if ((extsts & (RGE_RDEXTSTS_IPV4 | RGE_RDEXTSTS_IPV6)) &&
-		(((rxstat & RGE_RDCMDSTS_TCPPKT) &&
-		!(rxstat & RGE_RDCMDSTS_TCPCSUMERR)) ||
-		((rxstat & RGE_RDCMDSTS_UDPPKT) &&
-		!(rxstat & RGE_RDCMDSTS_UDPCSUMERR
+		(((extsts & RGE_RDEXTSTS_TCPPKT) &&
+		!(extsts & RGE_RDEXTSTS_TCPCSUMERR)) ||
+		((extsts & RGE_RDEXTSTS_UDPPKT) &&
+		!(extsts & RGE_RDEXTSTS_UDPCSUMERR
 			m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK |
 			M_UDP_CSUM_IN_OK;
 #endif

Index: src/sys/dev/pci/if_rgereg.h
diff -u src/sys/dev/pci/if_rgereg.h:1.6 src/sys/dev/pci/if_rgereg.h:1.7
--- src/sys/dev/pci/if_rgereg.h:1.6	Sun Aug 28 07:44:23 2022
+++ src/sys/dev/pci/if_rgereg.h	Wed Dec 21 05:19:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rgereg.h,v 1.6 2022/08/28 07:44:23 skrll Exp $	*/
+/*	$NetBSD: if_rgereg.h,v 1.7 2022/12/21 05:19:15 nonaka Exp $	*/
 /*	$OpenBSD: if_rgereg.h,v 1.6 2020/12/24 01:00:00 kevlo Exp $	*/
 
 /*
@@ -188,9 +188,10 @@
 #define RGE_NEXT_RX_DESC(x)	(((x) + 1) % RGE_RX_LIST_CNT)
 #define RGE_ADDR_LO(y)		((uint64_t) (y) & 0x)
 #define RGE_ADDR_HI(y)		((uint64_t) (y) >> 32)
-#define RGE_OWN(x)		(letoh32((x)->rge_cmdsts) & RGE_RDCMDSTS_OWN)
-#define RGE_RXBYTES(x)  (letoh32((x)->rge_cmdsts) & \
-RGE_RDCMDSTS_FRAGLEN)
+#define RGE_OWN(x)			\
+

CVS commit: src/sys/dev/pci

2022-12-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed Dec 21 05:19:15 UTC 2022

Modified Files:
src/sys/dev/pci: if_rge.c if_rgereg.h

Log Message:
Update the Rx descriptor based on the vendor driver for Linux.

This fixes a panic on RTL8125.
Patch from OpenBSD if_rge.c r1.20, if_rgereg.h r1.8.

Tested by msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_rge.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_rgereg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-12-08 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Dec  8 08:14:28 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Workaround for some hypervisor environments.

The environments cannot stop e1000 interrupt immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.766 -r1.767 src/sys/dev/pci/if_wm.c

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/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.766 src/sys/dev/pci/if_wm.c:1.767
--- src/sys/dev/pci/if_wm.c:1.766	Wed Oct 26 06:36:39 2022
+++ src/sys/dev/pci/if_wm.c	Thu Dec  8 08:14:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.766 2022/10/26 06:36:39 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.767 2022/12/08 08:14:28 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.766 2022/10/26 06:36:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.767 2022/12/08 08:14:28 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -478,6 +478,7 @@ struct wm_queue {
 	char sysctlname[32];		/* Name for sysctl */
 
 	bool wmq_txrx_use_workqueue;
+	bool wmq_wq_enqueued;
 	struct work wmq_cookie;
 	void *wmq_si;
 };
@@ -10308,9 +10309,13 @@ static inline void
 wm_sched_handle_queue(struct wm_softc *sc, struct wm_queue *wmq)
 {
 
-	if (wmq->wmq_txrx_use_workqueue)
-		workqueue_enqueue(sc->sc_queue_wq, >wmq_cookie, curcpu());
-	else
+	if (wmq->wmq_txrx_use_workqueue) {
+		if (!wmq->wmq_wq_enqueued) {
+			wmq->wmq_wq_enqueued = true;
+			workqueue_enqueue(sc->sc_queue_wq, >wmq_cookie,
+			curcpu());
+		}
+	} else
 		softint_schedule(wmq->wmq_si);
 }
 
@@ -10593,8 +10598,10 @@ wm_handle_queue_work(struct work *wk, vo
 	struct wm_queue *wmq = container_of(wk, struct wm_queue, wmq_cookie);
 
 	/*
-	 * "enqueued flag" is not required here.
+	 * Some qemu environment workaround.  They don't stop interrupt
+	 * immediately.
 	 */
+	wmq->wmq_wq_enqueued = false;
 	wm_handle_queue(wmq);
 }
 



CVS commit: src/sys/dev/pci

2022-12-08 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Dec  8 08:14:28 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Workaround for some hypervisor environments.

The environments cannot stop e1000 interrupt immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.766 -r1.767 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:53 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1451 -r1.1452 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1450 -r1.1451 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:28 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some Xeon Scalable devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1470 -r1.1471 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1470 src/sys/dev/pci/pcidevs:1.1471
--- src/sys/dev/pci/pcidevs:1.1470	Wed Oct 26 14:50:26 2022
+++ src/sys/dev/pci/pcidevs	Tue Nov 22 14:55:28 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1470 2022/10/26 14:50:26 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1471 2022/11/22 14:55:28 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4599,17 +4599,23 @@ product INTEL XEONSC_UBOX_0	0x2014	Xeon 
 product INTEL XEONSC_UBOX_1	0x2015	Xeon Scalable Ubox
 product INTEL XEONSC_UBOX_2	0x2016	Xeon Scalable Ubox
 product INTEL XEONSC_M2PCIR	0x2018	Xeon Scalable M2PCI
+product INTEL XEONSC_HB		0x2020	Xeon Scalable Host
 product INTEL XEONSC_CBDMAR	0x2021	Xeon Scalable CBDMA
 product INTEL XEONSC_MMVTD	0x2024	Xeon Scalable MM/Vt-d
 product INTEL XEONSC_RAS	0x2025	Xeon Scalable RAS
 product INTEL XEONSC_IOAPIC	0x2026	Xeon Scalable I/O APIC
+product INTEL XEONSC_PCIE_1	0x2030	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_2	0x2031	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_3	0x2032	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_4	0x2033	Xeon Scalable PCIe
 product INTEL XEONSC_VTD	0x2034	Xeon Scalable VT-d
 product INTEL XEONSC_RAS_CFG	0x2035	Xeon Scalable RAS Configuration
 product INTEL XEONSC_IOAPIC_C	0x2036	Xeon Scalable IOxAPIC
-product INTEL XEONSC_IMC_1	0x2041	Xeon Scalable IMC
-product INTEL XEONSC_IMC_2	0x2042	Xeon Scalable IMC
-product INTEL XEONSC_IMC_3	0x2043  Xeon Scalable IMC
-product INTEL XEONSC_IMC_4	0x2044  Xeon Scalable IMC
+product INTEL XEONSC_IMC_1	0x2040	Xeon Scalable IMC
+product INTEL XEONSC_IMC_2	0x2041	Xeon Scalable IMC
+product INTEL XEONSC_IMC_3	0x2042	Xeon Scalable IMC
+product INTEL XEONSC_IMC_4	0x2043  Xeon Scalable IMC
+product INTEL XEONSC_IMC_5	0x2044  Xeon Scalable IMC
 product INTEL XEONSC_LMC_1	0x2045  Xeon Scalable LM
 product INTEL XEONSC_LMSC_1	0x2046  Xeon Scalable LMS
 product INTEL XEONSC_LMDPC_1	0x2047  Xeon Scalable LMDP
@@ -4619,15 +4625,29 @@ product INTEL XEONSC_LMSC_2	0x204a	Xeon 
 product INTEL XEONSC_LMDPC_2	0x204b	Xeon Scalable LMDP
 product INTEL XEONSC_M3KTI_1	0x204c	Xeon Scalable M3KTI
 product INTEL XEONSC_M3KTI_2	0x204d	Xeon Scalable M3KTI
+product INTEL XEONSC_M3KTI_3	0x204e	Xeon Scalable M3KTI
 product INTEL XEONSC_CHA_1	0x2054	Xeon Scalable CHA
 product INTEL XEONSC_CHA_2	0x2055	Xeon Scalable CHA
 product INTEL XEONSC_CHA_3	0x2056	Xeon Scalable CHA
 product INTEL XEONSC_CHA_4	0x2057	Xeon Scalable CHA
 product INTEL XEONSC_KTI	0x2058	Xeon Scalable KTI
 product INTEL XEONSC_UPIR	0x2059	Xeon Scalable UPI
-product INTEL XEONSC_PCU_0	0x2080	Xeon Scalable PCU
-product	INTEL XEONSC_PCU_1	0x2081  Xeon Scalable PCU
-product INTEL XEONSC_PCU_2	0x2082	Xeon Scalable PCU
+product INTEL XEONSC_IMC	0x2066	Xeon Scalable IMC
+product INTEL XEONSC_DDRIO_1	0x2068	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_2	0x2069	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_3	0x206a	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_4	0x206b	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_5	0x206c	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_6	0x206d	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_7	0x206e	Xeon Scalable DDRIO
+product INTEL XEONSC_PCU_1	0x2080	Xeon Scalable PCU
+product	INTEL XEONSC_PCU_2	0x2081  Xeon Scalable PCU
+product INTEL XEONSC_PCU_3	0x2082	Xeon Scalable PCU
+product INTEL XEONSC_PCU_4	0x2083	Xeon Scalable PCU
+product INTEL XEONSC_PCU_5	0x2084	Xeon Scalable PCU
+product INTEL XEONSC_PCU_6	0x2085	Xeon Scalable PCU
+product INTEL XEONSC_PCU_7	0x2086	Xeon Scalable PCU
+product INTEL XEONSC_M2PCIE	0x2088	Xeon Scalable M2PCIe
 product INTEL XEONSC_CHA_5	0x208d	Xeon Scalable CHA
 product INTEL XEONSC_CHA_6	0x208e	Xeon Scalable CHA
 product INTEL BSW_HB		0x2280	Braswell Soc Transaction Router



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:28 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some Xeon Scalable devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1470 -r1.1471 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-31 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Oct 31 13:00:34 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Use PRIx64 in a debug print macro to print a uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-31 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Oct 31 13:00:34 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
Use PRIx64 in a debug print macro to print a uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/virtio.c

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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.62 src/sys/dev/pci/virtio.c:1.63
--- src/sys/dev/pci/virtio.c:1.62	Tue Oct 18 04:20:56 2022
+++ src/sys/dev/pci/virtio.c	Mon Oct 31 13:00:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.62 2022/10/18 04:20:56 skrll Exp $	*/
+/*	$NetBSD: virtio.c,v 1.63 2022/10/31 13:00:34 simonb Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.62 2022/10/18 04:20:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.63 2022/10/31 13:00:34 simonb Exp $");
 
 #include 
 #include 
@@ -244,7 +244,7 @@ virtio_read_device_config_8(struct virti
 	if (BYTE_ORDER != sc->sc_struct_endian)
 		val = bswap64(val);
 
-	DPRINTFR("read_8", "%08lx", val, index, 8);
+	DPRINTFR("read_8", "%08"PRIx64, val, index, 8);
 	DPRINTFR2("read_8 low ", "%08x",
 	bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh,
 		index),



CVS commit: src/sys/dev/pci

2022-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 28 21:57:58 UTC 2022

Modified Files:
src/sys/dev/pci: xhci_pci.c

Log Message:
xhci(4): Mark PCI interrupt handler MP-safe.

xhci_intr has its own intr lock to coordinate with the MP-safe
softint it defers all its work to, other than reading and writing a
few registers to get and acknowledge the interrupt status.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/xhci_pci.c

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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.31 src/sys/dev/pci/xhci_pci.c:1.32
--- src/sys/dev/pci/xhci_pci.c:1.31	Tue Oct 11 09:18:22 2022
+++ src/sys/dev/pci/xhci_pci.c	Fri Oct 28 21:57:58 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.31 2022/10/11 09:18:22 msaitoh Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.32 2022/10/28 21:57:58 riastradh Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.31 2022/10/11 09:18:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.32 2022/10/28 21:57:58 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -229,6 +229,7 @@ xhci_pci_attach(device_t parent, device_
 	}
 	intrstr = pci_intr_string(pc, psc->sc_pihp[0], intrbuf,
 	sizeof(intrbuf));
+	pci_intr_setattr(pa->pa_pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
 	psc->sc_ih = pci_intr_establish_xname(pc, psc->sc_pihp[0], IPL_USB,
 	xhci_intr, sc, device_xname(sc->sc_dev));
 	if (psc->sc_ih == NULL) {



CVS commit: src/sys/dev/pci

2022-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 28 21:57:58 UTC 2022

Modified Files:
src/sys/dev/pci: xhci_pci.c

Log Message:
xhci(4): Mark PCI interrupt handler MP-safe.

xhci_intr has its own intr lock to coordinate with the MP-safe
softint it defers all its work to, other than reading and writing a
few registers to get and acknowledge the interrupt status.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/xhci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 28 21:56:44 UTC 2022

Modified Files:
src/sys/dev/pci: ehci_pci.c

Log Message:
ehci(4): Mark PCI interrupt handler MP-safe.

ehci_intr has its own intr lock to coordinate with the MP-safe
softint it defers all its work to, other than reading and writing a
few registers to get and acknowledge the interrupt status.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/ehci_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 28 21:56:44 UTC 2022

Modified Files:
src/sys/dev/pci: ehci_pci.c

Log Message:
ehci(4): Mark PCI interrupt handler MP-safe.

ehci_intr has its own intr lock to coordinate with the MP-safe
softint it defers all its work to, other than reading and writing a
few registers to get and acknowledge the interrupt status.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/ehci_pci.c

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/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.74 src/sys/dev/pci/ehci_pci.c:1.75
--- src/sys/dev/pci/ehci_pci.c:1.74	Sun Mar 13 11:29:21 2022
+++ src/sys/dev/pci/ehci_pci.c	Fri Oct 28 21:56:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.74 2022/03/13 11:29:21 riastradh Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.75 2022/10/28 21:56:44 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.74 2022/03/13 11:29:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.75 2022/10/28 21:56:44 riastradh Exp $");
 
 #include 
 #include 
@@ -196,6 +196,7 @@ ehci_pci_attach(device_t parent, device_
 	 * Allocate IRQ
 	 */
 	intrstr = pci_intr_string(pc, sc->sc_pihp[0], intrbuf, sizeof(intrbuf));
+	pci_intr_setattr(pa->pa_pc, >sc_pihp[0], PCI_INTR_MPSAFE, true);
 	sc->sc_ih = pci_intr_establish_xname(pc, sc->sc_pihp[0], IPL_USB,
 	ehci_intr, sc, device_xname(self));
 	if (sc->sc_ih == NULL) {



CVS commit: src/sys/dev/pci/ixgbe

2022-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 28 01:10:41 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Make three "Unsupported SFP+ module..." messages the same.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/pci/ixgbe/ixgbe.c

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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.323 src/sys/dev/pci/ixgbe/ixgbe.c:1.324
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.323	Wed Jul  6 06:31:47 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Oct 28 01:10:41 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.323 2022/07/06 06:31:47 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.323 2022/07/06 06:31:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1001,7 +1001,8 @@ ixgbe_attach(device_t parent, device_t d
 	if (error == IXGBE_ERR_SFP_NOT_PRESENT)
 		error = IXGBE_SUCCESS;
 	else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
-		aprint_error_dev(dev, "Unsupported SFP+ module detected!\n");
+		aprint_error_dev(dev,
+		"Unsupported SFP+ module type was detected.\n");
 		unsupported_sfp = true;
 		error = IXGBE_SUCCESS;
 	} else if (error) {



CVS commit: src/sys/dev/pci/ixgbe

2022-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 28 01:10:41 UTC 2022

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Make three "Unsupported SFP+ module..." messages the same.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:01:07 UTC 2022

Modified Files:
src/sys/dev/pci: xmm7360.c

Log Message:
wwanc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/xmm7360.c

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/xmm7360.c
diff -u src/sys/dev/pci/xmm7360.c:1.16 src/sys/dev/pci/xmm7360.c:1.17
--- src/sys/dev/pci/xmm7360.c:1.16	Sat Feb 12 16:21:27 2022
+++ src/sys/dev/pci/xmm7360.c	Thu Oct 27 00:01:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $	*/
+/*	$NetBSD: xmm7360.c,v 1.17 2022/10/27 00:01:07 riastradh Exp $	*/
 
 /*
  * Device driver for Intel XMM7360 LTE modems, eg. Fibocom L850-GL.
@@ -75,7 +75,7 @@ MODULE_DEVICE_TABLE(pci, xmm7360_ids);
 #include "opt_gateway.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.16 2022/02/12 16:21:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.17 2022/10/27 00:01:07 riastradh Exp $");
 #endif
 
 #include 
@@ -167,9 +167,9 @@ typedef struct mutex spinlock_t;
 #define if_deferred_start_init(ifp, arg)	/* nothing */
 #define IF_OUTPUT_CONST/* nothing */
 #define knote_set_eof(kn, f)			(kn)->kn_flags |= EV_EOF | (f)
-#define tty_lock()int s = spltty()
-#define tty_unlock()splx(s)
-#define tty_locked()/* nothing */
+#define tty_lock(tp)int s = spltty()
+#define tty_unlock(tp)splx(s)
+#define tty_locked(tp)/* nothing */
 #define pmf_device_deregister(dev)		/* nothing */
 #if NBPFILTER > 0
 #define BPF_MTAP_OUT(ifp, m)		\
@@ -263,9 +263,9 @@ typedef struct kmutex spinlock_t;
 #define if_hardmtu			if_mtu
 #define IF_OUTPUT_CONST			const
 #define XMM_KQ_ISFD_INITIALIZER		.f_flags = FILTEROP_ISFD
-#define tty_lock()			mutex_spin_enter(_lock)
-#define tty_unlock()			mutex_spin_exit(_lock)
-#define tty_locked()			KASSERT(mutex_owned(_lock))
+#define tty_lock(tp)			ttylock(tp)
+#define tty_unlock(tp)			ttyunlock(tp)
+#define tty_locked(tp)			KASSERT(ttylocked(tp))
 #define bpfattach(bpf, ifp, dlt, sz)	bpf_attach(ifp, dlt, sz)
 #define NBPFILTER			1
 #define BPF_MTAP_OUT(ifp, m)		bpf_mtap(ifp, m, BPF_D_OUT)
@@ -2677,7 +2677,7 @@ wwancstart(struct tty *tp)
 
 	KASSERT(DEV_IS_TTY(dev));
 	KASSERT(tp == sc->sc_tty[func]);
-	tty_locked();
+	tty_locked(tp);
 
 	if (ISSET(tp->t_state, TS_BUSY) || !xmm7360_qp_can_write(qp))
 		return;
@@ -2752,10 +2752,14 @@ static void
 filt_wwancrdetach(struct knote *kn)
 {
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
+	struct xmm_dev *xmm = qp->xmm;
+	int func = qp - xmm->qp;
+	struct wwanc_softc *sc = container_of(xmm, struct wwanc_softc, sc_xmm);
+	struct tty *tp = sc->sc_tty[func];
 
-	tty_lock();
+	tty_lock(tp);
 	selremove_knote(>selr, kn);
-	tty_unlock();
+	tty_unlock(tp);
 }
 
 static int
@@ -2779,10 +2783,14 @@ static void
 filt_wwancwdetach(struct knote *kn)
 {
 	struct queue_pair *qp = (struct queue_pair *)kn->kn_hook;
+	struct xmm_dev *xmm = qp->xmm;
+	int func = qp - xmm->qp;
+	struct wwanc_softc *sc = container_of(xmm, struct wwanc_softc, sc_xmm);
+	struct tty *tp = sc->sc_tty[func];
 
-	tty_lock();
+	tty_lock(tp);
 	selremove_knote(>selw, kn);
-	tty_unlock();
+	tty_unlock(tp);
 }
 
 static int
@@ -2820,6 +2828,7 @@ wwanckqfilter(dev_t dev, struct knote *k
 	struct wwanc_softc *sc = device_lookup_private(_cd, DEVUNIT(dev));
 	int func = DEVFUNC(dev);
 	struct queue_pair *qp = >sc_xmm.qp[func];
+	struct tty *tp = sc->sc_tty[func];
 	struct selinfo *si;
 
 	if (DEV_IS_TTY(func))
@@ -2842,9 +2851,9 @@ wwanckqfilter(dev_t dev, struct knote *k
 
 	kn->kn_hook = (void *)qp;
 
-	tty_lock();
+	tty_lock(tp);
 	selrecord_knote(si, kn);
-	tty_unlock();
+	tty_unlock(tp);
 
 	return (0);
 }



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Oct 27 00:01:07 UTC 2022

Modified Files:
src/sys/dev/pci: xmm7360.c

Log Message:
wwanc(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/xmm7360.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:24 UTC 2022

Modified Files:
src/sys/dev/pci: cz.c

Log Message:
cz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/cz.c

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/cz.c
diff -u src/sys/dev/pci/cz.c:1.64 src/sys/dev/pci/cz.c:1.65
--- src/sys/dev/pci/cz.c:1.64	Sun Dec  9 11:14:02 2018
+++ src/sys/dev/pci/cz.c	Wed Oct 26 23:46:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cz.c,v 1.64 2018/12/09 11:14:02 jdolecek Exp $	*/
+/*	$NetBSD: cz.c,v 1.65 2022/10/26 23:46:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.64 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.65 2022/10/26 23:46:24 riastradh Exp $");
 
 #include 
 #include 
@@ -731,9 +731,9 @@ cz_intr(void *arg)
 /*
  * Do wakeup stuff here.
  */
-mutex_spin_enter(_lock); /* XXX */
+ttylock(tp); /* XXX */
 ttwakeup(tp);
-mutex_spin_exit(_lock); /* XXX */
+ttyunlock(tp); /* XXX */
 wakeup(tp);
 			}
 			break;
@@ -754,9 +754,9 @@ cz_intr(void *arg)
 /*
  * Do wakeup stuff here.
  */
-mutex_spin_enter(_lock); /* XXX */
+ttylock(tp); /* XXX */
 ttwakeup(tp);
-mutex_spin_exit(_lock); /* XXX */
+ttyunlock(tp); /* XXX */
 wakeup(tp);
 			}
 			break;
@@ -804,9 +804,9 @@ cz_intr(void *arg)
 			 * flags set. So TTY_FE by itself works.
 			 */
 			(*tp->t_linesw->l_rint)(TTY_FE, tp);
-			mutex_spin_enter(_lock); /* XXX */
+			ttylock(tp); /* XXX */
 			ttwakeup(tp);
-			mutex_spin_exit(_lock); /* XXX */
+			ttyunlock(tp); /* XXX */
 			wakeup(tp);
 			break;
 



CVS commit: src/sys/dev/pci

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:46:24 UTC 2022

Modified Files:
src/sys/dev/pci: cz.c

Log Message:
cz(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/cz.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 14:50:47 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1450 -r1.1451 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1449 -r1.1450 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 14:50:47 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1450 -r1.1451 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1449 -r1.1450 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 14:50:26 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD F17/Axh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1469 -r1.1470 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1469 src/sys/dev/pci/pcidevs:1.1470
--- src/sys/dev/pci/pcidevs:1.1469	Wed Oct 26 13:22:31 2022
+++ src/sys/dev/pci/pcidevs	Wed Oct 26 14:50:26 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1469 2022/10/26 13:22:31 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1470 2022/10/26 14:50:26 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1028,6 +1028,7 @@ product AMD F17_IOMMU		0x1451	Family17h 
 product AMD F17_PCIE_1		0x1452	Family17h PCIe
 product AMD F17_PCIE_2		0x1453	Family17h PCIe
 product AMD F17_PCIE_3		0x1454	Family17h PCIe
+product AMD F17_AX_PCIE_DUMMY	0x1455	17h/Axh PCIe Dummy Function
 product AMD F17_CCP_1		0x1456	Family17h Crypto
 product AMD F17_HDA		0x1457	Family17h HD Audio
 product AMD F17_PCIE_DUMMY	0x145a	Family17h PCIe Dummy Function
@@ -1053,7 +1054,16 @@ product AMD F17_7X_RESV_SPP	0x1485	Famil
 product AMD F17_7X_CCP		0x1486	Family17h/7xh Crypto
 product AMD F17_3X_HDA		0x1487	17h/7xh HD Audio
 product AMD F17_7X_USB3		0x149c	Family17h/7xh USB 3.0 Host Controller
+product AMD F17_AX_RC		0x14b5	17h/Axh Root Complex
+product AMD F17_AX_IOMMU	0x14b6	17h/Axh IOMMU
+product AMD F17_AX_PCIE_DUMMY_HB 0x14b7	17h/Axh PCIe Dummy Host Bridge
+product AMD F17_AX_INTNL_GPPB_0	0x14b9	17h/Axh Internal GPP Bridge 0
+product AMD F17_AX_GPPB		0x14ba	17h/Axh PCIe GPP Bridge
 product AMD F19_6X_RC		0x14d8	19h/6xh Root Complex
+product AMD F17_AX_XHCI_0	0x1503	17h/Axh USB 3.1 xHCI
+product AMD F17_AX_XHCI_1	0x1504	17h/Axh USB 3.1 xHCI
+product AMD F17_AX_USB_BIOM	0x1505	17h/Axh Secure USB BIOmetric
+product AMD F17_AX_GFX		0x1506	17h/Axh Internal GPU
 product AMD F14_RC		0x1510	Family14h Root Complex
 product AMD F14_PCIE_1		0x1512	Family14h PCIe
 product AMD F14_PCIE_2		0x1513	Family14h PCIe
@@ -1131,6 +1141,7 @@ product AMD F17_6X_PCIE_3	0x1635	17h/6xh
 product AMD F17_6X_HDAUDIO	0x1637	17h/6xh HD Audio Controller
 product AMD F17_6X_XHCI		0x1639	17h/6xh xHCI
 product AMD F17_9X_XHCI_2	0x163b	17h/9xh xHCI
+product AMD F17_AX_HDA		0x1640	17h/Axh HD Audio
 product AMD F17_6X_XGBE		0x1641	17h/6xh 10GbE Controller
 product AMD F17_6X_WLAN		0x1642	17h/6xh WLAN
 product AMD F17_6X_BT		0x1643	17h/6xh Bluetooth
@@ -1171,6 +1182,14 @@ product AMD F12_PCIE_7		0x170d	Family12h
 product AMD F14_MISC		0x1716	Family12h/14h Misc. Configuration
 product AMD F14_HB18		0x1718	Family12h/14h Host Bridge
 product AMD F14_HB19		0x1719	Family12h/14h Host Bridge
+product AMD F17_AX_DF_0		0x1724	17h/Axh Data Fabric
+product AMD F17_AX_DF_1		0x1725	17h/Axh Data Fabric
+product AMD F17_AX_DF_2		0x1726	17h/Axh Data Fabric
+product AMD F17_AX_DF_3		0x1727	17h/Axh Data Fabric
+product AMD F17_AX_DF_4		0x1728	17h/Axh Data Fabric
+product AMD F17_AX_DF_5		0x1729	17h/Axh Data Fabric
+product AMD F17_AX_DF_6		0x172a	17h/Axh Data Fabric
+product AMD F17_AX_DF_7		0x172b	17h/Axh Data Fabric
 product AMD SEATTLE_PCHB_1	0x1a00	Seattle Host Bridge
 product AMD SEATTLE_PCHB_2	0x1a01	Seattle Host Bridge
 product AMD SEATTLE_PCIE	0x1a02	Seattle PCIe Root Port



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 14:50:26 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add AMD F17/Axh devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1469 -r1.1470 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:35:25 UTC 2022

Modified Files:
src/sys/dev/pci: amdccp_pci.c

Log Message:
Add AMD F17/1x and F17/9x CCP(PSP) support to amdccp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/amdccp_pci.c

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/amdccp_pci.c
diff -u src/sys/dev/pci/amdccp_pci.c:1.2 src/sys/dev/pci/amdccp_pci.c:1.3
--- src/sys/dev/pci/amdccp_pci.c:1.2	Thu Jun 25 16:40:40 2020
+++ src/sys/dev/pci/amdccp_pci.c	Wed Oct 26 13:35:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: amdccp_pci.c,v 1.2 2020/06/25 16:40:40 thorpej Exp $ */
+/* $NetBSD: amdccp_pci.c,v 1.3 2022/10/26 13:35:25 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdccp_pci.c,v 1.2 2020/06/25 16:40:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdccp_pci.c,v 1.3 2022/10/26 13:35:25 msaitoh Exp $");
 
 #include 
 #include 
@@ -65,8 +65,14 @@ static const struct amdccp_pci_product {
 	  .product	=	PCI_PRODUCT_AMD_F17_CCP_2,
 	},
 	{ .vendor	=	PCI_VENDOR_AMD,
+	  .product	=	PCI_PRODUCT_AMD_F17_1X_PSP,
+	},
+	{ .vendor	=	PCI_VENDOR_AMD,
 	  .product	=	PCI_PRODUCT_AMD_F17_7X_CCP,
 	},
+	{ .vendor	=	PCI_VENDOR_AMD,
+	  .product	=	PCI_PRODUCT_AMD_F17_9X_CCP,
+	},
 };
 
 static const struct amdccp_pci_product *



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:35:25 UTC 2022

Modified Files:
src/sys/dev/pci: amdccp_pci.c

Log Message:
Add AMD F17/1x and F17/9x CCP(PSP) support to amdccp(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/amdccp_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:23:10 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1448 -r1.1449 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:23:10 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1448 -r1.1449 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:22:31 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some AMD 17h/9xh devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1468 -r1.1469 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1468 src/sys/dev/pci/pcidevs:1.1469
--- src/sys/dev/pci/pcidevs:1.1468	Fri Oct  7 02:55:33 2022
+++ src/sys/dev/pci/pcidevs	Wed Oct 26 13:22:31 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1468 2022/10/07 02:55:33 snj Exp $
+$NetBSD: pcidevs,v 1.1469 2022/10/26 13:22:31 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1121,6 +1121,7 @@ product AMD F15_DRAM		0x1602	Family15h D
 product AMD F15_MISC		0x1603	Family15h Miscellaneous Configuration
 product AMD F15_LINK		0x1604	Family15h Link Configuration
 product AMD F15_NB		0x1605	Family15h North Bridge Configuration
+product AMD F17_9X_XHCI_1	0x162c	17h/9xh xHCI
 product AMD F17_6X_RC		0x1630	17h/6xh Root Complex
 product AMD F17_6X_IOMMU	0x1631	17h/6xh IOMMU
 product AMD F17_6X_HB		0x1632	17h/6xh Host Bridge
@@ -1129,10 +1130,23 @@ product AMD F17_6X_PCIE_2	0x1634	17h/6xh
 product AMD F17_6X_PCIE_3	0x1635	17h/6xh PCIe
 product AMD F17_6X_HDAUDIO	0x1637	17h/6xh HD Audio Controller
 product AMD F17_6X_XHCI		0x1639	17h/6xh xHCI
+product AMD F17_9X_XHCI_2	0x163b	17h/9xh xHCI
 product AMD F17_6X_XGBE		0x1641	17h/6xh 10GbE Controller
 product AMD F17_6X_WLAN		0x1642	17h/6xh WLAN
 product AMD F17_6X_BT		0x1643	17h/6xh Bluetooth
 product AMD F17_6X_I2S		0x1644	17h/6xh I2S
+product AMD F17_9X_HB		0x1645	17h/9xh Host
+product AMD F17_9X_PCIE_1	0x1647	17h/9xh PCIE
+product AMD F17_9X_PCIE_2	0x1648	17h/9xh PCIE
+product AMD F17_9X_CCP		0x1649	17h/9xh Crypto
+product AMD F17_9X_DF_0		0x1660	17h/9xh Data Fabric
+product AMD F17_9X_DF_1		0x1661	17h/9xh Data Fabric
+product AMD F17_9X_DF_2		0x1662	17h/9xh Data Fabric
+product AMD F17_9X_DF_3		0x1663	17h/9xh Data Fabric
+product AMD F17_9X_DF_4		0x1664	17h/9xh Data Fabric
+product AMD F17_9X_DF_5		0x1665	17h/9xh Data Fabric
+product AMD F17_9X_DF_6		0x1666	17h/9xh Data Fabric
+product AMD F17_9X_DF_7		0x1667	17h/9xh Data Fabric
 product AMD F19_5X_DF_0		0x166a	19h/5xh Data Fabric
 product AMD F19_5X_DF_1		0x166b	19h/5xh Data Fabric
 product AMD F19_5X_DF_2		0x166c	19h/5xh Data Fabric



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 13:22:31 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some AMD 17h/9xh devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1468 -r1.1469 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 06:36:40 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Add comment to ICH/PCH's lock stuff in wm_reset().


To generate a diff of this commit:
cvs rdiff -u -r1.765 -r1.766 src/sys/dev/pci/if_wm.c

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/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.765 src/sys/dev/pci/if_wm.c:1.766
--- src/sys/dev/pci/if_wm.c:1.765	Wed Oct 19 06:37:25 2022
+++ src/sys/dev/pci/if_wm.c	Wed Oct 26 06:36:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.765 2022/10/19 06:37:25 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.766 2022/10/26 06:36:39 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.765 2022/10/19 06:37:25 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.766 2022/10/26 06:36:39 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -5579,6 +5579,11 @@ wm_reset(struct wm_softc *sc)
 		CSR_WRITE(sc, WMREG_CTRL, reg);
 		/* Don't insert a completion barrier when reset */
 		delay(20*1000);
+		/*
+		 * The EXTCNFCTR_MDIO_SW_OWNERSHIP bit is cleared by the reset,
+		 * so don't use sc->phy.release(sc). Release sc_ich_phymtx
+		 * only. See also wm_get_swflag_ich8lan().
+		 */
 		mutex_exit(sc->sc_ich_phymtx);
 		break;
 	case WM_T_82580:



CVS commit: src/sys/dev/pci

2022-10-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 26 06:36:40 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Add comment to ICH/PCH's lock stuff in wm_reset().


To generate a diff of this commit:
cvs rdiff -u -r1.765 -r1.766 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 21 09:29:32 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Remove incorrect ASSERT_SLEEPABLE introduced in 1.33.

It is true that aq_stop must be sleepable, and that aq_stop_locked
may sleep, but aq_stop_locked will release sc->sc_mutex when it
sleeps, which ASSERT_SLEEPABLE doesn't know about.  Since that is a
spin lock, ASSERT_SLEEPABLE trips over it and crashes.

This is not quite right: aq_stop should really only take the lock
over specific things that need the lock to synchronize with other
threads, like mii_down; aq_init and aq_stop are already serialized by
IFNET_LOCK.  sc->sc_mutex is used for too much and should have its
scope narrowed like I did recently in usbnet(9).  But this small
change will at least remove a source of crashes for now.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.37 src/sys/dev/pci/if_aq.c:1.38
--- src/sys/dev/pci/if_aq.c:1.37	Mon Oct 17 10:39:27 2022
+++ src/sys/dev/pci/if_aq.c	Fri Oct 21 09:29:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.37 2022/10/17 10:39:27 riastradh Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.38 2022/10/21 09:29:32 riastradh Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.37 2022/10/17 10:39:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.38 2022/10/21 09:29:32 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -4871,7 +4871,6 @@ aq_stop_locked(struct ifnet *ifp, bool d
 	struct aq_softc * const sc = ifp->if_softc;
 	int i;
 
-	ASSERT_SLEEPABLE();
 	KASSERT(IFNET_LOCKED(ifp));
 	AQ_LOCKED(sc);
 



CVS commit: src/sys/dev/pci

2022-10-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Oct 21 09:29:32 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Remove incorrect ASSERT_SLEEPABLE introduced in 1.33.

It is true that aq_stop must be sleepable, and that aq_stop_locked
may sleep, but aq_stop_locked will release sc->sc_mutex when it
sleeps, which ASSERT_SLEEPABLE doesn't know about.  Since that is a
spin lock, ASSERT_SLEEPABLE trips over it and crashes.

This is not quite right: aq_stop should really only take the lock
over specific things that need the lock to synchronize with other
threads, like mii_down; aq_init and aq_stop are already serialized by
IFNET_LOCK.  sc->sc_mutex is used for too much and should have its
scope narrowed like I did recently in usbnet(9).  But this small
change will at least remove a source of crashes for now.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 19 06:37:25 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
Fix typo. No functional change. OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.764 -r1.765 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/pci/if_wmreg.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/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.764 src/sys/dev/pci/if_wm.c:1.765
--- src/sys/dev/pci/if_wm.c:1.764	Thu Sep  8 02:40:10 2022
+++ src/sys/dev/pci/if_wm.c	Wed Oct 19 06:37:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.764 2022/09/08 02:40:10 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.765 2022/10/19 06:37:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.764 2022/09/08 02:40:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.765 2022/10/19 06:37:25 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -8922,12 +8922,12 @@ wm_nq_tx_offload(struct wm_softc *sc, st
 	 * however it does not cause problems.
 	 */
 	/* Fill in the context descriptor. */
-	txq->txq_nq_descs[txq->txq_next].nqrx_ctx.nqtxc_vl_len =
+	txq->txq_nq_descs[txq->txq_next].nqtx_ctx.nqtxc_vl_len =
 	htole32(vl_len);
-	txq->txq_nq_descs[txq->txq_next].nqrx_ctx.nqtxc_sn = 0;
-	txq->txq_nq_descs[txq->txq_next].nqrx_ctx.nqtxc_cmd =
+	txq->txq_nq_descs[txq->txq_next].nqtx_ctx.nqtxc_sn = 0;
+	txq->txq_nq_descs[txq->txq_next].nqtx_ctx.nqtxc_cmd =
 	htole32(cmdc);
-	txq->txq_nq_descs[txq->txq_next].nqrx_ctx.nqtxc_mssidx =
+	txq->txq_nq_descs[txq->txq_next].nqtx_ctx.nqtxc_mssidx =
 	htole32(mssidx);
 	wm_cdtxsync(txq, txq->txq_next, 1, BUS_DMASYNC_PREWRITE);
 	DPRINTF(sc, WM_DEBUG_TX,

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.127 src/sys/dev/pci/if_wmreg.h:1.128
--- src/sys/dev/pci/if_wmreg.h:1.127	Fri Jul 22 05:23:50 2022
+++ src/sys/dev/pci/if_wmreg.h	Wed Oct 19 06:37:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.127 2022/07/22 05:23:50 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.128 2022/10/19 06:37:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1707,7 +1707,7 @@ typedef union nq_txdesc {
 		uint32_t nqtxc_sn;
 		uint32_t nqtxc_cmd;
 		uint32_t nqtxc_mssidx;
-	} nqrx_ctx;
+	} nqtx_ctx;
 } __packed nq_txdesc_t;
 
 



CVS commit: src/sys/dev/pci

2022-10-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 19 06:37:25 UTC 2022

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
Fix typo. No functional change. OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.764 -r1.765 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 18 04:20:56 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/virtio.c

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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.61 src/sys/dev/pci/virtio.c:1.62
--- src/sys/dev/pci/virtio.c:1.61	Mon Oct 17 07:03:19 2022
+++ src/sys/dev/pci/virtio.c	Tue Oct 18 04:20:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.61 2022/10/17 07:03:19 skrll Exp $	*/
+/*	$NetBSD: virtio.c,v 1.62 2022/10/18 04:20:56 skrll Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.61 2022/10/17 07:03:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.62 2022/10/18 04:20:56 skrll Exp $");
 
 #include 
 #include 
@@ -441,7 +441,7 @@ static inline void
 vq_sync_descs(struct virtio_softc *sc, struct virtqueue *vq, int ops)
 {
 
-	/* availoffset == sizeof(vring_desc)*vq_num */
+	/* availoffset == sizeof(vring_desc) * vq_num */
 	bus_dmamap_sync(sc->sc_dmat, vq->vq_dmamap, 0, vq->vq_availoffset,
 	ops);
 }
@@ -778,11 +778,11 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	hdrlen = sc->sc_active_features & VIRTIO_F_RING_EVENT_IDX ? 3 : 2;
 
 	/* allocsize1: descriptor table + avail ring + pad */
-	allocsize1 = VIRTQUEUE_ALIGN(sizeof(struct vring_desc)*vq_size
-	+ sizeof(uint16_t)*(hdrlen + vq_size));
+	allocsize1 = VIRTQUEUE_ALIGN(sizeof(struct vring_desc) * vq_size
+	+ sizeof(uint16_t) * (hdrlen + vq_size));
 	/* allocsize2: used ring + pad */
 	allocsize2 = VIRTQUEUE_ALIGN(sizeof(uint16_t) * hdrlen
-	+ sizeof(struct vring_used_elem)*vq_size);
+	+ sizeof(struct vring_used_elem) * vq_size);
 	/* allocsize3: indirect table */
 	if (sc->sc_indirect && maxnsegs >= MINSEG_INDIRECT)
 		allocsize3 = sizeof(struct vring_desc) * maxnsegs * vq_size;
@@ -829,7 +829,7 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	vq->vq_num = vq_size;
 	vq->vq_index = index;
 	vq->vq_desc = vq->vq_vaddr;
-	vq->vq_availoffset = sizeof(struct vring_desc)*vq_size;
+	vq->vq_availoffset = sizeof(struct vring_desc) * vq_size;
 	vq->vq_avail = (void *)(((char *)vq->vq_desc) + vq->vq_availoffset);
 	vq->vq_used_event = (uint16_t *)((char *)vq->vq_avail +
 	offsetof(struct vring_avail, ring[vq->vq_num]));
@@ -848,7 +848,7 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	vq->vq_maxnsegs = maxnsegs;
 
 	/* free slot management */
-	vq->vq_entries = kmem_zalloc(sizeof(struct vq_entry)*vq_size,
+	vq->vq_entries = kmem_zalloc(sizeof(struct vq_entry) * vq_size,
 	KM_SLEEP);
 	virtio_init_vq(sc, vq, false);
 



CVS commit: src/sys/dev/pci

2022-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 18 04:20:56 UTC 2022

Modified Files:
src/sys/dev/pci: virtio.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2022-10-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 17 10:39:27 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Annotate boolean parameters with names for legibility.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/if_aq.c

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/if_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.36 src/sys/dev/pci/if_aq.c:1.37
--- src/sys/dev/pci/if_aq.c:1.36	Mon Oct 17 10:39:01 2022
+++ src/sys/dev/pci/if_aq.c	Mon Oct 17 10:39:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.36 2022/10/17 10:39:01 riastradh Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.37 2022/10/17 10:39:27 riastradh Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.36 2022/10/17 10:39:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.37 2022/10/17 10:39:27 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -1507,7 +1507,8 @@ aq_attach(device_t parent, device_t self
 	ether_set_ifflags_cb(>sc_ethercom, aq_ifflags_cb);
 	if_register(ifp);
 
-	aq_enable_intr(sc, true, false);	/* only intr about link */
+	/* only intr about link */
+	aq_enable_intr(sc, /*link*/true, /*txrx*/false);
 
 	/* update media */
 	aq_ifmedia_change(ifp);
@@ -4691,7 +4692,7 @@ aq_init_locked(struct ifnet *ifp)
 	ifp->if_flags |= IFF_RUNNING;
 
 	/* start TX and RX */
-	aq_enable_intr(sc, true, true);
+	aq_enable_intr(sc, /*link*/true, /*txrx*/true);
 	AQ_WRITE_REG_BIT(sc, TPB_TX_BUF_REG, TPB_TX_BUF_EN, 1);
 	AQ_WRITE_REG_BIT(sc, RPB_RPF_RX_REG, RPB_RPF_RX_BUF_EN, 1);
 
@@ -4880,7 +4881,7 @@ aq_stop_locked(struct ifnet *ifp, bool d
 		goto already_stopped;
 
 	/* disable tx/rx interrupts */
-	aq_enable_intr(sc, true, false);
+	aq_enable_intr(sc, /*link*/true, /*txrx*/false);
 
 	AQ_WRITE_REG_BIT(sc, TPB_TX_BUF_REG, TPB_TX_BUF_EN, 0);
 	for (i = 0; i < sc->sc_nqueues; i++) {
@@ -4898,7 +4899,7 @@ aq_stop_locked(struct ifnet *ifp, bool d
 	RX_DMA_DESC_CACHE_INIT_REG, RX_DMA_DESC_CACHE_INIT) ^ 1);
 
  already_stopped:
-	aq_enable_intr(sc, false, false);
+	aq_enable_intr(sc, /*link*/false, /*txrx*/false);
 	callout_halt(>sc_tick_ch, >sc_mutex);
 
 	ifp->if_flags &= ~IFF_RUNNING;



CVS commit: src/sys/dev/pci

2022-10-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 17 10:39:27 UTC 2022

Modified Files:
src/sys/dev/pci: if_aq.c

Log Message:
aq(4): Annotate boolean parameters with names for legibility.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/if_aq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   3   4   5   6   7   8   9   10   >