CVS commit: src/sys/external/bsd/drm2

2018-12-20 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Dec 21 07:51:18 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_drm.c
nouveau_usif.c nouveau_usif.h
src/sys/external/bsd/drm2/dist/include/drm: drmP.h
src/sys/external/bsd/drm2/drm: drm_cdevsw.c

Log Message:
Expose nvif ioctl interface.

nvif is a variable length (nested..) ioctl, so it doesn't match the
usual drm_ioctl interface. linux uses a shim to override the ioctl
function for nouveau to allow this, do the same.

fixes 3D acceleration with nouveau.

from riastradh.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.h
cvs rdiff -u -r1.34 -r1.35 src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/drm/drm_cdevsw.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/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.15 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.16
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.15	Mon Aug 27 15:22:54 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c	Fri Dec 21 07:51:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_drm.c,v 1.15 2018/08/27 15:22:54 riastradh Exp $	*/
+/*	$NetBSD: nouveau_drm.c,v 1.16 2018/12/21 07:51:17 maya Exp $	*/
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.15 2018/08/27 15:22:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.16 2018/12/21 07:51:17 maya Exp $");
 
 #include 
 #include 
@@ -954,7 +954,35 @@ nouveau_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(NOUVEAU_GEM_INFO, nouveau_gem_ioctl_info, DRM_AUTH|DRM_RENDER_ALLOW),
 };
 
-#ifndef __NetBSD__		/* XXX nouveau pm */
+#ifdef __NetBSD__
+#include 
+#include 
+static int			/* XXX expose to ioc32 */
+nouveau_ioctl_override(struct file *fp, unsigned long cmd, void *data)
+{
+	struct drm_file *file = fp->f_data;
+	struct drm_device *dev = file->minor->dev;
+	int ret;
+
+	ret = pm_runtime_get_sync(dev->dev);
+	if (ret < 0 && ret != -EACCES)
+		return ret;
+
+	switch (DRM_IOCTL_NR(cmd) - DRM_COMMAND_BASE) {
+	case DRM_NOUVEAU_NVIF:
+		/* XXX errno NetBSD->Linux */
+		ret = -usif_ioctl(file, data, IOCPARM_LEN(cmd));
+		break;
+	default:
+		ret = drm_ioctl(fp, cmd, data);
+		break;
+	}
+
+	pm_runtime_mark_last_busy(dev->dev);
+	pm_runtime_put_autosuspend(dev->dev);
+	return ret;
+}
+#else
 long
 nouveau_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
@@ -979,7 +1007,9 @@ nouveau_drm_ioctl(struct file *file, uns
 	pm_runtime_put_autosuspend(dev->dev);
 	return ret;
 }
+#endif
 
