Module Name: src Committed By: martin Date: Mon Nov 16 18:18:15 UTC 2020
Modified Files: src/sys/dev/pci [netbsd-8]: if_wm.c Log Message: Pull up following revision(s) (requested by rin in ticket #1623): sys/dev/pci/if_wm.c: revision 1.696 Fix little-endian dependence in wm_rxeof(), by which packets cannot be received by 82574 and successors on big-endian machines. Tested by aarch64eb with I210-T1 on ROCKPro64. Thanks msaitoh for discussion! XXX pullup to netbsd-9 and netbsd-8 To generate a diff of this commit: cvs rdiff -u -r1.508.4.41 -r1.508.4.42 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.508.4.41 src/sys/dev/pci/if_wm.c:1.508.4.42 --- src/sys/dev/pci/if_wm.c:1.508.4.41 Wed Nov 4 11:51:57 2020 +++ src/sys/dev/pci/if_wm.c Mon Nov 16 18:18:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.508.4.41 2020/11/04 11:51:57 martin Exp $ */ +/* $NetBSD: if_wm.c,v 1.508.4.42 2020/11/16 18:18:14 martin Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.41 2020/11/04 11:51:57 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.42 2020/11/16 18:18:14 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -8790,9 +8790,11 @@ wm_rxdesc_get_status(struct wm_rxqueue * struct wm_softc *sc = rxq->rxq_sc; if (sc->sc_type == WM_T_82574) - return EXTRXC_STATUS(rxq->rxq_ext_descs[idx].erx_ctx.erxc_err_stat); + return EXTRXC_STATUS( + le32toh(rxq->rxq_ext_descs[idx].erx_ctx.erxc_err_stat)); else if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) - return NQRXC_STATUS(rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_err_stat); + return NQRXC_STATUS( + le32toh(rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_err_stat)); else return rxq->rxq_descs[idx].wrx_status; } @@ -8803,9 +8805,11 @@ wm_rxdesc_get_errors(struct wm_rxqueue * struct wm_softc *sc = rxq->rxq_sc; if (sc->sc_type == WM_T_82574) - return EXTRXC_ERROR(rxq->rxq_ext_descs[idx].erx_ctx.erxc_err_stat); + return EXTRXC_ERROR( + le32toh(rxq->rxq_ext_descs[idx].erx_ctx.erxc_err_stat)); else if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) - return NQRXC_ERROR(rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_err_stat); + return NQRXC_ERROR( + le32toh(rxq->rxq_nq_descs[idx].nqrx_ctx.nrxc_err_stat)); else return rxq->rxq_descs[idx].wrx_errors; }