CVS commit: src/sys/dev/pci

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:42 UTC 2021

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.1428 -r1.1429 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1427 -r1.1428 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

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:18 UTC 2021

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

Log Message:
Add Intel Rocket Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1443 -r1.1444 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.1443 src/sys/dev/pci/pcidevs:1.1444
--- src/sys/dev/pci/pcidevs:1.1443	Wed Nov  3 15:09:42 2021
+++ src/sys/dev/pci/pcidevs	Tue Nov 30 15:16:18 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1443 2021/11/03 15:09:42 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1444 2021/11/30 15:16:18 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5736,6 +5736,18 @@ product INTEL EHL_PSE_I2C_7	0x4bc0	Elkha
 product INTEL EHL_PSE_CAN_0	0x4bc1	Elkhart Lake PSE CAN 0
 product INTEL EHL_PSE_CAN_1	0x4bc2	Elkhart Lake PSE CAN 1
 product INTEL EHL_PSE_QEP_0	0x4bc3	Elkhart Lake PSE QEP 0
+product INTEL RKL_PCIE_RP_0	0x4c01	Rocket Lake PCIe Root Port 0 (x16)
+product INTEL RKL_DPTF		0x4c03	Rocket Lake DPTF
+product INTEL RKL_PCIE_RP_1	0x4c05	Rocket Lake PCIe Root Port 1 (x8)
+product INTEL RKL_PCIE_RP_2	0x4c07	Rocket Lake PCIe Root Port 2 (x4)
+product INTEL RKL_PCIE_RP_3	0x4c09	Rocket Lake PCIe Root Port 3 (x4)
+product INTEL RKL_GNA		0x4c11	Rocket Lake Gauss Newton Algorithm
+product INTEL RKL_8C_HOST	0x4c43	Rocket Lake (8Core) Host
+product INTEL RKL_6C_HOST	0x4c53	Rocket Lake (8Core) Host
+product INTEL RKL_IGD_1		0x4c8a	Rocket Lake UHD Graphics 750 (32EU)
+product INTEL RKL_IGD_2		0x4c8b	Rocket Lake UHD Graphics 730 (24EU)
+product INTEL RKL_IGD_3		0x4c90	Rocket Lake (Xeon W) UHD Graphics 750
+product INTEL RKL_IGD_4		0x4c9a	Rocket Lake (Xeon E) UHD Graphics 750
 product INTEL JSL_ESPI		0x4d87	Jasper Lake eSPI
 product INTEL JSL_P2SB		0x4da0	Jasper Lake P2SB
 product INTEL JSL_PMC		0x4da1	Jasper Lake PMC



CVS commit: src/sys/dev/pci

2021-11-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 30 15:16:18 UTC 2021

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

Log Message:
Add Intel Rocket Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1443 -r1.1444 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/ixgbe

2021-11-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 17 06:37:44 UTC 2021

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

Log Message:
s/dataseet/datasheet/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.82 src/sys/dev/pci/ixgbe/ixgbe.h:1.83
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.82	Sun Sep 19 10:34:09 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Wed Nov 17 06:37:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.82 2021/09/19 10:34:09 andvar Exp $ */
+/* $NetBSD: ixgbe.h,v 1.83 2021/11/17 06:37:44 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -197,7 +197,7 @@
  * 33 should be large enough even for 64K TSO
  * (32 * 2K mbuf cluster and 1 x mbuf header).
  *
- * Reference: 82599-X550 dataseet 7.2.1.1 "Transmit Storage in System Memory".
+ * Reference: 82599-X550 datasheet 7.2.1.1 "Transmit Storage in System Memory".
  */
 #define IXGBE_82599_SCATTER_MAX	(40 - IXGBE_TX_WTHRESH - 2)
 #define IXGBE_SCATTER_DEFAULT	33



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

2021-11-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 17 06:37:44 UTC 2021

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

Log Message:
s/dataseet/datasheet/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pci/ixgbe/ixgbe.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

2021-11-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Nov 13 21:38:48 UTC 2021

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

Log Message:
firmware ver1 doesn't seem to work with linkstat interrupt, so in this case 
also set it to polling mode.

- Make the version acquisition (aq_fw_reset) timing earlier.
- Unmap registers when terminating with attach after failing to set interrupt


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/sys/dev/pci/if_aq.c:1.31
--- src/sys/dev/pci/if_aq.c:1.30	Thu Nov 11 06:56:56 2021
+++ src/sys/dev/pci/if_aq.c	Sat Nov 13 21:38:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.30 2021/11/11 06:56:56 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.31 2021/11/13 21:38:48 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.30 2021/11/11 06:56:56 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.31 2021/11/13 21:38:48 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -1284,6 +1284,10 @@ aq_attach(device_t parent, device_t self
 		return;
 	}
 
+	error = aq_fw_reset(sc);
+	if (error != 0)
+		goto attach_failure;
+
 	sc->sc_nqueues = MIN(ncpu, AQ_RSSQUEUE_MAX);
 
 	/* max queue num is 8, and must be 2^n */
@@ -1325,8 +1329,9 @@ aq_attach(device_t parent, device_t self
 		sc->sc_msix = false;
 	}
 
-	/* XXX: on FIBRE, linkstat interrupt does not occur on boot? */
-	if (aqp->aq_media_type == AQ_MEDIA_TYPE_FIBRE)
+	/* on FW Ver1 or FIBRE, linkstat interrupt does not occur on boot? */
+	if (aqp->aq_media_type == AQ_MEDIA_TYPE_FIBRE ||
+	FW_VERSION_MAJOR(sc) == 1)
 		sc->sc_poll_linkstat = true;
 
 #ifdef AQ_FORCE_POLL_LINKSTAT
@@ -1363,7 +1368,7 @@ aq_attach(device_t parent, device_t self
 		error = aq_setup_legacy(sc, pa, PCI_INTR_TYPE_INTX);
 	}
 	if (error != 0)
-		return;
+		goto attach_failure;
 
 	callout_init(>sc_tick_ch, 0);
 	callout_setfunc(>sc_tick_ch, aq_tick, sc);
