cxgbe(4): Add core Vdd to the sysctl MIB.

Sponsored by:	Chelsio Communications
This commit is contained in:
np 2017-11-17 23:22:39 +00:00
parent 2234692101
commit 81d724e890
2 changed files with 9 additions and 1 deletions

View File

@ -332,6 +332,7 @@ struct adapter_params {
struct devlog_params devlog; /* PF-only */
struct rss_params rss; /* VF-only */
struct vf_resources vfres; /* VF-only */
unsigned int core_vdd;
unsigned int sf_size; /* serial flash size in bytes */
unsigned int sf_nsec; /* # of flash sectors */

View File

@ -3435,7 +3435,10 @@ get_params__post_init(struct adapter *sc)
param[3] = FW_PARAM_PFVF(FILTER_END);
param[4] = FW_PARAM_PFVF(L2T_START);
param[5] = FW_PARAM_PFVF(L2T_END);
rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 6, param, val);
param[6] = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) |
V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_VDD);
rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 7, param, val);
if (rc != 0) {
device_printf(sc->dev,
"failed to query parameters (post_init): %d.\n", rc);
@ -3453,6 +3456,7 @@ get_params__post_init(struct adapter *sc)
KASSERT(sc->vres.l2t.size <= L2T_SIZE,
("%s: L2 table size (%u) larger than expected (%u)",
__func__, sc->vres.l2t.size, L2T_SIZE));
sc->params.core_vdd = val[6];
/*
* MPSBGMAP is queried separately because only recent firmwares support
@ -5160,6 +5164,9 @@ t4_sysctls(struct adapter *sc)
CTLFLAG_RD, sc, 0, sysctl_temperature, "I",
"chip temperature (in Celsius)");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD,
&sc->params.core_vdd, 0, "core Vdd (in mV)");
#ifdef SBUF_DRAIN
/*
* dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload.