CVS commit: [netbsd-10] src/sys/arch/newsmips/dev
Module Name:src Committed By: bouyer Date: Sun Nov 26 11:54:31 UTC 2023 Modified Files: src/sys/arch/newsmips/dev [netbsd-10]: dmac_0448.h scsi_1185.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #462): sys/arch/newsmips/dev/dmac_0448.h: revision 1.7 sys/arch/newsmips/dev/scsi_1185.c: revision 1.25 Use DELAY(9), not empty for() loop that could be optimized out. No visible regression on NWS-3260 and NWS-3470. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.122.1 src/sys/arch/newsmips/dev/dmac_0448.h cvs rdiff -u -r1.23 -r1.23.46.1 src/sys/arch/newsmips/dev/scsi_1185.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/dev/dmac_0448.h diff -u src/sys/arch/newsmips/dev/dmac_0448.h:1.6 src/sys/arch/newsmips/dev/dmac_0448.h:1.6.122.1 --- src/sys/arch/newsmips/dev/dmac_0448.h:1.6 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/dev/dmac_0448.h Sun Nov 26 11:54:31 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: dmac_0448.h,v 1.6 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: dmac_0448.h,v 1.6.122.1 2023/11/26 11:54:31 bouyer Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -120,7 +120,7 @@ struct dm_stat { unsigned int dm_width; }; -#define DMAC_WAIT nops(10) +#define DMAC_WAIT DELAY(1) #define PINTEN 0xbfc80001 # define DMA_INTEN 0x10 Index: src/sys/arch/newsmips/dev/scsi_1185.c diff -u src/sys/arch/newsmips/dev/scsi_1185.c:1.23 src/sys/arch/newsmips/dev/scsi_1185.c:1.23.46.1 --- src/sys/arch/newsmips/dev/scsi_1185.c:1.23 Thu Jul 21 19:49:58 2016 +++ src/sys/arch/newsmips/dev/scsi_1185.c Sun Nov 26 11:54:31 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $ */ +/* $NetBSD: scsi_1185.c,v 1.23.46.1 2023/11/26 11:54:31 bouyer Exp $ */ /* * Copyright (c) 1992, 1993 @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.23.46.1 2023/11/26 11:54:31 bouyer Exp $"); #define __INTR_PRIVATE #include @@ -116,10 +116,9 @@ __KERNEL_RCSID(0, "$NetBSD: scsi_1185.c, #define splscsi splsc #if defined(__mips__) && defined(CPU_SINGLE) -#define nops(x) { int __i; for (__i = 0; __i < (x); __i++) ; } -#define DMAC_WAIT0 ; +#define DMAC_WAIT0 __nothing #else -#define DMAC_WAIT0 DMAC_WAIT +#define DMAC_WAIT0 DMAC_WAIT /* see MODIFY HISTORY comment above */ #endif #ifdef DMAC_MAP_INIT
CVS commit: [netbsd-10] src/sys/arch/newsmips/dev
Module Name:src Committed By: bouyer Date: Sun Nov 26 11:54:31 UTC 2023 Modified Files: src/sys/arch/newsmips/dev [netbsd-10]: dmac_0448.h scsi_1185.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #462): sys/arch/newsmips/dev/dmac_0448.h: revision 1.7 sys/arch/newsmips/dev/scsi_1185.c: revision 1.25 Use DELAY(9), not empty for() loop that could be optimized out. No visible regression on NWS-3260 and NWS-3470. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.122.1 src/sys/arch/newsmips/dev/dmac_0448.h cvs rdiff -u -r1.23 -r1.23.46.1 src/sys/arch/newsmips/dev/scsi_1185.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/sys/arch/newsmips
Module Name:src Committed By: martin Date: Sun Nov 5 17:43:59 UTC 2023 Modified Files: src/sys/arch/newsmips/conf [netbsd-10]: GENERIC INSTALL src/sys/arch/newsmips/dev [netbsd-10]: fb.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #459): sys/arch/newsmips/dev/fb.c: revision 1.34 sys/arch/newsmips/conf/GENERIC: revision 1.146 sys/arch/newsmips/conf/INSTALL: revision 1.49 sys/arch/newsmips/dev/fb.c: revision 1.30 sys/arch/newsmips/dev/fb.c: revision 1.31 sys/arch/newsmips/dev/fb.c: revision 1.32 sys/arch/newsmips/dev/fb.c: revision 1.33 Make local functions and variables static. Use proper C99 exact-width integer types. Use C99 designated struct initializers. Remove trailing spaces and tab. Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines. Tested on NWS-3260, which was sent from ryo@'s belongins and repaired by me, and also tested on my NWS-3470D, including Xorg mono server. (Note X.org server on NEWS machines requires keymap modifications) Also add proper initialization on consinit() in NMB-253 case. To generate a diff of this commit: cvs rdiff -u -r1.142.4.1 -r1.142.4.2 src/sys/arch/newsmips/conf/GENERIC cvs rdiff -u -r1.47.30.1 -r1.47.30.2 src/sys/arch/newsmips/conf/INSTALL cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/fb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/conf/GENERIC diff -u src/sys/arch/newsmips/conf/GENERIC:1.142.4.1 src/sys/arch/newsmips/conf/GENERIC:1.142.4.2 --- src/sys/arch/newsmips/conf/GENERIC:1.142.4.1 Sun Nov 5 17:17:03 2023 +++ src/sys/arch/newsmips/conf/GENERIC Sun Nov 5 17:43:58 2023 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.142.4.1 2023/11/05 17:17:03 martin Exp $ +# $NetBSD: GENERIC,v 1.142.4.2 2023/11/05 17:43:58 martin Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/newsmips/conf/std.newsmip options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.142.4.1 $" +#ident "GENERIC-$Revision: 1.142.4.2 $" makeoptions COPTS="-O2 -fno-unwind-tables" @@ -170,6 +170,7 @@ zstty4 at zsc2 channel 0 # tty04 zstty5 at zsc2 channel 1 # tty05 fb0 at hb0 addr 0x8800 # NWB-253 frame buffer +fb0 at hb0 addr 0x9020 # LCD-MONO on NWS-32x0 wsdisplay0 at fb? console ? xafb* at ap?# "XA" frame buffer Index: src/sys/arch/newsmips/conf/INSTALL diff -u src/sys/arch/newsmips/conf/INSTALL:1.47.30.1 src/sys/arch/newsmips/conf/INSTALL:1.47.30.2 --- src/sys/arch/newsmips/conf/INSTALL:1.47.30.1 Sun Nov 5 17:17:03 2023 +++ src/sys/arch/newsmips/conf/INSTALL Sun Nov 5 17:43:58 2023 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.47.30.1 2023/11/05 17:17:03 martin Exp $ +# $NetBSD: INSTALL,v 1.47.30.2 2023/11/05 17:43:58 martin Exp $ # # INSTALL kernel for RISC-NEWS @@ -81,7 +81,8 @@ zsc0 at ap? zstty0 at zsc0 channel 0 # tty00 zstty1 at zsc0 channel 1 # tty01 -fb0 at hb0 addr 0x8800 # frame buffer +fb0 at hb0 addr 0x8800 # NWB-253 frame buffer +fb0 at hb0 addr 0x9020 # LCD-MONO on NWS-32x0 xafb* at ap? kb0 at ap? Index: src/sys/arch/newsmips/dev/fb.c diff -u src/sys/arch/newsmips/dev/fb.c:1.29 src/sys/arch/newsmips/dev/fb.c:1.29.6.1 --- src/sys/arch/newsmips/dev/fb.c:1.29 Sat Aug 7 16:19:01 2021 +++ src/sys/arch/newsmips/dev/fb.c Sun Nov 5 17:43:58 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $ */ +/* $NetBSD: fb.c,v 1.29.6.1 2023/11/05 17:43:58 martin Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -25,9 +25,32 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*- + * Copyright (c) 2023 Izumi Tsutsui. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CVS commit: [netbsd-10] src/sys/arch/newsmips
Module Name:src Committed By: martin Date: Sun Nov 5 17:43:59 UTC 2023 Modified Files: src/sys/arch/newsmips/conf [netbsd-10]: GENERIC INSTALL src/sys/arch/newsmips/dev [netbsd-10]: fb.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #459): sys/arch/newsmips/dev/fb.c: revision 1.34 sys/arch/newsmips/conf/GENERIC: revision 1.146 sys/arch/newsmips/conf/INSTALL: revision 1.49 sys/arch/newsmips/dev/fb.c: revision 1.30 sys/arch/newsmips/dev/fb.c: revision 1.31 sys/arch/newsmips/dev/fb.c: revision 1.32 sys/arch/newsmips/dev/fb.c: revision 1.33 Make local functions and variables static. Use proper C99 exact-width integer types. Use C99 designated struct initializers. Remove trailing spaces and tab. Add support for LCD-MONO framebuffer on NWS-32x0 laptop machines. Tested on NWS-3260, which was sent from ryo@'s belongins and repaired by me, and also tested on my NWS-3470D, including Xorg mono server. (Note X.org server on NEWS machines requires keymap modifications) Also add proper initialization on consinit() in NMB-253 case. To generate a diff of this commit: cvs rdiff -u -r1.142.4.1 -r1.142.4.2 src/sys/arch/newsmips/conf/GENERIC cvs rdiff -u -r1.47.30.1 -r1.47.30.2 src/sys/arch/newsmips/conf/INSTALL cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/fb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/sys/arch/newsmips/conf
Module Name:src Committed By: martin Date: Sun Nov 5 17:17:04 UTC 2023 Modified Files: src/sys/arch/newsmips/conf [netbsd-10]: DEJIKO GENERIC INSTALL WAPIKO Log Message: Pull up following revision(s) (requested by tsutsui in ticket #457): sys/arch/newsmips/conf/GENERIC: revision 1.144 sys/arch/newsmips/conf/GENERIC: revision 1.145 sys/arch/newsmips/conf/WAPIKO: revision 1.50 sys/arch/newsmips/conf/WAPIKO: revision 1.51 sys/arch/newsmips/conf/INSTALL: revision 1.48 sys/arch/newsmips/conf/DEJIKO: revision 1.36 sys/arch/newsmips/conf/DEJIKO: revision 1.37 Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun. Specify -fno-unwind-tables to shrink kernel binaries. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.30.1 src/sys/arch/newsmips/conf/DEJIKO cvs rdiff -u -r1.142 -r1.142.4.1 src/sys/arch/newsmips/conf/GENERIC cvs rdiff -u -r1.47 -r1.47.30.1 src/sys/arch/newsmips/conf/INSTALL cvs rdiff -u -r1.49 -r1.49.30.1 src/sys/arch/newsmips/conf/WAPIKO Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/conf/DEJIKO diff -u src/sys/arch/newsmips/conf/DEJIKO:1.35 src/sys/arch/newsmips/conf/DEJIKO:1.35.30.1 --- src/sys/arch/newsmips/conf/DEJIKO:1.35 Wed Aug 1 20:04:13 2018 +++ src/sys/arch/newsmips/conf/DEJIKO Sun Nov 5 17:17:03 2023 @@ -1,4 +1,4 @@ -# $NetBSD: DEJIKO,v 1.35 2018/08/01 20:04:13 maxv Exp $ +# $NetBSD: DEJIKO,v 1.35.30.1 2023/11/05 17:17:03 martin Exp $ # # Dejiko's sekai-seifuku NEWS5000 nyo. @@ -6,6 +6,8 @@ include "arch/newsmips/conf/std.newsmip #options INCLUDE_CONFIG_FILE # embed config file in kernel binary +makeoptions COPTS="-O2 -fno-unwind-tables" + maxusers 16 options news5000 @@ -45,7 +47,8 @@ include "conf/compat_netbsd14.config" # wscons options options WSEMUL_VT100 # VT100 / VT220 emulation options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_GALLANT12x22 +#options FONT_GALLANT12x22 +options FONT_SONY12x24 config netbsd root on ? type ? Index: src/sys/arch/newsmips/conf/GENERIC diff -u src/sys/arch/newsmips/conf/GENERIC:1.142 src/sys/arch/newsmips/conf/GENERIC:1.142.4.1 --- src/sys/arch/newsmips/conf/GENERIC:1.142 Thu Sep 29 10:10:09 2022 +++ src/sys/arch/newsmips/conf/GENERIC Sun Nov 5 17:17:03 2023 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.142 2022/09/29 10:10:09 riastradh Exp $ +# $NetBSD: GENERIC,v 1.142.4.1 2023/11/05 17:17:03 martin Exp $ # # GENERIC machine description file # @@ -22,7 +22,9 @@ include "arch/newsmips/conf/std.newsmip options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.142 $" +#ident "GENERIC-$Revision: 1.142.4.1 $" + +makeoptions COPTS="-O2 -fno-unwind-tables" maxusers 16 @@ -126,7 +128,8 @@ options NFS_BOOT_DHCP # wscons options options WSEMUL_VT100 # VT100 / VT220 emulation options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_GALLANT12x22 +#options FONT_GALLANT12x22 +options FONT_SONY12x24 config netbsd root on ? type ? Index: src/sys/arch/newsmips/conf/INSTALL diff -u src/sys/arch/newsmips/conf/INSTALL:1.47 src/sys/arch/newsmips/conf/INSTALL:1.47.30.1 --- src/sys/arch/newsmips/conf/INSTALL:1.47 Thu Feb 7 04:33:58 2019 +++ src/sys/arch/newsmips/conf/INSTALL Sun Nov 5 17:17:03 2023 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.47 2019/02/07 04:33:58 mrg Exp $ +# $NetBSD: INSTALL,v 1.47.30.1 2023/11/05 17:17:03 martin Exp $ # # INSTALL kernel for RISC-NEWS @@ -6,7 +6,7 @@ include "arch/newsmips/conf/std.newsmip #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -makeoptions COPTS="-Os -mmemcpy" # Optimise for space. Implies -O2 +makeoptions COPTS="-Os -fno-unwind-tables -mmemcpy" # Optimise for space. Implies -O2 maxusers 8 Index: src/sys/arch/newsmips/conf/WAPIKO diff -u src/sys/arch/newsmips/conf/WAPIKO:1.49 src/sys/arch/newsmips/conf/WAPIKO:1.49.30.1 --- src/sys/arch/newsmips/conf/WAPIKO:1.49 Wed Aug 1 20:04:13 2018 +++ src/sys/arch/newsmips/conf/WAPIKO Sun Nov 5 17:17:03 2023 @@ -1,15 +1,15 @@ # # NEWS3400 config file # -# $NetBSD: WAPIKO,v 1.49 2018/08/01 20:04:13 maxv Exp $ +# $NetBSD: WAPIKO,v 1.49.30.1 2023/11/05 17:17:03 martin Exp $ # include "arch/newsmips/conf/std.newsmips" #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -maxusers 16 +makeoptions COPTS="-O2 -fno-unwind-tables" -makeoptions COPTS="-O2 -pipe" +maxusers 16 options news3400 options MIPS1 # R2000/R3000 support @@ -84,7 +84,8 @@ sd* at scsibus? target ? lun ? # SCSI di options WSEMUL_VT100 # VT100 / VT220 emulation options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_GALLANT12x22 +#options FONT_GALLANT12x22 +options FONT_SONY12x24 wsdisplay0 at fb? console ? wskbd0 at kb? console ?
CVS commit: [netbsd-10] src/sys/arch/newsmips/conf
Module Name:src Committed By: martin Date: Sun Nov 5 17:17:04 UTC 2023 Modified Files: src/sys/arch/newsmips/conf [netbsd-10]: DEJIKO GENERIC INSTALL WAPIKO Log Message: Pull up following revision(s) (requested by tsutsui in ticket #457): sys/arch/newsmips/conf/GENERIC: revision 1.144 sys/arch/newsmips/conf/GENERIC: revision 1.145 sys/arch/newsmips/conf/WAPIKO: revision 1.50 sys/arch/newsmips/conf/WAPIKO: revision 1.51 sys/arch/newsmips/conf/INSTALL: revision 1.48 sys/arch/newsmips/conf/DEJIKO: revision 1.36 sys/arch/newsmips/conf/DEJIKO: revision 1.37 Use FONT_SONY12x24 for Sony fans, rather than Gallant fonts used on Sun. Specify -fno-unwind-tables to shrink kernel binaries. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.30.1 src/sys/arch/newsmips/conf/DEJIKO cvs rdiff -u -r1.142 -r1.142.4.1 src/sys/arch/newsmips/conf/GENERIC cvs rdiff -u -r1.47 -r1.47.30.1 src/sys/arch/newsmips/conf/INSTALL cvs rdiff -u -r1.49 -r1.49.30.1 src/sys/arch/newsmips/conf/WAPIKO Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/sys/arch/newsmips/dev
Module Name:src Committed By: martin Date: Sun Nov 5 17:06:14 UTC 2023 Modified Files: src/sys/arch/newsmips/dev [netbsd-10]: zs_hb.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #456): sys/arch/newsmips/dev/zs_hb.c: revision 1.30 Don't use aprint_error(9) for a normal attach message. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/zs_hb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/sys/arch/newsmips/dev
Module Name:src Committed By: martin Date: Sun Nov 5 17:06:14 UTC 2023 Modified Files: src/sys/arch/newsmips/dev [netbsd-10]: zs_hb.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #456): sys/arch/newsmips/dev/zs_hb.c: revision 1.30 Don't use aprint_error(9) for a normal attach message. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.6.1 src/sys/arch/newsmips/dev/zs_hb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/dev/zs_hb.c diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.29 src/sys/arch/newsmips/dev/zs_hb.c:1.29.6.1 --- src/sys/arch/newsmips/dev/zs_hb.c:1.29 Sat Aug 7 16:19:01 2021 +++ src/sys/arch/newsmips/dev/zs_hb.c Sun Nov 5 17:06:14 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_hb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $ */ +/* $NetBSD: zs_hb.c,v 1.29.6.1 2023/11/05 17:06:14 martin Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.29 2021/08/07 16:19:01 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.29.6.1 2023/11/05 17:06:14 martin Exp $"); #include #include @@ -214,7 +214,7 @@ zs_hb_attach(device_t parent, device_t s #endif } - aprint_error(" level %d\n", intlevel); + aprint_normal(" level %d\n", intlevel); zs_delay = zs_hb_delay;
CVS commit: [netbsd-10] src/sys/arch/newsmips/apbus
Module Name:src Committed By: martin Date: Sat Sep 2 16:19:35 UTC 2023 Modified Files: src/sys/arch/newsmips/apbus [netbsd-10]: if_sn.c Log Message: Pull up following revision(s) (requested by andvar in ticket #341): sys/arch/newsmips/apbus/if_sn.c: revision 1.53 newsmips: fix build with SNDEBUG option enabled. It was broken since rev 1.21 24 years ago, and got more broken code later on: remove leftover device_xname(sc->sc_dev) param from aprint_debug_dev in one block. fix wrong method name devoce_xname to device_xname in second block. rename et to eh for consistency, and define it (definition was removed in the past). while here, improve the code with riastradh help to make it safer. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.52.4.1 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.52 src/sys/arch/newsmips/apbus/if_sn.c:1.52.4.1 --- src/sys/arch/newsmips/apbus/if_sn.c:1.52 Sun Sep 18 12:49:34 2022 +++ src/sys/arch/newsmips/apbus/if_sn.c Sat Sep 2 16:19:35 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.52 2022/09/18 12:49:34 thorpej Exp $ */ +/* $NetBSD: if_sn.c,v 1.52.4.1 2023/09/02 16:19:35 martin Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.52 2022/09/18 12:49:34 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.52.4.1 2023/09/02 16:19:35 martin Exp $"); #include "opt_inet.h" @@ -202,7 +202,7 @@ snsetup(struct sn_softc *sc, uint8_t *ll #ifdef SNDEBUG aprint_debug_dev(sc->sc_dev, "buffers: rra=%p cda=%p rda=%p tda=%p\n", - device_xname(sc->sc_dev), sc->p_rra[0], sc->p_cda, + sc->p_rra[0], sc->p_cda, sc->p_rda, sc->mtda[0].mtd_txp); #endif @@ -1033,15 +1033,6 @@ sonic_read(struct sn_softc *sc, void *pk struct ifnet *ifp = >sc_if; struct mbuf *m; -#ifdef SNDEBUG - { - printf("%s: rcvd %p len=%d type=0x%x from %s", - devoce_xname(sc->sc_dev), et, len, htons(et->ether_type), - ether_sprintf(et->ether_shost)); - printf(" (to %s)\n", ether_sprintf(et->ether_dhost)); - } -#endif /* SNDEBUG */ - if (len < (ETHER_MIN_LEN - ETHER_CRC_LEN) || len > (ETHER_MAX_LEN - ETHER_CRC_LEN)) { printf("%s: invalid packet length %d bytes\n", @@ -1049,6 +1040,18 @@ sonic_read(struct sn_softc *sc, void *pk return 0; } +#ifdef SNDEBUG + { + struct ether_header eh_s, *eh = _s; + memcpy(eh, pkt, sizeof(*eh)); + CTASSERT(sizeof(*eh) <= ETHER_MIN_LEN); + printf("%s: rcvd %p len=%d type=0x%x from %s", + device_xname(sc->sc_dev), eh, len, htons(eh->ether_type), + ether_sprintf(eh->ether_shost)); + printf(" (to %s)\n", ether_sprintf(eh->ether_dhost)); + } +#endif /* SNDEBUG */ + m = sonic_get(sc, pkt, len); if (m == NULL) return 0;
CVS commit: [netbsd-10] src/sys/arch/newsmips/apbus
Module Name:src Committed By: martin Date: Sat Sep 2 16:19:35 UTC 2023 Modified Files: src/sys/arch/newsmips/apbus [netbsd-10]: if_sn.c Log Message: Pull up following revision(s) (requested by andvar in ticket #341): sys/arch/newsmips/apbus/if_sn.c: revision 1.53 newsmips: fix build with SNDEBUG option enabled. It was broken since rev 1.21 24 years ago, and got more broken code later on: remove leftover device_xname(sc->sc_dev) param from aprint_debug_dev in one block. fix wrong method name devoce_xname to device_xname in second block. rename et to eh for consistency, and define it (definition was removed in the past). while here, improve the code with riastradh help to make it safer. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.52.4.1 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.