Commit 8bf52e0a authored by Liad Kaufman's avatar Liad Kaufman Committed by Luca Coelho

iwlwifi: mvm: add read debugfs for he_sniffer_params

Return the AID currently set when reading this debugfs entry.
Signed-off-by: default avatarLiad Kaufman <liad.kaufman@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 90a12829
...@@ -1789,6 +1789,7 @@ iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf, ...@@ -1789,6 +1789,7 @@ iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf,
struct iwl_mvm_sniffer_apply { struct iwl_mvm_sniffer_apply {
struct iwl_mvm *mvm; struct iwl_mvm *mvm;
u8 *bssid;
u16 aid; u16 aid;
}; };
...@@ -1798,6 +1799,8 @@ static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data, ...@@ -1798,6 +1799,8 @@ static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data,
struct iwl_mvm_sniffer_apply *apply = data; struct iwl_mvm_sniffer_apply *apply = data;
apply->mvm->cur_aid = cpu_to_le16(apply->aid); apply->mvm->cur_aid = cpu_to_le16(apply->aid);
memcpy(apply->mvm->cur_bssid, apply->bssid,
sizeof(apply->mvm->cur_bssid));
return true; return true;
} }
...@@ -1830,6 +1833,7 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf, ...@@ -1830,6 +1833,7 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
he_mon_cmd.aid = cpu_to_le16(aid); he_mon_cmd.aid = cpu_to_le16(aid);
apply.aid = aid; apply.aid = aid;
apply.bssid = (void *)he_mon_cmd.bssid;
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
...@@ -1858,6 +1862,23 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf, ...@@ -1858,6 +1862,23 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
return ret ?: count; return ret ?: count;
} }
static ssize_t
iwl_dbgfs_he_sniffer_params_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct iwl_mvm *mvm = file->private_data;
u8 buf[32];
int len;
len = scnprintf(buf, sizeof(buf),
"%d %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n",
le16_to_cpu(mvm->cur_aid), mvm->cur_bssid[0],
mvm->cur_bssid[1], mvm->cur_bssid[2], mvm->cur_bssid[3],
mvm->cur_bssid[4], mvm->cur_bssid[5]);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
static ssize_t static ssize_t
iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf, iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -1928,7 +1949,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(d3_sram, 8); ...@@ -1928,7 +1949,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(d3_sram, 8);
MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile); MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile);
#endif #endif
MVM_DEBUGFS_WRITE_FILE_OPS(he_sniffer_params, 32); MVM_DEBUGFS_READ_WRITE_FILE_OPS(he_sniffer_params, 32);
static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf, static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -2119,7 +2140,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir) ...@@ -2119,7 +2140,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400); MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400);
#endif #endif
MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0200); MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600);
if (!debugfs_create_bool("enable_scan_iteration_notif", if (!debugfs_create_bool("enable_scan_iteration_notif",
0600, 0600,
......
...@@ -1176,6 +1176,7 @@ struct iwl_mvm { ...@@ -1176,6 +1176,7 @@ struct iwl_mvm {
/* sniffer data to include in radiotap */ /* sniffer data to include in radiotap */
__le16 cur_aid; __le16 cur_aid;
u8 cur_bssid[ETH_ALEN];
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM]; struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment