Loading drivers/net/wireless/ath/ath10k/core.c +27 −1 Original line number Diff line number Diff line Loading @@ -206,6 +206,28 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, }, { .id = QCA9888_HW_2_0_DEV_VERSION, .dev_id = QCA9888_2_0_DEVICE_ID, .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .otp_exe_param = 0x00000700, .continuous_frag_desc = true, .channel_counters_freq_hz = 150000, .max_probe_resp_desc_thres = 24, .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE, .tx_chain_mask = 3, .rx_chain_mask = 3, .max_spatial_stream = 2, .cal_data_len = 12064, .fw = { .dir = QCA9888_HW_2_0_FW_DIR, .board = QCA9888_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, }, { .id = QCA9377_HW_1_0_DEV_VERSION, .dev_id = QCA9377_1_0_DEVICE_ID, Loading Loading @@ -1675,7 +1697,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) case ATH10K_FW_WMI_OP_VERSION_10_4: case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_MAX: WARN_ON(1); ath10k_err(ar, "htt op version not found from fw meta data"); return -EINVAL; } } Loading Loading @@ -2171,6 +2193,10 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->regs = &qca99x0_regs; ar->hw_values = &qca99x0_values; break; case ATH10K_HW_QCA9888: ar->regs = &qca99x0_regs; ar->hw_values = &qca9888_values; break; case ATH10K_HW_QCA4019: ar->regs = &qca4019_regs; ar->hw_values = &qca4019_values; Loading drivers/net/wireless/ath/ath10k/core.h +9 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,13 @@ struct ath10k_fw_stats_peer { u32 rx_duration; }; struct ath10k_fw_extd_stats_peer { struct list_head list; u8 peer_macaddr[ETH_ALEN]; u32 rx_duration; }; struct ath10k_fw_stats_vdev { struct list_head list; Loading Loading @@ -256,9 +263,11 @@ struct ath10k_fw_stats_pdev { }; struct ath10k_fw_stats { bool extended; struct list_head pdevs; struct list_head vdevs; struct list_head peers; struct list_head peers_extd; }; #define ATH10K_TPC_TABLE_TYPE_FLAG 1 Loading drivers/net/wireless/ath/ath10k/debug.c +18 −1 Original line number Diff line number Diff line Loading @@ -313,13 +313,25 @@ static void ath10k_fw_stats_peers_free(struct list_head *head) } } static void ath10k_fw_extd_stats_peers_free(struct list_head *head) { struct ath10k_fw_extd_stats_peer *i, *tmp; list_for_each_entry_safe(i, tmp, head, list) { list_del(&i->list); kfree(i); } } static void ath10k_debug_fw_stats_reset(struct ath10k *ar) { spin_lock_bh(&ar->data_lock); ar->debug.fw_stats_done = false; ar->debug.fw_stats.extended = false; ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); spin_unlock_bh(&ar->data_lock); } Loading @@ -334,6 +346,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) INIT_LIST_HEAD(&stats.pdevs); INIT_LIST_HEAD(&stats.vdevs); INIT_LIST_HEAD(&stats.peers); INIT_LIST_HEAD(&stats.peers_extd); spin_lock_bh(&ar->data_lock); ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats); Loading @@ -354,7 +367,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) * delivered which is treated as end-of-data and is itself discarded */ if (ath10k_peer_stats_enabled(ar)) ath10k_sta_update_rx_duration(ar, &stats.peers); ath10k_sta_update_rx_duration(ar, &stats); if (ar->debug.fw_stats_done) { if (!ath10k_peer_stats_enabled(ar)) Loading Loading @@ -396,6 +409,8 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) list_splice_tail_init(&stats.peers, &ar->debug.fw_stats.peers); list_splice_tail_init(&stats.vdevs, &ar->debug.fw_stats.vdevs); list_splice_tail_init(&stats.peers_extd, &ar->debug.fw_stats.peers_extd); } complete(&ar->debug.fw_stats_complete); Loading @@ -407,6 +422,7 @@ free: ath10k_fw_stats_pdevs_free(&stats.pdevs); ath10k_fw_stats_vdevs_free(&stats.vdevs); ath10k_fw_stats_peers_free(&stats.peers); ath10k_fw_extd_stats_peers_free(&stats.peers_extd); spin_unlock_bh(&ar->data_lock); } Loading Loading @@ -2330,6 +2346,7 @@ int ath10k_debug_create(struct ath10k *ar) INIT_LIST_HEAD(&ar->debug.fw_stats.pdevs); INIT_LIST_HEAD(&ar->debug.fw_stats.vdevs); INIT_LIST_HEAD(&ar->debug.fw_stats.peers); INIT_LIST_HEAD(&ar->debug.fw_stats.peers_extd); return 0; } Loading drivers/net/wireless/ath/ath10k/debug.h +8 −3 Original line number Diff line number Diff line Loading @@ -154,10 +154,15 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar) #ifdef CONFIG_MAC80211_DEBUGFS void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer); void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats); void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct station_info *sinfo); #else static inline void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer) static inline void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { } #endif /* CONFIG_MAC80211_DEBUGFS */ Loading drivers/net/wireless/ath/ath10k/debugfs_sta.c +47 −27 Original line number Diff line number Diff line Loading @@ -18,13 +18,34 @@ #include "wmi-ops.h" #include "debug.h" void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *head) { struct ieee80211_sta *sta; static void ath10k_sta_update_extd_stats_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { struct ath10k_fw_extd_stats_peer *peer; struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_read_lock(); list_for_each_entry(peer, &stats->peers_extd, list) { sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, NULL); if (!sta) continue; arsta = (struct ath10k_sta *)sta->drv_priv; arsta->rx_duration += (u64)peer->rx_duration; } rcu_read_unlock(); } static void ath10k_sta_update_stats_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { struct ath10k_fw_stats_peer *peer; struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_read_lock(); list_for_each_entry(peer, head, list) { list_for_each_entry(peer, &stats->peers, list) { sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, NULL); if (!sta) Loading @@ -35,6 +56,29 @@ void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *head) rcu_read_unlock(); } void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { if (stats->extended) ath10k_sta_update_extd_stats_rx_duration(ar, stats); else ath10k_sta_update_stats_rx_duration(ar, stats); } void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct station_info *sinfo) { struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; struct ath10k *ar = arsta->arvif->ar; if (!ath10k_peer_stats_enabled(ar)) return; sinfo->rx_duration = arsta->rx_duration; sinfo->filled |= 1ULL << NL80211_STA_INFO_RX_DURATION; } static ssize_t ath10k_dbg_sta_read_aggr_mode(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) Loading Loading @@ -249,28 +293,6 @@ static const struct file_operations fops_delba = { .llseek = default_llseek, }; static ssize_t ath10k_dbg_sta_read_rx_duration(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ieee80211_sta *sta = file->private_data; struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; char buf[100]; int len = 0; len = scnprintf(buf, sizeof(buf), "%llu usecs\n", arsta->rx_duration); return simple_read_from_buffer(user_buf, count, ppos, buf, len); } static const struct file_operations fops_rx_duration = { .read = ath10k_dbg_sta_read_rx_duration, .open = simple_open, .owner = THIS_MODULE, .llseek = default_llseek, }; void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir) { Loading @@ -279,6 +301,4 @@ void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); debugfs_create_file("delba", S_IWUSR, dir, sta, &fops_delba); debugfs_create_file("rx_duration", S_IRUGO, dir, sta, &fops_rx_duration); } Loading
drivers/net/wireless/ath/ath10k/core.c +27 −1 Original line number Diff line number Diff line Loading @@ -206,6 +206,28 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, }, { .id = QCA9888_HW_2_0_DEV_VERSION, .dev_id = QCA9888_2_0_DEVICE_ID, .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .otp_exe_param = 0x00000700, .continuous_frag_desc = true, .channel_counters_freq_hz = 150000, .max_probe_resp_desc_thres = 24, .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE, .tx_chain_mask = 3, .rx_chain_mask = 3, .max_spatial_stream = 2, .cal_data_len = 12064, .fw = { .dir = QCA9888_HW_2_0_FW_DIR, .board = QCA9888_HW_2_0_BOARD_DATA_FILE, .board_size = QCA99X0_BOARD_DATA_SZ, .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ, }, }, { .id = QCA9377_HW_1_0_DEV_VERSION, .dev_id = QCA9377_1_0_DEVICE_ID, Loading Loading @@ -1675,7 +1697,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) case ATH10K_FW_WMI_OP_VERSION_10_4: case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_MAX: WARN_ON(1); ath10k_err(ar, "htt op version not found from fw meta data"); return -EINVAL; } } Loading Loading @@ -2171,6 +2193,10 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->regs = &qca99x0_regs; ar->hw_values = &qca99x0_values; break; case ATH10K_HW_QCA9888: ar->regs = &qca99x0_regs; ar->hw_values = &qca9888_values; break; case ATH10K_HW_QCA4019: ar->regs = &qca4019_regs; ar->hw_values = &qca4019_values; Loading
drivers/net/wireless/ath/ath10k/core.h +9 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,13 @@ struct ath10k_fw_stats_peer { u32 rx_duration; }; struct ath10k_fw_extd_stats_peer { struct list_head list; u8 peer_macaddr[ETH_ALEN]; u32 rx_duration; }; struct ath10k_fw_stats_vdev { struct list_head list; Loading Loading @@ -256,9 +263,11 @@ struct ath10k_fw_stats_pdev { }; struct ath10k_fw_stats { bool extended; struct list_head pdevs; struct list_head vdevs; struct list_head peers; struct list_head peers_extd; }; #define ATH10K_TPC_TABLE_TYPE_FLAG 1 Loading
drivers/net/wireless/ath/ath10k/debug.c +18 −1 Original line number Diff line number Diff line Loading @@ -313,13 +313,25 @@ static void ath10k_fw_stats_peers_free(struct list_head *head) } } static void ath10k_fw_extd_stats_peers_free(struct list_head *head) { struct ath10k_fw_extd_stats_peer *i, *tmp; list_for_each_entry_safe(i, tmp, head, list) { list_del(&i->list); kfree(i); } } static void ath10k_debug_fw_stats_reset(struct ath10k *ar) { spin_lock_bh(&ar->data_lock); ar->debug.fw_stats_done = false; ar->debug.fw_stats.extended = false; ath10k_fw_stats_pdevs_free(&ar->debug.fw_stats.pdevs); ath10k_fw_stats_vdevs_free(&ar->debug.fw_stats.vdevs); ath10k_fw_stats_peers_free(&ar->debug.fw_stats.peers); ath10k_fw_extd_stats_peers_free(&ar->debug.fw_stats.peers_extd); spin_unlock_bh(&ar->data_lock); } Loading @@ -334,6 +346,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) INIT_LIST_HEAD(&stats.pdevs); INIT_LIST_HEAD(&stats.vdevs); INIT_LIST_HEAD(&stats.peers); INIT_LIST_HEAD(&stats.peers_extd); spin_lock_bh(&ar->data_lock); ret = ath10k_wmi_pull_fw_stats(ar, skb, &stats); Loading @@ -354,7 +367,7 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) * delivered which is treated as end-of-data and is itself discarded */ if (ath10k_peer_stats_enabled(ar)) ath10k_sta_update_rx_duration(ar, &stats.peers); ath10k_sta_update_rx_duration(ar, &stats); if (ar->debug.fw_stats_done) { if (!ath10k_peer_stats_enabled(ar)) Loading Loading @@ -396,6 +409,8 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb) list_splice_tail_init(&stats.peers, &ar->debug.fw_stats.peers); list_splice_tail_init(&stats.vdevs, &ar->debug.fw_stats.vdevs); list_splice_tail_init(&stats.peers_extd, &ar->debug.fw_stats.peers_extd); } complete(&ar->debug.fw_stats_complete); Loading @@ -407,6 +422,7 @@ free: ath10k_fw_stats_pdevs_free(&stats.pdevs); ath10k_fw_stats_vdevs_free(&stats.vdevs); ath10k_fw_stats_peers_free(&stats.peers); ath10k_fw_extd_stats_peers_free(&stats.peers_extd); spin_unlock_bh(&ar->data_lock); } Loading Loading @@ -2330,6 +2346,7 @@ int ath10k_debug_create(struct ath10k *ar) INIT_LIST_HEAD(&ar->debug.fw_stats.pdevs); INIT_LIST_HEAD(&ar->debug.fw_stats.vdevs); INIT_LIST_HEAD(&ar->debug.fw_stats.peers); INIT_LIST_HEAD(&ar->debug.fw_stats.peers_extd); return 0; } Loading
drivers/net/wireless/ath/ath10k/debug.h +8 −3 Original line number Diff line number Diff line Loading @@ -154,10 +154,15 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar) #ifdef CONFIG_MAC80211_DEBUGFS void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer); void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats); void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct station_info *sinfo); #else static inline void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer) static inline void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { } #endif /* CONFIG_MAC80211_DEBUGFS */ Loading
drivers/net/wireless/ath/ath10k/debugfs_sta.c +47 −27 Original line number Diff line number Diff line Loading @@ -18,13 +18,34 @@ #include "wmi-ops.h" #include "debug.h" void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *head) { struct ieee80211_sta *sta; static void ath10k_sta_update_extd_stats_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { struct ath10k_fw_extd_stats_peer *peer; struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_read_lock(); list_for_each_entry(peer, &stats->peers_extd, list) { sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, NULL); if (!sta) continue; arsta = (struct ath10k_sta *)sta->drv_priv; arsta->rx_duration += (u64)peer->rx_duration; } rcu_read_unlock(); } static void ath10k_sta_update_stats_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { struct ath10k_fw_stats_peer *peer; struct ieee80211_sta *sta; struct ath10k_sta *arsta; rcu_read_lock(); list_for_each_entry(peer, head, list) { list_for_each_entry(peer, &stats->peers, list) { sta = ieee80211_find_sta_by_ifaddr(ar->hw, peer->peer_macaddr, NULL); if (!sta) Loading @@ -35,6 +56,29 @@ void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *head) rcu_read_unlock(); } void ath10k_sta_update_rx_duration(struct ath10k *ar, struct ath10k_fw_stats *stats) { if (stats->extended) ath10k_sta_update_extd_stats_rx_duration(ar, stats); else ath10k_sta_update_stats_rx_duration(ar, stats); } void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct station_info *sinfo) { struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; struct ath10k *ar = arsta->arvif->ar; if (!ath10k_peer_stats_enabled(ar)) return; sinfo->rx_duration = arsta->rx_duration; sinfo->filled |= 1ULL << NL80211_STA_INFO_RX_DURATION; } static ssize_t ath10k_dbg_sta_read_aggr_mode(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) Loading Loading @@ -249,28 +293,6 @@ static const struct file_operations fops_delba = { .llseek = default_llseek, }; static ssize_t ath10k_dbg_sta_read_rx_duration(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ieee80211_sta *sta = file->private_data; struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; char buf[100]; int len = 0; len = scnprintf(buf, sizeof(buf), "%llu usecs\n", arsta->rx_duration); return simple_read_from_buffer(user_buf, count, ppos, buf, len); } static const struct file_operations fops_rx_duration = { .read = ath10k_dbg_sta_read_rx_duration, .open = simple_open, .owner = THIS_MODULE, .llseek = default_llseek, }; void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir) { Loading @@ -279,6 +301,4 @@ void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, debugfs_create_file("addba", S_IWUSR, dir, sta, &fops_addba); debugfs_create_file("addba_resp", S_IWUSR, dir, sta, &fops_addba_resp); debugfs_create_file("delba", S_IWUSR, dir, sta, &fops_delba); debugfs_create_file("rx_duration", S_IRUGO, dir, sta, &fops_rx_duration); }