CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:48:15 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1451):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.216
sys/dev/pci/ixgbe/ixv.c: revision 1.141

Print MAC address.

XXX Should we move such type of printf() to ether_ifattach?


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.36 -r1.88.2.37 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.27 -r1.56.2.28 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:48:15 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1451):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.216
sys/dev/pci/ixgbe/ixv.c: revision 1.141

Print MAC address.

XXX Should we move such type of printf() to ether_ifattach?


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.36 -r1.88.2.37 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.56.2.27 -r1.56.2.28 src/sys/dev/pci/ixgbe/ixv.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.88.2.36 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.37
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.36	Thu Oct 17 18:39:41 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Nov 19 10:48:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.36 2019/10/17 18:39:41 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.37 2019/11/19 10:48:15 martin Exp $ */
 
 /**
 
@@ -1333,6 +1333,8 @@ ixgbe_setup_interface(device_t dev, stru
 	}
 	adapter->ipq = if_percpuq_create(>osdep.ec.ec_if);
 	ether_ifattach(ifp, adapter->hw.mac.addr);
+	aprint_normal_dev(dev, "Ethernet address %s\n",
+	ether_sprintf(adapter->hw.mac.addr));
 	/*
 	 * We use per TX queue softint, so if_deferred_start_init() isn't
 	 * used.

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.56.2.27 src/sys/dev/pci/ixgbe/ixv.c:1.56.2.28
--- src/sys/dev/pci/ixgbe/ixv.c:1.56.2.27	Thu Nov 14 15:53:39 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Nov 19 10:48:15 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.56.2.27 2019/11/14 15:53:39 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.56.2.28 2019/11/19 10:48:15 martin Exp $*/
 
 /**
 
@@ -1623,6 +1623,8 @@ ixv_setup_interface(device_t dev, struct
 	}
 	adapter->ipq = if_percpuq_create(>osdep.ec.ec_if);
 	ether_ifattach(ifp, adapter->hw.mac.addr);
+	aprint_normal_dev(dev, "Ethernet address %s\n",
+	ether_sprintf(adapter->hw.mac.addr));
 	/*
 	 * We use per TX queue softint, so if_deferred_start_init() isn't
 	 * used.



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:40:40 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1448


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.16 -r1.1281.2.17 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.16 -r1.1280.2.17 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: [netbsd-8] src/sys/dev/pci

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:40:40 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #1448


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.16 -r1.1281.2.17 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.16 -r1.1280.2.17 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:36:48 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1448:

sys/dev/pci/pcidevs 1.1384-1.1391

- Add micron/crucial SM2263 NVMe.
- Add some device found on ASUS X570-P with Ryzen 3200G CPU.
- Spell it "PCIe' when using the name.
- Add Mellanox ConnectX-4, ConnectX-4 Lx, ConnectX-5, and ConnectX-5 Ex
- Modify Attansic Ethernet devices' description to clarify.
- Add Killer E2400 and E2500.
- Spell "controller" correctly.
- Add Realtek RTL8125.
- Update Intel's NVMe SSDs.
- Add Intel Apollo Lake TXE HECI.
- Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.16 -r1.1289.2.17 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: [netbsd-8] src/sys/dev/pci

2019-11-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov 19 10:36:48 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1448:

sys/dev/pci/pcidevs 1.1384-1.1391

- Add micron/crucial SM2263 NVMe.
- Add some device found on ASUS X570-P with Ryzen 3200G CPU.
- Spell it "PCIe' when using the name.
- Add Mellanox ConnectX-4, ConnectX-4 Lx, ConnectX-5, and ConnectX-5 Ex
- Modify Attansic Ethernet devices' description to clarify.
- Add Killer E2400 and E2500.
- Spell "controller" correctly.
- Add Realtek RTL8125.
- Update Intel's NVMe SSDs.
- Add Intel Apollo Lake TXE HECI.
- Add D-Link DGE-530T C1 and TP-Link TG-3468 v2.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.16 -r1.1289.2.17 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.1289.2.16 src/sys/dev/pci/pcidevs:1.1289.2.17
--- src/sys/dev/pci/pcidevs:1.1289.2.16	Tue Aug  6 15:51:07 2019
+++ src/sys/dev/pci/pcidevs	Tue Nov 19 10:36:47 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.16 2019/08/06 15:51:07 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.17 2019/11/19 10:36:47 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -686,6 +686,7 @@ vendor ADP2		0x9005	Adaptec (2nd PCI Ven
 vendor ATRONICS		0x907f	Atronics
 vendor NETMOS		0x9710	Netmos
 vendor PARALLELS	0x	Parallels	
+vendor MICRON		0xc0a9	Micron/Crucial Technology
 vendor CHRYSALIS	0xcafe	Chrysalis-ITS
 vendor MIDDLE_DIGITAL	0xdeaf	Middle Digital
 vendor ARC		0xedd8	ARC Logic
@@ -963,10 +964,10 @@ product AMAZON NVME	0x8061	NVMe SSD
 product AMAZON ENA	0xec20	Elastic Network Adapter
 
 /* AMD products */
-product AMD AMD64_HT	0x1100	K8 AMD64 HyperTransport Configuration
-product AMD AMD64_ADDR	0x1101	K8 AMD64 Address Map Configuration
-product AMD AMD64_DRAM	0x1102	K8 AMD64 DRAM Configuration
-product AMD AMD64_MISC	0x1103	K8 AMD64 Miscellaneous Configuration
+product AMD AMD64_HT		0x1100	K8 AMD64 HyperTransport Configuration
+product AMD AMD64_ADDR		0x1101	K8 AMD64 Address Map Configuration
+product AMD AMD64_DRAM		0x1102	K8 AMD64 DRAM Configuration
+product AMD AMD64_MISC		0x1103	K8 AMD64 Miscellaneous Configuration
 product AMD AMD64_F10_HT	0x1200	AMD64 Family10h HyperTransport Configuration
 product AMD AMD64_F10_ADDR	0x1201	AMD64 Family10h Address Map Configuration
 product AMD AMD64_F10_DRAM	0x1202	AMD64 Family10h DRAM Configuration
@@ -977,140 +978,145 @@ product AMD AMD64_F11_ADDR	0x1301	AMD64 
 product AMD AMD64_F11_DRAM	0x1302	AMD64 Family11h DRAM Configuration
 product AMD AMD64_F11_MISC	0x1303	AMD64 Family11h Miscellaneous Configuration
 product AMD AMD64_F11_LINK	0x1304	AMD64 Family11h Link Configuration
-product AMD F15_10_PF_0	0x1400	Family15h Processor Function 0
-product AMD F15_10_PF_1	0x1401	Family15h Processor Function 1
-product AMD F15_10_PF_2	0x1402	Family15h Processor Function 2
-product AMD F15_10_PF_3	0x1403	Family15h Processor Function 3
-product AMD F15_10_PF_4	0x1404	Family15h Processor Function 4
-product AMD F15_10_PF_5	0x1405	Family15h Processor Function 5
-product AMD F15_10_RC	0x1410	Family15h Root Complex
-product AMD F15_10_RP_2	0x1412	Family15h Root Port
-product AMD F15_10_RP_3	0x1413	Family15h Root Port
-product AMD F15_10_RP_4	0x1414	Family15h Root Port
-product AMD F15_10_RP_5	0x1415	Family15h Root Port
-product AMD F15_10_RP_6	0x1416	Family15h Root Port
-product AMD F15_10_RP_7	0x1417	Family15h Root Port
-product AMD F15_10_RP_8	0x1418	Family15h Root Port
+product AMD F15_10_PF_0		0x1400	Family15h Processor Function 0
+product AMD F15_10_PF_1		0x1401	Family15h Processor Function 1
+product AMD F15_10_PF_2		0x1402	Family15h Processor Function 2
+product AMD F15_10_PF_3		0x1403	Family15h Processor Function 3
+product AMD F15_10_PF_4		0x1404	Family15h Processor Function 4
+product AMD F15_10_PF_5		0x1405	Family15h Processor Function 5
+product AMD F15_10_RC		0x1410	Family15h Root Complex
+product AMD F15_10_RP_2		0x1412	Family15h Root Port
+product AMD F15_10_RP_3		0x1413	Family15h Root Port
+product AMD F15_10_RP_4		0x1414	Family15h Root Port
+product AMD F15_10_RP_5		0x1415	Family15h Root Port
+product AMD F15_10_RP_6		0x1416	Family15h Root Port
+product AMD F15_10_RP_7		0x1417	Family15h Root Port
+product AMD F15_10_RP_8		0x1418	Family15h Root Port
 product AMD F15_10_IOMMU	0x1419	Family15h IOMMU
-product AMD F15_30_PF_0	0x141a	Family15h Processor Function 0
-product AMD F15_30_PF_1	0x141b	Family15h Processor Function 1
-product AMD F15_30_PF_2	0x141c	Family15h Processor Function 2
-product AMD F15_30_PF_3	0x141d	Family15h Processor Function 3
-product AMD F15_30_PF_4	0x141e	Family15h Processor Function 4
-product AMD F15_30_PF_5	0x141f	Family15h Processor Function 5
-product AMD F15_30_RC	0x1422	Family15h Root Complex

CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 15:53:40 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1435):

sys/dev/pci/ixgbe/ixv.c: revision 1.140

ixv(4): disable RSS configuration on 82599 and X540 VFs.

Those VFs share their RSS configuration with PF and, thus,
they cannot be configured independently. From FreeBSD r354349.


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

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 15:53:40 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1435):

sys/dev/pci/ixgbe/ixv.c: revision 1.140

ixv(4): disable RSS configuration on 82599 and X540 VFs.

Those VFs share their RSS configuration with PF and, thus,
they cannot be configured independently. From FreeBSD r354349.


To generate a diff of this commit:
cvs rdiff -u -r1.56.2.26 -r1.56.2.27 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.56.2.26 src/sys/dev/pci/ixgbe/ixv.c:1.56.2.27
--- src/sys/dev/pci/ixgbe/ixv.c:1.56.2.26	Tue Oct  8 18:16:50 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Nov 14 15:53:39 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.56.2.26 2019/10/08 18:16:50 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.56.2.27 2019/11/14 15:53:39 martin Exp $*/
 
 /**
 
@@ -1931,7 +1931,8 @@ ixv_initialize_receive_units(struct adap
 			adapter->num_rx_desc - 1);
 	}
 
-	ixv_initialize_rss_mapping(adapter);
+	if (adapter->hw.mac.type >= ixgbe_mac_X550_vf)
+		ixv_initialize_rss_mapping(adapter);
 } /* ixv_initialize_receive_units */
 
 /



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 15:48:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pucdata.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #1440):

sys/dev/pci/pucdata.c: revision 1.105

The 16C1054 and 16C1058 serial multi-port controllers need a clock
multiplier of 8, just like the 16C1050 controller.

Verified with an ExSys EX-41388.
ryo@ checked back with the hardware his original commit was based on,
and confirmed the change.

XXX Pull-up to netbsd-{7,8,9}


To generate a diff of this commit:
cvs rdiff -u -r1.99.8.4 -r1.99.8.5 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.99.8.4 src/sys/dev/pci/pucdata.c:1.99.8.5
--- src/sys/dev/pci/pucdata.c:1.99.8.4	Sun May  5 08:20:08 2019
+++ src/sys/dev/pci/pucdata.c	Thu Nov 14 15:48:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.99.8.4 2019/05/05 08:20:08 martin Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.99.8.5 2019/11/14 15:48:07 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.99.8.4 2019/05/05 08:20:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.99.8.5 2019/11/14 15:48:07 martin Exp $");
 
 #include 
 #include 
@@ -2872,10 +2872,10 @@ const struct puc_device_description puc_
 	{	PCI_VENDOR_SYSTEMBASE, PCI_PRODUCT_SYSTEMBASE_SB16C1054, 0, 0 },
 	{	0x,	0x,		 0, 0 },
 	{
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x08, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x10, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x18, COM_FREQ },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x08, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x10, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x18, COM_FREQ * 8 },
 	},
 	},
 
@@ -2884,14 +2884,14 @@ const struct puc_device_description puc_
 	{   PCI_VENDOR_SYSTEMBASE, PCI_PRODUCT_SYSTEMBASE_SB16C1058, 0, 0 },
 	{	0x,	0x,		 0, 0 },
 	{
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x08, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x10, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x18, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x20, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x28, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x30, COM_FREQ },
-		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x38, COM_FREQ },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x08, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x10, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x18, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x20, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x28, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x30, COM_FREQ * 8 },
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x38, COM_FREQ * 8 },
 	},
 	},
 



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 14 15:48:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pucdata.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #1440):

sys/dev/pci/pucdata.c: revision 1.105

The 16C1054 and 16C1058 serial multi-port controllers need a clock
multiplier of 8, just like the 16C1050 controller.

Verified with an ExSys EX-41388.
ryo@ checked back with the hardware his original commit was based on,
and confirmed the change.

XXX Pull-up to netbsd-{7,8,9}


To generate a diff of this commit:
cvs rdiff -u -r1.99.8.4 -r1.99.8.5 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: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 10 13:36:29 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1431):

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.56

Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.


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

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-11-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 10 13:36:29 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1431):

sys/dev/pci/ixgbe/ix_txrx.c: revision 1.56

Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.17 -r1.24.2.18 src/sys/dev/pci/ixgbe/ix_txrx.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.17 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.18
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.17	Thu Sep  5 09:06:07 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sun Nov 10 13:36:29 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.17 2019/09/05 09:06:07 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.18 2019/11/10 13:36:29 martin Exp $ */
 
 /**
 
@@ -266,8 +266,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 >wq_cookie, curcpu());
 			} else
 percpu_putref(adapter->txr_wq_enqueued);
-		} else
+		} else {
+			kpreempt_disable();
 			softint_schedule(txr->txr_si);
+			kpreempt_enable();
+		}
 	}
 
 	return (0);



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 10 13:34:46 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_jme.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1430):

sys/dev/pci/if_jme.c: revision 1.46

A * is missing here. This could cause a use-after-free.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.31.8.2 -r1.31.8.3 src/sys/dev/pci/if_jme.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_jme.c
diff -u src/sys/dev/pci/if_jme.c:1.31.8.2 src/sys/dev/pci/if_jme.c:1.31.8.3
--- src/sys/dev/pci/if_jme.c:1.31.8.2	Thu Jul 26 23:55:30 2018
+++ src/sys/dev/pci/if_jme.c	Sun Nov 10 13:34:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_jme.c,v 1.31.8.2 2018/07/26 23:55:30 snj Exp $	*/
+/*	$NetBSD: if_jme.c,v 1.31.8.3 2019/11/10 13:34:46 martin Exp $	*/
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.31.8.2 2018/07/26 23:55:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.31.8.3 2019/11/10 13:34:46 martin Exp $");
 
 
 #include 
@@ -1450,7 +1450,7 @@ jme_encap(struct jme_softc *sc, struct m
 			"DMA segments, dropping...\n",
 			device_xname(sc->jme_dev));
 			m_freem(*m_head);
-			m_head = NULL;
+			*m_head = NULL;
 		}
 		return (error);
 	}



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 10 13:34:46 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_jme.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1430):

sys/dev/pci/if_jme.c: revision 1.46

A * is missing here. This could cause a use-after-free.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.31.8.2 -r1.31.8.3 src/sys/dev/pci/if_jme.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  6 10:23:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1428:

