// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022, Intel Corporation. */ #include <linux/vmalloc.h> #include "ice.h" #include "ice_common.h" #include "ice_fwlog.h" bool ice_fwlog_ring_full(struct ice_fwlog_ring *rings) { … } bool ice_fwlog_ring_empty(struct ice_fwlog_ring *rings) { … } void ice_fwlog_ring_increment(u16 *item, u16 size) { … } static int ice_fwlog_alloc_ring_buffs(struct ice_fwlog_ring *rings) { … } static void ice_fwlog_free_ring_buffs(struct ice_fwlog_ring *rings) { … } #define ICE_FWLOG_INDEX_TO_BYTES(n) … /** * ice_fwlog_realloc_rings - reallocate the FW log rings * @hw: pointer to the HW structure * @index: the new index to use to allocate memory for the log data * */ void ice_fwlog_realloc_rings(struct ice_hw *hw, int index) { … } /** * ice_fwlog_init - Initialize FW logging configuration * @hw: pointer to the HW structure * * This function should be called on driver initialization during * ice_init_hw(). */ int ice_fwlog_init(struct ice_hw *hw) { … } /** * ice_fwlog_deinit - unroll FW logging configuration * @hw: pointer to the HW structure * * This function should be called in ice_deinit_hw(). */ void ice_fwlog_deinit(struct ice_hw *hw) { … } /** * ice_fwlog_supported - Cached for whether FW supports FW logging or not * @hw: pointer to the HW structure * * This will always return false if called before ice_init_hw(), so it must be * called after ice_init_hw(). */ bool ice_fwlog_supported(struct ice_hw *hw) { … } /** * ice_aq_fwlog_set - Set FW logging configuration AQ command (0xFF30) * @hw: pointer to the HW structure * @entries: entries to configure * @num_entries: number of @entries * @options: options from ice_fwlog_cfg->options structure * @log_resolution: logging resolution */ static int ice_aq_fwlog_set(struct ice_hw *hw, struct ice_fwlog_module_entry *entries, u16 num_entries, u16 options, u16 log_resolution) { … } /** * ice_fwlog_set - Set the firmware logging settings * @hw: pointer to the HW structure * @cfg: config used to set firmware logging * * This function should be called whenever the driver needs to set the firmware * logging configuration. It can be called on initialization, reset, or during * runtime. * * If the PF wishes to receive FW logging then it must register via * ice_fwlog_register. Note, that ice_fwlog_register does not need to be called * for init. */ int ice_fwlog_set(struct ice_hw *hw, struct ice_fwlog_cfg *cfg) { … } /** * ice_aq_fwlog_get - Get the current firmware logging configuration (0xFF32) * @hw: pointer to the HW structure * @cfg: firmware logging configuration to populate */ static int ice_aq_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg) { … } /** * ice_fwlog_get - Get the firmware logging settings * @hw: pointer to the HW structure * @cfg: config to populate based on current firmware logging settings */ int ice_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg) { … } /** * ice_aq_fwlog_register - Register PF for firmware logging events (0xFF31) * @hw: pointer to the HW structure * @reg: true to register and false to unregister */ static int ice_aq_fwlog_register(struct ice_hw *hw, bool reg) { … } /** * ice_fwlog_register - Register the PF for firmware logging * @hw: pointer to the HW structure * * After this call the PF will start to receive firmware logging based on the * configuration set in ice_fwlog_set. */ int ice_fwlog_register(struct ice_hw *hw) { … } /** * ice_fwlog_unregister - Unregister the PF from firmware logging * @hw: pointer to the HW structure */ int ice_fwlog_unregister(struct ice_hw *hw) { … } /** * ice_fwlog_set_supported - Set if FW logging is supported by FW * @hw: pointer to the HW struct * * If FW returns success to the ice_aq_fwlog_get call then it supports FW * logging, else it doesn't. Set the fwlog_supported flag accordingly. * * This function is only meant to be called during driver init to determine if * the FW support FW logging. */ void ice_fwlog_set_supported(struct ice_hw *hw) { … }