CVS commit: src

2023-09-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Sep  4 02:21:17 UTC 2023

Modified Files:
src: build.sh

Log Message:
build.sh: add support for git worktree

Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)

src$ git worktree add ../src-clean-tree
[...]
src$ (cd ../src-clean-tree && ./build.sh tools)
[...]
ERROR: Cannot determine VCS for '.../src-clean-tree/'

XXX: pullup-10 pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.373 src/build.sh:1.374
--- src/build.sh:1.373	Tue Jul 18 16:59:57 2023
+++ src/build.sh	Mon Sep  4 02:21:17 2023
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.373 2023/07/18 16:59:57 lukem Exp $
+#	$NetBSD: build.sh,v 1.374 2023/09/04 02:21:17 khorben Exp $
 #
 # Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2030,7 +2030,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src

2023-09-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Sep  4 02:21:17 UTC 2023

Modified Files:
src: build.sh

Log Message:
build.sh: add support for git worktree

Git supports multiple working trees attached to the same repository,
with the git-worktree(1) subcommand.

When building from a Git working tree, the repository metadata in .git
from the top source directory is a file (containing the actual location
of the metadata) instead of the usual directory structure. With this
change, build.sh allows .git to be a directory or a regular file
instead, therefore letting the sources build as expected from a Git
working tree.

To test: (without this patch)

src$ git worktree add ../src-clean-tree
[...]
src$ (cd ../src-clean-tree && ./build.sh tools)
[...]
ERROR: Cannot determine VCS for '.../src-clean-tree/'

XXX: pullup-10 pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/build.sh

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



CVS commit: src/share/man/man4

2023-05-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  9 22:00:00 UTC 2023

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

Log Message:
video(4): fix a typo

>From Li-Wen Hsu in PR misc/57364; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/video.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/video.4
diff -u src/share/man/man4/video.4:1.10 src/share/man/man4/video.4:1.11
--- src/share/man/man4/video.4:1.10	Tue Mar 18 18:20:39 2014
+++ src/share/man/man4/video.4	Tue May  9 22:00:00 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: video.4,v 1.10 2014/03/18 18:20:39 riastradh Exp $
+.\"	$NetBSD: video.4,v 1.11 2023/05/09 22:00:00 khorben Exp $
 .\"
 .\" Copyright (c) 2008 Patrick Mahoney
 .\" All rights reserved.
@@ -92,7 +92,7 @@ filled by the driver:
 describes the driver used by this device,
 .Va card
 describes the video capture card or camera, and
-.Va buf_info
+.Va bus_info
 represents the bus to which the hardware device is attached.
 .Pp
 The



CVS commit: src/share/man/man4

2023-05-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  9 22:00:00 UTC 2023

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

Log Message:
video(4): fix a typo

>From Li-Wen Hsu in PR misc/57364; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/video.4

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



CVS commit: src/sys

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 03:34:44 UTC 2022

Modified Files:
src/sys/dev/pci: emuxki.c emuxkivar.h
src/sys/modules/emuxki: Makefile.inc
Added Files:
src/sys/dev/pci: emuxki_boards.c emuxki_boards.h

Log Message:
emuxki(4): import a list of board definitions

This is inspired by the cxdtv(4) driver.

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870, PCI)
and with a Sound Blaster Audigy Rx 7.1 (SB1550, PCIe).

Additional sound cards sponsored by the NetBSD Foundation; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/emuxki_boards.c \
src/sys/dev/pci/emuxki_boards.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/emuxkivar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/emuxki/Makefile.inc

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/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.75 src/sys/dev/pci/emuxki.c:1.76
--- src/sys/dev/pci/emuxki.c:1.75	Wed Sep  7 01:00:37 2022
+++ src/sys/dev/pci/emuxki.c	Wed Sep  7 03:34:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.75 2022/09/07 01:00:37 khorben Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.75 2022/09/07 01:00:37 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.76 2022/09/07 03:34:43 khorben Exp $");
 
 #include 
 #include 
@@ -56,6 +56,7 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1
 
 #include 
 #include 
+#include 
 
 /* #define EMUXKI_DEBUG 1 */
 #ifdef EMUXKI_DEBUG
@@ -74,7 +75,6 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1
  */
 
 #define EMU_PCI_CBIO		(0x10)
-#define EMU_SUBSYS_APS		(0x40011102)
 
 /* blackmagic */
 #define X1(x)		((sc->sc_type & EMUXKI_AUDIGY) ? EMU_A_##x : EMU_##x)
@@ -357,20 +357,17 @@ static int
 emuxki_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct pci_attach_args *pa;
+	pcireg_t reg;
 
 	pa = aux;
-	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_CREATIVELABS)
-		return 0;
 
-	switch (PCI_PRODUCT(pa->pa_id)) {
-	case PCI_PRODUCT_CREATIVELABS_SBLIVE:
-	case PCI_PRODUCT_CREATIVELABS_SBLIVE2:
-	case PCI_PRODUCT_CREATIVELABS_AUDIGY:
-	case PCI_PRODUCT_CREATIVELABS_SBAUDIGY4:
+	reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+	if (emuxki_board_lookup(PCI_VENDOR(pa->pa_id),
+PCI_PRODUCT(pa->pa_id), reg,
+PCI_REVISION(pa->pa_class)) != NULL)
 		return 1;
-	default:
-		return 0;
-	}
+
+	return 0;
 }
 
 static void
