aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bxe
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2014-10-21 07:31:21 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2014-10-21 07:31:21 +0000
commitf0188618f2abe08246731cf09b0b0a99609fd34c (patch)
treeee67959a46304c59df434799575e3820a2cc841f /sys/dev/bxe
parent7eb884645c96add0d48c306ae9ecb053af2623f7 (diff)
downloadsrc-f0188618f2abe08246731cf09b0b0a99609fd34c.tar.gz
src-f0188618f2abe08246731cf09b0b0a99609fd34c.zip
Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=273377
Diffstat (limited to 'sys/dev/bxe')
-rw-r--r--sys/dev/bxe/bxe.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index ac20d781f608..a27b3e7a56bd 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -16216,7 +16216,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
"version");
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version",
- CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0,
+ CTLFLAG_RD, sc->devinfo.bc_ver_str, 0,
"bootcode version");
snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d",
@@ -16225,7 +16225,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
BCM_5710_FW_REVISION_VERSION,
BCM_5710_FW_ENGINEERING_VERSION);
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version",
- CTLFLAG_RD, &sc->fw_ver_str, 0,
+ CTLFLAG_RD, sc->fw_ver_str, 0,
"firmware version");
snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s",
@@ -16235,7 +16235,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
(sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" :
"Unknown"));
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode",
- CTLFLAG_RD, &sc->mf_mode_str, 0,
+ CTLFLAG_RD, sc->mf_mode_str, 0,
"multifunction mode");
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics",
@@ -16243,7 +16243,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
"multifunction vnics per port");
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr",
- CTLFLAG_RD, &sc->mac_addr_str, 0,
+ CTLFLAG_RD, sc->mac_addr_str, 0,
"mac address");
snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d",
@@ -16253,12 +16253,12 @@ bxe_add_sysctls(struct bxe_softc *sc)
"???GT/s"),
sc->devinfo.pcie_link_width);
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link",
- CTLFLAG_RD, &sc->pci_link_str, 0,
+ CTLFLAG_RD, sc->pci_link_str, 0,
"pci link status");
sc->debug = bxe_debug;
- SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug",
- CTLFLAG_RW, &sc->debug, 0,
+ SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug",
+ CTLFLAG_RW, &sc->debug,
"debug logging mode");
sc->rx_budget = bxe_rx_budget;