Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Liad Kaufman <liad.kaufman@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 12/20] iwlwifi: mvm: add read debugfs for he_sniffer_params
Date: Fri, 15 Feb 2019 13:49:16 +0200	[thread overview]
Message-ID: <20190215114924.2545-13-luca@coelho.fi> (raw)
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>

From: Liad Kaufman <liad.kaufman@intel.com>

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>
---
 .../net/wireless/intel/iwlwifi/mvm/debugfs.c  | 25 +++++++++++++++++--
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  1 +
 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,
 
 struct iwl_mvm_sniffer_apply {
 	struct iwl_mvm *mvm;
+	u8 *bssid;
 	u16 aid;
 };
 
@@ -1798,6 +1799,8 @@ static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data,
 	struct iwl_mvm_sniffer_apply *apply = data;
 
 	apply->mvm->cur_aid = cpu_to_le16(apply->aid);
+	memcpy(apply->mvm->cur_bssid, apply->bssid,
+	       sizeof(apply->mvm->cur_bssid));
 
 	return true;
 }
@@ -1830,6 +1833,7 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
 	he_mon_cmd.aid = cpu_to_le16(aid);
 
 	apply.aid = aid;
+	apply.bssid = (void *)he_mon_cmd.bssid;
 
 	mutex_lock(&mvm->mutex);
 
@@ -1858,6 +1862,23 @@ iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
 	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
 iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf,
 				  size_t count, loff_t *ppos)
@@ -1928,7 +1949,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(d3_sram, 8);
 MVM_DEBUGFS_READ_FILE_OPS(sar_geo_profile);
 #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,
 				  size_t count, loff_t *ppos)
@@ -2119,7 +2140,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 #ifdef CONFIG_ACPI
 	MVM_DEBUGFS_ADD_FILE(sar_geo_profile, dbgfs_dir, 0400);
 #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",
 				 0600,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index b6d5a87dbae0..c90dd98bdd99 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 {
 
 	/* sniffer data to include in radiotap */
 	__le16 cur_aid;
+	u8 cur_bssid[ETH_ALEN];
 
 #ifdef CONFIG_ACPI
 	struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM];
-- 
2.20.1


  parent reply	other threads:[~2019-02-15 11:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 11:49 [PATCH 00/20] iwlwifi: updates intended for v5.1 2019-02-15 Luca Coelho
2019-02-15 11:49 ` [PATCH 01/20] iwlwifi: pcie: allocate rb_stts's for all queues in one place Luca Coelho
2019-02-15 11:49 ` [PATCH 02/20] iwlwifi: mvm: Don't request HW restart if already requested Luca Coelho
2019-02-15 11:49 ` [PATCH 03/20] iwlwifi: fix false-positive maybe-uninitialized warning Luca Coelho
2019-02-15 11:49 ` [PATCH 04/20] iwlwifi: eeprom-parse: use struct_size() in kzalloc() Luca Coelho
2019-02-15 11:49 ` [PATCH 05/20] iwlwifi: nvm-parse: " Luca Coelho
2019-02-15 11:49 ` [PATCH 06/20] iwlwifi: mvm: fix error path in iwl_mvm_mac_setup_register() Luca Coelho
2019-02-15 11:49 ` [PATCH 07/20] iwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT Luca Coelho
2019-02-15 11:49 ` [PATCH 08/20] iwlwifi: dvm: no need to check return value of debugfs_create functions Luca Coelho
2019-02-15 11:49 ` [PATCH 09/20] iwlwifi: fw: " Luca Coelho
2019-02-15 11:49 ` [PATCH 10/20] iwlwifi: iwl-drv: " Luca Coelho
2019-02-15 11:49 ` [PATCH 11/20] iwlwifi: mvm: reject new beacons when in inject mode Luca Coelho
2019-02-20  8:54   ` [PATCH v2 " Luca Coelho
2019-02-15 11:49 ` Luca Coelho [this message]
2019-02-15 11:49 ` [PATCH 13/20] iwlwifi: mvm: support non-transmitting AP Luca Coelho
2019-02-15 11:49 ` [PATCH 14/20] iwlwifi: mvm: Set TX_CMD_FLG_PROT_REQUIRE correctly Luca Coelho
2019-02-15 11:49 ` [PATCH 15/20] iwlwifi: mvm: remove IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE Luca Coelho
2019-02-15 11:49 ` [PATCH 16/20] iwlwifi: mvm: Allow retries for probe responses Luca Coelho
2019-02-15 11:49 ` [PATCH 17/20] iwlwifi: mvm: implement VHT extended NSS support in rs.c Luca Coelho
2019-02-15 11:49 ` [PATCH 18/20] iwlwifi: remove redundant condition from prior alive dump flow Luca Coelho
2019-02-15 11:49 ` [PATCH 19/20] iwlwifi: mvm: add some debug data to TX path Luca Coelho
2019-02-15 11:49 ` [PATCH 20/20] iwlwifi: dbg_ini: fix infinite time ignore consecutive dumps Luca Coelho
2019-02-20 12:35 ` [PATCH 00/20] iwlwifi: updates intended for v5.1 2019-02-15 Kalle Valo
2019-02-20 12:43   ` Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215114924.2545-13-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=liad.kaufman@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox