aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2019-01-15 06:38:30 -0500
committerLuca Coelho <luciano.coelho@intel.com>2019-02-20 13:47:57 -0500
commit8bf52e0ab3d6c4c64295250382fcff2d9d3fed6a (patch)
treeaf0d1233cf9d7efa9d865fab1f20212782763822 /drivers/net/wireless/intel
parent90a128291ded5f86a730729f74d6b2f0e8f668df (diff)
iwlwifi: mvm: add read debugfs for he_sniffer_params
Return the AID currently set when reading this debugfs entry. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c25
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h1
2 files changed, 24 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 05a6db2db478..776b24f54200 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1789,6 +1789,7 @@ iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf,
1789 1789
1790struct iwl_mvm_sniffer_apply { 1790struct iwl_mvm_sniffer_apply {
1791 struct iwl_mvm *mvm; 1791 struct iwl_mvm *mvm;
1792 u8 *bssid;
1792 u16 aid; 1793 u16 aid;
1793}; 1794};
1794 1795
@@ -1798,6 +1799,8 @@ static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data,
1798 struct iwl_mvm_sniffer_apply *apply = data; 1799 struct iwl_mvm_sniffer_apply *apply = data;
1799 1800
1800 apply->mvm->cur_aid = cpu_to_le16(apply->aid); 1801 apply->mvm->cur_aid = cpu_to_le16(apply->aid);
1802 memcpy(apply->mvm->cur_bssid, apply->bssid,
1803 sizeof(apply->mvm->cur_bssid));
1801 1804
1802 return true; 1805 return true;
1803} 1806}
@@ -1830,6 +1833,7 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
1830 he_mon_cmd.aid = cpu_to_le16(aid); 1833 he_mon_cmd.aid = cpu_to_le16(aid);
1831 1834
1832 apply.aid = aid; 1835 apply.aid = aid;
1836 apply.bssid = (void *)he_mon_cmd.bssid;
1833 1837
1834 mutex_lock(&mvm->mutex); 1838 mutex_lock(&mvm->mutex);
1835 1839
@@ -1859,6 +1863,23 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
1859} 1863}
1860 1864
1861static ssize_t 1865static ssize_t
1866iwl_dbgfs_he_sniffer_params_read(struct file *file, char __user *user_buf,
1867 size_t count, loff_t *ppos)
1868{
1869 struct iwl_mvm *mvm = file->private_data;
1870 u8 buf[32];
1871 int len;
1872
1873 len = scnprintf(buf, sizeof(buf),
1874 "%d %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n",
1875 le16_to_cpu(mvm->cur_aid), mvm->cur_bssid[0],
1876 mvm->cur_bssid[1], mvm->cur_bssid[2], mvm->cur_bssid[3],
1877 mvm->cur_bssid[4], mvm->cur_bssid[5]);
1878
1879 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
1880}
1881
1882static ssize_t
1862iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf, 1883iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf,
1863 size_t count, loff_t *ppos) 1884 size_t count, loff_t *ppos)
1864{ 1885{
@@ -1928,7 +1949,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(d3_sram, 8);
1928MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile); 1949MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile);
1929#endif 1950#endif
1930 1951
1931MVM_DEBUGFS_WRITE_FILE_OPS(he_sniffer_params, 32); 1952MVM_DEBUGFS_READ_WRITE_FILE_OPS(he_sniffer_params, 32);
1932 1953
1933static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf, 1954static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
1934 size_t count, loff_t *ppos) 1955 size_t count, loff_t *ppos)
@@ -2119,7 +2140,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
2119#ifdef CONFIG_ACPI 2140#ifdef CONFIG_ACPI
2120 MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400); 2141 MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400);
2121#endif 2142#endif
2122 MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0200); 2143 MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600);
2123 2144
2124 if (!debugfs_create_bool("enable_scan_iteration_notif", 2145 if (!debugfs_create_bool("enable_scan_iteration_notif",
2125 0600, 2146 0600,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index acb4cca5bdcf..148aee1ad79d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1176,6 +1176,7 @@ struct iwl_mvm {
1176 1176
1177 /* sniffer data to include in radiotap */ 1177 /* sniffer data to include in radiotap */
1178 __le16 cur_aid; 1178 __le16 cur_aid;
1179 u8 cur_bssid[ETH_ALEN];
1179 1180
1180#ifdef CONFIG_ACPI 1181#ifdef CONFIG_ACPI
1181 struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM]; 1182 struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM];