CVS commit: src/sys/dev/pci

2024-06-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jun  8 21:02:29 UTC 2024

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

Log Message:
s/amound/amount/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 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/pci

2024-06-08 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jun  8 21:02:29 UTC 2024

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

Log Message:
s/amound/amount/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 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.78 src/sys/dev/pci/emuxki.c:1.79
--- src/sys/dev/pci/emuxki.c:1.78	Wed Dec 20 05:08:34 2023
+++ src/sys/dev/pci/emuxki.c	Sat Jun  8 21:02:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.78 2023/12/20 05:08:34 thorpej Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.79 2024/06/08 21:02:29 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.78 2023/12/20 05:08:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.79 2024/06/08 21:02:29 andvar Exp $");
 
 #include 
 #include 
@@ -801,7 +801,7 @@ emuxki_play_start(struct emuxki_softc *s
 	volume = 32767;
 
 	emuxki_write(sc, ch, EMU_CHAN_DSL,
-	(0 << 24) |	/* send amound D = 0 */
+	(0 << 24) |	/* send amount D = 0 */
 	end);
 
 	emuxki_write(sc, ch, EMU_CHAN_PSST,



CVS commit: src/sys/dev/mii

2024-06-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Jun  6 21:28:31 UTC 2024

Modified Files:
src/sys/dev/mii: bmtphyreg.h icsphyreg.h

Log Message:
s/dupled/duplex/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/bmtphyreg.h \
src/sys/dev/mii/icsphyreg.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/mii

2024-06-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Jun  6 21:17:37 UTC 2024

Modified Files:
src/sys/dev/mii: amhphyreg.h

Log Message:
s/chane/change/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/amhphyreg.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/mii

2024-06-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Jun  6 21:17:37 UTC 2024

Modified Files:
src/sys/dev/mii: amhphyreg.h

Log Message:
s/chane/change/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/amhphyreg.h

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

Modified files:

Index: src/sys/dev/mii/amhphyreg.h
diff -u src/sys/dev/mii/amhphyreg.h:1.1 src/sys/dev/mii/amhphyreg.h:1.2
--- src/sys/dev/mii/amhphyreg.h:1.1	Sat Aug 25 04:06:26 2001
+++ src/sys/dev/mii/amhphyreg.h	Thu Jun  6 21:17:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: amhphyreg.h,v 1.1 2001/08/25 04:06:26 thorpej Exp $	*/
+/*	$NetBSD: amhphyreg.h,v 1.2 2024/06/06 21:17:37 andvar Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -50,7 +50,7 @@
 #define	SER_SCE			0x0200	/* speed change enable */
 #define	SER_GE			0x0100	/* global enable */
 #define	SER_LSC			0x0010	/* link status change */
-#define	SER_DMC			0x0008	/* duplex mode chane */
+#define	SER_DMC			0x0008	/* duplex mode change */
 #define	SER_ANC			0x0004	/* auto-negotiation change */
 #define	SER_SC			0x0002	/* speed change */
 #define	SER_G			0x0001	/* global event pending */



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

2024-05-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 30 08:55:02 UTC 2024

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

Log Message:
Move RECOVERY_MODE feature test code for readability. No functional change.

 ixgbe.c rev. 1.169 inserted RECOVERY_MODE feature test in between
 MSI-X allocation and legacy allocation. To improve code readability,
move it to earlier location.


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

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.350 src/sys/dev/pci/ixgbe/ixgbe.c:1.351
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.350	Mon May 13 03:15:33 2024
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu May 30 08:55:02 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.351 2024/05/30 08:55:02 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.351 2024/05/30 08:55:02 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1136,6 +1136,21 @@ ixgbe_attach(device_t parent, device_t d
 	error = ixgbe_read_pba_string(hw, buf, IXGBE_PBANUM_LENGTH);
 	aprint_normal_dev(dev, "PBA number %s\n", error ? "unknown" : buf);
 
+	/* Recovery mode */
+	switch (sc->hw.mac.type) {
+	case ixgbe_mac_X550:
+	case ixgbe_mac_X550EM_x:
+	case ixgbe_mac_X550EM_a:
+		/* >= 2.00 */
+		if (hw->eeprom.nvm_image_ver_high >= 2) {
+			sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE;
+			sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE;
+		}
+		break;
+	default:
+		break;
+	}
+
 	if (sc->feat_en & IXGBE_FEATURE_MSIX) {
 		error = ixgbe_allocate_msix(sc, pa);
 		if (error) {
@@ -1155,21 +1170,6 @@ ixgbe_attach(device_t parent, device_t d
 		}
 	}
 
-	/* Recovery mode */
-	switch (sc->hw.mac.type) {
-	case ixgbe_mac_X550:
-	case ixgbe_mac_X550EM_x:
-	case ixgbe_mac_X550EM_a:
-		/* >= 2.00 */
-		if (hw->eeprom.nvm_image_ver_high >= 2) {
-			sc->feat_cap |= IXGBE_FEATURE_RECOVERY_MODE;
-			sc->feat_en |= IXGBE_FEATURE_RECOVERY_MODE;
-		}
-		break;
-	default:
-		break;
-	}
-
 	if ((sc->feat_en & IXGBE_FEATURE_MSIX) == 0)
 		error = ixgbe_allocate_legacy(sc, pa);
 	if (error)



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

2024-05-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 30 08:55:02 UTC 2024

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

Log Message:
Move RECOVERY_MODE feature test code for readability. No functional change.

 ixgbe.c rev. 1.169 inserted RECOVERY_MODE feature test in between
 MSI-X allocation and legacy allocation. To improve code readability,
move it to earlier location.


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

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



CVS commit: src/sys/dev/audio

2024-05-26 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon May 27 02:47:53 UTC 2024

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
audio(4): Handle delta == 0 in audio_volume_(up|down).

These functions are used by the pmf power handler functions to deal
with keyboard volume up/down key presses.

However, delta is optional, and may not be returned by certain hardware
drivers, including the earliest reference drivers (it is unlikely that
these are used on any systems with pmf volume keys on the keyboard,
but still).

XXX it may make sense to have 16 as a minimum bound for delta, since
pressing the volume up key on a keyboard 255 times doesn't sound
particularly fun.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/audio/audio.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/audio

2024-05-26 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon May 27 02:47:53 UTC 2024

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
audio(4): Handle delta == 0 in audio_volume_(up|down).

These functions are used by the pmf power handler functions to deal
with keyboard volume up/down key presses.

However, delta is optional, and may not be returned by certain hardware
drivers, including the earliest reference drivers (it is unlikely that
these are used on any systems with pmf volume keys on the keyboard,
but still).

XXX it may make sense to have 16 as a minimum bound for delta, since
pressing the volume up key on a keyboard 255 times doesn't sound
particularly fun.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.145 src/sys/dev/audio/audio.c:1.146
--- src/sys/dev/audio/audio.c:1.145	Sun Oct  1 09:34:28 2023
+++ src/sys/dev/audio/audio.c	Mon May 27 02:47:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.145 2023/10/01 09:34:28 mlelstv Exp $	*/
+/*	$NetBSD: audio.c,v 1.146 2024/05/27 02:47:53 nia Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -181,7 +181,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.145 2023/10/01 09:34:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.146 2024/05/27 02:47:53 nia Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -9151,6 +9151,13 @@ audio_volume_down(device_t dv)
 		mi.un.v.delta = 0;
 		if (audio_query_devinfo(sc, ) == 0) {
 			au_get_gain(sc, >sc_outports, , );
+			/*
+			 * delta is optional. 16 gives us about 16 increments
+			 * to reach max or minimum gain which seems reasonable
+			 * for keyboard key presses.
+			 */
+			if (mi.un.v.delta == 0)
+mi.un.v.delta = 16;
 			newgain = gain - mi.un.v.delta;
 			if (newgain < AUDIO_MIN_GAIN)
 newgain = AUDIO_MIN_GAIN;
@@ -9175,6 +9182,8 @@ audio_volume_up(device_t dv)
 		mi.un.v.delta = 0;
 		if (audio_query_devinfo(sc, ) == 0) {
 			au_get_gain(sc, >sc_outports, , );
+			if (mi.un.v.delta == 0) 
+mi.un.v.delta = 16;
 			newgain = gain + mi.un.v.delta;
 			if (newgain > AUDIO_MAX_GAIN)
 newgain = AUDIO_MAX_GAIN;



CVS commit: src/sys/dev/pci

2024-05-21 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue May 21 22:47:11 UTC 2024

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

Log Message:
eap(4): re-organize mixer controls to put classes first

some software (understandably) doesn't like it if you declare a
mixer node's child before the parent, notably ossxmix in pkgsrc


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pci/eapreg.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/eapreg.h
diff -u src/sys/dev/pci/eapreg.h:1.13 src/sys/dev/pci/eapreg.h:1.14
--- src/sys/dev/pci/eapreg.h:1.13	Mon Apr 28 20:23:54 2008
+++ src/sys/dev/pci/eapreg.h	Tue May 21 22:47:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: eapreg.h,v 1.13 2008/04/28 20:23:54 martin Exp $	*/
+/*	$NetBSD: eapreg.h,v 1.14 2024/05/21 22:47:11 nia Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -292,20 +292,20 @@
 #define VOL_0DB 200
 
 /* Futzable parms */
-#define EAP_MASTER_VOL		0
-#define EAP_VOICE_VOL		1
-#define EAP_FM_VOL		2
-#define EAP_VIDEO_VOL		2	/* ES1371 */
-#define EAP_CD_VOL		3
-#define EAP_LINE_VOL		4
-#define EAP_AUX_VOL		5
-#define EAP_MIC_VOL		6
-#define	EAP_RECORD_SOURCE	7
-#define EAP_INPUT_SOURCE	8
-#define	EAP_MIC_PREAMP		9
-#define EAP_OUTPUT_CLASS	10
-#define EAP_RECORD_CLASS	11
-#define EAP_INPUT_CLASS		12
+#define EAP_OUTPUT_CLASS	0
+#define EAP_RECORD_CLASS	1
+#define EAP_INPUT_CLASS		2
+#define EAP_MASTER_VOL		3
+#define EAP_VOICE_VOL		4
+#define EAP_FM_VOL		5
+#define EAP_VIDEO_VOL		5	/* ES1371 */
+#define EAP_CD_VOL		6
+#define EAP_LINE_VOL		7
+#define EAP_AUX_VOL		8
+#define EAP_MIC_VOL		9
+#define	EAP_RECORD_SOURCE	10
+#define EAP_INPUT_SOURCE	11
+#define	EAP_MIC_PREAMP		12
 
 #define MIDI_BUSY_WAIT		100
 #define MIDI_BUSY_DELAY		100	/* Delay when UART is busy */



CVS commit: src/sys/dev/pci

2024-05-21 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue May 21 22:47:11 UTC 2024

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

Log Message:
eap(4): re-organize mixer controls to put classes first

some software (understandably) doesn't like it if you declare a
mixer node's child before the parent, notably ossxmix in pkgsrc


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

2024-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue May 21 08:04:20 UTC 2024

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

Log Message:
nix extra whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/ne2000.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/ne2000.c
diff -u src/sys/dev/ic/ne2000.c:1.78 src/sys/dev/ic/ne2000.c:1.79
--- src/sys/dev/ic/ne2000.c:1.78	Tue May 21 07:29:40 2024
+++ src/sys/dev/ic/ne2000.c	Tue May 21 08:04:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ne2000.c,v 1.78 2024/05/21 07:29:40 andvar Exp $	*/
+/*	$NetBSD: ne2000.c,v 1.79 2024/05/21 08:04:20 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.78 2024/05/21 07:29:40 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.79 2024/05/21 08:04:20 andvar Exp $");
 
 #include "rtl80x9.h"
 
@@ -373,7 +373,7 @@ ne2000_detect(bus_space_tag_t nict, bus_
 
 	/*
 	 * Generic probe routine for testing for the existence of a DS8390.
-	 * Must be performed  after the NIC has just been reset.  This
+	 * Must be performed after the NIC has just been reset.  This
 	 * works by looking at certain register values that are guaranteed
 	 * to be initialized a certain way after power-up or reset.
 	 *



CVS commit: src/sys/dev/ic

2024-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue May 21 08:04:20 UTC 2024

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

Log Message:
nix extra whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/ne2000.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

2024-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue May 21 07:29:40 UTC 2024

Modified Files:
src/sys/dev/ic: mx98905.c ne2000.c

Log Message:
s/amout/amount/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/mx98905.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/ic/ne2000.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/mx98905.c
diff -u src/sys/dev/ic/mx98905.c:1.17 src/sys/dev/ic/mx98905.c:1.18
--- src/sys/dev/ic/mx98905.c:1.17	Tue Aug  1 20:52:43 2023
+++ src/sys/dev/ic/mx98905.c	Tue May 21 07:29:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mx98905.c,v 1.17 2023/08/01 20:52:43 andvar Exp $	*/
+/*	$NetBSD: mx98905.c,v 1.18 2024/05/21 07:29:40 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: mx98905.c,v 1.17 2023/08/01 20:52:43 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mx98905.c,v 1.18 2024/05/21 07:29:40 andvar Exp $");
 
 #include 
 #include 
@@ -282,7 +282,7 @@ mx98905_write_mbuf(struct dp8390_softc *
 }
 
 /*
- * Given a source and destination address, copy 'amout' of a packet from
+ * Given a source and destination address, copy 'amount' of a packet from
  * the ring buffer into a linear destination buffer.  Takes into account
  * ring-wrap.
  */

Index: src/sys/dev/ic/ne2000.c
diff -u src/sys/dev/ic/ne2000.c:1.77 src/sys/dev/ic/ne2000.c:1.78
--- src/sys/dev/ic/ne2000.c:1.77	Fri Aug 20 20:25:28 2021
+++ src/sys/dev/ic/ne2000.c	Tue May 21 07:29:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ne2000.c,v 1.77 2021/08/20 20:25:28 andvar Exp $	*/
+/*	$NetBSD: ne2000.c,v 1.78 2024/05/21 07:29:40 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.77 2021/08/20 20:25:28 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.78 2024/05/21 07:29:40 andvar Exp $");
 
 #include "rtl80x9.h"
 
@@ -716,7 +716,7 @@ ne2000_write_mbuf(struct dp8390_softc *s
 }
 
 /*
- * Given a source and destination address, copy 'amout' of a packet from
+ * Given a source and destination address, copy 'amount' of a packet from
  * the ring buffer into a linear destination buffer.  Takes into account
  * ring-wrap.
  */



CVS commit: src/sys/dev/ic

2024-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue May 21 07:29:40 UTC 2024

Modified Files:
src/sys/dev/ic: mx98905.c ne2000.c

Log Message:
s/amout/amount/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/mx98905.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/ic/ne2000.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

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:36:21 UTC 2024

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

Log Message:
xhci(4): Narrow some more variable scopes in xhci_device_isoc_enter.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.183 src/sys/dev/usb/xhci.c:1.184
--- src/sys/dev/usb/xhci.c:1.183	Mon May 20 11:35:54 2024
+++ src/sys/dev/usb/xhci.c	Mon May 20 11:36:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.184 2024/05/20 11:36:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.184 2024/05/20 11:36:20 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -4560,14 +4560,12 @@ xhci_device_isoc_enter(struct usbd_xfer 
 	uint64_t parameter;
 	uint32_t status;
 	uint32_t control;
-	uint32_t mfindex;
 	uint32_t offs;
 	int i, ival;
 	const bool polling = xhci_polling_p(sc);
 	const uint16_t MPS = UGETW(xfer->ux_pipe->up_endpoint->ue_edesc->wMaxPacketSize);
 	const uint16_t mps = UE_GET_SIZE(MPS);
 	const uint8_t maxb = xpipe->xp_maxb;
-	u_int tdpc, tbc, tlbpc;
 
 	XHCIHIST_FUNC();
 	XHCIHIST_CALLARGS("%#jx slot %ju dci %ju",
@@ -4593,7 +4591,8 @@ xhci_device_isoc_enter(struct usbd_xfer 
 		ival = 1; /* fake something up */
 
 	if (xpipe->xp_isoc_next == -1) {
-		mfindex = xhci_rt_read_4(sc, XHCI_MFINDEX);
+		uint32_t mfindex = xhci_rt_read_4(sc, XHCI_MFINDEX);
+
 		DPRINTF("mfindex %jx", (uintmax_t)mfindex, 0, 0, 0);
 		mfindex = XHCI_MFINDEX_GET(mfindex + 1);
 		mfindex /= USB_UFRAMES_PER_FRAME;
@@ -4604,11 +4603,10 @@ xhci_device_isoc_enter(struct usbd_xfer 
 	offs = 0;
 	for (i = 0; i < xfer->ux_nframes; i++) {
 		const uint32_t len = xfer->ux_frlengths[i];
-
-		tdpc = howmany(len, mps);
-		tbc = howmany(tdpc, maxb) - 1;
-		tlbpc = tdpc % maxb;
-		tlbpc = tlbpc ? tlbpc - 1 : maxb - 1;
+		const unsigned tdpc = howmany(len, mps);
+		const unsigned tbc = howmany(tdpc, maxb) - 1;
+		const unsigned tlbpc1 = tdpc % maxb;
+		const unsigned tlbpc = tlbpc1 ? tlbpc1 - 1 : maxb - 1;
 
 		KASSERTMSG(len <= 0x1, "len %d", len);
 		parameter = DMAADDR(dma, offs);



CVS commit: src/sys/dev/usb

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:36:21 UTC 2024

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

Log Message:
xhci(4): Narrow some more variable scopes in xhci_device_isoc_enter.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/xhci.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

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:35:55 UTC 2024

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

Log Message:
xhci(4): Narrow scope of variable.

Nix spurious initialization in wider scope.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.182 src/sys/dev/usb/xhci.c:1.183
--- src/sys/dev/usb/xhci.c:1.182	Mon May 20 11:35:36 2024
+++ src/sys/dev/usb/xhci.c	Mon May 20 11:35:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -4556,7 +4556,6 @@ xhci_device_isoc_enter(struct usbd_xfer 
 	struct xhci_ring * const tr = xs->xs_xr[dci];
 	struct xhci_xfer * const xx = XHCI_XFER2XXFER(xfer);
 	struct xhci_pipe * const xpipe = (struct xhci_pipe *)xfer->ux_pipe;
-	uint32_t len = xfer->ux_length;
 	usb_dma_t * const dma = >ux_dmabuf;
 	uint64_t parameter;
 	uint32_t status;
@@ -4604,7 +4603,7 @@ xhci_device_isoc_enter(struct usbd_xfer 
 
 	offs = 0;
 	for (i = 0; i < xfer->ux_nframes; i++) {
-		len = xfer->ux_frlengths[i];
+		const uint32_t len = xfer->ux_frlengths[i];
 
 		tdpc = howmany(len, mps);
 		tbc = howmany(tdpc, maxb) - 1;



CVS commit: src/sys/dev/usb

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:35:55 UTC 2024

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

Log Message:
xhci(4): Narrow scope of variable.

Nix spurious initialization in wider scope.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/xhci.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

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:35:37 UTC 2024

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

Log Message:
xhci.c: Fix confusing line break.

No functionanl change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/xhci.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

2024-05-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 20 11:35:37 UTC 2024

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

Log Message:
xhci.c: Fix confusing line break.

No functionanl change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.181 src/sys/dev/usb/xhci.c:1.182
--- src/sys/dev/usb/xhci.c:1.181	Fri Apr  5 18:57:10 2024
+++ src/sys/dev/usb/xhci.c	Mon May 20 11:35:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.181 2024/04/05 18:57:10 riastradh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.181 2024/04/05 18:57:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2496,8 +2496,7 @@ xhci_event_transfer(struct xhci_softc * 
 			xfer->ux_frlengths[xx->xx_isoc_done] -=
 			XHCI_TRB_2_REM_GET(trb_2);
 			xfer->ux_actlen += xfer->ux_frlengths[xx->xx_isoc_done];
-		} else
-		if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0) {
+		} else if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0) {
 			if (xfer->ux_actlen == 0)
 xfer->ux_actlen = xfer->ux_length -
 XHCI_TRB_2_REM_GET(trb_2);



CVS commit: src/sys/dev/i2c

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 00:02:04 UTC 2024

Modified Files:
src/sys/dev/i2c: dbcool.c sgsmix.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/sgsmix.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/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.64 src/sys/dev/i2c/dbcool.c:1.65
--- src/sys/dev/i2c/dbcool.c:1.64	Wed Mar 30 00:06:50 2022
+++ src/sys/dev/i2c/dbcool.c	Sat May 18 00:02:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.64 2022/03/30 00:06:50 pgoyette Exp $ */
+/*	$NetBSD: dbcool.c,v 1.65 2024/05/18 00:02:04 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,13 +50,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.64 2022/03/30 00:06:50 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.65 2024/05/18 00:02:04 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 

Index: src/sys/dev/i2c/sgsmix.c
diff -u src/sys/dev/i2c/sgsmix.c:1.10 src/sys/dev/i2c/sgsmix.c:1.11
--- src/sys/dev/i2c/sgsmix.c:1.10	Sat Jan 30 01:23:08 2021
+++ src/sys/dev/i2c/sgsmix.c	Sat May 18 00:02:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sgsmix.c,v 1.10 2021/01/30 01:23:08 thorpej Exp $	*/
+/*	$NetBSD: sgsmix.c,v 1.11 2024/05/18 00:02:04 thorpej Exp $	*/
 
 /*-
  * Copyright (C) 2005 Michael Lorenz.
@@ -31,13 +31,12 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sgsmix.c,v 1.10 2021/01/30 01:23:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sgsmix.c,v 1.11 2024/05/18 00:02:04 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 



CVS commit: src/sys/dev/i2c

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 00:02:04 UTC 2024

Modified Files:
src/sys/dev/i2c: dbcool.c sgsmix.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/sgsmix.c

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



CVS commit: src/sys/dev/pci

2024-05-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri May 17 12:20:02 UTC 2024

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

Log Message:
eap(4): Restore the full set of supported hardware encodings from netbsd-7

Tested in QEMU.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/pci/eap.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/eap.c
diff -u src/sys/dev/pci/eap.c:1.102 src/sys/dev/pci/eap.c:1.103
--- src/sys/dev/pci/eap.c:1.102	Thu Jul 25 15:06:07 2019
+++ src/sys/dev/pci/eap.c	Fri May 17 12:20:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: eap.c,v 1.102 2019/07/25 15:06:07 msaitoh Exp $	*/
+/*	$NetBSD: eap.c,v 1.103 2024/05/17 12:20:02 nia Exp $	*/
 /*  $OpenBSD: eap.c,v 1.6 1999/10/05 19:24:42 csapuntz Exp $ */
 
 /*
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.102 2019/07/25 15:06:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eap.c,v 1.103 2024/05/17 12:20:02 nia Exp $");
 
 #include "midi.h"
 #include "joy_eap.h"
@@ -218,9 +218,39 @@ static const struct audio_format eap_for
 		.precision	= 16,
 		.channels	= 2,
 		.channel_mask	= AUFMT_STEREO,
-		.frequency_type	= 2,
+		.frequency_type	= 0,
 		.frequency	= { 4000, 48000 },
 	},
+	{
+		.mode		= AUMODE_PLAY | AUMODE_RECORD,
+		.encoding	= AUDIO_ENCODING_SLINEAR_LE,
+		.validbits	= 16,
+		.precision	= 16,
+		.channels	= 1,
+		.channel_mask	= AUFMT_MONAURAL,
+		.frequency_type	= 0,
+		.frequency	= { 4000, 48000 },
+	},
+	{
+		.mode		= AUMODE_PLAY | AUMODE_RECORD,
+		.encoding	= AUDIO_ENCODING_ULINEAR_LE,
+		.validbits	= 8,
+		.precision	= 8,
+		.channels	= 2,
+		.channel_mask	= AUFMT_STEREO,
+		.frequency_type	= 0,
+		.frequency	= { 4000, 48000 },
+	},
+	{
+		.mode		= AUMODE_PLAY | AUMODE_RECORD,
+		.encoding	= AUDIO_ENCODING_ULINEAR_LE,
+		.validbits	= 8,
+		.precision	= 8,
+		.channels	= 1,
+		.channel_mask	= AUFMT_MONAURAL,
+		.frequency_type	= 0,
+		.frequency	= { 4000, 48000 },
+	}
 };
 #define EAP_NFORMATS	__arraycount(eap_formats)
 



CVS commit: src/sys/dev/pci

2024-05-17 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri May 17 12:20:02 UTC 2024

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

Log Message:
eap(4): Restore the full set of supported hardware encodings from netbsd-7

Tested in QEMU.


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

2024-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May 14 13:41:15 UTC 2024

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

Log Message:
tpm(4): device_printf needs \n.

Observed in PR 58255.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/sys/dev/ic/tpm.c:1.29
--- src/sys/dev/ic/tpm.c:1.28	Tue Jul  4 01:02:26 2023
+++ src/sys/dev/ic/tpm.c	Tue May 14 13:41:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpm.c,v 1.28 2023/07/04 01:02:26 riastradh Exp $	*/
+/*	$NetBSD: tpm.c,v 1.29 2024/05/14 13:41:15 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.28 2023/07/04 01:02:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.29 2024/05/14 13:41:15 riastradh Exp $");
 
 #include 
 #include 
@@ -150,7 +150,7 @@ tpm12_suspend(struct tpm_softc *sc)
 	 */
 	error = (*sc->sc_intf->start)(sc, UIO_WRITE);
 	if (error) {
-		device_printf(sc->sc_dev, "start write failed: %d", error);
+		device_printf(sc->sc_dev, "start write failed: %d\n", error);
 		goto out;
 	}
 
@@ -158,8 +158,8 @@ tpm12_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->write)(sc, , sizeof(command));
 	if (error) {
-		device_printf(sc->sc_dev, "write TPM_ORD_SaveState failed: %d",
-		error);
+		device_printf(sc->sc_dev, "write TPM_ORD_SaveState failed:"
+		" %d\n", error);
 		goto out;
 	}
 
@@ -167,7 +167,7 @@ tpm12_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->end)(sc, UIO_WRITE, 0);
 	if (error) {
-		device_printf(sc->sc_dev, "end write failed: %d", error);
+		device_printf(sc->sc_dev, "end write failed: %d\n", error);
 		goto out;
 	}
 
@@ -177,7 +177,7 @@ tpm12_suspend(struct tpm_softc *sc)
 	 */
 	error = (*sc->sc_intf->start)(sc, UIO_READ);
 	if (error) {
-		device_printf(sc->sc_dev, "start read failed: %d", error);
+		device_printf(sc->sc_dev, "start read failed: %d\n", error);
 		goto out;
 	}
 
@@ -186,11 +186,11 @@ tpm12_suspend(struct tpm_softc *sc)
 	error = (*sc->sc_intf->read)(sc, , sizeof(response), ,
 	0);
 	if (error) {
-		device_printf(sc->sc_dev, "read failed: %d", error);
+		device_printf(sc->sc_dev, "read failed: %d\n", error);
 		goto out;
 	}
 	if (nread != sizeof(response)) {
-		device_printf(sc->sc_dev, "short header read: %zu", nread);
+		device_printf(sc->sc_dev, "short header read: %zu\n", nread);
 		goto out;
 	}
 
@@ -198,7 +198,7 @@ tpm12_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->end)(sc, UIO_READ, 0);
 	if (error) {
-		device_printf(sc->sc_dev, "end read failed: %d", error);
+		device_printf(sc->sc_dev, "end read failed: %d\n", error);
 		goto out;
 	}
 
@@ -209,7 +209,8 @@ tpm12_suspend(struct tpm_softc *sc)
 	be32toh(response.length) != sizeof(response) ||
 	be32toh(response.code) != 0) {
 		device_printf(sc->sc_dev,
-		"TPM_ORD_SaveState failed: tag=0x%x length=0x%x code=0x%x",
+		"TPM_ORD_SaveState failed:"
+		" tag=0x%x length=0x%x code=0x%x\n",
 		be16toh(response.tag),
 		be32toh(response.length),
 		be32toh(response.code));
@@ -248,7 +249,7 @@ tpm20_suspend(struct tpm_softc *sc)
 	 */
 	error = (*sc->sc_intf->start)(sc, UIO_WRITE);
 	if (error) {
-		device_printf(sc->sc_dev, "start write failed: %d", error);
+		device_printf(sc->sc_dev, "start write failed: %d\n", error);
 		goto out;
 	}
 
@@ -256,8 +257,8 @@ tpm20_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->write)(sc, , sizeof(command));
 	if (error) {
-		device_printf(sc->sc_dev, "write TPM_ORD_SaveState failed: %d",
-		error);
+		device_printf(sc->sc_dev, "write TPM_ORD_SaveState failed:"
+		" %d\n", error);
 		goto out;
 	}
 
@@ -265,7 +266,7 @@ tpm20_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->end)(sc, UIO_WRITE, 0);
 	if (error) {
-		device_printf(sc->sc_dev, "end write failed: %d", error);
+		device_printf(sc->sc_dev, "end write failed: %d\n", error);
 		goto out;
 	}
 
@@ -275,7 +276,7 @@ tpm20_suspend(struct tpm_softc *sc)
 	 */
 	error = (*sc->sc_intf->start)(sc, UIO_READ);
 	if (error) {
-		device_printf(sc->sc_dev, "start read failed: %d", error);
+		device_printf(sc->sc_dev, "start read failed: %d\n", error);
 		goto out;
 	}
 
@@ -284,11 +285,11 @@ tpm20_suspend(struct tpm_softc *sc)
 	error = (*sc->sc_intf->read)(sc, , sizeof(response), ,
 	0);
 	if (error) {
-		device_printf(sc->sc_dev, "read failed: %d", error);
+		device_printf(sc->sc_dev, "read failed: %d\n", error);
 		goto out;
 	}
 	if (nread != sizeof(response)) {
-		device_printf(sc->sc_dev, "short header read: %zu", nread);
+		device_printf(sc->sc_dev, "short header read: %zu\n", nread);
 		goto out;
 	}
 
@@ -296,7 +297,7 @@ tpm20_suspend(struct tpm_softc *sc)
 
 	error = (*sc->sc_intf->end)(sc, UIO_READ, 0);
 	if (error) {
-		

CVS commit: src/sys/dev/ic

2024-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May 14 13:41:15 UTC 2024

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

Log Message:
tpm(4): device_printf needs \n.

Observed in PR 58255.


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

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon May 13 03:15:33 UTC 2024

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

Log Message:
Modify comment. The number of queues is not limited to 8.

The number of queue is calculated from both the number of CPUs and
the number of MSI-X vectors.


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

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.349 src/sys/dev/pci/ixgbe/ixgbe.c:1.350
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.349	Wed Jan 24 05:18:59 2024
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon May 13 03:15:33 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.349 2024/01/24 05:18:59 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.349 2024/01/24 05:18:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.350 2024/05/13 03:15:33 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -358,8 +358,8 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix
 /*
  * Number of Queues, can be set to 0,
  * it then autoconfigures based on the
- * number of cpus with a max of 8. This
- * can be overridden manually here.
+ * number of cpus and number of MSI-X vectors.
+ * This can be overridden manually here.
  */
 static int ixgbe_num_queues = 0;
 SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, _num_queues, 0,



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

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon May 13 03:15:33 UTC 2024

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

Log Message:
Modify comment. The number of queues is not limited to 8.

The number of queue is calculated from both the number of CPUs and
the number of MSI-X vectors.


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

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



CVS commit: src/sys/dev/pci

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:30:37 UTC 2024

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1484 -r1.1485 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1483 -r1.1484 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:30:07 UTC 2024

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

Log Message:
Add some Intel Rapotr Lake graphics.


To generate a diff of this commit:
cvs rdiff -u -r1.1505 -r1.1506 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1505 src/sys/dev/pci/pcidevs:1.1506
--- src/sys/dev/pci/pcidevs:1.1505	Sun May 12 23:29:14 2024
+++ src/sys/dev/pci/pcidevs	Sun May 12 23:30:07 2024
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1505 2024/05/12 23:29:14 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1506 2024/05/12 23:30:07 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -7476,6 +7476,9 @@ product INTEL RPL_IGD_6		0xa7a0	Raptor L
 product INTEL RPL_IGD_7		0xa7a1	Raptor Lake Graphics (96 or 80EU)
 product INTEL RPL_IGD_8		0xa7a8	Raptor Lake Graphics (64 or 48EU)
 product INTEL RPL_IGD_9		0xa7a9	Raptor Lake Graphics (64 or 48EU)
+product INTEL RPL_IGD_10	0xa7aa	Raptor Lake Graphics (96 or 80EU)
+product INTEL RPL_IGD_11	0xa7ac	Raptor Lake Graphics (96 or 80EU)
+product INTEL RPL_IGD_12	0xa7ad	Raptor Lake Graphics (64EU)
 product INTEL 21152		0xb152	S21152BB PCI-PCI Bridge
 product INTEL 21154		0xb154	S21152BA,S21154AE/BE PCI-PCI Bridge
 product INTEL 21555		0xb555	21555 Non-Transparent PCI-PCI Bridge



CVS commit: src/sys/dev/pci

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:30:07 UTC 2024

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

Log Message:
Add some Intel Rapotr Lake graphics.


To generate a diff of this commit:
cvs rdiff -u -r1.1505 -r1.1506 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/dev/pci

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:29:14 UTC 2024

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

Log Message:
Add Phison PS5021 and PS5026.


To generate a diff of this commit:
cvs rdiff -u -r1.1504 -r1.1505 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1504 src/sys/dev/pci/pcidevs:1.1505
--- src/sys/dev/pci/pcidevs:1.1504	Sat Apr  6 09:10:11 2024
+++ src/sys/dev/pci/pcidevs	Sun May 12 23:29:14 2024
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1504 2024/04/06 09:10:11 andvar Exp $
+$NetBSD: pcidevs,v 1.1505 2024/05/12 23:29:14 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -7856,8 +7856,10 @@ product PHILIPS SAA7135HL	0x7135	SAA7135
 product PHILIPS SAA7146AH	0x7146	SAA7146AH PCI Multimedia Bridge
 
 /* Phison products */
-product PHISON PS5000		0x5000 PS5000
-product PHISON PS5016		0x5016 PS5016
+product PHISON PS5000		0x5000	PS5000
+product PHISON PS5016		0x5016	PS5016
+product PHISON PS5021		0x5021	PS5021
+product PHISON PS5026		0x5026	PS5026
 
 /* NCR/Symbios Logic products */
 product SYMBIOS 810			0x0001	53c810



CVS commit: src/sys/dev/pci

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:29:14 UTC 2024

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

Log Message:
Add Phison PS5021 and PS5026.


To generate a diff of this commit:
cvs rdiff -u -r1.1504 -r1.1505 src/sys/dev/pci/pcidevs

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



CVS commit: src/sys/dev/usb

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:18:34 UTC 2024

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

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.807 -r1.808 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.807 src/sys/dev/usb/usbdevs.h:1.808
--- src/sys/dev/usb/usbdevs.h:1.807	Tue Apr 16 22:33:04 2024
+++ src/sys/dev/usb/usbdevs.h	Sun May 12 13:18:34 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.807 2024/04/17 02:33:04 maya Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.808 2024/05/12 17:18:34 christos Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp
+ *	NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp
  */
 
 /*-
@@ -3474,6 +3474,7 @@
 #define	USB_PRODUCT_TPLINK_T4UV2	0x010d		/* Archer T4U ver 2 */
 #define	USB_PRODUCT_TPLINK_T4UHV2	0x010e		/* Archer T4UH ver 2 */
 #define	USB_PRODUCT_TPLINK_T2UNANO	0x011e		/* Archer T2U Nano */
+#define	USB_PRODUCT_TPLINK_UE300	0x0601		/* UE300 10/100/1000 LAN */
 
 /* Trek Technology products */
 #define	USB_PRODUCT_TREK_THUMBDRIVE	0x		/* ThumbDrive */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.807 src/sys/dev/usb/usbdevs_data.h:1.808
--- src/sys/dev/usb/usbdevs_data.h:1.807	Tue Apr 16 22:33:04 2024
+++ src/sys/dev/usb/usbdevs_data.h	Sun May 12 13:18:34 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.807 2024/04/17 02:33:04 maya Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.808 2024/05/12 17:18:34 christos Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp
+ *	NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp
  */
 
 /*-
@@ -4767,168 +4767,170 @@ static const uint32_t usb_products[] = {
 	20027, 20038, 7643, 6624, 0,
 	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_T2UNANO, 
 	20027, 20043, 6975, 0,
+	USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_UE300, 
+	20047, 20053, 7459, 0,
 	USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE, 
-	20047, 0,
+	20065, 0,
 	USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, 
-	20047, 20058, 0,
+	20065, 20076, 0,
 	USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_RTL8192CU, 
 	5282, 0,
 	USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_RTL8188CU, 
 	5302, 0,
 	USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_TEW648UBM, 
-	20062, 0,
+	20080, 0,
 	USB_VENDOR_TRIPPLITE, USB_PRODUCT_TRIPPLITE_U209, 
-	20073, 7044, 5007, 0,
+	20091, 7044, 5007, 0,
 	USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_UPS, 
 	3207, 3213, 480, 0,
 	USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_SMARTLCD, 
-	20078, 480, 0,
+	20096, 480, 0,
 	USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_AVR550U, 
-	3207, 3213, 20087, 0,
+	3207, 3213, 20105, 0,
 	USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_T33521, 
-	20095, 20103, 0,
+	20113, 20121, 0,
 	USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_XXX1100, 
-	16365, 20111, 0,
+	16365, 20129, 0,
 	USB_VENDOR_TSUNAMI, USB_PRODUCT_TSUNAMI_SM2000, 
-	20116, 0,
+	20134, 0,
 	USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_G240, 
-	20124, 0,
+	20142, 0,
 	USB_VENDOR_ULTIMA, USB_PRODUCT_ULTIMA_1200UBPLUS, 
 	11625, 15247, 11515, 7345, 0,
 	USB_VENDOR_ULTIMA, USB_PRODUCT_ULTIMA_T14BR, 
-	20129, 20135, 6945, 0,
+	20147, 20153, 6945, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1236U, 
-	20141, 5778, 20147, 0,
+	20159, 5778, 20165, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1220U, 
-	20141, 20155, 20147, 0,
+	20159, 20173, 20165, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2000U, 
-	20141, 20161, 20147, 0,
+	20159, 20179, 20165, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA3400, 
-	20141, 20167, 20147, 0,
+	20159, 20185, 20165, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2100U, 
-	20141, 20172, 20147, 0,
+	20159, 20190, 20165, 0,
 	USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2200U, 
-	20141, 20178, 20147, 0,
+	20159, 20196, 20165, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB_A, 
-	20184, 0,
+	20202, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB, 
-	20196, 0,
+	20214, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UBC1, 
-	20196, 9551, 0,
+	20214, 9551, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_RT2870_1, 
 	5161, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW645UB, 
-	20206, 0,
+	20224, 0,
 	USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_ALL0298V2, 
-	20216, 7632, 0,
+	20234, 7632, 0,
 	USB_VENDOR_UNIACCESS, 

CVS commit: src/sys/dev/usb

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:18:34 UTC 2024

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

Log Message:
Regen


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

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:17:56 UTC 2024

Modified Files:
src/sys/dev/usb: if_ure.c usbdevs

Log Message:
PR/58250: RVP: Add TP-Link UE300 USB LAN adapter


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.815 -r1.816 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/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.59 src/sys/dev/usb/if_ure.c:1.60
--- src/sys/dev/usb/if_ure.c:1.59	Mon Oct  9 07:28:05 2023
+++ src/sys/dev/usb/if_ure.c	Sun May 12 13:17:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.59 2023/10/09 11:28:05 riastradh Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.60 2024/05/12 17:17:56 christos Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.59 2023/10/09 11:28:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.60 2024/05/12 17:17:56 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -72,7 +72,8 @@ int	uredebug = 0;
 
 static const struct usb_devno ure_devs[] = {
 	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8152 },
-	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 }
+	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 },
+	{ USB_VENDOR_TPLINK,  USB_PRODUCT_TPLINK_UE300 },
 };
 
 #define URE_BUFSZ	(16 * 1024)

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.815 src/sys/dev/usb/usbdevs:1.816
--- src/sys/dev/usb/usbdevs:1.815	Tue Apr 16 22:32:08 2024
+++ src/sys/dev/usb/usbdevs	Sun May 12 13:17:56 2024
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.815 2024/04/17 02:32:08 maya Exp $
+$NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3467,6 +3467,7 @@ product TPLINK RTL8188EU	0x010c	RTL8188E
 product	TPLINK T4UV2		0x010d  Archer T4U ver 2
 product	TPLINK T4UHV2		0x010e  Archer T4UH ver 2
 product	TPLINK T2UNANO		0x011e  Archer T2U Nano
+product	TPLINK UE300		0x0601	UE300 10/100/1000 LAN
 
 /* Trek Technology products */
 product TREK THUMBDRIVE		0x	ThumbDrive



CVS commit: src/sys/dev/usb

2024-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 12 17:17:56 UTC 2024

Modified Files:
src/sys/dev/usb: if_ure.c usbdevs

Log Message:
PR/58250: RVP: Add TP-Link UE300 USB LAN adapter


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.815 -r1.816 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/acpi

2024-05-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri May 10 19:29:46 UTC 2024

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

Log Message:
Add quirk for machines were the getting the brightness value always
returns the same result by keeping a local copy of the last set value.

This makes the brightness buttons work on my Thinkpad T450s, and will
probably fix PR kern/57825 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/acpi/acpi_display.c

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

Modified files:

Index: src/sys/dev/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.23 src/sys/dev/acpi/acpi_display.c:1.24
--- src/sys/dev/acpi/acpi_display.c:1.23	Fri Mar 17 17:16:06 2023
+++ src/sys/dev/acpi/acpi_display.c	Fri May 10 19:29:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.23 2023/03/17 17:16:06 andvar Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.24 2024/05/10 19:29:46 maya Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.23 2023/03/17 17:16:06 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.24 2024/05/10 19:29:46 maya Exp $");
 
 #include 
 #include 
@@ -270,6 +270,12 @@ struct acpidisp_brctl {
 	uint8_t		*bc_level;		/* Array of levels */
 	uint16_t	 bc_level_count;	/* Number of levels */
 	uint8_t		 bc_current;		/* Current level */
+
+	/* 
+	 * Quirk if firmware returns wrong values for _BQC
+	 * (acpidisp_get_brightness) 
+	 */
+	bool		bc_bqc_broken;
 };
 
 /*
@@ -376,6 +382,7 @@ static int	acpidisp_get_brightness(const
 		uint8_t *);
 static int	acpidisp_set_brightness(const struct acpidisp_out_softc *,
 		uint8_t);
+static int	acpidisp_quirk_get_brightness(const struct acpidisp_out_softc *);
 
 static void	acpidisp_print_odinfo(device_t, const struct acpidisp_odinfo *);
 static void	acpidisp_print_brctl(device_t, const struct acpidisp_brctl *);
@@ -717,6 +724,10 @@ acpidisp_out_attach(device_t parent, dev
 			kmem_free(bc, sizeof(*bc));
 			osc->sc_brctl = NULL;
 		} else {
+			if (acpidisp_quirk_get_brightness(osc)) {
+aprint_error_dev(self,
+"failed to test _BQC quirk\n");
+			}
 			acpidisp_print_brctl(self, osc->sc_brctl);
 		}
 	}
@@ -1860,6 +1871,11 @@ acpidisp_get_brightness(const struct acp
 	if (!(osc->sc_caps & ACPI_DISP_OUT_CAP__BQC))
 		return ENODEV;
 
+	if (osc->sc_brctl->bc_bqc_broken) {
+		*valuep = osc->sc_brctl->bc_current;
+		return 0;
+	}
+
 	rv = acpi_eval_integer(hdl, "_BQC", );
 	if (ACPI_FAILURE(rv)) {
 		aprint_error_dev(osc->sc_dev, "failed to evaluate %s.%s: %s\n",
@@ -1878,6 +1894,60 @@ acpidisp_get_brightness(const struct acp
 	return 0;
 }
 
+/*
+ * Quirk for when getting the brightness value always returns the same
+ * result, which breaks brightness controls which try to lower the
+ * brightness by a specific value and then check if it worked.
+ */
+static int
+acpidisp_quirk_get_brightness(const struct acpidisp_out_softc *osc)
+{
+	struct acpidisp_brctl *bc;
+	uint8_t original_brightness, test_brightness;
+	int error;
+
+	bc = osc->sc_brctl;
+
+	/* Avoid false results if quirk already enabled */
+	bc->bc_bqc_broken = false;
+
+	error = acpidisp_get_brightness(osc, >bc_current);
+	if (error)
+		return error;
+	original_brightness = bc->bc_current;
+
+	/* Find a different brightness value */
+	test_brightness = bc->bc_level[bc->bc_level_count - 1];
+	if (test_brightness == original_brightness)
+		test_brightness = bc->bc_level[0];
+
+	if (test_brightness == original_brightness) {
+		aprint_error_dev(osc->sc_dev,
+		"couldn't find different brightness levels"
+		" for _BQC quirk test\n");
+		return 0;
+	}
+
+	bc->bc_current = test_brightness;
+	error = acpidisp_set_brightness(osc, bc->bc_current);
+	if (error)
+		return error;
+
+	error = acpidisp_get_brightness(osc, >bc_current);
+	if (error)
+		return error;
+
+	/* We set a different value, but got the original value back */
+	if (bc->bc_current == original_brightness) {
+		aprint_normal_dev(osc->sc_dev, "_BQC broken, enabling quirk\n");
+		bc->bc_bqc_broken = true;
+	}
+
+	/* Restore original value */
+	bc->bc_current = original_brightness;
+	return acpidisp_set_brightness(osc, bc->bc_current);
+}
+
 static int
 acpidisp_set_brightness(const struct acpidisp_out_softc *osc, uint8_t value)
 {



CVS commit: src/sys/dev/acpi

2024-05-10 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri May 10 19:29:46 UTC 2024

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

Log Message:
Add quirk for machines were the getting the brightness value always
returns the same result by keeping a local copy of the last set value.

This makes the brightness buttons work on my Thinkpad T450s, and will
probably fix PR kern/57825 as well.


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

2024-05-08 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu May  9 01:33:13 UTC 2024

Modified Files:
src/sys/dev/acpi: sdhc_acpi.c
src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
If the ACPI flag "non-removable" is present and true for an SD/MMC
slot, then set a new flag on that slot to indicate that the media
is non-removable.  Make sdhc_card_detect always return true for a
slot if its non-removable media flag is set.

This change lets the kernel automatically configure the
permanently-installed MMC slot on the NXP LX2160-based HoneyComb
LX2 board.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/sdhc_acpi.c
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sdmmc/sdhcvar.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/acpi/sdhc_acpi.c
diff -u src/sys/dev/acpi/sdhc_acpi.c:1.20 src/sys/dev/acpi/sdhc_acpi.c:1.21
--- src/sys/dev/acpi/sdhc_acpi.c:1.20	Sun Feb  6 15:52:20 2022
+++ src/sys/dev/acpi/sdhc_acpi.c	Thu May  9 01:33:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_acpi.c,v 1.20 2022/02/06 15:52:20 jmcneill Exp $	*/
+/*	$NetBSD: sdhc_acpi.c,v 1.21 2024/05/09 01:33:12 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.20 2022/02/06 15:52:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.21 2024/05/09 01:33:12 dyoung Exp $");
 
 #include 
 #include 
@@ -166,6 +166,7 @@ sdhc_acpi_attach(device_t parent, device
 	ACPI_INTEGER clock_freq;
 	ACPI_INTEGER caps, caps_mask;
 	ACPI_INTEGER funcs;
+	bool non_removable;
 
 	sc->sc.sc_dev = self;
 	sc->sc.sc_dmat = aa->aa_dmat;
@@ -234,6 +235,11 @@ sdhc_acpi_attach(device_t parent, device
 	/* Enable DMA transfer */
 	sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
 
+	rv = acpi_dsd_bool(aa->aa_node->ad_handle, "non-removable",
+	_removable);
+	if (ACPI_SUCCESS(rv) && non_removable)
+		sc->sc.sc_flags |= SDHC_FLAG_NON_REMOVABLE;
+
 	/* Read clock frequency from device properties */
 	rv = acpi_dsd_integer(aa->aa_node->ad_handle, "clock-frequency",
 	_freq);

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.118 src/sys/dev/sdmmc/sdhc.c:1.119
--- src/sys/dev/sdmmc/sdhc.c:1.118	Sat Jan 20 00:22:11 2024
+++ src/sys/dev/sdmmc/sdhc.c	Thu May  9 01:33:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.118 2024/01/20 00:22:11 jmcneill Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.119 2024/05/09 01:33:13 dyoung Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.118 2024/01/20 00:22:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.119 2024/05/09 01:33:13 dyoung Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -897,6 +897,9 @@ sdhc_card_detect(sdmmc_chipset_handle_t 
 	struct sdhc_host *hp = (struct sdhc_host *)sch;
 	int r;
 
+	if (ISSET(hp->sc->sc_flags, SDHC_FLAG_NON_REMOVABLE))
+		return 1;
+
 	if (hp->sc->sc_vendor_card_detect)
 		return (*hp->sc->sc_vendor_card_detect)(hp->sc);
 

Index: src/sys/dev/sdmmc/sdhcvar.h
diff -u src/sys/dev/sdmmc/sdhcvar.h:1.34 src/sys/dev/sdmmc/sdhcvar.h:1.35
--- src/sys/dev/sdmmc/sdhcvar.h:1.34	Sat Jan 20 00:22:11 2024
+++ src/sys/dev/sdmmc/sdhcvar.h	Thu May  9 01:33:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcvar.h,v 1.34 2024/01/20 00:22:11 jmcneill Exp $	*/
+/*	$NetBSD: sdhcvar.h,v 1.35 2024/05/09 01:33:13 dyoung Exp $	*/
 /*	$OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $	*/
 
 /*
@@ -52,6 +52,10 @@ struct sdhc_softc {
 #define	SDHC_FLAG_NO_HS_BIT	0x2000 /* Don't set SDHC_HIGH_SPEED bit */
 #define	SDHC_FLAG_EXTERNAL_DMA	0x4000
 #define	SDHC_FLAG_EXTDMA_DMAEN	0x8000 /* ext. dma need SDHC_DMA_ENABLE */
+#define	SDHC_FLAG_NON_REMOVABLE \
+0x0001 /* slot has no card detect, behave
+	* as if a card is always present
+	*/
 #define	SDHC_FLAG_NO_CLKBASE	0x0002 /* ignore clkbase register */
 #define	SDHC_FLAG_SINGLE_POWER_WRITE 0x0004
 #define	SDHC_FLAG_NO_TIMEOUT	0x0008 /* ignore timeout interrupts */



CVS commit: src/sys/dev

2024-05-08 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu May  9 01:33:13 UTC 2024

Modified Files:
src/sys/dev/acpi: sdhc_acpi.c
src/sys/dev/sdmmc: sdhc.c sdhcvar.h

Log Message:
If the ACPI flag "non-removable" is present and true for an SD/MMC
slot, then set a new flag on that slot to indicate that the media
is non-removable.  Make sdhc_card_detect always return true for a
slot if its non-removable media flag is set.

This change lets the kernel automatically configure the
permanently-installed MMC slot on the NXP LX2160-based HoneyComb
LX2 board.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/acpi/sdhc_acpi.c
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sdmmc/sdhcvar.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/hil

2024-05-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May  6 13:27:50 UTC 2024

Modified Files:
src/sys/dev/hil: hil.c

Log Message:
Fix "stray level 1 interrupt" panic by pressing keys during autoconf(9).

Also explicitly initialize sc->sc_status = HIL_STATUS_BUSY in hil_attach().

Previously hil_intr(9) returned immediately during 'cold', but
all interrupts are enabled at the end of configure() (actually
in MD cpu_configure()) and cold is cleared in confiugre2()
after configure(), so there is a small window when hil interrupts
can be triggered during cold.

It looks there is no problem to process hil_intr() before
hil_attach_deferre() is called via configure2() because
we already check 'sc->sc_status != HIL_STATUS_BUSY' on
processing a kthread.

Note this seems also to appease the similar panic on mame's hp9k370
emulation (though mame's emulation around DMAC looks still incomplete).

Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hil/hil.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/hil/hil.c
diff -u src/sys/dev/hil/hil.c:1.7 src/sys/dev/hil/hil.c:1.8
--- src/sys/dev/hil/hil.c:1.7	Sat Jun 25 02:36:27 2022
+++ src/sys/dev/hil/hil.c	Mon May  6 13:27:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil.c,v 1.7 2022/06/25 02:36:27 tsutsui Exp $	*/
+/*	$NetBSD: hil.c,v 1.8 2024/05/06 13:27:49 tsutsui Exp $	*/
 /*	$OpenBSD: hil.c,v 1.24 2010/11/20 16:45:46 miod Exp $	*/
 /*
  * Copyright (c) 2003, 2004, Miodrag Vallat.
@@ -153,6 +153,7 @@ hil_attach(struct hil_softc *sc, int *hi
 	sc->sc_cmdbp = sc->sc_cmdbuf;
 	sc->sc_pollbp = sc->sc_pollbuf;
 	sc->sc_console = hil_is_console;
+	sc->sc_status = HIL_STATUS_BUSY;
 }
 
 /*
@@ -272,9 +273,6 @@ hil_intr(void *v)
 	struct hil_softc *sc = v;
 	uint8_t c, stat;
 
-	if (cold)
-		return 0;
-
 	stat = bus_space_read_1(sc->sc_bst, sc->sc_bsh, HILP_STAT);
 
 	/*



CVS commit: src/sys/dev/hil

2024-05-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May  6 13:27:50 UTC 2024

Modified Files:
src/sys/dev/hil: hil.c

Log Message:
Fix "stray level 1 interrupt" panic by pressing keys during autoconf(9).

Also explicitly initialize sc->sc_status = HIL_STATUS_BUSY in hil_attach().

Previously hil_intr(9) returned immediately during 'cold', but
all interrupts are enabled at the end of configure() (actually
in MD cpu_configure()) and cold is cleared in confiugre2()
after configure(), so there is a small window when hil interrupts
can be triggered during cold.

It looks there is no problem to process hil_intr() before
hil_attach_deferre() is called via configure2() because
we already check 'sc->sc_status != HIL_STATUS_BUSY' on
processing a kthread.

Note this seems also to appease the similar panic on mame's hp9k370
emulation (though mame's emulation around DMAC looks still incomplete).

Should be pulled up to netbsd-10 and netbsd-9.


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

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:49:16 UTC 2024

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

Log Message:
Use device_printf instead of autoconf messages for errors.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/uhub.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

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:49:16 UTC 2024

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

Log Message:
Use device_printf instead of autoconf messages for errors.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/uhub.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/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.161 src/sys/dev/usb/uhub.c:1.162
--- src/sys/dev/usb/uhub.c:1.161	Wed Apr  6 22:01:45 2022
+++ src/sys/dev/usb/uhub.c	Sat May  4 12:49:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $	*/
+/*	$NetBSD: uhub.c,v 1.162 2024/05/04 12:49:15 mlelstv Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 /*	$OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.162 2024/05/04 12:49:15 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -864,7 +864,7 @@ uhub_explore(struct usbd_device *dev)
 			 * some other serious problem.  Since we cannot leave
 			 * at 0 we have to disable the port instead.
 			 */
-			aprint_error_dev(sc->sc_dev,
+			device_printf(sc->sc_dev,
 			"device problem, disabling port %d\n", port);
 			usbd_clear_port_feature(dev, port, UHF_PORT_ENABLE);
 		} else {



CVS commit: src/sys/dev/usb

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:45:14 UTC 2024

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

Log Message:
Make usb address and hub topology available to drvctl.


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 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.278 src/sys/dev/usb/usb_subr.c:1.279
--- src/sys/dev/usb/usb_subr.c:1.278	Tue Apr 11 08:50:07 2023
+++ src/sys/dev/usb/usb_subr.c	Sat May  4 12:45:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.279 2024/05/04 12:45:13 mlelstv 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.278 2023/04/11 08:50:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.279 2024/05/04 12:45:13 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1083,6 +1083,24 @@ usbd_properties(device_t dv, struct usbd
 	vendor = UGETW(dd->idVendor);
 	product = UGETW(dd->idProduct);
 
+	prop_dictionary_set_uint8(dict, "address", dev->ud_addr);
+
+	if (dev->ud_myhub) {
+		struct usbd_device *hdev = dev->ud_myhub;
+		struct usbd_hub *hub = hdev->ud_hub;
+		int p;
+
+		KASSERT(hub != NULL);
+
+		prop_dictionary_set_uint8(dict, "hub-address", hdev->ud_addr);
+		for (p=1; p <= hub->uh_hubdesc.bNbrPorts; ++p) {
+			if (hub->uh_ports[p-1].up_dev == dev) {
+prop_dictionary_set_uint8(dict, "hub-port", p);
+break;
+			}
+		}
+	}
+
 	prop_dictionary_set_uint8(dict, "class", class);
 	prop_dictionary_set_uint8(dict, "subclass", subclass);
 	prop_dictionary_set_uint16(dict, "release", release);



CVS commit: src/sys/dev/usb

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:45:14 UTC 2024

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

Log Message:
Make usb address and hub topology available to drvctl.


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

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:41:03 UTC 2024

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

Log Message:
Use device_printf instead of autoconf messages for errors.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/dev/usb/usbnet.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/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.119 src/sys/dev/usb/usbnet.c:1.120
--- src/sys/dev/usb/usbnet.c:1.119	Fri Feb  2 22:00:33 2024
+++ src/sys/dev/usb/usbnet.c	Sat May  4 12:41:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.119 2024/02/02 22:00:33 andvar Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.120 2024/05/04 12:41:03 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.119 2024/02/02 22:00:33 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.120 2024/05/04 12:41:03 mlelstv Exp $");
 
 #include 
 #include 
@@ -377,7 +377,7 @@ usbnet_rxeof(struct usbd_xfer *xfer, voi
 	usbd_get_xfer_status(xfer, NULL, NULL, _len, NULL);
 
 	if (total_len > un->un_rx_bufsz) {
-		aprint_error_dev(un->un_dev,
+		device_printf(un->un_dev,
 		"rxeof: too large transfer (%u > %u)\n",
 		total_len, un->un_rx_bufsz);
 		goto done;
@@ -471,7 +471,7 @@ usbnet_pipe_intr(struct usbd_xfer *xfer,
 
 	if (status != USBD_NORMAL_COMPLETION) {
 		if (usbd_ratecheck(>unp_intr_notice)) {
-			aprint_error_dev(un->un_dev, "usb error on intr: %s\n",
+			device_printf(un->un_dev, "usb error on intr: %s\n",
 			usbd_errstr(status));
 		}
 		if (status == USBD_STALLED)



CVS commit: src/sys/dev/usb

2024-05-04 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat May  4 12:41:03 UTC 2024

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

Log Message:
Use device_printf instead of autoconf messages for errors.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/dev/usb/usbnet.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/i2c

2024-04-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Apr 29 21:25:34 UTC 2024

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

Log Message:
ihidev(4): make driver compile with ACPI option disabled.

This change unlikely useful in practice, but adds consistency to already
available guards. Driver won't attach currently without ACPI.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/i2c/ihidev.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/ihidev.c
diff -u src/sys/dev/i2c/ihidev.c:1.29 src/sys/dev/i2c/ihidev.c:1.30
--- src/sys/dev/i2c/ihidev.c:1.29	Tue Aug  1 19:36:45 2023
+++ src/sys/dev/i2c/ihidev.c	Mon Apr 29 21:25:34 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ihidev.c,v 1.29 2023/08/01 19:36:45 riastradh Exp $ */
+/* $NetBSD: ihidev.c,v 1.30 2024/04/29 21:25:34 andvar Exp $ */
 /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */
 
 /*-
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.29 2023/08/01 19:36:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.30 2024/04/29 21:25:34 andvar Exp $");
 
 #include 
 #include 
@@ -116,8 +116,10 @@ static void	ihidev_intr_fini(struct ihid
 static bool	ihidev_suspend(device_t, const pmf_qual_t *);
 static bool	ihidev_resume(device_t, const pmf_qual_t *);
 static int	ihidev_hid_command(struct ihidev_softc *, int, void *, bool);
+#if NACPICA > 0
 static int	ihidev_intr(void *);
 static void	ihidev_work(struct work *, void *);
+#endif
 static int	ihidev_reset(struct ihidev_softc *, bool);
 static int	ihidev_hid_desc_parse(struct ihidev_softc *);
 
@@ -730,14 +732,13 @@ ihidev_intr_fini(struct ihidev_softc *sc
 #endif
 }
 
+#if NACPICA > 0
 static void
 ihidev_intr_mask(struct ihidev_softc * const sc)
 {
 
 	if (sc->sc_intr_type == IST_LEVEL) {
-#if NACPICA > 0
 		acpi_intr_mask(sc->sc_ih);
-#endif
 	}
 }
 
@@ -746,9 +747,7 @@ ihidev_intr_unmask(struct ihidev_softc *
 {
 
 	if (sc->sc_intr_type == IST_LEVEL) {
-#if NACPICA > 0
 		acpi_intr_unmask(sc->sc_ih);
-#endif
 	}
 }
 
@@ -832,6 +831,7 @@ ihidev_work(struct work *wk, void *arg)
 	 */
 	ihidev_intr_unmask(sc);
 }
+#endif
 
 static int
 ihidev_maxrepid(void *buf, int len)
@@ -1009,6 +1009,7 @@ ihidev_set_report(struct device *dev, in
 static bool
 ihidev_acpi_get_info(struct ihidev_softc *sc)
 {
+#if NACPICA > 0
 	ACPI_HANDLE hdl = (void *)(uintptr_t)sc->sc_phandle;
 	ACPI_STATUS status;
 	ACPI_INTEGER val;
@@ -1033,4 +1034,7 @@ ihidev_acpi_get_info(struct ihidev_softc
 	sc->sc_hid_desc_addr = (u_int)val;
 
 	return true;
+#else
+	return false;
+#endif
 }



CVS commit: src/sys/dev/i2c

2024-04-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Apr 29 21:25:34 UTC 2024

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

Log Message:
ihidev(4): make driver compile with ACPI option disabled.

This change unlikely useful in practice, but adds consistency to already
available guards. Driver won't attach currently without ACPI.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/i2c/ihidev.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/acpi

2024-04-28 Thread Taylor R Campbell
> Module Name:src
> Committed By:   christos
> Date:   Fri Apr 26 18:19:18 UTC 2024
> 
> Modified Files:
> src/sys/dev/acpi: acpi_bat.c
> 
> Log Message:
> PR/58201: Malte Dehling: re-order sysmon initialization before acpi
> registration, to avoid needing to call to acpi_deregister_notify on sysmon
> failure.

This isn't really a bug: the detach function calls
acpi_deregister_notify.  Now, with this change, it will call
acpi_deregister_notify even if acpi_register_notify was never called.

Fortunately, that's mostly harmless in the current implementation --
just as it was harmless to leave the notifier there; it doesn't use
any memory that would be leaked.

(Really, if there's any bug here, it's that sysmon_envsys_register can
fail at all.  This creates vast swaths of never-tested error branches
that waste maintainer and auditor time.)


CVS commit: src/sys/dev/usb

2024-04-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 28 08:55:03 UTC 2024

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

Log Message:
Fix some usb_syncmem calls and add some missing ones.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.327 src/sys/dev/usb/ohci.c:1.328
--- src/sys/dev/usb/ohci.c:1.327	Sun Apr 28 07:52:52 2024
+++ src/sys/dev/usb/ohci.c	Sun Apr 28 08:55:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.328 2024/04/28 08:55:03 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.328 2024/04/28 08:55:03 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -844,6 +844,9 @@ ohci_init(ohci_softc_t *sc)
 		goto bad1;
 	}
 	sc->sc_ctrl_head->ed.ed_flags |= HTOO32(OHCI_ED_SKIP);
+	usb_syncmem(>sc_ctrl_head->dma, sc->sc_ctrl_head->offs,
+	sizeof(sc->sc_ctrl_head->ed),
+	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
 	/* Allocate dummy ED that starts the bulk list. */
 	sc->sc_bulk_head = ohci_alloc_sed(sc);
@@ -1609,6 +1612,10 @@ ohci_softintr(void *v)
 			for (i = 0, sitd = xfer->ux_hcpriv;;
 			sitd = next) {
 next = sitd->nextitd;
+
+usb_syncmem(>dma, sitd->offs, sizeof(sitd->itd),
+BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
+
 if (OHCI_ITD_GET_CC(O32TOH(sitd->
 itd.itd_flags)) != OHCI_CC_NO_ERROR)
 	xfer->ux_status = USBD_IOERROR;
@@ -2259,8 +2266,7 @@ ohci_abortx(struct usbd_xfer *xfer)
 	 * waiting for the next start of frame (OHCI_SF)
 	 */
 	DPRINTFN(1, "stop ed=%#jx", (uintptr_t)sed, 0, 0, 0);
-	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_flags),
-	sizeof(sed->ed.ed_flags),
+	usb_syncmem(>dma, sed->offs, sizeof(sed->ed),
 	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	if (!(sed->ed.ed_flags & OHCI_HALTED)) {
 		/* force hardware skip */
@@ -2337,6 +2343,9 @@ ohci_abortx(struct usbd_xfer *xfer)
 		hit |= headp == p->physaddr;
 		n = p->nexttd;
 
+		usb_syncmem(>dma, p->offs + offsetof(ohci_td_t, td_flags),
+		sizeof(p->td.td_flags),
+		BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 		int cc = OHCI_TD_GET_CC(O32TOH(p->td.td_flags));
 		if (!OHCI_CC_ACCESSED_P(cc)) {
 			ohci_hash_rem_td(sc, p);
@@ -2951,8 +2960,17 @@ ohci_device_clear_toggle(struct usbd_pip
 {
 	struct ohci_pipe *opipe = OHCI_PIPE2OPIPE(pipe);
 	ohci_softc_t *sc = OHCI_PIPE2SC(pipe);
+	ohci_soft_ed_t *sed = opipe->sed;
+
+	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_headp),
+	sizeof(sed->ed.ed_headp),
+	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 
 	opipe->sed->ed.ed_headp &= HTOO32(~OHCI_TOGGLECARRY);
+
+	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_headp),
+	sizeof(sed->ed.ed_headp),
+	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 }
 
 Static void
@@ -3403,17 +3421,21 @@ ohci_device_setintr(ohci_softc_t *sc, st
 	mutex_enter(>sc_lock);
 	hsed = sc->sc_eds[best];
 	sed->next = hsed->next;
-	usb_syncmem(>dma, hsed->offs + offsetof(ohci_ed_t, ed_flags),
-	sizeof(hsed->ed.ed_flags),
+	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_nexted),
+	sizeof(sed->ed.ed_nexted),
 	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	sed->ed.ed_nexted = hsed->ed.ed_nexted;
-	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_flags),
-	sizeof(sed->ed.ed_flags),
+	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_nexted),
+	sizeof(sed->ed.ed_nexted),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
+
 	hsed->next = sed;
+	usb_syncmem(>dma, hsed->offs + offsetof(ohci_ed_t, ed_nexted),
+	sizeof(hsed->ed.ed_nexted),
+	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	hsed->ed.ed_nexted = HTOO32(sed->physaddr);
-	usb_syncmem(>dma, hsed->offs + offsetof(ohci_ed_t, ed_flags),
-	sizeof(hsed->ed.ed_flags),
+	usb_syncmem(>dma, hsed->offs + offsetof(ohci_ed_t, ed_nexted),
+	sizeof(hsed->ed.ed_nexted),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 	mutex_exit(>sc_lock);
 
@@ -3685,8 +3707,7 @@ ohci_device_isoc_enter(struct usbd_xfer 
 	BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
 	sed->ed.ed_tailp = HTOO32(tail->physaddr);
 	sed->ed.ed_flags &= HTOO32(~OHCI_ED_SKIP);
-	usb_syncmem(>dma, sed->offs + offsetof(ohci_ed_t, ed_flags),
-	sizeof(sed->ed.ed_flags),
+	usb_syncmem(>dma, sed->offs, sizeof(sed->ed),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 }
 



CVS commit: src/sys/dev/usb

2024-04-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 28 08:55:03 UTC 2024

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

Log Message:
Fix some usb_syncmem calls and add some missing ones.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/sys/dev/usb/ohci.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

2024-04-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 28 07:52:52 UTC 2024

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

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.326 src/sys/dev/usb/ohci.c:1.327
--- src/sys/dev/usb/ohci.c:1.326	Fri Apr  5 18:57:10 2024
+++ src/sys/dev/usb/ohci.c	Sun Apr 28 07:52:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.326 2024/04/05 18:57:10 riastradh Exp $	*/
+/*	$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.326 2024/04/05 18:57:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -826,8 +826,8 @@ ohci_init(ohci_softc_t *sc)
 
 	/* XXX determine alignment by R/W */
 	/* Allocate the HCCA area. */
-	err = usb_allocmem(sc->sc_bus.ub_dmatag, OHCI_HCCA_SIZE,	OHCI_HCCA_ALIGN,
-	USBMALLOC_COHERENT, >sc_hccadma);
+	err = usb_allocmem(sc->sc_bus.ub_dmatag, OHCI_HCCA_SIZE,
+	OHCI_HCCA_ALIGN, USBMALLOC_COHERENT, >sc_hccadma);
 	if (err) {
 		sc->sc_hcca = NULL;
 		return err;



CVS commit: src/sys/dev/usb

2024-04-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 28 07:52:52 UTC 2024

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

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/sys/dev/usb/ohci.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/acpi

2024-04-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 14:50:18 UTC 2024

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

Log Message:
Expose a sysctl interface hw.acpi.thinkpad.bat[]. to control
some aspects of battery charging behavior on supported systems:

charge_start
threshold below which to start charging (in %, 0-99)

charge_stop
threshold above which to stop charging (in %, 1-100)

force_discharge
discharge while on AC power, e.g., for calibration

charge_inhibit
inhibit charging while on AC power

>From Malte Dehling


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/acpi/thinkpad_acpi.c

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

Modified files:

Index: src/sys/dev/acpi/thinkpad_acpi.c
diff -u src/sys/dev/acpi/thinkpad_acpi.c:1.56 src/sys/dev/acpi/thinkpad_acpi.c:1.57
--- src/sys/dev/acpi/thinkpad_acpi.c:1.56	Sat Apr 27 10:45:11 2024
+++ src/sys/dev/acpi/thinkpad_acpi.c	Sat Apr 27 10:50:18 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.56 2024/04/27 14:45:11 christos Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.57 2024/04/27 14:50:18 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,13 +27,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.56 2024/04/27 14:45:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.57 2024/04/27 14:50:18 christos Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -49,10 +50,27 @@ ACPI_MODULE_NAME		("thinkpad_acpi")
 #define	THINKPAD_NFANSENSORS	1
 #define	THINKPAD_NSENSORS	(THINKPAD_NTEMPSENSORS + THINKPAD_NFANSENSORS)
 
+typedef struct tp_sysctl_param {
+	device_t		sp_dev;
+	int			sp_bat;
+} tp_sysctl_param_t;
+
+typedef union tp_batctl {
+	int			have_any;
+	struct {
+	int			charge_start:1;
+	int			charge_stop:1;
+	int			charge_inhibit:1;
+	int			force_discharge:1;
+	int			individual_control:1;
+	}			have;
+} tp_batctl_t;
+
 typedef struct thinkpad_softc {
 	device_t		sc_dev;
 	device_t		sc_ecdev;
 	struct acpi_devnode	*sc_node;
+	struct sysctllog	*sc_log;
 	ACPI_HANDLE		sc_powhdl;
 	ACPI_HANDLE		sc_cmoshdl;
 	ACPI_INTEGER		sc_ver;
@@ -90,6 +108,14 @@ typedef struct thinkpad_softc {
 	envsys_data_t		sc_sensor[THINKPAD_NSENSORS];
 
 	int			sc_display_state;
+
+#define THINKPAD_BAT_ANY	0
+#define THINKPAD_BAT_PRIMARY	1
+#define THINKPAD_BAT_SECONDARY	2
+#define THINKPAD_BAT_LAST	3
+
+	tp_batctl_t		sc_batctl;
+	tp_sysctl_param_t	sc_scparam[THINKPAD_BAT_LAST];
 } thinkpad_softc_t;
 
 /* Hotkey events */
@@ -130,6 +156,17 @@ typedef struct thinkpad_softc {
 #define	THINKPAD_DISPLAY_ALL \
 	(THINKPAD_DISPLAY_LCD | THINKPAD_DISPLAY_CRT | THINKPAD_DISPLAY_DVI)
 
+#define THINKPAD_GET_CHARGE_START	"BCTG"
+#define THINKPAD_SET_CHARGE_START	"BCCS"
+#define THINKPAD_GET_CHARGE_STOP	"BCSG"
+#define THINKPAD_SET_CHARGE_STOP	"BCSS"
+#define THINKPAD_GET_FORCE_DISCHARGE	"BDSG"
+#define THINKPAD_SET_FORCE_DISCHARGE	"BDSS"
+#define THINKPAD_GET_CHARGE_INHIBIT	"BICG"
+#define THINKPAD_SET_CHARGE_INHIBIT	"BICS"
+
+#define THINKPAD_CALL_ERROR		0x8000
+
 #define THINKPAD_BLUETOOTH_HWPRESENT	0x01
 #define THINKPAD_BLUETOOTH_RADIOSSW	0x02
 #define THINKPAD_BLUETOOTH_RESUMECTRL	0x04
@@ -168,6 +205,9 @@ static void	thinkpad_brightness_down(dev
 static uint8_t	thinkpad_brightness_read(thinkpad_softc_t *);
 static void	thinkpad_cmos(thinkpad_softc_t *, uint8_t);
 
+static void	thinkpad_battery_probe_support(device_t);
+static void	thinkpad_battery_sysctl_setup(device_t);
+
 CFATTACH_DECL3_NEW(thinkpad, sizeof(thinkpad_softc_t),
 thinkpad_match, thinkpad_attach, thinkpad_detach, NULL, NULL, NULL,
 0);
@@ -220,6 +260,7 @@ thinkpad_attach(device_t parent, device_
 	int i;
 
 	sc->sc_dev = self;
+	sc->sc_log = NULL;
 	sc->sc_powhdl = NULL;
 	sc->sc_cmoshdl = NULL;
 	sc->sc_node = aa->aa_node;
@@ -371,6 +412,17 @@ thinkpad_attach(device_t parent, device_
 	/* Register temperature and fan sensors with envsys */
 	thinkpad_sensors_init(sc);
 
+	/* Probe supported battery charge/control operations */
+	thinkpad_battery_probe_support(self);
+
+	if (sc->sc_batctl.have_any) {
+		for (i = 0; i < THINKPAD_BAT_LAST; i++) {
+			sc->sc_scparam[i].sp_dev = self;
+			sc->sc_scparam[i].sp_bat = i;
+		}
+		thinkpad_battery_sysctl_setup(self);
+	}
+
 fail:
 	if (!pmf_device_register(self, NULL, thinkpad_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
@@ -396,6 +448,9 @@ thinkpad_detach(device_t self, int flags
 	if (sc->sc_sme != NULL)
 		sysmon_envsys_unregister(sc->sc_sme);
 
+	if (sc->sc_log != NULL)
+		sysctl_teardown(>sc_log);
+
 	pmf_device_deregister(self);
 
 	pmf_event_deregister(self, PMFE_DISPLAY_BRIGHTNESS_UP,
@@ -948,6 +1003,290 @@ thinkpad_cmos(thinkpad_softc_t *sc, uint
 		AcpiFormatException(rv));
 }
 
+static uint32_t
+thinkpad_call_method(device_t 

CVS commit: src/sys/dev/acpi

2024-04-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 14:50:18 UTC 2024

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

Log Message:
Expose a sysctl interface hw.acpi.thinkpad.bat[]. to control
some aspects of battery charging behavior on supported systems:

charge_start
threshold below which to start charging (in %, 0-99)

charge_stop
threshold above which to stop charging (in %, 1-100)

force_discharge
discharge while on AC power, e.g., for calibration

charge_inhibit
inhibit charging while on AC power

>From Malte Dehling


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/acpi/thinkpad_acpi.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/acpi

2024-04-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 14:45:11 UTC 2024

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

Log Message:
thinkpad cosmetic patches (Malte Dehling)


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/acpi/thinkpad_acpi.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/acpi

2024-04-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 14:45:11 UTC 2024

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

Log Message:
thinkpad cosmetic patches (Malte Dehling)


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/acpi/thinkpad_acpi.c

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

Modified files:

Index: src/sys/dev/acpi/thinkpad_acpi.c
diff -u src/sys/dev/acpi/thinkpad_acpi.c:1.55 src/sys/dev/acpi/thinkpad_acpi.c:1.56
--- src/sys/dev/acpi/thinkpad_acpi.c:1.55	Fri Aug 12 12:21:41 2022
+++ src/sys/dev/acpi/thinkpad_acpi.c	Sat Apr 27 10:45:11 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.55 2022/08/12 16:21:41 riastradh Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.56 2024/04/27 14:45:11 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.55 2022/08/12 16:21:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.56 2024/04/27 14:45:11 christos Exp $");
 
 #include 
 #include 
@@ -138,8 +138,8 @@ typedef struct thinkpad_softc {
 #define THINKPAD_WWAN_RADIOSSW		0x02
 #define THINKPAD_WWAN_RESUMECTRL	0x04
 
-#define THINKPAD_UWB_HWPRESENT	0x01
-#define THINKPAD_UWB_RADIOSSW	0x02
+#define THINKPAD_UWB_HWPRESENT		0x01
+#define THINKPAD_UWB_RADIOSSW		0x02
 
 #define THINKPAD_RFK_BLUETOOTH		0
 #define THINKPAD_RFK_WWAN		1
@@ -165,7 +165,7 @@ static void	thinkpad_bluetooth_toggle(th
 static bool	thinkpad_resume(device_t, const pmf_qual_t *);
 static void	thinkpad_brightness_up(device_t);
 static void	thinkpad_brightness_down(device_t);
-static uint8_t	thinkpad_brightness_read(thinkpad_softc_t *sc);
+static uint8_t	thinkpad_brightness_read(thinkpad_softc_t *);
 static void	thinkpad_cmos(thinkpad_softc_t *, uint8_t);
 
 CFATTACH_DECL3_NEW(thinkpad, sizeof(thinkpad_softc_t),
@@ -230,7 +230,7 @@ thinkpad_attach(device_t parent, device_
 
 	sc->sc_ecdev = NULL;
 	for (curdev = deviter_first(, DEVITER_F_ROOT_FIRST);
-	 curdev != NULL; curdev = deviter_next())
+	curdev != NULL; curdev = deviter_next())
 		if (device_is_a(curdev, "acpiecdt") ||
 		device_is_a(curdev, "acpiec")) {
 			sc->sc_ecdev = curdev;
@@ -330,29 +330,30 @@ thinkpad_attach(device_t parent, device_
 #endif
 	for (i = TP_PSW_DISPLAY_CYCLE; i < TP_PSW_LAST; i++)
 		sc->sc_smpsw[i].smpsw_type = PSWITCH_TYPE_HOTKEY;
-	psw[TP_PSW_DISPLAY_CYCLE].smpsw_name = PSWITCH_HK_DISPLAY_CYCLE;
-	psw[TP_PSW_LOCK_SCREEN].smpsw_name = PSWITCH_HK_LOCK_SCREEN;
-	psw[TP_PSW_BATTERY_INFO].smpsw_name = PSWITCH_HK_BATTERY_INFO;
-	psw[TP_PSW_EJECT_BUTTON].smpsw_name = PSWITCH_HK_EJECT_BUTTON;
-	psw[TP_PSW_ZOOM_BUTTON].smpsw_name = PSWITCH_HK_ZOOM_BUTTON;
-	psw[TP_PSW_VENDOR_BUTTON].smpsw_name = PSWITCH_HK_VENDOR_BUTTON;
+
+	psw[TP_PSW_DISPLAY_CYCLE].smpsw_name	= PSWITCH_HK_DISPLAY_CYCLE;
+	psw[TP_PSW_LOCK_SCREEN].smpsw_name	= PSWITCH_HK_LOCK_SCREEN;
+	psw[TP_PSW_BATTERY_INFO].smpsw_name	= PSWITCH_HK_BATTERY_INFO;
+	psw[TP_PSW_EJECT_BUTTON].smpsw_name	= PSWITCH_HK_EJECT_BUTTON;
+	psw[TP_PSW_ZOOM_BUTTON].smpsw_name	= PSWITCH_HK_ZOOM_BUTTON;
+	psw[TP_PSW_VENDOR_BUTTON].smpsw_name	= PSWITCH_HK_VENDOR_BUTTON;
 #ifndef THINKPAD_NORMAL_HOTKEYS
-	psw[TP_PSW_FNF1_BUTTON].smpsw_name = PSWITCH_HK_FNF1_BUTTON;
-	psw[TP_PSW_WIRELESS_BUTTON].smpsw_name = PSWITCH_HK_WIRELESS_BUTTON;
-	psw[TP_PSW_WWAN_BUTTON].smpsw_name = PSWITCH_HK_WWAN_BUTTON;
-	psw[TP_PSW_POINTER_BUTTON].smpsw_name  = PSWITCH_HK_POINTER_BUTTON;
-	psw[TP_PSW_FNF10_BUTTON].smpsw_name= PSWITCH_HK_FNF10_BUTTON;
-	psw[TP_PSW_FNF11_BUTTON].smpsw_name= PSWITCH_HK_FNF11_BUTTON;
-	psw[TP_PSW_BRIGHTNESS_UP].smpsw_name   = PSWITCH_HK_BRIGHTNESS_UP;
-	psw[TP_PSW_BRIGHTNESS_DOWN].smpsw_name = PSWITCH_HK_BRIGHTNESS_DOWN;
-	psw[TP_PSW_THINKLIGHT].smpsw_name  = PSWITCH_HK_THINKLIGHT;
-	psw[TP_PSW_VOLUME_UP].smpsw_name   = PSWITCH_HK_VOLUME_UP;
-	psw[TP_PSW_VOLUME_DOWN].smpsw_name = PSWITCH_HK_VOLUME_DOWN;
-	psw[TP_PSW_VOLUME_MUTE].smpsw_name = PSWITCH_HK_VOLUME_MUTE;
-	psw[TP_PSW_STAR_BUTTON].smpsw_name = PSWITCH_HK_STAR_BUTTON;
-	psw[TP_PSW_SCISSORS_BUTTON].smpsw_name = PSWITCH_HK_SCISSORS_BUTTON;
-	psw[TP_PSW_BLUETOOTH_BUTTON].smpsw_name = PSWITCH_HK_BLUETOOTH_BUTTON;
-	psw[TP_PSW_KEYBOARD_BUTTON].smpsw_name = PSWITCH_HK_KEYBOARD_BUTTON;
+	psw[TP_PSW_FNF1_BUTTON].smpsw_name	= PSWITCH_HK_FNF1_BUTTON;
+	psw[TP_PSW_WIRELESS_BUTTON].smpsw_name	= PSWITCH_HK_WIRELESS_BUTTON;
+	psw[TP_PSW_WWAN_BUTTON].smpsw_name	= PSWITCH_HK_WWAN_BUTTON;
+	psw[TP_PSW_POINTER_BUTTON].smpsw_name	= PSWITCH_HK_POINTER_BUTTON;
+	psw[TP_PSW_FNF10_BUTTON].smpsw_name	= PSWITCH_HK_FNF10_BUTTON;
+	psw[TP_PSW_FNF11_BUTTON].smpsw_name	= PSWITCH_HK_FNF11_BUTTON;
+	psw[TP_PSW_BRIGHTNESS_UP].smpsw_name	= PSWITCH_HK_BRIGHTNESS_UP;
+	psw[TP_PSW_BRIGHTNESS_DOWN].smpsw_name	= PSWITCH_HK_BRIGHTNESS_DOWN;
+	psw[TP_PSW_THINKLIGHT].smpsw_name	= PSWITCH_HK_THINKLIGHT;
+	

CVS commit: src/sys/dev/acpi

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 00:40:07 UTC 2024

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

Log Message:
Remove 0 initializations (since the softc is zalloc'ed) and the initial
refresh which will have no data.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/acpi/acpi_bat.c

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

Modified files:

Index: src/sys/dev/acpi/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.122 src/sys/dev/acpi/acpi_bat.c:1.123
--- src/sys/dev/acpi/acpi_bat.c:1.122	Fri Apr 26 14:19:18 2024
+++ src/sys/dev/acpi/acpi_bat.c	Fri Apr 26 20:40:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_bat.c,v 1.122 2024/04/26 18:19:18 christos Exp $	*/
+/*	$NetBSD: acpi_bat.c,v 1.123 2024/04/27 00:40:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.122 2024/04/26 18:19:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.123 2024/04/27 00:40:06 christos Exp $");
 
 #include 
 #include 
@@ -229,14 +229,6 @@ acpibat_attach(device_t parent, device_t
 
 	sc->sc_node = aa->aa_node;
 
-	sc->sc_present = 0;
-	sc->sc_dvoltage = 0;
-	sc->sc_dcapacity = 0;
-	sc->sc_lcapacity = 0;
-	sc->sc_wcapacity = 0;
-
-	sc->sc_sme = NULL;
-
 	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(>sc_condvar, device_xname(self));
 
@@ -759,7 +751,7 @@ acpibat_init_envsys(device_t dv)
 	sc->sc_sme->sme_cookie = dv;
 	sc->sc_sme->sme_refresh = acpibat_refresh;
 	sc->sc_sme->sme_class = SME_CLASS_BATTERY;
-	sc->sc_sme->sme_flags = SME_POLL_ONLY | SME_INIT_REFRESH;
+	sc->sc_sme->sme_flags = SME_POLL_ONLY;
 	sc->sc_sme->sme_get_limits = acpibat_get_limits;
 
 	if (sysmon_envsys_register(sc->sc_sme))



CVS commit: src/sys/dev/acpi

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 27 00:40:07 UTC 2024

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

Log Message:
Remove 0 initializations (since the softc is zalloc'ed) and the initial
refresh which will have no data.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/acpi/acpi_bat.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/acpi

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:19:18 UTC 2024

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

Log Message:
PR/58201: Malte Dehling: re-order sysmon initialization before acpi
registration, to avoid needing to call to acpi_deregister_notify on sysmon
failure.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/acpi/acpi_bat.c

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

Modified files:

Index: src/sys/dev/acpi/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.121 src/sys/dev/acpi/acpi_bat.c:1.122
--- src/sys/dev/acpi/acpi_bat.c:1.121	Thu Jan  6 20:10:57 2022
+++ src/sys/dev/acpi/acpi_bat.c	Fri Apr 26 14:19:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_bat.c,v 1.121 2022/01/07 01:10:57 riastradh Exp $	*/
+/*	$NetBSD: acpi_bat.c,v 1.122 2024/04/26 18:19:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.121 2022/01/07 01:10:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.122 2024/04/26 18:19:18 christos Exp $");
 
 #include 
 #include 
@@ -762,17 +762,16 @@ acpibat_init_envsys(device_t dv)
 	sc->sc_sme->sme_flags = SME_POLL_ONLY | SME_INIT_REFRESH;
 	sc->sc_sme->sme_get_limits = acpibat_get_limits;
 
+	if (sysmon_envsys_register(sc->sc_sme))
+		goto fail;
+
 	(void)acpi_register_notify(sc->sc_node, acpibat_notify_handler);
 	acpibat_update_info(dv);
 	acpibat_update_status(dv);
 
-	if (sysmon_envsys_register(sc->sc_sme))
-		goto fail;
-
 	(void)pmf_device_register(dv, NULL, acpibat_resume);
 
 	return;
-
 fail:
 	aprint_error_dev(dv, "failed to initialize sysmon\n");
 



CVS commit: src/sys/dev/acpi

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 18:19:18 UTC 2024

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

Log Message:
PR/58201: Malte Dehling: re-order sysmon initialization before acpi
registration, to avoid needing to call to acpi_deregister_notify on sysmon
failure.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/acpi/acpi_bat.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

2024-04-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Apr 25 01:33:04 UTC 2024

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

Log Message:
Add a match quirk to prevent matching any interface on SiPEED FPGA
development boards (e.g. Tang Nano 9K).  The FT2232s on these boards
are wired up only for JTAG.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/uftdi.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/uftdi.c
diff -u src/sys/dev/usb/uftdi.c:1.78 src/sys/dev/usb/uftdi.c:1.79
--- src/sys/dev/usb/uftdi.c:1.78	Wed Apr 17 02:34:45 2024
+++ src/sys/dev/usb/uftdi.c	Thu Apr 25 01:33:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $	*/
+/*	$NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -229,7 +229,19 @@ static const struct uftdi_match_quirk_en
 	  .vendor_str	= "SecuringHardware.com",
 	  .product_str	= "Tigard V1.1",
 	  .match_ret	= UMATCH_NONE,
-	}
+	},
+	/*
+	 * The SiPEED Tang Nano 9K (and other SiPEED Tang FPGA development
+	 * boards) have an FT2232 on-board, wired up only for JTAG.
+	 */
+	{
+	  .vendor_id	= USB_VENDOR_FTDI,
+	  .product_id	= USB_PRODUCT_FTDI_SERIAL_2232C,
+	  .iface_no	= -1,
+	  .vendor_str	= "SIPEED",
+	  .product_str	= "JTAG Debugger",
+	  .match_ret	= UMATCH_NONE,
+	},
 };
 
 static int
@@ -243,7 +255,7 @@ uftdi_quirk_match(struct usbif_attach_ar
 		q = _match_quirks[i];
 		if (uiaa->uiaa_vendor != q->vendor_id ||
 		uiaa->uiaa_product != q->product_id ||
-		uiaa->uiaa_ifaceno != q->iface_no) {
+		(q->iface_no != -1 && uiaa->uiaa_ifaceno != q->iface_no)) {
 			continue;
 		}
 		if (q->vendor_str != NULL &&



CVS commit: src/sys/dev/usb

2024-04-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Apr 25 01:33:04 UTC 2024

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

Log Message:
Add a match quirk to prevent matching any interface on SiPEED FPGA
development boards (e.g. Tang Nano 9K).  The FT2232s on these boards
are wired up only for JTAG.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/uftdi.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/goldfish

2024-04-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 14:41:13 UTC 2024

Modified Files:
src/sys/dev/goldfish: gfpic.c

Log Message:
Remove a superflouous printf().


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/goldfish/gfpic.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/goldfish/gfpic.c
diff -u src/sys/dev/goldfish/gfpic.c:1.1 src/sys/dev/goldfish/gfpic.c:1.2
--- src/sys/dev/goldfish/gfpic.c:1.1	Tue Jan  2 07:27:51 2024
+++ src/sys/dev/goldfish/gfpic.c	Wed Apr 24 14:41:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gfpic.c,v 1.1 2024/01/02 07:27:51 thorpej Exp $	*/
+/*	$NetBSD: gfpic.c,v 1.2 2024/04/24 14:41:13 thorpej Exp $	*/
 
 /*- 
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gfpic.c,v 1.1 2024/01/02 07:27:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gfpic.c,v 1.2 2024/04/24 14:41:13 thorpej Exp $");
 
 #include 
 #include 
@@ -79,8 +79,6 @@ gfpic_enable(struct gfpic_softc *sc, int
 	KASSERT(pirq >= 0);
 	KASSERT(pirq <= 31);
 
-	device_printf(sc->sc_dev, "enabling IRQ %d (0x%08x)\n",
-	pirq, (1U << pirq));
 	REG_WRITE(sc, GFPIC_ENABLE, (1U << pirq));
 }
 



CVS commit: src/sys/dev/goldfish

2024-04-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 14:41:13 UTC 2024

Modified Files:
src/sys/dev/goldfish: gfpic.c

Log Message:
Remove a superflouous printf().


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

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



CVS commit: src/sys/dev/pci

2024-04-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 02:31:26 UTC 2024

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

Log Message:
b3_2706_map_vme(): Use VM_BESTFIT.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/btvmeii.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/btvmeii.c
diff -u src/sys/dev/pci/btvmeii.c:1.27 src/sys/dev/pci/btvmeii.c:1.28
--- src/sys/dev/pci/btvmeii.c:1.27	Tue Dec  5 15:58:32 2023
+++ src/sys/dev/pci/btvmeii.c	Wed Apr 24 02:31:26 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: btvmeii.c,v 1.27 2023/12/05 15:58:32 thorpej Exp $ */
+/* $NetBSD: btvmeii.c,v 1.28 2024/04/24 02:31:26 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btvmeii.c,v 1.27 2023/12/05 15:58:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btvmeii.c,v 1.28 2024/04/24 02:31:26 thorpej Exp $");
 
 #include 
 #include 
@@ -328,7 +328,7 @@ b3_2706_map_vme(void *vsc, vme_addr_t vm
 			0,			/* boundary */
 			VMEM_ADDR_MIN,		/* minaddr */
 			VMEM_ADDR_MAX,		/* maxaddr */
-			VM_NOSLEEP,
+			VM_BESTFIT | VM_NOSLEEP,
 			)) {
 		sc->windowused[wnd] = 0;
 		return (ENOMEM);



CVS commit: src/sys/dev/pci

2024-04-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 02:31:26 UTC 2024

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

Log Message:
b3_2706_map_vme(): Use VM_BESTFIT.


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

2024-04-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 02:27:33 UTC 2024

Modified Files:
src/sys/dev/vme: vme.c

Log Message:
_vme_space_get(): Use VM_BESTFIT.


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

2024-04-23 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Apr 24 02:27:33 UTC 2024

Modified Files:
src/sys/dev/vme: vme.c

Log Message:
_vme_space_get(): Use VM_BESTFIT.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/vme/vme.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/vme/vme.c
diff -u src/sys/dev/vme/vme.c:1.30 src/sys/dev/vme/vme.c:1.31
--- src/sys/dev/vme/vme.c:1.30	Mon Dec  4 01:49:29 2023
+++ src/sys/dev/vme/vme.c	Wed Apr 24 02:27:33 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vme.c,v 1.30 2023/12/04 01:49:29 thorpej Exp $ */
+/* $NetBSD: vme.c,v 1.31 2024/04/24 02:27:33 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.30 2023/12/04 01:49:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.31 2024/04/24 02:27:33 thorpej Exp $");
 
 #include 
 #include 
@@ -336,7 +336,7 @@ _vme_space_get(struct vmebus_softc *sc, 
 			  0,			/* nocross */
 			  VMEM_ADDR_MIN,	/* minaddr */
 			  VMEM_ADDR_MAX,	/* maxaddr */
-			  VM_NOSLEEP,
+			  VM_BESTFIT | VM_NOSLEEP,
 			  );
 	if (!res)
 		*addr = help;



CVS commit: src/sys/dev/pci

2024-04-23 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Tue Apr 23 15:34:07 UTC 2024

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

Log Message:
Sync the statistics DMA memory correctly before it is accessed.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/pci/if_bnx.c

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

Modified files:

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.113 src/sys/dev/pci/if_bnx.c:1.114
--- src/sys/dev/pci/if_bnx.c:1.113	Fri Feb  9 22:08:35 2024
+++ src/sys/dev/pci/if_bnx.c	Tue Apr 23 15:34:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.113 2024/02/09 22:08:35 andvar Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.114 2024/04/23 15:34:07 hans Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.113 2024/02/09 22:08:35 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.114 2024/04/23 15:34:07 hans Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -5667,7 +5667,7 @@ bnx_stats_update(struct bnx_softc *sc)
 	struct statistics_block	*stats;
 
 	DBPRINT(sc, BNX_EXCESSIVE, "Entering %s()\n", __func__);
-	bus_dmamap_sync(sc->bnx_dmatag, sc->status_map, 0, BNX_STATUS_BLK_SZ,
+	bus_dmamap_sync(sc->bnx_dmatag, sc->stats_map, 0, BNX_STATS_BLK_SZ,
 	BUS_DMASYNC_POSTREAD);
 
 	stats = (struct statistics_block *)sc->stats_block;
@@ -6257,7 +6257,7 @@ void
 bnx_dump_stats_block(struct bnx_softc *sc)
 {
 	struct statistics_block	*sblk;
-	bus_dmamap_sync(sc->bnx_dmatag, sc->status_map, 0, BNX_STATUS_BLK_SZ,
+	bus_dmamap_sync(sc->bnx_dmatag, sc->stats_map, 0, BNX_STATS_BLK_SZ,
 	BUS_DMASYNC_POSTREAD);
 
 	sblk = sc->stats_block;



CVS commit: src/sys/dev/pci

2024-04-23 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Tue Apr 23 15:34:07 UTC 2024

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

Log Message:
Sync the statistics DMA memory correctly before it is accessed.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/pci/if_bnx.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/audio

2024-04-20 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Apr 20 05:38:40 UTC 2024

Modified Files:
src/sys/dev/audio: linear.c

Log Message:
Fix typo in comment.


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

2024-04-20 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Apr 20 05:38:40 UTC 2024

Modified Files:
src/sys/dev/audio: linear.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/audio/linear.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/audio/linear.c
diff -u src/sys/dev/audio/linear.c:1.4 src/sys/dev/audio/linear.c:1.5
--- src/sys/dev/audio/linear.c:1.4	Wed Jul 21 06:35:44 2021
+++ src/sys/dev/audio/linear.c	Sat Apr 20 05:38:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: linear.c,v 1.4 2021/07/21 06:35:44 skrll Exp $	*/
+/*	$NetBSD: linear.c,v 1.5 2024/04/20 05:38:40 isaki Exp $	*/
 
 /*
  * Copyright (C) 2017 Tetsuya Isaki. All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linear.c,v 1.4 2021/07/21 06:35:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linear.c,v 1.5 2024/04/20 05:38:40 isaki Exp $");
 
 #include 
 #include 
@@ -222,7 +222,7 @@ audio_internal_to_linear16(audio_filter_
 /*
  * audio_linear24_to_internal:
  *	This filter performs conversion from [US]LINEAR24/24{LE,BE} to
- *	internal format.  Since it's rerely used, it's size optimized.
+ *	internal format.  Since it's rarely used, it's size optimized.
  */
 void
 audio_linear24_to_internal(audio_filter_arg_t *arg)



CVS commit: src/sys/dev/pci

2024-04-19 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr 19 21:24:00 UTC 2024

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
s/Resorce/Resource/ in comment and log message.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.169 -r1.170 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.243 src/sys/dev/pci/pci_subr.c:1.244
--- src/sys/dev/pci/pci_subr.c:1.243	Thu Aug 10 20:02:56 2023
+++ src/sys/dev/pci/pci_subr.c	Fri Apr 19 21:24:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.243 2023/08/10 20:02:56 andvar Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.244 2024/04/19 21:24:00 andvar Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.243 2023/08/10 20:02:56 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.244 2024/04/19 21:24:00 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -2559,10 +2559,10 @@ pci_conf_print_ea_cap_prop(unsigned int 
 		printf("I/O Space\n");
 		break;
 	case PCI_EA_PROP_VF_MEM_NONPREF:
-		printf("Resorce for VF use, Memory Space, Non-Prefetchable\n");
+		printf("Resource for VF use, Memory Space, Non-Prefetchable\n");
 		break;
 	case PCI_EA_PROP_VF_MEM_PREF:
-		printf("Resorce for VF use, Memory Space, Prefetch\n");
+		printf("Resource for VF use, Memory Space, Prefetch\n");
 		break;
 	case PCI_EA_PROP_BB_MEM_NONPREF:
 		printf("Behind the Bridge, Memory Space, Non-Pref\n");

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.169 src/sys/dev/pci/pcireg.h:1.170
--- src/sys/dev/pci/pcireg.h:1.169	Fri Feb  2 22:19:13 2024
+++ src/sys/dev/pci/pcireg.h	Fri Apr 19 21:24:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.169 2024/02/02 22:19:13 andvar Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.170 2024/04/19 21:24:00 andvar Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1963,8 +1963,8 @@ struct pci_rom {
 #define  PCI_EA_PROP_MEM_NONPREF	0x00	/* Memory Space, Non-Prefetchable */
 #define  PCI_EA_PROP_MEM_PREF		0x01	/* Memory Space, Prefetchable */
 #define  PCI_EA_PROP_IO			0x02	/* I/O Space */
-#define  PCI_EA_PROP_VF_MEM_NONPREF	0x03	/* Resorce for VF use. Mem. Non-Pref */
-#define  PCI_EA_PROP_VF_MEM_PREF	0x04	/* Resorce for VF use. Mem. Prefetch */
+#define  PCI_EA_PROP_VF_MEM_NONPREF	0x03	/* Resource for VF use. Mem. Non-Pref */
+#define  PCI_EA_PROP_VF_MEM_PREF	0x04	/* Resource for VF use. Mem. Prefetch */
 #define  PCI_EA_PROP_BB_MEM_NONPREF	0x05	/* Behind Bridge: MEM. Non-Pref */
 #define  PCI_EA_PROP_BB_MEM_PREF	0x06	/* Behind Bridge: MEM. Prefetch */
 #define  PCI_EA_PROP_BB_IO		0x07	/* Behind Bridge: I/O Space */



CVS commit: src/sys/dev/pci

2024-04-19 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr 19 21:24:00 UTC 2024

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
s/Resorce/Resource/ in comment and log message.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.169 -r1.170 src/sys/dev/pci/pcireg.h

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



CVS commit: src/sys/dev/pckbport

2024-04-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Apr 18 17:35:53 UTC 2024

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Renamed border/boundary variables to better describe their use.
Fix edge default values, factor out percentage calculation for more consistent
values. Use device_printf/DPRINTF to show errors instead of aprint variants.
Print raw input for debugging.

Correct capability parsing. Old devices were probed with nonexistent
commands and then used undefined boundary values that made them unusuable.

Fixes PR 57874.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.82 src/sys/dev/pckbport/synaptics.c:1.83
--- src/sys/dev/pckbport/synaptics.c:1.82	Tue Sep  5 05:55:12 2023
+++ src/sys/dev/pckbport/synaptics.c	Thu Apr 18 17:35:53 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.82 2023/09/05 05:55:12 mrg Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.83 2024/04/18 17:35:53 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.82 2023/09/05 05:55:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.83 2024/04/18 17:35:53 mlelstv Exp $");
 
 #include 
 #include 
@@ -112,10 +112,10 @@ static int synaptics_edge_bottom = SYNAP
 static int synaptics_edge_motion_delta = 32;
 static u_int synaptics_finger_high = SYNAPTICS_FINGER_LIGHT + 5;
 static u_int synaptics_finger_low = SYNAPTICS_FINGER_LIGHT - 10;
-static int synaptics_horiz_pct = 0;
-static int synaptics_vert_pct = 0;
-static int synaptics_button_pct = 30;
-static int synaptics_button_boundary;
+static int synaptics_hscroll_pct = 0;
+static int synaptics_vscroll_pct = 0;
+static int synaptics_button_pct = 0;
+static int synaptics_button_boundary = SYNAPTICS_EDGE_BOTTOM;
 static int synaptics_button2;
 static int synaptics_button3;
 static int synaptics_two_fingers_emul = 0;
@@ -166,23 +166,26 @@ static int synaptics_movement_threshold_
 static int synaptics_movement_enable_nodenum;
 static int synaptics_button_region_movement_nodenum;
 static int synaptics_aux_mid_button_scroll_nodenum;
-static int synaptics_horiz_pct_nodenum;
-static int synaptics_vert_pct_nodenum;
+static int synaptics_hscroll_pct_nodenum;
+static int synaptics_vscroll_pct_nodenum;
 static int synaptics_button_pct_nodenum;
 
 /*
  * copy of edges so we can recalculate edge limit if there is 
  * vertical scroll region
  */
-static int synaptics_actual_edge_right;
-static int synaptics_actual_edge_bottom;
+static int synaptics_true_edge_right;
+static int synaptics_true_edge_bottom;
 
-static int synaptics_old_vert_pct = 0;
-static int synaptics_old_horiz_pct = 0;
-static int synaptics_old_button_pct = 0;
-static int synaptics_old_button_boundary = SYNAPTICS_EDGE_BOTTOM;
-static int synaptics_old_horiz_edge = SYNAPTICS_EDGE_BOTTOM;
-static int synaptics_old_vert_edge = SYNAPTICS_EDGE_RIGHT;
+/*
+ * invalid old values, recalculate everything
+ */
+static int synaptics_old_vscroll_pct = -1;
+static int synaptics_old_hscroll_pct = -1;
+static int synaptics_old_button_pct = -1;
+static int synaptics_old_button_boundary = -1;
+static int synaptics_old_edge_right = -1;
+static int synaptics_old_edge_bottom = -1;
 
 /*
  * This holds the processed packet data, it is global because multiple
@@ -208,7 +211,7 @@ synaptics_poll_cmd(struct pms_softc *psc
 	int res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, i, 0,
 	NULL, 0);
 	if (res)
-		aprint_error_dev(psc->sc_dev, "command error %#x\n", cmd[0]);
+		device_printf(psc->sc_dev, "command error %#x\n", cmd[0]);
 	return res;
 }
 
@@ -221,7 +224,7 @@ synaptics_poll_reset(struct pms_softc *p
 	u_char cmd[1] = { PMS_RESET };
 	res = pckbport_poll_cmd(psc->sc_kbctag, psc->sc_kbcslot, cmd, 1, 2,
 	resp, 1);
-	aprint_debug_dev(psc->sc_dev, "reset %d 0x%02x 0x%02x\n",
+	DPRINTF(10, >u.synaptics, "reset %d 0x%02x 0x%02x\n",
 	res, resp[0], resp[1]);
 	return res;
 }
@@ -251,80 +254,90 @@ synaptics_special_write(struct pms_softc
 	return res;
 }
 
+static int
+synaptics_value(int pct, int low, int high)
+{
+	return low + pct * (high - low) / 100UL;
+}
+
+static int
+synaptics_percentage(int val, int low, int high)
+{
+	return ((val - low) * 100UL + high - low - 1) / (high - low);
+}
+
 static void
 pms_synaptics_set_boundaries(void)
 {
-	if (synaptics_vert_pct != synaptics_old_vert_pct ) {
-		synaptics_edge_right = synaptics_actual_edge_right -
-		((unsigned long) synaptics_vert_pct *
-		(synaptics_actual_edge_right - synaptics_edge_left)) / 100;
-		synaptics_old_vert_pct = synaptics_vert_pct;
-		synaptics_old_vert_edge = synaptics_edge_right;
+	if (synaptics_vscroll_pct != synaptics_old_vscroll_pct ) {
+		

CVS commit: src/sys/dev/pckbport

2024-04-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Apr 18 17:35:53 UTC 2024

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
Renamed border/boundary variables to better describe their use.
Fix edge default values, factor out percentage calculation for more consistent
values. Use device_printf/DPRINTF to show errors instead of aprint variants.
Print raw input for debugging.

Correct capability parsing. Old devices were probed with nonexistent
commands and then used undefined boundary values that made them unusuable.

Fixes PR 57874.


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

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:44:00 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_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/hdaudio/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.9 src/sys/dev/hdaudio/hdaudiodevs.h:1.10
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.9	Sat Apr  6 13:35:59 2024
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Wed Apr 17 11:43:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.10 2024/04/17 11:43:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
+ *	NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp
  */
 
 /*
@@ -151,6 +151,8 @@
 #define	HDAUDIO_PRODUCT_VIATECH_VT1812	0x0448		/* VT1812 */
 #define	HDAUDIO_PRODUCT_VIATECH_VT1818S	0x0440		/* VT1818S */
 #define	HDAUDIO_PRODUCT_VIATECH_VT1705	0x4760		/* VT1705 */
+#define	HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_1	0x9f80		/* VX900 HDMI/DP */
+#define	HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_2	0x9f81		/* VX900 HDMI/DP */
 
 /* Analog Devices */
 #define	HDAUDIO_PRODUCT_ANALOG_AD1884A	0x184a		/* AD1884A */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.10
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9	Sat Apr  6 13:35:59 2024
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Wed Apr 17 11:43:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.10 2024/04/17 11:43:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
+ *	NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp
  */
 
 /*
@@ -231,60 +231,64 @@ static const uint32_t hdaudio_products[]
 	477, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1705, 
 	485, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_1, 
+	492, 160, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_2, 
+	492, 160, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1884A, 
-	492, 0,
+	498, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1882, 
-	500, 0,
+	506, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1883, 
-	507, 0,
+	513, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1884, 
-	514, 0,
+	520, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984A, 
-	521, 0,
+	527, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984B, 
-	529, 0,
+	535, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1981HD, 
-	537, 0,
+	543, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1983, 
-	546, 0,
+	552, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984, 
-	553, 0,
+	559, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1986A, 
-	560, 0,
+	566, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1988A, 
-	568, 0,
+	574, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1988B, 
-	576, 0,
+	582, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1989A, 
-	584, 0,
+	590, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1989B, 
-	592, 0,
+	598, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20549, 
-	600, 0,
+	606, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20551, 
-	608, 0,
+	614, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20561, 
-	616, 0,
+	622, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20582, 
-	624, 0,
+	630, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20583, 
-	632, 0,
+	638, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20585, 
-	640, 0,
+	646, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20671, 
-	648, 0,
+	654, 0,
 	HDAUDIO_VENDOR_CMEDIA, HDAUDIO_PRODUCT_CMEDIA_CMI9880, 
-	656, 0,
+	662, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_Q57_HDMI, 
-	664, 92, 0,
+	670, 92, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_1, 
-	668, 672, 0,
+	674, 678, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_2, 
-	668, 679, 0,
+	674, 685, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_3, 
-	668, 686, 0,
+	674, 692, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_4, 
-	  

CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:44:00 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_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/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:42:47 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add VIA VX900 HDMI.


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

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.8 src/sys/dev/hdaudio/hdaudiodevs:1.9
--- src/sys/dev/hdaudio/hdaudiodevs:1.8	Sat Apr  6 13:35:36 2024
+++ src/sys/dev/hdaudio/hdaudiodevs	Wed Apr 17 11:42:47 2024
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp $
+$NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -144,6 +144,8 @@ product	VIATECH		VT2002P_1	0x4438	VT2002
 product	VIATECH		VT1812		0x0448	VT1812
 product	VIATECH		VT1818S		0x0440	VT1818S
 product	VIATECH		VT1705		0x4760	VT1705
+product	VIATECH		VX900_HDMI_1	0x9f80	VX900 HDMI/DP
+product	VIATECH		VX900_HDMI_2	0x9f81	VX900 HDMI/DP
 
 /* Analog Devices */
 product	ANALOG		AD1884A		0x184a	AD1884A



CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:42:47 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add VIA VX900 HDMI.


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

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

2024-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 17 02:34:45 UTC 2024

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

Log Message:
Add support for a range of USB serial adapters

>From Cameron Williams in PR kern/58127


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/usb/uftdi.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/uftdi.c
diff -u src/sys/dev/usb/uftdi.c:1.77 src/sys/dev/usb/uftdi.c:1.78
--- src/sys/dev/usb/uftdi.c:1.77	Tue Mar 26 03:38:02 2024
+++ src/sys/dev/usb/uftdi.c	Wed Apr 17 02:34:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $	*/
+/*	$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -126,6 +126,25 @@ static const struct ucom_methods uftdi_m
  */
 static const struct usb_devno uftdi_devs[] = {
 	{ USB_VENDOR_BBELECTRONICS, USB_PRODUCT_BBELECTRONICS_USOTL4 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US101 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US159 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US235 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US257 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_12 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_34 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_56 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_78 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US313 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US320 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US324 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US346_12 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US346_34 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US701_12 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US701_34 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_12 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_34 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_56 },
+	{ USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_78 },
 	{ USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_TWIST },
 	{ USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_SAMBA },
 	{ USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_230X },



CVS commit: src/sys/dev/usb

2024-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 17 02:34:45 UTC 2024

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

Log Message:
Add support for a range of USB serial adapters

>From Cameron Williams in PR kern/58127


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/usb/uftdi.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

2024-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 17 02:33:04 UTC 2024

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

Log Message:
Regen after usbdevs change


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

2024-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 17 02:32:09 UTC 2024

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

Log Message:
Add some USB serial adapters

>From Cameron Williams in PR kern/58127


To generate a diff of this commit:
cvs rdiff -u -r1.814 -r1.815 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.814 src/sys/dev/usb/usbdevs:1.815
--- src/sys/dev/usb/usbdevs:1.814	Wed Feb 28 21:50:51 2024
+++ src/sys/dev/usb/usbdevs	Wed Apr 17 02:32:08 2024
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp $
+$NetBSD: usbdevs,v 1.815 2024/04/17 02:32:08 maya Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1118,6 +1118,27 @@ product BILLIONTON USBEL100	0x0988	USB10
 product BILLIONTON USBE100	0x8511	USBE100
 product BILLIONTON USB2AR	0x90ff	USB2AR Ethernet
 
+/* Brainboxes Limited products */
+product BRAINBOXES US101	0x1011	US-101 USB2Serial 1xRS232
+product BRAINBOXES US159	0x1021	US-159 USB2Serial 1xRS232
+product BRAINBOXES US235	0x1017	US-235 USB2Serial 1xRS232
+product BRAINBOXES US257	0x5001	US-257 USB2Serial 2xRS232
+product BRAINBOXES US279_12	0x2021	US-279 USB2Serial 8xRS232 (Port 1 and 2)
+product BRAINBOXES US279_34	0x2022	US-279 USB2Serial 8xRS232 (Port 3 and 4)
+product BRAINBOXES US279_56	0x2023	US-279 USB2Serial 8xRS232 (Port 5 and 6)
+product BRAINBOXES US279_78	0x2024	US-279 USB2Serial 8xRS232 (Port 7 and 8)
+product BRAINBOXES US313	0x6001	US-313 USB2Serial 2xRS422/485
+product BRAINBOXES US320	0x1019	US-320 USB2Serial 1xRS422/485
+product BRAINBOXES US324	0x1013	US-324 USB2Serial 1xRS422/485
+product BRAINBOXES US346_12	0x3011	US-346 USB2Serial 4xRS422/485 (Port 1 and 2)
+product BRAINBOXES US346_34	0x3012	US-346 USB2Serial 4xRS422/485 (Port 3 and 4)
+product BRAINBOXES US701_12	0x2011	US-701 USB2Serial 4xRS232 (Port 1 and 2)
+product BRAINBOXES US701_34	0x2012	US-701 USB2Serial 4xRS232 (Port 3 and 4)
+product BRAINBOXES US842_12	0x8001	US-842 USB2Serial 8xRS422/485 (Port 1 and 2)
+product BRAINBOXES US842_34	0x8002	US-842 USB2Serial 8xRS422/485 (Port 3 and 4)
+product BRAINBOXES US842_56	0x8003	US-842 USB2Serial 8xRS422/485 (Port 5 and 6)
+product BRAINBOXES US842_78	0x8004	US-842 USB2Serial 8xRS422/485 (Port 7 and 8)
+
 /* Broadcom products */
 product BROADCOM BCMFW		0x0bdc	BCMFW
 product BROADCOM BCM2033	0x2000	BCM2033



CVS commit: src/sys/dev/usb

2024-04-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Apr 17 02:32:09 UTC 2024

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

Log Message:
Add some USB serial adapters

>From Cameron Williams in PR kern/58127


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

2024-04-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Apr 12 16:54:37 UTC 2024

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

Log Message:
include opt_ntp.h for PPS_SYNC


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.138 src/sys/dev/usb/ucom.c:1.139
--- src/sys/dev/usb/ucom.c:1.138	Sun Mar  5 23:28:54 2023
+++ src/sys/dev/usb/ucom.c	Fri Apr 12 16:54:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.138 2023/03/05 23:28:54 riastradh Exp $	*/
+/*	$NetBSD: ucom.c,v 1.139 2024/04/12 16:54:37 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,9 +34,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.138 2023/03/05 23:28:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.139 2024/04/12 16:54:37 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
+#include "opt_ntp.h"
 #include "opt_usb.h"
 #endif
 



CVS commit: src/sys/dev/usb

2024-04-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Apr 12 16:54:37 UTC 2024

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

Log Message:
include opt_ntp.h for PPS_SYNC


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/ucom.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

2024-04-11 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr 12 05:04:02 UTC 2024

Modified Files:
src/sys/dev: ccd.c

Log Message:
Repair handling of ccd sysctls to not use newp as an index.

This is a work-around for kern/58051.  It is not a complete fix.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/dev/ccd.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/ccd.c
diff -u src/sys/dev/ccd.c:1.190 src/sys/dev/ccd.c:1.191
--- src/sys/dev/ccd.c:1.190	Sun Mar 31 14:56:41 2024
+++ src/sys/dev/ccd.c	Fri Apr 12 05:04:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd.c,v 1.190 2024/03/31 14:56:41 hannken Exp $	*/
+/*	$NetBSD: ccd.c,v 1.191 2024/04/12 05:04:02 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.190 2024/03/31 14:56:41 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.191 2024/04/12 05:04:02 pgoyette Exp $");
 
 #include 
 #include 
@@ -1774,13 +1774,14 @@ ccd_info_sysctl(SYSCTLFN_ARGS)
 	struct sysctlnode node;
 	struct ccddiskinfo ccd;
 	struct ccd_softc *sc;
-	int unit;
+	int unit, error;
 
 	if (newp == NULL || newlen != sizeof(int))
 		return EINVAL;
 
-	unit = *(const int *)newp;
-	newp = NULL;
+	error = sysctl_copyin(l, newp, , sizeof unit);
+	if (error)
+		return error;
 	newlen = 0;
 	ccd.ccd_ndisks = ~0;
 	mutex_enter(_lock);
@@ -1818,8 +1819,9 @@ ccd_components_sysctl(SYSCTLFN_ARGS)
 		return EINVAL;
 
 	size = 0;
-	unit = *(const int *)newp;
-	newp = NULL;
+	error = sysctl_copyin(l, newp, , sizeof unit);
+	if (error)
+		return error;
 	newlen = 0;
 	mutex_enter(_lock);
 	LIST_FOREACH(sc, , sc_link)



CVS commit: src/sys/dev

2024-04-11 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Apr 12 05:04:02 UTC 2024

Modified Files:
src/sys/dev: ccd.c

Log Message:
Repair handling of ccd sysctls to not use newp as an index.

This is a work-around for kern/58051.  It is not a complete fix.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/dev/ccd.c

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



CVS commit: src/sys/dev/pci

2024-04-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 11 10:42:42 UTC 2024

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

Log Message:
mcx(4): enforce full-duplex mark in mcx_media_status(), when link is up.

LACP protocol requires full-duplex to be enabled for lagg(4) to work,
however mcx(4) was not setting this capability making it to fail.

Fixes PR kern/58124.  OK'd by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_mcx.c

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



CVS commit: src/sys/dev/pci

2024-04-11 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Apr 11 10:42:42 UTC 2024

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

Log Message:
mcx(4): enforce full-duplex mark in mcx_media_status(), when link is up.

LACP protocol requires full-duplex to be enabled for lagg(4) to work,
however mcx(4) was not setting this capability making it to fail.

Fixes PR kern/58124.  OK'd by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_mcx.c

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

Modified files:

Index: src/sys/dev/pci/if_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.26 src/sys/dev/pci/if_mcx.c:1.27
--- src/sys/dev/pci/if_mcx.c:1.26	Thu Oct 26 03:44:12 2023
+++ src/sys/dev/pci/if_mcx.c	Thu Apr 11 10:42:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcx.c,v 1.26 2023/10/26 03:44:12 msaitoh Exp $ */
+/*	$NetBSD: if_mcx.c,v 1.27 2024/04/11 10:42:42 andvar Exp $ */
 /*	$OpenBSD: if_mcx.c,v 1.101 2021/06/02 19:16:11 patrick Exp $ */
 
 /*
@@ -23,7 +23,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.26 2023/10/26 03:44:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mcx.c,v 1.27 2024/04/11 10:42:42 andvar Exp $");
 
 #include 
 #include 
@@ -8072,7 +8072,7 @@ mcx_media_status(struct ifnet *ifp, stru
 	ifmr->ifm_status = IFM_AVALID;
 	if (proto_oper != 0) {
 		ifmr->ifm_status |= IFM_ACTIVE;
-		ifmr->ifm_active = IFM_ETHER | IFM_AUTO | media_oper;
+		ifmr->ifm_active = IFM_ETHER | IFM_FDX | IFM_AUTO | media_oper;
 		/* txpause, rxpause, duplex? */
 	}
 }



CVS commit: src/sys/dev/ic

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:42:18 UTC 2024

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

Log Message:
Add RISC-V support


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/qemufwcfg.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/qemufwcfg.c
diff -u src/sys/dev/ic/qemufwcfg.c:1.2 src/sys/dev/ic/qemufwcfg.c:1.3
--- src/sys/dev/ic/qemufwcfg.c:1.2	Mon Sep  3 16:29:31 2018
+++ src/sys/dev/ic/qemufwcfg.c	Sat Apr  6 13:42:18 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: qemufwcfg.c,v 1.2 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: qemufwcfg.c,v 1.3 2024/04/06 13:42:18 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: qemufwcfg.c,v 1.2 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qemufwcfg.c,v 1.3 2024/04/06 13:42:18 skrll Exp $");
 
 #include 
 #include 
@@ -52,6 +52,11 @@ __KERNEL_RCSID(0, "$NetBSD: qemufwcfg.c,
 #define	FWCFG_SEL_SWAP		htobe16
 #define	FWCFG_DATA_REG		0x00
 #define	FWCFG_DMA_ADDR		0x10
+#elif defined(__riscv)
+#define	FWCFG_SEL_REG		0x08
+#define	FWCFG_SEL_SWAP		htobe16
+#define	FWCFG_DATA_REG		0x00
+#define	FWCFG_DMA_ADDR		0x10
 #else
 #error driver does not support this architecture
 #endif



CVS commit: src/sys/dev/ic

2024-04-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  6 13:42:18 UTC 2024

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

Log Message:
Add RISC-V support


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/qemufwcfg.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/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:59 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_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/hdaudio/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.8 src/sys/dev/hdaudio/hdaudiodevs.h:1.9
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.8	Sat Jul  1 13:37:48 2023
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Sat Apr  6 13:35:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
  */
 
 /*
@@ -49,6 +49,7 @@
 #define	HDAUDIO_VENDOR_ANALOG	0x11d4		/* Analog Devices */
 #define	HDAUDIO_VENDOR_CONEXANT	0x14f1		/* Conexant */
 #define	HDAUDIO_VENDOR_VMWARE	0x15ad		/* VMware */
+#define	HDAUDIO_VENDOR_ZHAOXIN	0x1d17		/* Zhaoxin */
 #define	HDAUDIO_VENDOR_CMEDIA	0x434d		/* C-Media */
 #define	HDAUDIO_VENDOR_INTEL	0x8086		/* Intel */
 #define	HDAUDIO_VENDOR_SIGMATEL	0x8384		/* Sigmatel */
@@ -269,6 +270,10 @@
 /* VMware */
 #define	HDAUDIO_PRODUCT_VMWARE_VIRTUAL_HDA	0x1975		/* Virtual HDA */
 
+/* Zhaoxin */
+#define	HDAUDIO_PRODUCT_ZHAOXIN_KX6000_HDMI_1	0x9f8a		/* ZX-E HDMI/DP */
+#define	HDAUDIO_PRODUCT_ZHAOXIN_KX6000_HDMI_2	0x9f8b		/* ZX-E HDMI/DP */
+
 /* Define format strings for non-existent values */
 #define hdaudio_id1_format	"vendor %4.4x"
 #define hdaudio_id2_format	"product %4.4x"
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8	Sat Jul  1 13:37:48 2023
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Sat Apr  6 13:35:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
  */
 
 /*
@@ -44,400 +44,405 @@ static const uint32_t hdaudio_vendors[] 
 	HDAUDIO_VENDOR_ANALOG, 33, 40, 0,
 	HDAUDIO_VENDOR_CONEXANT, 48, 0,
 	HDAUDIO_VENDOR_VMWARE, 57, 0,
-	HDAUDIO_VENDOR_CMEDIA, 64, 0,
-	HDAUDIO_VENDOR_INTEL, 72, 0,
+	HDAUDIO_VENDOR_ZHAOXIN, 64, 0,
+	HDAUDIO_VENDOR_CMEDIA, 72, 0,
+	HDAUDIO_VENDOR_INTEL, 80, 0,
 	HDAUDIO_VENDOR_SIGMATEL, 24, 0,
 };
 
 static const uint32_t hdaudio_products[] = {
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_1, 
-	78, 84, 0,
+	86, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_2, 
-	78, 84, 0,
+	86, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS690_780_HDMI, 
-	89, 84, 0,
+	97, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_R6xx_HDMI, 
-	99, 84, 0,
+	107, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_2, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_3, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_5, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_6, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP79_7A_HDMI_7, 
-	113, 84, 0,
+	121, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT220_HDMI, 
-	122, 84, 0,
+	130, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT21x_HDMI, 
-	128, 84, 0,
+	136, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP89_HDMI, 
-	134, 84, 0,
+	142, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT240_HDMI, 
-	140, 84, 0,
+	148, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT5xx_HDMI_DP, 
-	146, 152, 0,
+	154, 160, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_TEGRA124_HDMI, 
-	160, 84, 0,
+	168, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP67_HDMI, 
-	169, 84, 0,
+	177, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP73_HDMI, 
-	175, 84, 0,
+	183, 92, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC260, 
-	181, 0,
+	189, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC262, 
-	188, 0,
+	196, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC267, 
-	195, 0,
+	203, 0,
 

CVS commit: src/sys/dev/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:59 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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



  1   2   3   4   5   6   7   8   9   10   >