Module Name: src Committed By: isaki Date: Sun Dec 31 03:19:22 UTC 2023
Modified Files: src/sys/dev/ic: rtl80x9.c Log Message: ne(4): Write CR0 properly. Writing 0b000 to RD2-0 in CR0 appears harmless, but it is "not allowed" by the RTL8019AS (and several NE2000 derived) datasheets. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/rtl80x9.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/rtl80x9.c diff -u src/sys/dev/ic/rtl80x9.c:1.18 src/sys/dev/ic/rtl80x9.c:1.19 --- src/sys/dev/ic/rtl80x9.c:1.18 Thu Apr 25 10:44:52 2019 +++ src/sys/dev/ic/rtl80x9.c Sun Dec 31 03:19:22 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $ */ +/* $NetBSD: rtl80x9.c,v 1.19 2023/12/31 03:19:22 isaki Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.19 2023/12/31 03:19:22 isaki Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -170,7 +170,8 @@ rtl80x9_media_init(struct dp8390_softc * aprint_normal_dev(sc->sc_dev, "10base2, 10baseT, 10baseT-FDX, auto, default "); - bus_space_write_1(sc->sc_regt, sc->sc_regh, ED_P0_CR, ED_CR_PAGE_3); + bus_space_write_1(sc->sc_regt, sc->sc_regh, ED_P0_CR, + sc->cr_proto | ED_CR_PAGE_3); conf2 = bus_space_read_1(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG2); conf3 = bus_space_read_1(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG3); @@ -201,7 +202,8 @@ rtl80x9_media_init(struct dp8390_softc * break; } - bus_space_write_1(sc->sc_regt, sc->sc_regh, ED_P0_CR, ED_CR_PAGE_0); + bus_space_write_1(sc->sc_regt, sc->sc_regh, ED_P0_CR, + sc->cr_proto | ED_CR_PAGE_0); ifmedia_init(&sc->sc_media, 0, dp8390_mediachange, dp8390_mediastatus); for (i = 0; i < rtl80x9_nmedia; i++)