sys/dev/pci/if_wm.c 1.647, 1.649 via patch

- Use device_printf() instead of printf().
- Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.35 -r1.508.4.36 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.508.4.35 src/sys/dev/pci/if_wm.c:1.508.4.36
--- src/sys/dev/pci/if_wm.c:1.508.4.35	Sun Aug  4 10:59:19 2019
+++ src/sys/dev/pci/if_wm.c	Wed Nov  6 10:23:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.36 2019/11/06 10:23:06 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.36 2019/11/06 10:23:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4549,8 +4549,8 @@ wm_flush_desc_rings(struct wm_softc *sc)
 		return;
 
 	/* TX */
-	printf("%s: Need TX flush (reg = %08x, len = %u)\n",
-	device_xname(sc->sc_dev), preg, reg);
+	device_printf(sc->sc_dev, "Need TX flush (reg = %08x, len = %u)\n",
+	preg, reg);
 	reg = CSR_READ(sc, WMREG_TCTL);
 	CSR_WRITE(sc, WMREG_TCTL, reg | TCTL_EN);
 
@@ -4577,8 +4577,7 @@ wm_flush_desc_rings(struct wm_softc *sc)
 		return;
 
 	/* RX */
-	printf("%s: Need RX flush (reg = %08x)\n",
-	device_xname(sc->sc_dev), preg);
+	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);
 	CSR_WRITE_FLUSH(sc);
@@ -4818,7 +4817,7 @@ wm_reset(struct wm_softc *sc)
 			reg |= CTRL_PHY_RESET;
 			phy_reset = 1;
 		} else
-			printf("XXX reset is blocked!!!\n");
+			device_printf(sc->sc_dev, "XXX reset is blocked!!!\n");
 		sc->phy.acquire(sc);
 		CSR_WRITE(sc, WMREG_CTRL, reg);
 		/* Don't insert a completion barrier when reset */
@@ -8962,7 +8961,8 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
  * Fiber?
  * Shoud not enter here.
  */
-printf("unknown media (%x)\n", active);
+device_printf(sc->sc_dev,
+"unknown media (%x)\n", active);
 break;
 			}
 			if (active & IFM_FDX)
@@ -9705,7 +9705,7 @@ wm_gmii_reset(struct wm_softc *sc)
  * result might be incorrect.
  *
  *  In the second call, PHY OUI and model is used to identify PHY type.
- * It might not be perfpect because of the lack of compared entry, but it
+ * It might not be perfect because of the lack of compared entry, but it
  * would be better than the first call.
  *
  *  If the detected new result and previous assumption is different,
@@ -10916,7 +10916,7 @@ wm_gmii_hv_readreg_locked(device_t dev, 
 	 * own func
 	 */
 	if ((page > 0) && (page < HV_INTC_FC_PAGE_START)) {
-		printf("gmii_hv_readreg!!!\n");
+		device_printf(dev, "gmii_hv_readreg!!!\n");
 		return 0;
 	}
 
@@ -10984,7 +10984,7 @@ wm_gmii_hv_writereg_locked(device_t dev,
 	 * own func
 	 */
 	if ((page > 0) && (page < HV_INTC_FC_PAGE_START)) {
-		printf("gmii_hv_writereg!!!\n");
+		device_printf(dev, "gmii_hv_writereg!!!\n");
 		return -1;
 	}
 
@@ -11008,7 +11008,7 @@ wm_gmii_hv_writereg_locked(device_t dev,
 			if ((child != NULL) && (child->mii_mpd_rev >= 1)
 			&& (phy == 2) && ((regnum & MII_ADDRMASK) == 0)
 			&& ((val & (1 << 11)) != 0)) {
-printf("XXX need workaround\n");
+device_printf(dev, "XXX need workaround\n");
 			}
 		}
 
@@ -12550,12 +12550,12 @@ wm_ich8_cycle_init(struct wm_softc *sc)
 	/*
 	 * Either we should have a hardware SPI cycle in progress bit to check
 	 * against, in order to start a new cycle or FDONE bit should be
-	 * changed in the hardware so that it is 1 after harware reset, which
+	 * changed in the hardware so that it is 1 after hardware reset, which
 	 * can then be used as an indication whether a cycle is in progress or
 	 * has been completed .. we should also have some software semaphore
 	 * mechanism to guard FDONE or the cycle in progress bit so that two
 	 * threads access to those bits can be sequentiallized or a way so that
-	 * 2 threads dont start the cycle at the same time
+	 * 2 threads don't start the cycle at the same time
 	 */
 
 	if ((hsfsts & HSFSTS_FLINPRO) == 0) {
@@ -13569,8 +13569,9 @@ wm_get_swfw_semaphore(struct wm_softc *s
 		delay(5000);
 		timeout--;
 	}
-	printf("%s: failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
-	device_xname(sc->sc_dev), mask, swfw_sync);
+	device_printf(sc->sc_dev,
+	"failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
+	mask, swfw_sync);
 	return 1;
 }
 
@@ -13716,8 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  6 10:23:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1428:

sys/dev/pci/if_wm.c 1.647, 1.649 via patch

- Use device_printf() instead of printf().
- Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.35 -r1.508.4.36 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: [netbsd-8] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:03:38 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1415):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

 -

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.156.1 src/sys/dev/pci/if_bcereg.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_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.46 src/sys/dev/pci/if_bce.c:1.46.4.1
--- src/sys/dev/pci/if_bce.c:1.46	Wed Apr 19 07:35:44 2017
+++ src/sys/dev/pci/if_bce.c	Thu Oct 24 16:03:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.46 2017/04/19 07:35:44 msaitoh Exp $	 */
+/* $NetBSD: if_bce.c,v 1.46.4.1 2019/10/24 16:03:38 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.46 2017/04/19 07:35:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.46.4.1 2019/10/24 16:03:38 martin Exp $");
 
 #include "vlan.h"
 
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1
 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -419,6 +417,8 @@ bce_attach(device_t parent, device_t sel
 	ifp->if_stop = bce_stop;
 	IFQ_SET_READY(>if_snd);
 
+	sc->ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
 	/* Initialize our media structures and probe the MII. */
 
 	sc->bce_mii.mii_ifp = ifp;
@@ -648,7 +648,7 @@ bce_watchdog(struct ifnet *ifp)
 {
 	struct bce_softc *sc = ifp->if_softc;
 
-	aprint_error_dev(sc->bce_dev, "device timeout\n");
+	device_printf(sc->bce_dev, "device timeout\n");
 	ifp->if_oerrors++;
 
 	(void) bce_init(ifp);
@@ -915,10 +915,15 @@ bce_init(struct ifnet *ifp)
 	sc->bce_txsnext = 0;
 	sc->bce_txin = 0;
 
-	/* enable crc32 generation */
+	/* enable crc32 generation and set proper LED modes */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
 	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) |
-	BCE_EMC_CG);
+	BCE_EMC_CRC32_ENAB | BCE_EMC_LED);
+
+	/* reset or clear powerdown control bit  */
+	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
+	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) &
+	~BCE_EMC_PDOWN);
 
 	/* setup DMA interrupt control */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DMAI_CTL, 1 << 24);	/* MAGIC */
@@ -1464,9 +1469,11 @@ static void
 bce_tick(void *v)
 {
 	struct bce_softc *sc = v;
+	int s;
 
-	/* Tick the MII. */
+	s = splnet();
 	mii_tick(>bce_mii);
+	splx(s);
 
 	callout_reset(>bce_timeout, hz, bce_tick, sc);
 }

Index: src/sys/dev/pci/if_bcereg.h
diff -u src/sys/dev/pci/if_bcereg.h:1.4 src/sys/dev/pci/if_bcereg.h:1.4.156.1
--- src/sys/dev/pci/if_bcereg.h:1.4	Sun Dec 11 12:22:49 2005
+++ src/sys/dev/pci/if_bcereg.h	Thu Oct 24 16:03:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bcereg.h,v 1.4 2005/12/11 12:22:49 christos Exp $	 */
+/* $NetBSD: if_bcereg.h,v 1.4.156.1 2019/10/24 16:03:38 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -71,7 +71,10 @@
 /* Ethernet MAC Control */
 #define BCE_MACCTL			0x00A8	/* ethernet mac control */
 /* mac control bits */
-#define BCE_EMC_CG			0x0001	/* crc32 generation */
+#define BCE_EMC_CRC32_ENAB		0x0001	/* crc32 generation */
+#define BCE_EMC_PDOWN			0x0004	/* PHY powerdown */
+#define BCE_EMC_EDET			0x0008	/* PHY energy detect */
+#define BCE_EMC_LED			0x00e0	/* PHY LED control */
 
 /* DMA Interrupt control */
 #define BCE_DMAI_CTL			0x0100



CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:03:38 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1415):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

 -

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.156.1 src/sys/dev/pci/if_bcereg.h

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:39:42 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1408):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.214

Apply FreeBSD r353599:
 > ixgbe: Disable EEE for backplane X550EM_X
 >
 > From Zach:
 > Intel documentation indicates that backplane X550EM_X KR devices do not
 > support Energy Efficient Ethernet. Prior to this patch, X552 devices
 > (device ID 0x15AB) will crash the system when transitioning EEE state
 > via sysctl.
 >
 > Signed-off-by: Zach Vargas 
 >
 > PR:  240320
 > Submitted by:Zach Vargas 
 > Reviewed by: erj@
 > MFC after:   3 days
 > Differential Revision:   https://reviews.freebsd.org/D21673


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.35 -r1.88.2.36 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.88.2.35 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.36
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.35	Thu Sep 26 18:19:26 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Oct 17 18:39:41 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.35 2019/09/26 18:19:26 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.36 2019/10/17 18:39:41 martin Exp $ */
 
 /**
 
@@ -5819,7 +5819,7 @@ ixgbe_sysctl_eee_state(SYSCTLFN_ARGS)
 	if ((new_eee < 0) || (new_eee > 1))
 		return (EINVAL);
 
-	retval = adapter->hw.mac.ops.setup_eee(>hw, new_eee);
+	retval = ixgbe_setup_eee(>hw, new_eee);
 	if (retval) {
 		device_printf(dev, "Error in EEE setup: 0x%08X\n", retval);
 		return (EINVAL);
@@ -5993,8 +5993,6 @@ ixgbe_init_device_features(struct adapte
 		 */
 		adapter->feat_cap |= IXGBE_FEATURE_SRIOV;
 		adapter->feat_cap |= IXGBE_FEATURE_FDIR;
-		if (adapter->hw.device_id == IXGBE_DEV_ID_X550EM_X_KR)
-			adapter->feat_cap |= IXGBE_FEATURE_EEE;
 		break;
 	case ixgbe_mac_X550EM_a:
 		/*



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:39:42 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1408):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.214

Apply FreeBSD r353599:
 > ixgbe: Disable EEE for backplane X550EM_X
 >
 > From Zach:
 > Intel documentation indicates that backplane X550EM_X KR devices do not
 > support Energy Efficient Ethernet. Prior to this patch, X552 devices
 > (device ID 0x15AB) will crash the system when transitioning EEE state
 > via sysctl.
 >
 > Signed-off-by: Zach Vargas 
 >
 > PR:  240320
 > Submitted by:Zach Vargas 
 > Reviewed by: erj@
 > MFC after:   3 days
 > Differential Revision:   https://reviews.freebsd.org/D21673


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.35 -r1.88.2.36 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: [netbsd-8] src/sys/dev/pci

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:36:44 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_et.c

Log Message:
Pull up the following revision, requested by msaitoh in ticket #1407:

sys/dev/pci/if_et.c 1.27 via patch

Fix a bug that multicast address filter doesn't work correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.3 -r1.14.8.4 src/sys/dev/pci/if_et.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_et.c
diff -u src/sys/dev/pci/if_et.c:1.14.8.3 src/sys/dev/pci/if_et.c:1.14.8.4
--- src/sys/dev/pci/if_et.c:1.14.8.3	Tue Aug  6 16:10:17 2019
+++ src/sys/dev/pci/if_et.c	Thu Oct 17 18:36:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.14.8.3 2019/08/06 16:10:17 martin Exp $	*/
+/*	$NetBSD: if_et.c,v 1.14.8.4 2019/10/17 18:36:44 martin Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.14.8.3 2019/08/06 16:10:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.14.8.4 2019/10/17 18:36:44 martin Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -1302,7 +1302,6 @@ et_setmulti(struct et_softc *sc)
 	uint32_t rxmac_ctrl, pktfilt;
 	struct ether_multi *enm;
 	struct ether_multistep step;
-	uint8_t addr[ETHER_ADDR_LEN];
 	int i, count;
 
 	pktfilt = CSR_READ_4(sc, ET_PKTFILT);
@@ -1314,19 +1313,12 @@ et_setmulti(struct et_softc *sc)
 		goto back;
 	}
 
-	bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN);
-
 	count = 0;
 	ETHER_FIRST_MULTI(step, ec, enm);
 	while (enm != NULL) {
 		uint32_t *hp, h;
 
-		for (i = 0; i < ETHER_ADDR_LEN; i++) {
-			addr[i] &= enm->enm_addrlo[i];
-		}
-
-		h = ether_crc32_be(LLADDR((struct sockaddr_dl *)addr),
-		ETHER_ADDR_LEN);
+		h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
 		h = (h & 0x3f80) >> 23;
 
 		hp = [0];



CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:36:44 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_et.c

Log Message:
Pull up the following revision, requested by msaitoh in ticket #1407:

sys/dev/pci/if_et.c 1.27 via patch

Fix a bug that multicast address filter doesn't work correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.3 -r1.14.8.4 src/sys/dev/pci/if_et.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:27:36 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_vge.c if_vgereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1406):

sys/dev/pci/if_vgereg.h: revision 1.5
sys/dev/pci/if_vge.c: revision 1.75

Copy vge_clrwol() from FreeBSD and call it in vge_attach() to recover from
powerdown mode. Fixes PR kern/41525 reported by Aran Clauson.


To generate a diff of this commit:
cvs rdiff -u -r1.60.8.2 -r1.60.8.3 src/sys/dev/pci/if_vge.c
cvs rdiff -u -r1.3 -r1.3.134.1 src/sys/dev/pci/if_vgereg.h

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 18:27:36 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_vge.c if_vgereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1406):

sys/dev/pci/if_vgereg.h: revision 1.5
sys/dev/pci/if_vge.c: revision 1.75

Copy vge_clrwol() from FreeBSD and call it in vge_attach() to recover from
powerdown mode. Fixes PR kern/41525 reported by Aran Clauson.


To generate a diff of this commit:
cvs rdiff -u -r1.60.8.2 -r1.60.8.3 src/sys/dev/pci/if_vge.c
cvs rdiff -u -r1.3 -r1.3.134.1 src/sys/dev/pci/if_vgereg.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_vge.c
diff -u src/sys/dev/pci/if_vge.c:1.60.8.2 src/sys/dev/pci/if_vge.c:1.60.8.3
--- src/sys/dev/pci/if_vge.c:1.60.8.2	Mon May 13 12:40:13 2019
+++ src/sys/dev/pci/if_vge.c	Thu Oct 17 18:27:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.60.8.2 2019/05/13 12:40:13 martin Exp $ */
+/* $NetBSD: if_vge.c,v 1.60.8.3 2019/10/17 18:27:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.60.8.2 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.60.8.3 2019/10/17 18:27:36 martin Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -329,6 +329,7 @@ static void vge_miibus_statchg(struct if
 
 static void vge_cam_clear(struct vge_softc *);
 static int vge_cam_set(struct vge_softc *, uint8_t *);
+static void	vge_clrwol(struct vge_softc *);
 static void vge_setmulti(struct vge_softc *);
 static void vge_reset(struct vge_softc *);
 
@@ -999,6 +1000,9 @@ vge_attach(device_t parent, device_t sel
 	aprint_normal_dev(self, "Ethernet address: %s\n",
 	ether_sprintf(eaddr));
 
+	/* Clear WOL and take hardware from powerdown. */
+	vge_clrwol(sc);
+
 	/*
 	 * Use the 32bit tag. Hardware supports 48bit physical addresses,
 	 * but we don't use that for now.
@@ -2202,3 +2206,30 @@ vge_shutdown(device_t self, int howto)
 
 	return true;
 }
+
+static void
+vge_clrwol(struct vge_softc *sc)
+{
+	uint8_t val;
+
+	val = CSR_READ_1(sc, VGE_PWRSTAT);
+	val &= ~VGE_STICKHW_SWPTAG;
+	CSR_WRITE_1(sc, VGE_PWRSTAT, val);
+	/* Disable WOL and clear power state indicator. */
+	val = CSR_READ_1(sc, VGE_PWRSTAT);
+	val &= ~(VGE_STICKHW_DS0 | VGE_STICKHW_DS1);
+	CSR_WRITE_1(sc, VGE_PWRSTAT, val);
+
+	CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII);
+	CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE);
+
+	/* Clear WOL on pattern match. */
+	CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL);
+	/* Disable WOL on magic/unicast packet. */
+	CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F);
+	CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM |
+	VGE_WOLCFG_PMEOVR);
+	/* Clear WOL status on pattern match. */
+	CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF);
+	CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF);
+}

