Lines Matching defs:cfg
39 * @cfg: config to cache
41 static void cache_cfg(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
43 hw->fwlog_cfg = *cfg;
91 * @cfg: config to validate
93 static bool valid_cfg(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
95 if (!cfg) {
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,
118 * @cfg: config used to initialize the cached structures
125 ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
127 if (!valid_cfg(hw, cfg))
130 cache_cfg(hw, cfg);
170 cmd->ops.cfg.log_resolution = CPU_TO_LE16(log_resolution);
171 cmd->ops.cfg.mdl_cnt = CPU_TO_LE16(num_entries);
202 * @cfg: config used to set firmware logging
213 ice_fwlog_set(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
220 if (!valid_cfg(hw, cfg))
223 status = ice_aq_fwlog_set(hw, cfg->module_entries,
224 ICE_AQC_FW_LOG_ID_MAX, cfg->options,
225 cfg->log_resolution);
227 cache_cfg(hw, cfg);
277 struct ice_fwlog_cfg *cfg;
286 cfg = (struct ice_fwlog_cfg *)ice_calloc(hw, 1, sizeof(*cfg));
287 if (!cfg)
290 status = ice_fwlog_get(hw, cfg);
294 status = ice_aq_fwlog_set(hw, entries, num_entries, cfg->options,
295 cfg->log_resolution);
300 ice_free(hw, cfg);
367 * @cfg: firmware logging configuration to populate
370 ice_aq_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
379 ice_memset(cfg, 0, sizeof(*cfg), ICE_NONDMA_MEM);
396 module_id_cnt = LE16_TO_CPU(cmd->ops.cfg.mdl_cnt);
406 cfg->log_resolution = LE16_TO_CPU(cmd->ops.cfg.log_resolution);
408 cfg->options |= ICE_FWLOG_OPTION_ARQ_ENA;
410 cfg->options |= ICE_FWLOG_OPTION_UART_ENA;
412 cfg->options |= ICE_FWLOG_OPTION_IS_REGISTERED;
419 cfg->module_entries[i].module_id =
421 cfg->module_entries[i].log_level = fw_module->log_level;
441 struct ice_fwlog_cfg *cfg;
446 cfg = (struct ice_fwlog_cfg *)ice_calloc(hw, 1, sizeof(*cfg));
447 if (!cfg)
454 status = ice_aq_fwlog_get(hw, cfg);
461 ice_free(hw, cfg);
467 * @cfg: config to populate based on current firmware logging settings
470 ice_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg)
477 if (!cfg)
480 status = ice_aq_fwlog_get(hw, cfg);
484 cache_cfg(hw, cfg);