From 0a9fbc6b07ce608e4a18aafa58397a6cd09ddea3 Mon Sep 17 00:00:00 2001 From: Anilkumar Kolli Date: Fri, 15 May 2020 14:51:50 +0530 Subject: [PATCH 181/187] ath11k: add support to multiple debugfs entries for qcn9000 Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath11k/core.c | 5 +---- drivers/net/wireless/ath/ath11k/core.h | 1 - drivers/net/wireless/ath/ath11k/debug.c | 22 ++++++++++++---------- 3 files changed, 13 insertions(+), 15 deletions(-) --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -426,7 +426,7 @@ static int ath11k_core_pdev_create(struc ret = ath11k_mac_register(ab); if (ret) { ath11k_err(ab, "failed register the radio with mac80211: %d\n", ret); - goto err_pdev_debug; + return ret; } ret = ath11k_dp_pdev_alloc(ab); @@ -456,8 +456,6 @@ err_dp_pdev_free: ath11k_dp_pdev_free(ab); err_mac_unregister: ath11k_mac_unregister(ab); -err_pdev_debug: - ath11k_debug_pdev_destroy(ab); return ret; } @@ -469,7 +467,6 @@ static void ath11k_core_pdev_destroy(str ath11k_mac_unregister(ab); ath11k_hif_irq_disable(ab); ath11k_dp_pdev_free(ab); - ath11k_debug_pdev_destroy(ab); } static int ath11k_core_start(struct ath11k_base *ab, --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -792,7 +792,6 @@ struct ath11k_base { enum ath11k_dfs_region dfs_region; #ifdef CPTCFG_ATH11K_DEBUGFS struct dentry *debugfs_soc; - struct dentry *debugfs_ath11k; struct ath11k_soc_dp_ring_stats ring_stats; #endif struct ath11k_soc_dp_stats soc_stats; --- a/drivers/net/wireless/ath/ath11k/debug.c +++ b/drivers/net/wireless/ath/ath11k/debug.c @@ -13,6 +13,8 @@ #include "peer.h" #include "pktlog.h" +struct dentry *debugfs_ath11k; + #ifdef CPTCFG_ATH11K_DEBUGFS static const char *htt_bp_umac_ring[HTT_SW_UMAC_RING_IDX_MAX] = { "REO2SW1_RING", @@ -1159,10 +1161,15 @@ static const struct file_operations fops int ath11k_debug_pdev_create(struct ath11k_base *ab) { + char soc_name[11] = {0}; + if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) return 0; - ab->debugfs_soc = debugfs_create_dir(ab->hw_params.name, ab->debugfs_ath11k); + snprintf(soc_name, sizeof(soc_name), "%s_%d", ab->hw_params.name, + ab->qmi.service_ins_id); + + ab->debugfs_soc = debugfs_create_dir(soc_name, debugfs_ath11k); if (IS_ERR_OR_NULL(ab->debugfs_soc)) { if (IS_ERR(ab->debugfs_soc)) @@ -1184,19 +1191,14 @@ int ath11k_debug_pdev_create(struct ath1 void ath11k_debug_pdev_destroy(struct ath11k_base *ab) { - debugfs_remove_recursive(ab->debugfs_ath11k); - ab->debugfs_ath11k = NULL; + debugfs_remove_recursive(debugfs_ath11k); + debugfs_ath11k = NULL; } int ath11k_debug_soc_create(struct ath11k_base *ab) { - ab->debugfs_ath11k = debugfs_create_dir("ath11k", NULL); - - if (IS_ERR_OR_NULL(ab->debugfs_ath11k)) { - if (IS_ERR(ab->debugfs_ath11k)) - return PTR_ERR(ab->debugfs_ath11k); - return -ENOMEM; - } + if (IS_ERR_OR_NULL(debugfs_ath11k)) + debugfs_ath11k = debugfs_create_dir("ath11k", NULL); return 0; }