Index: src/sys/dev/pci/if_vgereg.h
diff -u src/sys/dev/pci/if_vgereg.h:1.3 src/sys/dev/pci/if_vgereg.h:1.3.134.1
--- src/sys/dev/pci/if_vgereg.h:1.3	Tue Oct 31 14:13:30 2006
+++ src/sys/dev/pci/if_vgereg.h	Thu Oct 17 18:27:36 2019
@@ -540,6 +540,31 @@
 #define VGE_TXBLOCK_128PKTS	0x08
 #define VGE_TXBLOCK_8PKTS	0x0C
 
+/* Sticky bit shadow register */
+
+#define	VGE_STICKHW_DS0		0x01
+#define	VGE_STICKHW_DS1		0x02
+#define	VGE_STICKHW_WOL_ENB	0x04
+#define	VGE_STICKHW_WOL_STS	0x08
+#define	VGE_STICKHW_SWPTAG	0x10
+
+/* WOL pattern control */
+#define	VGE_WOLCR0_PATTERN0	0x01
+#define	VGE_WOLCR0_PATTERN1	0x02
+#define	VGE_WOLCR0_PATTERN2	0x04
+#define	VGE_WOLCR0_PATTERN3	0x08
+#define	VGE_WOLCR0_PATTERN4	0x10
+#define	VGE_WOLCR0_PATTERN5	0x20
+#define	VGE_WOLCR0_PATTERN6	0x40
+#define	VGE_WOLCR0_PATTERN7	0x80
+#define	VGE_WOLCR0_PATTERN_ALL	0xFF
+
+/* WOL config register */
+#define	VGE_WOLCFG_PHYINT_ENB	0x01
+#define	VGE_WOLCFG_SAB		0x10
+#define	VGE_WOLCFG_SAM		0x20
+#define	VGE_WOLCFG_PMEOVR	0x80
+
 /* EEPROM control/status register */
 
 #define VGE_EECSR_EDO		0x01	/* data out pin */



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct  8 18:16:50 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1403):

sys/dev/pci/ixgbe/ixv.c: revision 1.139

Set MTU correctly if mtu > 1500.


To generate a diff of this commit:
cvs rdiff -u -r1.56.2.25 -r1.56.2.26 src/sys/dev/pci/ixgbe/ixv.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/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.56.2.25 src/sys/dev/pci/ixgbe/ixv.c:1.56.2.26
--- src/sys/dev/pci/ixgbe/ixv.c:1.56.2.25	Thu Sep 26 18:19:26 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Tue Oct  8 18:16:50 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.56.2.25 2019/09/26 18:19:26 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.56.2.26 2019/10/08 18:16:50 martin Exp $*/
 
 /**
 
@@ -736,6 +736,9 @@ ixv_init_locked(struct adapter *adapter)
 	for (i = 0, que = adapter->queues; i < adapter->num_queues; i++, que++)
 		que->disabled_count = 0;
 
+	adapter->max_frame_size =
+	ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+
 	/* reprogram the RAR[0] in case user changed it. */
 	hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
 
@@ -768,10 +771,10 @@ ixv_init_locked(struct adapter *adapter)
 	 * Determine the correct mbuf pool
 	 * for doing jumbo/headersplit
 	 */
-	if (ifp->if_mtu > ETHERMTU)
-		adapter->rx_mbuf_sz = MJUMPAGESIZE;
-	else
+	if (adapter->max_frame_size <= MCLBYTES)
 		adapter->rx_mbuf_sz = MCLBYTES;
+	else
+		adapter->rx_mbuf_sz = MJUMPAGESIZE;
 
 	/* Prepare receive descriptors and buffers */
 	if (ixgbe_setup_receive_structures(adapter)) {



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-10-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct  8 18:16:50 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixv.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1403):

sys/dev/pci/ixgbe/ixv.c: revision 1.139

Set MTU correctly if mtu > 1500.


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

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-09-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 26 18:14:54 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c pcireg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1388:

sys/dev/pci/pcireg.h1.147 via patch
sys/dev/pci/pci_subr.c  1.212, 1.215-1.217 via 
patch

- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard
  Timer Status and Discard Timer SERR# Enable bit in pci_subr.c.
- Print some DPC register values not with %04x but with %08x because
  those are 32bit.
- Remove whitespace for consistency.
- Use macro.
- Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.11 -r1.183.2.12 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.130.2.8 -r1.130.2.9 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.183.2.11 src/sys/dev/pci/pci_subr.c:1.183.2.12
--- src/sys/dev/pci/pci_subr.c:1.183.2.11	Wed Jul 17 15:55:31 2019
+++ src/sys/dev/pci/pci_subr.c	Thu Sep 26 18:14:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.183.2.11 2019/07/17 15:55:31 martin Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.183.2.12 2019/09/26 18:14:54 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.11 2019/07/17 15:55:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.12 2019/09/26 18:14:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -209,7 +209,7 @@ static const struct pci_class pci_subcla
 
 /* PCI bridge programming interface */
 static const struct pci_class pci_interface_pcibridge[] = {
-	{ "",			PCI_INTERFACE_BRIDGE_PCI_PCI, NULL,	},
+	{ "",			PCI_INTERFACE_BRIDGE_PCI_PCI,	NULL,	},
 	{ "subtractive decode",	PCI_INTERFACE_BRIDGE_PCI_SUBDEC, NULL,	},
 	{ NULL,			0,NULL,	},
 };
@@ -223,8 +223,8 @@ static const struct pci_class pci_interf
 
 /* Advanced Switching programming interface */
 static const struct pci_class pci_interface_advsw[] = {
-	{ "custom interface",	PCI_INTERFACE_ADVSW_CUSTOM, NULL, },
-	{ "ASI-SIG",		PCI_INTERFACE_ADVSW_ASISIG, NULL, },
+	{ "custom interface",	PCI_INTERFACE_ADVSW_CUSTOM,	NULL, },
+	{ "ASI-SIG",		PCI_INTERFACE_ADVSW_ASISIG,	NULL, },
 	{ NULL,			0,NULL,	},
 };
 
@@ -304,7 +304,7 @@ static const struct pci_class pci_subcla
 /*
  * Class 0x08.
  * Base system peripheral.
- */ 
+ */
 
 /* PIC programming interface */
 static const struct pci_class pci_interface_pic[] = {
@@ -429,10 +429,10 @@ static const struct pci_class pci_interf
 
 /* IPMI programming interface */
 static const struct pci_class pci_interface_ipmi[] = {
-	{ "SMIC",		PCI_INTERFACE_IPMI_SMIC,		NULL,},
-	{ "keyboard",		PCI_INTERFACE_IPMI_KBD,			NULL,},
-	{ "block transfer",	PCI_INTERFACE_IPMI_BLOCKXFER,		NULL,},
-	{ NULL,			0,	NULL,},
+	{ "SMIC",		PCI_INTERFACE_IPMI_SMIC,	NULL,	},
+	{ "keyboard",		PCI_INTERFACE_IPMI_KBD,		NULL,	},
+	{ "block transfer",	PCI_INTERFACE_IPMI_BLOCKXFER,	NULL,	},
+	{ NULL,			0,NULL,	},
 };
 
 /* Subclasses */
@@ -478,8 +478,8 @@ static const struct pci_class pci_subcla
 
 /* Intelligent IO programming interface */
 static const struct pci_class pci_interface_i2o[] = {
-	{ "FIFO at offset 0x40", PCI_INTERFACE_I2O_FIFOAT40,		NULL,},
-	{ NULL,			0,	NULL,},
+	{ "FIFO at offset 0x40", PCI_INTERFACE_I2O_FIFOAT40,	NULL,	},
+	{ NULL,			0,NULL,	},
 };
 
 /* Subclasses */
@@ -494,9 +494,9 @@ static const struct pci_class pci_subcla
  * Satellite communication controller.
  */
 static const struct pci_class pci_subclass_satcom[] = {
-	{ "TV",			PCI_SUBCLASS_SATCOM_TV,	 	NULL,	},
-	{ "audio",		PCI_SUBCLASS_SATCOM_AUDIO, 	NULL,	},
-	{ "voice",		PCI_SUBCLASS_SATCOM_VOICE, 	NULL,	},
+	{ "TV",			PCI_SUBCLASS_SATCOM_TV,		NULL,	},
+	{ "audio",		PCI_SUBCLASS_SATCOM_AUDIO,	NULL,	},
+	{ "voice",		PCI_SUBCLASS_SATCOM_VOICE,	NULL,	},
 	{ "data",		PCI_SUBCLASS_SATCOM_DATA,	NULL,	},
 	{ "miscellaneous",	PCI_SUBCLASS_SATCOM_MISC,	NULL,	},
 	{ NULL,			0,NULL,	},
@@ -507,9 +507,9 @@ static const struct pci_class pci_subcla
  * Encryption/Decryption controller.
  */
 static const struct pci_class pci_subclass_crypto[] = {
-	{ "network/computing",	PCI_SUBCLASS_CRYPTO_NETCOMP, 	NULL,	},
+	{ "network/computing",	PCI_SUBCLASS_CRYPTO_NETCOMP,	NULL,	},
 	{ "entertainment",	PCI_SUBCLASS_CRYPTO_ENTERTAINMENT, NULL,},
-	{ "miscellaneous",	PCI_SUBCLASS_CRYPTO_MISC, 	NULL,	},
+	{ "miscellaneous",	PCI_SUBCLASS_CRYPTO_MISC,	NULL,	},
 	{ NULL,			0,NULL,	},
 };
 
@@ -585,7 +585,7 @@ DEV_VERBOSE_DEFINE(pci);
  * a positive value if the dest buffer would have overflowed.
  */
 
-static int __printflike(3,4)
+static int __printflike(3, 4)
 snappendf(char **dest, size_t 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-09-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 26 18:14:54 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c pcireg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1388:

sys/dev/pci/pcireg.h1.147 via patch
sys/dev/pci/pci_subr.c  1.212, 1.215-1.217 via 
patch

- Change fast back-to-back "capable" to "enable" in pci_subr.c.
- Print Primary Discard Timer, Secondary Discard Timer, Discard
  Timer Status and Discard Timer SERR# Enable bit in pci_subr.c.
- Print some DPC register values not with %04x but with %08x because
  those are 32bit.
- Remove whitespace for consistency.
- Use macro.
- Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.11 -r1.183.2.12 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.130.2.8 -r1.130.2.9 src/sys/dev/pci/pcireg.h

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-09-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  6 13:44:36 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367:

fix mistake in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.33 -r1.88.2.34 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: [netbsd-8] src/sys/dev/pci/ixgbe

2019-09-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  6 13:44:36 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367:

fix mistake in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.33 -r1.88.2.34 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.88.2.33 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.34
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.33	Thu Sep  5 09:06:07 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Sep  6 13:44:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.33 2019/09/05 09:06:07 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.34 2019/09/06 13:44:36 martin Exp $ */
 
 /**
 
@@ -1397,6 +1397,7 @@ static void
 ixgbe_add_media_types(struct adapter *adapter)
 {
 	struct ixgbe_hw *hw = >hw;
+	device_t	dev = adapter->dev;
 	u64		layer;
 
 	layer = adapter->phy_layer;



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:06:08 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_common.c
ixgbe_netbsd.c ixgbe_x550.c ixv.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367, to pull up the following
revisions:

sys/dev/pci/ixgbe/ixgbe_x550.c  1.16
sys/dev/pci/ixgbe/ixgbe.c   1.180,1.203-1.204,
1.207-1.208 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.55
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.10
sys/dev/pci/ixgbe/ixgbe_common.c1.25
sys/dev/pci/ixgbe/ixv.c 1.129-1.130

- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.
- An interrupt might not arrive when a module is inserted. When an link
  status change interrupt occurred and the driver still regard SFP as
  unplugged, issue the module softint before issuing LSC softint.
- Add 1BASE-LX media if it's 1000BASE-BX.
- printf -> device_printf
- Avoid undefined behavior of VLAN filter setting.
- Simplify code.
- Fix typo in unused code.
- Fix typo in comment. Found by Wataru Ashihara.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.16 -r1.24.2.17 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.32 -r1.88.2.33 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.5.6.6 -r1.5.6.7 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.56.2.23 -r1.56.2.24 src/sys/dev/pci/ixgbe/ixv.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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.16 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.17
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.16	Mon Jul 22 17:53:35 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Sep  5 09:06:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.16 2019/07/22 17:53:35 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.17 2019/09/05 09:06:07 martin Exp $ */
 
 /**
 
@@ -1363,7 +1363,9 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 			error = bus_dmamap_load_mbuf(rxr->ptag->dt_dmat,
 			rxbuf->pmap, mp, BUS_DMA_NOWAIT);
 			if (error != 0) {
-printf("Refresh mbufs: payload dmamap load failure - %d\n", error);
+device_printf(adapter->dev, "Refresh mbufs: "
+"payload dmamap load failure - %d\n",
+error);
 m_free(mp);
 rxbuf->buf = NULL;
 goto update;

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.33
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32	Thu Aug 29 16:31:53 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep  5 09:06:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.32 2019/08/29 16:31:53 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.33 2019/09/05 09:06:07 martin Exp $ */
 
 /**
 
@@ -1397,7 +1397,6 @@ static void
 ixgbe_add_media_types(struct adapter *adapter)
 {
 	struct ixgbe_hw *hw = >hw;
-	device_t	dev = adapter->dev;
 	u64		layer;
 
 	layer = adapter->phy_layer;
@@ -1449,7 +1448,7 @@ ixgbe_add_media_types(struct adapter *ad
 		ADD(IFM_10G_KR | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) {
-		ADD(AIFM_10G_KX4 | IFM_FDX, 0);
+		ADD(IFM_10G_KX4 | IFM_FDX, 0);
 	}
 #else
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) {
@@ -1476,7 +1475,7 @@ ixgbe_add_media_types(struct adapter *ad
 		ADD(IFM_5000_T | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
-		device_printf(dev, "Media supported: 1000baseBX\n");
+		ADD(IFM_1000_LX | IFM_FDX, 0); /* IFM_1000_BX */
 	/* XXX no ifmedia_set? */
 
 	ADD(IFM_AUTO, 0);
@@ -1496,6 +1495,8 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 			return (TRUE);
 		return (FALSE);
 	case ixgbe_mac_82599EB:
+	case ixgbe_mac_X550EM_x:
+	case ixgbe_mac_X550EM_a:
 		switch (hw->mac.ops.get_media_type(hw)) {
 		case ixgbe_media_type_fiber:
 		case ixgbe_media_type_fiber_qsfp:
@@ -1503,11 +1504,6 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 		default:
 			return (FALSE);
 		}
-	case ixgbe_mac_X550EM_x:
-	case ixgbe_mac_X550EM_a:
-		if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
-			return (TRUE);
-		return (FALSE);
 	default:
 		return (FALSE);
 	}
@@ -2542,7 +2538,7 @@ ixgbe_enable_queue(struct adapter *adapt
 {
 	struct ixgbe_hw *hw = >hw;
 	struct ix_queue *que = >queues[vector];
-	u64		queue = (u64)(1ULL << vector);
+	u64		queue = 1ULL << vector;
 	u32		mask;
 
 	mutex_enter(>dc_mtx);
@@ -3077,6 +3073,34 @@ ixgbe_msix_link(void *arg)
 	/* Clear interrupt with write */
 	IXGBE_WRITE_REG(hw, 

CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:06:08 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_common.c
ixgbe_netbsd.c ixgbe_x550.c ixv.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367, to pull up the following
revisions:

sys/dev/pci/ixgbe/ixgbe_x550.c  1.16
sys/dev/pci/ixgbe/ixgbe.c   1.180,1.203-1.204,
1.207-1.208 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.55
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.10
sys/dev/pci/ixgbe/ixgbe_common.c1.25
sys/dev/pci/ixgbe/ixv.c 1.129-1.130

- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.
- An interrupt might not arrive when a module is inserted. When an link
  status change interrupt occurred and the driver still regard SFP as
  unplugged, issue the module softint before issuing LSC softint.
- Add 1BASE-LX media if it's 1000BASE-BX.
- printf -> device_printf
- Avoid undefined behavior of VLAN filter setting.
- Simplify code.
- Fix typo in unused code.
- Fix typo in comment. Found by Wataru Ashihara.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.16 -r1.24.2.17 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.32 -r1.88.2.33 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.5.6.6 -r1.5.6.7 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.56.2.23 -r1.56.2.24 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-08-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 29 16:31:53 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1347):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.205
sys/dev/pci/ixgbe/ixgbe.c: revision 1.206

fix typo in error handling of ixgbe_allocate_legacy().
ok by msaitoh@n.o
pullup-8, pullup-9

 -

Fix panic when ncpu == 1 && sysctl -w hw.ixg0.txrx_workqueue=1. Reported by 
nonaka@n.o.

ok by msaitoh@n.o and nonaka@n.o
pullup-8, pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.31 -r1.88.2.32 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.88.2.31 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.31	Thu Aug  1 14:14:30 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug 29 16:31:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.31 2019/08/01 14:14:30 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.32 2019/08/29 16:31:53 martin Exp $ */
 
 /**
 
@@ -6410,7 +6410,9 @@ ixgbe_allocate_legacy(struct adapter *ad
 	int		counts[PCI_INTR_TYPE_SIZE];
 	pci_intr_type_t intr_type, max_type;
 	char		intrbuf[PCI_INTRSTR_LEN];
+	char		wqname[MAXCOMLEN];
 	const char	*intrstr = NULL;
+	int defertx_error = 0, error;
 
 	/* We allocate a single interrupt resource */
 	max_type = PCI_INTR_TYPE_MSI;
@@ -6472,15 +6474,27 @@ alloc_retry:
 	 * Try allocating a fast interrupt and the associated deferred
 	 * processing contexts.
 	 */
-	if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
+	if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) {
 		txr->txr_si =
 		softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
 			ixgbe_deferred_mq_start, txr);
+
+		snprintf(wqname, sizeof(wqname), "%sdeferTx", device_xname(dev));
+		defertx_error = workqueue_create(>txr_wq, wqname,
+		ixgbe_deferred_mq_start_work, adapter, IXGBE_WORKQUEUE_PRI,
+		IPL_NET, IXGBE_WORKQUEUE_FLAGS);
+		adapter->txr_wq_enqueued = percpu_alloc(sizeof(u_int));
+	}
 	que->que_si = softint_establish(SOFTINT_NET | IXGBE_SOFTINFT_FLAGS,
 	ixgbe_handle_que, que);
+	snprintf(wqname, sizeof(wqname), "%sTxRx", device_xname(dev));
+	error = workqueue_create(>que_wq, wqname,
+	ixgbe_handle_que_work, adapter, IXGBE_WORKQUEUE_PRI, IPL_NET,
+	IXGBE_WORKQUEUE_FLAGS);
 
 	if ((!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)
-		& (txr->txr_si == NULL)) || (que->que_si == NULL)) {
+		&& ((txr->txr_si == NULL) || defertx_error != 0))
+	|| (que->que_si == NULL) || error != 0) {
 		aprint_error_dev(dev,
 		"could not establish software interrupts\n");
 



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-08-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 29 16:31:53 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1347):

