Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2025 16:58:53 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5a8caf9bfae2 - main - bce: make compile with BCE_DEBUG
Message-ID:  <202502021658.512Gwr8K013072@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a8caf9bfae280614ebd98df894a9d895aacd876

commit 5a8caf9bfae280614ebd98df894a9d895aacd876
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-02-02 16:57:01 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-02-02 16:57:01 +0000

    bce: make compile with BCE_DEBUG
    
    Builds now with BCE_DEBUG defined. All bets are of as to whether or not
    it works though. This is not the default, and likely quite a rare config
    given (a) it's been broken for years and (b) this is an old card people
    aren't actively debugging anymore. I don't have the hardware to test it,
    though I've not changed anything in the BCE_DEBUG undefined case.
    
    Sponsored by:           Netflix
---
 sys/dev/bce/if_bce.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c
index b0ba56099135..16bfce5338a7 100644
--- a/sys/dev/bce/if_bce.c
+++ b/sys/dev/bce/if_bce.c
@@ -1594,7 +1594,7 @@ bce_shutdown(device_t dev)
 static u32
 bce_reg_rd(struct bce_softc *sc, u32 offset)
 {
-	u32 val = REG_RD(sc, offset);
+	u32 val = bus_space_read_4(sc->bce_btag, sc->bce_bhandle, offset);
 	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n",
 		__FUNCTION__, offset, val);
 	return val;
@@ -1611,7 +1611,7 @@ bce_reg_wr16(struct bce_softc *sc, u32 offset, u16 val)
 {
 	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%04X\n",
 		__FUNCTION__, offset, val);
-	REG_WR16(sc, offset, val);
+	bus_space_write_2(sc->bce_btag, sc->bce_bhandle, offset, val);
 }
 
 /****************************************************************************/
@@ -1625,7 +1625,7 @@ bce_reg_wr(struct bce_softc *sc, u32 offset, u32 val)
 {
 	DBPRINT(sc, BCE_INSANE_REG, "%s(); offset = 0x%08X, val = 0x%08X\n",
 		__FUNCTION__, offset, val);
-	REG_WR(sc, offset, val);
+	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, offset, val);
 }
 #endif
 
@@ -5780,7 +5780,7 @@ bce_fill_rx_chain(struct bce_softc *sc)
 	/* We should never end up pointing to a next page pointer. */
 	DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE),
 	    BCE_PRINTF("%s(): Invalid rx_prod value: 0x%04X\n",
-	    __FUNCTION__, rx_prod));
+	    __FUNCTION__, sc->rx_prod));
 
 	/* Write the mailbox and tell the chip about the waiting rx_bd's. */
 	REG_WR16(sc, MB_GET_CID_ADDR(RX_CID) + BCE_L2MQ_RX_HOST_BDIDX, prod);
@@ -5944,7 +5944,7 @@ bce_fill_pg_chain(struct bce_softc *sc)
 
 	DBRUNIF(((prod & USABLE_RX_BD_PER_PAGE) == USABLE_RX_BD_PER_PAGE),
 	    BCE_PRINTF("%s(): Invalid pg_prod value: 0x%04X\n",
-	    __FUNCTION__, pg_prod));
+	    __FUNCTION__, sc->pg_prod));
 
 	/*
 	 * Write the mailbox and tell the chip about
@@ -9030,7 +9030,7 @@ bce_add_sysctls(struct bce_softc *sc)
 	    CTLFLAG_RW, &bootcode_running_failure_sim_control,
 	    0, "Debug control to force bootcode running failures");
 
-	SYSCTL_ADD_INT(ctx, children, OID_AUTO,
+	SYSCTL_ADD_U16(ctx, children, OID_AUTO,
 	    "rx_low_watermark",
 	    CTLFLAG_RD, &sc->rx_low_watermark,
 	    0, "Lowest level of free rx_bd's");
@@ -9040,7 +9040,7 @@ bce_add_sysctls(struct bce_softc *sc)
 	    CTLFLAG_RD, &sc->rx_empty_count,
 	    "Number of times the RX chain was empty");
 
-	SYSCTL_ADD_INT(ctx, children, OID_AUTO,
+	SYSCTL_ADD_U16(ctx, children, OID_AUTO,
 	    "tx_hi_watermark",
 	    CTLFLAG_RD, &sc->tx_hi_watermark,
 	    0, "Highest level of used tx_bd's");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502021658.512Gwr8K013072>