Loading drivers/net/wireless/ath/ath10k/Kconfig +7 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,10 @@ config ATH10K_TRACING ---help--- Select this to ath10k use tracing infrastructure. config ATH10K_DFS_CERTIFIED bool "Atheros DFS support for certified platforms" depends on ATH10K && CFG80211_CERTIFICATION_ONUS default n ---help--- This option enables DFS support for initiating radiation on ath10k. drivers/net/wireless/ath/ath10k/core.h +11 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,9 @@ struct ath10k_vif { u8 bssid[ETH_ALEN]; } ibss; } u; u8 fixed_rate; u8 fixed_nss; }; struct ath10k_vif_iter { Loading @@ -272,6 +275,8 @@ struct ath10k_debug { struct delayed_work htt_stats_dwork; struct ath10k_dfs_stats dfs_stats; struct ath_dfs_pool_stats dfs_pool_stats; u32 fw_dbglog_mask; }; enum ath10k_state { Loading Loading @@ -306,6 +311,9 @@ enum ath10k_fw_features { /* firmware support tx frame management over WMI, otherwise it's HTT */ ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX = 2, /* Firmware does not support P2P */ ATH10K_FW_FEATURE_NO_P2P = 3, /* keep last */ ATH10K_FW_FEATURE_COUNT, }; Loading Loading @@ -429,6 +437,9 @@ struct ath10k { struct list_head peers; wait_queue_head_t peer_mapping_wq; /* number of created peers; protected by data_lock */ int num_peers; struct work_struct offchan_tx_work; struct sk_buff_head offchan_tx_queue; struct completion offchan_tx_completed; Loading drivers/net/wireless/ath/ath10k/debug.c +66 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,61 @@ static const struct file_operations fops_htt_stats_mask = { .llseek = default_llseek, }; static ssize_t ath10k_read_fw_dbglog(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; unsigned int len; char buf[32]; len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->debug.fw_dbglog_mask); return simple_read_from_buffer(user_buf, count, ppos, buf, len); } static ssize_t ath10k_write_fw_dbglog(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; unsigned long mask; int ret; ret = kstrtoul_from_user(user_buf, count, 0, &mask); if (ret) return ret; mutex_lock(&ar->conf_mutex); ar->debug.fw_dbglog_mask = mask; if (ar->state == ATH10K_STATE_ON) { ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); if (ret) { ath10k_warn("dbglog cfg failed from debugfs: %d\n", ret); goto exit; } } ret = count; exit: mutex_unlock(&ar->conf_mutex); return ret; } static const struct file_operations fops_fw_dbglog = { .read = ath10k_read_fw_dbglog, .write = ath10k_write_fw_dbglog, .open = simple_open, .owner = THIS_MODULE, .llseek = default_llseek, }; int ath10k_debug_start(struct ath10k *ar) { int ret; Loading @@ -625,6 +680,14 @@ int ath10k_debug_start(struct ath10k *ar) /* continue normally anyway, this isn't serious */ ath10k_warn("failed to start htt stats workqueue: %d\n", ret); if (ar->debug.fw_dbglog_mask) { ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); if (ret) /* not serious */ ath10k_warn("failed to enable dbglog during start: %d", ret); } return 0; } Loading Loading @@ -747,6 +810,9 @@ int ath10k_debug_create(struct ath10k *ar) debugfs_create_file("htt_stats_mask", S_IRUSR, ar->debug.debugfs_phy, ar, &fops_htt_stats_mask); debugfs_create_file("fw_dbglog", S_IRUSR, ar->debug.debugfs_phy, ar, &fops_fw_dbglog); if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) { debugfs_create_file("dfs_simulate_radar", S_IWUSR, ar->debug.debugfs_phy, ar, Loading drivers/net/wireless/ath/ath10k/htt.h +1 −0 Original line number Diff line number Diff line Loading @@ -1183,6 +1183,7 @@ struct htt_rx_info { } rate; bool fcs_err; bool amsdu_more; bool mic_err; }; struct ath10k_htt { Loading drivers/net/wireless/ath/ath10k/htt_rx.c +15 −0 Original line number Diff line number Diff line Loading @@ -838,6 +838,20 @@ static bool ath10k_htt_rx_has_fcs_err(struct sk_buff *skb) return false; } static bool ath10k_htt_rx_has_mic_err(struct sk_buff *skb) { struct htt_rx_desc *rxd; u32 flags; rxd = (void *)skb->data - sizeof(*rxd); flags = __le32_to_cpu(rxd->attention.flags); if (flags & RX_ATTENTION_FLAGS_TKIP_MIC_ERR) return true; return false; } static int ath10k_htt_rx_get_csum_state(struct sk_buff *skb) { struct htt_rx_desc *rxd; Loading Loading @@ -960,6 +974,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, info.skb = msdu_head; info.fcs_err = ath10k_htt_rx_has_fcs_err(msdu_head); info.mic_err = ath10k_htt_rx_has_mic_err(msdu_head); info.signal = ATH10K_DEFAULT_NOISE_FLOOR; info.signal += rx->ppdu.combined_rssi; Loading Loading
drivers/net/wireless/ath/ath10k/Kconfig +7 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,10 @@ config ATH10K_TRACING ---help--- Select this to ath10k use tracing infrastructure. config ATH10K_DFS_CERTIFIED bool "Atheros DFS support for certified platforms" depends on ATH10K && CFG80211_CERTIFICATION_ONUS default n ---help--- This option enables DFS support for initiating radiation on ath10k.
drivers/net/wireless/ath/ath10k/core.h +11 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,9 @@ struct ath10k_vif { u8 bssid[ETH_ALEN]; } ibss; } u; u8 fixed_rate; u8 fixed_nss; }; struct ath10k_vif_iter { Loading @@ -272,6 +275,8 @@ struct ath10k_debug { struct delayed_work htt_stats_dwork; struct ath10k_dfs_stats dfs_stats; struct ath_dfs_pool_stats dfs_pool_stats; u32 fw_dbglog_mask; }; enum ath10k_state { Loading Loading @@ -306,6 +311,9 @@ enum ath10k_fw_features { /* firmware support tx frame management over WMI, otherwise it's HTT */ ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX = 2, /* Firmware does not support P2P */ ATH10K_FW_FEATURE_NO_P2P = 3, /* keep last */ ATH10K_FW_FEATURE_COUNT, }; Loading Loading @@ -429,6 +437,9 @@ struct ath10k { struct list_head peers; wait_queue_head_t peer_mapping_wq; /* number of created peers; protected by data_lock */ int num_peers; struct work_struct offchan_tx_work; struct sk_buff_head offchan_tx_queue; struct completion offchan_tx_completed; Loading
drivers/net/wireless/ath/ath10k/debug.c +66 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,61 @@ static const struct file_operations fops_htt_stats_mask = { .llseek = default_llseek, }; static ssize_t ath10k_read_fw_dbglog(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; unsigned int len; char buf[32]; len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->debug.fw_dbglog_mask); return simple_read_from_buffer(user_buf, count, ppos, buf, len); } static ssize_t ath10k_write_fw_dbglog(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct ath10k *ar = file->private_data; unsigned long mask; int ret; ret = kstrtoul_from_user(user_buf, count, 0, &mask); if (ret) return ret; mutex_lock(&ar->conf_mutex); ar->debug.fw_dbglog_mask = mask; if (ar->state == ATH10K_STATE_ON) { ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); if (ret) { ath10k_warn("dbglog cfg failed from debugfs: %d\n", ret); goto exit; } } ret = count; exit: mutex_unlock(&ar->conf_mutex); return ret; } static const struct file_operations fops_fw_dbglog = { .read = ath10k_read_fw_dbglog, .write = ath10k_write_fw_dbglog, .open = simple_open, .owner = THIS_MODULE, .llseek = default_llseek, }; int ath10k_debug_start(struct ath10k *ar) { int ret; Loading @@ -625,6 +680,14 @@ int ath10k_debug_start(struct ath10k *ar) /* continue normally anyway, this isn't serious */ ath10k_warn("failed to start htt stats workqueue: %d\n", ret); if (ar->debug.fw_dbglog_mask) { ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); if (ret) /* not serious */ ath10k_warn("failed to enable dbglog during start: %d", ret); } return 0; } Loading Loading @@ -747,6 +810,9 @@ int ath10k_debug_create(struct ath10k *ar) debugfs_create_file("htt_stats_mask", S_IRUSR, ar->debug.debugfs_phy, ar, &fops_htt_stats_mask); debugfs_create_file("fw_dbglog", S_IRUSR, ar->debug.debugfs_phy, ar, &fops_fw_dbglog); if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) { debugfs_create_file("dfs_simulate_radar", S_IWUSR, ar->debug.debugfs_phy, ar, Loading
drivers/net/wireless/ath/ath10k/htt.h +1 −0 Original line number Diff line number Diff line Loading @@ -1183,6 +1183,7 @@ struct htt_rx_info { } rate; bool fcs_err; bool amsdu_more; bool mic_err; }; struct ath10k_htt { Loading
drivers/net/wireless/ath/ath10k/htt_rx.c +15 −0 Original line number Diff line number Diff line Loading @@ -838,6 +838,20 @@ static bool ath10k_htt_rx_has_fcs_err(struct sk_buff *skb) return false; } static bool ath10k_htt_rx_has_mic_err(struct sk_buff *skb) { struct htt_rx_desc *rxd; u32 flags; rxd = (void *)skb->data - sizeof(*rxd); flags = __le32_to_cpu(rxd->attention.flags); if (flags & RX_ATTENTION_FLAGS_TKIP_MIC_ERR) return true; return false; } static int ath10k_htt_rx_get_csum_state(struct sk_buff *skb) { struct htt_rx_desc *rxd; Loading Loading @@ -960,6 +974,7 @@ static void ath10k_htt_rx_handler(struct ath10k_htt *htt, info.skb = msdu_head; info.fcs_err = ath10k_htt_rx_has_fcs_err(msdu_head); info.mic_err = ath10k_htt_rx_has_mic_err(msdu_head); info.signal = ATH10K_DEFAULT_NOISE_FLOOR; info.signal += rx->ppdu.combined_rssi; Loading