sys/dev/pci/ixgbe/ixgbe.c: revision 1.205
sys/dev/pci/ixgbe/ixgbe.c: revision 1.206

fix typo in error handling of ixgbe_allocate_legacy().
ok by msaitoh@n.o
pullup-8, pullup-9

 -

Fix panic when ncpu == 1 && sysctl -w hw.ixg0.txrx_workqueue=1. Reported by 
nonaka@n.o.

ok by msaitoh@n.o and nonaka@n.o
pullup-8, pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.31 -r1.88.2.32 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: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 16:10:17 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_et.c if_etreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1329:

sys/dev/pci/if_etreg.h  1.2-1.3
sys/dev/pci/if_et.c 1.23,1.25 and 1.26
via patch

Make et(4) work:
- Add missing ifioctl_common() for SIOCSIFFLAGS to make if_flags
  controllable.
- Enabling TX/RX in et_init() will always fail when cable is not
  plugged in. If this happens, we delay TX/RX enablement until link is
  up.
- Modify flow control stuff a little. It still doesn't work.
- Avoid undefined behavior when reset the chip.
- Code cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.2 -r1.14.8.3 src/sys/dev/pci/if_et.c
cvs rdiff -u -r1.1 -r1.1.54.1 src/sys/dev/pci/if_etreg.h

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 16:10:17 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_et.c if_etreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1329:

sys/dev/pci/if_etreg.h  1.2-1.3
sys/dev/pci/if_et.c 1.23,1.25 and 1.26
via patch

Make et(4) work:
- Add missing ifioctl_common() for SIOCSIFFLAGS to make if_flags
  controllable.
- Enabling TX/RX in et_init() will always fail when cable is not
  plugged in. If this happens, we delay TX/RX enablement until link is
  up.
- Modify flow control stuff a little. It still doesn't work.
- Avoid undefined behavior when reset the chip.
- Code cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.14.8.2 -r1.14.8.3 src/sys/dev/pci/if_et.c
cvs rdiff -u -r1.1 -r1.1.54.1 src/sys/dev/pci/if_etreg.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_et.c
diff -u src/sys/dev/pci/if_et.c:1.14.8.2 src/sys/dev/pci/if_et.c:1.14.8.3
--- src/sys/dev/pci/if_et.c:1.14.8.2	Mon May 13 12:40:13 2019
+++ src/sys/dev/pci/if_et.c	Tue Aug  6 16:10:17 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: if_et.c,v 1.14.8.2 2019/05/13 12:40:13 martin Exp $	*/
-/*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
+/*	$NetBSD: if_et.c,v 1.14.8.3 2019/08/06 16:10:17 martin Exp $	*/
+/*	$OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
  *
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.14.8.2 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.14.8.3 2019/08/06 16:10:17 martin Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -83,17 +83,19 @@ __KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.
 
 int	et_match(device_t, cfdata_t, void *);
 void	et_attach(device_t, device_t, void *);
-int	et_detach(device_t, int flags);
+int	et_detach(device_t, int);
 int	et_shutdown(device_t);
 
 int	et_miibus_readreg(device_t, int, int);
 void	et_miibus_writereg(device_t, int, int, int);
 void	et_miibus_statchg(struct ifnet *);
 
-int	et_init(struct ifnet *ifp);
+int	et_init(struct ifnet *);
 int	et_ioctl(struct ifnet *, u_long, void *);
 void	et_start(struct ifnet *);
 void	et_watchdog(struct ifnet *);
+static int	et_ifmedia_upd(struct ifnet *);
+static void	et_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
 int	et_intr(void *);
 void	et_enable_intrs(struct et_softc *, uint32_t);
@@ -131,7 +133,6 @@ int	et_start_rxdma(struct et_softc *);
 int	et_start_txdma(struct et_softc *);
 int	et_stop_rxdma(struct et_softc *);
 int	et_stop_txdma(struct et_softc *);
-int	et_enable_txrx(struct et_softc *);
 void	et_reset(struct et_softc *);
 int	et_bus_config(struct et_softc *);
 void	et_get_eaddr(struct et_softc *, uint8_t[]);
@@ -189,6 +190,8 @@ et_attach(device_t parent, device_t self
 	pci_intr_handle_t ih;
 	const char *intrstr;
 	struct ifnet *ifp = >sc_ethercom.ec_if;
+	struct mii_data * const mii = >sc_miibus;
+	uint32_t pmcfg;
 	pcireg_t memtype;
 	int error;
 	char intrbuf[PCI_INTRSTR_LEN];
@@ -232,6 +235,9 @@ et_attach(device_t parent, device_t self
 	sc->sc_pct = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 
+	if (pa->pa_id == PCI_PRODUCT_LUCENT_ET1301)
+		sc->sc_flags |= ET_FLAG_FASTETHER;
+
 	error = et_bus_config(sc);
 	if (error)
 		goto fail;
@@ -241,8 +247,11 @@ et_attach(device_t parent, device_t self
 	aprint_normal_dev(self, "Ethernet address %s\n",
 	ether_sprintf(sc->sc_enaddr));
 
-	CSR_WRITE_4(sc, ET_PM,
-		ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE);
+	/* Take PHY out of COMA and enable clocks. */
+	pmcfg = ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE;
+	if ((sc->sc_flags & ET_FLAG_FASTETHER) == 0)
+		pmcfg |= EM_PM_GIGEPHY_ENB;
+	CSR_WRITE_4(sc, ET_PM, pmcfg);
 
 	et_reset(sc);
 
