Lines Matching +full:firmware +full:- +full:based
1 /* SPDX-License-Identifier: BSD-3-Clause */
37 * cache_cfg - Cache FW logging config
43 hw->fwlog_cfg = *cfg;
47 * valid_module_entries - validate all the module entry IDs and log levels
64 ice_debug(hw, ICE_DBG_FW_LOG, "num_entries must be non-zero\n");
71 if (entry->module_id >= ICE_AQC_FW_LOG_ID_MAX) {
73 entry->module_id, ICE_AQC_FW_LOG_ID_MAX - 1);
77 if (entry->log_level >= ICE_FWLOG_LEVEL_INVALID) {
79 entry->log_level,
80 ICE_AQC_FW_LOG_ID_MAX - 1);
89 * valid_cfg - validate entire configuration
100 if (cfg->log_resolution < ICE_AQC_FW_LOG_MIN_RESOLUTION ||
101 cfg->log_resolution > ICE_AQC_FW_LOG_MAX_RESOLUTION) {
103 cfg->log_resolution, ICE_AQC_FW_LOG_MIN_RESOLUTION,
108 if (!valid_module_entries(hw, cfg->module_entries,
116 * ice_fwlog_init - Initialize cached structures for tracking FW logging
121 * ice_init_hw(). Firmware logging will be configured based on these settings
136 * ice_aq_fwlog_set - Set FW logging configuration AQ command (0xFF30)
140 * @options: options from ice_fwlog_cfg->options structure
169 cmd->cmd_flags = ICE_AQC_FW_LOG_CONF_SET_VALID;
170 cmd->ops.cfg.log_resolution = CPU_TO_LE16(log_resolution);
171 cmd->ops.cfg.mdl_cnt = CPU_TO_LE16(num_entries);
174 cmd->cmd_flags |= ICE_AQC_FW_LOG_CONF_AQ_EN;
176 cmd->cmd_flags |= ICE_AQC_FW_LOG_CONF_UART_EN;
188 * ice_fwlog_supported - Cached for whether FW supports FW logging or not
196 return hw->fwlog_support_ena;
200 * ice_fwlog_set - Set the firmware logging settings
202 * @cfg: config used to set firmware logging
204 * This function should be called whenever the driver needs to set the firmware
223 status = ice_aq_fwlog_set(hw, cfg->module_entries,
224 ICE_AQC_FW_LOG_ID_MAX, cfg->options,
225 cfg->log_resolution);
233 * update_cached_entries - Update module entries in cached FW logging config
250 &hw->fwlog_cfg.module_entries[j];
252 if (cached->module_id == updated->module_id) {
253 cached->log_level = updated->log_level;
261 * ice_fwlog_update_modules - Update the log level 1 or more FW logging modules
269 * Only the entries passed in will be affected. All other firmware logging
294 status = ice_aq_fwlog_set(hw, entries, num_entries, cfg->options,
295 cfg->log_resolution);
305 * ice_aq_fwlog_register - Register PF for firmware logging events (0xFF31)
322 * ice_fwlog_register - Register the PF for firmware logging
325 * After this call the PF will start to receive firmware logging based on the
337 ice_debug(hw, ICE_DBG_FW_LOG, "Failed to register for firmware logging events over ARQ\n");
339 hw->fwlog_cfg.options |= ICE_FWLOG_OPTION_IS_REGISTERED;
345 * ice_fwlog_unregister - Unregister the PF from firmware logging
357 ice_debug(hw, ICE_DBG_FW_LOG, "Failed to unregister from firmware logging events over ARQ\n");
359 hw->fwlog_cfg.options &= ~ICE_FWLOG_OPTION_IS_REGISTERED;
365 * ice_aq_fwlog_get - Get the current firmware logging configuration (0xFF32)
367 * @cfg: firmware logging configuration to populate
388 cmd->cmd_flags = ICE_AQC_FW_LOG_AQ_QUERY;
396 module_id_cnt = LE16_TO_CPU(cmd->ops.cfg.mdl_cnt);
406 cfg->log_resolution = LE16_TO_CPU(cmd->ops.cfg.log_resolution);
407 if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_AQ_EN)
408 cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA;
409 if (cmd->cmd_flags & ICE_AQC_FW_LOG_CONF_UART_EN)
410 cfg->options |= ICE_FWLOG_OPTION_UART_ENA;
411 if (cmd->cmd_flags & ICE_AQC_FW_LOG_QUERY_REGISTERED)
412 cfg->options |= ICE_FWLOG_OPTION_IS_REGISTERED;
419 cfg->module_entries[i].module_id =
420 LE16_TO_CPU(fw_module->module_identifier);
421 cfg->module_entries[i].log_level = fw_module->log_level;
430 * ice_fwlog_set_support_ena - Set if FW logging is supported by FW
444 hw->fwlog_support_ena = false;
459 hw->fwlog_support_ena = true;
465 * ice_fwlog_get - Get the firmware logging settings
467 * @cfg: config to populate based on current firmware logging settings
490 * ice_fwlog_event_dump - Dump the event received over the Admin Receive Queue
504 ice_info_fwlog(hw, 32, 1, (u8 *)buf, LE16_TO_CPU(desc->datalen));