@@ -1379,10 +1384,6 @@ aq_attach(device_t parent, device_t self
 	if (error != 0)
 		goto attach_failure;
 
-	error = aq_fw_reset(sc);
-	if (error != 0)
-		goto attach_failure;
-
 	error = aq_fw_version_init(sc);
 	if (error != 0)
 		goto attach_failure;



CVS commit: src/sys/dev/pci

2021-11-13 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Nov 13 21:38:48 UTC 2021

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

Log Message:
firmware ver1 doesn't seem to work with linkstat interrupt, so in this case 
also set it to polling mode.

- Make the version acquisition (aq_fw_reset) timing earlier.
- Unmap registers when terminating with attach after failing to set interrupt


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 07:18:53 UTC 2021

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/vioscsi.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/vioscsi.c
diff -u src/sys/dev/pci/vioscsi.c:1.27 src/sys/dev/pci/vioscsi.c:1.28
--- src/sys/dev/pci/vioscsi.c:1.27	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/vioscsi.c	Fri Nov 12 07:18:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vioscsi.c,v 1.27 2021/08/07 16:19:14 thorpej Exp $	*/
+/*	$NetBSD: vioscsi.c,v 1.28 2021/11/12 07:18:53 skrll Exp $	*/
 /*	$OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.27 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.28 2021/11/12 07:18:53 skrll Exp $");
 
 #include 
 #include 
@@ -67,7 +67,7 @@ struct vioscsi_softc {
 	kmutex_t		 sc_mutex;
 };
 
-/*  
+/*
  * Each block request uses at least two segments - one for the header
  * and one for the status.
 */
@@ -279,7 +279,7 @@ vioscsi_scsipi_request(struct scsipi_cha
 	struct vioscsi_softc *sc =
 	device_private(chan->chan_adapter->adapt_dev);
 	struct virtio_softc *vsc = device_private(device_parent(sc->sc_dev));
-	struct scsipi_xfer *xs; 
+	struct scsipi_xfer *xs;
 	struct scsipi_periph *periph;
 	struct vioscsi_req *vr;
 	struct virtio_scsi_req_hdr *req;
@@ -305,7 +305,7 @@ vioscsi_scsipi_request(struct scsipi_cha
 		DPRINTF(("%s: unhandled %d\n", __func__, request));
 		return;
 	}
-	
+
 	xs = arg;
 	periph = xs->xs_periph;
 
@@ -619,7 +619,7 @@ vioscsi_alloc_reqs(struct vioscsi_softc 
 	sc->sc_reqs = vaddr;
 	sc->sc_nreqs = qsize;
 
-	/* Prepare maps for the requests */ 
+	/* Prepare maps for the requests */
 	for (slot=0; slot < qsize; slot++) {
 		vr = >sc_reqs[slot];
 
@@ -689,7 +689,7 @@ vioscsi_free_reqs(struct vioscsi_softc *
 		return;
 	}
 
-	/* Free request maps */ 
+	/* Free request maps */
 	for (slot=0; slot < sc->sc_nreqs; slot++) {
 		vr = >sc_reqs[slot];
 



CVS commit: src/sys/dev/pci

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 07:18:53 UTC 2021

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/vioscsi.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

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 07:06:06 UTC 2021

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

Log Message:
Fix the conditional for failed interrupt establishment


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/ahcisata_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/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.59 src/sys/dev/pci/ahcisata_pci.c:1.60
--- src/sys/dev/pci/ahcisata_pci.c:1.59	Mon Nov  8 11:01:51 2021
+++ src/sys/dev/pci/ahcisata_pci.c	Fri Nov 12 07:06:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.59 2021/11/08 11:01:51 rin Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.60 2021/11/12 07:06:06 skrll Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.59 2021/11/08 11:01:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.60 2021/11/12 07:06:06 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -366,7 +366,7 @@ ahci_pci_intr_establish(struct ahci_soft
 	sizeof(intrbuf));
 	psc->sc_ih[vec] = pci_intr_establish_xname(psc->sc_pc,
 	psc->sc_pihp[vec], IPL_BIO, intr_handler, intr_arg, intr_xname);
-	if (psc->sc_ih == NULL) {
+	if (psc->sc_ih[vec] == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt");
 		if (intrstr != NULL)
 			aprint_error(" at %s", intrstr);



CVS commit: src/sys/dev/pci

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 07:06:06 UTC 2021

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

Log Message:
Fix the conditional for failed interrupt establishment


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/ahcisata_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/ixgbe

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 06:56:50 UTC 2021

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 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.293 src/sys/dev/pci/ixgbe/ixgbe.c:1.294
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.293	Thu Sep 30 04:06:50 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Nov 12 06:56:50 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.293 2021/09/30 04:06:50 yamaguchi Exp $ */
+/* $NetBSD: ixgbe.c,v 1.294 2021/11/12 06:56:50 skrll Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.293 2021/09/30 04:06:50 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.294 2021/11/12 06:56:50 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2516,7 +2516,7 @@ ixgbe_setup_vlan_hw_support(struct adapt
 	struct vlanid_list *vlanidp;
 
 	/*
-	 *  This function is called from both if_init and ifflags_cb()
+	 * This function is called from both if_init and ifflags_cb()
 	 * on NetBSD.
 	 */
 



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

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 06:56:50 UTC 2021

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 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

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 06:51:04 UTC 2021

Modified Files:
src/sys/dev/pci: files.pci

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/sys/dev/pci/files.pci

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/files.pci
diff -u src/sys/dev/pci/files.pci:1.438 src/sys/dev/pci/files.pci:1.439
--- src/sys/dev/pci/files.pci:1.438	Wed Aug 25 09:06:02 2021
+++ src/sys/dev/pci/files.pci	Fri Nov 12 06:51:04 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.438 2021/08/25 09:06:02 msaitoh Exp $
+#	$NetBSD: files.pci,v 1.439 2021/11/12 06:51:04 skrll Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -152,7 +152,7 @@ file	dev/pci/isp_pci.c		isp_pci
 attach	mfi at pci with mfi_pci
 file	dev/pci/mfi_pci.c		mfi_pci
 
-# LSI MegaRAID SAS Fusion RAID controllers 
+# LSI MegaRAID SAS Fusion RAID controllers
 device	mfii: scsi
 attach	mfii at pci
 file	dev/pci/mfii.c			mfii
@@ -926,7 +926,7 @@ file	dev/pci/njs_pci.c		njs_pci
 
 # S2io Xframe 10 Gigabit ethernet (Xframe driver)
 device  xge: ether, ifnet, arp
-attach  xge  at pci 
+attach  xge  at pci
 filedev/pci/if_xge.c		xge
 
 # Via Velocity 612x 10/100/1000 Ethernet
@@ -1046,7 +1046,7 @@ attach	pm2fb at pci
 file	dev/pci/pm2fb.c		pm2fb
 defflag	opt_pm2fb.h	PM2FB_DEBUG
 
-# Permedia 3 / Oxygen VX1 / Proformance 3  
+# Permedia 3 / Oxygen VX1 / Proformance 3
 device  pm3fb: wsemuldisplaydev, rasops8, vcons, videomode, i2cexec, i2c_bitbang, ddc_read_edid, edid
 attach  pm3fb at pci
 file	dev/pci/pm3fb.c		pm3fb
@@ -1115,7 +1115,7 @@ file	dev/pci/igma.c		igma
 defflag	opt_tdvfb.h		TDVFB_CONSOLE
 device	tdvfb: wsemuldisplaydev, rasops16, rasops32, vcons, videomode
 attach	tdvfb at pci
-file	dev/pci/tdvfb.c		tdvfb	
+file	dev/pci/tdvfb.c		tdvfb
 
 # nvidia geforce framebuffer console driver
 device	gffb: wsemuldisplaydev, rasops8, vcons, glyphcache



CVS commit: src/sys/dev/pci

2021-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 12 06:51:04 UTC 2021

Modified Files:
src/sys/dev/pci: files.pci

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/sys/dev/pci/files.pci

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

2021-11-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Nov 11 06:56:56 UTC 2021

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

Log Message:
Fixed a panic problem at attach with aq(4) F/W version 1.

- Don't use cprng(9) when attaching, since it's not available yet.
- Wait up to 10 seconds because delay is not enough.
- Even if the delay is not enough, it will fail attach without panic.
- Checked on the actual card D107 (F/W version 1.5.58)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/sys/dev/pci/if_aq.c:1.30
--- src/sys/dev/pci/if_aq.c:1.29	Mon Oct 11 15:08:17 2021
+++ src/sys/dev/pci/if_aq.c	Thu Nov 11 06:56:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.29 2021/10/11 15:08:17 msaitoh Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.30 2021/11/11 06:56:56 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.29 2021/10/11 15:08:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.30 2021/11/11 06:56:56 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -2068,22 +2068,22 @@ aq_hw_init_ucp(struct aq_softc *sc)
 	int timo;
 
 	if (FW_VERSION_MAJOR(sc) == 1) {
-		if (AQ_READ_REG(sc, FW1X_MPI_INIT2_REG) == 0) {
-			uint32_t data;
-			cprng_fast(, sizeof(data));
-			data &= 0xfefefefe;
-			data |= 0x02020202;
-			AQ_WRITE_REG(sc, FW1X_MPI_INIT2_REG, data);
-		}
+		if (AQ_READ_REG(sc, FW1X_MPI_INIT2_REG) == 0)
+			AQ_WRITE_REG(sc, FW1X_MPI_INIT2_REG, 0xfefefefe);
 		AQ_WRITE_REG(sc, FW1X_MPI_INIT1_REG, 0);
 	}
 
-	for (timo = 100; timo > 0; timo--) {
+	/* Wait a maximum of 10sec. It usually takes about 5sec. */
+	for (timo = 1; timo > 0; timo--) {
 		sc->sc_mbox_addr = AQ_READ_REG(sc, FW_MPI_MBOX_ADDR_REG);
 		if (sc->sc_mbox_addr != 0)
 			break;
 		delay(1000);
 	}
+	if (sc->sc_mbox_addr == 0) {
+		aprint_error_dev(sc->sc_dev, "cannot get mbox addr\n");
+		return ETIMEDOUT;
+	}
 
 #define AQ_FW_MIN_VERSION	0x01050006
 #define AQ_FW_MIN_VERSION_STR	"1.5.6"



CVS commit: src/sys/dev/pci

2021-11-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Nov 11 06:56:56 UTC 2021

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

Log Message:
Fixed a panic problem at attach with aq(4) F/W version 1.

- Don't use cprng(9) when attaching, since it's not available yet.
- Wait up to 10 seconds because delay is not enough.
- Even if the delay is not enough, it will fail attach without panic.
- Checked on the actual card D107 (F/W version 1.5.58)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 15:36:44 UTC 2021

Modified Files:
src/sys/dev/pci: if_iwmreg.h

Log Message:
s/unoticable/unnoticeable/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_iwmreg.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

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 15:36:44 UTC 2021

Modified Files:
src/sys/dev/pci: if_iwmreg.h

Log Message:
s/unoticable/unnoticeable/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_iwmreg.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_iwmreg.h
diff -u src/sys/dev/pci/if_iwmreg.h:1.9 src/sys/dev/pci/if_iwmreg.h:1.10
--- src/sys/dev/pci/if_iwmreg.h:1.9	Tue Aug 17 22:00:31 2021
+++ src/sys/dev/pci/if_iwmreg.h	Wed Nov 10 15:36:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwmreg.h,v 1.9 2021/08/17 22:00:31 andvar Exp $	*/
+/*	$NetBSD: if_iwmreg.h,v 1.10 2021/11/10 15:36:43 msaitoh Exp $	*/
 /*	OpenBSD: if_iwmreg.h,v 1.19 2016/09/20 11:46:09 stsp Exp 	*/
 
 /*-
@@ -2590,7 +2590,7 @@ enum {
  * notification the status is always success. There is no start/end fragment
  * notification for monolithic events.
  *
- * @IWM_TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
+ * @IWM_TE_V2_DEFAULT_POLICY: independent, social, present, unnoticeable
  * @IWM_TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
  * @IWM_TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
  * @IWM_TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use



CVS commit: src/sys/dev/pci

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 14:36:28 UTC 2021

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

Log Message:
Support 64bit BAR.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/dev/pci/sdhc_pci.c:1.18
--- src/sys/dev/pci/sdhc_pci.c:1.17	Wed Jan  1 23:28:31 2020
+++ src/sys/dev/pci/sdhc_pci.c	Wed Nov 10 14:36:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.17 2020/01/01 23:28:31 mlelstv Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.18 2021/11/10 14:36:28 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.17 2020/01/01 23:28:31 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.18 2021/11/10 14:36:28 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -252,6 +252,7 @@ sdhc_pci_attach(device_t parent, device_
 	bus_space_handle_t ioh;
 	bus_size_t size;
 	uint32_t flags;
+	int width;
 	char intrbuf[PCI_INTRSTR_LEN];
 
 	sc->sc.sc_dev = self;
@@ -313,13 +314,23 @@ sdhc_pci_attach(device_t parent, device_
 	if ((PCI_INTERFACE(pa->pa_class) == SDHC_PCI_INTERFACE_DMA))
 		SET(sc->sc.sc_flags, SDHC_FLAG_USE_DMA);
 
-	/* XXX: handle 64-bit BARs */
 	cnt = 0;
 	for (reg = SDHC_PCI_BAR_START + SDHC_PCI_FIRST_BAR(slotinfo) *
 		 sizeof(uint32_t);
 	 reg < SDHC_PCI_BAR_END && nslots > 0;
-	 reg += sizeof(uint32_t), nslots--) {
-		if (pci_mapreg_map(pa, reg, PCI_MAPREG_TYPE_MEM, 0,
+	 reg += width, nslots--) {
+		pcireg_t type;
+
+		type = pci_mapreg_type(pa->pa_pc, pa->pa_tag, reg);
+		if (type == PCI_MAPREG_TYPE_IO)
+			break;
+		else if (PCI_MAPREG_MEM_TYPE(type)
+		== PCI_MAPREG_MEM_TYPE_64BIT)
+			width = 8;
+		else
+			width = 4;
+
+		if (pci_mapreg_map(pa, reg, type, 0,
 		, , NULL, )) {
 			continue;
 		}



CVS commit: src/sys/dev/pci

2021-11-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 10 14:36:28 UTC 2021

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

Log Message:
Support 64bit BAR.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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

2021-11-08 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  8 11:01:52 UTC 2021

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

Log Message:
Group quirks by vendors. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/ahcisata_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/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.58 src/sys/dev/pci/ahcisata_pci.c:1.59
--- src/sys/dev/pci/ahcisata_pci.c:1.58	Mon Dec 28 20:01:46 2020
+++ src/sys/dev/pci/ahcisata_pci.c	Mon Nov  8 11:01:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.58 2020/12/28 20:01:46 jmcneill Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.59 2021/11/08 11:01:51 rin Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.58 2020/12/28 20:01:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.59 2021/11/08 11:01:51 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -200,10 +200,10 @@ static const struct ahci_pci_quirk ahci_
 	AHCI_PCI_QUIRK_FORCE },
 	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON_SATA,
 	AHCI_PCI_QUIRK_FORCE },
-	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801JI_SATA_AHCI,
-	AHCI_QUIRK_BADPMP },
 	{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON_SATA_AHCI,
 	AHCI_QUIRK_BADPMP },
+	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801JI_SATA_AHCI,
+	AHCI_QUIRK_BADPMP },
 };
 
 struct ahci_pci_softc {



CVS commit: src/sys/dev/pci

2021-11-08 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  8 11:01:52 UTC 2021

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

Log Message:
Group quirks by vendors. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/ahcisata_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

2021-11-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Nov  6 22:11:39 UTC 2021

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

Log Message:
s/invlaid/invalid/


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_iavf.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_iavf.c
diff -u src/sys/dev/pci/if_iavf.c:1.14 src/sys/dev/pci/if_iavf.c:1.15
--- src/sys/dev/pci/if_iavf.c:1.14	Wed Jun 16 00:21:18 2021
+++ src/sys/dev/pci/if_iavf.c	Sat Nov  6 22:11:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iavf.c,v 1.14 2021/06/16 00:21:18 riastradh Exp $	*/
+/*	$NetBSD: if_iavf.c,v 1.15 2021/11/06 22:11:39 andvar Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.14 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.15 2021/11/06 22:11:39 andvar Exp $");
 
 #include 
 #include 
@@ -5313,7 +5313,7 @@ iavf_parse_modprop(prop_dictionary_t dic
 		val = prop_number_signed_value((prop_number_t)obj);
 		n = 1U << (fls32(val) - 1);
 		if (val != (int64_t) n) {
-			printf("iavf: TX desc invlaid size"
+			printf("iavf: TX desc invalid size"
 			"(%" PRId64 " != %" PRIu32 ")\n", val, n);
 		} else if (val > (8192 - 32)) {
 			printf("iavf: Tx desc too big (%" PRId64 " > %d)",
@@ -5330,7 +5330,7 @@ iavf_parse_modprop(prop_dictionary_t dic
 		val = prop_number_signed_value((prop_number_t)obj);
 		n = 1U << (fls32(val) - 1);
 		if (val != (int64_t) n) {
-			printf("iavf: RX desc invlaid size"
+			printf("iavf: RX desc invalid size"
 			"(%" PRId64 " != %" PRIu32 ")\n", val, n);
 		} else if (val > (8192 - 32)) {
 			printf("iavf: Rx desc too big (%" PRId64 " > %d)",



CVS commit: src/sys/dev/pci

2021-11-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Nov  6 22:11:39 UTC 2021

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

Log Message:
s/invlaid/invalid/


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_iavf.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

2021-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Nov  5 23:39:47 UTC 2021

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

Log Message:
mcx(4): ensure that RQT size is always a power of two.
Fixes PR kern/56484.
Thanks riastradh for the power of two patch :). OK: mrg, jmcneill, riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_mcx.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

2021-11-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Nov  5 23:39:47 UTC 2021

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

Log Message:
mcx(4): ensure that RQT size is always a power of two.
Fixes PR kern/56484.
Thanks riastradh for the power of two patch :). OK: mrg, jmcneill, riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_mcx.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_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.22 src/sys/dev/pci/if_mcx.c:1.23
--- src/sys/dev/pci/if_mcx.c:1.22	Sun Sep 26 20:14:07 2021
+++ src/sys/dev/pci/if_mcx.c	Fri Nov  5 23:39:47 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.22 2021/09/26 20:14:07 jmcneill Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.23 2021/11/05 23:39:47 andvar Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.101 2021/06/02 19:16:11 patrick Exp $ */
 
 /*
@@ -23,7 +23,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.22 2021/09/26 20:14:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.23 2021/11/05 23:39:47 andvar Exp $");
 
 #include 
 #include 
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -2956,6 +2957,8 @@ mcx_attach(device_t parent, device_t sel
 
 	sc->sc_nqueues = uimin(MCX_MAX_QUEUES, msix);
 	sc->sc_nqueues = uimin(sc->sc_nqueues, ncpu);
+	/* Round down to a power of two.  */
+	sc->sc_nqueues = 1U << ilog2(sc->sc_nqueues);
 	sc->sc_queues = kmem_zalloc(sc->sc_nqueues * sizeof(*sc->sc_queues),
 	KM_SLEEP);
 



CVS commit: src/sys/dev/pci

2021-11-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 06:15:42 UTC 2021

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

Log Message:
 Fix comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 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_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.120 src/sys/dev/pci/if_wmreg.h:1.121
--- src/sys/dev/pci/if_wmreg.h:1.120	Wed Sep 16 15:04:02 2020
+++ src/sys/dev/pci/if_wmreg.h	Fri Nov  5 06:15:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.120 2020/09/16 15:04:02 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.121 2021/11/05 06:15:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -974,8 +974,8 @@ struct livengood_tcpip_ctxdesc {
 #define	WMREG_PHPM	0x0e14	/* PHY Power Management */
 #define	PHPM_SPD_EN		__BIT(0)	/* Smart Power Down */
 #define	PHPM_D0A_LPLU		__BIT(1)	/* D0 Low Power Link Up */
-#define	PHPM_NOND0A_LPLU	__BIT(2)	/* D0 Low Power Link Up */
-#define	PHPM_NOND0A_GBE_DIS	__BIT(3)	/* D0 Low Power Link Up */
+#define	PHPM_NOND0A_LPLU	__BIT(2)	/* Non-D0a LPLU */
+#define	PHPM_NOND0A_GBE_DIS	__BIT(3)	/* Disable 1G in non-D0a */
 #define	PHPM_GO_LINK_D		__BIT(5)	/* Go Link Disconnect */
 
 #define WMREG_EEER	0x0e30	/* Energy Efficiency Ethernet "EEE" */



CVS commit: src/sys/dev/pci

2021-11-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 06:15:42 UTC 2021

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

Log Message:
 Fix comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 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

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 05:52:49 UTC 2021

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

Log Message:
Fix a bug that device timeout still happens on ICH/PCH. Fixes PR kern/56478.

 - if_wm.c rev. 1.695 for PR kern/40981 still had a problem. The workaround
   flag was unexpectedly cleared when a cable is not connected, SIOCINITIFADDR
   was called, or if_init was called. Fix it.
 - Add debug printf()s.


To generate a diff of this commit:
cvs rdiff -u -r1.717 -r1.718 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.717 src/sys/dev/pci/if_wm.c:1.718
--- src/sys/dev/pci/if_wm.c:1.717	Fri Nov  5 01:49:14 2021
+++ src/sys/dev/pci/if_wm.c	Fri Nov  5 05:52:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.717 2021/11/05 01:49:14 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.718 2021/11/05 05:52:49 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.717 2021/11/05 01:49:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.718 2021/11/05 05:52:49 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3154,8 +3154,12 @@ alloc_retry:
 
 	sc->sc_txrx_use_workqueue = false;
 
-	if (wm_phy_need_linkdown_discard(sc))
+	if (wm_phy_need_linkdown_discard(sc)) {
+		DPRINTF(sc, WM_DEBUG_LINK,
+		("%s: %s: Set linkdown discard flag\n",
+			device_xname(sc->sc_dev), __func__));
 		wm_set_linkdown_discard(sc);
+	}
 
 	wm_init_sysctls(sc);
 
@@ -3625,10 +3629,12 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 		WM_CORE_UNLOCK(sc);
 		error = ifmedia_ioctl(ifp, ifr, >sc_mii.mii_media, cmd);
 		if (error == 0 && wm_phy_need_linkdown_discard(sc)) {
-			if (IFM_SUBTYPE(ifr->ifr_media) == IFM_NONE)
+			if (IFM_SUBTYPE(ifr->ifr_media) == IFM_NONE) {
+DPRINTF(sc, WM_DEBUG_LINK,
+("%s: %s: Set linkdown discard flag\n",
+	device_xname(sc->sc_dev), __func__));
 wm_set_linkdown_discard(sc);
-			else
-wm_clear_linkdown_discard(sc);
+			}
 		}
 		break;
 	case SIOCINITIFADDR:
@@ -3644,14 +3650,14 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 			break;
 		}
 		WM_CORE_UNLOCK(sc);
-		if (((ifp->if_flags & IFF_UP) == 0) && wm_phy_need_linkdown_discard(sc))
-			wm_clear_linkdown_discard(sc);
 		/*FALLTHROUGH*/
 	default:
 		if (cmd == SIOCSIFFLAGS && wm_phy_need_linkdown_discard(sc)) {
-			if (((ifp->if_flags & IFF_UP) == 0) && ((ifr->ifr_flags & IFF_UP) != 0)) {
-wm_clear_linkdown_discard(sc);
-			} else if (((ifp->if_flags & IFF_UP) != 0) && ((ifr->ifr_flags & IFF_UP) == 0)) {
+			if (((ifp->if_flags & IFF_UP) != 0) &&
+			((ifr->ifr_flags & IFF_UP) == 0)) {
+DPRINTF(sc, WM_DEBUG_LINK,
+("%s: %s: Set linkdown discard flag\n",
+	device_xname(sc->sc_dev), __func__));
 wm_set_linkdown_discard(sc);
 			}
 		}
@@ -7479,7 +7485,9 @@ wm_init_tx_queue(struct wm_softc *sc, st
 	wm_init_tx_regs(sc, wmq, txq);
 	wm_init_tx_buffer(sc, txq);
 
-	txq->txq_flags = 0; /* Clear WM_TXQ_NO_SPACE */
+	/* Clear other than WM_TXQ_LINKDOWN_DISCARD */
+	txq->txq_flags &= WM_TXQ_LINKDOWN_DISCARD;
+
 	txq->txq_sending = false;
 }
 
@@ -9490,13 +9498,21 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
 		DPRINTF(sc, WM_DEBUG_LINK, ("%s: LINK: LSC -> up %s\n",
 			device_xname(dev),
 			(status & STATUS_FD) ? "FDX" : "HDX"));
-		if (wm_phy_need_linkdown_discard(sc))
+		if (wm_phy_need_linkdown_discard(sc)) {
+			DPRINTF(sc, WM_DEBUG_LINK,
+			("%s: linkintr: Clear linkdown discard flag\n",
+device_xname(dev)));
 			wm_clear_linkdown_discard(sc);
+		}
 	} else {
 		DPRINTF(sc, WM_DEBUG_LINK, ("%s: LINK: LSC -> down\n",
 			device_xname(dev)));
-		if (wm_phy_need_linkdown_discard(sc))
+		if (wm_phy_need_linkdown_discard(sc)) {
+			DPRINTF(sc, WM_DEBUG_LINK,
+			("%s: linkintr: Set linkdown discard flag\n",
+device_xname(dev)));
 			wm_set_linkdown_discard(sc);
+		}
 	}
 	if ((sc->sc_type == WM_T_ICH8) && (link == false))
 		wm_gig_downshift_workaround_ich8lan(sc);



CVS commit: src/sys/dev/pci

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 05:52:49 UTC 2021

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

Log Message:
Fix a bug that device timeout still happens on ICH/PCH. Fixes PR kern/56478.

 - if_wm.c rev. 1.695 for PR kern/40981 still had a problem. The workaround
   flag was unexpectedly cleared when a cable is not connected, SIOCINITIFADDR
   was called, or if_init was called. Fix it.
 - Add debug printf()s.


To generate a diff of this commit:
cvs rdiff -u -r1.717 -r1.718 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

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 01:49:15 UTC 2021

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

Log Message:
 Use macro. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.716 -r1.717 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.716 src/sys/dev/pci/if_wm.c:1.717
--- src/sys/dev/pci/if_wm.c:1.716	Thu Nov  4 12:25:05 2021
+++ src/sys/dev/pci/if_wm.c	Fri Nov  5 01:49:14 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.716 2021/11/04 12:25:05 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.717 2021/11/05 01:49:14 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.716 2021/11/04 12:25:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.717 2021/11/05 01:49:14 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10502,9 +10502,9 @@ wm_gmii_setup_phytype(struct wm_softc *s
 	} else {
 		/* It's not the first call. Use PHY OUI and model */
 		switch (phy_oui) {
-		case MII_OUI_ATTANSIC: /* XXX ??? */
+		case MII_OUI_ATTANSIC: /* atphy(4) */
 			switch (phy_model) {
-			case 0x0004: /* XXX */
+			case MII_MODEL_ATTANSIC_AR8021:
 new_phytype = WMPHY_82578;
 break;
 			default:



CVS commit: src/sys/dev/pci

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Nov  5 01:49:15 UTC 2021

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

Log Message:
 Use macro. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.716 -r1.717 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

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov  4 12:25:05 UTC 2021

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

Log Message:
Add some sysctl info for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.715 -r1.716 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.715 src/sys/dev/pci/if_wm.c:1.716
--- src/sys/dev/pci/if_wm.c:1.715	Wed Oct 20 08:10:26 2021
+++ src/sys/dev/pci/if_wm.c	Thu Nov  4 12:25:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.715 2021/10/20 08:10:26 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.716 2021/11/04 12:25:05 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.715 2021/10/20 08:10:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.716 2021/11/04 12:25:05 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1068,6 +1068,8 @@ static bool	wm_phy_need_linkdown_discard
 static void	wm_set_linkdown_discard(struct wm_softc *);
 static void	wm_clear_linkdown_discard(struct wm_softc *);
 
+static int	wm_sysctl_tdh_handler(SYSCTLFN_PROTO);
+static int	wm_sysctl_tdt_handler(SYSCTLFN_PROTO);
 #ifdef WM_DEBUG
 static int	wm_sysctl_debug(SYSCTLFN_PROTO);
 #endif
@@ -5991,6 +5993,7 @@ wm_init_sysctls(struct wm_softc *sc)
 		sc->sc_queue[i].sysctlname, SYSCTL_DESCR("Queue Name"),
 		NULL, 0, NULL, 0, CTL_CREATE, CTL_EOL) != 0)
 			break;
+
 		if (sysctl_createv(log, 0, , ,
 		CTLFLAG_READONLY, CTLTYPE_INT,
 		"txq_free", SYSCTL_DESCR("TX queue free"),
@@ -5999,10 +6002,58 @@ wm_init_sysctls(struct wm_softc *sc)
 			break;
 		if (sysctl_createv(log, 0, , ,
 		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txd_head", SYSCTL_DESCR("TX descriptor head"),
+		wm_sysctl_tdh_handler, 0, (void *)txq,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txd_tail", SYSCTL_DESCR("TX descriptor tail"),
+		wm_sysctl_tdt_handler, 0, (void *)txq,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
 		"txq_next", SYSCTL_DESCR("TX queue next"),
 		NULL, 0, >txq_next,
 		0, CTL_CREATE, CTL_EOL) != 0)
 			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txq_sfree", SYSCTL_DESCR("TX queue sfree"),
+		NULL, 0, >txq_sfree,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txq_snext", SYSCTL_DESCR("TX queue snext"),
+		NULL, 0, >txq_snext,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txq_sdirty", SYSCTL_DESCR("TX queue sdirty"),
+		NULL, 0, >txq_sdirty,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_INT,
+		"txq_flags", SYSCTL_DESCR("TX queue flags"),
+		NULL, 0, >txq_flags,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_BOOL,
+		"txq_stopping", SYSCTL_DESCR("TX queue stopping"),
+		NULL, 0, >txq_stopping,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
+		if (sysctl_createv(log, 0, , ,
+		CTLFLAG_READONLY, CTLTYPE_BOOL,
+		"txq_sending", SYSCTL_DESCR("TX queue sending"),
+		NULL, 0, >txq_sending,
+		0, CTL_CREATE, CTL_EOL) != 0)
+			break;
 
 		if (sysctl_createv(log, 0, , ,
 		CTLFLAG_READONLY, CTLTYPE_INT,
@@ -17084,7 +17135,35 @@ wm_legacy_irq_quirk_spt(struct wm_softc 
 	CSR_WRITE(sc, WMREG_FEXTNVM9, reg);
 }
 
-/* Sysctl function */
+/* Sysctl functions */
+static int
+wm_sysctl_tdh_handler(SYSCTLFN_ARGS)
+{
+	struct sysctlnode node = *rnode;
+	struct wm_txqueue *txq = (struct wm_txqueue *)node.sysctl_data;
+	struct wm_queue *wmq = container_of(txq, struct wm_queue, wmq_txq);
+	struct wm_softc *sc = txq->txq_sc; 
+	uint32_t reg;
+
+	reg = CSR_READ(sc, WMREG_TDH(wmq->wmq_id));
+	node.sysctl_data = 
+	return sysctl_lookup(SYSCTLFN_CALL());
+}
+
+static int
+wm_sysctl_tdt_handler(SYSCTLFN_ARGS)
+{
+	struct sysctlnode node = *rnode;
+	struct wm_txqueue *txq = (struct wm_txqueue *)node.sysctl_data;
+	struct wm_queue *wmq = container_of(txq, struct wm_queue, wmq_txq);
+	struct wm_softc *sc = txq->txq_sc; 
+	uint32_t reg;
+
+	reg = CSR_READ(sc, WMREG_TDT(wmq->wmq_id));
+	node.sysctl_data = 
+	return sysctl_lookup(SYSCTLFN_CALL());
+}
+
 #ifdef WM_DEBUG
 static int
 wm_sysctl_debug(SYSCTLFN_ARGS)
@@ -17102,6 +17181,8 @@ wm_sysctl_debug(SYSCTLFN_ARGS)
 		return error;
 
 	sc->sc_debug = dflags;
+	device_printf(sc->sc_dev, "TARC0: %08x\n", CSR_READ(sc, WMREG_TARC0));
+	device_printf(sc->sc_dev, "TDT0: %08x\n", CSR_READ(sc, 

CVS commit: src/sys/dev/pci

2021-11-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov  4 12:25:05 UTC 2021

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

Log Message:
Add some sysctl info for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.715 -r1.716 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

2021-11-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  3 15:10:12 UTC 2021

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.1427 -r1.1428 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1426 -r1.1427 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

2021-11-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  3 15:09:42 UTC 2021

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

Log Message:
- Rename EHL_TRACE* macros
- Update Jasper Lake's Processor Transaction Routers.


To generate a diff of this commit:
cvs rdiff -u -r1.1442 -r1.1443 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.1442 src/sys/dev/pci/pcidevs:1.1443
--- src/sys/dev/pci/pcidevs:1.1442	Wed Oct 27 18:25:31 2021
+++ src/sys/dev/pci/pcidevs	Wed Nov  3 15:09:42 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1442 2021/10/27 18:25:31 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1443 2021/11/03 15:09:42 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5645,13 +5645,13 @@ product INTEL EHL_GPU_32_SUPER	0x4551	El
 product INTEL EHL_GPU_32	0x4551	Elkhart Lake GPU (32EU)
 product INTEL EHL_DPTF		0x4503	Elkhart Lake DPTF
 product INTEL EHL_GNA		0x4511	Elkhart Lake GNA
-product INTEL EHL_TRACE_1	0x4529	Elkhart Lake Trace Hub (Compute Die)
+product INTEL EHL_TRACE_2	0x4529	Elkhart Lake Trace Hub (Compute Die)
 product INTEL EHL_ESPI		0x4b00	Elkhart Lake eSPI
 product INTEL EHL_P2SB		0x4b20	Elkhart Lake P2SB
 product INTEL EHL_PMC		0x4b21	Elkhart Lake PMC
 product INTEL EHL_SMB		0x4b23	Elkhart Lake SMBus
 product INTEL EHL_SPI_FLASH	0x4b24	Elkhart Lake SPI (FLASH & TPM)
-product INTEL EHL_TRACE		0x4b26	Elkhart Lake Trace Hub (PCH)
+product INTEL EHL_TRACE_1	0x4b26	Elkhart Lake Trace Hub (PCH)
 product INTEL EHL_SIO_UART_0	0x4b28	Elkhart Lake SIO UART 0
 product INTEL EHL_SIO_UART_1	0x4b29	Elkhart Lake SIO UART 1
 product INTEL EHL_SIO_SPI_0	0x4b2a	Elkhart Lake SIO SPI 0
@@ -5741,7 +5741,7 @@ product INTEL JSL_P2SB		0x4da0	Jasper La
 product INTEL JSL_PMC		0x4da1	Jasper Lake PMC
 product INTEL JSL_SMB		0x4da3	Jasper Lake SMBus
 product INTEL JSL_SPI_FLASH	0x4da4	Jasper Lake SPI (FLASH)
-product INTEL JSL_TRACE		0x4da6	Jasper Lake Intel Trace Hub
+product INTEL JSL_TRACE_1	0x4da6	Jasper Lake Intel Trace Hub (PCH)
 product INTEL JSL_UART_0	0x4da8	Jasper Lake UART 0
 product INTEL JSL_UART_1	0x4da9	Jasper Lake UART 1
 product INTEL JSL_SPI_0		0x4daa	Jasper Lake SPI 0
@@ -5781,7 +5781,13 @@ product INTEL JSL_CNVI_3	0x4df3	Jasper L
 product INTEL JSL_SCS		0x4df8	Jasper Lake SD Card
 product INTEL JSL_SPI_2		0x4dfb	Jasper Lake SPI 2
 product INTEL JSL_DPTF		0x4e03	Jasper Lake DPTF
-product INTEL JSL_HB		0x4e22	Jasper Lake Processor Transaction Route
+product INTEL JSL_TROUTER_4_1	0x4e12	Jasper Lake Processor Transaction Router (SKU 4)
+product INTEL JSL_TROUTER_2_1	0x4e14	Jasper Lake Processor Transaction Router (SKU 2)
+product INTEL JSL_TROUTER_2_2	0x4e22	Jasper Lake Processor Transaction Router (SKU 2)
+product INTEL JSL_TROUTER_4_2	0x4e24	Jasper Lake Processor Transaction Router (SKU 4)
+product INTEL JSL_TROUTER_4_3	0x4e26	Jasper Lake Processor Transaction Router (SKU 4)
+product INTEL JSL_TROUTER_4_4	0x4e28	Jasper Lake Processor Transaction Router (SKU 4)
+product INTEL JSL_TRACE_2	0x4da6	Jasper Lake Intel Trace Hub (Compute Die)
 product INTEL JSL_GPU_EU_16	0x4e55	Jasper Lake GPU 16 EU
 product INTEL JSL_GPU_EU_24	0x4e61	Jasper Lake GPU 24 EU
 product INTEL JSL_GPU_EU_32	0x4e71	Jasper Lake GPU 32 EU



CVS commit: src/sys/dev/pci

2021-11-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  3 15:09:42 UTC 2021

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

Log Message:
- Rename EHL_TRACE* macros
- Update Jasper Lake's Processor Transaction Routers.


To generate a diff of this commit:
cvs rdiff -u -r1.1442 -r1.1443 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

2021-10-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 28 09:15:36 UTC 2021

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

Log Message:
Support devices that the PCI subclass is not PCI_SUBCLASS_MULTIMEDIA_HDAUDIO.

 - Not tested well.
 - If audioX is not attached, add HDAUDIO_ENABLE_DISPLAYPORT and
   HDAUDIO_ENABLE_HDMI to your kernel config.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/hdaudio_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

2021-10-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 28 09:15:36 UTC 2021

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

Log Message:
Support devices that the PCI subclass is not PCI_SUBCLASS_MULTIMEDIA_HDAUDIO.

 - Not tested well.
 - If audioX is not attached, add HDAUDIO_ENABLE_DISPLAYPORT and
   HDAUDIO_ENABLE_HDMI to your kernel config.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/hdaudio_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/hdaudio_pci.c
diff -u src/sys/dev/pci/hdaudio_pci.c:1.10 src/sys/dev/pci/hdaudio_pci.c:1.11
--- src/sys/dev/pci/hdaudio_pci.c:1.10	Wed Sep 12 09:49:03 2018
+++ src/sys/dev/pci/hdaudio_pci.c	Thu Oct 28 09:15:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.10 2018/09/12 09:49:03 mrg Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.11 2021/10/28 09:15:35 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.10 2018/09/12 09:49:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.11 2021/10/28 09:15:35 msaitoh Exp $");
 
 #include 
 #include 
@@ -84,6 +84,17 @@ CFATTACH_DECL2_NEW(
 hdaudio_pci_childdet
 );
 
+/* Some devices' sublcass is not PCI_SUBCLASS_MULTIMEDIA_HDAUDIO. */
+static const struct device_compatible_entry compat_data[] = {
+	{ .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_2HS_U_HDA) },
+	{ .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3HS_U_HDA) },
+	{ .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_4HS_H_CAVS) },
+	{ .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_5HS_LP_HDA) },
+	{ .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_JSL_CAVS) },
+
+	PCI_COMPAT_EOL
+};
+
 /*
  * NetBSD autoconfiguration
  */
@@ -93,12 +104,13 @@ hdaudio_pci_match(device_t parent, cfdat
 {
 	struct pci_attach_args *pa = opaque;
 
-	if (PCI_CLASS(pa->pa_class) != PCI_CLASS_MULTIMEDIA)
-		return 0;
-	if (PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_MULTIMEDIA_HDAUDIO)
-		return 0;
+	if ((PCI_CLASS(pa->pa_class) == PCI_CLASS_MULTIMEDIA) &&
+	(PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MULTIMEDIA_HDAUDIO))
+		return 10;
+	if (pci_compatible_match(pa, compat_data) != 0)
+		return 10;
 
-	return 10;
+	return 0;
 }
 
 static void



CVS commit: src/sys/dev/pci

2021-10-27 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 28 01:36:43 UTC 2021

Modified Files:
src/sys/dev/pci: if_vioif.c virtio.c virtio_pci.c virtiovar.h

Log Message:
virtio: stop reinit for safety when a device resetting is failed


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pci/if_vioif.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/virtiovar.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_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.70 src/sys/dev/pci/if_vioif.c:1.71
--- src/sys/dev/pci/if_vioif.c:1.70	Mon Feb  8 06:56:26 2021
+++ src/sys/dev/pci/if_vioif.c	Thu Oct 28 01:36:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.70 2021/02/08 06:56:26 skrll Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.71 2021/10/28 01:36:43 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.70 2021/02/08 06:56:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.71 2021/10/28 01:36:43 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1155,7 +1156,12 @@ vioif_init(struct ifnet *ifp)
 
 	vioif_stop(ifp, 0);
 
-	virtio_reinit_start(vsc);
+	r = virtio_reinit_start(vsc);
+	if (r != 0) {
+		log(LOG_ERR, "%s: reset failed\n", ifp->if_xname);
+		return EIO;
+	}
+
 	virtio_negotiate_features(vsc, virtio_features(vsc));
 
 	for (i = 0; i < sc->sc_req_nvq_pairs; i++) {

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.52 src/sys/dev/pci/virtio.c:1.53
--- src/sys/dev/pci/virtio.c:1.52	Thu Oct 21 07:08:55 2021
+++ src/sys/dev/pci/virtio.c	Thu Oct 28 01:36:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $	*/
+/*	$NetBSD: virtio.c,v 1.53 2021/10/28 01:36:43 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.53 2021/10/28 01:36:43 yamaguchi Exp $");
 
 #include 
 #include 
@@ -90,7 +90,7 @@ virtio_reset(struct virtio_softc *sc)
 	virtio_device_reset(sc);
 }
 
-void
+int
 virtio_reinit_start(struct virtio_softc *sc)
 {
 	int i, r;
@@ -114,10 +114,15 @@ virtio_reinit_start(struct virtio_softc 
 	}
 
 	r = sc->sc_ops->setup_interrupts(sc, 1);
-	if (r != 0) {
-		printf("%s: failed to setup interrupts\n",
-		device_xname(sc->sc_dev));
-	}
+	if (r != 0)
+		goto fail;
+
+	return 0;
+
+fail:
+	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_FAILED);
+
+	return 1;
 }
 
 void

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.32 src/sys/dev/pci/virtio_pci.c:1.33
--- src/sys/dev/pci/virtio_pci.c:1.32	Thu Oct 21 05:37:43 2021
+++ src/sys/dev/pci/virtio_pci.c	Thu Oct 28 01:36:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.32 2021/10/21 05:37:43 yamaguchi Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.33 2021/10/28 01:36:43 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.32 2021/10/21 05:37:43 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.33 2021/10/28 01:36:43 yamaguchi Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: virtio_pci.c
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -50,6 +51,18 @@ __KERNEL_RCSID(0, "$NetBSD: virtio_pci.c
 #include  /* XXX: move to non-pci */
 
 
+#define VIRTIO_PCI_LOG(_sc, _use_log, _fmt, _args...)	\
+do {			\
+	if ((_use_log)) {\
+		log(LOG_DEBUG, "%s: " _fmt,		\
+		device_xname((_sc)->sc_dev),	\
+		##_args);\
+	} else {	\
+		aprint_error_dev((_sc)->sc_dev,		\
+		_fmt, ##_args);			\
+	}		\
+} while(0)
+
 static int	virtio_pci_match(device_t, cfdata_t, void *);
 static void	virtio_pci_attach(device_t, device_t, void *);
 static int	virtio_pci_rescan(device_t, const char *, const int *);
@@ -808,7 +821,6 @@ static int
 virtio_pci_setup_interrupts_10(struct virtio_softc *sc, int reinit)
 {
 	struct virtio_pci_softc * const psc = (struct virtio_pci_softc *)sc;
-	device_t self  =  sc->sc_dev;
 	bus_space_tag_t	   iot = psc->sc_iot;
 	bus_space_handle_t ioh = psc->sc_ioh;
 	int vector, ret, qid;
@@ -821,10 +833,8 @@ virtio_pci_setup_interrupts_10(struct vi
 		VIRTIO_CONFIG1_CONFIG_MSIX_VECTOR, vector);
 	ret = bus_space_read_2(iot, ioh, VIRTIO_CONFIG1_CONFIG_MSIX_VECTOR);
 	if (ret != vector) {
-		if (reinit == 0) {
-			aprint_error_dev(self,
-			"can't set config msix vector\n");
-		}
+		VIRTIO_PCI_LOG(sc, reinit,
+	

CVS commit: src/sys/dev/pci

2021-10-27 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 28 01:36:43 UTC 2021

Modified Files:
src/sys/dev/pci: if_vioif.c virtio.c virtio_pci.c virtiovar.h

Log Message:
virtio: stop reinit for safety when a device resetting is failed


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pci/if_vioif.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/virtiovar.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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 18:50:57 UTC 2021

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

Log Message:
Add Elkhart Lake support.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.74 src/sys/dev/pci/ichsmb.c:1.75
--- src/sys/dev/pci/ichsmb.c:1.74	Tue Oct 12 14:15:34 2021
+++ src/sys/dev/pci/ichsmb.c	Wed Oct 27 18:50:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.74 2021/10/12 14:15:34 msaitoh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.75 2021/10/27 18:50:57 msaitoh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.74 2021/10/12 14:15:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.75 2021/10/27 18:50:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -136,6 +136,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_BSW_PCU_SMB:
 		case PCI_PRODUCT_INTEL_APL_SMB:
 		case PCI_PRODUCT_INTEL_GLK_SMB:
+		case PCI_PRODUCT_INTEL_EHL_SMB:
 		case PCI_PRODUCT_INTEL_JSL_SMB:
 		case PCI_PRODUCT_INTEL_C600_SMBUS:
 		case PCI_PRODUCT_INTEL_C600_SMB_0:



CVS commit: src/sys/dev/pci

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 18:50:57 UTC 2021

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

Log Message:
Add Elkhart Lake support.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/ichsmb.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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 18:26:06 UTC 2021

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.1426 -r1.1427 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1425 -r1.1426 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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 18:25:31 UTC 2021

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

Log Message:
Add Intel Elkhart Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1441 -r1.1442 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.1441 src/sys/dev/pci/pcidevs:1.1442
--- src/sys/dev/pci/pcidevs:1.1441	Wed Oct 27 11:18:22 2021
+++ src/sys/dev/pci/pcidevs	Wed Oct 27 18:25:31 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1441 2021/10/27 11:18:22 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1442 2021/10/27 18:25:31 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5626,6 +5626,116 @@ product INTEL 5HS_H_CNVI	0x43f0	500 Seri
 product INTEL 5HS_H_GSPI_2	0x43fb	500 Series PCH-H GSPI 2
 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_TROUTER_3	0x4512	Elkhart Lake Transaction Router (SKU 3)
+product INTEL EHL_TROUTER_3A	0x451e	Elkhart Lake Transaction Router (SKU 3A)
+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_1	0x4522	Elkhart Lake Transaction Router (SKU 1)
+product INTEL EHL_TROUTER_1A	0x4538	Elkhart Lake Transaction Router (SKU 1A)
+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_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_11	0x4532	Elkhart Lake Transaction Router (SKU 11)
+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_DPTF		0x4503	Elkhart Lake DPTF
+product INTEL EHL_GNA		0x4511	Elkhart Lake GNA
+product INTEL EHL_TRACE_1	0x4529	Elkhart Lake Trace Hub (Compute Die)
+product INTEL EHL_ESPI		0x4b00	Elkhart Lake eSPI
+product INTEL EHL_P2SB		0x4b20	Elkhart Lake P2SB
+product INTEL EHL_PMC		0x4b21	Elkhart Lake PMC
+product INTEL EHL_SMB		0x4b23	Elkhart Lake SMBus
+product INTEL EHL_SPI_FLASH	0x4b24	Elkhart Lake SPI (FLASH & TPM)
+product INTEL EHL_TRACE		0x4b26	Elkhart Lake Trace Hub (PCH)
+product INTEL EHL_SIO_UART_0	0x4b28	Elkhart Lake SIO UART 0
+product INTEL EHL_SIO_UART_1	0x4b29	Elkhart Lake SIO UART 1
+product INTEL EHL_SIO_SPI_0	0x4b2a	Elkhart Lake SIO SPI 0
+product INTEL EHL_SIO_SPI_1	0x4b2b	Elkhart Lake SIO SPI 1
+product INTEL EHL_IEH		0x4b2f	Elkhart Lake IEH
+product INTEL EHL_ETH		0x4b32	Elkhart Lake Ethernet
+product INTEL EHL_SIO_SPI_2	0x4b37	Elkhart Lake SIO SPI 2
+product INTEL EHL_PCIE_RP_0	0x4b38	Elkhart Lake PCIe Root Port 0 (PCIe 0, Single VC)
+product INTEL EHL_PCIE_RP_1	0x4b39	Elkhart Lake PCIe Root Port 1 (PCIe 0, Single VC)
+product INTEL EHL_PCIE_RP_2	0x4b3a	Elkhart Lake PCIe Root Port 2 (PCIe 0, Single VC)
+product INTEL EHL_PCIE_RP_3	0x4b3b	Elkhart Lake PCIe Root Port 3 (PCIe 0, Single VC)
+product INTEL EHL_PCIE_RP_4	0x4b3c	Elkhart Lake PCIe Root Port 4 (PCIe 1, Multi VC)
+product INTEL EHL_PCIE_RP_5	0x4b3d	Elkhart Lake PCIe Root Port 5 (PCIe 2, Multi VC)
+product INTEL EHL_PCIE_RP_6	0x4b3e	Elkhart Lake PCIe Root Port 6 (PCIe 3, Multi VC)
+product INTEL EHL_SIO_I2C_6	0x4b44	Elkhart Lake SIO I2C 6
+product INTEL EHL_SIO_I2C_7	0x4b45	Elkhart Lake SIO I2C 7
+product INTEL EHL_EMMC		0x4b47	Elkhart Lake eMMC
+product INTEL EHL_SDIO		0x4b48	Elkhart Lake SDIO
+product INTEL EHL_SI		0x4b4a	Elkhart Lake Safety Island
+product INTEL EHL_SIO_I2C_4	0x4b4b	Elkhart Lake SIO I2C 4
+product INTEL EHL_SIO_I2C_5	0x4b4c	Elkhart Lake SIO I2C 5
+product INTEL EHL_SIO_UART_2	0x4b4d	Elkhart Lake SIO UART 2
+product INTEL EHL_CAVS_1	0x4b55	Elkhart Lake cAVS
+product INTEL EHL_CAVS_2	0x4b56	Elkhart Lake cAVS
+product INTEL EHL_CAVS_3	0x4b57	Elkhart Lake cAVS
+product INTEL EHL_CAVS_4	0x4b58	Elkhart Lake cAVS
+product INTEL EHL_CAVS_5	0x4b59	Elkhart Lake cAVS
+product INTEL EHL_CAVS_6	0x4b5a	Elkhart Lake cAVS
+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_HPET		0x4b68	Elkhart Lake HPET
+product INTEL EHL_IOAPIC	0x4b69	Elkhart Lake IOAPIC
+product INTEL EHL_CSE_UMA	0x4b6c	Elkhart Lake CSE UMA Access
+product INTEL EHL_CSE_PTTDMA	0x4b6b	Elkhart Lake CSE PTT DMA
+product INTEL EHL_CSE_HECI_0	

CVS commit: src/sys/dev/pci

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 18:25:31 UTC 2021

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

Log Message:
Add Intel Elkhart Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1441 -r1.1442 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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 11:18:56 UTC 2021

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.1425 -r1.1426 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1424 -r1.1425 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.1425 src/sys/dev/pci/pcidevs.h:1.1426
--- src/sys/dev/pci/pcidevs.h:1.1425	Wed Oct 13 07:06:53 2021
+++ src/sys/dev/pci/pcidevs.h	Wed Oct 27 11:18:55 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1425 2021/10/13 07:06:53 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1426 2021/10/27 11:18:55 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1440 2021/10/13 07:06:23 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1441 2021/10/27 11:18:22 msaitoh Exp
  */
 
 /*
@@ -5165,6 +5165,7 @@
 #define	PCI_PRODUCT_INTEL_GLK_FASTSPI	0x3196		/* Gemini Lake Fast SPI */
 #define	PCI_PRODUCT_INTEL_GLK_ESPI	0x3197		/* Gemini Lake eSPI */
 #define	PCI_PRODUCT_INTEL_GLK_HDA	0x3198		/* Gemini Lake HD Audio */
+#define	PCI_PRODUCT_INTEL_GLK_TXE_HECI_1	0x319a		/* Gemini Lake TXE HECI 1 */
 #define	PCI_PRODUCT_INTEL_GLK_ISH	0x31a2		/* Gemini Lake Integrated Sensor Hub */
 #define	PCI_PRODUCT_INTEL_GLK_XHCI	0x31a8		/* Gemini Lake USB Host (xHCI) */
 #define	PCI_PRODUCT_INTEL_GLK_XDCI	0x31aa		/* Gemini Lake USB Device (xDCI) */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1424 src/sys/dev/pci/pcidevs_data.h:1.1425
--- src/sys/dev/pci/pcidevs_data.h:1.1424	Wed Oct 13 07:06:52 2021
+++ src/sys/dev/pci/pcidevs_data.h	Wed Oct 27 11:18:55 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1424 2021/10/13 07:06:52 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1425 2021/10/27 11:18:55 msaitoh Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1440 2021/10/13 07:06:23 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1441 2021/10/27 11:18:22 msaitoh Exp
  */
 
 /*
@@ -9027,6 +9027,8 @@ static const uint32_t pci_products[] = {
 	27820, 22906, 23040, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_GLK_HDA, 
 	27820, 22906, 8152, 7021, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_GLK_TXE_HECI_1, 
+	27820, 22906, 26462, 23501, 8088, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_GLK_ISH, 
 	27820, 22906, 692, 23157, 8664, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_GLK_XHCI, 
@@ -17799,7 +17801,7 @@ static const char pci_words[] = { "." 
 	"Processor\0" /* 54 refs @ 8067 */
 	"Function\0" /* 39 refs @ 8077 */
 	"0\0" /* 121 refs @ 8086 */
-	"1\0" /* 142 refs @ 8088 */
+	"1\0" /* 143 refs @ 8088 */
 	"5\0" /* 36 refs @ 8090 */
 	"Root\0" /* 278 refs @ 8092 */
 	"Complex\0" /* 11 refs @ 8097 */
@@ -19868,7 +19870,7 @@ static const char pci_words[] = { "." 
 	"TwinTurbo\0" /* 1 refs @ 22886 */
 	"128M\0" /* 1 refs @ 22896 */
 	"Iron\0" /* 6 refs @ 22901 */
-	"Lake\0" /* 219 refs @ 22906 */
+	"Lake\0" /* 220 refs @ 22906 */
 	"Core\0" /* 180 refs @ 22911 */
 	"Centrino\0" /* 28 refs @ 22916 */
 	"Advanced-N\0" /* 10 refs @ 22925 */
@@ -19963,7 +19965,7 @@ static const char pci_words[] = { "." 
 	"desktop\0" /* 4 refs @ 23479 */
 	"mobile\0" /* 6 refs @ 23487 */
 	"Optane\0" /* 1 refs @ 23494 */
-	"HECI\0" /* 43 refs @ 23501 */
+	"HECI\0" /* 44 refs @ 23501 */
 	"6150\0" /* 4 refs @ 23506 */
 	"2230\0" /* 2 refs @ 23511 */
 	"6235\0" /* 2 refs @ 23516 */
@@ -20399,7 +20401,7 @@ static const char pci_words[] = { "." 
 	"SPI2\0" /* 1 refs @ 26448 */
 	"MMC\0" /* 1 refs @ 26453 */
 	"SDIO\0" /* 5 refs @ 26457 */
-	"TXE\0" /* 4 refs @ 26462 */
+	"TXE\0" /* 5 refs @ 26462 */
 	"SPI3\0" /* 1 refs @ 26466 */
 	"(OTG)\0" /* 6 refs @ 26471 */
 	"ISP\0" /* 1 refs @ 26477 */
@@ -20581,7 +20583,7 @@ static const char pci_words[] = { "." 
 	"3165\0" /* 2 refs @ 27807 */
 	"UHD\0" /* 35 refs @ 27812 */
 	"605\0" /* 2 refs @ 27816 */
-	"Gemini\0" /* 34 refs @ 27820 */
+	"Gemini\0" /* 35 refs @ 27820 */
 	"DPTF\0" /* 3 refs @ 27827 */
 	"GNA\0" /* 1 refs @ 27832 */
 	"SideBand\0" /* 2 refs @ 27836 */



CVS commit: src/sys/dev/pci

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 11:18:56 UTC 2021

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.1425 -r1.1426 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1424 -r1.1425 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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 11:18:23 UTC 2021

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

Log Message:
Add Intel Gemini Lake TXE HECI 1.


To generate a diff of this commit:
cvs rdiff -u -r1.1440 -r1.1441 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

2021-10-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 27 11:18:23 UTC 2021

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

Log Message:
Add Intel Gemini Lake TXE HECI 1.


To generate a diff of this commit:
cvs rdiff -u -r1.1440 -r1.1441 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.1440 src/sys/dev/pci/pcidevs:1.1441
--- src/sys/dev/pci/pcidevs:1.1440	Wed Oct 13 07:06:23 2021
+++ src/sys/dev/pci/pcidevs	Wed Oct 27 11:18:22 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1440 2021/10/13 07:06:23 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1441 2021/10/27 11:18:22 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5158,6 +5158,7 @@ product INTEL GLK_PMC		0x3194	Gemini Lak
 product INTEL GLK_FASTSPI	0x3196	Gemini Lake Fast SPI
 product INTEL GLK_ESPI		0x3197	Gemini Lake eSPI
 product INTEL GLK_HDA		0x3198	Gemini Lake HD Audio
+product INTEL GLK_TXE_HECI_1	0x319a	Gemini Lake TXE HECI 1
 product INTEL GLK_ISH		0x31a2	Gemini Lake Integrated Sensor Hub
 product INTEL GLK_XHCI		0x31a8	Gemini Lake USB Host (xHCI)
 product INTEL GLK_XDCI		0x31aa	Gemini Lake USB Device (xDCI)



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

2021-10-21 Thread Jonathan A. Kollasch
On Thu, Oct 21, 2021 at 05:32:28AM +, Shoichi YAMAGUCHI wrote:
> Module Name:  src
> Committed By: yamaguchi
> Date: Thu Oct 21 05:32:27 UTC 2021
> 
> Modified Files:
>   src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h
> 
> Log Message:
> divide setup routine of virtio interrupts
> into establishment and device configuration
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/virtio.c
> cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/virtio_pci.c
> cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/virtiovar.h

This seems to have broken the virtio_mmio build.


CVS commit: src/sys/dev/pci

2021-10-21 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 07:08:56 UTC 2021

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

Log Message:
virtio: fix missing release of interrupt resources


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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.51 src/sys/dev/pci/virtio.c:1.52
--- src/sys/dev/pci/virtio.c:1.51	Thu Oct 21 05:37:43 2021
+++ src/sys/dev/pci/virtio.c	Thu Oct 21 07:08:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $	*/
+/*	$NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $");
 
 #include 
 #include 
@@ -1214,6 +1214,7 @@ virtio_child_attach_finish(struct virtio
 	r = sc->sc_ops->setup_interrupts(sc, 0);
 	if (r != 0) {
 		aprint_error_dev(sc->sc_dev, "failed to setup interrupts\n");
+		goto fail;
 	}
 
 	KASSERT(sc->sc_soft_ih == NULL);
@@ -1240,6 +1241,8 @@ fail:
 		sc->sc_soft_ih = NULL;
 	}
 
+	sc->sc_ops->free_interrupts(sc);
+
 	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_FAILED);
 	return 1;
 }



CVS commit: src/sys/dev/pci

2021-10-21 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 07:08:56 UTC 2021

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

Log Message:
virtio: fix missing release of interrupt resources


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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

2021-10-20 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 05:37:43 UTC 2021

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h

Log Message:
virtio: reconfigure MSI-X vector on re-initialization

This may fix a problem that some interrupts, for example
link-state change of vioif(4) are not notified.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/virtiovar.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

2021-10-20 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 05:37:43 UTC 2021

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h

Log Message:
virtio: reconfigure MSI-X vector on re-initialization

This may fix a problem that some interrupts, for example
link-state change of vioif(4) are not notified.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/virtiovar.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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.50 src/sys/dev/pci/virtio.c:1.51
--- src/sys/dev/pci/virtio.c:1.50	Thu Oct 21 05:32:27 2021
+++ src/sys/dev/pci/virtio.c	Thu Oct 21 05:37:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.50 2021/10/21 05:32:27 yamaguchi Exp $	*/
+/*	$NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.50 2021/10/21 05:32:27 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $");
 
 #include 
 #include 
@@ -93,7 +93,7 @@ virtio_reset(struct virtio_softc *sc)
 void
 virtio_reinit_start(struct virtio_softc *sc)
 {
-	int i;
+	int i, r;
 
 	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_ACK);
 	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER);
@@ -112,6 +112,12 @@ virtio_reinit_start(struct virtio_softc 
 		sc->sc_ops->setup_queue(sc, vq->vq_index,
 		vq->vq_dmamap->dm_segs[0].ds_addr);
 	}
+
+	r = sc->sc_ops->setup_interrupts(sc, 1);
+	if (r != 0) {
+		printf("%s: failed to setup interrupts\n",
+		device_xname(sc->sc_dev));
+	}
 }
 
 void
@@ -1205,7 +1211,7 @@ virtio_child_attach_finish(struct virtio
 		goto fail;
 	}
 
-	r = sc->sc_ops->setup_interrupts(sc);
+	r = sc->sc_ops->setup_interrupts(sc, 0);
 	if (r != 0) {
 		aprint_error_dev(sc->sc_dev, "failed to setup interrupts\n");
 	}

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.31 src/sys/dev/pci/virtio_pci.c:1.32
--- src/sys/dev/pci/virtio_pci.c:1.31	Thu Oct 21 05:32:27 2021
+++ src/sys/dev/pci/virtio_pci.c	Thu Oct 21 05:37:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.31 2021/10/21 05:32:27 yamaguchi Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.32 2021/10/21 05:37:43 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.31 2021/10/21 05:32:27 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.32 2021/10/21 05:37:43 yamaguchi Exp $");
 
 #include 
 #include 
@@ -112,8 +112,8 @@ static int	virtio_pci_adjust_config_regi
 static int	virtio_pci_intr(void *arg);
 static int	virtio_pci_msix_queue_intr(void *);
 static int	virtio_pci_msix_config_intr(void *);
-static int	virtio_pci_setup_interrupts_09(struct virtio_softc *);
-static int	virtio_pci_setup_interrupts_10(struct virtio_softc *);
+static int	virtio_pci_setup_interrupts_09(struct virtio_softc *, int);
+static int	virtio_pci_setup_interrupts_10(struct virtio_softc *, int);
 static int	virtio_pci_establish_msix_interrupts(struct virtio_softc *,
 		struct pci_attach_args *);
 static int	virtio_pci_establish_intx_interrupt(struct virtio_softc *,
@@ -805,7 +805,7 @@ virtio_pci_negotiate_features_10(struct 
  * -*/
 
 static int
-virtio_pci_setup_interrupts_10(struct virtio_softc *sc)
+virtio_pci_setup_interrupts_10(struct virtio_softc *sc, int reinit)
 {
 	struct virtio_pci_softc * const psc = (struct virtio_pci_softc *)sc;
 	device_t self  =  sc->sc_dev;
@@ -821,7 +821,10 @@ virtio_pci_setup_interrupts_10(struct vi
 		VIRTIO_CONFIG1_CONFIG_MSIX_VECTOR, vector);
 	ret = bus_space_read_2(iot, ioh, VIRTIO_CONFIG1_CONFIG_MSIX_VECTOR);
 	if (ret != vector) {
-		aprint_error_dev(self, "can't set config msix vector\n");
+		if (reinit == 0) {
+			aprint_error_dev(self,
+			"can't set config msix vector\n");
+		}
 		return -1;
 	}
 
@@ -836,8 +839,10 @@ virtio_pci_setup_interrupts_10(struct vi
 		ret = bus_space_read_2(iot, ioh,
 			VIRTIO_CONFIG1_QUEUE_MSIX_VECTOR);
 		if (ret != vector) {
-			aprint_error_dev(self, "can't set queue %d "
-"msix vector\n", qid);
+			if (reinit == 0) {
+aprint_error_dev(self, "can't set queue %d "
+"msix vector\n", qid);
+			}
 			return -1;
 		}
 	}
@@ -846,7 +851,7 @@ virtio_pci_setup_interrupts_10(struct vi
 }
 
 static int
-virtio_pci_setup_interrupts_09(struct virtio_softc *sc)
+virtio_pci_setup_interrupts_09(struct virtio_softc *sc, int reinit)
 {
 	struct virtio_pci_softc * const psc = (struct virtio_pci_softc *)sc;
 	device_t self = sc->sc_dev;
@@ -863,7 +868,10 @@ virtio_pci_setup_interrupts_09(struct vi
 	aprint_debug_dev(sc->sc_dev, 

CVS commit: src/sys/dev/pci

2021-10-20 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 05:32:27 UTC 2021

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h

Log Message:
divide setup routine of virtio interrupts
into establishment and device configuration


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/virtiovar.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/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.49 src/sys/dev/pci/virtio.c:1.50
--- src/sys/dev/pci/virtio.c:1.49	Sun Feb  7 09:29:53 2021
+++ src/sys/dev/pci/virtio.c	Thu Oct 21 05:32:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.49 2021/02/07 09:29:53 skrll Exp $	*/
+/*	$NetBSD: virtio.c,v 1.50 2021/10/21 05:32:27 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.49 2021/02/07 09:29:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.50 2021/10/21 05:32:27 yamaguchi Exp $");
 
 #include 
 #include 
@@ -1199,10 +1199,15 @@ virtio_child_attach_finish(struct virtio
 	int r;
 
 	sc->sc_finished_called = true;
+	r = sc->sc_ops->alloc_interrupts(sc);
+	if (r != 0) {
+		aprint_error_dev(sc->sc_dev, "failed to allocate interrupts\n");
+		goto fail;
+	}
+
 	r = sc->sc_ops->setup_interrupts(sc);
 	if (r != 0) {
 		aprint_error_dev(sc->sc_dev, "failed to setup interrupts\n");
-		goto fail;
 	}
 
 	KASSERT(sc->sc_soft_ih == NULL);

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.30 src/sys/dev/pci/virtio_pci.c:1.31
--- src/sys/dev/pci/virtio_pci.c:1.30	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/virtio_pci.c	Thu Oct 21 05:32:27 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.30 2021/08/07 16:19:14 thorpej Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.31 2021/10/21 05:32:27 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.30 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.31 2021/10/21 05:32:27 yamaguchi Exp $");
 
 #include 
 #include 
@@ -106,18 +106,19 @@ static void	virtio_pci_set_status_10(str
 static void	virtio_pci_negotiate_features_10(struct virtio_softc *, uint64_t);
 static int	virtio_pci_find_cap(struct virtio_pci_softc *psc, int cfg_type, void *buf, int buflen);
 
-static int	virtio_pci_setup_interrupts(struct virtio_softc *);
+static int	virtio_pci_alloc_interrupts(struct virtio_softc *);
 static void	virtio_pci_free_interrupts(struct virtio_softc *);
 static int	virtio_pci_adjust_config_region(struct virtio_pci_softc *psc);
 static int	virtio_pci_intr(void *arg);
 static int	virtio_pci_msix_queue_intr(void *);
 static int	virtio_pci_msix_config_intr(void *);
-static int	virtio_pci_setup_msix_vectors_09(struct virtio_softc *);
-static int	virtio_pci_setup_msix_vectors_10(struct virtio_softc *);
-static int	virtio_pci_setup_msix_interrupts(struct virtio_softc *,
+static int	virtio_pci_setup_interrupts_09(struct virtio_softc *);
+static int	virtio_pci_setup_interrupts_10(struct virtio_softc *);
+static int	virtio_pci_establish_msix_interrupts(struct virtio_softc *,
 		struct pci_attach_args *);
-static int	virtio_pci_setup_intx_interrupt(struct virtio_softc *,
+static int	virtio_pci_establish_intx_interrupt(struct virtio_softc *,
 		struct pci_attach_args *);
+static bool	virtio_pci_msix_enabled(struct virtio_pci_softc *);
 
 #define VIRTIO_MSIX_CONFIG_VECTOR_INDEX	0
 #define VIRTIO_MSIX_QUEUE_VECTOR_INDEX	1
@@ -158,8 +159,9 @@ static const struct virtio_ops virtio_pc
 	.setup_queue = virtio_pci_setup_queue_09,
 	.set_status = virtio_pci_set_status_09,
 	.neg_features = virtio_pci_negotiate_features_09,
-	.setup_interrupts = virtio_pci_setup_interrupts,
+	.alloc_interrupts = virtio_pci_alloc_interrupts,
 	.free_interrupts = virtio_pci_free_interrupts,
+	.setup_interrupts = virtio_pci_setup_interrupts_09,
 };
 
 static const struct virtio_ops virtio_pci_ops_10 = {
@@ -168,8 +170,9 @@ static const struct virtio_ops virtio_pc
 	.setup_queue = virtio_pci_setup_queue_10,
 	.set_status = virtio_pci_set_status_10,
 	.neg_features = virtio_pci_negotiate_features_10,
-	.setup_interrupts = virtio_pci_setup_interrupts,
+	.alloc_interrupts = virtio_pci_alloc_interrupts,
 	.free_interrupts = virtio_pci_free_interrupts,
+	.setup_interrupts = virtio_pci_setup_interrupts_10,
 };
 
 static int
@@ -802,7 +805,7 @@ virtio_pci_negotiate_features_10(struct 
  * -*/
 
 static int
-virtio_pci_setup_msix_vectors_10(struct virtio_softc *sc)
+virtio_pci_setup_interrupts_10(struct virtio_softc *sc)
 {
 	struct virtio_pci_softc * const psc = (struct virtio_pci_softc *)sc;
 	device_t self  =  

CVS commit: src/sys/dev/pci

2021-10-20 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Oct 21 05:32:27 UTC 2021

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h

Log Message:
divide setup routine of virtio interrupts
into establishment and device configuration


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/virtiovar.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

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:10:27 UTC 2021

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

Log Message:
Use wm_flush_desc_rings() more.

 - Use wm_flush_desc_rings() for newer than PCH_SPT, too. Same as other OSes.
   It seems that some devices has no this errata, but we don't know how to
   identify it. So just use >= PCH_SPT.
 - Use wm_flush_desc_rings() before chip reset in wm_resume(), too.


To generate a diff of this commit:
cvs rdiff -u -r1.714 -r1.715 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.714 src/sys/dev/pci/if_wm.c:1.715
--- src/sys/dev/pci/if_wm.c:1.714	Wed Oct 20 08:06:45 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 08:10:26 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.715 2021/10/20 08:10:26 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.714 2021/10/20 08:06:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.715 2021/10/20 08:10:26 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3293,6 +3293,10 @@ wm_resume(device_t self, const pmf_qual_
 	if (sc->sc_type >= WM_T_PCH2)
 		wm_resume_workarounds_pchlan(sc);
 	if ((ifp->if_flags & IFF_UP) == 0) {
+		/* >= PCH_SPT hardware workaround before reset. */
+		if (sc->sc_type >= WM_T_PCH_SPT)
+			wm_flush_desc_rings(sc);
+
 		wm_reset(sc);
 		/* Non-AMT based hardware can now take control from firmware */
 		if ((sc->sc_flags & WM_F_HAS_AMT) == 0)
@@ -6093,8 +6097,8 @@ wm_init_locked(struct ifnet *ifp)
 	if_statadd2(ifp, if_collisions, CSR_READ(sc, WMREG_COLC),
 	if_ierrors, CSR_READ(sc, WMREG_RXERRC));
 
-	/* PCH_SPT hardware workaround */
-	if (sc->sc_type == WM_T_PCH_SPT)
+	/* >= PCH_SPT hardware workaround before reset. */
+	if (sc->sc_type >= WM_T_PCH_SPT)
 		wm_flush_desc_rings(sc);
 
 	/* Reset the chip to a known state. */



CVS commit: src/sys/dev/pci

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:10:27 UTC 2021

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

Log Message:
Use wm_flush_desc_rings() more.

 - Use wm_flush_desc_rings() for newer than PCH_SPT, too. Same as other OSes.
   It seems that some devices has no this errata, but we don't know how to
   identify it. So just use >= PCH_SPT.
 - Use wm_flush_desc_rings() before chip reset in wm_resume(), too.


To generate a diff of this commit:
cvs rdiff -u -r1.714 -r1.715 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

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:06:45 UTC 2021

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

Log Message:
Disable printf()s in wm_flush_desc_rings() because the code is verified.

 The problem was very rare, so I added those printf()s as we can see.
Last week, knakahara and I found a procedure to reproduce the problem and
verified it worked correctly.

 To reproduce the problem:

 0) Use I219 V1 to V5. Not all of them have the problem and newer than V5 may
have the problem. I used V2 for the test.
 1) Define WM_DEBUG or add printf in wm_flush_desc_rings() to see
DESCRING_STATUS_FLUSH_REQ bit.
 2) Run "iperf -s" on the DUT.
 3) Run "iperf3 -R -u -c 192.168.1.110 -w 8m -b 1g" repeatedly on another
machine. Note that kern.sbmax should be increased on both machines.
 4) run
while true; do
ifconfig wm0 down up
sleep 30
done
 5) After DESCRING_STATUS_FLUSH_REQ is set, without wm_flush_desc_rings(),
TX stalls and reboot is required to recover from it.
With wm_flush_desc_rings(), no device hang.
 6) If you can't see the DESCRING_STATUS_FLUSH_REQ is set, change the media
to 100BASE-T.

 Note that if_wm.c rev. 1.710 originally written by chuq is required for the
test. Without the change, the device becomes unrecoverable state before
wm_flush_desc_rings() and the function doesn't recover from the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.713 -r1.714 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

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:06:45 UTC 2021

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

Log Message:
Disable printf()s in wm_flush_desc_rings() because the code is verified.

 The problem was very rare, so I added those printf()s as we can see.
Last week, knakahara and I found a procedure to reproduce the problem and
verified it worked correctly.

 To reproduce the problem:

 0) Use I219 V1 to V5. Not all of them have the problem and newer than V5 may
have the problem. I used V2 for the test.
 1) Define WM_DEBUG or add printf in wm_flush_desc_rings() to see
DESCRING_STATUS_FLUSH_REQ bit.
 2) Run "iperf -s" on the DUT.
 3) Run "iperf3 -R -u -c 192.168.1.110 -w 8m -b 1g" repeatedly on another
machine. Note that kern.sbmax should be increased on both machines.
 4) run
while true; do
ifconfig wm0 down up
sleep 30
done
 5) After DESCRING_STATUS_FLUSH_REQ is set, without wm_flush_desc_rings(),
TX stalls and reboot is required to recover from it.
With wm_flush_desc_rings(), no device hang.
 6) If you can't see the DESCRING_STATUS_FLUSH_REQ is set, change the media
to 100BASE-T.

 Note that if_wm.c rev. 1.710 originally written by chuq is required for the
test. Without the change, the device becomes unrecoverable state before
wm_flush_desc_rings() and the function doesn't recover from the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.713 -r1.714 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.713 src/sys/dev/pci/if_wm.c:1.714
--- src/sys/dev/pci/if_wm.c:1.713	Wed Oct 20 08:02:07 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 08:06:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.713 2021/10/20 08:02:07 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 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.713 2021/10/20 08:02:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.714 2021/10/20 08:06:45 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4890,8 +4890,9 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	 * the data of the next descriptor. We don't care about the data we are
 	 * about to reset the HW.
 	 */
-	device_printf(sc->sc_dev, "Need TX flush (reg = %08x, len = %u)\n",
-	preg, reg);
+#ifdef WM_DEBUG
+	device_printf(sc->sc_dev, "Need TX flush (reg = %08x)\n", preg);
+#endif
 	reg = CSR_READ(sc, WMREG_TCTL);
 	CSR_WRITE(sc, WMREG_TCTL, reg | TCTL_EN);
 
@@ -4921,7 +4922,9 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	 * Mark all descriptors in the RX ring as consumed and disable the
 	 * rx ring.
 	 */
+#ifdef WM_DEBUG
 	device_printf(sc->sc_dev, "Need RX flush (reg = %08x)\n", preg);
+#endif
 	rctl = CSR_READ(sc, WMREG_RCTL);
 	CSR_WRITE(sc, WMREG_RCTL, rctl & ~RCTL_EN);
 	CSR_WRITE_FLUSH(sc);



CVS commit: src/sys/dev/pci

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:02:08 UTC 2021

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

Log Message:
Change DMA physical address in wm_flush_desc_rings() to match other OSes.

 - Even without this change, the workaround works with my machines.
 - Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.712 -r1.713 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.712 src/sys/dev/pci/if_wm.c:1.713
--- src/sys/dev/pci/if_wm.c:1.712	Wed Oct 20 07:04:28 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 08:02:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.712 2021/10/20 07:04:28 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.713 2021/10/20 08:02:07 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.712 2021/10/20 07:04:28 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.713 2021/10/20 08:02:07 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4852,8 +4852,15 @@ wm_reset_phy(struct wm_softc *sc)
 }
 
 /*
- * Only used by WM_T_PCH_SPT which does not use multiqueue,
- * so it is enough to check sc->sc_queue[0] only.
+ * wm_flush_desc_rings - remove all descriptors from the descriptor rings.
+ *
+ * In i219, the descriptor rings must be emptied before resetting the HW
+ * or before changing the device state to D3 during runtime (runtime PM).
+ *
+ * Failure to do this will cause the HW to enter a unit hang state which can
+ * only be released by PCI reset on the device.
+ *
+ * I219 does not use multiqueue, so it is enough to check sc->sc_queue[0] only.
  */
 static void
 wm_flush_desc_rings(struct wm_softc *sc)
@@ -4875,7 +4882,14 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	if (((preg & DESCRING_STATUS_FLUSH_REQ) == 0) || (reg == 0))
 		return;
 
-	/* TX */
+	/*
+	 * Remove all descriptors from the tx_ring.
+	 *
+	 * We want to clear all pending descriptors from the TX ring. Zeroing
+	 * happens when the HW reads the regs. We  assign the ring itself as
+	 * the data of the next descriptor. We don't care about the data we are
+	 * about to reset the HW.
+	 */
 	device_printf(sc->sc_dev, "Need TX flush (reg = %08x, len = %u)\n",
 	preg, reg);
 	reg = CSR_READ(sc, WMREG_TCTL);
@@ -4884,7 +4898,7 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	txq = >sc_queue[0].wmq_txq;
 	nexttx = txq->txq_next;
 	txd = >txq_descs[nexttx];
-	wm_set_dma_addr(>wtx_addr, WM_CDTXADDR(txq, nexttx));
+	wm_set_dma_addr(>wtx_addr, txq->txq_desc_dma);
 	txd->wtx_cmdlen = htole32(WTX_CMD_IFCS | 512);
 	txd->wtx_fields.wtxu_status = 0;
 	txd->wtx_fields.wtxu_options = 0;
@@ -4903,7 +4917,10 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	if ((preg & DESCRING_STATUS_FLUSH_REQ) == 0)
 		return;
 
-	/* RX */
+	/*
+	 * Mark all descriptors in the RX ring as consumed and disable the
+	 * rx ring.
+	 */
 	device_printf(sc->sc_dev, "Need RX flush (reg = %08x)\n", preg);
 	rctl = CSR_READ(sc, WMREG_RCTL);
 	CSR_WRITE(sc, WMREG_RCTL, rctl & ~RCTL_EN);



CVS commit: src/sys/dev/pci

2021-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 20 08:02:08 UTC 2021

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

Log Message:
Change DMA physical address in wm_flush_desc_rings() to match other OSes.

 - Even without this change, the workaround works with my machines.
 - Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.712 -r1.713 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

2021-10-20 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 07:04:28 UTC 2021

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

Log Message:
Fix return value of interrupt handler, pointed out by msaitoh@n.o.

Even if stopping flag is set (and handler do nothing), the interrupt
itself should be assume to be processed when ICR is not zero.  If not,
interrupt count is not incremented correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.711 -r1.712 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.711 src/sys/dev/pci/if_wm.c:1.712
--- src/sys/dev/pci/if_wm.c:1.711	Wed Oct 20 02:12:36 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 07:04:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.711 2021/10/20 02:12:36 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.712 2021/10/20 07:04: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.711 2021/10/20 02:12:36 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.712 2021/10/20 07:04:28 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9853,7 +9853,7 @@ wm_intr_legacy(void *arg)
 
 	if (rxq->rxq_stopping) {
 		mutex_exit(rxq->rxq_lock);
-		return 0;
+		return 1;
 	}
 
 #if defined(WM_DEBUG) || defined(WM_EVENT_COUNTERS)
@@ -9877,7 +9877,7 @@ wm_intr_legacy(void *arg)
 
 	if (txq->txq_stopping) {
 		mutex_exit(txq->txq_lock);
-		return 0;
+		return 1;
 	}
 
 #if defined(WM_DEBUG) || defined(WM_EVENT_COUNTERS)
@@ -9897,7 +9897,7 @@ wm_intr_legacy(void *arg)
 
 	if (sc->sc_core_stopping) {
 		WM_CORE_UNLOCK(sc);
-		return 0;
+		return 1;
 	}
 
 	if (icr & (ICR_LSC | ICR_RXSEQ)) {
@@ -9997,7 +9997,7 @@ wm_txrxintr_msix(void *arg)
 
 	if (txq->txq_stopping) {
 		mutex_exit(txq->txq_lock);
-		return 0;
+		return 1;
 	}
 
 	WM_Q_EVCNT_INCR(txq, txdw);
@@ -10011,7 +10011,7 @@ wm_txrxintr_msix(void *arg)
 
 	if (rxq->rxq_stopping) {
 		mutex_exit(rxq->rxq_lock);
-		return 0;
+		return 1;
 	}
 
 	WM_Q_EVCNT_INCR(rxq, intr);



CVS commit: src/sys/dev/pci

2021-10-20 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 07:04:28 UTC 2021

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

Log Message:
Fix return value of interrupt handler, pointed out by msaitoh@n.o.

Even if stopping flag is set (and handler do nothing), the interrupt
itself should be assume to be processed when ICR is not zero.  If not,
interrupt count is not incremented correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.711 -r1.712 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

2021-10-19 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 02:12:37 UTC 2021

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

Log Message:
Uniform INTx/MSI handler's Tx/Rx behavior to MSI-X's one.

Because the difference has caused INTx/MSI own bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.710 -r1.711 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.710 src/sys/dev/pci/if_wm.c:1.711
--- src/sys/dev/pci/if_wm.c:1.710	Wed Oct 20 02:05:15 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 02:12:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.710 2021/10/20 02:05:15 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.711 2021/10/20 02:12:36 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.710 2021/10/20 02:05:15 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.711 2021/10/20 02:12:36 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9835,88 +9835,85 @@ wm_intr_legacy(void *arg)
 	struct wm_queue *wmq = >sc_queue[0];
 	struct wm_txqueue *txq = >wmq_txq;
 	struct wm_rxqueue *rxq = >wmq_rxq;
+	u_int txlimit = sc->sc_tx_intr_process_limit;
+	u_int rxlimit = sc->sc_rx_intr_process_limit;
 	uint32_t icr, rndval = 0;
-	int handled = 0;
 	bool more = false;
 
-	while (1 /* CONSTCOND */) {
-		icr = CSR_READ(sc, WMREG_ICR);
-		if ((icr & sc->sc_icr) == 0)
-			break;
-		if (handled == 0)
-			DPRINTF(sc, WM_DEBUG_TX,
-			("%s: INTx: got intr\n",device_xname(sc->sc_dev)));
-		if (rndval == 0)
-			rndval = icr;
+	icr = CSR_READ(sc, WMREG_ICR);
+	if ((icr & sc->sc_icr) == 0)
+		return 0;
 
-		mutex_enter(rxq->rxq_lock);
+	DPRINTF(sc, WM_DEBUG_TX,
+	("%s: INTx: got intr\n",device_xname(sc->sc_dev)));
+	if (rndval == 0)
+		rndval = icr;
 
-		if (rxq->rxq_stopping) {
-			mutex_exit(rxq->rxq_lock);
-			break;
-		}
+	mutex_enter(rxq->rxq_lock);
 
-		handled = 1;
+	if (rxq->rxq_stopping) {
+		mutex_exit(rxq->rxq_lock);
+		return 0;
+	}
 
 #if defined(WM_DEBUG) || defined(WM_EVENT_COUNTERS)
-		if (icr & (ICR_RXDMT0 | ICR_RXT0)) {
-			DPRINTF(sc, WM_DEBUG_RX,
-			("%s: RX: got Rx intr 0x%08x\n",
-device_xname(sc->sc_dev),
-icr & (ICR_RXDMT0 | ICR_RXT0)));
-			WM_Q_EVCNT_INCR(rxq, intr);
-		}
+	if (icr & (ICR_RXDMT0 | ICR_RXT0)) {
+		DPRINTF(sc, WM_DEBUG_RX,
+		("%s: RX: got Rx intr 0x%08x\n",
+			device_xname(sc->sc_dev),
+			icr & (ICR_RXDMT0 | ICR_RXT0)));
+		WM_Q_EVCNT_INCR(rxq, intr);
+	}
 #endif
-		/*
-		 * wm_rxeof() does *not* call upper layer functions directly,
-		 * as if_percpuq_enqueue() just call softint_schedule().
-		 * So, we can call wm_rxeof() in interrupt context.
-		 */
-		more = wm_rxeof(rxq, UINT_MAX);
+	/*
+	 * wm_rxeof() does *not* call upper layer functions directly,
+	 * as if_percpuq_enqueue() just call softint_schedule().
+	 * So, we can call wm_rxeof() in interrupt context.
+	 */
+	more = wm_rxeof(rxq, rxlimit);
 
-		mutex_exit(rxq->rxq_lock);
-		mutex_enter(txq->txq_lock);
+	mutex_exit(rxq->rxq_lock);
+	mutex_enter(txq->txq_lock);
 
-		if (txq->txq_stopping) {
-			mutex_exit(txq->txq_lock);
-			break;
-		}
+	if (txq->txq_stopping) {
+		mutex_exit(txq->txq_lock);
+		return 0;
+	}
 
 #if defined(WM_DEBUG) || defined(WM_EVENT_COUNTERS)
-		if (icr & ICR_TXDW) {
-			DPRINTF(sc, WM_DEBUG_TX,
-			("%s: TX: got TXDW interrupt\n",
-device_xname(sc->sc_dev)));
-			WM_Q_EVCNT_INCR(txq, txdw);
-		}
+	if (icr & ICR_TXDW) {
+		DPRINTF(sc, WM_DEBUG_TX,
+		("%s: TX: got TXDW interrupt\n",
+			device_xname(sc->sc_dev)));
+		WM_Q_EVCNT_INCR(txq, txdw);
+	}
 #endif
-		more |= wm_txeof(txq, UINT_MAX);
-		if (!IF_IS_EMPTY(>if_snd))
-			more = true;
+	more |= wm_txeof(txq, txlimit);
+	if (!IF_IS_EMPTY(>if_snd))
+		more = true;
 
-		mutex_exit(txq->txq_lock);
-		WM_CORE_LOCK(sc);
+	mutex_exit(txq->txq_lock);
+	WM_CORE_LOCK(sc);
 
-		if (sc->sc_core_stopping) {
-			WM_CORE_UNLOCK(sc);
-			break;
-		}
+	if (sc->sc_core_stopping) {
+		WM_CORE_UNLOCK(sc);
+		return 0;
+	}
 
-		if (icr & (ICR_LSC | ICR_RXSEQ)) {
-			WM_EVCNT_INCR(>sc_ev_linkintr);
-			wm_linkintr(sc, icr);
-		}
-		if ((icr & ICR_GPI(0)) != 0)
-			device_printf(sc->sc_dev, "got module interrupt\n");
+	if (icr & (ICR_LSC | ICR_RXSEQ)) {
+		WM_EVCNT_INCR(>sc_ev_linkintr);
+		wm_linkintr(sc, icr);
+	}
+	if ((icr & ICR_GPI(0)) != 0)
+		device_printf(sc->sc_dev, "got module interrupt\n");
 
-		WM_CORE_UNLOCK(sc);
+	WM_CORE_UNLOCK(sc);
 
-		if (icr & ICR_RXO) {
+	if (icr & ICR_RXO) {
 #if defined(WM_DEBUG)
-			log(LOG_WARNING, "%s: Receive overrun\n",
-			device_xname(sc->sc_dev));
+		log(LOG_WARNING, "%s: Receive overrun\n",
+		device_xname(sc->sc_dev));
 #endif /* defined(WM_DEBUG) */
-		}
 	}
 
 	rnd_add_uint32(>rnd_source, rndval);
@@ -9928,7 +9925,7 @@ wm_intr_legacy(void *arg)
 		

CVS commit: src/sys/dev/pci

2021-10-19 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 02:12:37 UTC 2021

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

Log Message:
Uniform INTx/MSI handler's Tx/Rx behavior to MSI-X's one.

Because the difference has caused INTx/MSI own bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.710 -r1.711 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

2021-10-19 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 02:05:15 UTC 2021

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

Log Message:
Fix Tx stall, reported and implemented original patch by chs@n.o, thanks.

Check if_snd queue because if.c::if_transmit() doesn't call ifp->if_start()
when IFQ_ENQUEUE failed.

Reviewed and tested by chs@n.o and msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.709 -r1.710 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.709 src/sys/dev/pci/if_wm.c:1.710
--- src/sys/dev/pci/if_wm.c:1.709	Mon Oct 18 11:36:11 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 20 02:05:15 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.709 2021/10/18 11:36:11 jmcneill Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.710 2021/10/20 02:05:15 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.709 2021/10/18 11:36:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.710 2021/10/20 02:05:15 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9831,6 +9831,7 @@ static int
 wm_intr_legacy(void *arg)
 {
 	struct wm_softc *sc = arg;
+	struct ifnet *ifp = >sc_ethercom.ec_if;
 	struct wm_queue *wmq = >sc_queue[0];
 	struct wm_txqueue *txq = >wmq_txq;
 	struct wm_rxqueue *rxq = >wmq_rxq;
@@ -9890,6 +9891,8 @@ wm_intr_legacy(void *arg)
 		}
 #endif
 		more |= wm_txeof(txq, UINT_MAX);
+		if (!IF_IS_EMPTY(>if_snd))
+			more = true;
 
 		mutex_exit(txq->txq_lock);
 		WM_CORE_LOCK(sc);



CVS commit: src/sys/dev/pci

2021-10-19 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 20 02:05:15 UTC 2021

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

Log Message:
Fix Tx stall, reported and implemented original patch by chs@n.o, thanks.

Check if_snd queue because if.c::if_transmit() doesn't call ifp->if_start()
when IFQ_ENQUEUE failed.

Reviewed and tested by chs@n.o and msaitoh@n.o.


To generate a diff of this commit:
cvs rdiff -u -r1.709 -r1.710 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

2021-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 18 11:36:12 UTC 2021

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

Log Message:
Only print an error about missing I/O BARs for chips that need it.


To generate a diff of this commit:
cvs rdiff -u -r1.708 -r1.709 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

2021-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 18 11:36:12 UTC 2021

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

Log Message:
Only print an error about missing I/O BARs for chips that need it.


To generate a diff of this commit:
cvs rdiff -u -r1.708 -r1.709 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.708 src/sys/dev/pci/if_wm.c:1.709
--- src/sys/dev/pci/if_wm.c:1.708	Wed Oct 13 08:12:36 2021
+++ src/sys/dev/pci/if_wm.c	Mon Oct 18 11:36:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.709 2021/10/18 11:36:11 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.709 2021/10/18 11:36:11 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2016,7 +2016,12 @@ wm_attach(device_t parent, device_t self
 	 * this driver) to use it for normal operation, though it is
 	 * required to work around bugs in some chip versions.
 	 */
-	if (sc->sc_type >= WM_T_82544) {
+	switch (sc->sc_type) {
+	case WM_T_82544:
+	case WM_T_82541:
+	case WM_T_82541_2:
+	case WM_T_82547:
+	case WM_T_82547_2:
 		/* First we have to find the I/O BAR. */
 		for (i = PCI_MAPREG_START; i < PCI_MAPREG_END; i += 4) {
 			memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, i);
@@ -2049,7 +2054,9 @@ wm_attach(device_t parent, device_t self
 aprint_error_dev(sc->sc_dev,
 "WARNING: unable to map I/O space\n");
 		}
-
+		break;
+	default:
+		break;
 	}
 
 	/* Enable bus mastering.  Disable MWI on the i82542 2.0. */



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

2021-10-18 Thread Kengo NAKAHARA

Hi,

Thank you for your quick commit!


Thanks,

On 2021/10/18 17:15, Juergen Hannken-Illjes wrote:

Module Name:src
Committed By:   hannken
Date:   Mon Oct 18 08:15:00 UTC 2021

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

Log Message:
Use a local static variable to hold "pktq_rps_hash_default"
like the other devices do.

Kernel ALL/amd64 compiles again.

OK: Kengo NAKAHARA 


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.



--
//
Internet Initiative Japan Inc.

Device Engineering Section,
Product Division,
Technology Unit

Kengo NAKAHARA 




CVS commit: src/sys/dev/pci

2021-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Oct 18 08:15:00 UTC 2021

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

Log Message:
Use a local static variable to hold "pktq_rps_hash_default"
like the other devices do.

Kernel ALL/amd64 compiles again.

OK: Kengo NAKAHARA 


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/sys/dev/pci/xmm7360.c:1.13
--- src/sys/dev/pci/xmm7360.c:1.12	Mon Oct 11 05:13:10 2021
+++ src/sys/dev/pci/xmm7360.c	Mon Oct 18 08:15:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmm7360.c,v 1.12 2021/10/11 05:13:10 knakahara Exp $	*/
+/*	$NetBSD: xmm7360.c,v 1.13 2021/10/18 08:15:00 hannken 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.12 2021/10/11 05:13:10 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xmm7360.c,v 1.13 2021/10/18 08:15:00 hannken Exp $");
 #endif
 
 #include 
@@ -294,6 +294,7 @@ typedef struct kmutex spinlock_t;
 		tsleep(xmm, 0, "wwancsl", msec * hz / 1000);	\
 	} while (0)
 
+static pktq_rps_hash_func_t xmm7360_pktq_rps_hash_p;
 static void *dma_alloc_coherent(struct device *, size_t, dma_addr_t *, int);
 static void dma_free_coherent(struct device *, size_t, volatile void *, dma_addr_t);
 
@@ -3110,7 +3111,7 @@ wwan_if_input(struct ifnet *ifp, struct 
 	/* No errors.  Receive the packet. */
 	m_set_rcvif(m, ifp);
 
-	const uint32_t h = pktq_rps_hash(_rps_hash_default, m);
+	const uint32_t h = pktq_rps_hash(_pktq_rps_hash_p, m);
 	if (__predict_false(!pktq_enqueue(pktq, m, h))) {
 		m_freem(m);
 	}
@@ -3257,6 +3258,8 @@ wwan_attach(struct device *parent, struc
 	printf("\n");
 
 #ifdef __NetBSD__
+	xmm7360_pktq_rps_hash_p = pktq_rps_hash_default;
+
 	if (pmf_device_register(self, wwan_pmf_suspend, NULL))
 		pmf_class_network_register(self, ifp);
 	else



CVS commit: src/sys/dev/pci

2021-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Oct 18 08:15:00 UTC 2021

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

Log Message:
Use a local static variable to hold "pktq_rps_hash_default"
like the other devices do.

Kernel ALL/amd64 compiles again.

OK: Kengo NAKAHARA 


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 08:12:36 UTC 2021

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

Log Message:
Add support for I219V 15-19 and I219LM 16-19.


To generate a diff of this commit:
cvs rdiff -u -r1.707 -r1.708 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.707 src/sys/dev/pci/if_wm.c:1.708
--- src/sys/dev/pci/if_wm.c:1.707	Wed Oct 13 08:09:46 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 13 08:12:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.707 2021/10/13 08:09:46 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 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.707 2021/10/13 08:09:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.708 2021/10/13 08:12:36 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1640,6 +1640,18 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM15,
 	  "I219 LM (15) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM16,
+	  "I219 LM (16) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM17,
+	  "I219 LM (17) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM18,
+	  "I219 LM (18) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
+	  "I219 LM (19) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
@@ -1679,6 +1691,21 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V14,
 	  "I219 V (14) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V15,
+	  "I219 V (15) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V16,
+	  "I219 V (16) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V17,
+	  "I219 V (17) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V18,
+	  "I219 V (18) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
+	  "I219 V (19) Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ 0,			0,
 	  NULL,
 	  0,			0 },



CVS commit: src/sys/dev/pci

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 08:12:36 UTC 2021

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

Log Message:
Add support for I219V 15-19 and I219LM 16-19.


To generate a diff of this commit:
cvs rdiff -u -r1.707 -r1.708 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 08:09:46 UTC 2021

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

Log Message:
Print I219's version number.


To generate a diff of this commit:
cvs rdiff -u -r1.706 -r1.707 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.706 src/sys/dev/pci/if_wm.c:1.707
--- src/sys/dev/pci/if_wm.c:1.706	Tue Aug  3 01:08:18 2021
+++ src/sys/dev/pci/if_wm.c	Wed Oct 13 08:09:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.706 2021/08/03 01:08:18 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.707 2021/10/13 08:09:46 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.706 2021/08/03 01:08:18 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.707 2021/10/13 08:09:46 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1599,85 +1599,85 @@ static const struct wm_product {
 	  "I219 LM Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM2,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (2) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM3,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (3) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM4,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (4) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM5,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (5) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM6,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (6) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM7,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (7) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM8,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (8) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM9,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (9) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM10,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (10) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM11,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (11) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM12,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (12) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM13,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (13) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM14,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (14) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM15,
-	  "I219 LM Ethernet Connection",
+	  "I219 LM (15) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V2,
-	  "I219 V Ethernet Connection",
+	  "I219 V (2) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V4,
-	  "I219 V Ethernet Connection",
+	  "I219 V (4) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V5,
-	  "I219 V Ethernet Connection",
+	  "I219 V (5) Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V6,
-	  "I219 V Ethernet Connection",
+	  "I219 V (6) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V7,
-	  "I219 V Ethernet Connection",
+	  "I219 V (7) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V8,
-	  "I219 V Ethernet Connection",
+	  "I219 V (8) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V9,
-	  "I219 V Ethernet Connection",
+	  "I219 V (9) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V10,
-	  "I219 V Ethernet Connection",
+	  "I219 V (10) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V11,
-	  "I219 V Ethernet Connection",
+	  "I219 V (11) Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	

CVS commit: src/sys/dev/pci

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 08:09:46 UTC 2021

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

Log Message:
Print I219's version number.


To generate a diff of this commit:
cvs rdiff -u -r1.706 -r1.707 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 07:06:53 UTC 2021

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.1424 -r1.1425 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1423 -r1.1424 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 07:06:23 UTC 2021

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

Log Message:
Add Intel I219V 15-19 and I219LM 16-19.


To generate a diff of this commit:
cvs rdiff -u -r1.1439 -r1.1440 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.1439 src/sys/dev/pci/pcidevs:1.1440
--- src/sys/dev/pci/pcidevs:1.1439	Wed Oct 13 07:04:59 2021
+++ src/sys/dev/pci/pcidevs	Wed Oct 13 07:06:23 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1439 2021/10/13 07:04:59 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1440 2021/10/13 07:06:23 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4203,6 +4203,7 @@ product INTEL C3K_X553_SGMII_L	0x15e5	C3
 product INTEL I225_LM		0x15f2	I225 LM Ethernet
 product INTEL I225_V		0x15f3	I225 V Ethernet
 product INTEL I219_LM15		0x15f4	I219-LM (15) Ethernet Connection
+product INTEL I219_V15		0x15f5	I219-V (15) Ethernet Connection
 product INTEL I210_SGMII_WOF	0x15f6	I210 Ethernet (SGMII)
 product INTEL I219_LM14		0x15f9	I219-LM (14) Ethernet Connection
 product INTEL I219_V14		0x15fa	I219-V (14) Ethernet Connection
@@ -4314,6 +4315,10 @@ product INTEL C3K_IE_HECI_1	0x19e5	C3000
 product INTEL C3K_IE_HECI_2	0x19e6	C3000 IE HECI 2
 product INTEL C3K_IE_KT		0x19e8	C3000 IE KT
 product INTEL C3K_IE_HECI_3	0x19e9	C3000 IE HECI 3
+product INTEL I219_LM17		0x1a1c	I219-LM (17) Ethernet Connection
+product INTEL I219_V17		0x1a1d	I219-V (17) Ethernet Connection
+product INTEL I219_LM16		0x1a1e	I219-LM (16) Ethernet Connection
+product INTEL I219_V16		0x1a1f	I219-V (16) Ethernet Connection
 product INTEL 82840_HB		0x1a21	82840 Host
 product INTEL 82840_AGP		0x1a23	82840 AGP
 product INTEL 82840_PCI		0x1a24	82840 PCI
@@ -5694,6 +5699,10 @@ product INTEL EP80579_LAN_1	0x5040	EP805
 product INTEL EP80579_LAN_2	0x5044	EP80579 LAN
 product INTEL EP80579_LAN_3	0x5048	EP80579 LAN
 product INTEL 80312_ATU		0x530d	80310 ATU
+product INTEL I219_LM18		0x550a	I219-LM (18) Ethernet Connection
+product INTEL I219_V18		0x550b	I219-V (18) Ethernet Connection
+product INTEL I219_LM19		0x550c	I219-LM (19) Ethernet Connection
+product INTEL I219_V19		0x550d	I219-V (19) Ethernet Connection
 product INTEL CORE7G_H_M_D_HOST_DRAM 0x5900 Core 7G (H, Mobile, Dual) Host Bridge, DRAM
 product INTEL CORE7G_PCIE_X16	0x5901	Core 7G PCIe x16
 product INTEL CORE7G_S_GT1	0x5902	HD Graphics 610 (GT1)



CVS commit: src/sys/dev/pci

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 07:06:23 UTC 2021

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

Log Message:
Add Intel I219V 15-19 and I219LM 16-19.


To generate a diff of this commit:
cvs rdiff -u -r1.1439 -r1.1440 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 07:04:59 UTC 2021

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

Log Message:
Add Intel I219's version number.


To generate a diff of this commit:
cvs rdiff -u -r1.1438 -r1.1439 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

2021-10-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 13 07:04:59 UTC 2021

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

Log Message:
Add Intel I219's version number.


To generate a diff of this commit:
cvs rdiff -u -r1.1438 -r1.1439 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.1438 src/sys/dev/pci/pcidevs:1.1439
--- src/sys/dev/pci/pcidevs:1.1438	Tue Oct 12 14:12:06 2021
+++ src/sys/dev/pci/pcidevs	Wed Oct 13 07:04:59 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1438 2021/10/12 14:12:06 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1439 2021/10/13 07:04:59 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3763,12 +3763,12 @@ product INTEL S1200_ILB		0x0c60	Atom S12
 product INTEL S1200_S1220	0x0c72	Atom S1220 Internal
 product INTEL S1200_S1240	0x0c73	Atom S1240 Internal
 product INTEL S1200_S1260	0x0c75	Atom S1260 Internal
-product INTEL I219_LM11		0x0d4c	I219-LM Ethernet Connection
-product INTEL I219_V11		0x0d4d	I219-V Ethernet Connection
-product INTEL I219_LM10		0x0d4e	I219-LM Ethernet Connection
-product INTEL I219_V10		0x0d4f	I219-V Ethernet Connection
-product INTEL I219_LM12		0x0d53	I219-LM Ethernet Connection
-product INTEL I219_V12		0x0d55	I219-V Ethernet Connection
+product INTEL I219_LM11		0x0d4c	I219-LM (11) Ethernet Connection
+product INTEL I219_V11		0x0d4d	I219-V (11) Ethernet Connection
+product INTEL I219_LM10		0x0d4e	I219-LM (10) Ethernet Connection
+product INTEL I219_V10		0x0d4f	I219-V (10) Ethernet Connection
+product INTEL I219_LM12		0x0d53	I219-LM (12) Ethernet Connection
+product INTEL I219_V12		0x0d55	I219-V (12) Ethernet Connection
 product INTEL E5V2_DMI2		0x0e00	E5 v2 DMI2
 product INTEL E5V2_PCIE_1	0x0e01	E5 v2 PCIe x4 (DMI2 Mode)
 product INTEL E5V2_PCIE_2	0x0e02	E5 v2 PCIe
@@ -4172,13 +4172,13 @@ product INTEL X557_AT2		0x15ad	X557-AT2
 product INTEL X552_1G_T		0x15ae	X552 1000Base-T
 product INTEL X552_XFI		0x15b0	X552 XFI
 product INTEL C3K_X553_VF_HYPV	0x15b4	C3000 X553 VF (Hyper-V)
-product INTEL I219_LM2		0x15b7	I219-LM Ethernet Connection
-product INTEL I219_V2		0x15b8	I219-V Ethernet Connection
-product INTEL I219_LM3		0x15b9	I219-LM Ethernet Connection
-product INTEL I219_LM7		0x15bb	I219-LM Ethernet Connection
-product INTEL I219_V7		0x15bc	I219-V Ethernet Connection
-product INTEL I219_LM6		0x15bd	I219-LM Ethernet Connection
-product INTEL I219_V6		0x15be	I219-V Ethernet Connection
+product INTEL I219_LM2		0x15b7	I219-LM (2) Ethernet Connection
+product INTEL I219_V2		0x15b8	I219-V (2) Ethernet Connection
+product INTEL I219_LM3		0x15b9	I219-LM (3) Ethernet Connection
+product INTEL I219_LM7		0x15bb	I219-LM (7) Ethernet Connection
+product INTEL I219_V7		0x15bc	I219-V (7) Ethernet Connection
+product INTEL I219_LM6		0x15bd	I219-LM (6) Ethernet Connection
+product INTEL I219_V6		0x15be	I219-V (6) Ethernet Connection
 product INTEL C3K_X553_KRKX	0x15c2	C3000 X553 Backplane (KR/KX 10G SKU)
 product INTEL C3K_X553_KX_25G	0x15c3	C3000 X553 Backplane (KX 2.5G)
 product INTEL C3K_X553_SFI_SFP	0x15c4	C3000 X553 10G SFP+ (SFI)
@@ -4190,24 +4190,24 @@ product INTEL C3K_X553_QSFP	0x15ca	C3000
 product INTEL C3K_X553_QSFP_N	0x15cc	C3000 X553 10G QSFP
 product INTEL C3K_X553_KR_SFP	0x15ce	C3000 X553 10G SFP+ (KR)
 product INTEL X550T1	 	0x15d1	X550 10G Ethernet
-product INTEL I219_V5		0x15d6	I219-V Ethernet Connection
-product INTEL I219_LM4		0x15d7	I219-LM Ethernet Connection
-product INTEL I219_V4		0x15d8	I219-V Ethernet Connection
-product INTEL I219_LM8		0x15df	I219-LM Ethernet Connection
-product INTEL I219_V8		0x15e0	I219-V Ethernet Connection
-product INTEL I219_LM9		0x15e1	I219-LM Ethernet Connection
-product INTEL I219_V9		0x15e2	I219-V Ethernet Connection
-product INTEL I219_LM5		0x15e3	I219-LM Ethernet Connection
+product INTEL I219_V5		0x15d6	I219-V (5) Ethernet Connection
+product INTEL I219_LM4		0x15d7	I219-LM (4) Ethernet Connection
+product INTEL I219_V4		0x15d8	I219-V (4) Ethernet Connection
+product INTEL I219_LM8		0x15df	I219-LM (8) Ethernet Connection
+product INTEL I219_V8		0x15e0	I219-V (8) Ethernet Connection
+product INTEL I219_LM9		0x15e1	I219-LM (9) Ethernet Connection
+product INTEL I219_V9		0x15e2	I219-V (9) Ethernet Connection
+product INTEL I219_LM5		0x15e3	I219-LM (5) Ethernet Connection
 product INTEL C3K_X553_SGMII	0x15e4	C3000 X553 1GbE SGMII (10G SKU)
 product INTEL C3K_X553_SGMII_L	0x15e5	C3000 X553 1GbE SGMII (non-10G SKU)
 product INTEL I225_LM		0x15f2	I225 LM Ethernet
 product INTEL I225_V		0x15f3	I225 V Ethernet
-product INTEL I219_LM15		0x15f4	I219-LM Ethernet Connection
+product INTEL I219_LM15		0x15f4	I219-LM (15) Ethernet Connection
 product INTEL I210_SGMII_WOF	0x15f6	I210 Ethernet (SGMII)
-product INTEL I219_LM14		0x15f9	I219-LM Ethernet Connection
-product INTEL I219_V14		0x15fa	I219-V Ethernet Connection
-product INTEL 

CVS commit: src/sys/dev/pci

2021-10-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 13 01:11:30 UTC 2021

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

Log Message:
Fix vmx(4) receive workqueue problem on qemu, reported by ozaki-r@n.o, thanks.

ESXi stops interrupt by vmxnet3_disable_intr() immediately.  In contrast, qemu
does not stop interrupt soon.  Hmm, qemu's behavior seems not to be correct,
however, there is no explicit specification of vmxnet3.  So, we have to accept
that behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_vmx.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_vmx.c
diff -u src/sys/dev/pci/if_vmx.c:1.4 src/sys/dev/pci/if_vmx.c:1.5
--- src/sys/dev/pci/if_vmx.c:1.4	Thu Oct 15 04:37:48 2020
+++ src/sys/dev/pci/if_vmx.c	Wed Oct 13 01:11:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.4 2020/10/15 04:37:48 ryo Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.5 2021/10/13 01:11:29 knakahara Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.4 2020/10/15 04:37:48 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.5 2021/10/13 01:11:29 knakahara Exp $");
 
 #include 
 #include 
@@ -253,6 +253,7 @@ struct vmxnet3_queue {
 
 	void *vxq_si;
 	bool vxq_workqueue;
+	bool vxq_wq_enqueued;
 	struct work vxq_wq_cookie;
 };
 
@@ -2484,8 +2485,15 @@ vmxnet3_sched_handle_queue(struct vmxnet
 {
 
 	if (vmxq->vxq_workqueue) {
-		workqueue_enqueue(sc->vmx_queue_wq, >vxq_wq_cookie,
-		curcpu());
+		/*
+		 * When this function is called, "vmxq" is owned by one CPU.
+		 * so, atomic operation is not required here.
+		 */
+		if (!vmxq->vxq_wq_enqueued) {
+			vmxq->vxq_wq_enqueued = true;
+			workqueue_enqueue(sc->vmx_queue_wq,
+			>vxq_wq_cookie, curcpu());
+		}
 	} else {
 		softint_schedule(vmxq->vxq_si);
 	}
@@ -2625,6 +2633,7 @@ vmxnet3_handle_queue_work(struct work *w
 	struct vmxnet3_queue *vmxq;
 
 	vmxq = container_of(wk, struct vmxnet3_queue, vxq_wq_cookie);
+	vmxq->vxq_wq_enqueued = false;
 	vmxnet3_handle_queue(vmxq);
 }
 



CVS commit: src/sys/dev/pci

2021-10-12 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 13 01:11:30 UTC 2021

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

Log Message:
Fix vmx(4) receive workqueue problem on qemu, reported by ozaki-r@n.o, thanks.

ESXi stops interrupt by vmxnet3_disable_intr() immediately.  In contrast, qemu
does not stop interrupt soon.  Hmm, qemu's behavior seems not to be correct,
however, there is no explicit specification of vmxnet3.  So, we have to accept
that behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_vmx.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

2021-10-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 14:15:34 UTC 2021

Modified Files:
src/sys/dev/pci: ichsmb.c pucdata.c

Log Message:
Add Intel 400 Series PCH-V devices.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/pucdata.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.73 src/sys/dev/pci/ichsmb.c:1.74
--- src/sys/dev/pci/ichsmb.c:1.73	Mon Oct 11 15:47:10 2021
+++ src/sys/dev/pci/ichsmb.c	Tue Oct 12 14:15:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.74 2021/10/12 14:15:34 msaitoh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.74 2021/10/12 14:15:34 msaitoh Exp $");
 
 #include 
 #include 
@@ -128,6 +128,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_3HS_SMB:
 		case PCI_PRODUCT_INTEL_3HS_U_SMB:
 		case PCI_PRODUCT_INTEL_4HS_H_SMB:
+		case PCI_PRODUCT_INTEL_4HS_V_SMB:
 		case PCI_PRODUCT_INTEL_CORE4G_M_SMB:
 		case PCI_PRODUCT_INTEL_CORE5G_M_SMB:
 		case PCI_PRODUCT_INTEL_CMTLK_SMB:

Index: src/sys/dev/pci/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.111 src/sys/dev/pci/pucdata.c:1.112
--- src/sys/dev/pci/pucdata.c:1.111	Mon Oct 11 15:43:19 2021
+++ src/sys/dev/pci/pucdata.c	Tue Oct 12 14:15:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.112 2021/10/12 14:15:34 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.112 2021/10/12 14:15:34 msaitoh Exp $");
 
 #include 
 #include 
@@ -2046,6 +2046,15 @@ const struct puc_device_description puc_
 	},
 	},
 
+	/* Intel 400 Series (V) KT */
+	{   "Intel 400 Series (V) KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_4HS_V_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
 	/* Intel 495 Series KT */
 	{   "Intel 495 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_495_YU_KT, 0, 0 },



CVS commit: src/sys/dev/pci

2021-10-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 14:15:34 UTC 2021

Modified Files:
src/sys/dev/pci: ichsmb.c pucdata.c

Log Message:
Add Intel 400 Series PCH-V devices.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/pucdata.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

2021-10-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 14:13:18 UTC 2021

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.1423 -r1.1424 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1422 -r1.1423 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

2021-10-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 14:12:06 UTC 2021

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

Log Message:
Add Intel 400 Series PCH-V devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1437 -r1.1438 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.1437 src/sys/dev/pci/pcidevs:1.1438
--- src/sys/dev/pci/pcidevs:1.1437	Mon Oct 11 13:26:52 2021
+++ src/sys/dev/pci/pcidevs	Tue Oct 12 14:12:06 2021
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1437 2021/10/11 13:26:52 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1438 2021/10/12 14:12:06 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6625,6 +6625,60 @@ product INTEL 3HS_SSRAM		0xa36f	300 Seri
 product INTEL 3HS_THERM		0xa379	300 Series Thermal
 product INTEL 3HS_SPI_2		0xa37b	300 Series SPI
 product INTEL 3HS_ISH		0xa37c	300 Series ISH
+product INTEL 4HS_V_AHCI	0xa382	400 Series PCH-V SATA (AHCI)
+product INTEL 4HS_V_RAID	0xa384	400 Series PCH-V SATA (RAID)
+product INTEL 4HS_V_P_RAID	0xa386	400 Series PCH-V SATA (RAID) premium
+product INTEL 4HS_V_OPTANE	0xa38e	400 Series PCH-V SATA (Optane)
+product INTEL 4HS_V_PCIE_1	0xa390	400 Series PCH-V PCIe Root Port 1
+product INTEL 4HS_V_PCIE_2	0xa391	400 Series PCH-V PCIe Root Port 2
+product INTEL 4HS_V_PCIE_3	0xa392	400 Series PCH-V PCIe Root Port 3
+product INTEL 4HS_V_PCIE_4	0xa393	400 Series PCH-V PCIe Root Port 4
+product INTEL 4HS_V_PCIE_5	0xa394	400 Series PCH-V PCIe Root Port 5
+product INTEL 4HS_V_PCIE_6	0xa395	400 Series PCH-V PCIe Root Port 6
+product INTEL 4HS_V_PCIE_7	0xa396	400 Series PCH-V PCIe Root Port 7
+product INTEL 4HS_V_PCIE_8	0xa397	400 Series PCH-V PCIe Root Port 8
+product INTEL 4HS_V_PCIE_9	0xa398	400 Series PCH-V PCIe Root Port 9
+product INTEL 4HS_V_PCIE_10	0xa399	400 Series PCH-V PCIe Root Port 10
+product INTEL 4HS_V_PCIE_11	0xa39a	400 Series PCH-V PCIe Root Port 11
+product INTEL 4HS_V_PCIE_12	0xa39b	400 Series PCH-V PCIe Root Port 12
+product INTEL 4HS_V_PCIE_13	0xa39c	400 Series PCH-V PCIe Root Port 13
+product INTEL 4HS_V_PCIE_14	0xa39d	400 Series PCH-V PCIe Root Port 14
+product INTEL 4HS_V_PCIE_15	0xa39e	400 Series PCH-V PCIe Root Port 15
+product INTEL 4HS_V_PCIE_16	0xa39f	400 Series PCH-V PCIe Root Port 16
+product INTEL 4HS_V_P2SB	0xa3a0	400 Series PCH-V P2SB
+product INTEL 4HS_V_PMC		0xa3a1	400 Series PCH-V PMC
+product INTEL 4HS_V_SMB		0xa3a3	400 Series PCH-V SMBus
+product INTEL 4HS_V_SPI		0xa3a4	400 Series PCH-V SPI (FLASH)
+product INTEL 4HS_V_TRACE	0xa3a6	400 Series PCH-V Trace Hub
+product INTEL 4HS_V_UART_0	0xa3a7	400 Series PCH-V UART 0
+product INTEL 4HS_V_UART_1	0xa3a8	400 Series PCH-V UART 1
+product INTEL 4HS_V_SPI_0	0xa3a9	400 Series PCH-V SPI 0
+product INTEL 4HS_V_SPI_1	0xa3aa	400 Series PCH-V SPI 1
+product INTEL 4HS_V_XHCI	0xa3af	400 Series PCH-V USB 3.2 Gen 1x1 xHCI
+product INTEL 4HS_V_XDCI	0xa3b0	400 Series PCH-V USB xDCI
+product INTEL 4HS_V_THERM	0xa3b1	400 Series PCH-V Thermal
+product INTEL 4HS_V_ISH		0xa3b5	400 Series PCH-V Integrated Sensor Hub
+product INTEL 4HS_V_HECI_1	0xa3ba	400 Series PCH-V HECI 1
+product INTEL 4HS_V_HECI_2	0xa3bb	400 Series PCH-V HECI 2
+product INTEL 4HS_V_IDER	0xa3bc	400 Series PCH-V IDE-R
+product INTEL 4HS_V_KT		0xa3bd	400 Series PCH-V KT
+product INTEL 4HS_V_HECI_3	0xa3be	400 Series PCH-V HECI 3
+product INTEL 4HS_V_B460_LPC	0xa3c8	B460 PCH-V LPC or eSPI
+product INTEL 4HS_V_H410_LPC	0xa3da	H410 PCH-V LPC or eSPI
+product INTEL 4HS_V_I2C_0	0xa3e0	400 Series PCH-V I2C 0
+product INTEL 4HS_V_I2C_1	0xa3e1	400 Series PCH-V I2C 1
+product INTEL 4HS_V_I2C_2	0xa3e2	400 Series PCH-V I2C 2
+product INTEL 4HS_V_I2C_3	0xa3e3	400 Series PCH-V I2C 3
+product INTEL 4HS_V_UART_2	0xa3e6	400 Series PCH-V UART 2
+product INTEL 4HS_V_PCIE_17	0xa3e7	400 Series PCH-V PCIe Root Port 17
+product INTEL 4HS_V_PCIE_18	0xa3e8	400 Series PCH-V PCIe Root Port 18
+product INTEL 4HS_V_PCIE_19	0xa3e9	400 Series PCH-V PCIe Root Port 19
+product INTEL 4HS_V_PCIE_20	0xa3ea	400 Series PCH-V PCIe Root Port 20
+product INTEL 4HS_V_PCIE_21	0xa3eb	400 Series PCH-V PCIe Root Port 21
+product INTEL 4HS_V_PCIE_22	0xa3ec	400 Series PCH-V PCIe Root Port 22
+product INTEL 4HS_V_PCIE_23	0xa3ed	400 Series PCH-V PCIe Root Port 23
+product INTEL 4HS_V_PCIE_24	0xa3ee	400 Series PCH-V PCIe Root Port 24
+product INTEL 4HS_V_CAVS	0xa3f0	400 Series PCH-V cAVS
 product INTEL 21152		0xb152	S21152BB PCI-PCI Bridge
 product INTEL 21154		0xb154	S21152BA,S21154AE/BE PCI-PCI Bridge
 product INTEL 21555		0xb555	21555 Non-Transparent PCI-PCI Bridge



CVS commit: src/sys/dev/pci

2021-10-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 12 14:12:06 UTC 2021

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

Log Message:
Add Intel 400 Series PCH-V devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1437 -r1.1438 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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:47:10 UTC 2021

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

Log Message:
Add Intel 500 Series PCH-H SMBus.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.72 src/sys/dev/pci/ichsmb.c:1.73
--- src/sys/dev/pci/ichsmb.c:1.72	Sat Aug  7 16:19:14 2021
+++ src/sys/dev/pci/ichsmb.c	Mon Oct 11 15:47:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.72 2021/08/07 16:19:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.73 2021/10/11 15:47:10 msaitoh Exp $");
 
 #include 
 #include 
@@ -149,6 +149,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_C2000_PCU_SMBUS:
 		case PCI_PRODUCT_INTEL_C3K_SMBUS_LEGACY:
 		case PCI_PRODUCT_INTEL_495_YU_SMB:
+		case PCI_PRODUCT_INTEL_5HS_H_SMB:
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
 			return 1;
 		}



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:47:10 UTC 2021

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

Log Message:
Add Intel 500 Series PCH-H SMBus.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ichsmb.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:43:20 UTC 2021

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

Log Message:
Add some Intel KT devices.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/pucdata.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/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.110 src/sys/dev/pci/pucdata.c:1.111
--- src/sys/dev/pci/pucdata.c:1.110	Sat Jul 17 10:45:58 2021
+++ src/sys/dev/pci/pucdata.c	Mon Oct 11 15:43:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.110 2021/07/17 10:45:58 riastradh Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.110 2021/07/17 10:45:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.111 2021/10/11 15:43:19 msaitoh Exp $");
 
 #include 
 #include 
@@ -2028,6 +2028,42 @@ const struct puc_device_description puc_
 	},
 	},
 
+	/* Intel Comet Lake KT */
+	{   "Intel Comet Lake KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_CMTLK_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 400 Series (H) KT */
+	{   "Intel 400 Series (H) KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_4HS_H_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 495 Series KT */
+	{   "Intel 495 Series KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_495_YU_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
+	/* Intel 500 Series (H) KT */
+	{   "Intel 500 Series (H) KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_5HS_H_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+	
 	/* Intel C600/X79 Series KT */
 	{   "Intel C600/X79 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C600_KT, 0, 0 },



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:43:20 UTC 2021

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

Log Message:
Add some Intel KT devices.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/pucdata.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:50 UTC 2021

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

Log Message:
Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_rge.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_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.21 src/sys/dev/pci/if_rge.c:1.22
--- src/sys/dev/pci/if_rge.c:1.21	Mon Oct 11 15:11:07 2021
+++ src/sys/dev/pci/if_rge.c	Mon Oct 11 15:11:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.22 2021/10/11 15:11:49 msaitoh 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.21 2021/10/11 15:11:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.22 2021/10/11 15:11:49 msaitoh Exp $");
 
 #include 
 
@@ -2077,8 +2077,10 @@ rge_set_macaddr(struct rge_softc *sc, co
 void
 rge_get_macaddr(struct rge_softc *sc, uint8_t *addr)
 {
-	*(uint32_t *)[0] = RGE_READ_4(sc, RGE_ADDR0);
-	*(uint16_t *)[4] = RGE_READ_2(sc, RGE_ADDR1);
+	int i;
+
+	for (i = 0; i < ETHER_ADDR_LEN; i++)
+		addr[i] = RGE_READ_1(sc, RGE_ADDR0 + i);
 }
 
 void



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:50 UTC 2021

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

Log Message:
Avoid unaligned access in rge_get_macaddr(). Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_rge.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:07 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_rge.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_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.20 src/sys/dev/pci/if_rge.c:1.21
--- src/sys/dev/pci/if_rge.c:1.20	Mon Oct 11 15:10:19 2021
+++ src/sys/dev/pci/if_rge.c	Mon Oct 11 15:11:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.20 2021/10/11 15:10:19 msaitoh Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh 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.20 2021/10/11 15:10:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.21 2021/10/11 15:11:07 msaitoh Exp $");
 
 #include 
 
@@ -1503,9 +1503,9 @@ rge_iff(struct rge_softc *sc)
 			ETHER_ADDR_LEN) >> 26;
 
 			if (h < 32)
-hashes[0] |= (1 << h);
+hashes[0] |= (1U << h);
 			else
-hashes[1] |= (1 << (h - 32));
+hashes[1] |= (1U << (h - 32));
 
 			ETHER_NEXT_MULTI(step, enm);
 		}
@@ -2068,7 +2068,7 @@ rge_set_macaddr(struct rge_softc *sc, co
 {
 	RGE_SETBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
 	RGE_WRITE_4(sc, RGE_MAC0,
-	addr[3] << 24 | addr[2] << 16 | addr[1] << 8 | addr[0]);
+	(uint32_t)addr[3] << 24 | addr[2] << 16 | addr[1] << 8 | addr[0]);
 	RGE_WRITE_4(sc, RGE_MAC4,
 	addr[5] <<  8 | addr[4]);
 	RGE_CLRBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);



CVS commit: src/sys/dev/pci

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:11:07 UTC 2021

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

Log Message:
Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/if_rge.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

2021-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 11 15:10:19 UTC 2021

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

Log Message:
Add pmf_device_register().


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_rge.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   >