git: 175b2c00a6bc - main - Fix bnxt build in LINT

From: Warner Losh <imp_at_FreeBSD.org>
Date: Wed, 29 May 2024 15:50:31 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=175b2c00a6bcb0c8c1f6b76b6da9bf4879a5848e

commit 175b2c00a6bcb0c8c1f6b76b6da9bf4879a5848e
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-05-29 15:45:47 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-29 15:49:53 +0000

    Fix bnxt build in LINT
    
    LINT includes bnxt_re driver. Adjust the path in files, add missing
    files and add a new BNXT_C to build (which thinly wraps OFED version
    with bnxt specicif stuff).
    
    Sponsored by:           Netflix
    Fixes: acd884dec99a ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
---
 sys/conf/files                    | 13 ++++++++-----
 sys/conf/kern.pre.mk              |  4 ++++
 sys/modules/bnxt/bnxt_re/Makefile |  2 +-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/sys/conf/files b/sys/conf/files
index 56c92f51947f..fec92518c498 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1327,11 +1327,14 @@ dev/bhnd/siba/siba_bhndb.c		optional siba bhnd bhndb
 dev/bhnd/siba/siba_erom.c		optional siba bhnd
 dev/bhnd/siba/siba_subr.c		optional siba bhnd
 #
-dev/bnxt/bnxt_hwrm.c		optional bnxt iflib pci
-dev/bnxt/bnxt_mgmt.c		optional bnxt iflib pci
-dev/bnxt/bnxt_sysctl.c		optional bnxt iflib pci
-dev/bnxt/bnxt_txrx.c		optional bnxt iflib pci
-dev/bnxt/if_bnxt.c		optional bnxt iflib pci
+dev/bnxt/bnxt_en/bnxt_auxbus_compat.c	optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_dcb.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_hwrm.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_mgmt.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_sysctl.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_txrx.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/bnxt_ulp.c		optional bnxt iflib pci compile-with "${BNXT_C}"
+dev/bnxt/bnxt_en/if_bnxt.c		optional bnxt iflib pci compile-with "${BNXT_C}"
 dev/bwi/bwimac.c		optional bwi
 dev/bwi/bwiphy.c		optional bwi
 dev/bwi/bwirf.c			optional bwi
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 567c68e5887e..53b9862f2145 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -335,6 +335,10 @@ MLXFW_C=	${OFED_C_NOIMP} \
 		-I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
 		-I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
 		${.IMPSRC}
+# BNXT Driver
+BNXT_CFLAGS=	-I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS}
+BNXT_C_NOIMP=	${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR}
+BNXT_C=		${BNXT_C_NOIMP} ${.IMPSRC}
 
 GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
 SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
diff --git a/sys/modules/bnxt/bnxt_re/Makefile b/sys/modules/bnxt/bnxt_re/Makefile
index 2e1dbc048dfb..d6aa701dbae6 100644
--- a/sys/modules/bnxt/bnxt_re/Makefile
+++ b/sys/modules/bnxt/bnxt_re/Makefile
@@ -8,7 +8,7 @@ SRCS	+= qplib_res.c qplib_res.h
 SRCS	+= qplib_rcfw.c qplib_rcfw.h
 SRCS	+= stats.c stats.h
 SRCS	+= main.c bnxt_re.h
-SRCS	+= opt_inet.h opt_inet6.h
+SRCS	+= opt_inet.h opt_inet6.h opt_ratelimit.h
 SRCS	+= ${LINUXKPI_GENSRCS}
 
 CFLAGS+= -I${SRCTOP}/sys/dev/bnxt/bnxt_en