+#ifndef __NetBSD__
 static const struct file_operations
 nouveau_driver_fops = {
 	.owner = THIS_MODULE,
@@ -1026,6 +1056,7 @@ driver_stub = {
 	.fops = NULL,
 	.mmap_object = _ttm_mmap_object,
 	.gem_uvm_ops = _gem_uvm_ops,
+	.ioctl_override = nouveau_ioctl_override,
 #else
 	.fops = _driver_fops,
 #endif

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c:1.5 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c:1.5	Mon Aug 27 07:43:16 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_usif.c	Fri Dec 21 07:51:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_usif.c,v 1.5 2018/08/27 07:43:16 riastradh Exp $	*/
+/*	$NetBSD: nouveau_usif.c,v 1.6 2018/12/21 07:51:17 maya Exp $	*/
 
 /*
  * Copyright 2014 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_usif.c,v 1.5 2018/08/27 07:43:16 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_usif.c,v 1.6 2018/12/21 07:51:17 maya Exp $");
 
 #include "nouveau_drm.h"
 #include "nouveau_usif.h"
@@ -305,11 +305,17 @@ usif_object_new(struct drm_file *f, void
 }
 
 int
+#ifdef __NetBSD__
+usif_ioctl(struct drm_file *filp, void *data, u32 argc)
+#else
 usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
+#endif
 {
 	struct nouveau_cli *cli = nouveau_cli(filp);
 	struct nvif_client *client = >base;
+#ifndef __NetBSD__
 	void *data = kmalloc(argc, GFP_KERNEL);
+#endif
 	u32   size = argc;
 	union {
 		struct nvif_ioctl_v0 v0;
@@ -318,10 +324,12 @@ usif_ioctl(struct drm_file *filp, void _
 	u8 owner;
 	int ret;
 
+#ifndef __NetBSD__
 	if (ret = -ENOMEM, !argv)
 		goto done;
 	if (ret = -EFAULT, copy_from_user(argv, user, size))
 		goto done;
+#endif
 
 	if (nvif_unpack(argv->v0, 0, 0, true)) {
 		/* block access to objects not created via this interface */
@@ -385,10 

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

2018-12-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 07:13:30 UTC 2018

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

Log Message:
 Remove ETHERCAP_VLAN_HWFILTER.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.9 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.10
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.h:1.9	Thu Dec  6 13:25:02 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.h	Fri Dec 21 07:13:30 2018
@@ -1,4 +1,4 @@
-/*$NetBSD: ixgbe_netbsd.h,v 1.9 2018/12/06 13:25:02 msaitoh Exp $*/
+/*$NetBSD: ixgbe_netbsd.h,v 1.10 2018/12/21 07:13:30 msaitoh Exp $*/
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,6 @@
 #define	IXGBE_LEGACY_TX	1
 #endif
 
-#define	ETHERCAP_VLAN_HWFILTER	0
 #define	ETHERCAP_VLAN_HWCSUM	0
 #define	MJUM9BYTES	(9 * 1024)
 #define	MJUM16BYTES	(16 * 1024)



CVS commit: src/usr.bin/make

2018-12-20 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Dec 21 05:50:19 UTC 2018

Modified Files:
src/usr.bin/make: var.c

Log Message:
unexport-env: avoid SEGFAULT if MAKELEVEL not in env


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/var.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.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.220 src/usr.bin/make/var.c:1.221
--- src/usr.bin/make/var.c:1.220	Sun May 27 01:14:51 2018
+++ src/usr.bin/make/var.c	Fri Dec 21 05:50:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $	*/
+/*	$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -836,7 +836,8 @@ Var_UnExport(char *str)
 	environ = savedEnv = newenv;
 	newenv[0] = NULL;
 	newenv[1] = NULL;
-	setenv(MAKE_LEVEL_ENV, cp, 1);
+	if (cp && *cp)
+	setenv(MAKE_LEVEL_ENV, cp, 1);
 } else {
 	for (; *str != '\n' && isspace((unsigned char) *str); str++)
 	continue;



CVS commit: src/sys/net

2018-12-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 21 04:43:17 UTC 2018

Modified Files:
src/sys/net: if_ether.h

Log Message:
 Add ETHERCAP_VLAN_HWFILTER and ETHERCAP_EEE.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_ether.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/net/if_ether.h
diff -u src/sys/net/if_ether.h:1.75 src/sys/net/if_ether.h:1.76
--- src/sys/net/if_ether.h:1.75	Thu Jun 14 08:00:24 2018
+++ src/sys/net/if_ether.h	Fri Dec 21 04:43:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ether.h,v 1.75 2018/06/14 08:00:24 yamaguchi Exp $	*/
+/*	$NetBSD: if_ether.h,v 1.76 2018/12/21 04:43:17 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -187,16 +187,20 @@ struct ethercom {
 #endif
 };
 
-#define	ETHERCAP_VLAN_MTU	0x0001	/* VLAN-compatible MTU */
-#define	ETHERCAP_VLAN_HWTAGGING	0x0002	/* hardware VLAN tag support */
-#define	ETHERCAP_JUMBO_MTU	0x0004	/* 9000 byte MTU supported */
-#define	ETHERCAP_MASK		0x0007
+#define	ETHERCAP_VLAN_MTU	0x0001 /* VLAN-compatible MTU */
+#define	ETHERCAP_VLAN_HWTAGGING	0x0002 /* hardware VLAN tag support */
+#define	ETHERCAP_JUMBO_MTU	0x0004 /* 9000 byte MTU supported */
+#define	ETHERCAP_VLAN_HWFILTER	0x0008 /* iface hw can filter vlan tag */
+#define	ETHERCAP_EEE		0x0010 /* Energy Efficiency Ethernet */
+#define	ETHERCAP_MASK		0x001f
 
 #define	ECCAPBITS		\
 	"\020"			\
 	"\1VLAN_MTU"		\
 	"\2VLAN_HWTAGGING"	\
-	"\3JUMBO_MTU"
+	"\3JUMBO_MTU"		\
+	"\4VLAN_HWFILTER"	\
+	"\5EEE"
 
 /* ioctl() for Ethernet capabilities */
 struct eccapreq {



CVS commit: src/sys/dev/i2c

2018-12-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Dec 20 21:36:53 UTC 2018

Modified Files:
src/sys/dev/i2c: ds1307.c

Log Message:
make DSRTC_FLAG_YEAR_START_2K settable by device property


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/i2c/ds1307.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/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.30 src/sys/dev/i2c/ds1307.c:1.31
--- src/sys/dev/i2c/ds1307.c:1.30	Fri Dec 14 22:05:36 2018
+++ src/sys/dev/i2c/ds1307.c	Thu Dec 20 21:36:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307.c,v 1.30 2018/12/14 22:05:36 macallan Exp $	*/
+/*	$NetBSD: ds1307.c,v 1.31 2018/12/20 21:36:53 macallan Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.30 2018/12/14 22:05:36 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.31 2018/12/20 21:36:53 macallan Exp $");
 
 #include 
 #include 
@@ -297,6 +297,8 @@ dsrtc_attach(device_t parent, device_t s
 	struct dsrtc_softc *sc = device_private(self);
 	struct i2c_attach_args *ia = arg;
 	const struct dsrtc_model *dm;
+	prop_dictionary_t dict = device_properties(self);
+	bool base_2k = FALSE;
 
 	if ((dm = dsrtc_model_by_compat(ia)) == NULL)
 		dm = dsrtc_model_by_number(device_cfdata(self)->cf_flags);
@@ -331,6 +333,10 @@ dsrtc_attach(device_t parent, device_t s
 	sc->sc_model.dm_flags |= DSRTC_FLAG_YEAR_START_2K;
 #endif
 
+	prop_dictionary_get_bool(dict, "base_year_is_2000", _2k);
+	if (base_2k) sc->sc_model.dm_flags |= DSRTC_FLAG_YEAR_START_2K;
+
+
 	todr_attach(>sc_todr);
 	if ((sc->sc_model.dm_flags & DSRTC_FLAG_TEMP) != 0) {
 		int error;



CVS commit: src/sys/dev/acpi

2018-12-20 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Dec 20 19:16:17 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi_mcfg.c

Log Message:
An ACPI MCFG allocation with start bus number = end bus number is valid,
so do not skip it. An entry like this defines MCFG space for a single bus.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/acpi_mcfg.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/acpi/acpi_mcfg.c
diff -u src/sys/dev/acpi/acpi_mcfg.c:1.15 src/sys/dev/acpi/acpi_mcfg.c:1.16
--- src/sys/dev/acpi/acpi_mcfg.c:1.15	Sat Dec  8 15:02:06 2018
+++ src/sys/dev/acpi/acpi_mcfg.c	Thu Dec 20 19:16:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_mcfg.c,v 1.15 2018/12/08 15:02:06 jmcneill Exp $	*/
+/*	$NetBSD: acpi_mcfg.c,v 1.16 2018/12/20 19:16:17 jmcneill Exp $	*/
 
 /*-
  * Copyright (C) 2015 NONAKA Kimihiro 
@@ -28,7 +28,7 @@
 #include "opt_pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.15 2018/12/08 15:02:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_mcfg.c,v 1.16 2018/12/20 19:16:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -350,15 +350,6 @@ acpimcfg_init(bus_space_tag_t memt, cons
 		 * Some (broken?) BIOSen have an MCFG table for an empty
 		 * bus range.  Ignore those tables.
 		 */
-		if (ama->StartBusNumber == ama->EndBusNumber) {
-			aprint_debug_dev(acpi_sc->sc_dev,
-			"MCFG: segment %d, bus %d-%d, address 0x%016" PRIx64
-			": ignore (bus %d == %d)\n", ama->PciSegment,
-			ama->StartBusNumber, ama->EndBusNumber,
-			ama->Address, ama->StartBusNumber,
-			ama->EndBusNumber);
-			goto next;
-		}
 		if (ama->StartBusNumber > ama->EndBusNumber) {
 			aprint_debug_dev(acpi_sc->sc_dev,
 			"MCFG: segment %d, bus %d-%d, address 0x%016" PRIx64



CVS commit: src/share/man/man4

2018-12-20 Thread Tom Ivar Helbekkmo
Module Name:src
Committed By:   tih
Date:   Thu Dec 20 15:19:31 UTC 2018

Modified Files:
src/share/man/man4: urtwn.4

Log Message:
Add D-Link DWA-131 to list of devices expected to work


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man4/urtwn.4

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

Modified files:

Index: src/share/man/man4/urtwn.4
diff -u src/share/man/man4/urtwn.4:1.16 src/share/man/man4/urtwn.4:1.17
--- src/share/man/man4/urtwn.4:1.16	Mon Dec 17 04:11:34 2018
+++ src/share/man/man4/urtwn.4	Thu Dec 20 15:19:31 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: urtwn.4,v 1.16 2018/12/17 04:11:34 msaitoh Exp $
+.\" $NetBSD: urtwn.4,v 1.17 2018/12/20 15:19:31 tih Exp $
 .\" $OpenBSD: urtwn.4,v 1.15 2011/11/26 06:39:33 ckuethe Exp $
 .\"
 .\" Copyright (c) 2010 Damien Bergamini 
@@ -109,6 +109,7 @@ The following adapters should work:
 .It B-Link BL-LW05-5R
 .It Belkin F7D1102 Surf Wireless Micro
 .It D-Link DWA-121
+.It D-Link DWA-131
 .It D-Link DWA-133
 .It D-Link DWA-135
 .It Digitus DN-7042



CVS commit: src/sys/dev/usb

2018-12-20 Thread Tom Ivar Helbekkmo
Module Name:src
Committed By:   tih
Date:   Thu Dec 20 15:16:07 UTC 2018

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
Add D-Link DWA-131 rev E "Wireless N300 Nano USB Adapter"

OK: jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_urtwn.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/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.66 src/sys/dev/usb/if_urtwn.c:1.67
--- src/sys/dev/usb/if_urtwn.c:1.66	Sat Dec 15 10:30:58 2018
+++ src/sys/dev/usb/if_urtwn.c	Thu Dec 20 15:16:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.66 2018/12/15 10:30:58 msaitoh Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.67 2018/12/20 15:16:07 tih Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.66 2018/12/15 10:30:58 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.67 2018/12/20 15:16:07 tih Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -195,6 +195,7 @@ static const struct urtwn_dev {
 	URTWN_RTL8188E_DEV(TPLINK, RTL8188EU),
 
 	/* URTWN_RTL8192EU */
+	URTWN_RTL8192EU_DEV(DLINK,	DWA131E),
 	URTWN_RTL8192EU_DEV(REALTEK,	RTL8192EU),
 	URTWN_RTL8192EU_DEV(TPLINK,	RTL8192EU),
 };



CVS commit: src/sys/dev/usb

2018-12-20 Thread Tom Ivar Helbekkmo
Module Name:src
Committed By:   tih
Date:   Thu Dec 20 15:13:07 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.757 -r1.758 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.757 src/sys/dev/usb/usbdevs.h:1.758
--- src/sys/dev/usb/usbdevs.h:1.757	Fri Dec 14 14:04:13 2018
+++ src/sys/dev/usb/usbdevs.h	Thu Dec 20 15:13:07 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.757 2018/12/14 14:04:13 tnn Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.758 2018/12/20 15:13:07 tih Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.764 2018/12/14 13:56:59 tnn Exp
+ *	NetBSD: usbdevs,v 1.765 2018/12/20 15:09:46 tih Exp
  */
 
 /*-
@@ -1398,6 +1398,7 @@
 #define	USB_PRODUCT_DLINK_RTL8192CU_4	0x330b		/* RTL8192CU */
 #define	USB_PRODUCT_DLINK_DWA131B	0x330d		/* DWA-131 rev B */
 #define	USB_PRODUCT_DLINK_DWA125D1	0x330f		/* DWA-125 rev D1 */
+#define	USB_PRODUCT_DLINK_DWA131E	0x3319		/* DWA-131 rev E */
 #define	USB_PRODUCT_DLINK_DWL122	0x3700		/* Wireless DWL122 */
 #define	USB_PRODUCT_DLINK_DWLG120	0x3701		/* DWL-G120 */
 #define	USB_PRODUCT_DLINK_DWL120F	0x3702		/* DWL-120 rev F */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.757 src/sys/dev/usb/usbdevs_data.h:1.758
--- src/sys/dev/usb/usbdevs_data.h:1.757	Fri Dec 14 14:04:13 2018
+++ src/sys/dev/usb/usbdevs_data.h	Thu Dec 20 15:13:07 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.757 2018/12/14 14:04:13 tnn Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.758 2018/12/20 15:13:07 tih Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.764 2018/12/14 13:56:59 tnn Exp
+ *	NetBSD: usbdevs,v 1.765 2018/12/20 15:09:46 tih Exp
  */
 
 /*-
@@ -1736,6 +1736,8 @@ static const uint16_t usb_products[] = {
 	9140, 8693, 9148, 0,
 	USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWA125D1, 
 	9150, 8693, 9158, 0,
+	USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWA131E, 
+	9140, 8693, 9128, 0,
 	USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWL122, 
 	651, 9161, 0,
 	USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWLG120, 
@@ -6091,7 +6093,7 @@ static const char usb_words[] = { "." 
 	"XH1153\0" /* 1 refs @ 8672 */
 	"C-Net\0" /* 1 refs @ 8679 */
 	"CWD-854\0" /* 1 refs @ 8685 */
-	"rev\0" /* 17 refs @ 8693 */
+	"rev\0" /* 18 refs @ 8693 */
 	"F\0" /* 2 refs @ 8697 */
 	"RTL8187\0" /* 4 refs @ 8699 */
 	"AccelePort\0" /* 3 refs @ 8707 */
@@ -6146,10 +6148,10 @@ static const char usb_words[] = { "." 
 	"DUB-E100\0" /* 3 refs @ 9107 */
 	"C1\0" /* 3 refs @ 9116 */
 	"DUB-1312\0" /* 1 refs @ 9119 */
-	"E\0" /* 1 refs @ 9128 */
+	"E\0" /* 2 refs @ 9128 */
 	"DWA-130\0" /* 3 refs @ 9130 */
 	"C\0" /* 1 refs @ 9138 */
-	"DWA-131\0" /* 2 refs @ 9140 */
+	"DWA-131\0" /* 3 refs @ 9140 */
 	"B\0" /* 3 refs @ 9148 */
 	"DWA-125\0" /* 1 refs @ 9150 */
 	"D1\0" /* 2 refs @ 9158 */



CVS commit: src/sys/dev/usb

2018-12-20 Thread Tom Ivar Helbekkmo
Module Name:src
Committed By:   tih
Date:   Thu Dec 20 15:09:47 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add D-Link DWA-131 rev E "Wireless N300 Nano USB Adapter"


To generate a diff of this commit:
cvs rdiff -u -r1.764 -r1.765 src/sys/dev/usb/usbdevs

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/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.764 src/sys/dev/usb/usbdevs:1.765
--- src/sys/dev/usb/usbdevs:1.764	Fri Dec 14 13:56:59 2018
+++ src/sys/dev/usb/usbdevs	Thu Dec 20 15:09:46 2018
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.764 2018/12/14 13:56:59 tnn Exp $
+$NetBSD: usbdevs,v 1.765 2018/12/20 15:09:46 tih Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1391,6 +1391,7 @@ product DLINK RTL8192CU_3	0x330a	RTL8192
 product DLINK RTL8192CU_4	0x330b	RTL8192CU
 product DLINK DWA131B		0x330d	DWA-131 rev B
 product	DLINK DWA125D1		0x330f  DWA-125 rev D1
+product DLINK DWA131E		0x3319	DWA-131 rev E
 product DLINK DWL122		0x3700	Wireless DWL122
 product DLINK DWLG120		0x3701	DWL-G120
 product DLINK DWL120F		0x3702	DWL-120 rev F



CVS commit: src/sbin/gpt

2018-12-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 20 14:58:10 UTC 2018

Modified Files:
src/sbin/gpt: gpt_uuid.c gpt_uuid.h

Log Message:
Add a query function (for external code) to enumerate the know guids.
Add recently added VMware GUIDs to the internal enum type.
Fix some short names (bogus + duplicate).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/gpt/gpt_uuid.c
cvs rdiff -u -r1.7 -r1.8 src/sbin/gpt/gpt_uuid.h

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

Modified files:

Index: src/sbin/gpt/gpt_uuid.c
diff -u src/sbin/gpt/gpt_uuid.c:1.16 src/sbin/gpt/gpt_uuid.c:1.17
--- src/sbin/gpt/gpt_uuid.c:1.16	Tue Nov  6 04:04:33 2018
+++ src/sbin/gpt/gpt_uuid.c	Thu Dec 20 14:58:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt_uuid.c,v 1.16 2018/11/06 04:04:33 mrg Exp $	*/
+/*	$NetBSD: gpt_uuid.c,v 1.17 2018/12/20 14:58:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt_uuid.c,v 1.16 2018/11/06 04:04:33 mrg Exp $");
+__RCSID("$NetBSD: gpt_uuid.c,v 1.17 2018/12/20 14:58:10 martin Exp $");
 #endif
 
 #include 
@@ -87,9 +87,9 @@ static const struct {
 	{ GPT_ENT_TYPE_NETBSD_RAIDFRAME, "raid",
 	"NetBSD RAIDFrame component" },
 	{ GPT_ENT_TYPE_NETBSD_SWAP, "swap", "NetBSD swap" },
-	{ GPT_ENT_TYPE_VMWARE_VMKCORE, "swap", "VMware VMkernel core dump" },
-	{ GPT_ENT_TYPE_VMWARE_VMFS, "swap", "VMware VMFS" },
-	{ GPT_ENT_TYPE_VMWARE_RESERVED, "swap", "VMware reserved" },
+	{ GPT_ENT_TYPE_VMWARE_VMKCORE, "vmcore", "VMware VMkernel core dump" },
+	{ GPT_ENT_TYPE_VMWARE_VMFS, "vmfs", "VMware VMFS" },
+	{ GPT_ENT_TYPE_VMWARE_RESERVED, "vmresered", "VMware reserved" },
 };
 
 static void
@@ -234,6 +234,23 @@ gpt_uuid_parse(const char *s, gpt_uuid_t
 	return 0;
 }
 
+size_t
+gpt_uuid_query(
+void (*func)(const char *uuid, const char *short_name, const char *desc))
+{
+	size_t i;
+	char buf[64];
+
+	if (func != NULL) {
+		for (i = 0; i < __arraycount(gpt_nv); i++) {
+			gpt_uuid_numeric(buf, sizeof(buf), _nv[i].u);
+			(*func)(buf, gpt_nv[i].n, gpt_nv[i].d);
+		}
+	}
+	return __arraycount(gpt_nv);
+}
+
+#ifndef GPT_UUID_QUERY_ONLY
 void
 gpt_uuid_help(const char *prefix)
 {
@@ -323,3 +340,4 @@ gpt_uuid_generate(gpt_t gpt, gpt_uuid_t 
 	gpt_dce_to_uuid(, t);
 	return 0;
 }
+#endif

Index: src/sbin/gpt/gpt_uuid.h
diff -u src/sbin/gpt/gpt_uuid.h:1.7 src/sbin/gpt/gpt_uuid.h:1.8
--- src/sbin/gpt/gpt_uuid.h:1.7	Sun Dec  6 04:27:05 2015
+++ src/sbin/gpt/gpt_uuid.h	Thu Dec 20 14:58:10 2018
@@ -67,7 +67,10 @@ typedef enum {
 	GPT_TYPE_NETBSD_FFS,
 	GPT_TYPE_NETBSD_LFS,
 	GPT_TYPE_NETBSD_RAIDFRAME,
-	GPT_TYPE_NETBSD_SWAP
+	GPT_TYPE_NETBSD_SWAP,
+	GPT_TYPE_VMWARE_VMKCORE,
+	GPT_TYPE_VMWARE_VMFS,
+	GPT_TYPE_VMWARE_RESERVED
 } gpt_type_t;
 
 typedef uint8_t gpt_uuid_t[16];
@@ -98,6 +101,10 @@ int gpt_uuid_parse(const char *, gpt_uui
 struct gpt;
 int gpt_uuid_generate(struct gpt *, gpt_uuid_t);
 
+/* returns number of entries, callback func may be NULL */
+size_t gpt_uuid_query(
+void (*func)(const char *uuid, const char *short_name, const char *desc));
+
 void gpt_uuid_help(const char *);
 
 __END_DECLS



CVS commit: [netbsd-8] src/doc

2018-12-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 20 11:35:32 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Ticket #1141


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.78 -r1.1.2.79 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.78 src/doc/CHANGES-8.1:1.1.2.79
--- src/doc/CHANGES-8.1:1.1.2.78	Tue Dec 18 18:33:40 2018
+++ src/doc/CHANGES-8.1	Thu Dec 20 11:35:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.78 2018/12/18 18:33:40 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.79 2018/12/20 11:35:32 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2082,3 +2082,8 @@ sys/dev/usb/if_urtwn.c1.66
 	- Add IO-DATA WN-G150UMW to the supported list.
 	[msaitoh, ticket #1140]
 
+sys/dev/pci/ixgbe/ix_txrx.c			1.51
+
+	Fix TX queue assignment in some cases.
+	[knakahara, ticket #1141]
+



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

2018-12-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 20 11:34:33 UTC 2018

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

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

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

Apply the same fix as if_wm.c:r1.606 to ixg(4). Pointed out by msaitoh@n.o, 
thanks.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.13 -r1.24.2.14 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.13 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.14
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.13	Fri Sep  7 12:37:20 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 20 11:34:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.13 2018/09/07 12:37:20 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.14 2018/12/20 11:34:33 martin Exp $ */
 
 /**
 
@@ -230,7 +230,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			i = m->m_pkthdr.flowid % adapter->num_queues;
 	} else
 #endif /* 0 */
-		i = cpu_index(curcpu()) % adapter->num_queues;
+		i = (cpu_index(curcpu()) % ncpu) % adapter->num_queues;
 
 	/* Check for a hung queue and pick alternative */
 	if (((1 << i) & adapter->active_queues) == 0)



CVS commit: src

2018-12-20 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec 20 10:33:42 UTC 2018

Modified Files:
src/share/man/man4: options.4
src/sys/arch/x86/conf: files.x86

Log Message:
Enable 'options NO_PCI_MSI_MSIX' to DTRT in x86 builds.

Document 'options NO_PCI_MSI_MSIX' in options(4).


To generate a diff of this commit:
cvs rdiff -u -r1.495 -r1.496 src/share/man/man4/options.4
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/x86/conf/files.x86

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.495 src/share/man/man4/options.4:1.496
--- src/share/man/man4/options.4:1.495	Thu Dec 20 09:17:04 2018
+++ src/share/man/man4/options.4	Thu Dec 20 10:33:41 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.495 2018/12/20 09:17:04 cherry Exp $
+.\"	$NetBSD: options.4,v 1.496 2018/12/20 10:33:41 cherry Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -2688,6 +2688,11 @@ bolded
 .El
 .Ss x86-specific Options
 .Bl -ohang
+.It Cd options NO_PCI_MSI_MSIX
+Disable support for MSI/MSIX in the kernel.
+See
+.Xr pci_msi 9
+for details of MSI/MSIX support
 .It Cd options NO_PREEMPTION
 Disables
 .Xr kpreempt 9

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.104 src/sys/arch/x86/conf/files.x86:1.105
--- src/sys/arch/x86/conf/files.x86:1.104	Fri Dec  7 15:47:11 2018
+++ src/sys/arch/x86/conf/files.x86	Thu Dec 20 10:33:41 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.104 2018/12/07 15:47:11 maxv Exp $
+#	$NetBSD: files.x86,v 1.105 2018/12/20 10:33:41 cherry Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI
@@ -155,8 +155,8 @@ file	arch/x86/x86/vga_post.c		vga_post
 file	arch/x86/pci/pci_machdep.c	pci
 #file	arch/x86/pci/pci_ranges.c	pci
 file	arch/x86/pci/pci_intr_machdep.c	pci
-file	arch/x86/pci/pci_msi_machdep.c	pci
-file	arch/x86/pci/msipic.c		pci
+file	arch/x86/pci/pci_msi_machdep.c	pci & ! no_pci_msi_msix
+file	arch/x86/pci/msipic.c		pci & ! no_pci_msi_msix
 
 file	arch/x86/pci/pciide_machdep.c	pciide_common
 



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

2018-12-20 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Dec 20 09:47:15 UTC 2018

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

Log Message:
Apply the same fix as if_wm.c:r1.606 to ixg(4). Pointed out by msaitoh@n.o, 
thanks.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 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.50 src/sys/dev/pci/ixgbe/ix_txrx.c:1.51
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.50	Thu Sep  6 08:20:12 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 20 09:47:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.50 2018/09/06 08:20:12 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.51 2018/12/20 09:47:15 knakahara Exp $ */
 
 /**
 
@@ -230,7 +230,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			i = m->m_pkthdr.flowid % adapter->num_queues;
 	} else
 #endif /* 0 */
-		i = cpu_index(curcpu()) % adapter->num_queues;
+		i = (cpu_index(curcpu()) % ncpu) % adapter->num_queues;
 
 	/* Check for a hung queue and pick alternative */
 	if (((1 << i) & adapter->active_queues) == 0)



CVS commit: src/sys/dev

2018-12-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 20 09:32:13 UTC 2018

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

Log Message:
- Don't setup WoL on non-WoL capable port.
- Setup PHY wakeup feature on PCH and newer. Tested on Thinkpad X220.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.609 -r1.610 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_wmvar.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/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.14 src/sys/dev/mii/inbmphyreg.h:1.15
--- src/sys/dev/mii/inbmphyreg.h:1.14	Thu Dec 13 05:22:44 2018
+++ src/sys/dev/mii/inbmphyreg.h	Thu Dec 20 09:32:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.14 2018/12/13 05:22:44 msaitoh Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.15 2018/12/20 09:32:12 msaitoh Exp $	*/
 /***
 Copyright (c) 2001-2015, Intel Corporation 
 All rights reserved.
@@ -160,6 +160,16 @@ POSSIBILITY OF SUCH DAMAGE.
 #define I218_ULP_CONFIG1_DIS_SMB_PERST	__BIT(12)
 
 #define	BM_WUC_PAGE		800
+
+#define	BM_RCTL			BME1000_REG(BM_WUC_PAGE, 0)
+#define BM_RCTL_UPE		0x0001 /* Unicast Promiscuous Mode */
+#define BM_RCTL_MPE		0x0002 /* Multicast Promiscuous Mode */
+#define BM_RCTL_MO_SHIFT	3  /* Multicast Offset Shift */
+#define BM_RCTL_MO_MASK		(3 << 3) /* Multicast Offset Mask */
+#define BM_RCTL_BAM		0x0020 /* Broadcast Accept Mode */
+#define BM_RCTL_PMCF		0x0040 /* Pass MAC Control Frames */
+#define BM_RCTL_RFCE		0x0080 /* Rx Flow Control Enable */
+
 #define	BM_WUC			BME1000_REG(BM_WUC_PAGE, 1)
 #define	BM_WUC_ADDRESS_OPCODE	0x11
 #define	BM_WUC_DATA_OPCODE	0x12
@@ -169,6 +179,15 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	BM_WUC_HOST_WU_BIT	(1 << 4)
 #define	BM_WUC_ME_WU_BIT	(1 << 5)
 
+#define	BM_WUFC			BME1000_REG(BM_WUC_PAGE, 2)
+
 #define	I217_PROXY_CTRL		BME1000_REG(BM_WUC_PAGE, 70)
 #define I217_PROXY_CTRL_AUTO_DISABLE	0x0080
+
+#define BM_RAR_L(_i)		(BME1000_REG(BM_WUC_PAGE, 16 + ((_i) << 2)))
+#define BM_RAR_M(_i)		(BME1000_REG(BM_WUC_PAGE, 17 + ((_i) << 2)))
+#define BM_RAR_H(_i)		(BME1000_REG(BM_WUC_PAGE, 18 + ((_i) << 2)))
+#define BM_RAR_CTRL(_i)		(BME1000_REG(BM_WUC_PAGE, 19 + ((_i) << 2)))
+#define BM_MTA(_i)		(BME1000_REG(BM_WUC_PAGE, 128 + ((_i) << 1)))
+
 #endif /* _DEV_MII_INBMPHYREG_H_ */

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.609 src/sys/dev/pci/if_wm.c:1.610
--- src/sys/dev/pci/if_wm.c:1.609	Thu Dec 20 08:59:22 2018
+++ src/sys/dev/pci/if_wm.c	Thu Dec 20 09:32:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.609 2018/12/20 08:59:22 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.610 2018/12/20 09:32:13 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.609 2018/12/20 08:59:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.610 2018/12/20 09:32:13 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -710,6 +710,7 @@ static uint16_t	wm_check_alt_mac_addr(st
 static int	wm_read_mac_addr(struct wm_softc *, uint8_t *);
 static void	wm_set_ral(struct wm_softc *, const uint8_t *, int);
 static uint32_t	wm_mchash(struct wm_softc *, const uint8_t *);
+static int	wm_rar_count(struct wm_softc *);
 static void	wm_set_filter(struct wm_softc *);
 /* Reset and init related */
 static void	wm_set_vlan(struct wm_softc *);
@@ -829,7 +830,10 @@ static int	wm_gmii_i80003_readreg(device
 static void	wm_gmii_i80003_writereg(device_t, int, int, int);
 static int	wm_gmii_bm_readreg(device_t, int, int);
 static void	wm_gmii_bm_writereg(device_t, int, int, int);
-static void	wm_access_phy_wakeup_reg_bm(device_t, int, int16_t *, int);
+static int	wm_enable_phy_wakeup_reg_access_bm(device_t, uint16_t *);
+static int	wm_disable_phy_wakeup_reg_access_bm(device_t, uint16_t *);
+static int	wm_access_phy_wakeup_reg_bm(device_t, int, int16_t *, int,
+	bool);
 static int	wm_gmii_hv_readreg(device_t, int, int);
 static int	wm_gmii_hv_readreg_locked(device_t, int, int, uint16_t *);
 static void	wm_gmii_hv_writereg(device_t, int, int, int);
@@ -954,7 +958,7 @@ static void	wm_init_manageability(struct
 static void	wm_release_manageability(struct wm_softc *);
 static void	wm_get_wakeup(struct wm_softc *);
 static int	wm_ulp_disable(struct wm_softc *);
-static void	wm_enable_phy_wakeup(struct wm_softc *);
+static int	wm_enable_phy_wakeup(struct wm_softc *);
 static void	wm_igp3_phy_powerdown_workaround_ich8lan(struct wm_softc *);
 static void	wm_suspend_workarounds_ich8lan(struct wm_softc *);
 static int	wm_resume_workarounds_pchlan(struct wm_softc *);
@@ -972,6 +976,7 @@ static void	

CVS commit: src/share/man/man4

2018-12-20 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec 20 09:17:04 UTC 2018

Modified Files:
src/share/man/man4: options.4

Log Message:
Close .Bl directive properly


To generate a diff of this commit:
cvs rdiff -u -r1.494 -r1.495 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.494 src/share/man/man4/options.4:1.495
--- src/share/man/man4/options.4:1.494	Thu Dec 20 08:32:55 2018
+++ src/share/man/man4/options.4	Thu Dec 20 09:17:04 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.494 2018/12/20 08:32:55 cherry Exp $
+.\"	$NetBSD: options.4,v 1.495 2018/12/20 09:17:04 cherry Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -2685,6 +2685,7 @@ underlined
 .It 4
 bolded
 .El
+.El
 .Ss x86-specific Options
 .Bl -ohang
 .It Cd options NO_PREEMPTION
@@ -2692,7 +2693,6 @@ Disables
 .Xr kpreempt 9
 support in the kernel.
 .El
-.El
 .\" The following requests should be uncommented and used where appropriate.
 .\" .Sh FILES
 .\" .Sh EXAMPLES



CVS commit: src/sys/dev/pci

2018-12-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 20 08:59:22 UTC 2018

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

Log Message:
 Fix WoL capability detection on ICH and PCH.


To generate a diff of this commit:
cvs rdiff -u -r1.608 -r1.609 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.608 src/sys/dev/pci/if_wm.c:1.609
--- src/sys/dev/pci/if_wm.c:1.608	Thu Dec 20 02:38:28 2018
+++ src/sys/dev/pci/if_wm.c	Thu Dec 20 08:59:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.608 2018/12/20 02:38:28 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.609 2018/12/20 08:59:22 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.608 2018/12/20 02:38:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.609 2018/12/20 08:59:22 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2379,7 +2379,7 @@ alloc_retry:
 	 */
 	wm_gmii_setup_phytype(sc, 0, 0);
 
-	/* check for WM_F_WOL on some chips before wm_reset() */
+	/* Check for WM_F_WOL on some chips before wm_reset() */
 	switch (sc->sc_type) {
 	case WM_T_ICH8:
 	case WM_T_ICH9:
@@ -2395,6 +2395,9 @@ alloc_retry:
 	default:
 		break;
 	}
+	if ((eeprom_data & apme_mask) != 0)
+		sc->sc_flags |= WM_F_WOL;
+
 	/* Reset the chip to a known state. */
 	wm_reset(sc);
 
@@ -2528,7 +2531,6 @@ alloc_retry:
 		wm_nvm_read(sc, NVM_OFF_CFG3_PORTA, 1, _data);
 		break;
 	}
-
 	/* Check for WM_F_WOL flag after the setting of the EEPROM stuff */
 	if ((eeprom_data & apme_mask) != 0)
 		sc->sc_flags |= WM_F_WOL;



CVS commit: src/share/man/man4

2018-12-20 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec 20 08:32:55 UTC 2018

Modified Files:
src/share/man/man4: options.4

Log Message:
Document 'options NO_PREEMPTION'

With prompting from Christoph Badura.


To generate a diff of this commit:
cvs rdiff -u -r1.493 -r1.494 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.493 src/share/man/man4/options.4:1.494
--- src/share/man/man4/options.4:1.493	Wed Dec 19 13:57:45 2018
+++ src/share/man/man4/options.4	Thu Dec 20 08:32:55 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.493 2018/12/19 13:57:45 maxv Exp $
+.\"	$NetBSD: options.4,v 1.494 2018/12/20 08:32:55 cherry Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -2685,6 +2685,13 @@ underlined
 .It 4
 bolded
 .El
+.Ss x86-specific Options
+.Bl -ohang
+.It Cd options NO_PREEMPTION
+Disables
+.Xr kpreempt 9
+support in the kernel.
+.El
 .El
 .\" The following requests should be uncommented and used where appropriate.
 .\" .Sh FILES