CVS commit: src/usr.sbin/acpitools/acpidump

2017-09-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 27 05:43:55 UTC 2017

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
- Print SAPIC EID of Processor Local APIC/SAPIC Affinity.
- Print GIC Interrupt Translation Service(ITS) Affinity (ACPI 6.2)
- KNF
- Whilte space cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/acpitools/acpidump/acpi.c

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

Modified files:

Index: src/usr.sbin/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.26 src/usr.sbin/acpitools/acpidump/acpi.c:1.27
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.26	Thu Sep  7 04:40:56 2017
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Wed Sep 27 05:43:55 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.26 2017/09/07 04:40:56 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.27 2017/09/27 05:43:55 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.26 2017/09/07 04:40:56 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.27 2017/09/27 05:43:55 msaitoh Exp $");
 
 #include 
 #include 
@@ -95,9 +95,9 @@ static void	acpi_handle_sbst(ACPI_TABLE_
 static void	acpi_handle_slit(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_spcr(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_spmi(ACPI_TABLE_HEADER *sdp);
-static void	acpi_print_srat_cpu(uint32_t apic_id,
+static void	acpi_print_srat_cpu(uint8_t type, uint32_t apic_id,
 		uint32_t proximity_domain,
-		uint32_t flags, uint32_t clockdomain);
+		uint32_t flags, uint32_t clockdomain, uint8_t sapic_eid);
 static void	acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp);
 static void	acpi_print_srat(ACPI_SUBTABLE_HEADER *srat);
 static void	acpi_handle_srat(ACPI_TABLE_HEADER *sdp);
@@ -210,7 +210,7 @@ acpi_print_string(char *s, size_t length
 static void
 acpi_print_gas(ACPI_GENERIC_ADDRESS *gas)
 {
-	switch(gas->SpaceId) {
+	switch (gas->SpaceId) {
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
 		if (gas->BitWidth <= 32)
 			printf("0x%08x:%u[%u] (Memory)",
@@ -1984,8 +1984,8 @@ acpi_handle_spmi(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
-acpi_print_srat_cpu(uint32_t apic_id, uint32_t proximity_domain,
-uint32_t flags, uint32_t clockdomain)
+acpi_print_srat_cpu(uint8_t type, uint32_t apic_id, uint32_t proximity_domain,
+uint32_t flags, uint32_t clockdomain, uint8_t sapic_eid)
 {
 
 	printf("\tFlags={");
@@ -1994,9 +1994,14 @@ acpi_print_srat_cpu(uint32_t apic_id, ui
 	else
 		printf("DISABLED");
 	printf("}\n");
-	printf("\tAPIC ID=%d\n", apic_id);
+	printf("\t%s ID=%d\n",
+	(type == ACPI_SRAT_TYPE_GIC_ITS_AFFINITY) ? "ITS" : "APIC",
+	apic_id);
+	if (type == ACPI_SRAT_TYPE_CPU_AFFINITY)
+		printf("\tSAPIC EID=%d\n", sapic_eid);
 	printf("\tProximity Domain=%d\n", proximity_domain);
-	printf("\tClock Domain=%d\n", clockdomain);
+	if (type != ACPI_SRAT_TYPE_GIC_ITS_AFFINITY)
+		printf("\tClock Domain=%d\n", clockdomain);
 }
 
 static void
@@ -2023,6 +2028,7 @@ static const char *srat_types[] = {
 [ACPI_SRAT_TYPE_MEMORY_AFFINITY] = "Memory",
 [ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY] = "X2APIC",
 [ACPI_SRAT_TYPE_GICC_AFFINITY] = "GICC",
+[ACPI_SRAT_TYPE_GIC_ITS_AFFINITY] = "GIC ITS",
 };
 
 static void
@@ -2030,7 +2036,8 @@ acpi_print_srat(ACPI_SUBTABLE_HEADER *sr
 {
 	ACPI_SRAT_CPU_AFFINITY *cpu;
 	ACPI_SRAT_X2APIC_CPU_AFFINITY *x2apic;
-	ACPI_SRAT_GICC_AFFINITY *gic;
+	ACPI_SRAT_GICC_AFFINITY *gicc;
+	ACPI_SRAT_GIC_ITS_AFFINITY *gici;
 
 	if (srat->Type < __arraycount(srat_types))
 		printf("\tType=%s\n", srat_types[srat->Type]);
@@ -2039,25 +2046,33 @@ acpi_print_srat(ACPI_SUBTABLE_HEADER *sr
 	switch (srat->Type) {
 	case ACPI_SRAT_TYPE_CPU_AFFINITY:
 		cpu = (ACPI_SRAT_CPU_AFFINITY *)srat;
-		acpi_print_srat_cpu(cpu->ApicId,
+		acpi_print_srat_cpu(srat->Type, cpu->ApicId,
 		cpu->ProximityDomainHi[2] << 24 |
 		cpu->ProximityDomainHi[1] << 16 |
 		cpu->ProximityDomainHi[0] << 0 |
 		cpu->ProximityDomainLo,
-		cpu->Flags, cpu->ClockDomain);
+		cpu->Flags, cpu->ClockDomain, cpu->LocalSapicEid);
 		break;
 	case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
 		acpi_print_srat_memory((ACPI_SRAT_MEM_AFFINITY *)srat);
 		break;
 	case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
 		x2apic = (ACPI_SRAT_X2APIC_CPU_AFFINITY *)srat;
-		acpi_print_srat_cpu(x2apic->ApicId, x2apic->ProximityDomain,
-		x2apic->Flags, x2apic->ClockDomain);
+		acpi_print_srat_cpu(srat->Type, x2apic->ApicId,
+		x2apic->ProximityDomain,
+		x2apic->Flags, x2apic->ClockDomain, 0 /* dummy */);
 		break;
 	case ACPI_SRAT_TYPE_GICC_AFFINITY:
-		gic = (ACPI_SRAT_GICC_AFFINITY *)srat;
-		acpi_print_srat_cpu(gic->AcpiProcessorUid, gic->ProximityDomain,
-		gic->Flags, gic->ClockDomain);
+		gicc = (ACPI_SRAT_GICC_AFFINITY *)srat;
+		acpi_print_srat_cpu(srat->Type, gicc->AcpiProcessorUid,
+		gicc->ProximityDomain,
+		gicc->Flags, gi

CVS commit: [jdolecek-ncq] src/sys/arch

2017-09-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Sep 26 22:13:08 UTC 2017

Modified Files:
src/sys/arch/acorn32/mainbus [jdolecek-ncq]: wdc_pioc.c
src/sys/arch/amiga/dev [jdolecek-ncq]: wdc_amiga.c
src/sys/arch/landisk/dev [jdolecek-ncq]: wdc_obio.c
src/sys/arch/mac68k/obio [jdolecek-ncq]: wdc_obio.c
src/sys/arch/prep/pnpbus [jdolecek-ncq]: wdc_pnpbus.c

Log Message:
switch to ata_queue_alloc() so that this at least compiles


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.28.1 src/sys/arch/acorn32/mainbus/wdc_pioc.c
cvs rdiff -u -r1.38 -r1.38.6.1 src/sys/arch/amiga/dev/wdc_amiga.c
cvs rdiff -u -r1.8 -r1.8.28.1 src/sys/arch/landisk/dev/wdc_obio.c
cvs rdiff -u -r1.27 -r1.27.18.1 src/sys/arch/mac68k/obio/wdc_obio.c
cvs rdiff -u -r1.13 -r1.13.28.1 src/sys/arch/prep/pnpbus/wdc_pnpbus.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/arch/acorn32/mainbus/wdc_pioc.c
diff -u src/sys/arch/acorn32/mainbus/wdc_pioc.c:1.28 src/sys/arch/acorn32/mainbus/wdc_pioc.c:1.28.28.1
--- src/sys/arch/acorn32/mainbus/wdc_pioc.c:1.28	Tue Jul 31 15:50:31 2012
+++ src/sys/arch/acorn32/mainbus/wdc_pioc.c	Tue Sep 26 22:13:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_pioc.c,v 1.28 2012/07/31 15:50:31 bouyer Exp $	*/
+/*	$NetBSD: wdc_pioc.c,v 1.28.28.1 2017/09/26 22:13:08 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.28 2012/07/31 15:50:31 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.28.28.1 2017/09/26 22:13:08 jdolecek Exp $");
 
 #include 
 #include 
@@ -60,7 +60,6 @@ struct wdc_pioc_softc {
 	struct	wdc_softc sc_wdcdev;
 	struct	ata_channel *sc_chanlist[1];
 	struct	ata_channel sc_channel;
-	struct	ata_queue sc_chqueue;
 	struct	wdc_regs sc_wdc_regs;
 	void	*sc_ih;
 };
@@ -187,7 +186,7 @@ wdc_pioc_attach(device_t parent, device_
 	sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
 	sc->sc_wdcdev.wdc_maxdrives = 2;
 	sc->sc_channel.ch_channel = 0;
-	sc->sc_channel.ch_queue = &sc->sc_chqueue;
+	sc->sc_channel.ch_queue = ata_queue_alloc(1);
 
 	wdc_init_shadow_regs(&sc->sc_channel);
 

Index: src/sys/arch/amiga/dev/wdc_amiga.c
diff -u src/sys/arch/amiga/dev/wdc_amiga.c:1.38 src/sys/arch/amiga/dev/wdc_amiga.c:1.38.6.1
--- src/sys/arch/amiga/dev/wdc_amiga.c:1.38	Sat Apr 18 14:21:41 2015
+++ src/sys/arch/amiga/dev/wdc_amiga.c	Tue Sep 26 22:13:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_amiga.c,v 1.38 2015/04/18 14:21:41 mlelstv Exp $ */
+/*	$NetBSD: wdc_amiga.c,v 1.38.6.1 2017/09/26 22:13:08 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.38 2015/04/18 14:21:41 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.38.6.1 2017/09/26 22:13:08 jdolecek Exp $");
 
 #include 
 #include 
@@ -56,7 +56,6 @@ struct wdc_amiga_softc {
 	struct wdc_softc sc_wdcdev;
 	struct	ata_channel *sc_chanlist[1];
 	struct  ata_channel sc_channel;
-	struct	ata_queue sc_chqueue;
 	struct wdc_regs sc_wdc_regs;
 	struct isr sc_isr;
 	struct bus_space_tag cmd_iot;
@@ -136,7 +135,7 @@ wdc_amiga_attach(device_t parent, device
 	sc->sc_wdcdev.wdc_maxdrives = 2;
 	sc->sc_channel.ch_channel = 0;
 	sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-	sc->sc_channel.ch_queue = &sc->sc_chqueue;
+	sc->sc_channel.ch_queue = ata_queue_alloc(1);
 
 	wdc_init_shadow_regs(&sc->sc_channel);
 

Index: src/sys/arch/landisk/dev/wdc_obio.c
diff -u src/sys/arch/landisk/dev/wdc_obio.c:1.8 src/sys/arch/landisk/dev/wdc_obio.c:1.8.28.1
--- src/sys/arch/landisk/dev/wdc_obio.c:1.8	Tue Jul 31 15:50:32 2012
+++ src/sys/arch/landisk/dev/wdc_obio.c	Tue Sep 26 22:13:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_obio.c,v 1.8 2012/07/31 15:50:32 bouyer Exp $	*/
+/*	$NetBSD: wdc_obio.c,v 1.8.28.1 2017/09/26 22:13:08 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.8 2012/07/31 15:50:32 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.8.28.1 2017/09/26 22:13:08 jdolecek Exp $");
 
 #include 
 #include 
@@ -50,7 +50,6 @@ struct wdc_obio_softc {
 	struct	wdc_softc sc_wdcdev;
 	struct	ata_channel *sc_chanlist[1];
 	struct	ata_channel sc_channel;
-	struct	ata_queue sc_chqueue;
 	struct	wdc_regs sc_wdc_regs;
 	void	*sc_ih;
 };
@@ -174,7 +173,7 @@ wdc_obio_attach(device_t parent, device_
 	sc->sc_wdcdev.wdc_maxdrives = 2;
 	sc->sc_channel.ch_channel = 0;
 	sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-	sc->sc_channel.ch_queue = &sc->sc_chqueue;
+	sc->sc_channel.ch_queue = ata_queue_alloc(1);
 
 	wdc_init_shadow_regs(&sc->sc_channel);
 

Index: src/sys/arch/mac68k/obio/wdc_obio.c
diff -u src/sys/arch/mac68k/obio/wdc_obio.c:1.27 src/sys/arch/mac68k/obio/wdc_obio.c:1.27.18.1
--- src/sys/arch/mac68k/obio/w

CVS commit: [jdolecek-ncq] src/sys/arch/amiga/dev

2017-09-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Sep 26 21:06:24 UTC 2017

Modified Files:
src/sys/arch/amiga/dev [jdolecek-ncq]: wdc_xsurf.c

Log Message:
need  for DEV_BSIZE needed by atavar.h


To generate a diff of this commit:
cvs rdiff -u -r1.2.30.1 -r1.2.30.2 src/sys/arch/amiga/dev/wdc_xsurf.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/arch/amiga/dev/wdc_xsurf.c
diff -u src/sys/arch/amiga/dev/wdc_xsurf.c:1.2.30.1 src/sys/arch/amiga/dev/wdc_xsurf.c:1.2.30.2
--- src/sys/arch/amiga/dev/wdc_xsurf.c:1.2.30.1	Mon Apr 24 08:48:45 2017
+++ src/sys/arch/amiga/dev/wdc_xsurf.c	Tue Sep 26 21:06:24 2017
@@ -1,4 +1,4 @@
-/*  $NetBSD: wdc_xsurf.c,v 1.2.30.1 2017/04/24 08:48:45 jdolecek Exp $ */
+/*  $NetBSD: wdc_xsurf.c,v 1.2.30.2 2017/09/26 21:06:24 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-09-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Sep 26 20:15:36 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata_wdc.c atavar.h

Log Message:
make compile without NATA_DMA


To generate a diff of this commit:
cvs rdiff -u -r1.105.6.10 -r1.105.6.11 src/sys/dev/ata/ata_wdc.c
cvs rdiff -u -r1.92.8.26 -r1.92.8.27 src/sys/dev/ata/atavar.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/ata/ata_wdc.c
diff -u src/sys/dev/ata/ata_wdc.c:1.105.6.10 src/sys/dev/ata/ata_wdc.c:1.105.6.11
--- src/sys/dev/ata/ata_wdc.c:1.105.6.10	Thu Sep 21 18:47:21 2017
+++ src/sys/dev/ata/ata_wdc.c	Tue Sep 26 20:15:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_wdc.c,v 1.105.6.10 2017/09/21 18:47:21 jdolecek Exp $	*/
+/*	$NetBSD: ata_wdc.c,v 1.105.6.11 2017/09/26 20:15:36 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.105.6.10 2017/09/21 18:47:21 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.105.6.11 2017/09/26 20:15:36 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -340,9 +340,9 @@ _wdc_ata_bio_start(struct ata_channel *c
 	int wait_flags = (xfer->c_flags & C_POLL) ? AT_POLL : 0;
 	uint16_t cyl;
 	uint8_t head, sect, cmd = 0;
-	int nblks;
+	int nblks, tfd;
 #if NATA_DMA || NATA_PIOBM
-	int error, dma_flags = 0, tfd;
+	int error, dma_flags = 0;
 #endif
 
 	ATADEBUG_PRINT(("_wdc_ata_bio_start %s:%d:%d\n",

Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.92.8.26 src/sys/dev/ata/atavar.h:1.92.8.27
--- src/sys/dev/ata/atavar.h:1.92.8.26	Tue Sep 19 21:06:25 2017
+++ src/sys/dev/ata/atavar.h	Tue Sep 26 20:15:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: atavar.h,v 1.92.8.26 2017/09/19 21:06:25 jdolecek Exp $	*/
+/*	$NetBSD: atavar.h,v 1.92.8.27 2017/09/26 20:15:36 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -304,9 +304,9 @@ struct ata_drive_datas {
 #define RESET  0
 #define READY  1
 
-#if NATA_DMA
 	uint8_t drv_openings;		/* # of command tags */
 
+#if NATA_DMA
 	/* numbers of xfers and DMA errs. Used by ata_dmaerr() */
 	uint8_t n_dmaerrs;
 	uint32_t n_xfers;



CVS commit: src/lib/libm

2017-09-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Sep 26 18:03:30 UTC 2017

Modified Files:
src/lib/libm: shlib_version

Log Message:
Mention wanting to remove isnanf too, reword


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libm/shlib_version

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

Modified files:

Index: src/lib/libm/shlib_version
diff -u src/lib/libm/shlib_version:1.16 src/lib/libm/shlib_version:1.17
--- src/lib/libm/shlib_version:1.16	Sat May 13 13:17:11 2017
+++ src/lib/libm/shlib_version	Tue Sep 26 18:03:30 2017
@@ -1,8 +1,8 @@
-#	$NetBSD: shlib_version,v 1.16 2017/05/13 13:17:11 maya Exp $
+#	$NetBSD: shlib_version,v 1.17 2017/09/26 18:03:30 maya Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
 # - remove compatibility cabs
-# - hide isinff
+# - not provide isinff / isnanf (only provide __isinff version)
 major=0
 minor=12



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-09-26 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Sep 26 17:05:37 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: mvsata.c

Log Message:
make compile without MVSATA_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.35.6.29 -r1.35.6.30 src/sys/dev/ic/mvsata.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/ic/mvsata.c
diff -u src/sys/dev/ic/mvsata.c:1.35.6.29 src/sys/dev/ic/mvsata.c:1.35.6.30
--- src/sys/dev/ic/mvsata.c:1.35.6.29	Mon Sep 25 22:50:20 2017
+++ src/sys/dev/ic/mvsata.c	Tue Sep 26 17:05:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata.c,v 1.35.6.29 2017/09/25 22:50:20 jdolecek Exp $	*/
+/*	$NetBSD: mvsata.c,v 1.35.6.30 2017/09/26 17:05:37 jdolecek Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.6.29 2017/09/25 22:50:20 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata.c,v 1.35.6.30 2017/09/26 17:05:37 jdolecek Exp $");
 
 #include "opt_mvsata.h"
 
@@ -1673,7 +1673,6 @@ static int
 mvsata_exec_command(struct ata_drive_datas *drvp, struct ata_xfer *xfer)
 {
 	struct ata_channel *chp = drvp->chnl_softc;
-	struct mvsata_port *mvport = (struct mvsata_port *)chp;
 	struct ata_command *ata_c = &xfer->c_ata_c;
 	int rv, s;
 
@@ -1681,7 +1680,8 @@ mvsata_exec_command(struct ata_drive_dat
 	("%s:%d: mvsata_exec_command: drive=%d, bcount=%d,"
 	" r_lba=0x%012"PRIx64", r_count=0x%04x, r_features=0x%04x,"
 	" r_device=0x%02x, r_command=0x%02x\n",
-	device_xname(MVSATA_DEV2(mvport)), chp->ch_channel,
+	device_xname(MVSATA_DEV2((struct mvsata_port *)chp)),
+	chp->ch_channel,
 	drvp->drive, ata_c->bcount, ata_c->r_lba, ata_c->r_count,
 	ata_c->r_features, ata_c->r_device, ata_c->r_command));
 



CVS commit: src/sys/arch

2017-09-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Sep 26 16:12:45 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: files.tegra tegra210_car.c tegra210_xusbpad.c
tegra_pcie.c tegra_pciereg.h tegra_xusb.c
src/sys/arch/evbarm/conf: TEGRA

Log Message:
More PCIe / XUSBPAD initialization goo for Tegra210.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/nvidia/files.tegra
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra210_car.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra210_xusbpad.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_pciereg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/nvidia/tegra_xusb.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/conf/TEGRA

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

Modified files:

Index: src/sys/arch/arm/nvidia/files.tegra
diff -u src/sys/arch/arm/nvidia/files.tegra:1.44 src/sys/arch/arm/nvidia/files.tegra:1.45
--- src/sys/arch/arm/nvidia/files.tegra:1.44	Fri Sep 22 14:36:22 2017
+++ src/sys/arch/arm/nvidia/files.tegra	Tue Sep 26 16:12:45 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.tegra,v 1.44 2017/09/22 14:36:22 jmcneill Exp $
+#	$NetBSD: files.tegra,v 1.45 2017/09/26 16:12:45 jmcneill Exp $
 #
 # Configuration info for NVIDIA Tegra ARM Peripherals
 #
@@ -88,10 +88,13 @@ attach	tegra124xpad at fdt with tegra124
 file	arch/arm/nvidia/tegra124_xusbpad.c	tegra124_xusbpad
 
 # XUSB PADCTL (Tegra210)
-device	tegra210xpad: tegra_xusbpad
+device	tegra210xpad { }: tegra_xusbpad
+device	tegra210xphy: tegra210xpad
 attach	tegra210xpad at fdt with tegra210_xusbpad
+attach	tegra210xphy at tegra210xpad
 file	arch/arm/nvidia/tegra210_xusbpad.c	tegra210_xusbpad
 
+
 # UART
 attach	com at fdt with tegra_com
 file	arch/arm/nvidia/tegra_com.c		tegra_com needs-flag

Index: src/sys/arch/arm/nvidia/tegra210_car.c
diff -u src/sys/arch/arm/nvidia/tegra210_car.c:1.13 src/sys/arch/arm/nvidia/tegra210_car.c:1.14
--- src/sys/arch/arm/nvidia/tegra210_car.c:1.13	Mon Sep 25 08:55:07 2017
+++ src/sys/arch/arm/nvidia/tegra210_car.c	Tue Sep 26 16:12:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_car.c,v 1.13 2017/09/25 08:55:07 jmcneill Exp $ */
+/* $NetBSD: tegra210_car.c,v 1.14 2017/09/26 16:12:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.13 2017/09/25 08:55:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.14 2017/09/26 16:12:45 jmcneill Exp $");
 
 #include 
 #include 
@@ -609,6 +609,9 @@ struct tegra210_init_parent {
 	{ "XUSB_FS_SRC",	"PLL_U_48M", 4800, 0 },
 	{ "PLL_U_OUT1",		NULL, 4800, 1 },
 	{ "PLL_U_OUT2",		NULL, 6000, 1 },
+	{ "CML0",		NULL, 0, 1 },
+	{ "AFI",		NULL, 0, 1 },
+	{ "PCIE",		NULL, 0, 1 },
 };
 
 struct tegra210_car_rst {
@@ -817,9 +820,15 @@ tegra210_car_utmip_init(struct tegra210_
 	tegra_reg_set_clear(bst, bsh, CAR_UTMIP_PLL_CFG1_REG,
 	0x3, CAR_UTMIP_PLL_CFG1_XTAL_FREQ_COUNT);
 
+	bus_space_write_4(bst, bsh, CAR_CLK_ENB_U_SET_REG, CAR_DEV_U_AFI);
+	bus_space_write_4(bst, bsh, CAR_CLK_ENB_U_SET_REG, CAR_DEV_U_PCIE);
+
 	bus_space_write_4(bst, bsh, CAR_RST_DEV_L_CLR_REG, CAR_DEV_L_USBD);
 	bus_space_write_4(bst, bsh, CAR_RST_DEV_H_CLR_REG, CAR_DEV_H_USB2);
 	bus_space_write_4(bst, bsh, CAR_RST_DEV_W_CLR_REG, CAR_DEV_W_XUSB);
+	bus_space_write_4(bst, bsh, CAR_RST_DEV_U_CLR_REG, CAR_DEV_U_AFI);
+	bus_space_write_4(bst, bsh, CAR_RST_DEV_U_CLR_REG, CAR_DEV_U_PCIE);
+	bus_space_write_4(bst, bsh, CAR_RST_DEV_U_CLR_REG, CAR_DEV_U_PCIEXCLK);
 	bus_space_write_4(bst, bsh, CAR_RST_DEV_Y_CLR_REG, CAR_DEV_Y_PEX_USB_UPHY);
 	bus_space_write_4(bst, bsh, CAR_RST_DEV_Y_CLR_REG, CAR_DEV_Y_SATA_USB_UPHY);
 

Index: src/sys/arch/arm/nvidia/tegra210_xusbpad.c
diff -u src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.7 src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.8
--- src/sys/arch/arm/nvidia/tegra210_xusbpad.c:1.7	Mon Sep 25 00:03:34 2017
+++ src/sys/arch/arm/nvidia/tegra210_xusbpad.c	Tue Sep 26 16:12:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra210_xusbpad.c,v 1.7 2017/09/25 00:03:34 jmcneill Exp $ */
+/* $NetBSD: tegra210_xusbpad.c,v 1.8 2017/09/26 16:12:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.7 2017/09/25 00:03:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.8 2017/09/26 16:12:45 jmcneill Exp $");
 
 #include 
 #include 
@@ -158,6 +158,17 @@ struct tegra210_xusbpad_softc {
 	bool			sc_enabled;
 };
 
+struct tegra210_xusbpad_phy_softc {
+	device_t		sc_dev;
+	int			sc_phandle;
+	struct tegra210_xusbpad_softc *sc_xusbpad;
+};
+
+struct tegra210_xusbpad_phy_attach_args {
+	struct tegra210_xusbpad_softc	*paa_xusbpad;
+	int			paa_phandle;
+};
+
 #define	RD4(sc, reg)	\
 	bus_space_read_4((sc)->sc_bs

CVS commit: src/lib/libm/man

2017-09-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Sep 26 15:42:54 UTC 2017

Modified Files:
src/lib/libm/man: hypot.3

Log Message:
omit mention of cabs (not relevant to this man page)
mention type-generic hypot
mention hypotl


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libm/man/hypot.3

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

Modified files:

Index: src/lib/libm/man/hypot.3
diff -u src/lib/libm/man/hypot.3:1.17 src/lib/libm/man/hypot.3:1.18
--- src/lib/libm/man/hypot.3:1.17	Thu Feb 22 22:08:20 2007
+++ src/lib/libm/man/hypot.3	Tue Sep 26 15:42:54 2017
@@ -26,14 +26,15 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)hypot.3	6.7 (Berkeley) 5/6/91
-.\"	$NetBSD: hypot.3,v 1.17 2007/02/22 22:08:20 drochner Exp $
+.\"	$NetBSD: hypot.3,v 1.18 2017/09/26 15:42:54 maya Exp $
 .\"
-.Dd February 12, 2007
+.Dd September 26, 2017
 .Dt HYPOT 3
 .Os
 .Sh NAME
 .Nm hypot ,
-.Nm hypotf
+.Nm hypotf ,
+.Nm hypotl
 .Nd Euclidean distance and complex absolute value functions
 .Sh LIBRARY
 .Lb libm
@@ -43,6 +44,11 @@
 .Fn hypot "double x" "double y"
 .Ft float
 .Fn hypotf "float x" "float y"
+.Ft long double
+.Fn hypotl "long double x" "long double y"
+.In tgmath.h
+.Ft real-floating
+.Fn hypot "real-floating" "real-floating"
 .Sh DESCRIPTION
 The
 .Fn hypot
@@ -111,14 +117,7 @@ disappear when it turns out to be irrele
 .Xr math 3 ,
 .Xr sqrt 3
 .Sh HISTORY
-Both a
+The
 .Fn hypot
-function and a
-.Fn cabs
-function
 appeared in
 .At v7 .
-.Fn cabs
-was removed from public namespace in
-.Nx 5.0
-to avoid conflicts with the complex function in C99.



CVS commit: src/lib/libm/man

2017-09-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Sep 26 15:12:57 UTC 2017

Modified Files:
src/lib/libm/man: copysign.3

Log Message:
Mention there's a type generic variant in tgmath.h

(XXX and in math.h, if you're netbsd)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/man/copysign.3

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

Modified files:

Index: src/lib/libm/man/copysign.3
diff -u src/lib/libm/man/copysign.3:1.1 src/lib/libm/man/copysign.3:1.2
--- src/lib/libm/man/copysign.3:1.1	Wed Apr 13 04:57:10 2011
+++ src/lib/libm/man/copysign.3	Tue Sep 26 15:12:57 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: copysign.3,v 1.1 2011/04/13 04:57:10 jruoho Exp $
+.\" $NetBSD: copysign.3,v 1.2 2017/09/26 15:12:57 maya Exp $
 .\"
 .\" Copyright (c) 2011 Jukka Ruohonen 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 13, 2011
+.Dd September 26, 2017
 .Dt COPYSIGN 3
 .Os
 .Sh NAME
@@ -42,6 +42,9 @@
 .Fn copysignf "float x" "float y"
 .Ft long double
 .Fn copysignl "long double x" "long double y"
+.In tgmath.h
+.Ft real-floating
+.Fn copysign "real-floating x" "real-floating y"
 .Sh DESCRIPTION
 The
 .Fn copysign ,



CVS commit: src/sys/dev/hdaudio

2017-09-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Sep 26 09:24:22 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg_dd.c

Log Message:
In rev 1.0a of the Intel High Definition Audio Spec:

https://www.intel.com/content/www/us/en/standards/
high-definition-audio-specification.html

page 186 shows the layout of the baseline block of the ELD (EDID Like Data)
struct - and allows a reserved (effectively padding) area at the end of the
struct.  This is required to keep the struct an even number of words long
(size measured in units of 32 bits) while allowing for a variable length
monitor name, followed by a variable number of 3 byte structs - the
combination of which is not likely to be a multiple of 4.

Code here assumed that there was no padding, and objected to the ELD
format if any padding bytes existed (hdafg_dd_parse_info() would return
EINVAL) causing a "failed to parse ELD data" message (if HDAFG_HDMI_DEBUG
is defined) from hdafg_assoc_dump_dd() making it difficult (or at least
confusing) to debug HDMI related audio issues (hdafg_assoc_dump_dd would
not print most of the data it is expected to print) although this would
most likely have no effect on actual operations.

Change a test from a != to < (there must be enough data, not exactly the
amount needed) for the EINVAL.   As a consequence, the length after the
SAD data is parsed (the 3 byte structs) is no longer required to be 0,
so remove the KASSERT() (previously it was just useless, the code guaranteed
a 0 value, now it is incorrect.)   While here also change a related
diagnostic message to be slightly more informative as to what is being shown.

OK jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdafg_dd.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/hdaudio/hdafg_dd.c
diff -u src/sys/dev/hdaudio/hdafg_dd.c:1.2 src/sys/dev/hdaudio/hdafg_dd.c:1.3
--- src/sys/dev/hdaudio/hdafg_dd.c:1.2	Fri Aug  4 00:25:23 2017
+++ src/sys/dev/hdaudio/hdafg_dd.c	Tue Sep 26 09:24:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $ */
+/* $NetBSD: hdafg_dd.c,v 1.3 2017/09/26 09:24:22 kre Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.3 2017/09/26 09:24:22 kre Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	data += ELD_MNL(block);
 	datalen -= ELD_MNL(block);
 
-	if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
+	if (datalen < ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
 #ifdef HDAFG_HDMI_DEBUG
 		printf(" datalen %u sadcount %u sizeof sad %u\n",
 		(unsigned int)datalen,
@@ -109,10 +109,8 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	}
 
 #ifdef HDAFG_HDMI_DEBUG
-	printf("datalen = %u\n", (unsigned int)datalen);
+	printf("hdafg eld padding ignored = %u\n", (unsigned int)datalen);
 #endif
-	KASSERT(datalen == 0);
-
 	return 0;
 }
 



CVS commit: src/sys/dev/pci

2017-09-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Sep 26 08:25:56 UTC 2017

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

Log Message:
- Correct NVM word size check in wm_nvm_version() to prevent
  "EERD polling failed" error on attach. if_wm.c rev. 1.534 was not perfect.
  Reported by ozaki-r@.
- Print NVM offset and word count when EERD polling failed.

XXX pullup-8.


To generate a diff of this commit:
cvs rdiff -u -r1.538 -r1.539 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.538 src/sys/dev/pci/if_wm.c:1.539
--- src/sys/dev/pci/if_wm.c:1.538	Tue Sep 26 07:42:06 2017
+++ src/sys/dev/pci/if_wm.c	Tue Sep 26 08:25:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.538 2017/09/26 07:42:06 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.538 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.539 2017/09/26 08:25:56 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -11768,7 +11768,8 @@ wm_nvm_read_eerd(struct wm_softc *sc, in
 		CSR_WRITE(sc, WMREG_EERD, eerd);
 		rv = wm_poll_eerd_eewr_done(sc, WMREG_EERD);
 		if (rv != 0) {
-			aprint_error_dev(sc->sc_dev, "EERD polling failed\n");
+			aprint_error_dev(sc->sc_dev, "EERD polling failed: "
+			"offset=%d. wordcnt=%d\n", offset, wordcnt);
 			break;
 		}
 		data[i] = (CSR_READ(sc, WMREG_EERD) >> EERD_DATA_SHIFT);
@@ -12549,7 +12550,7 @@ printver:
 	}
 
 	/* Assume the Option ROM area is at avove NVM_SIZE */
-	if ((sc->sc_nvm_wordsize >= NVM_SIZE) && check_optionrom
+	if ((sc->sc_nvm_wordsize > NVM_SIZE) && check_optionrom
 	&& (wm_nvm_read(sc, NVM_OFF_COMB_VER_PTR, 1, &off) == 0)) {
 		/* Option ROM Version */
 		if ((off != 0x) && (off != 0x)) {



CVS commit: src/sys

2017-09-26 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Sep 26 07:42:06 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c
src/sys/arch/x86/pci: if_vmx.c
src/sys/dev/ic: i82557.c rtl8169.c
src/sys/dev/pci: if_age.c if_alc.c if_ale.c if_bge.c if_bnx.c if_jme.c
if_nfe.c if_sip.c if_stge.c if_ti.c if_txp.c if_vge.c if_wm.c
src/sys/dev/pci/cxgb: cxgb_sge.c
src/sys/dev/pci/ixgbe: ix_txrx.c
src/sys/net: if_ether.h if_ethersubr.c if_vlan.c
src/sys/net/agr: if_agrether_hash.c
src/sys/net80211: ieee80211_input.c ieee80211_output.c
src/sys/sys: mbuf.h

Log Message:
VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.

I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks.
See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html

XXX need pullup to -8 branch


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/booke/dev/pq3etsec.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/pci/if_vmx.c
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/ic/i82557.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.310 -r1.311 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_jme.c
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.166 -r1.167 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/if_stge.c
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/if_ti.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/pci/if_txp.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/if_vge.c
cvs rdiff -u -r1.537 -r1.538 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/cxgb/cxgb_sge.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.66 -r1.67 src/sys/net/if_ether.h
cvs rdiff -u -r1.243 -r1.244 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.99 -r1.100 src/sys/net/if_vlan.c
cvs rdiff -u -r1.3 -r1.4 src/sys/net/agr/if_agrether_hash.c
cvs rdiff -u -r1.88 -r1.89 src/sys/net80211/ieee80211_input.c
cvs rdiff -u -r1.58 -r1.59 src/sys/net80211/ieee80211_output.c
cvs rdiff -u -r1.170 -r1.171 src/sys/sys/mbuf.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/arch/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.29 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.30
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.29	Thu Dec 15 09:28:04 2016
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Tue Sep 26 07:42:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.29 2016/12/15 09:28:04 ozaki-r Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.30 2017/09/26 07:42:05 knakahara Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.29 2016/12/15 09:28:04 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.30 2017/09/26 07:42:05 knakahara Exp $");
 
 #include 
 #include 
@@ -1512,8 +1512,7 @@ pq3etsec_rx_offload(
 	const struct rxfcb *fcb)
 {
 	if (fcb->rxfcb_flags & RXFCB_VLN) {
-		VLAN_INPUT_TAG(&sc->sc_if, m, fcb->rxfcb_vlctl,
-		m_freem(m); return false);
+		vlan_set_tag(m, fcb->rxfcb_vlctl);
 	}
 	if ((fcb->rxfcb_flags & RXFCB_IP) == 0
 	|| (fcb->rxfcb_flags & (RXFCB_CIP|RXFCB_CTU)) == 0)
@@ -1991,14 +1990,18 @@ pq3etsec_tx_offload(
 {
 	struct mbuf *m = *mp;
 	u_int csum_flags = m->m_pkthdr.csum_flags;
-	struct m_tag *vtag = VLAN_OUTPUT_TAG(&sc->sc_ec, m);
+	bool have_vtag;
+	uint16_t vtag;
 
 	KASSERT(m->m_flags & M_PKTHDR);
 
+	have_vtag = vlan_has_tag(m);
+	vtag = vlan_get_tag(m);
+
 	/*
 	 * Let see if we are doing any offload first.
 	 */
-	if (csum_flags == 0 && vtag == 0) {
+	if (csum_flags == 0 && !have_vtag) {
 		m->m_flags &= ~M_HASFCB;
 		return;
 	}
@@ -2012,7 +2015,7 @@ pq3etsec_tx_offload(
 		| ((csum_flags & M_CSUM_CIP) ? TXFCB_CIP : 0)
 		| ((csum_flags & M_CSUM_CTU) ? TXFCB_CTU : 0);
 	}
-	if (vtag) {
+	if (have_vtag) {
 		flags |= TXFCB_VLN;
 	}
 	if (flags == 0) {
@@ -2028,7 +2031,7 @@ pq3etsec_tx_offload(
 		fcb.txfcb_l4os = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
 	fcb.txfcb_l3os = ETHER_HDR_LEN;
 	fcb.txfcb_phcs = 0;
-	fcb.txfcb_vlctl = vtag ? VLAN_TAG_VALUE(vtag) & 0x : 0;
+	fcb.txfcb_vlctl = have_vtag ? vtag : 0;
 
 #if 0
 	printf("%s: csum_flags=%#x: txfcb flags=%#x lsos=%u l4os=%u phcs=%u vlctl=%#x\n",
@@ -2063,7 +2066,6 @@ pq3etsec_tx_offload(
 panic("%s: impossible M_CSUM flags %#x",
 device_xname(sc->sc_dev), csum_flags);
 #endif
-			} else if (vtag) {
 			}
 
 			m->m_flags &= ~M_HASFCB;

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.19 src/sys/arch/x86/pc