Lines Matching +full:fw +full:- +full:cfg
1 /* SPDX-License-Identifier: BSD-3-Clause */
59 static int ice_reconfig_fw_log(struct ice_softc *sc, struct ice_fwlog_cfg *cfg);
70 * ice_reconfig_fw_log - Re-program firmware logging configuration
72 * @cfg: firmware log configuration to latch
76 * case, ice_init_hw() will re-configure firmware logging as soon as it brings
80 ice_reconfig_fw_log(struct ice_softc *sc, struct ice_fwlog_cfg *cfg)
84 ice_fwlog_init(&sc->hw, cfg);
86 if (!ice_check_sq_alive(&sc->hw, &sc->hw.adminq))
89 if (!ice_fwlog_supported(&sc->hw))
92 status = ice_fwlog_set(&sc->hw, cfg);
94 device_printf(sc->dev,
97 ice_aq_str(sc->hw.adminq.sq_last_status));
111 "\n0 - Enable firmware reporting via ARQ" \
112 "\n1 - Disable firmware reporting via ARQ"
116 "\n0 - Enable firmware reporting via UART" \
117 "\n1 - Disable firmware reporting via UART"
121 "\n0 - Enable firmware logging during attach phase" \
122 "\n1 - Disable firmware logging during attach phase"
126 "\n0 - Enable firmware logging" \
127 "\n1 - Disable firmware logging"
131 "\n\tverbose <4> - Verbose messages + (Error|Warning|Normal)" \
132 "\n\tnormal <3> - Normal messages + (Error|Warning)" \
133 "\n\twarning <2> - Warning messages + (Error)" \
134 "\n\terror <1> - Error messages" \
135 "\n\tnone <0> - Disables all logging for this module"
138 * ice_sysctl_fwlog_set_cfg_options - Sysctl for setting fwlog cfg options
153 struct ice_fwlog_cfg *cfg = &sc->hw.fwlog_cfg;
158 enabled = !!(cfg->options & option);
161 if ((error) || (req->newptr == NULL))
165 cfg->options |= option;
167 cfg->options &= ~option;
169 return ice_reconfig_fw_log(sc, cfg);
173 * ice_sysctl_fwlog_log_resolution - Sysctl for setting log message resolution
188 struct ice_fwlog_cfg *cfg = &sc->hw.fwlog_cfg;
194 resolution = cfg->log_resolution;
197 if ((error) || (req->newptr == NULL))
202 device_printf(sc->dev, "Log resolution out-of-bounds\n");
206 cfg->log_resolution = resolution;
208 return ice_reconfig_fw_log(sc, cfg);
212 * ice_sysctl_fwlog_register - Sysctl for (de)registering firmware logs
225 struct ice_fwlog_cfg *cfg = &sc->hw.fwlog_cfg;
232 if (ice_test_state(&sc->state, ICE_STATE_ATTACHING)) {
233 device_printf(sc->dev, "Registering FW Logging via kenv is supported with the on_load option\n");
237 if (cfg->options & ICE_FWLOG_OPTION_IS_REGISTERED)
243 if ((error) || (req->newptr == NULL))
246 if (!ice_check_sq_alive(&sc->hw, &sc->hw.adminq))
250 status = ice_fwlog_register(&sc->hw);
252 ice_set_bit(ICE_FEATURE_FW_LOGGING, sc->feat_en);
254 status = ice_fwlog_unregister(&sc->hw);
256 ice_clear_bit(ICE_FEATURE_FW_LOGGING, sc->feat_en);
266 * ice_sysctl_fwlog_module_log_severity - Add tunables for a FW logging module
276 struct ice_fwlog_cfg *cfg = &sc->hw.fwlog_cfg;
285 log_level = cfg->module_entries[module].log_level;
292 if ((error) || (req->newptr == NULL))
315 ll_num = -1;
320 device_printf(sc->dev,
327 cfg->module_entries[module].log_level = log_level;
329 return ice_reconfig_fw_log(sc, cfg);
333 * ice_add_fw_logging_tunables - Add tunables to configure FW logging events
347 struct ice_hw *hw = &sc->hw;
348 struct ice_fwlog_cfg *cfg;
349 device_t dev = sc->dev;
353 cfg = &hw->fwlog_cfg;
372 hw->pf_id = ice_get_pf_id(hw);
373 if (hw->pf_id == 0) {
382 cfg->module_entries[i].module_id = i;
383 cfg->module_entries[i].log_level = ICE_FWLOG_LEVEL_NONE;
393 cfg->log_resolution = 10;
399 cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA;
413 * ice_handle_fw_log_event - Handle a firmware logging event from the AdminQ
423 SDT_PROBE2(ice_fwlog, , , message, (const u8 *)buf, desc->datalen);
426 ice_fwlog_event_dump(&sc->hw, desc, buf);