diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_fwlog.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_fwlog.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_fwlog.c b/drivers/net/ethernet/intel/ice/ice_fwlog.c index a010f655ffb7..b1c1359d5ab5 100644 --- a/drivers/net/ethernet/intel/ice/ice_fwlog.c +++ b/drivers/net/ethernet/intel/ice/ice_fwlog.c @@ -73,13 +73,11 @@ static void ice_fwlog_free_ring_buffs(struct ice_fwlog_ring *rings) #define ICE_FWLOG_INDEX_TO_BYTES(n) ((128 * 1024) << (n)) /** * ice_fwlog_realloc_rings - reallocate the FW log rings - * @hw: pointer to the HW structure * @fwlog: pointer to the fwlog structure * @index: the new index to use to allocate memory for the log data * */ -void ice_fwlog_realloc_rings(struct ice_hw *hw, struct ice_fwlog *fwlog, - int index) +void ice_fwlog_realloc_rings(struct ice_fwlog *fwlog, int index) { struct ice_fwlog_ring ring; int status, ring_size; @@ -109,7 +107,7 @@ void ice_fwlog_realloc_rings(struct ice_hw *hw, struct ice_fwlog *fwlog, status = ice_fwlog_alloc_ring_buffs(&ring); if (status) { - dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log ring data buffers\n"); + dev_warn(&fwlog->pdev->dev, "Unable to allocate memory for FW log ring data buffers\n"); ice_fwlog_free_ring_buffs(&ring); kfree(ring.rings); return; @@ -165,16 +163,16 @@ static int ice_aq_fwlog_get(struct ice_hw *hw, struct ice_fwlog_cfg *cfg) status = ice_aq_send_cmd(hw, &desc, buf, ICE_AQ_MAX_BUF_LEN, NULL); if (status) { - ice_debug(hw, ICE_DBG_FW_LOG, "Failed to get FW log configuration\n"); + dev_dbg(&hw->fwlog.pdev->dev, "Failed to get FW log configuration\n"); goto status_out; } module_id_cnt = le16_to_cpu(cmd->ops.cfg.mdl_cnt); if (module_id_cnt < ICE_AQC_FW_LOG_ID_MAX) { - ice_debug(hw, ICE_DBG_FW_LOG, "FW returned less than the expected number of FW log module IDs\n"); + dev_dbg(&hw->fwlog.pdev->dev, "FW returned less than the expected number of FW log module IDs\n"); } else if (module_id_cnt > ICE_AQC_FW_LOG_ID_MAX) { - ice_debug(hw, ICE_DBG_FW_LOG, "FW returned more than expected number of FW log module IDs, setting module_id_cnt to software expected max %u\n", - ICE_AQC_FW_LOG_ID_MAX); + dev_dbg(&hw->fwlog.pdev->dev, "FW returned more than expected number of FW log module IDs, setting module_id_cnt to software expected max %u\n", + ICE_AQC_FW_LOG_ID_MAX); module_id_cnt = ICE_AQC_FW_LOG_ID_MAX; } @@ -225,8 +223,8 @@ static void ice_fwlog_set_supported(struct ice_hw *hw, struct ice_fwlog *fwlog) status = ice_aq_fwlog_get(hw, cfg); if (status) - ice_debug(hw, ICE_DBG_FW_LOG, "ice_aq_fwlog_get failed, FW logging is not supported on this version of FW, status %d\n", - status); + dev_dbg(&fwlog->pdev->dev, "ice_aq_fwlog_get failed, FW logging is not supported on this version of FW, status %d\n", + status); else fwlog->supported = true; @@ -237,17 +235,20 @@ static void ice_fwlog_set_supported(struct ice_hw *hw, struct ice_fwlog *fwlog) * ice_fwlog_init - Initialize FW logging configuration * @hw: pointer to the HW structure * @fwlog: pointer to the fwlog structure + * @pdev: pointer to the pci dev used in dev_warn() * * This function should be called on driver initialization during * ice_init_hw(). */ -int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog) +int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog, + struct pci_dev *pdev) { /* only support fw log commands on PF 0 */ if (hw->bus.func) return -EINVAL; ice_fwlog_set_supported(hw, fwlog); + fwlog->pdev = pdev; if (ice_fwlog_supported(fwlog)) { int status; @@ -261,7 +262,7 @@ int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog) sizeof(*fwlog->ring.rings), GFP_KERNEL); if (!fwlog->ring.rings) { - dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log rings\n"); + dev_warn(&fwlog->pdev->dev, "Unable to allocate memory for FW log rings\n"); return -ENOMEM; } @@ -270,7 +271,7 @@ int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog) status = ice_fwlog_alloc_ring_buffs(&fwlog->ring); if (status) { - dev_warn(ice_hw_to_dev(hw), "Unable to allocate memory for FW log ring data buffers\n"); + dev_warn(&fwlog->pdev->dev, "Unable to allocate memory for FW log ring data buffers\n"); ice_fwlog_free_ring_buffs(&fwlog->ring); kfree(fwlog->ring.rings); return status; @@ -278,7 +279,7 @@ int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog) ice_debugfs_fwlog_init(hw->back); } else { - dev_warn(ice_hw_to_dev(hw), "FW logging is not supported in this NVM image. Please update the NVM to get FW log support\n"); + dev_warn(&fwlog->pdev->dev, "FW logging is not supported in this NVM image. Please update the NVM to get FW log support\n"); } return 0; @@ -308,7 +309,7 @@ void ice_fwlog_deinit(struct ice_hw *hw, struct ice_fwlog *fwlog) fwlog->cfg.options &= ~ICE_FWLOG_OPTION_ARQ_ENA; status = ice_fwlog_set(hw, &fwlog->cfg); if (status) - dev_warn(ice_hw_to_dev(hw), "Unable to turn off FW logging, status: %d\n", + dev_warn(&fwlog->pdev->dev, "Unable to turn off FW logging, status: %d\n", status); kfree(pf->ice_debugfs_pf_fwlog_modules); @@ -317,7 +318,7 @@ void ice_fwlog_deinit(struct ice_hw *hw, struct ice_fwlog *fwlog) status = ice_fwlog_unregister(hw, fwlog); if (status) - dev_warn(ice_hw_to_dev(hw), "Unable to unregister FW logging, status: %d\n", + dev_warn(&fwlog->pdev->dev, "Unable to unregister FW logging, status: %d\n", status); if (fwlog->ring.rings) { @@ -436,7 +437,7 @@ int ice_fwlog_register(struct ice_hw *hw, struct ice_fwlog *fwlog) status = ice_aq_fwlog_register(hw, true); if (status) - ice_debug(hw, ICE_DBG_FW_LOG, "Failed to register for firmware logging events over ARQ\n"); + dev_dbg(&fwlog->pdev->dev, "Failed to register for firmware logging events over ARQ\n"); else fwlog->cfg.options |= ICE_FWLOG_OPTION_IS_REGISTERED; @@ -457,7 +458,7 @@ int ice_fwlog_unregister(struct ice_hw *hw, struct ice_fwlog *fwlog) status = ice_aq_fwlog_register(hw, false); if (status) - ice_debug(hw, ICE_DBG_FW_LOG, "Failed to unregister from firmware logging events over ARQ\n"); + dev_dbg(&fwlog->pdev->dev, "Failed to unregister from firmware logging events over ARQ\n"); else fwlog->cfg.options &= ~ICE_FWLOG_OPTION_IS_REGISTERED; |