@@ -265,23 +274,21 @@ et_attach(device_t parent, device_t self
 
 	et_chip_attach(sc);
 
-	sc->sc_miibus.mii_ifp = ifp;
-	sc->sc_miibus.mii_readreg = et_miibus_readreg;
-	sc->sc_miibus.mii_writereg = et_miibus_writereg;
-	sc->sc_miibus.mii_statchg = et_miibus_statchg;
-
-	sc->sc_ethercom.ec_mii = >sc_miibus;
-	ifmedia_init(>sc_miibus.mii_media, 0, ether_mediachange,
-	ether_mediastatus);
-	mii_attach(self, >sc_miibus, 0x, MII_PHY_ANY,
-	MII_OFFSET_ANY, 0);
-	if (LIST_FIRST(>sc_miibus.mii_phys) == NULL) {
+	mii->mii_ifp = ifp;
+	mii->mii_readreg = et_miibus_readreg;
+	mii->mii_writereg = et_miibus_writereg;
+	mii->mii_statchg = et_miibus_statchg;
+
+	sc->sc_ethercom.ec_mii = mii;
+	ifmedia_init(>mii_media, 0, et_ifmedia_upd, et_ifmedia_sts);
+	mii_attach(self, mii, 0x, MII_PHY_ANY, MII_OFFSET_ANY, 0);
+	if (LIST_FIRST(>mii_phys) == NULL) {
 		aprint_error_dev(self, "no PHY found!\n");
-		ifmedia_add(>sc_miibus.mii_media, 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 16:02:54 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c piixpmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1327):

sys/dev/pci/piixpmreg.h: revision 1.8
sys/dev/pci/piixpm.c: revision 1.53
sys/dev/pci/piixpm.c: revision 1.54

Sync with OpenBSD's piixpm.c up to rev. 1.35:
- Print "polling" correctly when in the attach function. Same as OpenBSD
 rev. 1.22-23.
- Improve debug printf()'s. Part of OpenBSD 1.24.
- Do not bus_space_map devices which are at address 0 (it's uninitialized).
  Same as OpenBSD rev. 1.25.
- Add ServerWorks HT1100 device from OpenBSD. Same as OpenBSD rev. 1.32
- Use unique wait channel. From OpenBSD rev. 1.35

Improve SB800 and newer chipsets support:
- Add newer chipset (e.g. X370/X399 and newer) support that the PCI device id
  is 0x790b. The register definitions are mainly taken from FreeBSD.
- Rename PIIXPM_INDIRECTIO_* to SB800_INDIRECTIO_* because those are only
  for SB800 and newer chipsets.
- SB800 also support 4 ports.
- SB800's interrupt configuration bit is different from others.
  Use SB800_SMB_HOSTC's bit 0.
- Do not bus_space_map devices which are at address 0 (it's uninitialized)
  in piixpm_attach().
- Add the port number to the dmesg output.
- Avoid uninitiliazed use of ctl and corresponding warnings. From OpenBSD rev.
  1.38


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.6.1 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.7 -r1.7.22.1 src/sys/dev/pci/piixpmreg.h

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 16:02:54 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c piixpmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1327):

sys/dev/pci/piixpmreg.h: revision 1.8
sys/dev/pci/piixpm.c: revision 1.53
sys/dev/pci/piixpm.c: revision 1.54

Sync with OpenBSD's piixpm.c up to rev. 1.35:
- Print "polling" correctly when in the attach function. Same as OpenBSD
 rev. 1.22-23.
- Improve debug printf()'s. Part of OpenBSD 1.24.
- Do not bus_space_map devices which are at address 0 (it's uninitialized).
  Same as OpenBSD rev. 1.25.
- Add ServerWorks HT1100 device from OpenBSD. Same as OpenBSD rev. 1.32
- Use unique wait channel. From OpenBSD rev. 1.35

Improve SB800 and newer chipsets support:
- Add newer chipset (e.g. X370/X399 and newer) support that the PCI device id
  is 0x790b. The register definitions are mainly taken from FreeBSD.
- Rename PIIXPM_INDIRECTIO_* to SB800_INDIRECTIO_* because those are only
  for SB800 and newer chipsets.
- SB800 also support 4 ports.
- SB800's interrupt configuration bit is different from others.
  Use SB800_SMB_HOSTC's bit 0.
- Do not bus_space_map devices which are at address 0 (it's uninitialized)
  in piixpm_attach().
- Add the port number to the dmesg output.
- Avoid uninitiliazed use of ctl and corresponding warnings. From OpenBSD rev.
  1.38


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.6.1 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.7 -r1.7.22.1 src/sys/dev/pci/piixpmreg.h

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

Modified files:

Index: src/sys/dev/pci/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.52 src/sys/dev/pci/piixpm.c:1.52.6.1
--- src/sys/dev/pci/piixpm.c:1.52	Wed Mar 29 09:04:36 2017
+++ src/sys/dev/pci/piixpm.c	Tue Aug  6 16:02:54 2019
@@ -1,5 +1,5 @@
-/* $NetBSD: piixpm.c,v 1.52 2017/03/29 09:04:36 msaitoh Exp $ */
-/*	$OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $	*/
+/* $NetBSD: piixpm.c,v 1.52.6.1 2019/08/06 16:02:54 martin Exp $ */
+/*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006 Alexander Yurchenko 
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52 2017/03/29 09:04:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52.6.1 2019/08/06 16:02:54 martin Exp $");
 
 #include 
 #include 
@@ -49,12 +49,27 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 #define DPRINTF(x)
 #endif
 
-#define PIIXPM_IS_CSB5(id) \
-	(PCI_VENDOR((id)) == PCI_VENDOR_SERVERWORKS && \
-	PCI_PRODUCT((id)) == PCI_PRODUCT_SERVERWORKS_CSB5)
+#define PIIXPM_IS_CSB5(sc)		  \
+	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
+#define PIIXPM_IS_SB800GRP(sc)		  \
+	((PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_ATI) &&			  \
+	((PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_ATI_SB600_SMB) &&	  \
+		((sc)->sc_rev >= 0x40)))
+
+#define PIIXPM_IS_HUDSON(sc)		  \
+	((PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_AMD) &&			  \
+	(PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_AMD_HUDSON_SMB))
+
+#define PIIXPM_IS_KERNCZ(sc)		  \
+	((PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_AMD) &&			  \
+	(PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_AMD_KERNCZ_SMB))
+
+#define PIIXPM_IS_FCHGRP(sc)	(PIIXPM_IS_HUDSON(sc) || PIIXPM_IS_KERNCZ(sc))
+
 struct piixpm_smbus {
 	int			sda;
 	struct			piixpm_softc *softc;
@@ -75,6 +90,7 @@ struct piixpm_softc {
 	pci_chipset_tag_t	sc_pc;
 	pcitag_t		sc_pcitag;
 	pcireg_t		sc_id;
+	pcireg_t		sc_rev;
 
 	int			sc_numbusses;
 	device_t		sc_i2c_device[4];
@@ -142,12 +158,14 @@ piixpm_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_SERVERWORKS_CSB5:
 		case PCI_PRODUCT_SERVERWORKS_CSB6:
 		case PCI_PRODUCT_SERVERWORKS_HT1000SB:
+		case PCI_PRODUCT_SERVERWORKS_HT1100SB:
 			return 1;
 		}
 		break;
 	case PCI_VENDOR_AMD:
 		switch (PCI_PRODUCT(pa->pa_id)) {
 		case PCI_PRODUCT_AMD_HUDSON_SMB:
+		case PCI_PRODUCT_AMD_KERNCZ_SMB:
 			return 1;
 		}
 		break;
@@ -164,6 +182,7 @@ piixpm_attach(device_t parent, device_t 
 	pcireg_t base, conf;
 	pcireg_t pmmisc;
 	pci_intr_handle_t ih;
+	bool usesmi = false;
 	const char *intrstr = NULL;
 	int i, flags;
 	char intrbuf[PCI_INTRSTR_LEN];
@@ -171,6 +190,7 @@ piixpm_attach(device_t parent, device_t 
 	sc->sc_dev = self;
 	sc->sc_iot = pa->pa_iot;
 	sc->sc_id = pa->pa_id;
+	sc->sc_rev = PCI_REVISION(pa->pa_class);
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 	sc->sc_numbusses = 1;
@@ -180,10 +200,6 @@ piixpm_attach(device_t parent, device_t 
 	if (!pmf_device_register(self, piixpm_suspend, piixpm_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
-	/* Read configuration */
-	conf = pci_conf_read(pa->pa_pc, pa->pa_tag, 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 15:52:52 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen (ticket #1326)


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.15 -r1.1281.2.16 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.15 -r1.1280.2.16 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 15:52:52 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen (ticket #1326)


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.15 -r1.1281.2.16 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.15 -r1.1280.2.16 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: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 15:51:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1326):

sys/dev/pci/pcidevs: revision 1.1381
sys/dev/pci/pcidevs: revision 1.1382
sys/dev/pci/pcidevs: revision 1.1383

- Intel C620 Virtual Switch Port for Termal Sensor is not 0x37c6 but 0x37c7.
- Add Some AMD Ryzen 3xxx's devices.
- Add some AMD devices mainly taken from OpenBSD.
- Rename some device names for consistency.
- Use _HDA for HD Audio.
Add BCM2711 PCIe Host bridge for RPI4


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.15 -r1.1289.2.16 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.1289.2.15 src/sys/dev/pci/pcidevs:1.1289.2.16
--- src/sys/dev/pci/pcidevs:1.1289.2.15	Wed Jul 17 15:27:55 2019
+++ src/sys/dev/pci/pcidevs	Tue Aug  6 15:51:07 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.15 2019/07/17 15:27:55 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.16 2019/08/06 15:51:07 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1009,6 +1009,7 @@ product AMD F17_IOMMU	0x1451	Family17h I
 product AMD F17_PCIE_1	0x1452	Family17h PCIE
 product AMD F17_PCIE_2	0x1453	Family17h PCIE
 product AMD F17_PCIE_3	0x1454	Family17h PCIE
+product AMD F17_CCP_1	0x1456	Family17h Crypto
 product AMD F17_HDA	0x1457	Family17h HD Audio
 product AMD F17_XHCI	0x145c	Family17h xHCI
 product AMD F17_XHCI_2	0x145f	Family17h xHCI
@@ -1022,6 +1023,8 @@ product AMD F17_DF_7	0x1466	Family17h Da
 product AMD F17_DF_8	0x1467	Family17h Data Fabric
 product AMD F17_PCIE_4	0x1470	Family17h PCIE
 product AMD F17_PCIE_5	0x1471	Family17h PCIE
+product AMD F17_7X_RC	0x1480	Family17h/7xh Root Complex
+product AMD F17_7X_IOMMU 0x1481	Family17h/7xh IOMMU
 product AMD F14_RC	0x1510	Family14h Root Complex
 product AMD F16_HT	0x1530	Family16h HyperTransport Configuration
 product AMD F16_ADDR	0x1531	Family16h Address Map Configuration
@@ -1030,7 +1033,7 @@ product AMD F16_NB	0x1533	Family16h Nort
 product AMD F16_CSTATE	0x1534	Family16h CPU C-state Configuration
 product AMD F16_MISC	0x1535	Family16h Miscellaneous Configuration
 product AMD F16_RC	0x1536	Family16h Root Complex
-product AMD CRYPTO_COP	0x1537	Cryptographic Coprocessor
+product AMD F16_CCP	0x1537	Family16h Cryptographic Coprocessor
 product AMD F16_30_RC	0x1566	Family16h Root Complex
 product AMD F16_30_IOMMU	0x1567	Family16h IOMMU
 product AMD F16_HB	0x1568	Family16h Host Bridge
@@ -1108,6 +,13 @@ product AMD HUDSON_PCIE_0	0x43a0	Hudson 
 product AMD HUDSON_PCIE_1	0x43a1	Hudson PCIE Root Port 1
 product AMD HUDSON_PCIE_2	0x43a2	Hudson PCIE Root Port 2
 product AMD HUDSON_PCIE_3	0x43a3	Hudson PCIE Root Port 3
+product AMD 300SERIES_PCIE	0x43b4	300 Series PCIe
+product AMD 300SERIES_SATA	0x43b7	300 Series SATA
+product AMD 300SERIES_XHCI	0x43bb	300 Series xHCI
+product AMD 400SERIES_PCIE_1	0x43c6	400 Series PCIe
+product AMD 400SERIES_PCIE_2	0x43c7	400 Series PCIe
+product AMD 400SERIES_AHCI	0x43c8	400 Series AHCI
+product AMD 400SERIES_XHCI	0x43d0	400 Series xHCI
 product AMD SC751_SC	0x7006	AMD751 System Controller
 product AMD SC751_PPB	0x7007	AMD751 PCI-PCI Bridge
 product AMD IGR4_AGP	0x700a	AMD IGR4 AGP Bridge
@@ -1152,21 +1162,33 @@ product AMD PBC8111_ACPI	0x746b	AMD8111 
 product AMD PBC8111_AC		0x746d	AMD8111 AC97 Audio
 product AMD PBC8111_MC97	0x746e	AMD8111 MC97 Modem
 product AMD PBC8111_AC_756b	0x756b	AMD8111 756b ACPI Controller
-product AMD HUDSON_SATA		0x7800	Hudson SATA Controller
-product AMD HUDSON_SATA_AHCI	0x7801	Hudson AHCI SATA Controller
+product AMD HUDSON_SATA		0x7800	Hudson SATA (IDE) Controller
+product AMD HUDSON_SATA_AHCI	0x7801	Hudson SATA (AHCI) Controller
+product AMD HUDSON_SATA_RAID	0x7802	Hudson SATA (RAID) Controller
+product AMD HUDSON_SATA_RAID5	0x7803	Hudson SATA (RAID5) Controller
+product AMD HUDSON_SATA_AHCI_2	0x7804	Hudson SATA (AMD AHCI) Controller
+product AMD HUDSON_SATA_RAID_2	0x7805	Hudson SATA (RAID) Controller
 product AMD HUDSON_SDHC		0x7806	Hudson SD Flash Controller
 product AMD HUDSON_OHCI		0x7807	Hudson USB OHCI Controller
 product AMD HUDSON_EHCI		0x7808	Hudson USB EHCI Controller
 product AMD HUDSON_OHCI_2	0x7809	Hudson USB OHCI Controller
 product AMD HUDSON_SMB		0x780b	Hudson SMBus Controller
 product AMD HUDSON_IDE		0x780c	Hudson IDE Controller
-product AMD HUDSON_HDAUDIO	0x780d	Hudson HD Audio Controller
+product AMD HUDSON_HDA		0x780d	Hudson HD Audio Controller
 product AMD HUDSON_LPC		0x780e	Hudson LPC Bridge
 product AMD HUDSON_PCI		0x780f	Hudson PCI Bridge
 product AMD HUDSON_XHCI		0x7812	Hudson USB xHCI Controller
 product AMD FCH_SDHC		0x7813	FCH SD Flash Controller
 product AMD FCH_XHCI		0x7814	FCH USB xHCI Controller
+product AMD KERNCZ_SATA_1	0x7900	

CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug  6 15:51:07 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1326):

sys/dev/pci/pcidevs: revision 1.1381
sys/dev/pci/pcidevs: revision 1.1382
sys/dev/pci/pcidevs: revision 1.1383

- Intel C620 Virtual Switch Port for Termal Sensor is not 0x37c6 but 0x37c7.
- Add Some AMD Ryzen 3xxx's devices.
- Add some AMD devices mainly taken from OpenBSD.
- Rename some device names for consistency.
- Use _HDA for HD Audio.
Add BCM2711 PCIe Host bridge for RPI4


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.15 -r1.1289.2.16 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: [netbsd-8] src/sys/dev/pci

2019-08-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  4 10:59:20 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1317):

sys/dev/pci/if_wm.c: revision 1.646
sys/dev/pci/if_wm.c: revision 1.612

Accept IFM_NONE.

 -

Use unsigned to avoid undefined behavior in wm_i82543_mii_sendbits().
Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.34 -r1.508.4.35 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: [netbsd-8] src/sys/dev/pci

2019-08-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  4 10:59:20 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1317):

sys/dev/pci/if_wm.c: revision 1.646
sys/dev/pci/if_wm.c: revision 1.612

Accept IFM_NONE.

 -

Use unsigned to avoid undefined behavior in wm_i82543_mii_sendbits().
Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.34 -r1.508.4.35 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.508.4.34 src/sys/dev/pci/if_wm.c:1.508.4.35
--- src/sys/dev/pci/if_wm.c:1.508.4.34	Thu Aug  1 13:50:13 2019
+++ src/sys/dev/pci/if_wm.c	Sun Aug  4 10:59:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.34 2019/08/01 13:50:13 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.34 2019/08/01 13:50:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10176,6 +10176,9 @@ wm_gmii_mediachange(struct ifnet *ifp)
 		case IFM_1000_T:
 			sc->sc_ctrl |= CTRL_SPEED_1000;
 			break;
+		case IFM_NONE:
+			/* There is no specific setting for IFM_NONE */
+			break;
 		default:
 			panic("wm_gmii_mediachange: bad media 0x%x",
 			ife->ifm_media);
@@ -10219,7 +10222,7 @@ wm_i82543_mii_sendbits(struct wm_softc *
 	v &= ~(MDI_IO | MDI_CLK | (CTRL_SWDPIO_MASK << CTRL_SWDPIO_SHIFT));
 	v |= MDI_DIR | CTRL_SWDPIO(3);
 
-	for (i = 1 << (nbits - 1); i != 0; i >>= 1) {
+	for (i = __BIT(nbits - 1); i != 0; i >>= 1) {
 		if (data & i)
 			v |= MDI_IO;
 		else



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 14:19:37 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: siside.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1314):

sys/dev/pci/siside.c: revision 1.38

add missing break; after "100NEW" configuration.
don't also set "133OLD", since the 100NEW cards don't support 133.


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

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 14:19:37 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: siside.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1314):

sys/dev/pci/siside.c: revision 1.38

add missing break; after "100NEW" configuration.
don't also set "133OLD", since the 100NEW cards don't support 133.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.20.1 src/sys/dev/pci/siside.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/siside.c
diff -u src/sys/dev/pci/siside.c:1.36 src/sys/dev/pci/siside.c:1.36.20.1
--- src/sys/dev/pci/siside.c:1.36	Sat May 31 16:25:29 2014
+++ src/sys/dev/pci/siside.c	Thu Aug  1 14:19:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: siside.c,v 1.36 2014/05/31 16:25:29 christos Exp $	*/
+/*	$NetBSD: siside.c,v 1.36.20.1 2019/08/01 14:19:37 martin Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siside.c,v 1.36 2014/05/31 16:25:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siside.c,v 1.36.20.1 2019/08/01 14:19:37 martin Exp $");
 
 #include 
 #include 
@@ -451,6 +451,7 @@ sis_setup_channel(struct ata_channel *ch
 sis_tim |=
 sis_udma100new_tim[drvp->UDMA_mode] <<
 SIS_TIM100_UDMA_TIME_OFF(drive);
+break;
 			case SIS_TYPE_133OLD:
 sis_tim |=
 sis_udma133old_tim[drvp->UDMA_mode] <<



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 14:14:30 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixgbe_common.c ixgbe_type.h
ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1313:

sys/dev/pci/ixgbe/ixgbe_type.h  1.41
sys/dev/pci/ixgbe/ixgbe.c   1.194,1.197-1.199
via patch
sys/dev/pci/ixgbe/ixgbe_common.c1.24
sys/dev/pci/ixgbe/ixv.c 1.121,1.124-1.125

 - Avoid undefined behavior of interrupt vector setting.
 - Avoid undefined behavior of TX/RX queue statistics calculation.
 - Avoid undefined behavior of X550EM's PHY accesses.
 - Avoid undefined behavior of Flow Control Transmit Timer setting.
 - Don't call {ixgbe,ixv}_stop() twice while detaching.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.30 -r1.88.2.31 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.5 -r1.13.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.22.2.9 -r1.22.2.10 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.56.2.22 -r1.56.2.23 src/sys/dev/pci/ixgbe/ixv.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.88.2.30 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.31
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.30	Mon Jul 22 17:53:35 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Aug  1 14:14:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.30 2019/07/22 17:53:35 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.31 2019/08/01 14:14:30 martin Exp $ */
 
 /**
 
@@ -608,7 +608,7 @@ ixgbe_initialize_receive_units(struct ad
 
 		/* Set RQSMR (Receive Queue Statistic Mapping) register */
 		reg = IXGBE_READ_REG(hw, IXGBE_RQSMR(regnum));
-		reg &= ~(0x00ff << (regshift * 8));
+		reg &= ~(0x00ffUL << (regshift * 8));
 		reg |= i << (regshift * 8);
 		IXGBE_WRITE_REG(hw, IXGBE_RQSMR(regnum), reg);
 
@@ -697,7 +697,7 @@ ixgbe_initialize_transmit_units(struct a
 		else
 			tqsmreg = IXGBE_TQSM(regnum);
 		reg = IXGBE_READ_REG(hw, tqsmreg);
-		reg &= ~(0x00ff << (regshift * 8));
+		reg &= ~(0x00ffUL << (regshift * 8));
 		reg |= i << (regshift * 8);
 		IXGBE_WRITE_REG(hw, tqsmreg, reg);
 
@@ -2572,7 +2572,7 @@ ixgbe_disable_queue_internal(struct adap
 {
 	struct ixgbe_hw *hw = >hw;
 	struct ix_queue *que = >queues[vector];
-	u64		queue = (u64)(1ULL << vector);
+	u64		queue = 1ULL << vector;
 	u32		mask;
 
 	mutex_enter(>dc_mtx);
@@ -3555,8 +3555,13 @@ ixgbe_detach(device_t dev, int flags)
 		return (EBUSY);
 	}
 
-	/* Stop the interface. Callouts are stopped in it. */
-	ixgbe_ifstop(adapter->ifp, 1);
+	/*
+	 * Stop the interface. ixgbe_setup_low_power_mode() calls ixgbe_stop(),
+	 * so it's not required to call ixgbe_stop() directly.
+	 */
+	IXGBE_CORE_LOCK(adapter);
+	ixgbe_setup_low_power_mode(adapter);
+	IXGBE_CORE_UNLOCK(adapter);
 #if NVLAN > 0
 	/* Make sure VLANs are not using driver */
 	if (!VLAN_ATTACHED(>osdep.ec))
@@ -3572,10 +3577,6 @@ ixgbe_detach(device_t dev, int flags)
 	pmf_device_deregister(dev);
 
 	ether_ifdetach(adapter->ifp);
-	/* Stop the adapter */
-	IXGBE_CORE_LOCK(adapter);
-	ixgbe_setup_low_power_mode(adapter);
-	IXGBE_CORE_UNLOCK(adapter);
 
 	ixgbe_free_softint(adapter);
 
@@ -4174,8 +4175,8 @@ ixgbe_set_ivar(struct adapter *adapter, 
 			entry += (type * 64);
 		index = (entry >> 2) & 0x1F;
 		ivar = IXGBE_READ_REG(hw, IXGBE_IVAR(index));
-		ivar &= ~(0xFF << (8 * (entry & 0x3)));
-		ivar |= (vector << (8 * (entry & 0x3)));
+		ivar &= ~(0xffUL << (8 * (entry & 0x3)));
+		ivar |= ((u32)vector << (8 * (entry & 0x3)));
 		IXGBE_WRITE_REG(>hw, IXGBE_IVAR(index), ivar);
 		break;
 	case ixgbe_mac_82599EB:
@@ -4186,14 +4187,14 @@ ixgbe_set_ivar(struct adapter *adapter, 
 		if (type == -1) { /* MISC IVAR */
 			index = (entry & 1) * 8;
 			ivar = IXGBE_READ_REG(hw, IXGBE_IVAR_MISC);
-			ivar &= ~(0xFF << index);
-			ivar |= (vector << index);
+			ivar &= ~(0xffUL << index);
+			ivar |= ((u32)vector << index);
 			IXGBE_WRITE_REG(hw, IXGBE_IVAR_MISC, ivar);
 		} else {	/* RX/TX IVARS */
 			index = (16 * (entry & 1)) + (8 * type);
 			ivar = IXGBE_READ_REG(hw, IXGBE_IVAR(entry >> 1));
-			ivar &= ~(0xFF << index);
-			ivar |= (vector << index);
+			ivar &= ~(0xffUL << index);
+			ivar |= ((u32)vector << index);
 			IXGBE_WRITE_REG(hw, IXGBE_IVAR(entry >> 1), ivar);
 		}
 		break;

Index: src/sys/dev/pci/ixgbe/ixgbe_common.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.5 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.6
--- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.5	Mon Jul 22 17:53:35 2019
+++ src/sys/dev/pci/ixgbe/ixgbe_common.c	Thu Aug  1 14:14:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 

CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 14:14:30 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ixgbe.c ixgbe_common.c ixgbe_type.h
ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1313:

sys/dev/pci/ixgbe/ixgbe_type.h  1.41
sys/dev/pci/ixgbe/ixgbe.c   1.194,1.197-1.199
via patch
sys/dev/pci/ixgbe/ixgbe_common.c1.24
sys/dev/pci/ixgbe/ixv.c 1.121,1.124-1.125

 - Avoid undefined behavior of interrupt vector setting.
 - Avoid undefined behavior of TX/RX queue statistics calculation.
 - Avoid undefined behavior of X550EM's PHY accesses.
 - Avoid undefined behavior of Flow Control Transmit Timer setting.
 - Don't call {ixgbe,ixv}_stop() twice while detaching.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.30 -r1.88.2.31 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.5 -r1.13.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.22.2.9 -r1.22.2.10 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.56.2.22 -r1.56.2.23 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 13:50:14 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1312):

sys/dev/pci/if_wm.c: revision 1.644
sys/dev/pci/if_wm.c: revision 1.645
sys/dev/pci/if_wmreg.h: revision 1.115

 Define RETA_ENTRY_MASK_Q(used in RSS redirection table) correctly.
Found by UBSan.

 Use aprint_debug_dev() instead of printf() in wm_ulp_disable().

- rnd_add_*() call must be serialized. Unserialized accesses broke the
  sc->rnd_source structure and caused off by one in kern_rndq.c's
  rnd_add_data_ts(). This problem was found by kUBSan. Make krndsource_t's
  data per queue-pair and call rnd_add_uint32() in wm_txrxintr_msix(). One of
  the reason why rnd_add_uint32() calls were moved from wm_{tx,rx}eof() is that
  rnd(9) manual page says "To allow the system to gather the timing information
  accurately, this call should be placed within the actual hardware interrupt
  service routine."

- Pass a better value to rnd_add_uint32() in wm_intr_legacy().
XXX pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.33 -r1.508.4.34 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.9 -r1.98.6.10 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: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 13:50:14 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1312):

sys/dev/pci/if_wm.c: revision 1.644
sys/dev/pci/if_wm.c: revision 1.645
sys/dev/pci/if_wmreg.h: revision 1.115

 Define RETA_ENTRY_MASK_Q(used in RSS redirection table) correctly.
Found by UBSan.

 Use aprint_debug_dev() instead of printf() in wm_ulp_disable().

- rnd_add_*() call must be serialized. Unserialized accesses broke the
  sc->rnd_source structure and caused off by one in kern_rndq.c's
  rnd_add_data_ts(). This problem was found by kUBSan. Make krndsource_t's
  data per queue-pair and call rnd_add_uint32() in wm_txrxintr_msix(). One of
  the reason why rnd_add_uint32() calls were moved from wm_{tx,rx}eof() is that
  rnd(9) manual page says "To allow the system to gather the timing information
  accurately, this call should be placed within the actual hardware interrupt
  service routine."

- Pass a better value to rnd_add_uint32() in wm_intr_legacy().
XXX pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.33 -r1.508.4.34 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.9 -r1.98.6.10 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.33 src/sys/dev/pci/if_wm.c:1.508.4.34
--- src/sys/dev/pci/if_wm.c:1.508.4.33	Wed Jul 17 16:12:17 2019
+++ src/sys/dev/pci/if_wm.c	Thu Aug  1 13:50:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.33 2019/07/17 16:12:17 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.34 2019/08/01 13:50:13 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.33 2019/07/17 16:12:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.34 2019/08/01 13:50:13 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -233,7 +233,7 @@ static int wm_watchdog_timeout = WM_WATC
  * packet.  We allocate 256 receive descriptors, each with a 2k
  * buffer (MCLBYTES), which gives us room for 50 jumbo packets.
  */
-#define	WM_NRXDESC		256
+#define	WM_NRXDESC		256U
 #define	WM_NRXDESC_MASK		(WM_NRXDESC - 1)
 #define	WM_NEXTRX(x)		(((x) + 1) & WM_NRXDESC_MASK)
 #define	WM_PREVRX(x)		(((x) - 1) & WM_NRXDESC_MASK)
@@ -457,6 +457,7 @@ struct wm_queue {
 	struct wm_rxqueue wmq_rxq;
 
 	void *wmq_si;
+	krndsource_t rnd_source;	/* random source */
 };
 
 struct wm_phyop {
@@ -584,8 +585,6 @@ struct wm_softc {
 
 	int sc_mchash_type;		/* multicast filter offset */
 
-	krndsource_t rnd_source;	/* random source */
-
 	struct if_percpuq *sc_ipq;	/* softint-based input queues */
 
 	kmutex_t *sc_core_lock;		/* lock for softc operations */
@@ -2930,8 +2929,6 @@ alloc_retry:
 	ether_ifattach(ifp, enaddr);
 	ether_set_ifflags_cb(>sc_ethercom, wm_ifflags_cb);
 	if_register(ifp);
-	rnd_attach_source(>rnd_source, xname, RND_TYPE_NET,
-	RND_FLAG_DEFAULT);
 
 #ifdef WM_EVENT_COUNTERS
 	/* Attach event counters. */
@@ -2986,8 +2983,6 @@ wm_detach(device_t self, int flags __unu
 	evcnt_detach(>sc_ev_rx_macctl);
 #endif /* WM_EVENT_COUNTERS */
 
-	rnd_detach_source(>rnd_source);
-
 	/* Tell the firmware about the release */
 	WM_CORE_LOCK(sc);
 	wm_release_manageability(sc);
@@ -6763,6 +6758,15 @@ wm_alloc_txrx_queues(struct wm_softc *sc
 	if (error)
 		goto fail_2;
 
+	for (i = 0; i < sc->sc_nqueues; i++) {
+		char rndname[16];
+
+		snprintf(rndname, sizeof(rndname), "%sTXRX%d",
+		device_xname(sc->sc_dev), i);
+		rnd_attach_source(>sc_queue[i].rnd_source, rndname,
+		RND_TYPE_NET, RND_FLAG_DEFAULT);
+	}
+
 	return 0;
 
  fail_2:
@@ -6798,6 +6802,9 @@ wm_free_txrx_queues(struct wm_softc *sc)
 {
 	int i;
 
+	for (i = 0; i < sc->sc_nqueues; i++)
+		rnd_detach_source(>sc_queue[i].rnd_source);
+
 	for (i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
 
@@ -8464,9 +8471,6 @@ wm_txeof(struct wm_txqueue *txq, u_int l
 	DPRINTF(WM_DEBUG_TX,
 	("%s: TX: txsdirty -> %d\n", device_xname(sc->sc_dev), i));
 
-	if (count != 0)
-		rnd_add_uint32(>rnd_source, count);
-
 	/*
 	 * If there are no more pending transmissions, cancel the watchdog
 	 * timer.
@@ -8880,9 +8884,6 @@ wm_rxeof(struct wm_rxqueue *rxq, u_int l
 			break;
 	}
 
-	if (count != 0)
-		rnd_add_uint32(>rnd_source, count);
-
 	DPRINTF(WM_DEBUG_RX,
 	("%s: RX: rxptr -> %d\n", device_xname(sc->sc_dev), i));
 
@@ -9228,6 +9229,8 @@ wm_intr_legacy(void *arg)
 		 * So, we can call wm_rxeof() in interrupt context.
 		 */
 		wm_rxeof(rxq, UINT_MAX);
+		/* Fill lower bits with RX index. See below for the upper. */
+		rndval |= rxq->rxq_ptr & WM_NRXDESC_MASK;
 
 		mutex_exit(rxq->rxq_lock);
 		mutex_enter(txq->txq_lock);
@@ -9246,6 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 13:45:55 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: agp_intel.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1311):

sys/dev/pci/agp_intel.c: revision 1.38

fix a >15 year old code rework bug, and add a missing break;.

the code in rev 1.7 looks like it does in this change, but rev 1.8 would
write the I443 AGP_INTEL_AGPCTRL value, and then the other value.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.48.1 src/sys/dev/pci/agp_intel.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/agp_intel.c
diff -u src/sys/dev/pci/agp_intel.c:1.37 src/sys/dev/pci/agp_intel.c:1.37.48.1
--- src/sys/dev/pci/agp_intel.c:1.37	Mon Apr  4 20:37:56 2011
+++ src/sys/dev/pci/agp_intel.c	Thu Aug  1 13:45:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp_intel.c,v 1.37 2011/04/04 20:37:56 dyoung Exp $	*/
+/*	$NetBSD: agp_intel.c,v 1.37.48.1 2019/08/01 13:45:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: agp_intel.c,v 1.37 2011/04/04 20:37:56 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_intel.c,v 1.37.48.1 2019/08/01 13:45:55 martin Exp $");
 
 #include 
 #include 
@@ -209,6 +209,7 @@ agp_intel_init(struct agp_softc *sc)
 	case CHIP_I443:
 		pci_conf_write(sc->as_pc, sc->as_tag, AGP_INTEL_AGPCTRL,
 		AGPCTRL_AGPRSE | AGPCTRL_GTLB);
+		break;
 
 	default:
 		pci_conf_write(sc->as_pc, sc->as_tag, AGP_INTEL_AGPCTRL,



CVS commit: [netbsd-8] src/sys/dev/pci

2019-08-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  1 13:45:55 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: agp_intel.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1311):

sys/dev/pci/agp_intel.c: revision 1.38

fix a >15 year old code rework bug, and add a missing break;.

the code in rev 1.7 looks like it does in this change, but rev 1.8 would
write the I443 AGP_INTEL_AGPCTRL value, and then the other value.


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

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 27 17:11:09 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wpi.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1308):

sys/dev/pci/if_wpi.c: revision 1.86

Put back correct recieve ring allocation size which was lost just over
five years ago mae culpa.

Found by msaitoh@

Should fix PR kern/54320 once pulled up.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 src/sys/dev/pci/if_wpi.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jul 27 17:11:09 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wpi.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1308):

sys/dev/pci/if_wpi.c: revision 1.86

Put back correct recieve ring allocation size which was lost just over
five years ago mae culpa.

Found by msaitoh@

Should fix PR kern/54320 once pulled up.


To generate a diff of this commit:
cvs rdiff -u -r1.78.2.1 -r1.78.2.2 src/sys/dev/pci/if_wpi.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_wpi.c
diff -u src/sys/dev/pci/if_wpi.c:1.78.2.1 src/sys/dev/pci/if_wpi.c:1.78.2.2
--- src/sys/dev/pci/if_wpi.c:1.78.2.1	Sun Dec 10 10:10:24 2017
+++ src/sys/dev/pci/if_wpi.c	Sat Jul 27 17:11:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wpi.c,v 1.78.2.1 2017/12/10 10:10:24 snj Exp $	*/
+/*	$NetBSD: if_wpi.c,v 1.78.2.2 2019/07/27 17:11:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.78.2.1 2017/12/10 10:10:24 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.78.2.2 2019/07/27 17:11:09 martin Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -668,7 +668,7 @@ wpi_alloc_rx_ring(struct wpi_softc *sc, 
 
 	ring->cur = 0;
 
-	size = WPI_RX_RING_COUNT * sizeof (uint32_t);
+	size = WPI_RX_RING_COUNT * sizeof (struct wpi_rx_desc);
 	error = wpi_dma_contig_alloc(sc->sc_dmat, >desc_dma,
 	(void **)>desc, size,
 	WPI_RING_DMA_ALIGN, BUS_DMA_NOWAIT);



CVS commit: [netbsd-8] src/sys/dev/pci/ixgbe

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 17:53:35 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: if_sriov.c ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82599.c ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h
ixgbe_features.h ixgbe_mbx.c ixgbe_mbx.h ixgbe_netbsd.c
ixgbe_netbsd.h ixgbe_netmap.c ixgbe_phy.c ixgbe_type.h ixgbe_vf.c
ixgbe_x550.c ixgbe_x550.h ixv.c

Log Message:
Pull up the following revisions (via patch), requested by msaitoh in
ticket #1301:

sys/dev/pci/ixgbe/if_sriov.c1.5-1.6
sys/dev/pci/ixgbe/ix_txrx.c 1.53-1.54
sys/dev/pci/ixgbe/ixgbe_x550.h  1.5
sys/dev/pci/ixgbe/ixgbe.c   
1.169-1.170,1.176,1.179,1.181,1.185-1.186,1.188-1.192 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.53,1.55
sys/dev/pci/ixgbe/ixgbe_82599.c 1.21
sys/dev/pci/ixgbe/ixgbe_api.c   1.22-1.23
sys/dev/pci/ixgbe/ixgbe_api.h   1.14-1.15
sys/dev/pci/ixgbe/ixgbe_x550.c  1.14-1.15
sys/dev/pci/ixgbe/ixgbe_common.c1.23
sys/dev/pci/ixgbe/ixgbe_common.h1.14
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.11
sys/dev/pci/ixgbe/ixgbe_mbx.h   1.14
sys/dev/pci/ixgbe/ixgbe_netmap.c1.2
sys/dev/pci/ixgbe/ixgbe_features.h  1.2
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.9
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.9-1.10
sys/dev/pci/ixgbe/ixgbe_phy.c   1.18
sys/dev/pci/ixgbe/ixgbe_type.h  1.37,1.39-1.40
sys/dev/pci/ixgbe/ixgbe_vf.c1.18
sys/dev/pci/ixgbe/ixv.c 1.112-1.114,1.117,1.119 
via patch

Sync ixgbe up to 20190717 except ETHERCAP or ixv's VLAN stuff:
- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM(C3000).
- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again.
- On X550EMU, use ixgbe_identify_sfp_module_X550em() instead of
  ixgbe_identify_module_generic(). ixgbe_identify_sfp_module_X550em()
  has extra check (e.g. exclude 1G copper).
- It's not required to calculate unused queues' statistics.
- Remove ETHERCAP_VLAN_HWFILTER's definition.
- Match 82598_BX(0x1508), 82599_KR(0x1517), 82599_SFP_EM(0x1507),
  X550EM_X_XFI(0x15b0), X550EM_A_QSFP(0x15ca) and
  X550EM_A_QSFP_N(0x15cc)
- Add missing XFI support into ixgbe_get_link_capabilities_X550em().
- Other than IXGBE_VF_RESET should wait ACK, so use
  ixgbevf_write_msg_read_ack() instead of write_posted() in
  ixgbe_update_mc_addr_list_vf().
- When ixv_check_link() failed in the watchdog function, reset the
  interface.
- Remove RXCSUM register modification in
  ixv_initialize_receive_units(). It seems it's not required.
- Remove some debug printf in ixv_print_debug_info().
- Calculate vector's bit location correctly when the vector >= 31
  in ixgbe_allocate_msix().
- Fix hung queue check when the queue number >= 31.
- On ENETRESET case, not continue and quit the ifflags_cb() function
  because if_init() will do the same thing.
- Fix bugs in unused code.
- Fix typo in comment.
- Fix typo in unused code.
- Whitespace fixes. KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.1.4.4 -r1.1.4.5 src/sys/dev/pci/ixgbe/if_sriov.c
cvs rdiff -u -r1.24.2.15 -r1.24.2.16 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.29 -r1.88.2.30 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.24.6.16 -r1.24.6.17 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.14.8.4 -r1.14.8.5 src/sys/dev/pci/ixgbe/ixgbe_82599.c
cvs rdiff -u -r1.15.8.4 -r1.15.8.5 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.9.8.3 -r1.9.8.4 src/sys/dev/pci/ixgbe/ixgbe_api.h
cvs rdiff -u -r1.13.2.4 -r1.13.2.5 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.7.8.4 -r1.7.8.5 src/sys/dev/pci/ixgbe/ixgbe_common.h
cvs rdiff -u -r1.1.4.2 -r1.1.4.3 src/sys/dev/pci/ixgbe/ixgbe_features.h \
src/sys/dev/pci/ixgbe/ixgbe_netmap.c
cvs rdiff -u -r1.6.8.2 -r1.6.8.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.c
cvs rdiff -u -r1.10.8.2 -r1.10.8.3 src/sys/dev/pci/ixgbe/ixgbe_mbx.h
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.11.6.3 -r1.11.6.4 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.22.2.8 -r1.22.2.9 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.12.8.2 -r1.12.8.3 src/sys/dev/pci/ixgbe/ixgbe_vf.c
cvs rdiff -u -r1.5.6.5 -r1.5.6.6 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.2.12.2 -r1.2.12.3 src/sys/dev/pci/ixgbe/ixgbe_x550.h
cvs rdiff -u -r1.56.2.21 -r1.56.2.22 src/sys/dev/pci/ixgbe/ixv.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 16:12:17 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions (via patch), requested by msaitoh in
ticket #1298:

sys/dev/pci/if_wm.c 1.633, 1.637-1.641
sys/dev/pci/if_wmreg.h  1.114

- Use unsigned to avoid undefined behavior.
- Print ICH/PCH's NVM version.
- Fix typo in comment. u_int*_t -> uint*_t. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.32 -r1.508.4.33 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.8 -r1.98.6.9 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.32 src/sys/dev/pci/if_wm.c:1.508.4.33
--- src/sys/dev/pci/if_wm.c:1.508.4.32	Tue May 14 11:40:41 2019
+++ src/sys/dev/pci/if_wm.c	Wed Jul 17 16:12:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.32 2019/05/14 11:40:41 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.33 2019/07/17 16:12:17 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.32 2019/05/14 11:40:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.33 2019/07/17 16:12:17 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -389,7 +389,7 @@ struct wm_txqueue {
 	WM_Q_EVCNT_DEFINE(txq, tusum6)	/* TCP/UDP v6 cksums comp. */
 	WM_Q_EVCNT_DEFINE(txq, tso)	/* TCP seg offload (IPv4) */
 	WM_Q_EVCNT_DEFINE(txq, tso6)	/* TCP seg offload (IPv6) */
-	WM_Q_EVCNT_DEFINE(txq, tsopain) /* Painful header manip. for TSO */
+	WM_Q_EVCNT_DEFINE(txq, tsopain)	/* Painful header manip. for TSO */
 	WM_Q_EVCNT_DEFINE(txq, pcqdrop)	/* Pkt dropped in pcq */
 	WM_Q_EVCNT_DEFINE(txq, descdrop)/* Pkt dropped in MAC desc ring */
 	/* other than toomanyseg */
@@ -543,10 +543,10 @@ struct wm_softc {
 
 	int sc_nqueues;
 	struct wm_queue *sc_queue;
-	u_int sc_tx_process_limit;	/* Tx processing repeat limit in softint */
-	u_int sc_tx_intr_process_limit;	/* Tx processing repeat limit in H/W intr */
-	u_int sc_rx_process_limit;	/* Rx processing repeat limit in softint */
-	u_int sc_rx_intr_process_limit;	/* Rx processing repeat limit in H/W intr */
+	u_int sc_tx_process_limit;	/* Tx proc. repeat limit in softint */
+	u_int sc_tx_intr_process_limit;	/* Tx proc. repeat limit in H/W intr */
+	u_int sc_rx_process_limit;	/* Rx proc. repeat limit in softint */
+	u_int sc_rx_intr_process_limit;	/* Rx proc. repeat limit in H/W intr */
 
 	int sc_affinity_offset;
 
@@ -600,9 +600,12 @@ struct wm_softc {
 	struct wm_nvmop nvm;
 };
 
-#define WM_CORE_LOCK(_sc)	if ((_sc)->sc_core_lock) mutex_enter((_sc)->sc_core_lock)
-#define WM_CORE_UNLOCK(_sc)	if ((_sc)->sc_core_lock) mutex_exit((_sc)->sc_core_lock)
-#define WM_CORE_LOCKED(_sc)	(!(_sc)->sc_core_lock || mutex_owned((_sc)->sc_core_lock))
+#define WM_CORE_LOCK(_sc)		\
+	if ((_sc)->sc_core_lock) mutex_enter((_sc)->sc_core_lock)
+#define WM_CORE_UNLOCK(_sc)		\
+	if ((_sc)->sc_core_lock) mutex_exit((_sc)->sc_core_lock)
+#define WM_CORE_LOCKED(_sc)		\
+	(!(_sc)->sc_core_lock || mutex_owned((_sc)->sc_core_lock))
 
 #define	WM_RXCHAIN_RESET(rxq)		\
 do {	\
@@ -638,7 +641,7 @@ do {	\
 #define	CSR_WRITE(sc, reg, val)		\
 	bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (reg), (val))
 #define	CSR_WRITE_FLUSH(sc)		\
-	(void) CSR_READ((sc), WMREG_STATUS)
+	(void)CSR_READ((sc), WMREG_STATUS)
 
 #define ICH8_FLASH_READ32(sc, reg)	\
 	bus_space_read_4((sc)->sc_flasht, (sc)->sc_flashh,		\
@@ -1813,7 +1816,7 @@ wm_attach(device_t parent, device_t self
 	/*
 	 * Disable MSI for Errata:
 	 * "Message Signaled Interrupt Feature May Corrupt Write Transactions"
-	 * 
+	 *
 	 *  82544: Errata 25
 	 *  82540: Errata  6 (easy to reproduce device timeout)
 	 *  82545: Errata  4 (easy to reproduce device timeout)
@@ -1913,7 +1916,7 @@ wm_attach(device_t parent, device_t self
 		preg &= ~PCI_COMMAND_INVALIDATE_ENABLE;
 	pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, preg);
 
-	/* power up chip */
+	/* Power up chip */
 	if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self, NULL))
 	&& error != EOPNOTSUPP) {
 		aprint_error_dev(sc->sc_dev, "cannot activate %d\n", error);
@@ -1973,7 +1976,7 @@ alloc_retry:
 			goto alloc_retry;
 		}
 	} else if (pci_intr_type(pc, sc->sc_intrs[0]) == PCI_INTR_TYPE_MSI) {
-		wm_adjust_qnum(sc, 0);	/* must not use multiqueue */
+		wm_adjust_qnum(sc, 0);	/* Must not use multiqueue */
 		error = wm_setup_legacy(sc);
 		if (error) {
 			pci_intr_release(sc->sc_pc, sc->sc_intrs,
@@ -1985,7 +1988,7 @@ alloc_retry:
 			goto alloc_retry;
 		}
 	} else {
-		wm_adjust_qnum(sc, 0);	/* must not use multiqueue */
+		wm_adjust_qnum(sc, 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 16:12:17 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions (via patch), requested by msaitoh in
ticket #1298:

sys/dev/pci/if_wm.c 1.633, 1.637-1.641
sys/dev/pci/if_wmreg.h  1.114

- Use unsigned to avoid undefined behavior.
- Print ICH/PCH's NVM version.
- Fix typo in comment. u_int*_t -> uint*_t. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.32 -r1.508.4.33 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.8 -r1.98.6.9 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: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:55:31 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c ppb.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1295):

sys/dev/pci/pci_subr.c: revision 1.213
sys/dev/pci/ppb.c: revision 1.69

Identify 16GT/s.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.10 -r1.183.2.11 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.63.2.1 -r1.63.2.2 src/sys/dev/pci/ppb.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/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.183.2.10 src/sys/dev/pci/pci_subr.c:1.183.2.11
--- src/sys/dev/pci/pci_subr.c:1.183.2.10	Wed Jul 17 15:34:31 2019
+++ src/sys/dev/pci/pci_subr.c	Wed Jul 17 15:55:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.183.2.10 2019/07/17 15:34:31 martin Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.183.2.11 2019/07/17 15:55:31 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.10 2019/07/17 15:34:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.11 2019/07/17 15:55:31 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1688,7 +1688,7 @@ pci_print_pcie_compl_timeout(uint32_t va
 	}
 }
 
-static const char * const pcie_linkspeeds[] = {"2.5", "5.0", "8.0"};
+static const char * const pcie_linkspeeds[] = {"2.5", "5.0", "8.0", "16.0"};
 
 /*
  * Print link speed. This function is used for the following register bits:

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.63.2.1 src/sys/dev/pci/ppb.c:1.63.2.2
--- src/sys/dev/pci/ppb.c:1.63.2.1	Fri Feb  1 11:25:13 2019
+++ src/sys/dev/pci/ppb.c	Wed Jul 17 15:55:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.63.2.1 2019/02/01 11:25:13 martin Exp $	*/
+/*	$NetBSD: ppb.c,v 1.63.2.2 2019/07/17 15:55:31 martin Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.63.2.1 2019/02/01 11:25:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.63.2.2 2019/07/17 15:55:31 martin Exp $");
 
 #include 
 #include 
@@ -54,8 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.63
 	(PCIE_SLCSR_ABP | PCIE_SLCSR_PFD | PCIE_SLCSR_MSC |	\
 	 PCIE_SLCSR_PDC | PCIE_SLCSR_CC | PCIE_SLCSR_LACS)
 
-static const char pcie_linkspeed_strings[4][5] = {
-	"1.25", "2.5", "5.0", "8.0",
+static const char pcie_linkspeed_strings[5][5] = {
+	"1.25", "2.5", "5.0", "8.0", "16.0"
 };
 
 int	ppb_printevent = 0; /* Print event type if the value is not 0 */



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:55:31 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c ppb.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1295):

sys/dev/pci/pci_subr.c: revision 1.213
sys/dev/pci/ppb.c: revision 1.69

Identify 16GT/s.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.10 -r1.183.2.11 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.63.2.1 -r1.63.2.2 src/sys/dev/pci/ppb.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:34:31 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1292):

sys/dev/pci/pci_subr.c: revision 1.211
sys/dev/pci/pci_subr.c: revision 1.214

Typo (s/vaule/value/)
Print extend capability from 0x25 to 0x29 correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.9 -r1.183.2.10 src/sys/dev/pci/pci_subr.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/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.183.2.9 src/sys/dev/pci/pci_subr.c:1.183.2.10
--- src/sys/dev/pci/pci_subr.c:1.183.2.9	Tue Dec  4 11:29:41 2018
+++ src/sys/dev/pci/pci_subr.c	Wed Jul 17 15:34:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.183.2.9 2018/12/04 11:29:41 martin Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.183.2.10 2019/07/17 15:34:31 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.9 2018/12/04 11:29:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.183.2.10 2019/07/17 15:34:31 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -3726,7 +3726,7 @@ pci_conf_print_tph_req_cap(const pcireg_
 		printf("Device Specific Mode\n");
 		break;
 	default:
-		printf("(reserved vaule)\n");
+		printf("(reserved value)\n");
 		break;
 	}
 	printf("  TPH Requester Enable: ");
@@ -3741,7 +3741,7 @@ pci_conf_print_tph_req_cap(const pcireg_
 		printf("TPH and Extended TPH");
 		break;
 	default:
-		printf("(reserved vaule)\n");
+		printf("(reserved value)\n");
 		break;
 	}
 
@@ -4240,6 +4240,9 @@ static struct {
 	  NULL },
 	{ PCI_EXTCAP_VF_RESIZBAR, "VF Resizable BARs",
 	  NULL },
+	{ 0x25, "unknown", NULL },
+	{ 0x26, "unknown", NULL },
+	{ 0x27, "unknown", NULL },
 	{ PCI_EXTCAP_HIERARCHYID, "Hierarchy ID",
 	  NULL },
 	{ PCI_EXTCAP_NPEM,	"Native PCIe Enclosure Management",



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:34:31 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pci_subr.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1292):

sys/dev/pci/pci_subr.c: revision 1.211
sys/dev/pci/pci_subr.c: revision 1.214

Typo (s/vaule/value/)
Print extend capability from 0x25 to 0x29 correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.9 -r1.183.2.10 src/sys/dev/pci/pci_subr.c

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



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:30:08 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.14 -r1.1281.2.15 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.14 -r1.1280.2.15 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: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:30:08 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.14 -r1.1281.2.15 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.14 -r1.1280.2.15 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:27:55 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up the foolowing revisions (via patch), requested by msaitoh
in ticket #1291:

sys/dev/pci/pcidevs 1.1367-1.1380

- Add other two Intel Core 8G host bridges.
- Add Intel Xeon E devices.
- Add some new Intel C620 LPC devices.
- Add some Intel Xeon Scalable processor's devices.
- Add some Intel Whisky Lake devices.
- Add Xeon D XFI.
- Add "(Hyper-V)" to Intel 0x15a9's description.
- Add Intel C3000 QSFP devices.
- Add Some Qlogic devices from OpenBSD.
- Rename Qlogic 0x3022's name from ISP3022 to ISP4022.
- Add IDs for SATA controllers VT8237S and VX855
- Modify some descriptions of Virtio devices from OpenBSD to identify
  the functions.
- Add Phison PS5000 and PS5016 NVMe.
- Add some ServerWorks HT1100 devices from OpenBSD.
- Remove extra white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.14 -r1.1289.2.15 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.1289.2.14 src/sys/dev/pci/pcidevs:1.1289.2.15
--- src/sys/dev/pci/pcidevs:1.1289.2.14	Thu Mar  7 17:03:52 2019
+++ src/sys/dev/pci/pcidevs	Wed Jul 17 15:27:55 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.14 2019/03/07 17:03:52 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.15 2019/07/17 15:27:55 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -634,6 +634,7 @@ vendor RENESAS		0x1912	Renesas Technolog
 vendor FREESCALE	0x1957	Freescale Semiconductor
 vendor ATTANSIC		0x1969	Attansic Technologies
 vendor JMICRON		0x197b	JMicron Technology
+vendor PHISON		0x1987	Phison
 vendor SERVERENGINES	0x19a2	ServerEngines
 vendor HUAWEI		0x19e5	Huaewi Technology
 vendor ASPEED		0x1a03	ASPEED Technology
@@ -1291,7 +1292,11 @@ product ASMEDIA ASM1061_12	0x0612	ASM106
 product	ASMEDIA	ASM1042		0x1042	ASM1042 USB 3.0 Host Controller
 product ASMEDIA ASM1083		0x1080	ASM1083/1085 PCIe-PCI Bridge
 product	ASMEDIA	ASM1042A	0x1142	ASM1042A USB 3.0 Host Controller
+product	ASMEDIA	ASM1182		0x1182	ASM1182E PCIE Bridge Controller
+product	ASMEDIA	ASM1184		0x1184	ASM1184E PCIE Bridge Controller
 product ASMEDIA ASM1142		0x1242	ASM1142 USB 3.1 Host Controller
+product ASMEDIA ASM1143		0x1343	ASM1143 USB 3.1 Host Controller
+product ASMEDIA ASM2142		0x2142	ASM2142 USB 3.1 Host Controller
 
 /* Asustek products */
 product ASUSTEK HFCPCI		0x0675	ISDN
@@ -1725,14 +1730,33 @@ product ATI RADEON_HD6320	0x9806	Radeon 
 product ATI RADEON_HD7340	0x9808	Radeon HD7340 Graphics
 product ATI RADEON_HDMI_DP_AUDIO	0x9840	HDMI/DP Audio
 product ATI RADEON_R2_R3_R3E_R4	0x9854	Radeon R2/R3/R4 Graphics
-product ATI RADEON_HD2600_HD	0xaa08	Radeon HD2600 HD Audio Controller
+product ATI RADEON_HD2900_HDA	0xaa00	Radeon HD 2900 HD Audio Controller
+product ATI RADEON_HD3650_HDA	0xaa01	Radeon HD 3650/3730/3750 HD Audio Controller
+product ATI RADEON_HD2600_HDA	0xaa08	Radeon HD 2600 HD Audio Controller
+product ATI RADEON_HD2350_HDA	0xaa10	Radeon HD 2350PRO/2400PRO/2400XT/3410 HD Audio Controller
+product ATI RADEON_HD3690_HDA	0xaa18	Radeon HD 3690/3800 HD Audio Controller
+product ATI RADEON_HD36XX_HDA	0xaa20	Radeon HD 3650/3730/3750 HD Audio Controller
 product ATI RADEON_HD34XX_HDA	0xaa28	Radeon HD 34xx HD Audio Controller
-product ATI RADEON_HD4350_HD	0xaa38	Radeon HD4350 HD Audio Controller
-product ATI RADEON_HD5600_HDMI	0xaa60	Redwood HDMI Audio
-product ATI RADEON_HD54XX_HDA	0xaa68	Radeon HD 54xx Audio
-product ATI RADEON_HD7700_HDA	0xaab0	Radeon HD 7700 HD Audio
-product ATI RADEON_RX460_HDA	0xaae0	Radeon RX460 HD Audio
-product ATI RADEON_RX470_HDA	0xaaf0	Radeon RX470 HD Audio
+product ATI RADEON_HD4850_HDA	0xaa30	Radeon HD 4850 HD Audio Controller
+product ATI RADEON_HD4350_HDA	0xaa38	Radeon HD 4350 HD Audio Controller
+product ATI RADEON_HD5830_HDA	0xaa50	Radeon HD 5830/5850/5870/6850/6870 HD Audio Controller
+product ATI RADEON_HD5700_HDA	0xaa58	Radeon HD 5700 HD Audio Controller
+product ATI RADEON_HD5000_HDA	0xaa60	Radeon HD 5000 HD Audio Controller
+product ATI RADEON_HD68XX_HDA	0xaa68	Radeon HD 5400/6300/7300 HD Audio Controller
+product ATI RADEON_HD6930_HDA	0xaa80	Radeon HD 6930/6950/6970/6990 HD Audio Controller
+product ATI RADEON_HD6790_HDA	0xaa88	Radeon HD 6790/6850/6870/7720 HD Audio Controller
+product ATI RADEON_HD6500_HDA	0xaa90	Radeon HD 6500/6600/6700M HD Audio Controller
+product ATI RADEON_HD6450_HDA	0xaa98	Radeon HD 6450/7450/8450/8490, R5 230/235/235X HD Audio Controller
+product ATI RADEON_HD7870_HDA	0xaaa0	Radeon HD 7870XT/7950/7970 HD Audio Controller
+product ATI RADEON_HD7700_HDA	0xaab0	Radeon HD 7700 HD Audio Controller
+product ATI RADEON_R7_360_HDA	0xaac0	Radeon R7 360, R9 360 HD Audio Controller
+product ATI RADEON_R9_290_HDA	0xaac8	Radeon R9 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 17 15:27:55 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: pcidevs

Log Message:
Pull up the foolowing revisions (via patch), requested by msaitoh
in ticket #1291:

sys/dev/pci/pcidevs 1.1367-1.1380

- Add other two Intel Core 8G host bridges.
- Add Intel Xeon E devices.
- Add some new Intel C620 LPC devices.
- Add some Intel Xeon Scalable processor's devices.
- Add some Intel Whisky Lake devices.
- Add Xeon D XFI.
- Add "(Hyper-V)" to Intel 0x15a9's description.
- Add Intel C3000 QSFP devices.
- Add Some Qlogic devices from OpenBSD.
- Rename Qlogic 0x3022's name from ISP3022 to ISP4022.
- Add IDs for SATA controllers VT8237S and VX855
- Modify some descriptions of Virtio devices from OpenBSD to identify
  the functions.
- Add Phison PS5000 and PS5016 NVMe.
- Add some ServerWorks HT1100 devices from OpenBSD.
- Remove extra white spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.1289.2.14 -r1.1289.2.15 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: [netbsd-8] src/sys/dev/pci

2019-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 15 08:23:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: vioscsi.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1289):

sys/dev/pci/vioscsi.c: revision 1.21

Fix use-after-free. If we're not polling, virtio_enqueue_commit() will send
the transaction, and it means 'xs' can be immediately freed. So, save the
value of xs_control beforehand.

Detected by KASAN, ok jdolecek@.
Fixes PR/54008


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.2.1 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.19 src/sys/dev/pci/vioscsi.c:1.19.2.1
--- src/sys/dev/pci/vioscsi.c:1.19	Mon May 15 21:30:37 2017
+++ src/sys/dev/pci/vioscsi.c	Mon Jul 15 08:23:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vioscsi.c,v 1.19 2017/05/15 21:30:37 jdolecek Exp $	*/
+/*	$NetBSD: vioscsi.c,v 1.19.2.1 2019/07/15 08:23:23 martin 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.19 2017/05/15 21:30:37 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.19.2.1 2019/07/15 08:23:23 martin Exp $");
 
 #include 
 #include 
@@ -274,6 +274,7 @@ vioscsi_scsipi_request(struct scsipi_cha
 	struct virtio_scsi_req_hdr *req;
 	struct virtqueue *vq = >sc_vqs[VIOSCSI_VQ_REQUEST];
 	int slot, error;
+	bool dopoll;
 
 	DPRINTF(("%s: enter\n", __func__));
 
@@ -422,9 +423,10 @@ stuffup:
 sizeof(struct virtio_scsi_res_hdr), 0);
 	if (xs->xs_control & XS_CTL_DATA_IN)
 		virtio_enqueue(vsc, vq, slot, vr->vr_data, 0);
+	dopoll = (xs->xs_control & XS_CTL_POLL) != 0;
 	virtio_enqueue_commit(vsc, vq, slot, 1);
 
-	if ((xs->xs_control & XS_CTL_POLL) == 0)
+	if (!dopoll)
 		return;
 
 	DPRINTF(("%s: polling...\n", __func__));



CVS commit: [netbsd-8] src/sys/dev/pci

2019-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 15 08:23:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: vioscsi.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1289):

sys/dev/pci/vioscsi.c: revision 1.21

Fix use-after-free. If we're not polling, virtio_enqueue_commit() will send
the transaction, and it means 'xs' can be immediately freed. So, save the
value of xs_control beforehand.

Detected by KASAN, ok jdolecek@.
Fixes PR/54008


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.2.1 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: [netbsd-8] src/sys/dev/pci

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:43:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_alc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1268):

sys/dev/pci/if_alc.c: revision 1.33
sys/dev/pci/if_alc.c: revision 1.34

 Fix a wrong and extra ether_ioctl() call in alc_ioctl(). _IOWR types call
broke ifreq by the first ether_ioct() and the second ether_ioctl() caused
unexpected behavior. One of bug example is that SIOCGIFMEDIA always failed.

This bug was added in if_alc.c rev. 1.16.
XXX pullup-8

 -

 Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make behavior
the same as before.

XXX need cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.2 -r1.24.8.3 src/sys/dev/pci/if_alc.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_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.24.8.2 src/sys/dev/pci/if_alc.c:1.24.8.3
--- src/sys/dev/pci/if_alc.c:1.24.8.2	Thu Jul 26 23:55:30 2018
+++ src/sys/dev/pci/if_alc.c	Tue May 14 11:43:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.24.8.2 2018/07/26 23:55:30 snj Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.24.8.3 2019/05/14 11:43:23 martin Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -2036,15 +2036,16 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
 
 	s = splnet();
 
-	error = ether_ioctl(ifp, cmd, data);
 	switch (cmd) {
 	case SIOCSIFADDR:
+		error = ether_ioctl(ifp, cmd, data);
 		ifp->if_flags |= IFF_UP;
 		if (!(ifp->if_flags & IFF_RUNNING))
 			alc_init(ifp);
 		break;
- 
+
 	case SIOCSIFFLAGS:
+		error = ether_ioctl(ifp, cmd, data);
 		if (ifp->if_flags & IFF_UP) {
 			if (ifp->if_flags & IFF_RUNNING)
 error = ENETRESET;
@@ -2060,7 +2061,7 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCGIFMEDIA:
 		error = ifmedia_ioctl(ifp, ifr, >mii_media, cmd);
 		break;
- 
+
 	default:
 		error = ether_ioctl(ifp, cmd, data);
 		break;



CVS commit: [netbsd-8] src/sys/dev/pci

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:43:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_alc.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1268):

sys/dev/pci/if_alc.c: revision 1.33
sys/dev/pci/if_alc.c: revision 1.34

 Fix a wrong and extra ether_ioctl() call in alc_ioctl(). _IOWR types call
broke ifreq by the first ether_ioct() and the second ether_ioctl() caused
unexpected behavior. One of bug example is that SIOCGIFMEDIA always failed.

This bug was added in if_alc.c rev. 1.16.
XXX pullup-8

 -

 Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make behavior
the same as before.

XXX need cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.2 -r1.24.8.3 src/sys/dev/pci/if_alc.c

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