@@ -378,6 +375,7 @@ emuxki_attach(device_t parent, device_t 
 {
 	struct emuxki_softc *sc;
 	struct pci_attach_args *pa;
+	const struct emuxki_board *sb;
 	pci_intr_handle_t ih;
 	const char *intrstr;
 	char intrbuf[PCI_INTRSTR_LEN];
@@ -387,7 +385,14 @@ emuxki_attach(device_t parent, device_t 
 	sc->sc_dev = self;
 	pa = aux;
 
+	reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+	sb = emuxki_board_lookup(PCI_VENDOR(pa->pa_id),
+  PCI_PRODUCT(pa->pa_id), reg,
+  PCI_REVISION(pa->pa_class));
+	KASSERT(sb != NULL);
+
 	pci_aprint_devinfo(pa, "Audio controller");
+	aprint_normal_dev(self, "%s [%s]\n", sb->sb_name, sb->sb_board);
 	DPRINTF("dmat=%p\n", (char *)pa->pa_dmat);
 
 	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -434,28 +439,17 @@ emuxki_attach(device_t parent, device_t 
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
 	/* XXX it's unknown whether APS is made from Audigy as well */
-	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_SBAUDIGY4) {
-		sc->sc_type = EMUXKI_AUDIGY;
-		sc->sc_type |= EMUXKI_AUDIGY2;
-		sc->sc_type |= EMUXKI_AUDIGY2_VALUE;
-		strlcpy(sc->sc_audv.name, "Audigy2 (value)",
+	sc->sc_type = sb->sb_flags;
+	if (sc->sc_type & EMUXKI_AUDIGY2_CA0108) {
+		strlcpy(sc->sc_audv.name, "Audigy2+CA0108",
 		sizeof(sc->sc_audv.name));
-	} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) {
-		sc->sc_type = EMUXKI_AUDIGY;
-		if (PCI_REVISION(pa->pa_class) == 0x04) {
-			sc->sc_type |= EMUXKI_AUDIGY2;
-			strlcpy(sc->sc_audv.name, "Audigy2",
-			sizeof(sc->sc_audv.name));
-		} else {
-			strlcpy(sc->sc_audv.name, "Audigy",
-			sizeof(sc->sc_audv.name));
-		}
-	} else if (pci_conf_read(pa->pa_pc, pa->pa_tag,
-	PCI_SUBSYS_ID_REG) == EMU_SUBSYS_APS) {
-		sc->sc_type = EMUXKI_APS;
+	} else if (sc->sc_type & EMUXKI_AUDIGY2) {
+		strlcpy(sc->sc_audv.name, "Audigy2", sizeof(sc->sc_audv.name));
+	} else if (sc->sc_type & EMUXKI_AUDIGY) {
+		strlcpy(sc->sc_audv.name, "Audigy", sizeof(sc->sc_audv.name));
+	} else if (sc->sc_type & EMUXKI_APS) {
 		strlcpy(sc->sc_audv.name, "E-mu APS", sizeof(sc->sc_audv.name));
 	} else {
-		sc->sc_type = EMUXKI_SBLIVE;
 		strlcpy(sc->sc_audv.name, "SB Live!", sizeof(sc->sc_audv.name));
 	}
 	snprintf(sc->sc_audv.version, 

CVS commit: src/sys

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 03:34:44 UTC 2022

Modified Files:
src/sys/dev/pci: emuxki.c emuxkivar.h
src/sys/modules/emuxki: Makefile.inc
Added Files:
src/sys/dev/pci: emuxki_boards.c emuxki_boards.h

Log Message:
emuxki(4): import a list of board definitions

This is inspired by the cxdtv(4) driver.

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870, PCI)
and with a Sound Blaster Audigy Rx 7.1 (SB1550, PCIe).

Additional sound cards sponsored by the NetBSD Foundation; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/emuxki_boards.c \
src/sys/dev/pci/emuxki_boards.h
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/emuxkivar.h
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/emuxki/Makefile.inc

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



CVS commit: src/sys/dev/pci

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 01:00:37 UTC 2022

Modified Files:
src/sys/dev/pci: emuxki.c
Added Files:
src/sys/dev/pci: emuxkivar.h

Log Message:
emuxki(4): place struct emuxki_softc into its own file

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r0 -r1.15 src/sys/dev/pci/emuxkivar.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/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.74 src/sys/dev/pci/emuxki.c:1.75
--- src/sys/dev/pci/emuxki.c:1.74	Wed Sep  7 00:44:07 2022
+++ src/sys/dev/pci/emuxki.c	Wed Sep  7 01:00:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.74 2022/09/07 00:44:07 khorben Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.75 2022/09/07 01:00:37 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.74 2022/09/07 00:44:07 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.75 2022/09/07 01:00:37 khorben Exp $");
 
 #include 
 #include 
@@ -54,16 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1
 #include 
 #include 
 
-#include 
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
 #include 
+#include 
 
 /* #define EMUXKI_DEBUG 1 */
 #ifdef EMUXKI_DEBUG
@@ -84,109 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1
 #define EMU_PCI_CBIO		(0x10)
 #define EMU_SUBSYS_APS		(0x40011102)
 
-#define EMU_PTESIZE		(4096)
-#define EMU_MINPTE		(3)
-/*
- * Hardware limit of PTE is 4096 entry but it's too big for single voice.
- * Reasonable candidate is:
- *  48kHz * 2ch * 2byte * 1sec * 3buf/EMU_PTESIZE = 141
- * and then round it up to 2^n.
- */
-#define EMU_MAXPTE		(256)
-#define EMU_NUMCHAN		(64)
-
-/*
- * Internal recording DMA buffer
- */
-/* Recommend the same size as EMU_PTESIZE to be symmetrical for play/rec */
-#define EMU_REC_DMABLKSIZE	(4096)
-/* must be EMU_REC_DMABLKSIZE * 2 */
-#define EMU_REC_DMASIZE		(8192)
-/* must be EMU_RECBS_BUFSIZE_(EMU_REC_DMASIZE) */
-#define EMU_REC_BUFSIZE_RECBS	EMU_RECBS_BUFSIZE_8192
-
-/*
- * DMA memory management
- */
-
-#define EMU_DMA_ALIGN		(4096)
-#define EMU_DMA_NSEGS		(1)
-
-struct dmamem {
-	bus_dma_tag_t		dmat;
-	bus_size_t		size;
-	bus_size_t		align;
-	bus_size_t		bound;
-	bus_dma_segment_t	*segs;
-	int			nsegs;
-	int			rsegs;
-	void *			kaddr;
-	bus_dmamap_t		map;
-};
-
-#define KERNADDR(ptr)		((void *)((ptr)->kaddr))
-/*
- * (ptr)->segs[] is CPU's PA translated by CPU's MMU.
- * (ptr)->map->dm_segs[] is PCI device's PA translated by PCI's MMU.
- */
-#define DMASEGADDR(ptr, segno)	((ptr)->map->dm_segs[segno].ds_addr)
-#define DMAADDR(ptr)		DMASEGADDR(ptr, 0)
-#define DMASIZE(ptr)		((ptr)->size)
-
-struct emuxki_softc {
-	device_t		sc_dev;
-	device_t		sc_audev;
-	enum {
-		EMUXKI_SBLIVE = 0x00,
-		EMUXKI_AUDIGY = 0x01,
-		EMUXKI_AUDIGY2 = 0x02,
-		EMUXKI_AUDIGY2_VALUE = 0x04,
-		EMUXKI_LIVE_5_1 = 0x08,
-		EMUXKI_APS = 0x10
-	} sc_type;
-	audio_device_t		sc_audv;	/* for GETDEV */
-
-	/* Autoconfig parameters */
-	bus_space_tag_t		sc_iot;
-	bus_space_handle_t	sc_ioh;
-	bus_addr_t		sc_iob;
-	bus_size_t		sc_ios;
-	pci_chipset_tag_t	sc_pc;		/* PCI tag */
-	bus_dma_tag_t		sc_dmat;
-	void			*sc_ih;		/* interrupt handler */
-	kmutex_t		sc_intr_lock;
-	kmutex_t		sc_lock;
-	kmutex_t		sc_index_lock;
-
-	/* register parameters */
-	struct dmamem		*ptb;		/* page table */
-
-	struct dmamem		*pmem;		/* play memory */
-	void			(*pintr)(void *);
-	void			*pintrarg;
-	audio_params_t		play;
-	uint32_t		pframesize;
-	uint32_t		pblksize;
-	uint32_t		plength;
-	uint32_t		poffset;
-
-	struct dmamem		*rmem;		/* rec internal memory */
-	void			(*rintr)(void *);
-	void			*rintrarg;
-	audio_params_t		rec;
-	void			*rptr;		/* rec MI ptr */
-	int			rcurrent;	/* rec software trans count */
-	int			rframesize;
-	int			rblksize;
-	int			rlength;
-	int			roffset;
-
-	/* others */
-
-	struct ac97_host_if	hostif;
-	struct ac97_codec_if	*codecif;
-};
-
 /* blackmagic */
 #define X1(x)		((sc->sc_type & EMUXKI_AUDIGY) ? EMU_A_##x : EMU_##x)
 #define X2(x, y)	((sc->sc_type & EMUXKI_AUDIGY) \

Added files:

Index: src/sys/dev/pci/emuxkivar.h
diff -u /dev/null src/sys/dev/pci/emuxkivar.h:1.15
--- /dev/null	Wed Sep  7 01:00:37 2022
+++ src/sys/dev/pci/emuxkivar.h	Wed Sep  7 01:00:37 2022
@@ -0,0 +1,153 @@
+/*	$NetBSD: emuxkivar.h,v 1.15 2022/09/07 01:00:37 khorben Exp $	*/
+
+/*-
+ * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Yannick Montulet, and by Andrew Doran.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following 

CVS commit: src/sys/dev/pci

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 01:00:37 UTC 2022

Modified Files:
src/sys/dev/pci: emuxki.c
Added Files:
src/sys/dev/pci: emuxkivar.h

Log Message:
emuxki(4): place struct emuxki_softc into its own file

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r0 -r1.15 src/sys/dev/pci/emuxkivar.h

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



CVS commit: src/sys/dev/pci

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:44:07 UTC 2022

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

Log Message:
emuxki(4): restrict DMA memory within the first 2GB

As implemented in the driver, the EMU10K1 chip can only address memory
up to 31-bit addresses.

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870, PCI)
and with a Sound Blaster Audigy Rx 7.1 (SB1550, PCIe).

Additional sound cards sponsored by the NetBSD Foundation; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/emuxki.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/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.73 src/sys/dev/pci/emuxki.c:1.74
--- src/sys/dev/pci/emuxki.c:1.73	Wed Sep  7 00:29:23 2022
+++ src/sys/dev/pci/emuxki.c	Wed Sep  7 00:44:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.73 2022/09/07 00:29:23 khorben Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.74 2022/09/07 00:44:07 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.73 2022/09/07 00:29:23 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.74 2022/09/07 00:44:07 khorben Exp $");
 
 #include 
 #include 
@@ -506,7 +506,15 @@ emuxki_attach(device_t parent, device_t 
 	mutex_init(>sc_index_lock, MUTEX_DEFAULT, IPL_AUDIO);
 
 	sc->sc_pc   = pa->pa_pc;
-	sc->sc_dmat = pa->pa_dmat;
+
+	/* EMU10K1 can only address 31 bits (2GB) */
+	if (bus_dmatag_subregion(pa->pa_dmat, 0, ((uint32_t)1 << 31) - 1,
+	&(sc->sc_dmat), BUS_DMA_NOWAIT) != 0) {
+		aprint_error_dev(self,
+		"WARNING: failed to restrict dma range,"
+		" falling back to parent bus dma range\n");
+		sc->sc_dmat = pa->pa_dmat;
+	}
 
 	reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
 	reg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MASTER_ENABLE |



CVS commit: src/sys/dev/pci

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:44:07 UTC 2022

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

Log Message:
emuxki(4): restrict DMA memory within the first 2GB

As implemented in the driver, the EMU10K1 chip can only address memory
up to 31-bit addresses.

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870, PCI)
and with a Sound Blaster Audigy Rx 7.1 (SB1550, PCIe).

Additional sound cards sponsored by the NetBSD Foundation; thanks!


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

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



CVS commit: src/sys/dev/ic

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:34:20 UTC 2022

Modified Files:
src/sys/dev/ic: tpm.c

Log Message:
tpm(4): add missing newline character in device_printf()

Observed with on a Sun Ultra 24, NetBSD/amd64:

tpm0 at acpi0 (TPM, IFX0102-1): io 0x4e-0x4f,0x4700-0x470b mem 
0xfed4-0xfed44fff
tpm0: device 0x000b15d1 rev 0x10
tpm0: read 8 bytes, expected 10tpm0: deactivating entropy source


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/tpm.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/tpm.c
diff -u src/sys/dev/ic/tpm.c:1.25 src/sys/dev/ic/tpm.c:1.26
--- src/sys/dev/ic/tpm.c:1.25	Sat Jan 29 12:27:30 2022
+++ src/sys/dev/ic/tpm.c	Wed Sep  7 00:34:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpm.c,v 1.25 2022/01/29 12:27:30 riastradh Exp $	*/
+/*	$NetBSD: tpm.c,v 1.26 2022/09/07 00:34:19 khorben Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.25 2022/01/29 12:27:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.26 2022/09/07 00:34:19 khorben Exp $");
 
 #include 
 #include 
@@ -543,7 +543,7 @@ tpm12_rng(struct tpm_softc *sc, unsigned
 
 	/* Verify the response header looks sensible.  */
 	if (nread != sizeof(response.hdr)) {
-		device_printf(sc->sc_dev, "read %zu bytes, expected %zu",
+		device_printf(sc->sc_dev, "read %zu bytes, expected %zu\n",
 		nread, sizeof(response.hdr));
 		goto out;
 	}



CVS commit: src/sys/dev/ic

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:34:20 UTC 2022

Modified Files:
src/sys/dev/ic: tpm.c

Log Message:
tpm(4): add missing newline character in device_printf()

Observed with on a Sun Ultra 24, NetBSD/amd64:

tpm0 at acpi0 (TPM, IFX0102-1): io 0x4e-0x4f,0x4700-0x470b mem 
0xfed4-0xfed44fff
tpm0: device 0x000b15d1 rev 0x10
tpm0: read 8 bytes, expected 10tpm0: deactivating entropy source


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/tpm.c

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



CVS commit: src

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:29:23 UTC 2022

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386
src/sys/arch/i386/conf: MODULAR
src/sys/dev/pci: emuxki.c
src/sys/modules: Makefile
Added Files:
src/sys/modules/emuxki: Makefile Makefile.inc emuxki.ioconf

Log Message:
emuxki(4): allow building as a module

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870)

Note that this required setting outputs.master to the maximum value
allowed (255) to get sound out, and then cranking the volume pretty
high.

Additional sound cards sponsored by the NetBSD Foundation; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.94 -r1.95 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/conf/MODULAR
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r1.269 -r1.270 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/emuxki/Makefile \
src/sys/modules/emuxki/Makefile.inc src/sys/modules/emuxki/emuxki.ioconf

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

Modified files:

Index: src/distrib/sets/lists/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.96 src/distrib/sets/lists/modules/md.amd64:1.97
--- src/distrib/sets/lists/modules/md.amd64:1.96	Fri Aug  5 08:48:36 2022
+++ src/distrib/sets/lists/modules/md.amd64	Wed Sep  7 00:29:23 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.96 2022/08/05 08:48:36 riastradh Exp $
+# $NetBSD: md.amd64,v 1.97 2022/09/07 00:29:23 khorben Exp $
 #
 ./@MODULEDIR@/acpiacadmodules-base-kernel	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		modules-base-kernel	kmod
@@ -134,6 +134,8 @@
 ./@MODULEDIR@/dtrace_syscall_netbsd32/dtrace_syscall_netbsd32.kmod	modules-base-kernel	kmod,dtrace
 ./@MODULEDIR@/emdtvmodules-base-kernel	kmod
 ./@MODULEDIR@/emdtv/emdtv.kmod			modules-base-kernel	kmod
+./@MODULEDIR@/emuxkimodules-base-kernel	kmod
+./@MODULEDIR@/emuxki/emuxki.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/estmodules-base-kernel	kmod
 ./@MODULEDIR@/est/est.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/exec_elf32			modules-base-kernel	kmod

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.94 src/distrib/sets/lists/modules/md.i386:1.95
--- src/distrib/sets/lists/modules/md.i386:1.94	Fri Aug  5 08:48:36 2022
+++ src/distrib/sets/lists/modules/md.i386	Wed Sep  7 00:29:23 2022
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.94 2022/08/05 08:48:36 riastradh Exp $
+# $NetBSD: md.i386,v 1.95 2022/09/07 00:29:23 khorben Exp $
 #
 ./@MODULEDIR@/acpiacadmodules-base-kernel	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		modules-base-kernel	kmod
@@ -86,6 +86,8 @@
 ./@MODULEDIR@/dtrace_syscall_linux/dtrace_syscall_linux.kmod	modules-base-kernel	kmod,dtrace
 ./@MODULEDIR@/emdtvmodules-base-kernel	kmod
 ./@MODULEDIR@/emdtv/emdtv.kmod			modules-base-kernel	kmod
+./@MODULEDIR@/emuxkimodules-base-kernel	kmod
+./@MODULEDIR@/emuxki/emuxki.kmod		modules-base-kernel	kmod
 ./@MODULEDIR@/estmodules-base-kernel	kmod
 ./@MODULEDIR@/est/est.kmod			modules-base-kernel	kmod
 ./@MODULEDIR@/exec_aoutmodules-base-kernel	kmod

Index: src/sys/arch/i386/conf/MODULAR
diff -u src/sys/arch/i386/conf/MODULAR:1.9 src/sys/arch/i386/conf/MODULAR:1.10
--- src/sys/arch/i386/conf/MODULAR:1.9	Tue Aug 17 22:00:29 2021
+++ src/sys/arch/i386/conf/MODULAR	Wed Sep  7 00:29:23 2022
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.9 2021/08/17 22:00:29 andvar Exp $
+# $NetBSD: MODULAR,v 1.10 2022/09/07 00:29:23 khorben Exp $
 #
 # MODULAR kernel
 # This kernel config prefers loading kernel drivers from file system.
@@ -54,6 +54,7 @@ no pseudo-device	vcoda		   # coda mi
 no uvideo*
 no pseye*
 
+no emuxki*
 no hdaudio*
 no hdafg*
 

Index: src/sys/dev/pci/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.72 src/sys/dev/pci/emuxki.c:1.73
--- src/sys/dev/pci/emuxki.c:1.72	Mon Aug 29 09:04:27 2022
+++ src/sys/dev/pci/emuxki.c	Wed Sep  7 00:29:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.72 2022/08/29 09:04:27 khorben Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.73 2022/09/07 00:29:23 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,10 +38,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.72 2022/08/29 09:04:27 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.73 2022/09/07 00:29:23 khorben Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -164,10 +165,10 @@ struct emuxki_softc {
 	void			(*pintr)(void *);
 	void			*pintrarg;
 	audio_params_t		play;
-	int			pframesize;
-	int			pblksize;
-	int			plength;
-	int			poffset;
+	uint32_t		pframesize;
+	uint32_t		pblksize;
+	uint32_t		plength;
+	uint32_t		poffset;
 
 	struct dmamem		*rmem;		/* rec internal memory */
 	void			(*rintr)(void *);
@@ 

CVS commit: src

2022-09-06 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Sep  7 00:29:23 UTC 2022

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386
src/sys/arch/i386/conf: MODULAR
src/sys/dev/pci: emuxki.c
src/sys/modules: Makefile
Added Files:
src/sys/modules/emuxki: Makefile Makefile.inc emuxki.ioconf

Log Message:
emuxki(4): allow building as a module

Tested on NetBSD/amd64 with a Sound Blaster Live! Value (CT4870)

Note that this required setting outputs.master to the maximum value
allowed (255) to get sound out, and then cranking the volume pretty
high.

Additional sound cards sponsored by the NetBSD Foundation; thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.94 -r1.95 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/conf/MODULAR
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r1.269 -r1.270 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/emuxki/Makefile \
src/sys/modules/emuxki/Makefile.inc src/sys/modules/emuxki/emuxki.ioconf

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



CVS commit: src/sys/dev/pci

2022-08-29 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Aug 29 09:04:27 UTC 2022

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

Log Message:
emuxki(4): add support for the Sound Blaster Audigy Rx

This is as per kern/56980. Confirmed working on one out of two different
computers, albeit with a strong hissing noise (same card, different
mainboard). The mixer settings seem to be irrelevant or not supported
though.

Original support inspired by the Linux driver, and confirmed with the
OpenBSD driver, itself originally from NetBSD.

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/emuxki.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/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.71 src/sys/dev/pci/emuxki.c:1.72
--- src/sys/dev/pci/emuxki.c:1.71	Sat Feb  6 05:15:03 2021
+++ src/sys/dev/pci/emuxki.c	Mon Aug 29 09:04:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.71 2021/02/06 05:15:03 isaki Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.72 2022/08/29 09:04:27 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.71 2021/02/06 05:15:03 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.72 2022/08/29 09:04:27 khorben Exp $");
 
 #include 
 #include 
@@ -139,8 +139,9 @@ struct emuxki_softc {
 		EMUXKI_SBLIVE = 0x00,
 		EMUXKI_AUDIGY = 0x01,
 		EMUXKI_AUDIGY2 = 0x02,
-		EMUXKI_LIVE_5_1 = 0x04,
-		EMUXKI_APS = 0x08
+		EMUXKI_AUDIGY2_VALUE = 0x04,
+		EMUXKI_LIVE_5_1 = 0x08,
+		EMUXKI_APS = 0x10
 	} sc_type;
 	audio_device_t		sc_audv;	/* for GETDEV */
 
@@ -475,6 +476,7 @@ emuxki_match(device_t parent, cfdata_t m
 	case PCI_PRODUCT_CREATIVELABS_SBLIVE:
 	case PCI_PRODUCT_CREATIVELABS_SBLIVE2:
 	case PCI_PRODUCT_CREATIVELABS_AUDIGY:
+	case PCI_PRODUCT_CREATIVELABS_SBAUDIGY4:
 		return 1;
 	default:
 		return 0;
@@ -534,7 +536,13 @@ emuxki_attach(device_t parent, device_t 
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
 	/* XXX it's unknown whether APS is made from Audigy as well */
-	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) {
+	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_SBAUDIGY4) {
+		sc->sc_type = EMUXKI_AUDIGY;
+		sc->sc_type |= EMUXKI_AUDIGY2;
+		sc->sc_type |= EMUXKI_AUDIGY2_VALUE;
+		strlcpy(sc->sc_audv.name, "Audigy2 (value)",
+		sizeof(sc->sc_audv.name));
+	} else if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_CREATIVELABS_AUDIGY) {
 		sc->sc_type = EMUXKI_AUDIGY;
 		if (PCI_REVISION(pa->pa_class) == 0x04) {
 			sc->sc_type |= EMUXKI_AUDIGY2;
@@ -703,7 +711,27 @@ emuxki_init(struct emuxki_softc *sc)
 	emuxki_write(sc, 0, EMU_SPCS1, spcs);
 	emuxki_write(sc, 0, EMU_SPCS2, spcs);
 
-	if (sc->sc_type & EMUXKI_AUDIGY2) {
+	if (sc->sc_type & EMUXKI_AUDIGY2_VALUE) {
+		/* Setup SRCMulti_I2S SamplingRate */
+		emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
+		emuxki_read(sc, 0, EMU_A2_SPDIF_SAMPLERATE) & 0xf1ff);
+
+		/* Setup SRCSel (Enable SPDIF, I2S SRCMulti) */
+		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA, EMU_A2_SRCSEL,
+		EMU_A2_SRCSEL_ENABLE_SPDIF | EMU_A2_SRCSEL_ENABLE_SRCMULTI);
+
+		/* Setup SRCMulti Input Audio Enable */
+		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA,
+		0x7b, 0xff00);
+
+		/* Setup SPDIF Out Audio Enable
+		 * The Audigy 2 Value has a separate SPDIF out,
+		 * so no need for a mixer switch */
+		emuxki_writeptr(sc, EMU_A2_PTR, EMU_A2_DATA,
+		0x7a, 0xff00);
+		emuxki_writeio_4(sc, EMU_A_IOCFG,
+		emuxki_readio_4(sc, EMU_A_IOCFG) & ~0x8); /* clear bit 3 */
+	} else if (sc->sc_type & EMUXKI_AUDIGY2) {
 		emuxki_write(sc, 0, EMU_A2_SPDIF_SAMPLERATE,
 		EMU_A2_SPDIF_UNKNOWN);
 
@@ -735,10 +763,12 @@ emuxki_init(struct emuxki_softc *sc)
 	EMU_INTE_VOLDECRENABLE |
 	EMU_INTE_MUTEENABLE);
 
-	if (sc->sc_type & EMUXKI_AUDIGY2) {
+	if (sc->sc_type & EMUXKI_AUDIGY2_VALUE) {
+		emuxki_writeio_4(sc, EMU_A_IOCFG,
+		0x0060 | emuxki_readio_4(sc, EMU_A_IOCFG));
+	} else if (sc->sc_type & EMUXKI_AUDIGY2) {
 		emuxki_writeio_4(sc, EMU_A_IOCFG,
-		emuxki_readio_4(sc, EMU_A_IOCFG) |
-		EMU_A_IOCFG_GPOUT0);
+		EMU_A_IOCFG_GPOUT0 | emuxki_readio_4(sc, EMU_A_IOCFG));
 	}
 
 	/* enable AUDIO bit */



CVS commit: src/sys/dev/pci

2022-08-29 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Aug 29 09:04:27 UTC 2022

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

Log Message:
emuxki(4): add support for the Sound Blaster Audigy Rx

This is as per kern/56980. Confirmed working on one out of two different
computers, albeit with a strong hissing noise (same card, different
mainboard). The mixer settings seem to be irrelevant or not supported
though.

Original support inspired by the Linux driver, and confirmed with the
OpenBSD driver, itself originally from NetBSD.

Tested on NetBSD/amd64.


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

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



CVS commit: src/sys/dev/microcode/radeon

2022-01-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Jan 10 01:47:49 UTC 2022

Modified Files:
src/sys/dev/microcode/radeon: Makefile

Log Message:
Typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/microcode/radeon/Makefile

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/microcode/radeon/Makefile
diff -u src/sys/dev/microcode/radeon/Makefile:1.8 src/sys/dev/microcode/radeon/Makefile:1.9
--- src/sys/dev/microcode/radeon/Makefile:1.8	Sun Sep 26 15:52:40 2021
+++ src/sys/dev/microcode/radeon/Makefile	Mon Jan 10 01:47:49 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2021/09/26 15:52:40 maya Exp $
+#	$NetBSD: Makefile,v 1.9 2022/01/10 01:47:49 khorben Exp $
 
 NOMAN=	# defined
 
@@ -65,7 +65,7 @@ FILES=	\
 	VERDE_ce.bin VERDE_mc.bin VERDE_mc2.bin VERDE_me.bin VERDE_pfp.bin \
 	VERDE_rlc.bin VERDE_smc.bin
 
-# radeondrmks needs these after mountroot, but before starting init.
+# radeondrmkms needs these after mountroot, but before starting init.
 FIRMWAREDIR=	/libdata/firmware
 
 .endif



CVS commit: src/sys/dev/microcode/radeon

2022-01-09 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Jan 10 01:47:49 UTC 2022

Modified Files:
src/sys/dev/microcode/radeon: Makefile

Log Message:
Typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/microcode/radeon/Makefile

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



CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:13:38 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: prng.c

Log Message:
prekern: add warnings upon problems collecting entropy

As submitted on port-amd64@ (part 3/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/stand/prekern/prng.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/amd64/stand/prekern/prng.c
diff -u src/sys/arch/amd64/stand/prekern/prng.c:1.4 src/sys/arch/amd64/stand/prekern/prng.c:1.5
--- src/sys/arch/amd64/stand/prekern/prng.c:1.4	Tue May  4 21:10:25 2021
+++ src/sys/arch/amd64/stand/prekern/prng.c	Tue May  4 21:13:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: prng.c,v 1.4 2021/05/04 21:10:25 khorben Exp $	*/
+/*	$NetBSD: prng.c,v 1.5 2021/05/04 21:13:38 khorben Exp $	*/
 
 /*
  * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
@@ -84,6 +84,7 @@ prng_get_entropy_file(SHA512_CTX *ctx)
 	uint8_t digest[SHA1_DIGEST_LENGTH];
 	rndsave_t *rndsave;
 	SHA1_CTX sig;
+	size_t count = 0;
 
 	biml =
 	(struct btinfo_modulelist *)prng_lookup_bootinfo(BTINFO_MODULELIST);
@@ -117,7 +118,10 @@ prng_get_entropy_file(SHA512_CTX *ctx)
 		}
 
 		SHA512_Update(ctx, rndsave->data, sizeof(rndsave->data));
+		count++;
 	}
+	if (count == 0)
+		print_state(STATE_WARNING, "No entropy file could be loaded");
 }
 
 /*
@@ -168,6 +172,8 @@ prng_init(void)
 		cpuid(0x01, 0x00, descs);
 		has_rdrand = (descs[2] & CPUID2_RDRAND) != 0;
 	}
+	if (!has_rdseed && !has_rdrand)
+		print_state(STATE_WARNING, "No CPU entropy feature detected");
 
 	SHA512_Init();
 	prng_get_entropy_file();



CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:13:38 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: prng.c

Log Message:
prekern: add warnings upon problems collecting entropy

As submitted on port-amd64@ (part 3/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/stand/prekern/prng.c

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



CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:10:25 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: prng.c

Log Message:
prekern: do not choke on bad entropy files

As submitted on port-amd64@ (part 2/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/stand/prekern/prng.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/amd64/stand/prekern/prng.c
diff -u src/sys/arch/amd64/stand/prekern/prng.c:1.3 src/sys/arch/amd64/stand/prekern/prng.c:1.4
--- src/sys/arch/amd64/stand/prekern/prng.c:1.3	Thu May 21 08:20:25 2020
+++ src/sys/arch/amd64/stand/prekern/prng.c	Tue May  4 21:10:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: prng.c,v 1.3 2020/05/21 08:20:25 maxv Exp $	*/
+/*	$NetBSD: prng.c,v 1.4 2021/05/04 21:10:25 khorben Exp $	*/
 
 /*
  * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
@@ -98,7 +98,9 @@ prng_get_entropy_file(SHA512_CTX *ctx)
 			continue;
 		}
 		if (bi->len != sizeof(rndsave_t)) {
-			fatal("rndsave_t size mismatch");
+			print_state(STATE_WARNING,
+	"size mismatch in entropy file");
+			continue;
 		}
 		rndsave = (rndsave_t *)(vaddr_t)bi->base;
 
@@ -109,7 +111,9 @@ prng_get_entropy_file(SHA512_CTX *ctx)
 		SHA1Update(, rndsave->data, sizeof(rndsave->data));
 		SHA1Final(digest, );
 		if (memcmp(digest, rndsave->digest, sizeof(digest))) {
-			fatal("bad SHA1 checksum");
+			print_state(STATE_WARNING,
+	"bad SHA1 checksum in entropy file");
+			continue;
 		}
 
 		SHA512_Update(ctx, rndsave->data, sizeof(rndsave->data));



CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:10:25 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: prng.c

Log Message:
prekern: do not choke on bad entropy files

As submitted on port-amd64@ (part 2/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/stand/prekern/prng.c

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



CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:09:16 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: console.c elf.c mm.c prekern.c
prekern.h

Log Message:
prekern: add support for warning messages

As submitted on port-amd64@ (part 1/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/stand/prekern/console.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/stand/prekern/elf.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/stand/prekern/mm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amd64/stand/prekern/prekern.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amd64/stand/prekern/prekern.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/amd64/stand/prekern/console.c
diff -u src/sys/arch/amd64/stand/prekern/console.c:1.6 src/sys/arch/amd64/stand/prekern/console.c:1.7
--- src/sys/arch/amd64/stand/prekern/console.c:1.6	Sat May 23 08:25:32 2020
+++ src/sys/arch/amd64/stand/prekern/console.c	Tue May  4 21:09:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: console.c,v 1.6 2020/05/23 08:25:32 maxv Exp $	*/
+/*	$NetBSD: console.c,v 1.7 2021/05/04 21:09:16 khorben Exp $	*/
 
 /*
  * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
@@ -100,13 +100,24 @@ void print(char *buf)
 	print_ext(WHITE_ON_BLACK, buf);
 }
 
-void print_state(bool ok, char *buf)
+void print_state(state_t state, char *buf)
 {
 	print("[");
-	if (ok)
-		print_ext(GREEN_ON_BLACK, "+");
-	else
-		print_ext(RED_ON_BLACK, "!");
+	switch (state)
+	{
+		case STATE_NORMAL:
+			print_ext(GREEN_ON_BLACK, "+");
+			break;
+		case STATE_ERROR:
+			print_ext(RED_ON_BLACK, "!");
+			break;
+		case STATE_WARNING:
+			print_ext(YELLOW_ON_BLACK, "*");
+			break;
+		default:
+			print_ext(WHITE_ON_BLACK, "?");
+			break;
+	}
 	print("] ");
 	print(buf);
 	print("\n");

Index: src/sys/arch/amd64/stand/prekern/elf.c
diff -u src/sys/arch/amd64/stand/prekern/elf.c:1.21 src/sys/arch/amd64/stand/prekern/elf.c:1.22
--- src/sys/arch/amd64/stand/prekern/elf.c:1.21	Thu May  7 17:58:26 2020
+++ src/sys/arch/amd64/stand/prekern/elf.c	Tue May  4 21:09:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf.c,v 1.21 2020/05/07 17:58:26 maxv Exp $	*/
+/*	$NetBSD: elf.c,v 1.22 2021/05/04 21:09:16 khorben Exp $	*/
 
 /*
  * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
@@ -426,7 +426,7 @@ elf_kernel_reloc(void)
 	Elf_Sym *sym;
 	size_t i, j;
 
-	print_state(true, "ELF info created");
+	print_state(STATE_NORMAL, "ELF info created");
 
 	/*
 	 * Update all symbol values with the appropriate offset.
@@ -447,7 +447,7 @@ elf_kernel_reloc(void)
 		}
 	}
 
-	print_state(true, "Symbol values updated");
+	print_state(STATE_NORMAL, "Symbol values updated");
 
 	/*
 	 * Perform relocations without addend if there are any.
@@ -482,7 +482,7 @@ elf_kernel_reloc(void)
 		}
 	}
 
-	print_state(true, "REL relocations applied");
+	print_state(STATE_NORMAL, "REL relocations applied");
 
 	/*
 	 * Perform relocations with addend if there are any.
@@ -517,7 +517,7 @@ elf_kernel_reloc(void)
 		}
 	}
 
-	print_state(true, "RELA relocations applied");
+	print_state(STATE_NORMAL, "RELA relocations applied");
 
 	/*
 	 * Get the entry point.
@@ -527,7 +527,7 @@ elf_kernel_reloc(void)
 		fatal("elf_kernel_reloc: entry point not found");
 	}
 
-	print_state(true, "Entry point found");
+	print_state(STATE_NORMAL, "Entry point found");
 
 	return ent;
 }

Index: src/sys/arch/amd64/stand/prekern/mm.c
diff -u src/sys/arch/amd64/stand/prekern/mm.c:1.27 src/sys/arch/amd64/stand/prekern/mm.c:1.28
--- src/sys/arch/amd64/stand/prekern/mm.c:1.27	Thu May  7 17:58:26 2020
+++ src/sys/arch/amd64/stand/prekern/mm.c	Tue May  4 21:09:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.c,v 1.27 2020/05/07 17:58:26 maxv Exp $	*/
+/*	$NetBSD: mm.c,v 1.28 2021/05/04 21:09:16 khorben Exp $	*/
 
 /*
  * Copyright (c) 2017-2020 The NetBSD Foundation, Inc. All rights reserved.
@@ -148,7 +148,7 @@ mm_bootspace_mprotect(void)
 		mm_mprotect(bootspace.segs[i].va, bootspace.segs[i].sz, prot);
 	}
 
-	print_state(true, "Segments protection updated");
+	print_state(STATE_NORMAL, "Segments protection updated");
 }
 
 static size_t
@@ -493,9 +493,9 @@ mm_map_kernel(void)
 {
 	memset(, 0, sizeof(bootspace));
 	mm_map_head();
-	print_state(true, "Head region mapped");
+	print_state(STATE_NORMAL, "Head region mapped");
 	elf_map_sections();
-	print_state(true, "Segments mapped");
+	print_state(STATE_NORMAL, "Segments mapped");
 	mm_map_boot();
-	print_state(true, "Boot region mapped");
+	print_state(STATE_NORMAL, "Boot region mapped");
 }

Index: src/sys/arch/amd64/stand/prekern/prekern.c
diff -u src/sys/arch/amd64/stand/prekern/prekern.c:1.13 src/sys/arch/amd64/stand/prekern/prekern.c:1.14
--- src/sys/arch/amd64/stand/prekern/prekern.c:1.13	Sat May 23 08:25:32 2020
+++ src/sys/arch/amd64/stand/prekern/prekern.c	Tue May  4 

CVS commit: src/sys/arch/amd64/stand/prekern

2021-05-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue May  4 21:09:16 UTC 2021

Modified Files:
src/sys/arch/amd64/stand/prekern: console.c elf.c mm.c prekern.c
prekern.h

Log Message:
prekern: add support for warning messages

As submitted on port-amd64@ (part 1/3)

Tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/stand/prekern/console.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/stand/prekern/elf.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/stand/prekern/mm.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amd64/stand/prekern/prekern.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amd64/stand/prekern/prekern.h

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



CVS commit: src/external/bsd/pam-u2f

2020-11-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  4 13:46:46 UTC 2020

Modified Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile
src/external/bsd/pam-u2f/lib/security/pam-u2f: Makefile

Log Message:
PR/55747: Tobias Nygren: Install manpages for pam-u2f

I have added a Makefile rule, indicating how to generate the manual
pages again. It has no dependency on the original file, in order to
avoid issues when building: the generation depends in asciidoc and
libxslt, which are not in tools or in the base tree anyway. It should
therefore never trigger, but should be used by the maintainer when
updating pam-u2f.

With this, I believe this PR can be closed.

Tested with "build.sh release" on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile

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

Modified files:

Index: src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
diff -u src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.3 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.4
--- src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.3	Mon Nov  2 06:40:11 2020
+++ src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile	Wed Nov  4 13:46:46 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2020/11/02 06:40:11 khorben Exp $
+# $NetBSD: Makefile,v 1.4 2020/11/04 13:46:46 khorben Exp $
 
 .include 
 
@@ -22,4 +22,9 @@ COPTS.util.c += -Wno-error=stack-protect
 LDADD+=-lpam -lfido2 -lcbor -lusbhid -lcrypto -lm
 DPADD+=${LIBPAM} ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID} ${LIBCRYPTO} ${LIBM}
 
+pamu2fcfg.1:
+	asciidoc -b docbook45 -d manpage -o pamu2fcfg.1.xml ../../dist/man/pamu2fcfg.1.txt
+	xsltproc --nonet --xinclude -o pamu2fcfg.1 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' pamu2fcfg.1.xml
+	rm -f pamu2fcfg.1.xml
+
 .include 

Index: src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile
diff -u src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile:1.4 src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile:1.5
--- src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile:1.4	Mon Nov  2 06:40:11 2020
+++ src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile	Wed Nov  4 13:46:46 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/11/02 06:40:11 khorben Exp $
+# $NetBSD: Makefile,v 1.5 2020/11/04 13:46:46 khorben Exp $
 
 .include 
 .PATH: ${NETBSDSRCDIR}/external/bsd/pam-u2f/dist
@@ -18,4 +18,9 @@ LIBDPLIBS+= \
 	crypto	${NETBSDSRCDIR}/crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto \
 	m	${NETBSDSRCDIR}/lib/libm
 
+pam_u2f.8:
+	asciidoc -b docbook45 -d manpage -o pam_u2f.8.xml ../../../dist/man/pam_u2f.8.txt
+	xsltproc --nonet --xinclude -o pam_u2f.8 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' pam_u2f.8.xml
+	rm -f pam_u2f.8.xml
+
 .include "${NETBSDSRCDIR}/lib/libpam/modules/mod.mk"



CVS commit: src/external/bsd/pam-u2f

2020-11-04 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  4 13:46:46 UTC 2020

Modified Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile
src/external/bsd/pam-u2f/lib/security/pam-u2f: Makefile

Log Message:
PR/55747: Tobias Nygren: Install manpages for pam-u2f

I have added a Makefile rule, indicating how to generate the manual
pages again. It has no dependency on the original file, in order to
avoid issues when building: the generation depends in asciidoc and
libxslt, which are not in tools or in the base tree anyway. It should
therefore never trigger, but should be used by the maintainer when
updating pam-u2f.

With this, I believe this PR can be closed.

Tested with "build.sh release" on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile

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



CVS commit: src

2020-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Nov  2 06:40:11 UTC 2020

Modified Files:
src/distrib/sets/lists/man: mi
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile
src/external/bsd/pam-u2f/lib/security/pam-u2f: Makefile
Added Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: pamu2fcfg.1
src/external/bsd/pam-u2f/lib/security/pam-u2f: pam_u2f.8

Log Message:
PR/55747: Tobias Nygren: Install manpages for pam-u2f

I have generated the manual pages and referenced them into the sets.
It would probably help to add a Makefile rule, indicating how to
generate the manual pages again.

Tested with "build.sh release" on amd64.

Reviewed by Tobias Nygren before the commit.


To generate a diff of this commit:
cvs rdiff -u -r1.1707 -r1.1708 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/pam-u2f/bin/pamu2fcfg/pamu2fcfg.1
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/pam_u2f.8

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1707 src/distrib/sets/lists/man/mi:1.1708
--- src/distrib/sets/lists/man/mi:1.1707	Tue Oct 27 08:57:10 2020
+++ src/distrib/sets/lists/man/mi	Mon Nov  2 06:40:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1707 2020/10/27 08:57:10 ryo Exp $
+# $NetBSD: mi,v 1.1708 2020/11/02 06:40:11 khorben Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -421,6 +421,7 @@
 ./usr/share/man/cat1/openssl_x509v3_config.0	man-obsolete		obsolete
 ./usr/share/man/cat1/page.0			man-util-catman		.cat
 ./usr/share/man/cat1/pagesize.0			man-util-catman		.cat
+./usr/share/man/cat1/pamu2fcfg.0		man-util-catman		.cat
 ./usr/share/man/cat1/passwd.0			man-util-catman		.cat
 ./usr/share/man/cat1/paste.0			man-util-catman		.cat
 ./usr/share/man/cat1/patch.0			man-util-catman		.cat
@@ -2940,6 +2941,7 @@
 ./usr/share/man/cat8/pam_self.0			man-sysutil-catman	pam,.cat
 ./usr/share/man/cat8/pam_skey.0			man-sysutil-catman	skey,pam,.cat
 ./usr/share/man/cat8/pam_ssh.0			man-sysutil-catman	pam,.cat
+./usr/share/man/cat8/pam_u2f.0			man-sysutil-catman	pam,.cat
 ./usr/share/man/cat8/pam_unix.0			man-sysutil-catman	pam,.cat
 ./usr/share/man/cat8/paxctl.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/pc532/MAKEDEV.0		man-obsolete		obsolete
@@ -3707,6 +3709,7 @@
 ./usr/share/man/html1/openssl_x509v3_config.html	man-obsolete	obsolete
 ./usr/share/man/html1/page.html			man-util-htmlman	html
 ./usr/share/man/html1/pagesize.html		man-util-htmlman	html
+./usr/share/man/html1/pamu2fcfg.html		man-util-htmlman	html
 ./usr/share/man/html1/passwd.html		man-util-htmlman	html
 ./usr/share/man/html1/paste.html		man-util-htmlman	html
 ./usr/share/man/html1/patch.html		man-util-htmlman	html
@@ -5933,6 +5936,7 @@
 ./usr/share/man/html8/pam_self.html		man-sysutil-htmlman	pam,html
 ./usr/share/man/html8/pam_skey.html		man-sysutil-htmlman	skey,pam,html
 ./usr/share/man/html8/pam_ssh.html		man-sysutil-htmlman	pam,html
+./usr/share/man/html8/pam_u2f.html		man-sysutil-htmlman	pam,html
 ./usr/share/man/html8/pam_unix.html		man-sysutil-htmlman	pam,html
 ./usr/share/man/html8/paxctl.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/pcictl.html		man-sysutil-htmlman	html
@@ -6635,6 +6639,7 @@
 ./usr/share/man/man1/openssl_x509v3_config.1	man-obsolete		obsolete
 ./usr/share/man/man1/page.1			man-util-man		.man
 ./usr/share/man/man1/pagesize.1			man-util-man		.man
+./usr/share/man/man1/pamu2fcfg.1		man-util-man		.man
 ./usr/share/man/man1/passwd.1			man-util-man		.man
 ./usr/share/man/man1/paste.1			man-util-man		.man
 ./usr/share/man/man1/patch.1			man-util-man		.man
@@ -9154,6 +9159,7 @@
 ./usr/share/man/man8/pam_self.8			man-sysutil-man		.man,pam
 ./usr/share/man/man8/pam_skey.8			man-sysutil-man		skey,.man,pam
 ./usr/share/man/man8/pam_ssh.8			man-sysutil-man		.man,pam
+./usr/share/man/man8/pam_u2f.8			man-sysutil-man		.man,pam
 ./usr/share/man/man8/pam_unix.8			man-sysutil-man		.man,pam
 ./usr/share/man/man8/paxctl.8			man-sysutil-man		.man
 ./usr/share/man/man8/pc532/MAKEDEV.8		man-obsolete		obsolete

Index: src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
diff -u src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.2 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.3
--- src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile:1.2	Wed Mar  4 17:32:27 2020
+++ src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile	Mon Nov  2 06:40:11 2020
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2020/03/04 17:32:27 christos Exp $
-
-NOMAN=
+# $NetBSD: Makefile,v 1.3 2020/11/02 06:40:11 khorben Exp $
 
 .include 
 

Index: src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile
diff -u 

CVS commit: src

2020-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Nov  2 06:40:11 UTC 2020

Modified Files:
src/distrib/sets/lists/man: mi
src/external/bsd/pam-u2f/bin/pamu2fcfg: Makefile
src/external/bsd/pam-u2f/lib/security/pam-u2f: Makefile
Added Files:
src/external/bsd/pam-u2f/bin/pamu2fcfg: pamu2fcfg.1
src/external/bsd/pam-u2f/lib/security/pam-u2f: pam_u2f.8

Log Message:
PR/55747: Tobias Nygren: Install manpages for pam-u2f

I have generated the manual pages and referenced them into the sets.
It would probably help to add a Makefile rule, indicating how to
generate the manual pages again.

Tested with "build.sh release" on amd64.

Reviewed by Tobias Nygren before the commit.


To generate a diff of this commit:
cvs rdiff -u -r1.1707 -r1.1708 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pam-u2f/bin/pamu2fcfg/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/pam-u2f/bin/pamu2fcfg/pamu2fcfg.1
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/pam-u2f/lib/security/pam-u2f/pam_u2f.8

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



CVS commit: src/share/man/man4

2020-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Nov  1 06:19:47 UTC 2020

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

Log Message:
u3g(4): also list the Huawei EM770W as supported


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/u3g.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/u3g.4
diff -u src/share/man/man4/u3g.4:1.9 src/share/man/man4/u3g.4:1.10
--- src/share/man/man4/u3g.4:1.9	Sun Oct  8 03:39:50 2017
+++ src/share/man/man4/u3g.4	Sun Nov  1 06:19:47 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: u3g.4,v 1.9 2017/10/08 03:39:50 sevan Exp $
+.\" $NetBSD: u3g.4,v 1.10 2020/11/01 06:19:47 khorben Exp $
 .\"
 .\" Copyright (c) 2008 AnyWi Technologies
 .\" All rights reserved.
@@ -60,6 +60,8 @@ Huawei E171
 .It
 Huawei E220 (E270?)
 .It
+Huawei EM770W
+.It
 Huawei Mobile
 .It
 Novatel MC950D



CVS commit: src/share/man/man4

2020-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Nov  1 06:19:47 UTC 2020

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

Log Message:
u3g(4): also list the Huawei EM770W as supported


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man4/u3g.4

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



Re: CVS commit: src

2020-09-23 Thread Pierre Pronchery

Hi Maxime, (board@, source-changes-d@)

first of all thank you for contacting board@, as suggested by Taylor.

As I communicated to you directly a week ago, we at board@ have 
discussed the situation and asked you for the full list of files, where 
you would like to update the copyright headers.


We understand that you have already made most of the changes to the 
copyright headers that you intended, except for some files for vHCI 
support. It would be helpful to have the complete list. From what I can 
tell so far, it will include the following:


For KSAN,
- src/sys/arch/aarch64/include/asan.h
- src/sys/arch/amd64/include/asan.h
- src/sys/arch/arm/include/asan.h
- src/sys/kern/subr_asan.c
- src/sys/sys/asan.h

For KCSAN,
- src/sys/arch/amd64/include/csan.h
- src/sys/kern/subr_csan.c
- src/sys/sys/csan.h

For KMSAN,
- src/sys/arch/amd64/include/msan.h
- src/sys/kern/subr_msan.c
- src/sys/sys/msan.h

For NVMM,
- src/lib/libnvmm/libnvmm.3
- src/lib/libnvmm/libnvmm.c
- src/lib/libnvmm/libnvmm_x86.c
- src/lib/libnvmm/nvmm.h
- src/share/man/man4/nvmm.4
- src/sys/dev/nvmm/nvmm.c
- src/sys/dev/nvmm/nvmm.h
- src/sys/dev/nvmm/nvmm_internal.h
- src/sys/dev/nvmm/nvmm_ioctl.h
- src/sys/dev/nvmm/x86/nvmm_x86.c
- src/sys/dev/nvmm/x86/nvmm_x86.h
- src/sys/dev/nvmm/x86/nvmm_x86_svm.c
- src/sys/dev/nvmm/x86/nvmm_x86_svmfunc.S
- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
- src/sys/dev/nvmm/x86/nvmm_x86_vmxfunc.S
- src/tests/lib/libnvmm/h_io_assist.c
- src/tests/lib/libnvmm/h_io_assist_asm.S
- src/tests/lib/libnvmm/h_mem_assist.c
- src/tests/lib/libnvmm/h_mem_assist_asm.S
- src/tests/lib/libnvmm/t_io_assist.sh
- src/tests/lib/libnvmm/t_mem_assist.sh
- src/usr.sbin/nvmmctl/nvmmctl.8
- src/usr.sbin/nvmmctl/nvmmctl.c

Please let us know if this misses anything besides the remaining files 
for vHCI support.


Until we can fully assess the situation, we are kindly asking you to 
revert these changes, in order to restore the copyright lines as they 
were before the changes. We can then reassign the copyright back to you 
for TNF once the conditions are confirmed to allow it.


Thank you,
-- khorben for board@

On 10/09/2020 17:08, Taylor R Campbell wrote:

Module Name:src
Committed By:   maxv
Date:   Sat Sep  5 07:22:26 UTC 2020

nvmm: update copyright headers

[...]
-.\" Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
  .\" All rights reserved.
  .\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Maxime Villard.
+.\" This code is part of the NVMM hypervisor.


Please restore the NetBSD Foundation copyright notice.

You can add your own copyright notice in addition to it, for copyright
covering subsequent changes to the file, or on new files.  But you
already committed this code to the tree years ago, and it's gone out
in a NetBSD release with the NetBSD Foundation copyright notice.

If you want TNF to reassign the copyright back to you, please contact
board to discuss it rather than just quietly changing the existing
copyright notice on the file in the tree.

--
khorben



CVS commit: src/sbin/umbctl

2020-05-13 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed May 13 21:44:30 UTC 2020

Modified Files:
src/sbin/umbctl: umbctl.c

Log Message:
Fix and improve parsing of configuration files

XXX pull-up to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/umbctl/umbctl.c

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

Modified files:

Index: src/sbin/umbctl/umbctl.c
diff -u src/sbin/umbctl/umbctl.c:1.3 src/sbin/umbctl/umbctl.c:1.4
--- src/sbin/umbctl/umbctl.c:1.3	Sun Mar 22 07:45:02 2020
+++ src/sbin/umbctl/umbctl.c	Wed May 13 21:44:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: umbctl.c,v 1.3 2020/03/22 07:45:02 khorben Exp $ */
+/* $NetBSD: umbctl.c,v 1.4 2020/05/13 21:44:30 khorben Exp $ */
 /*
  * Copyright (c) 2018 Pierre Pronchery 
  *
@@ -179,12 +179,15 @@ static int _umbctl(char const * ifname, 
 /* umbctl_file */
 static int _umbctl_file(char const * ifname, char const * filename, int verbose)
 {
+	int ret = 0;
 	int fd;
 	struct ifreq ifr;
 	struct umb_info umbi;
 	struct umb_parameter umbp;
 	FILE * fp;
 	char buf[512];
+	size_t len;
+	int i;
 	int eof;
 	char * tokens[3] = { buf, NULL, NULL };
 	char * p;
@@ -197,18 +200,32 @@ static int _umbctl_file(char const * ifn
 		if(buf[0] == '#')
 			continue;
 		buf[sizeof(buf) - 1] = '\0';
-		if((p = strstr(buf, "=")) != NULL)
+		if((len = strlen(buf)) > 0)
+		{
+			if(buf[len - 1] != '\n')
+			{
+ret = _error(2, "%s: %s", filename,
+		"Line too long");
+while((i = fgetc(fp)) != EOF && i != '\n');
+continue;
+			}
+			else
+buf[len - 1] = '\0';
+		}
+		if((p = strchr(buf, '=')) != NULL)
 		{
 			tokens[1] = p + 1;
 			*p = '\0';
 		} else
 			tokens[1] = NULL;
-		if(_umbctl_set(ifname, , (p != NULL) ? 2 : 1, tokens) != 0)
-			break;
+		ret |= _umbctl_set(ifname, , (p != NULL) ? 2 : 1, tokens)
+			? 2 : 0;
 	}
 	eof = feof(fp);
 	if(fclose(fp) != 0 || !eof)
 		return _error(2, "%s: %s", filename, strerror(errno));
+	if(ret != 0)
+		return ret;
 	if((fd = _umbctl_socket()) < 0)
 		return 2;
 	memset(, 0, sizeof(ifr));



CVS commit: src/sbin/umbctl

2020-05-13 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed May 13 21:44:30 UTC 2020

Modified Files:
src/sbin/umbctl: umbctl.c

Log Message:
Fix and improve parsing of configuration files

XXX pull-up to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/umbctl/umbctl.c

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



CVS commit: src/sbin/umbctl

2020-03-22 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Mar 22 07:45:03 UTC 2020

Modified Files:
src/sbin/umbctl: umbctl.8 umbctl.c

Log Message:
Forbid command line parameters when parsing configuration files

This behaviour was ambiguous at best.
While there, also correct the usage screen, and the corresponding manual
page.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/umbctl/umbctl.8 src/sbin/umbctl/umbctl.c

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

Modified files:

Index: src/sbin/umbctl/umbctl.8
diff -u src/sbin/umbctl/umbctl.8:1.2 src/sbin/umbctl/umbctl.8:1.3
--- src/sbin/umbctl/umbctl.8:1.2	Wed Aug  1 17:26:30 2018
+++ src/sbin/umbctl/umbctl.8	Sun Mar 22 07:45:02 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: umbctl.8,v 1.2 2018/08/01 17:26:30 wiz Exp $
+.\"	$NetBSD: umbctl.8,v 1.3 2020/03/22 07:45:02 khorben Exp $
 .\"
 .\" Copyright (c) 2018 by Pierre Pronchery 
 .\" All rights reserved.
@@ -26,11 +26,11 @@
 .\"
 .\" From: pppoectl.8,v 1.30 2016/09/12 05:35:20 sevan Exp $
 .\"
-.\" $Id: umbctl.8,v 1.2 2018/08/01 17:26:30 wiz Exp $
+.\" $Id: umbctl.8,v 1.3 2020/03/22 07:45:02 khorben Exp $
 .\"
 .\" last edit-date: [Thu Aug 31 10:47:33 2000]
 .\"
-.Dd July 24, 2018
+.Dd March 22, 2020
 .Dt UMBCTL 8
 .Os
 .Sh NAME
@@ -40,15 +40,13 @@
 .Nm umbctl
 .Op Fl v
 .Ar ifname
-.Op Ar parameter Ns Op \&= Ns Ar value
+.Op Ar parameter Op Ar value
 .Op Ar ...
 .Pp
 .Nm umbctl
 .Op Fl v
-.Op Fl f Ar config-file
+.Fl f Ar config-file
 .Ar ifname
-.Op Ar parameter Ns Op \&= Ns Ar value
-.Op Ar ...
 .Sh DESCRIPTION
 .Nm
 supports the following options:
Index: src/sbin/umbctl/umbctl.c
diff -u src/sbin/umbctl/umbctl.c:1.2 src/sbin/umbctl/umbctl.c:1.3
--- src/sbin/umbctl/umbctl.c:1.2	Thu Aug  2 03:40:51 2018
+++ src/sbin/umbctl/umbctl.c	Sun Mar 22 07:45:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: umbctl.c,v 1.2 2018/08/02 03:40:51 roy Exp $ */
+/* $NetBSD: umbctl.c,v 1.3 2020/03/22 07:45:02 khorben Exp $ */
 /*
  * Copyright (c) 2018 Pierre Pronchery 
  *
@@ -80,8 +80,8 @@ static const struct umb_valdescr _umb_be
 static int _char_to_utf16(const char * in, uint16_t * out, size_t outlen);
 static int _error(int ret, char const * format, ...);
 static int _umbctl(char const * ifname, int verbose, int argc, char * argv[]);
-static int _umbctl_file(char const * ifname, char const * filename, int verbose,
-		int argc, char * argv[]);
+static int _umbctl_file(char const * ifname, char const * filename,
+		int verbose);
 static void _umbctl_info(char const * ifname, struct umb_info * umbi);
 static int _umbctl_ioctl(char const * ifname, int fd, unsigned long request,
 		struct ifreq * ifr);
@@ -177,8 +177,7 @@ static int _umbctl(char const * ifname, 
 
 
 /* umbctl_file */
-static int _umbctl_file(char const * ifname, char const * filename, int verbose,
-		int argc, char * argv[])
+static int _umbctl_file(char const * ifname, char const * filename, int verbose)
 {
 	int fd;
 	struct ifreq ifr;
@@ -216,7 +215,6 @@ static int _umbctl_file(char const * ifn
 	strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
 	ifr.ifr_data = 
 	if(_umbctl_ioctl(ifname, fd, SIOCGUMBPARAM, ) != 0
-			|| _umbctl_set(ifname, , argc, argv) != 0
 			|| _umbctl_ioctl(ifname, fd, SIOCSUMBPARAM, ) != 0)
 	{
 		close(fd);
@@ -427,7 +425,7 @@ static int _umbctl_socket(void)
 /* usage */
 static int _usage(void)
 {
-	fputs("Usage: umbctl [-v] ifname [parameter[=value]] [...]\n"
+	fputs("Usage: umbctl [-v] ifname [parameter [value]] [...]\n"
 "   umbctl -f config-file ifname [...]\n",
 			stderr);
 	return 1;
@@ -475,8 +473,11 @@ int main(int argc, char * argv[])
 	if(optind == argc)
 		return _usage();
 	if(filename != NULL)
-		return _umbctl_file(argv[optind], filename, verbose,
-argc - optind - 1, [optind + 1]);
+	{
+		if(optind + 1 != argc)
+			return _usage();
+		return _umbctl_file(argv[optind], filename, verbose);
+	}
 	return _umbctl(argv[optind], verbose, argc - optind - 1,
 			[optind + 1]);
 }



CVS commit: src/sbin/umbctl

2020-03-22 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Mar 22 07:45:03 UTC 2020

Modified Files:
src/sbin/umbctl: umbctl.8 umbctl.c

Log Message:
Forbid command line parameters when parsing configuration files

This behaviour was ambiguous at best.
While there, also correct the usage screen, and the corresponding manual
page.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/umbctl/umbctl.8 src/sbin/umbctl/umbctl.c

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



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:51:22 UTC 2020

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

Log Message:
Only set the IPv4 address in umb(4) if both MBIM_IPCONF_HAS_ADDRINFO and
MBIM_IPCONF_HAS_GWINFO are available. Configuring umb(4) without gateway
wont work the system needs a destination address for the interface.
Problem found by jsg@.
OK jsg@ deraadt@

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.16 src/sys/dev/usb/if_umb.c:1.17
--- src/sys/dev/usb/if_umb.c:1.16	Thu Mar 19 07:50:27 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:51:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1714,7 +1714,8 @@ umb_decode_ip_configuration(struct umb_s
 	 * IPv4 configuration
 	 */
 	avail = le32toh(ic->ipv4_available);
-	if (avail & MBIM_IPCONF_HAS_ADDRINFO) {
+	if ((avail & (MBIM_IPCONF_HAS_ADDRINFO | MBIM_IPCONF_HAS_GWINFO)) ==
+	(MBIM_IPCONF_HAS_ADDRINFO | MBIM_IPCONF_HAS_GWINFO)) {
 		n = le32toh(ic->ipv4_naddr);
 		off = le32toh(ic->ipv4_addroffs);
 
@@ -1734,10 +1735,8 @@ umb_decode_ip_configuration(struct umb_s
 		sin = (struct sockaddr_in *)_dstaddr;
 		sin->sin_family = AF_INET;
 		sin->sin_len = sizeof(ifra.ifra_dstaddr);
-		if (avail & MBIM_IPCONF_HAS_GWINFO) {
-			off = le32toh(ic->ipv4_gwoffs);
-			sin->sin_addr.s_addr = *((uint32_t *)((char *)data + off));
-		}
+		off = le32toh(ic->ipv4_gwoffs);
+		sin->sin_addr.s_addr = *((uint32_t *)((char *)data + off));
 
 		sin = (struct sockaddr_in *)_mask;
 		sin->sin_family = AF_INET;



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:51:22 UTC 2020

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

Log Message:
Only set the IPv4 address in umb(4) if both MBIM_IPCONF_HAS_ADDRINFO and
MBIM_IPCONF_HAS_GWINFO are available. Configuring umb(4) without gateway
wont work the system needs a destination address for the interface.
Problem found by jsg@.
OK jsg@ deraadt@

>From OpenBSD.


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

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



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:50:27 UTC 2020

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

Log Message:
turn the success paths of FCC registration into debug prints. The
(unlikely) failure path remains noisy.
discussed with claudio

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:50:27 UTC 2020

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

Log Message:
turn the success paths of FCC registration into debug prints. The
(unlikely) failure path remains noisy.
discussed with claudio

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.15 src/sys/dev/usb/if_umb.c:1.16
--- src/sys/dev/usb/if_umb.c:1.15	Thu Mar 19 07:49:29 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:50:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2569,11 +2569,11 @@ umb_decode_qmi(struct umb_softc *sc, uin
 break;
 			case 0x555f:	/* Send FCC Authentication */
 if (val == 0)
-	log(LOG_INFO, "%s: send FCC "
+	DPRINTF("%s: send FCC "
 	"Authentication succeeded\n",
 	DEVNAM(sc));
 else if (val == 0x001a0001)
-	log(LOG_INFO, "%s: FCC Authentication "
+	DPRINTF("%s: FCC Authentication "
 	"not required\n", DEVNAM(sc));
 else
 	log(LOG_INFO, "%s: send FCC "



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:49:29 UTC 2020

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

Log Message:
When there is no network around the state timeout fires over and over again.
Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam.
Loudly requested by beck@ OK deraadt@

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:49:29 UTC 2020

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

Log Message:
When there is no network around the state timeout fires over and over again.
Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam.
Loudly requested by beck@ OK deraadt@

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.14 src/sys/dev/usb/if_umb.c:1.15
--- src/sys/dev/usb/if_umb.c:1.14	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:49:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $ */
+/*	$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -948,9 +948,12 @@ Static void
 umb_statechg_timeout(void *arg)
 {
 	struct umb_softc *sc = arg;
+	struct ifnet *ifp = GET_IFP(sc);
 
 	if (sc->sc_info.regstate != MBIM_REGSTATE_ROAMING || sc->sc_roaming)
-		printf("%s: state change timeout\n",DEVNAM(sc));
+		if (ifp->if_flags & IFF_DEBUG)
+			log(LOG_DEBUG, "%s: state change timeout\n",
+			DEVNAM(sc));
 	usb_add_task(sc->sc_udev, >sc_umb_task, USB_TASKQ_DRIVER);
 }
 



CVS commit: src/sys/dev/usb

2019-06-26 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Jun 26 22:58:59 UTC 2019

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

Log Message:
Fix typos

Some were found by OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2019-06-26 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Jun 26 22:58:59 UTC 2019

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

Log Message:
Fix typos

Some were found by OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.8 src/sys/dev/usb/if_umb.c:1.9
--- src/sys/dev/usb/if_umb.c:1.8	Sun Jan 27 02:08:42 2019
+++ src/sys/dev/usb/if_umb.c	Wed Jun 26 22:58:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.8 2019/01/27 02:08:42 pgoyette Exp $ */
+/*	$NetBSD: if_umb.c,v 1.9 2019/06/26 22:58:58 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.8 2019/01/27 02:08:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.9 2019/06/26 22:58:58 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1243,7 +1243,7 @@ umb_decode_response(struct umb_softc *sc
 		umb_command_done(sc, response, len);
 		break;
 	default:
-		DPRINTF("%s: discard messsage %s\n", DEVNAM(sc),
+		DPRINTF("%s: discard message %s\n", DEVNAM(sc),
 		umb_request2str(type));
 		break;
 	}
@@ -1257,19 +1257,19 @@ umb_handle_indicate_status_msg(struct um
 	uint32_t cid;
 
 	if (len < sizeof(*m)) {
-		DPRINTF("%s: discard short %s messsage\n", DEVNAM(sc),
+		DPRINTF("%s: discard short %s message\n", DEVNAM(sc),
 		umb_request2str(le32toh(m->hdr.type)));
 		return;
 	}
 	if (memcmp(m->devid, umb_uuid_basic_connect, sizeof(m->devid))) {
-		DPRINTF("%s: discard %s messsage for other UUID '%s'\n",
+		DPRINTF("%s: discard %s message for other UUID '%s'\n",
 		DEVNAM(sc), umb_request2str(le32toh(m->hdr.type)),
 		umb_uuid2str(m->devid));
 		return;
 	}
 	infolen = le32toh(m->infolen);
 	if (len < sizeof(*m) + infolen) {
-		DPRINTF("%s: discard truncated %s messsage (want %d, got %d)\n",
+		DPRINTF("%s: discard truncated %s message (want %d, got %d)\n",
 		DEVNAM(sc), umb_request2str(le32toh(m->hdr.type)),
 		(int)sizeof(*m) + infolen, len);
 		return;
@@ -1703,7 +1703,7 @@ umb_decode_ip_configuration(struct umb_s
 	s = splnet();
 
 	/*
-	 * IPv4 configuation
+	 * IPv4 configuration
 	 */
 	avail = le32toh(ic->ipv4_available);
 	if (avail & MBIM_IPCONF_HAS_ADDRINFO) {
@@ -2381,7 +2381,7 @@ umb_command_done(struct umb_softc *sc, v
 	int	 qmimsg = 0;
 
 	if (len < sizeof(*cmd)) {
-		DPRINTF("%s: discard short %s messsage\n", DEVNAM(sc),
+		DPRINTF("%s: discard short %s message\n", DEVNAM(sc),
 		umb_request2str(le32toh(cmd->hdr.type)));
 		return;
 	}
@@ -2389,7 +2389,7 @@ umb_command_done(struct umb_softc *sc, v
 	if (memcmp(cmd->devid, umb_uuid_basic_connect, sizeof(cmd->devid))) {
 		if (memcmp(cmd->devid, umb_uuid_qmi_mbim,
 		sizeof(cmd->devid))) {
-			DPRINTF("%s: discard %s messsage for other UUID '%s'\n",
+			DPRINTF("%s: discard %s message for other UUID '%s'\n",
 			DEVNAM(sc), umb_request2str(le32toh(cmd->hdr.type)),
 			umb_uuid2str(cmd->devid));
 			return;
@@ -2418,7 +2418,7 @@ umb_command_done(struct umb_softc *sc, v
 
 	infolen = le32toh(cmd->infolen);
 	if (len < sizeof(*cmd) + infolen) {
-		DPRINTF("%s: discard truncated %s messsage (want %d, got %d)\n",
+		DPRINTF("%s: discard truncated %s message (want %d, got %d)\n",
 		DEVNAM(sc), umb_cid2str(cid),
 		(int)sizeof(*cmd) + infolen, len);
 		return;
@@ -2639,7 +2639,7 @@ umb_intr(struct usbd_xfer *xfer, void *p
 		DEVNAM(sc));
 		break;
 	default:
-		DPRINTF("%s: unexpected notifiation (0x%02x)\n",
+		DPRINTF("%s: unexpected notification (0x%02x)\n",
 		DEVNAM(sc), sc->sc_intr_msg.bNotification);
 		break;
 	}



CVS commit: src/sys/dev

2019-02-28 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Feb 28 16:56:35 UTC 2019

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

Log Message:
Typo (s/vaule/value/)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/i2c/sdtemp.c
cvs rdiff -u -r1.628 -r1.629 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.210 -r1.211 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: src/sys/dev

2019-02-28 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Feb 28 16:56:35 UTC 2019

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

Log Message:
Typo (s/vaule/value/)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/i2c/sdtemp.c
cvs rdiff -u -r1.628 -r1.629 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.210 -r1.211 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/i2c/sdtemp.c
diff -u src/sys/dev/i2c/sdtemp.c:1.34 src/sys/dev/i2c/sdtemp.c:1.35
--- src/sys/dev/i2c/sdtemp.c:1.34	Sat Jun 16 21:22:13 2018
+++ src/sys/dev/i2c/sdtemp.c	Thu Feb 28 16:56:35 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: sdtemp.c,v 1.34 2018/06/16 21:22:13 thorpej Exp $*/
+/*  $NetBSD: sdtemp.c,v 1.35 2019/02/28 16:56:35 khorben Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.34 2018/06/16 21:22:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.35 2019/02/28 16:56:35 khorben Exp $");
 
 #include 
 #include 
@@ -297,7 +297,7 @@ sdtemp_attach(device_t parent, device_t 
 	 * IDT's devices and some Microchip's devices have the resolution
 	 * register in the vendor specific registers area. The devices'
 	 * resolution bits in the capability register are not the maximum
-	 * resolution but the current vaule of the setting.
+	 * resolution but the current value of the setting.
 	 */
 	if (sdtemp_dev_table[i].sdtemp_config != NULL)
 		sdtemp_dev_table[i].sdtemp_config(sc);

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.628 src/sys/dev/pci/if_wm.c:1.629
--- src/sys/dev/pci/if_wm.c:1.628	Sat Feb 23 11:41:08 2019
+++ src/sys/dev/pci/if_wm.c	Thu Feb 28 16:56:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.628 2019/02/23 11:41:08 kamil Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.629 2019/02/28 16:56:35 khorben Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.628 2019/02/23 11:41:08 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.629 2019/02/28 16:56:35 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -13482,7 +13482,7 @@ wm_nvm_version(struct wm_softc *sc)
 	 *	82572EI	0x5069	5.6.9?
 	 *	82574L	0x1080	1.8.0?	(the spec update notes about 2.1.4)
 	 *		0x2013	2.1.3?
-	 *	82583	0x10a0	1.10.0? (document says it's default vaule)
+	 *	82583	0x10a0	1.10.0? (document says it's default value)
 	 */
 
 	/*

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.112 src/sys/dev/pci/if_wmreg.h:1.113
--- src/sys/dev/pci/if_wmreg.h:1.112	Thu Jan 31 05:20:49 2019
+++ src/sys/dev/pci/if_wmreg.h	Thu Feb 28 16:56:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.112 2019/01/31 05:20:49 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.113 2019/02/28 16:56:35 khorben Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1493,7 +1493,7 @@ struct livengood_tcpip_ctxdesc {
 #define WM_INVM_DATA_REG(reg)	(0x12120 + 4*(reg))
 #define INVM_SIZE			64 /* Number of INVM Data Registers */
 
-/* iNVM default vaule */
+/* iNVM default value */
 #define NVM_INIT_CTRL_2_DEFAULT_I211	0x7243
 #define NVM_INIT_CTRL_4_DEFAULT_I211	0x00c1
 #define NVM_LED_1_CFG_DEFAULT_I211	0x0184

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.210 src/sys/dev/pci/pci_subr.c:1.211
--- src/sys/dev/pci/pci_subr.c:1.210	Fri Nov 30 10:18:37 2018
+++ src/sys/dev/pci/pci_subr.c	Thu Feb 28 16:56:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.210 2018/11/30 10:18:37 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.211 2019/02/28 16:56:35 khorben Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.210 2018/11/30 10:18:37 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.211 2019/02/28 16:56:35 khorben 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;
 	}
 



Re: CVS commit: src/etc

2019-02-08 Thread Pierre Pronchery
On 14/01/2019 12:27, m...@netbsd.org wrote:
> [...]
> This does give the ability to configure wifi with a GUI w/o root or
> something akin to polkit, via some pkgsrc packages (There's wpa_gui, for
> example, it's a QT5 thing. I imagine writing other things is not much
> harder)

Yes, that's also what x11/deforaos-panel uses to configure wireless.

> I just figured this change might be controversial so we need to be
> honest about it happening.

The change Roy made is something I also perform systematically on any
system I install and expect to connect to a wireless networks. It is
harmless when wpa_supplicant(8) is not running.

I agree that a dedicated group to allow network configuration would be
nice. However users in the "wheel" group are usually expected to be
allowed to su(1) anyway, and I think the balance is already very good
with this group to perform the corresponding privileged operations
without prompting for a password nor exposing too much.

Cheers,
-- 
khorben


CVS commit: src/sys/dev/usb

2018-09-20 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Sep 20 09:48:54 UTC 2018

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

Log Message:
Prevent a panic in umb(4) when roaming is disabled

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.5 src/sys/dev/usb/if_umb.c:1.6
--- src/sys/dev/usb/if_umb.c:1.5	Thu Sep 20 09:45:16 2018
+++ src/sys/dev/usb/if_umb.c	Thu Sep 20 09:48:54 2018
@@ -1,5 +1,5 @@
-/*	$NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $ */
-/*	$OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
+/*	$NetBSD: if_umb.c,v 1.6 2018/09/20 09:48:54 khorben Exp $ */
+/*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
  * Copyright (c) 2016 genua mbH
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.6 2018/09/20 09:48:54 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -944,13 +944,7 @@ umb_statechg_timeout(void *arg)
 {
 	struct umb_softc *sc = arg;
 
-	if (sc->sc_info.regstate == MBIM_REGSTATE_ROAMING && !sc->sc_roaming) {
-		/*
-		 * Query the registration state until we're with the home
-		 * network again.
-		 */
-		umb_cmd(sc, MBIM_CID_REGISTER_STATE, MBIM_CMDOP_QRY, NULL, 0);
-	} else
+	if (sc->sc_info.regstate != MBIM_REGSTATE_ROAMING || sc->sc_roaming)
 		printf("%s: state change timeout\n",DEVNAM(sc));
 	usb_add_task(sc->sc_udev, >sc_umb_task, USB_TASKQ_DRIVER);
 }
@@ -1004,6 +998,15 @@ umb_state_task(void *arg)
 	int	 s;
 	int	 state;
 
+	if (sc->sc_info.regstate == MBIM_REGSTATE_ROAMING && !sc->sc_roaming) {
+		/*
+		 * Query the registration state until we're with the home
+		 * network again.
+		 */
+		umb_cmd(sc, MBIM_CID_REGISTER_STATE, MBIM_CMDOP_QRY, NULL, 0);
+		return;
+	}
+
 	s = splnet();
 	if (ifp->if_flags & IFF_UP)
 		umb_up(sc);



CVS commit: src/sys/dev/usb

2018-09-20 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Sep 20 09:48:54 UTC 2018

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

Log Message:
Prevent a panic in umb(4) when roaming is disabled

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2018-09-20 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Sep 20 09:45:16 UTC 2018

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

Log Message:
Use usb_rem_task_wait() now that it is available

This should avoid panics while detaching devices.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2018-09-20 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Sep 20 09:45:16 UTC 2018

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

Log Message:
Use usb_rem_task_wait() now that it is available

This should avoid panics while detaching devices.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.4 src/sys/dev/usb/if_umb.c:1.5
--- src/sys/dev/usb/if_umb.c:1.4	Wed Aug  1 18:27:58 2018
+++ src/sys/dev/usb/if_umb.c	Thu Sep 20 09:45:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.5 2018/09/20 09:45:16 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -91,10 +91,6 @@ Static void	 umb_dump(void *, int);
 
 #define DEVNAM(sc)		device_xname((sc)->sc_dev)
 
-#ifndef notyet
-#define usb_wait_task(dev, task)
-#endif
-
 /*
  * State change timeout
  */
@@ -584,13 +580,13 @@ umb_detach(device_t self, int flags)
 		umb_down(sc, 1);
 	umb_close(sc);
 
-	usb_rem_task(sc->sc_udev, >sc_get_response_task);
-	usb_wait_task(sc->sc_udev, >sc_get_response_task);
+	usb_rem_task_wait(sc->sc_udev, >sc_get_response_task,
+			USB_TASKQ_DRIVER, NULL);
 	sc->sc_nresp = 0;
 	if (sc->sc_rx_ep != -1 && sc->sc_tx_ep != -1) {
 		callout_destroy(>sc_statechg_timer);
-		usb_rem_task(sc->sc_udev, >sc_umb_task);
-		usb_wait_task(sc->sc_udev, >sc_umb_task);
+		usb_rem_task_wait(sc->sc_udev, >sc_umb_task,
+			USB_TASKQ_DRIVER, NULL);
 	}
 	if (sc->sc_ctrl_pipe) {
 		usbd_close_pipe(sc->sc_ctrl_pipe);



CVS commit: src/sys/arch

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 18:36:14 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Build the umb(4) driver in the ALL kernels (amd64, i386)

As suggested by Robert Swindells; thank you!


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.444 -r1.445 src/sys/arch/i386/conf/ALL

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



CVS commit: src/sys/arch

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 18:36:14 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Build the umb(4) driver in the ALL kernels (amd64, i386)

As suggested by Robert Swindells; thank you!


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.444 -r1.445 src/sys/arch/i386/conf/ALL

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/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.95 src/sys/arch/amd64/conf/ALL:1.96
--- src/sys/arch/amd64/conf/ALL:1.95	Thu Jul 26 15:46:09 2018
+++ src/sys/arch/amd64/conf/ALL	Wed Aug  1 18:36:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.95 2018/07/26 15:46:09 maxv Exp $
+# $NetBSD: ALL,v 1.96 2018/08/01 18:36:13 khorben Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.95 $"
+#ident		"ALL-$Revision: 1.96 $"
 
 maxusers	64		# estimated number of users
 
@@ -1222,6 +1222,7 @@ cue*	at uhub? port ?		# CATC USB-EL1201A
 kue*	at uhub? port ?		# Kawasaki LSI KL5KUSB101B based adapters
 #mos*	at uhub? port ?		# Moschip MCS7730/MCS7830/MCS7832 based adapters
 udav*	at uhub? port ?		# Davicom DM9601 based adapters
+umb*	at uhub? port ?		# Mobile Broadband Interface Model (EXPERIMENTAL)
 url*	at uhub? port ?		# Realtek RTL8150L based adapters
 urndis* at uhub? port ? 	# Microsoft RNDIS specification
 

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.444 src/sys/arch/i386/conf/ALL:1.445
--- src/sys/arch/i386/conf/ALL:1.444	Thu Jul 26 15:46:09 2018
+++ src/sys/arch/i386/conf/ALL	Wed Aug  1 18:36:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.444 2018/07/26 15:46:09 maxv Exp $
+# $NetBSD: ALL,v 1.445 2018/08/01 18:36:14 khorben Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.444 $"
+#ident		"ALL-$Revision: 1.445 $"
 
 maxusers	64		# estimated number of users
 
@@ -1334,6 +1334,7 @@ cdce*	at uhub? port ?		# CDC, Ethernet N
 cue*	at uhub? port ?		# CATC USB-EL1201A based adapters
 kue*	at uhub? port ?		# Kawasaki LSI KL5KUSB101B based adapters
 udav*	at uhub? port ?		# Davicom DM9601 based adapters
+umb*	at uhub? port ?		# Mobile Broadband Interface Model (EXPERIMENTAL)
 url*	at uhub? port ?		# Realtek RTL8150L based adapters
 urndis* at uhub? port ?		# Microsoft RNDIS specification
 



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 18:27:58 UTC 2018

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

Log Message:
Fix building umb(4) on NetBSD-current

Patch by Robert Swindells; thank you!


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.3 src/sys/dev/usb/if_umb.c:1.4
--- src/sys/dev/usb/if_umb.c:1.3	Wed Aug  1 12:36:56 2018
+++ src/sys/dev/usb/if_umb.c	Wed Aug  1 18:27:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.3 2018/08/01 12:36:56 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.3 2018/08/01 12:36:56 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.4 2018/08/01 18:27:58 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -923,7 +923,7 @@ umb_start(struct ifnet *ifp)
 	}
 	IFQ_DEQUEUE(>if_snd, m_head);
 
-	bpf_mtap(ifp, m_head);
+	bpf_mtap(ifp, m_head, BPF_D_OUT);
 
 	ifp->if_flags |= IFF_OACTIVE;
 	ifp->if_timer = (2 * umb_xfer_tout) / 1000;



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 18:27:58 UTC 2018

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

Log Message:
Fix building umb(4) on NetBSD-current

Patch by Robert Swindells; thank you!


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 12:36:56 UTC 2018

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

Log Message:
Allow kmem_alloc(9) to sleep when attaching

Without this, umb(4) may needlessly fail to attach, like when under memory
pressure.

Thanks skrll@ for the heads-up!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.2 src/sys/dev/usb/if_umb.c:1.3
--- src/sys/dev/usb/if_umb.c:1.2	Wed Aug  1 12:25:50 2018
+++ src/sys/dev/usb/if_umb.c	Wed Aug  1 12:36:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.3 2018/08/01 12:36:56 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.3 2018/08/01 12:36:56 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -498,16 +498,9 @@ umb_attach(device_t parent, device_t sel
 		aprint_error_dev(self, "failed to open control pipe\n");
 		goto fail;
 	}
-	sc->sc_resp_buf = kmem_alloc(sc->sc_ctrl_len, KM_NOSLEEP);
-	if (sc->sc_resp_buf == NULL) {
-		aprint_error_dev(self, "allocation of resp buffer failed\n");
-		goto fail;
-	}
-	sc->sc_ctrl_msg = kmem_alloc(sc->sc_ctrl_len, KM_NOSLEEP);
-	if (sc->sc_ctrl_msg == NULL) {
-		aprint_error_dev(self, "allocation of ctrl msg buffer failed\n");
-		goto fail;
-	}
+
+	sc->sc_resp_buf = kmem_alloc(sc->sc_ctrl_len, KM_SLEEP);
+	sc->sc_ctrl_msg = kmem_alloc(sc->sc_ctrl_len, KM_SLEEP);
 
 	sc->sc_info.regstate = MBIM_REGSTATE_UNKNOWN;
 	sc->sc_info.pin_attempts_left = UMB_VALUE_UNKNOWN;



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 12:36:56 UTC 2018

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

Log Message:
Allow kmem_alloc(9) to sleep when attaching

Without this, umb(4) may needlessly fail to attach, like when under memory
pressure.

Thanks skrll@ for the heads-up!


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

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



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 12:25:50 UTC 2018

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

Log Message:
Avoid parentheses in return statements (KNF)

NFCI.

Thanks skrll@ for the heads-up!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_umb.c

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



CVS commit: src/sys/dev/usb

2018-08-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Aug  1 12:25:50 UTC 2018

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

Log Message:
Avoid parentheses in return statements (KNF)

NFCI.

Thanks skrll@ for the heads-up!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_umb.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_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.1 src/sys/dev/usb/if_umb.c:1.2
--- src/sys/dev/usb/if_umb.c:1.1	Tue Jul 31 16:44:29 2018
+++ src/sys/dev/usb/if_umb.c	Wed Aug  1 12:25:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.1 2018/07/31 16:44:29 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.18 2018/02/19 08:59:52 mpi Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.1 2018/07/31 16:44:29 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.2 2018/08/01 12:25:50 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2736,13 +2736,13 @@ inet_ntop(int af, const void *src, char 
 {
 	switch (af) {
 	case AF_INET:
-		return (inet_ntop4(src, dst, (size_t)size));
+		return inet_ntop4(src, dst, (size_t)size);
 #ifdef INET6
 	case AF_INET6:
-		return (inet_ntop6(src, dst, (size_t)size));
+		return inet_ntop6(src, dst, (size_t)size);
 #endif /* INET6 */
 	default:
-		return (NULL);
+		return NULL;
 	}
 	/* NOTREACHED */
 }
@@ -2767,10 +2767,10 @@ inet_ntop4(const u_char *src, char *dst,
 	l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
 	src[0], src[1], src[2], src[3]);
 	if (l <= 0 || l >= size) {
-		return (NULL);
+		return NULL;
 	}
 	strlcpy(dst, tmp, size);
-	return (dst);
+	return dst;
 }
 
 #ifdef INET6
@@ -2843,7 +2843,7 @@ inet_ntop6(const u_char *src, char *dst,
 		i < (best.base + best.len)) {
 			if (i == best.base) {
 if (tp + 1 >= ep)
-	return (NULL);
+	return NULL;
 *tp++ = ':';
 			}
 			continue;
@@ -2851,39 +2851,39 @@ inet_ntop6(const u_char *src, char *dst,
 		/* Are we following an initial run of 0x00s or any real hex? */
 		if (i != 0) {
 			if (tp + 1 >= ep)
-return (NULL);
+return NULL;
 			*tp++ = ':';
 		}
 		/* Is this address an encapsulated IPv4? */
 		if (i == 6 && best.base == 0 &&
 		(best.len == 6 || (best.len == 5 && words[5] == 0x))) {
 			if (!inet_ntop4(src+12, tp, (size_t)(ep - tp)))
-return (NULL);
+return NULL;
 			tp += strlen(tp);
 			break;
 		}
 		advance = snprintf(tp, ep - tp, "%x", words[i]);
 		if (advance <= 0 || advance >= ep - tp)
-			return (NULL);
+			return NULL;
 		tp += advance;
 	}
 	/* Was it a trailing run of 0x00's? */
 	if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) {
 		if (tp + 1 >= ep)
-			return (NULL);
+			return NULL;
 		*tp++ = ':';
 	}
 	if (tp + 1 >= ep)
-		return (NULL);
+		return NULL;
 	*tp++ = '\0';
 
 	/*
 	 * Check for overflow, copy, and we're done.
 	 */
 	if ((size_t)(tp - tmp) > size) {
-		return (NULL);
+		return NULL;
 	}
 	strlcpy(dst, tmp, size);
-	return (dst);
+	return dst;
 }
 #endif /* INET6 */



CVS commit: src

2018-07-31 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Jul 31 16:44:30 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi rescue.mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/man: mi
src/rescue: list
src/sbin: Makefile
src/share/man/man4: Makefile
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/dev/usb: Makefile files.usb usb.h usbdi.c usbdi.h
src/sys/net: if_types.h
src/sys/sys: sockio.h
Added Files:
src/sbin/umbctl: Makefile umbctl.8 umbctl.c
src/share/man/man4: umb.4
src/sys/dev/usb: if_umb.c if_umbreg.h mbim.h

Log Message:
Add a port of the umb(4) driver from OpenBSD

The umb(4) driver provides support for USB MBIM (Mobile Broadband
Interface Model) devices.

MBIM devices establish connections via cellular networks such as GPRS,
UMTS, and LTE. They appear as a regular point-to-point network interface, 
transporting raw IP frames.

Required configuration parameters like PIN and APN have to be set with
umbctl(8), a new tool specific to this driver. The IP address is configured
automatically; the default route and DNS server information have to be set
separately.

The driver is not fully functional yet, it is therefore still marked as
experimental and disabled by default. Any help welcome to complete it!

Tested on NetBSD/amd64, with a Sierra Wireless EM7345 LTE modem on a Lenovo
ThinkPad T440s. No functional change expected otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.1181 -r1.1182 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.41 -r1.42 src/distrib/sets/lists/base/rescue.mi
cvs rdiff -u -r1.2213 -r1.2214 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.258 -r1.259 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1602 -r1.1603 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.49 -r1.50 src/rescue/list
cvs rdiff -u -r1.132 -r1.133 src/sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/sbin/umbctl/Makefile src/sbin/umbctl/umbctl.8 \
src/sbin/umbctl/umbctl.c
cvs rdiff -u -r1.660 -r1.661 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/umb.4
cvs rdiff -u -r1.496 -r1.497 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1183 -r1.1184 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/Makefile
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/usb/files.usb
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/if_umb.c src/sys/dev/usb/if_umbreg.h \
src/sys/dev/usb/mbim.h
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/usb/usb.h
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/usb/usbdi.h
cvs rdiff -u -r1.28 -r1.29 src/sys/net/if_types.h
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/sockio.h

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



CVS commit: src/sys/dev/usb

2018-07-31 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Jul 31 16:07:46 UTC 2018

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

Log Message:
Re-generate


To generate a diff of this commit:
cvs rdiff -u -r1.749 -r1.750 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.749 src/sys/dev/usb/usbdevs.h:1.750
--- src/sys/dev/usb/usbdevs.h:1.749	Wed Jul 25 05:29:58 2018
+++ src/sys/dev/usb/usbdevs.h	Tue Jul 31 16:07:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs.h,v 1.749 2018/07/25 05:29:58 msaitoh Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.750 2018/07/31 16:07:46 khorben Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -3030,6 +3030,8 @@
 #define	USB_PRODUCT_SIERRA_AC885U	0x6880		/* Sierra Wireless AirCard 885U */
 #define	USB_PRODUCT_SIERRA_C01SW	0x6890		/* C01SW */
 #define	USB_PRODUCT_SIERRA_USB305	0x68a3		/* Sierra Wireless AirCard USB 305 */
+#define	USB_PRODUCT_SIERRA_MC7304	0x68c0		/* MC7304 */
+#define	USB_PRODUCT_SIERRA_EM7455	0x9079		/* EM7455 */
 
 /* Sigmatel products */
 #define	USB_PRODUCT_SIGMATEL_SIR4116	0x4116		/* StIR4116 SIR */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.749 src/sys/dev/usb/usbdevs_data.h:1.750
--- src/sys/dev/usb/usbdevs_data.h:1.749	Wed Jul 25 05:29:58 2018
+++ src/sys/dev/usb/usbdevs_data.h	Tue Jul 31 16:07:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs_data.h,v 1.749 2018/07/25 05:29:58 msaitoh Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.750 2018/07/31 16:07:46 khorben Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -4136,284 +4136,288 @@ static const uint16_t usb_products[] = {
 	17752, 0,
 	USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_USB305, 
 	3954, 651, 17595, 4871, 10581, 0,
+	USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7304, 
+	17758, 0,
+	USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_EM7455, 
+	17765, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_SIR4116, 
-	17758, 17767, 0,
+	17772, 17781, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_IRDA, 
 	9843, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_FIR4210, 
-	17771, 5533, 0,
+	17785, 5533, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_VFIR4220, 
-	17780, 17789, 0,
+	17794, 17803, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_I_BEAD100, 
-	17794, 12111, 8358, 10620, 0,
+	17808, 12111, 8358, 10620, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_I_BEAD150, 
-	17794, 15841, 8358, 10620, 0,
+	17808, 15841, 8358, 10620, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_DNSSF7X, 
-	17801, 1402, 17807, 17814, 17820, 0,
+	17815, 1402, 17821, 17828, 17834, 0,
 	USB_VENDOR_SIGMATEL, USB_PRODUCT_SIGMATEL_MUSICSTICK, 
-	17828, 17837, 0,
+	17842, 17851, 0,
 	USB_VENDOR_SIIG, USB_PRODUCT_SIIG_DIGIFILMREADER, 
-	17848, 10438, 0,
+	17862, 10438, 0,
 	USB_VENDOR_SIIG, USB_PRODUCT_SIIG_UISDMC2S, 
-	17863, 0,
+	17877, 0,
 	USB_VENDOR_SIIG, USB_PRODUCT_SIIG_MULTICARDREADER, 
-	17863, 0,
+	17877, 0,
 	USB_VENDOR_SIIG2, USB_PRODUCT_SIIG2_USBTOETHER, 
-	4871, 17879, 4901, 0,
+	4871, 17893, 4901, 0,
 	USB_VENDOR_SIIG2, USB_PRODUCT_SIIG2_US2308, 
 	6875, 0,
 	USB_VENDOR_SILICOM, USB_PRODUCT_SILICOM_U2E, 
-	17882, 0,
+	17896, 0,
 	USB_VENDOR_SILICOM, USB_PRODUCT_SILICOM_GPE, 
-	17886, 17210, 8543, 4901, 0,
+	17900, 17210, 8543, 4901, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_POLOLU, 
-	17892, 6875, 0,
+	17906, 6875, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_ARGUSISP, 
-	17899, 17909, 0,
+	17913, 17923, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CRUMB128, 
-	17913, 0,
+	17927, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_DEGREECONT, 
-	17922, 17929, 0,
+	17936, 17943, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_SUNNTO, 
-	17938, 17945, 0,
+	17952, 17959, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_DESKTOPMOBILE, 
-	17952, 13289, 17961, 0,
+	17966, 13289, 17975, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_IPLINK1220, 
-	17968, 17976, 0,
+	17982, 17990, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_JTAG, 
-	17981, 17990, 0,
+	17995, 18004, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_LIN, 
-	17981, 18000, 0,
+	17995, 18014, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_LIPOWSKY_HARP, 
-	17981, 18009, 0,
+	17995, 18023, 0,
 	USB_VENDOR_SILABS2, USB_PRODUCT_SILABS2_DCU11CLONE, 
-	18016, 18023, 0,
+	18030, 18037, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_1, 
-	18029, 6875, 0,
+	18043, 6875, 0,
 	USB_VENDOR_SILABS, USB_PRODUCT_SILABS_CP210X_2, 
-	18029, 6875, 0,
+	18043, 6875, 0,
 	

CVS commit: src/sys/dev/usb

2018-07-31 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Jul 31 16:07:46 UTC 2018

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

Log Message:
Re-generate


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



CVS commit: src/sys/dev/usb

2018-07-31 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Jul 31 16:07:26 UTC 2018

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

Log Message:
Add the Sierra Wireless MC7304 and EM7455 USB modems


To generate a diff of this commit:
cvs rdiff -u -r1.756 -r1.757 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.756 src/sys/dev/usb/usbdevs:1.757
--- src/sys/dev/usb/usbdevs:1.756	Wed Jul 25 05:29:33 2018
+++ src/sys/dev/usb/usbdevs	Tue Jul 31 16:07:26 2018
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.756 2018/07/25 05:29:33 msaitoh Exp $
+$NetBSD: usbdevs,v 1.757 2018/07/31 16:07:26 khorben Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3023,6 +3023,8 @@ product SIERRA AC881U		0x6856	Sierra Wir
 product SIERRA AC885U		0x6880	Sierra Wireless AirCard 885U
 product SIERRA C01SW		0x6890	C01SW
 product SIERRA USB305		0x68a3	Sierra Wireless AirCard USB 305
+product SIERRA MC7304		0x68c0	MC7304
+product SIERRA EM7455		0x9079	EM7455
 
 /* Sigmatel products */
 product SIGMATEL SIR4116	0x4116	StIR4116 SIR



CVS commit: src/sys/dev/usb

2018-07-31 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Jul 31 16:07:26 UTC 2018

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

Log Message:
Add the Sierra Wireless MC7304 and EM7455 USB modems


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

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



Re: CVS commit: src/sys/kern

2018-06-03 Thread Pierre Pronchery
On 03/06/2018 18:12, Michael wrote:
> Hello,
> 
> On Sun, 3 Jun 2018 15:26:04 +
> "Jonathan A. Kollasch"  wrote:
> 
>> Module Name: src
>> Committed By:jakllsch
>> Date:Sun Jun  3 15:26:04 UTC 2018
>>
>> Modified Files:
>>  src/sys/kern: subr_prf.c
>>
>> Log Message:
>> Make identification of accounted aprint_error()s possible by putting a
>> big ugly "autoconfiguration error: " in the log when they occur.
> 
> Maybe we can print them in red instead of the normal kernel green.

Or black on green background?
It would give a bit less of a rainbow effect.
Also, some people are visually impaired (like me).

HTH,
-- 
khorben



Re: CVS commit: src/external/bsd/top/dist

2018-06-03 Thread Pierre Pronchery
On 03/06/2018 05:10, Christos Zoulas wrote:
> On Jun 2,  7:36pm, li...@eitanadler.com (Eitan Adler) wrote:
> -- Subject: Re: CVS commit: src/external/bsd/top/dist
> 
> | I don't mind reverting this: it came out of a discussion on IRC. That
> | said, perhaps "cd /tmp" would resolve both issues?
> 
> This is a 3rd party program that behaves everywhere the same way;
> changing it for NetBSD will just produce unexpected results for
> the user:  How will I even know to cd to /tmp to look for the core?
> As I said, if you want it to run from a different directory, wrap
> it in a shell script or use an alias. These user-specific customizations
> don't belong in a general purpose program. It is a slippery slope
> to start making programs behave in random ways just because it is
> convenient for some uses. For example, I've never needed top to
> chdir before it grew a 'machine' subdirectory to fix the mess of
> ifdefs it required to run on multiple OS's. Are you planning to
> change vmstat to do the same? iostat? systat? Why not? These changes
> don't make sense (to me).

I agree with Christos here.

Cheers,
-- 
khorben



CVS commit: src/sys/netinet

2018-05-13 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun May 13 22:42:52 UTC 2018

Modified Files:
src/sys/netinet: in.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/netinet/in.c

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



CVS commit: src/sys/netinet

2018-05-13 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun May 13 22:42:52 UTC 2018

Modified Files:
src/sys/netinet: in.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.230 -r1.231 src/sys/netinet/in.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.230 src/sys/netinet/in.c:1.231
--- src/sys/netinet/in.c:1.230	Tue Apr 24 01:32:30 2018
+++ src/sys/netinet/in.c	Sun May 13 22:42:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.230 2018/04/24 01:32:30 knakahara Exp $	*/
+/*	$NetBSD: in.c,v 1.231 2018/05/13 22:42:51 khorben Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.230 2018/04/24 01:32:30 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.231 2018/05/13 22:42:51 khorben Exp $");
 
 #include "arp.h"
 
@@ -1145,7 +1145,7 @@ in_ifinit(struct ifnet *ifp, struct in_i
 
 	/*
 	 * Configure address flags.
-	 * We need to do this early because they maybe adjusted
+	 * We need to do this early because they may be adjusted
 	 * by if_addr_init depending on the address.
 	 */
 	if (ia->ia4_flags & IN_IFF_DUPLICATED) {



CVS commit: src/sys/arch/i386/include

2018-04-12 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Apr 13 01:49:47 UTC 2018

Modified Files:
src/sys/arch/i386/include: multiboot.h

Log Message:
Correct discrepancy with the Multiboot specification

The VBE mode was missing, and the types of the subsequent VBE members
were also wrong. Nothing in NetBSD's base seems to be using this, and
therefore nothing is expected to break as a result of this fix, or any
binary to change for that matter.
The latest specification (as of today) can be found at:
https://www.gnu.org/software/grub/manual/multiboot/multiboot.html

This was already reported in misc/52366, and addresses part of it.

Patch sent to port-i386@. Build-tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/include/multiboot.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/i386/include/multiboot.h
diff -u src/sys/arch/i386/include/multiboot.h:1.8 src/sys/arch/i386/include/multiboot.h:1.9
--- src/sys/arch/i386/include/multiboot.h:1.8	Sun Feb 22 18:05:42 2009
+++ src/sys/arch/i386/include/multiboot.h	Fri Apr 13 01:49:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: multiboot.h,v 1.8 2009/02/22 18:05:42 ahoka Exp $	*/
+/*	$NetBSD: multiboot.h,v 1.9 2018/04/13 01:49:47 khorben Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -134,9 +134,10 @@ struct multiboot_info {
 	/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_VBE. */
 	void *		unused_mi_vbe_control_info;
 	void *		unused_mi_vbe_mode_info;
-	paddr_t		unused_mi_vbe_interface_seg;
-	paddr_t		unused_mi_vbe_interface_off;
-	uint32_t	unused_mi_vbe_interface_len;
+	uint16_t	unused_mi_vbe_mode;
+	uint16_t	unused_mi_vbe_interface_seg;
+	uint16_t	unused_mi_vbe_interface_off;
+	uint16_t	unused_mi_vbe_interface_len;
 };
 
 /* - */



CVS commit: src/sys/arch/i386/include

2018-04-12 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Apr 13 01:49:47 UTC 2018

Modified Files:
src/sys/arch/i386/include: multiboot.h

Log Message:
Correct discrepancy with the Multiboot specification

The VBE mode was missing, and the types of the subsequent VBE members
were also wrong. Nothing in NetBSD's base seems to be using this, and
therefore nothing is expected to break as a result of this fix, or any
binary to change for that matter.
The latest specification (as of today) can be found at:
https://www.gnu.org/software/grub/manual/multiboot/multiboot.html

This was already reported in misc/52366, and addresses part of it.

Patch sent to port-i386@. Build-tested on NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/include/multiboot.h

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



CVS commit: src/usr.sbin/vnconfig

2018-03-11 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Mar 12 01:10:25 UTC 2018

Modified Files:
src/usr.sbin/vnconfig: vnconfig.c

Log Message:
Reflect the new name of vndconfig(8) in the usage screen

vnconfig(8) was renamed to vndconfig(8) in NetBSD 7. While the manual page
now defaults to vndconfig, the usage screen still referred to the old name.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/vnconfig/vnconfig.c

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



CVS commit: src/usr.sbin/vnconfig

2018-03-11 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Mon Mar 12 01:10:25 UTC 2018

Modified Files:
src/usr.sbin/vnconfig: vnconfig.c

Log Message:
Reflect the new name of vndconfig(8) in the usage screen

vnconfig(8) was renamed to vndconfig(8) in NetBSD 7. While the manual page
now defaults to vndconfig, the usage screen still referred to the old name.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/vnconfig/vnconfig.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/vnconfig/vnconfig.c
diff -u src/usr.sbin/vnconfig/vnconfig.c:1.44 src/usr.sbin/vnconfig/vnconfig.c:1.45
--- src/usr.sbin/vnconfig/vnconfig.c:1.44	Sun Apr 10 09:04:09 2016
+++ src/usr.sbin/vnconfig/vnconfig.c	Mon Mar 12 01:10:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnconfig.c,v 1.44 2016/04/10 09:04:09 martin Exp $	*/
+/*	$NetBSD: vnconfig.c,v 1.45 2018/03/12 01:10:25 khorben Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -425,9 +425,9 @@ usage(void)
 {
 
 	(void)fprintf(stderr, "%s%s",
-	"usage: vnconfig [-crvz] [-f dsktab] [-t type] vnode_disk"
+	"usage: vndconfig [-crvz] [-f dsktab] [-t type] vnode_disk"
 		" reg-file [geomspec]\n",
-	"   vnconfig -u [-Fv] vnode_disk\n"
-	"   vnconfig -l [-m num | vnode_disk...]\n");
+	"   vndconfig -u [-Fv] vnode_disk\n"
+	"   vndconfig -l [-m num | vnode_disk...]\n");
 	exit(1);
 }



CVS commit: src/sys/dev/sdmmc

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Mar 11 00:17:29 UTC 2018

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Outsource setting the backplane window into a specific function so it
can be called and reused in different places.

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sdmmc/if_bwfm_sdio.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/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.1 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.2
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.1	Tue Nov  7 16:30:32 2017
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sun Mar 11 00:17:28 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.1 2017/11/07 16:30:32 khorben Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.2 2018/03/11 00:17:28 khorben Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -73,6 +73,7 @@ int		 bwfm_sdio_match(device_t, cfdata_t
 void		 bwfm_sdio_attach(device_t, struct device *, void *);
 int		 bwfm_sdio_detach(device_t, int);
 
+void		 bwfm_sdio_backplane(struct bwfm_sdio_softc *, uint32_t);
 uint8_t		 bwfm_sdio_read_1(struct bwfm_sdio_softc *, uint32_t);
 uint32_t	 bwfm_sdio_read_4(struct bwfm_sdio_softc *, uint32_t);
 void		 bwfm_sdio_write_1(struct bwfm_sdio_softc *, uint32_t,
@@ -218,6 +219,21 @@ bwfm_sdio_detach(struct device *self, in
 	return 0;
 }
 
+void
+bwfm_sdio_backplane(struct bwfm_sdio_softc *sc, uint32_t bar0)
+{
+	if (sc->sc_bar0 == bar0)
+		return;
+
+	bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRLOW,
+	(bar0 >>  8) & 0x80);
+	bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRMID,
+	(bar0 >> 16) & 0xff);
+	bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRHIGH,
+	(bar0 >> 24) & 0xff);
+	sc->sc_bar0 = bar0;
+}
+
 uint8_t
 bwfm_sdio_read_1(struct bwfm_sdio_softc *sc, uint32_t addr)
 {
@@ -246,15 +262,7 @@ bwfm_sdio_read_4(struct bwfm_sdio_softc 
 	uint32_t bar0 = addr & ~BWFM_SDIO_SB_OFT_ADDR_MASK;
 	uint32_t rv;
 
-	if (sc->sc_bar0 != bar0) {
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRLOW,
-		(bar0 >>  8) & 0x80);
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRMID,
-		(bar0 >> 16) & 0xff);
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRHIGH,
-		(bar0 >> 24) & 0xff);
-		sc->sc_bar0 = bar0;
-	}
+	bwfm_sdio_backplane(sc, bar0);
 
 	addr &= BWFM_SDIO_SB_OFT_ADDR_MASK;
 	addr |= BWFM_SDIO_SB_ACCESS_2_4B_FLAG;
@@ -299,15 +307,7 @@ bwfm_sdio_write_4(struct bwfm_sdio_softc
 	struct sdmmc_function *sf;
 	uint32_t bar0 = addr & ~BWFM_SDIO_SB_OFT_ADDR_MASK;
 
-	if (sc->sc_bar0 != bar0) {
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRLOW,
-		(bar0 >>  8) & 0x80);
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRMID,
-		(bar0 >> 16) & 0xff);
-		bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_SBADDRHIGH,
-		(bar0 >> 24) & 0xff);
-		sc->sc_bar0 = bar0;
-	}
+	bwfm_sdio_backplane(sc, bar0);
 
 	addr &= BWFM_SDIO_SB_OFT_ADDR_MASK;
 	addr |= BWFM_SDIO_SB_ACCESS_2_4B_FLAG;



CVS commit: src/sys/dev/sdmmc

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sun Mar 11 00:17:29 UTC 2018

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Outsource setting the backplane window into a specific function so it
can be called and reused in different places.

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sdmmc/if_bwfm_sdio.c

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



CVS commit: src/sys/netinet

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Mar 10 23:28:13 UTC 2018

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/netinet/tcp_output.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/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.198 src/sys/netinet/tcp_output.c:1.199
--- src/sys/netinet/tcp_output.c:1.198	Mon Feb 12 08:22:26 2018
+++ src/sys/netinet/tcp_output.c	Sat Mar 10 23:28:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.198 2018/02/12 08:22:26 maxv Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.199 2018/03/10 23:28:13 khorben Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.198 2018/02/12 08:22:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.199 2018/03/10 23:28:13 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1720,7 +1720,7 @@ out:
 			error = 0;
 		}
 
-		/* Back out the seqence number advance. */
+		/* Back out the sequence number advance. */
 		if (sack_rxmit)
 			p->rxmit -= len;
 



CVS commit: src/sys/netinet

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Mar 10 23:28:13 UTC 2018

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/netinet/tcp_output.c

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



CVS commit: src/sys/dev/wscons

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Mar 10 23:25:59 UTC 2018

Modified Files:
src/sys/dev/wscons: mra.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/wscons/mra.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/wscons/mra.c
diff -u src/sys/dev/wscons/mra.c:1.6 src/sys/dev/wscons/mra.c:1.7
--- src/sys/dev/wscons/mra.c:1.6	Fri Mar 14 05:03:19 2014
+++ src/sys/dev/wscons/mra.c	Sat Mar 10 23:25:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mra.c,v 1.6 2014/03/14 05:03:19 khorben Exp $	*/
+/*	$NetBSD: mra.c,v 1.7 2018/03/10 23:25:59 khorben Exp $	*/
 
 /*
  * Copyright (c) 1999 Shin Takemura All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mra.c,v 1.6 2014/03/14 05:03:19 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mra.c,v 1.7 2018/03/10 23:25:59 khorben Exp $");
 
 #include 
 #include 
@@ -61,7 +61,7 @@ mra_Y_AX1_BX2_C(const int *y, int ys,
 #define Y(i)		AA(y, ys, i)
 
 	/*
-	 * get avarage and sum
+	 * get average and sum
 	 */
 	X1a = 0;	X2a = 0;	Ya = 0;
 	X1X1s = 0;	X2X2s = 0;	X1X2s = 0;



CVS commit: src/sys/dev/wscons

2018-03-10 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Sat Mar 10 23:25:59 UTC 2018

Modified Files:
src/sys/dev/wscons: mra.c

Log Message:
Fix spello in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/wscons/mra.c

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



Re: CVS commit: src/sys/ddb

2018-02-05 Thread Pierre Pronchery
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Matthew,

On 04/02/2018 10:17, matthew green wrote:
> Module Name:  src Committed By:   mrg Date:   Sun Feb  4 
> 09:17:54 UTC
> 2018
> 
> Modified Files: src/sys/ddb: db_access.c
> 
> Log Message: avoid leftshift of an unsigned value

Did you really mean "a signed value" instead?

Cheers,
- -- 
khorben
-BEGIN PGP SIGNATURE-

iQJHBAEBCAAxFiEEjPEp1wC4bxBrX8svMDjL25iGlwMFAlp4QjsTHGtob3JiZW5A
ZGVmb3JhLm9yZwAKCRAwOMvbmIaXAzlZEACn+oBbwFad9HHZLls6S/vDW9/Wact2
uluVVU04z5cCHTvCk3/JrrzsTC4WouFxs9/TCxEo0MNnYhtVJYLFun7DS77e/RKk
WUzRUEwqGShr16XZlOUqqQU8NmP7G+N6lALG2Zmi38QQCWuvXf9oqVmd8RWuke6o
YpcSJbsiEAQTGsfTygKTW1urpZOg7yYxbo0kvrDs73EiGc91bN7s3OkJDRInN9k/
aAxxUovvvIycPejsF8FNdJBv9eSjGqE6yQQjyB7jTcXr/HqUy3IN7ahcBpqda7fr
4zFTENC47t3WbuFgfjiwihplxNS5wbiUgAtrLTp7qNC875iH4sFYody/HxvXmJ36
xiIrBbWusYEelNoiGhhPS8pzDhD8EUkgF0klhfql5vZ5uy5NLjzRvI8I+D7/Zj8g
+t8GajfJSa8IHCXPu6QWqw9Pyx6EsxlJAeaPJA+HMFBuTGBWyTWmHFSLLdLfDxTO
QQmb2pcj2o3U5ECqQYpvRCJ3Ltto+QOmHCTKlG+PRHXTYfP/RQeCLeMZ9LxsAPhe
9Ht6qcpMGwEDUcyiORXaByDPztEx8w6h6ZauVgt0+Kg7nnF1Nnog8nwMfuZB7cLT
LjKcz6Xh9mmdg88hJWWYl1ybah7Ku02HF7jJte8X9UdJEazGkRBpqRAD/In06qDx
4vl2/zpbZrDpWw==
=Y54J
-END PGP SIGNATURE-



CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

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

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/hdaudio/hdafg.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.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.13 src/sys/dev/hdaudio/hdafg.c:1.14
--- src/sys/dev/hdaudio/hdafg.c:1.13	Fri Aug  4 00:25:23 2017
+++ src/sys/dev/hdaudio/hdafg.c	Thu Jan  4 00:09:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $ */
+/* $NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $");
 
 #include 
 #include 
@@ -4058,7 +4058,7 @@ hdafg_getdev(void *opaque, struct audio_
 	sc->sc_vendor);
 	hdaudio_findproduct(audiodev->version, sizeof(audiodev->version),
 	sc->sc_vendor, sc->sc_product);
-	snprintf(audiodev->config, sizeof(audiodev->config) - 1,
+	snprintf(audiodev->config, sizeof(audiodev->config),
 	"%02Xh", sc->sc_nid);
 
 	return 0;



CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

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

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/hdaudio/hdafg.c

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



CVS commit: src/sys/dev/usb

2017-12-26 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Dec 26 18:44:52 UTC 2017

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

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/dev/usb/usb_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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.222 src/sys/dev/usb/usb_subr.c:1.223
--- src/sys/dev/usb/usb_subr.c:1.222	Fri Dec  8 14:46:18 2017
+++ src/sys/dev/usb/usb_subr.c	Tue Dec 26 18:44:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.223 2017/12/26 18:44:52 khorben Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.223 2017/12/26 18:44:52 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1695,7 +1695,7 @@ usb_free_device(struct usbd_device *dev)
  * driver is dying and then wakes any sleepers.  It then sleeps on the
  * softc.  Each place that can sleep must maintain the reference
  * count.  When the reference count drops to -1 (0 is the normal value
- * of the reference count) the a wakeup on the softc is performed
+ * of the reference count) then a wakeup on the softc is performed
  * signaling to the detach waiter that all references are gone.
  */
 



CVS commit: src/sys/dev/usb

2017-12-26 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Dec 26 18:44:52 UTC 2017

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

Log Message:
Fix typo in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/dev/usb/usb_subr.c

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



CVS commit: src/sys/dev/usb

2017-12-08 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Dec  8 14:46:18 UTC 2017

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

Log Message:
Be more defensive towards malicious USB devices

This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.

Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).

Based on an initial patch by Nick Hudson , thanks!

Fixes PR kern/52383.

XXX pull-up to netbsd-7, netbsd-8

LGTM xtos@


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/dev/usb/usb_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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.221 src/sys/dev/usb/usb_subr.c:1.222
--- src/sys/dev/usb/usb_subr.c:1.221	Sat Oct 28 00:37:12 2017
+++ src/sys/dev/usb/usb_subr.c	Fri Dec  8 14:46:18 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.221 2017/10/28 00:37:12 pgoyette Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.221 2017/10/28 00:37:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.222 2017/12/08 14:46:18 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -609,6 +609,10 @@ usbd_set_config_index(struct usbd_device
 		return err;
 	}
 	len = UGETW(cd.wTotalLength);
+	if (len == 0) {
+		DPRINTF("empty short descriptor", 0, 0, 0, 0);
+		return USBD_INVAL;
+	}
 	cdp = kmem_alloc(len, KM_SLEEP);
 
 	/* Get the full descriptor.  Try a few times for slow devices. */
@@ -635,6 +639,11 @@ usbd_set_config_index(struct usbd_device
 		err = usbd_get_bos_desc(dev, index, );
 		if (!err) {
 			int blen = UGETW(bd.wTotalLength);
+			if (blen == 0) {
+DPRINTF("empty bos descriptor", 0, 0, 0, 0);
+err = USBD_INVAL;
+goto bad;
+			}
 			bdp = kmem_alloc(blen, KM_SLEEP);
 
 			/* Get the full desc */
@@ -724,6 +733,11 @@ usbd_set_config_index(struct usbd_device
 
 	/* Allocate and fill interface data. */
 	nifc = cdp->bNumInterface;
+	if (nifc == 0) {
+		DPRINTF("no interfaces", 0, 0, 0, 0);
+		err = USBD_INVAL;
+		goto bad;
+	}
 	dev->ud_ifaces = kmem_alloc(nifc * sizeof(struct usbd_interface),
 	KM_SLEEP);
 	DPRINTFN(5, "dev=%#jx cdesc=%#jx", (uintptr_t)dev, (uintptr_t)cdp,



CVS commit: src/sys/dev/usb

2017-12-08 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Dec  8 14:46:18 UTC 2017

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

Log Message:
Be more defensive towards malicious USB devices

This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.

Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).

Based on an initial patch by Nick Hudson , thanks!

Fixes PR kern/52383.

XXX pull-up to netbsd-7, netbsd-8

LGTM xtos@


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/dev/usb/usb_subr.c

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



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

2017-11-08 Thread Pierre Pronchery
Hi Jared,

On 07/11/2017 18:01, Jared McNeill wrote:
> Could have saved yourself a lot of time if you had emailed me first,
> I've been sitting on this code since I ported bwfm but didn't commit it
> as the original code doesn't actually work. Do you plan on finishing it?

Sorry, I could not guess that, and I currently do not have reliable
Internet at home so I often have to work on this offline. I got this
part to build, thought this was a net positive and decided to commit it
so it can benefit others too.

You are much better and faster than me at working on this, I am
interested in this area but feel free to go ahead and commit what you
have if you can improve it or get it to work.

Cheers,
-- khorben

> On Tue, 7 Nov 2017, Pierre Pronchery wrote:
> 
>> Module Name:    src
>> Committed By:    khorben
>> Date:    Tue Nov  7 16:30:32 UTC 2017
>>
>> Modified Files:
>> src/sys/dev/sdmmc: files.sdmmc
>> Added Files:
>> src/sys/dev/sdmmc: if_bwfm_sdio.c
>>
>> Log Message:
>> Add driver for Broadcom 802.11a/b/g/n/ac SDIO wireless devices, based on
>> the OpenBSD bwfm(4) driver.
>>
>> I could not test this on any hardware yet, as it does not attach as-is on
>> my Raspberry PI 3.
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.4 -r1.5 src/sys/dev/sdmmc/files.sdmmc
>> cvs rdiff -u -r0 -r1.1 src/sys/dev/sdmmc/if_bwfm_sdio.c
>>
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
>>
>>

-- 
khorben


Re: audio usemixer breaks vs(4) Re: CVS commit: src/sys/dev

2017-11-07 Thread Pierre Pronchery
Hi Nathanial, Tetsuya, (Christos)

this is one more thank you to Nathanial for this awesome work.

He's going to great length to make sure his changes work everywhere
every time, and even then it is very, very difficult to achieve a net
positive on every platform in every commit - we are supporting so many!

Let's just be a bit nicer to each other, fix issues as we see them
appear, and keep up the great work.

Cheers,
-- khorben

On 08/11/2017 00:10, Nathanial Sloss wrote:
> Hello Tetsuya and Christos,
> 
> 
> On Tue, 7 Nov 2017 14:45:47 Tetsuya Isaki wrote:
>> nat@, (cc: christos@)
>>
>> With this change, vs(4) no longer works even if usemixer=0.
>> Please revert it, and don't break without public discussion.
> 
> vs audio with the mixer enabled has been fixed in a follow up commit.
> 
> The change was intended to benifit slow (antiquated) computers that may have 
> trouble with the extra code in the audio path with mixing enabled.
> 
>>
>> This is the 3rd time you broke vs(4).
>> You broke and I repaired.
>> You broke and I repaired.
>> I spent a lot of time this half year.
> 
> The reason as to why vs audio does not work with usemixer=0 is that you 
> decided to remove what you considered to be dead code (mulaw, alaw, unsigned 
> linear filters).
> 
> The time I've spent on audio/ossaudio/bluetooth audio has been at least two 
> years non-stop and I will devote more time to it in future - so I think it's 
> fair to say we've all spent a lot of time perfecting NetBSD.
> 
>>
>> If you can not consider about supported devices (at least
>> devices which has active users), please don't touch audio.
>>
> 
> Every time I make a change I test it with emulations of various computers, 
> usb 
> audio devices, all of the computers I own and bluetooth.
> 
> Also an x68k emulation since x68k has been a problem with the changes.
> 
> I think to hold the merits of what I done to audio to x68k's abilities to be 
> unfair.
> 
> I'm actively trying to innovate and to bring NetBSD's audio server into the 
> 21 
> century whist still providing a solution for legacy systems we support.
> 
> I hope to contine to work on audio in future - if there is an emmense 
> objection from others I will stop audio completely and work on something else.
> 
> NB: Since I've started to alter audio with regards to mixing and such, I've 
> received at least 30 thank you emails from strangers and NetBSD users -  The 
> people we write NetBSD for.
> 
> 
>> Thanks,
> 
>> ---
>> Tetsuya Isaki 
> 
> Best regards and I hope to collaborate with you on audio in future as it is a 
> mutual interest.
> 
> Nat
> 
>>
>> At Tue, 7 Nov 2017 01:13:19 +,
>>
>>> Module Name:src
>>> Committed By:   nat
>>> Date:   Tue Nov  7 01:13:19 UTC 2017
>>>
>>> Modified Files:
>>> src/sys/dev: audio.c audiovar.h
>>>
>>> Log Message:
>>> A sysctl is now available to disable the in kernel mixer.
>>>
>>> sysctl -w hw.hdafg0.usemixer=0
>>>
>>> There currently is a problem draining the last block with the mixer
>>> disabled.  I will fix this in a follow up commit.
>>>
>>> AFAIK there will be a problem wiht vs(4) on x68k with the mixer disabled
>>> as the filters for mulaw, alaw and unsigned linear have been removed post
>>> audio mixing changes.
>>>
>>> Documentation for this sysctl variable will be made to audio.4 in a
>>> follow up commit.
>>>
>>> Ok christos@.
>>>
>>>
>>> To generate a diff of this commit:
>>> cvs rdiff -u -r1.429 -r1.430 src/sys/dev/audio.c
>>> cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audiovar
-- 
khorben



signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys/dev/sdmmc

2017-11-07 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Nov  7 16:30:32 UTC 2017

Modified Files:
src/sys/dev/sdmmc: files.sdmmc
Added Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Add driver for Broadcom 802.11a/b/g/n/ac SDIO wireless devices, based on
the OpenBSD bwfm(4) driver.

I could not test this on any hardware yet, as it does not attach as-is on
my Raspberry PI 3.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/sdmmc/files.sdmmc
cvs rdiff -u -r0 -r1.1 src/sys/dev/sdmmc/if_bwfm_sdio.c

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



CVS commit: src/sys/dev/sdmmc

2017-11-07 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Nov  7 16:30:32 UTC 2017

Modified Files:
src/sys/dev/sdmmc: files.sdmmc
Added Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
Add driver for Broadcom 802.11a/b/g/n/ac SDIO wireless devices, based on
the OpenBSD bwfm(4) driver.

I could not test this on any hardware yet, as it does not attach as-is on
my Raspberry PI 3.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/sdmmc/files.sdmmc
cvs rdiff -u -r0 -r1.1 src/sys/dev/sdmmc/if_bwfm_sdio.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/sdmmc/files.sdmmc
diff -u src/sys/dev/sdmmc/files.sdmmc:1.4 src/sys/dev/sdmmc/files.sdmmc:1.5
--- src/sys/dev/sdmmc/files.sdmmc:1.4	Thu Oct  2 21:49:22 2014
+++ src/sys/dev/sdmmc/files.sdmmc	Tue Nov  7 16:30:32 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: files.sdmmc,v 1.4 2014/10/02 21:49:22 jmcneill Exp $
+#  $NetBSD: files.sdmmc,v 1.5 2017/11/07 16:30:32 khorben Exp $
 #  $OpenBSD: files.sdmmc,v 1.2 2006/06/01 21:53:41 uwe Exp $
 #
 # Config file and device description for machine-independent SD/MMC code.
@@ -21,3 +21,7 @@ file	dev/sdmmc/ld_sdmmc.c		ld_sdmmc
 device sbt: btbus, bluetooth
 attach sbt at sdmmc
 file	dev/sdmmc/sbt.c			sbt
+
+# Broadcom FullMAC SDIO wireless adapter
+attach bwfm at sdmmc with bwfm_sdio
+file	dev/sdmmc/if_bwfm_sdio.c	bwfm_sdio

Added files:

Index: src/sys/dev/sdmmc/if_bwfm_sdio.c
diff -u /dev/null src/sys/dev/sdmmc/if_bwfm_sdio.c:1.1
--- /dev/null	Tue Nov  7 16:30:32 2017
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Tue Nov  7 16:30:32 2017
@@ -0,0 +1,444 @@
+/* $NetBSD: if_bwfm_sdio.c,v 1.1 2017/11/07 16:30:32 khorben Exp $ */
+/* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
+/*
+ * Copyright (c) 2010-2016 Broadcom Corporation
+ * Copyright (c) 2016,2017 Patrick Wildt 
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+#define BWFM_SDIO_CCCR_BRCM_CARDCAP			0xf0
+#define  BWFM_SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT	0x02
+#define  BWFM_SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT		0x04
+#define  BWFM_SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC		0x08
+#define BWFM_SDIO_CCCR_BRCM_CARDCTRL			0xf1
+#define  BWFM_SDIO_CCCR_BRCM_CARDCTRL_WLANRESET		0x02
+#define BWFM_SDIO_CCCR_BRCM_SEPINT			0xf2
+
+#ifdef BWFM_DEBUG
+#define DPRINTF(x)	do { if (bwfm_debug > 0) printf x; } while (0)
+#define DPRINTFN(n, x)	do { if (bwfm_debug >= (n)) printf x; } while (0)
+static int bwfm_debug = 2;
+#else
+#define DPRINTF(x)	do { ; } while (0)
+#define DPRINTFN(n, x)	do { ; } while (0)
+#endif
+
+#define DEVNAME(sc)	device_xname((sc)->sc_sc.sc_dev)
+
+struct bwfm_sdio_softc {
+	struct bwfm_softc	  sc_sc;
+	struct sdmmc_function	**sc_sf;
+	uint32_t		  sc_bar0;
+};
+
+int		 bwfm_sdio_match(device_t, cfdata_t, void *);
+void		 bwfm_sdio_attach(device_t, struct device *, void *);
+int		 bwfm_sdio_detach(device_t, int);
+
+uint8_t		 bwfm_sdio_read_1(struct bwfm_sdio_softc *, uint32_t);
+uint32_t	 bwfm_sdio_read_4(struct bwfm_sdio_softc *, uint32_t);
+void		 bwfm_sdio_write_1(struct bwfm_sdio_softc *, uint32_t,
+		 uint8_t);
+void		 bwfm_sdio_write_4(struct bwfm_sdio_softc *, uint32_t,
+		 uint32_t);
+
+uint32_t	 bwfm_sdio_buscore_read(struct bwfm_softc *, uint32_t);
+void		 bwfm_sdio_buscore_write(struct bwfm_softc *, uint32_t,
+		 uint32_t);
+int		 bwfm_sdio_buscore_prepare(struct bwfm_softc *);
+void		 bwfm_sdio_buscore_activate(struct bwfm_softc *, uint32_t);
+
+int		 bwfm_sdio_txdata(struct bwfm_softc *, struct mbuf *);
+int		 bwfm_sdio_txctl(struct bwfm_softc *, char *, size_t);
+int		 bwfm_sdio_rxctl(struct bwfm_softc *, char *, size_t *);
+
+struct bwfm_bus_ops bwfm_sdio_bus_ops = {
+	.bs_init = NULL,
+	.bs_stop = NULL,
+	.bs_txdata = bwfm_sdio_txdata,
+	.bs_txctl = bwfm_sdio_txctl,
+	.bs_rxctl = bwfm_sdio_rxctl,
+};
+
+struct bwfm_buscore_ops bwfm_sdio_buscore_ops = {
+	.bc_read = bwfm_sdio_buscore_read,
+	.bc_write = bwfm_sdio_buscore_write,
+	

CVS commit: src/share/misc

2017-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  1 15:34:28 UTC 2017

Modified Files:
src/share/misc: acronyms

Log Message:
BPM: beam propagation method (light)
BPM: beats per minute (music)


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/share/misc/acronyms

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



CVS commit: src/share/misc

2017-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  1 15:34:28 UTC 2017

Modified Files:
src/share/misc: acronyms

Log Message:
BPM: beam propagation method (light)
BPM: beats per minute (music)


To generate a diff of this commit:
cvs rdiff -u -r1.261 -r1.262 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.261 src/share/misc/acronyms:1.262
--- src/share/misc/acronyms:1.261	Wed Nov  1 15:11:31 2017
+++ src/share/misc/acronyms	Wed Nov  1 15:34:28 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.261 2017/11/01 15:11:31 riastradh Exp $
+$NetBSD: acronyms,v 1.262 2017/11/01 15:34:28 khorben Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -73,6 +73,8 @@ BNYA	burned now you are
 BOC	but of course
 BOFH	bastard operator from hell
 BOT	back on topic
+BPM	beam propagation method
+BPM	beats per minute
 BRB	[I'll] be right back
 BSD	booze, sex, drugs
 BTDT	been there, done that



CVS commit: src/share/mk

2017-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  1 15:24:42 UTC 2017

Modified Files:
src/share/mk: bsd.README

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.363 -r1.364 src/share/mk/bsd.README

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.363 src/share/mk/bsd.README:1.364
--- src/share/mk/bsd.README:1.363	Sun Oct  8 15:03:50 2017
+++ src/share/mk/bsd.README	Wed Nov  1 15:24:42 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.363 2017/10/08 15:03:50 christos Exp $
+#	$NetBSD: bsd.README,v 1.364 2017/11/01 15:24:42 khorben Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -374,7 +374,7 @@ MKRELRO		If "partial", set the non-PLT G
 		also force immediate symbol binding.
 		Default: no
 	
-MKREPRO If "yes", create reproducable builds. This enables
+MKREPRO If "yes", create reproducible builds. This enables
 		different switches to make two builds from the same source tree
 		result in the same build results.
 		Default: no
@@ -1210,7 +1210,7 @@ LIBDIR		Target directory for libraries.
 
 MKARZERO	Normally, ar(1) sets the timestamps, uid, gid and
 		permissions in files inside its archives to those of
-		the file it was fed. This leads to non-reproduceable
+		the file it was fed. This leads to non-reproducible
 		builds. If MKARZERO is set to "yes" (default is the
 		same as MKREPRO, or "no" if MKREPRO is not defined),
 		then the "D" flag is passed to ar, causing the



CVS commit: src/share/mk

2017-11-01 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Wed Nov  1 15:24:42 UTC 2017

Modified Files:
src/share/mk: bsd.README

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.363 -r1.364 src/share/mk/bsd.README

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



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:57:14 UTC 2017

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

Log Message:
Also attach the RTL8192EU from TP-LINK


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



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:57:14 UTC 2017

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

Log Message:
Also attach the RTL8192EU from TP-LINK


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 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.53 src/sys/dev/usb/if_urtwn.c:1.54
--- src/sys/dev/usb/if_urtwn.c:1.53	Wed May  3 15:34:05 2017
+++ src/sys/dev/usb/if_urtwn.c	Tue Oct 31 00:57:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.53 2017/05/03 15:34:05 jnemeth Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.54 2017/10/31 00:57:14 khorben 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.53 2017/05/03 15:34:05 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.54 2017/10/31 00:57:14 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -195,6 +195,7 @@ static const struct urtwn_dev {
 
 	/* URTWN_RTL8192EU */
 	URTWN_RTL8192EU_DEV(REALTEK,	RTL8192EU),
+	URTWN_RTL8192EU_DEV(TPLINK,	RTL8192EU),
 };
 #undef URTWN_DEV
 #undef URTWN_RTL8188E_DEV



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:30:07 UTC 2017

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

Log Message:
Re-generate


To generate a diff of this commit:
cvs rdiff -u -r1.735 -r1.736 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.736 -r1.737 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.735 src/sys/dev/usb/usbdevs.h:1.736
--- src/sys/dev/usb/usbdevs.h:1.735	Thu Oct 19 23:55:02 2017
+++ src/sys/dev/usb/usbdevs.h	Tue Oct 31 00:30:07 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.735 2017/10/19 23:55:02 jmcneill Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.736 2017/10/31 00:30:07 khorben Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.742 2017/10/19 23:54:42 jmcneill Exp
+ *	NetBSD: usbdevs,v 1.743 2017/10/31 00:20:51 khorben Exp
  */
 
 /*
@@ -3290,6 +3290,7 @@
 
 /* TP-Link products */
 #define	USB_PRODUCT_TPLINK_RTL8192CU	0x0100		/* RTL8192CU */
+#define	USB_PRODUCT_TPLINK_RTL8192EU	0x0109		/* RTL8192EU */
 #define	USB_PRODUCT_TPLINK_RTL8188EU	0x010c		/* RTL8188EU */
 
 /* Trek Technology products */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.736 src/sys/dev/usb/usbdevs_data.h:1.737
--- src/sys/dev/usb/usbdevs_data.h:1.736	Thu Oct 19 23:55:02 2017
+++ src/sys/dev/usb/usbdevs_data.h	Tue Oct 31 00:30:07 2017
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.736 2017/10/19 23:55:02 jmcneill Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.737 2017/10/31 00:30:07 khorben Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.742 2017/10/19 23:54:42 jmcneill Exp
+ *	NetBSD: usbdevs,v 1.743 2017/10/31 00:20:51 khorben Exp
  */
 
 /*
@@ -4480,6 +4480,8 @@ static const uint16_t usb_products[] = {
 	8525, 6353, 4878, 5670, 0,
 	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8192CU, 
 	5090, 0,
+	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8192EU, 
+	16460, 0,
 	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8188EU, 
 	5100, 0,
 	USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE, 
@@ -6974,7 +6976,7 @@ static const char usb_words[] = { "." 
 	"RTL8191CU\0" /* 1 refs @ 16431 */
 	"RTL8192CE\0" /* 1 refs @ 16441 */
 	"RTL8187B\0" /* 3 refs @ 16451 */
-	"RTL8192EU\0" /* 1 refs @ 16460 */
+	"RTL8192EU\0" /* 2 refs @ 16460 */
 	"RTL8712\0" /* 1 refs @ 16470 */
 	"RTL8713\0" /* 1 refs @ 16478 */
 	"BlackBerry\0" /* 3 refs @ 16486 */



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:30:07 UTC 2017

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

Log Message:
Re-generate


To generate a diff of this commit:
cvs rdiff -u -r1.735 -r1.736 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.736 -r1.737 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.



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:20:51 UTC 2017

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

Log Message:
Add the TP-LINK TL-WN823N (version 2)


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

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



CVS commit: src/sys/dev/usb

2017-10-30 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Tue Oct 31 00:20:51 UTC 2017

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

Log Message:
Add the TP-LINK TL-WN823N (version 2)


To generate a diff of this commit:
cvs rdiff -u -r1.742 -r1.743 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.742 src/sys/dev/usb/usbdevs:1.743
--- src/sys/dev/usb/usbdevs:1.742	Thu Oct 19 23:54:42 2017
+++ src/sys/dev/usb/usbdevs	Tue Oct 31 00:20:51 2017
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.742 2017/10/19 23:54:42 jmcneill Exp $
+$NetBSD: usbdevs,v 1.743 2017/10/31 00:20:51 khorben Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3283,6 +3283,7 @@ product TOSHIBA HSDPA_MODEM_EU870DT1	0x1
 
 /* TP-Link products */
 product TPLINK RTL8192CU	0x0100	RTL8192CU
+product TPLINK RTL8192EU	0x0109	RTL8192EU
 product TPLINK RTL8188EU	0x010c	RTL8188EU
 
 /* Trek Technology products */



CVS commit: src/sys/arch/evbarm

2017-09-22 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Sep 22 15:37:13 UTC 2017

Modified Files:
src/sys/arch/evbarm/kobo: kobo_usb.c
src/sys/arch/evbarm/netwalker: netwalker_usb.c

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/kobo/kobo_usb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/netwalker/netwalker_usb.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/evbarm/kobo/kobo_usb.c
diff -u src/sys/arch/evbarm/kobo/kobo_usb.c:1.1 src/sys/arch/evbarm/kobo/kobo_usb.c:1.2
--- src/sys/arch/evbarm/kobo/kobo_usb.c:1.1	Fri Jul 25 11:22:50 2014
+++ src/sys/arch/evbarm/kobo/kobo_usb.c	Fri Sep 22 15:37:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobo_usb.c,v 1.1 2014/07/25 11:22:50 hkenken Exp $	*/
+/*	$NetBSD: kobo_usb.c,v 1.2 2017/09/22 15:37:13 khorben Exp $	*/
 
 /*
  * Copyright (c) 2012  Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kobo_usb.c,v 1.1 2014/07/25 11:22:50 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kobo_usb.c,v 1.2 2017/09/22 15:37:13 khorben Exp $");
 
 #include "opt_imx.h"
 
@@ -113,7 +113,7 @@ kobo_usb_init(struct imxehci_softc *sc)
 		init_h1(sc);
 		break;
 	default:
-		aprint_error_dev(sc->sc_hsc.sc_dev, "unit %d not supprted\n",
+		aprint_error_dev(sc->sc_hsc.sc_dev, "unit %d not supported\n",
 		sc->sc_unit);
 	}
 }

Index: src/sys/arch/evbarm/netwalker/netwalker_usb.c
diff -u src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.3 src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.4
--- src/sys/arch/evbarm/netwalker/netwalker_usb.c:1.3	Sun Apr 15 10:19:47 2012
+++ src/sys/arch/evbarm/netwalker/netwalker_usb.c	Fri Sep 22 15:37:13 2017
@@ -25,7 +25,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netwalker_usb.c,v 1.3 2012/04/15 10:19:47 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netwalker_usb.c,v 1.4 2017/09/22 15:37:13 khorben Exp $");
 
 #include 
 #include 
@@ -106,7 +106,7 @@ netwalker_usb_init(struct imxehci_softc 
 		init_h1(sc);
 		break;
 	default:
-		aprint_error_dev(sc->sc_hsc.sc_dev, "unit %d not supprted\n",
+		aprint_error_dev(sc->sc_hsc.sc_dev, "unit %d not supported\n",
 		sc->sc_unit);
 	}
 }



CVS commit: src/sys/arch/evbarm

2017-09-22 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Fri Sep 22 15:37:13 UTC 2017

Modified Files:
src/sys/arch/evbarm/kobo: kobo_usb.c
src/sys/arch/evbarm/netwalker: netwalker_usb.c

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/kobo/kobo_usb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/netwalker/netwalker_usb.c

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



  1   2   3   4   >