Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bnxt/bnxt_sysctl.c
Context not available. | |||||
return ENOMEM; | return ENOMEM; | ||||
} | } | ||||
sysctl_ctx_init(&softc->flow_ctrl_ctx); | |||||
ctx = device_get_sysctl_ctx(softc->dev); | |||||
softc->flow_ctrl_oid = SYSCTL_ADD_NODE(ctx, | |||||
SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, | |||||
"fc", CTLFLAG_RD, 0, "flow ctrl"); | |||||
if (!softc->flow_ctrl_oid) { | |||||
sysctl_ctx_free(&softc->flow_ctrl_ctx); | |||||
return ENOMEM; | |||||
} | |||||
return 0; | return 0; | ||||
} | } | ||||
Context not available. | |||||
softc->hw_lro_oid = NULL; | softc->hw_lro_oid = NULL; | ||||
} | } | ||||
if (softc->flow_ctrl_oid != NULL) { | |||||
orc = sysctl_ctx_free(&softc->flow_ctrl_ctx); | |||||
if (orc) | |||||
rc = orc; | |||||
else | |||||
softc->flow_ctrl_oid = NULL; | |||||
} | |||||
return rc; | return rc; | ||||
} | } | ||||
Context not available. | |||||
BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_aggs, max_aggs) | BNXT_HW_LRO_FN(bnxt_hw_lro_set_max_aggs, max_aggs) | ||||
BNXT_HW_LRO_FN(bnxt_hw_lro_set_min_agg_len, min_agg_len) | BNXT_HW_LRO_FN(bnxt_hw_lro_set_min_agg_len, min_agg_len) | ||||
#define BNXT_FLOW_CTRL_FN(fn_name, arg) \ | |||||
static int \ | |||||
fn_name(SYSCTL_HANDLER_ARGS) { \ | |||||
struct bnxt_softc *softc = arg1; \ | |||||
int rc; \ | |||||
int val; \ | |||||
\ | |||||
if (softc == NULL) \ | |||||
return EBUSY; \ | |||||
\ | |||||
val = softc->link_info.flow_ctrl.arg; \ | |||||
rc = sysctl_handle_int(oidp, &val, 0, req); \ | |||||
if (rc || !req->newptr) \ | |||||
return rc; \ | |||||
\ | |||||
if (val) \ | |||||
val = 1; \ | |||||
\ | |||||
if (softc->link_info.flow_ctrl.arg != val) { \ | |||||
softc->link_info.flow_ctrl.arg = val; \ | |||||
rc = bnxt_hwrm_set_link_setting(softc, true, false, false);\ | |||||
rc = bnxt_hwrm_port_phy_qcfg(softc); \ | |||||
} \ | |||||
\ | |||||
return rc; \ | |||||
} | |||||
BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_tx, tx) | |||||
BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_rx, rx) | |||||
BNXT_FLOW_CTRL_FN(bnxt_flow_ctrl_autoneg, autoneg) | |||||
int | int | ||||
bnxt_create_pause_fc_sysctls(struct bnxt_softc *softc) | |||||
{ | |||||
struct sysctl_oid *oid = softc->flow_ctrl_oid; | |||||
if (!oid) | |||||
return ENOMEM; | |||||
SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, | |||||
"pause_tx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, | |||||
bnxt_flow_ctrl_tx, "A", | |||||
"Enable or Disable Tx Flow Ctrl: 0 / 1"); | |||||
SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, | |||||
"pause_rx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, | |||||
bnxt_flow_ctrl_rx, "A", | |||||
"Enable or Disable Tx Flow Ctrl: 0 / 1"); | |||||
SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, | |||||
"pause_autoneg", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, | |||||
shurd: Is the word "pause" required in these names? If so, perhaps it should be in the partent oid… | |||||
Not Done Inline ActionsTaken care by removing prefix pause_. bhargava.marreddy_broadcom.com: Taken care by removing prefix pause_.
But not added it in parent oid as it is defined as "fc". | |||||
bnxt_flow_ctrl_autoneg, "A", | |||||
"Enable or Disable Autoneg Flow Ctrl: 0 / 1"); | |||||
return 0; | |||||
} | |||||
int | |||||
bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc) | bnxt_create_hw_lro_sysctls(struct bnxt_softc *softc) | ||||
{ | { | ||||
struct sysctl_oid *oid = softc->hw_lro_oid; | struct sysctl_oid *oid = softc->hw_lro_oid; | ||||
Context not available. |
Is the word "pause" required in these names? If so, perhaps it should be in the partent oid name since it's a prefix to all values under it?