linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Golan Ben-Ami <golan.ben.ami@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 14/41] iwlwifi: mvm: add trigger for firmware dump upon TDLS events
Date: Tue,  1 Dec 2015 11:58:40 +0200	[thread overview]
Message-ID: <1448963947-24302-14-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB32E905B07@hasmsx107.ger.corp.intel.com>

From: Golan Ben-Ami <golan.ben.ami@intel.com>

This will allow to catch different TDLS events and get the
firmware data when they occur.
Add empty TX_LATENCY trigger on the way to avoid mismatch
with trees in which this trigger is implemented.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c       |  2 ++
 .../net/wireless/intel/iwlwifi/iwl-fw-error-dump.h |  5 +++
 drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h   | 13 +++++++
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c  | 42 ++++++++++++++++++++--
 4 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index eedd0d8..ce65665 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1323,6 +1323,8 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 		sizeof(struct iwl_fw_dbg_trigger_time_event);
 	trigger_tlv_sz[FW_DBG_TRIGGER_BA] =
 		sizeof(struct iwl_fw_dbg_trigger_ba);
+	trigger_tlv_sz[FW_DBG_TRIGGER_TDLS] =
+		sizeof(struct iwl_fw_dbg_trigger_tdls);
 
 	for (i = 0; i < ARRAY_SIZE(drv->fw.dbg_trigger_tlv); i++) {
 		if (pieces->dbg_trigger_tlv[i]) {
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fw-error-dump.h b/drivers/net/wireless/intel/iwlwifi/iwl-fw-error-dump.h
index 9dbe19c..73bcf29 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-fw-error-dump.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-fw-error-dump.h
@@ -288,6 +288,9 @@ iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data)
  * @FW_DBG_TRIGGER_TIME_EVENT: trigger log collection upon time events related
  *	events.
  * @FW_DBG_TRIGGER_BA: trigger log collection upon BlockAck related events.
+ * @FW_DBG_TX_LATENCY: trigger log collection when the tx latency goes above a
+ *	threshold.
+ * @FW_DBG_TDLS: trigger log collection upon TDLS related events.
  */
 enum iwl_fw_dbg_trigger {
 	FW_DBG_TRIGGER_INVALID = 0,
@@ -302,6 +305,8 @@ enum iwl_fw_dbg_trigger {
 	FW_DBG_TRIGGER_TXQ_TIMERS,
 	FW_DBG_TRIGGER_TIME_EVENT,
 	FW_DBG_TRIGGER_BA,
+	FW_DBG_TRIGGER_TX_LATENCY,
+	FW_DBG_TRIGGER_TDLS,
 
 	/* must be last */
 	FW_DBG_TRIGGER_MAX,
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
index 6aeeceb..e08319a 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
@@ -725,6 +725,19 @@ struct iwl_fw_dbg_trigger_ba {
 } __packed;
 
 /**
+ * struct iwl_fw_dbg_trigger_tdls - configures trigger for TDLS events.
+ * @action_bitmap: the TDLS action to trigger the collection upon
+ * @peer_mode: trigger on specific peer or all
+ * @peer: the TDLS peer to trigger the collection on
+ */
+struct iwl_fw_dbg_trigger_tdls {
+	u8 action_bitmap;
+	u8 peer_mode;
+	u8 peer[ETH_ALEN];
+	u8 reserved[4];
+} __packed;
+
+/**
  * struct iwl_fw_dbg_conf_tlv - a TLV that describes a debug configuration.
  * @id: conf id
  * @usniffer: should the uSniffer image be used
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index e88afac..f570c71 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -2699,6 +2699,34 @@ static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
 }
 
+static void
+iwl_mvm_tdls_check_trigger(struct iwl_mvm *mvm,
+			   struct ieee80211_vif *vif, u8 *peer_addr,
+			   enum nl80211_tdls_operation action)
+{
+	struct iwl_fw_dbg_trigger_tlv *trig;
+	struct iwl_fw_dbg_trigger_tdls *tdls_trig;
+
+	if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TDLS))
+		return;
+
+	trig = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TDLS);
+	tdls_trig = (void *)trig->data;
+	if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trig))
+		return;
+
+	if (!(tdls_trig->action_bitmap & BIT(action)))
+		return;
+
+	if (tdls_trig->peer_mode &&
+	    memcmp(tdls_trig->peer, peer_addr, ETH_ALEN) != 0)
+		return;
+
+	iwl_mvm_fw_dbg_collect_trig(mvm, trig,
+				    "TDLS event occurred, peer %pM, action %d",
+				    peer_addr, action);
+}
+
 static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 				 struct ieee80211_vif *vif,
 				 struct ieee80211_sta *sta,
@@ -2749,8 +2777,11 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 		}
 
 		ret = iwl_mvm_add_sta(mvm, vif, sta);
-		if (sta->tdls && ret == 0)
+		if (sta->tdls && ret == 0) {
 			iwl_mvm_recalc_tdls_state(mvm, vif, true);
+			iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
+						   NL80211_TDLS_SETUP);
+		}
 	} else if (old_state == IEEE80211_STA_NONE &&
 		   new_state == IEEE80211_STA_AUTH) {
 		/*
@@ -2774,6 +2805,10 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 		if (iwl_mvm_phy_ctx_count(mvm) > 1)
 			iwl_mvm_teardown_tdls_peers(mvm);
 
+		if (sta->tdls)
+			iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
+						   NL80211_TDLS_ENABLE_LINK);
+
 		/* enable beacon filtering */
 		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
 		ret = 0;
@@ -2791,8 +2826,11 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 	} else if (old_state == IEEE80211_STA_NONE &&
 		   new_state == IEEE80211_STA_NOTEXIST) {
 		ret = iwl_mvm_rm_sta(mvm, vif, sta);
-		if (sta->tdls)
+		if (sta->tdls) {
 			iwl_mvm_recalc_tdls_state(mvm, vif, false);
+			iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr,
+						   NL80211_TDLS_DISABLE_LINK);
+		}
 	} else {
 		ret = -EIO;
 	}
-- 
2.5.0


  parent reply	other threads:[~2015-12-01  9:59 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  9:56 pull request: iwlwifi-next 2015-12-01 Grumbach, Emmanuel
2015-12-01  9:58 ` [PATCH 01/41] iwlwifi: nvm: fix up phy section when reading it Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 02/41] iwlwifi: add support for 12K Receive Buffers Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 03/41] iwlwifi: dvm: remove Kconfig default Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 04/41] iwlwifi: trans: make various conversion macros inlines Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 05/41] iwlwifi: mvm: Configure fragmented scan for scheduled scan Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 06/41] iwlwifi: dvm: remove stray debug code Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 07/41] iwlwifi: mvm: Enable MPLUT only on supported hw Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 08/41] iwlwifi: mvm: ignore LMAC scan notifications when running UMAC scans Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 09/41] iwlwifi: mvm: check FW's response for nvm access write cmd Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 10/41] iwlwifi: pcie: remove ICT allocation message Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 11/41] iwlwifi: generalize d0i3_entry_timeout module parameter Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 12/41] iwlwifi: mvm: change name of iwl_mvm_d3_update_gtk Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 13/41] iwlwifi: mvm: use build-time assertion for fw trigger ID Emmanuel Grumbach
2015-12-01  9:58 ` Emmanuel Grumbach [this message]
2015-12-01  9:58 ` [PATCH 15/41] iwlwifi: mvm: remove redundant d0i3 flag from the config struct Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 16/41] iwlwifi: mvm: add bt settings to debugfs Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 17/41] iwlwifi: mvm: add bt rrc and ttc " Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 18/41] iwlwifi: mvm: remove stray nd_config element Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 19/41] iwlwifi: mvm: drop low_latency_agg_frame_cnt_limit Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 20/41] iwlwifi: export the _no_grab version of PRPH IO functions Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 21/41] iwlwifi: dump prph registers in a common place for all transports Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 22/41] iwlwifi: mvm: flush all used TX queues before suspending Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 23/41] iwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported() Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 24/41] iwlwifi: mvm: move fw-dbg code to separate file Emmanuel Grumbach
2015-12-01 18:52   ` Kalle Valo
2015-12-01 19:14     ` Grumbach, Emmanuel
2015-12-01 19:26       ` Emmanuel Grumbach
2015-12-01 19:29         ` Kalle Valo
2015-12-03 15:32         ` Kalle Valo
2015-12-01  9:58 ` [PATCH 25/41] iwlwifi: mvm: Support setting continuous recording debug mode Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 26/41] iwlwifi: clean up transport debugfs handling Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 27/41] iwlwifi: pcie: remove pointer from debug message Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 28/41] iwlwifi: mvm: fix incorrect fallthrough in iwl_mvm_check_running_scans() Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 29/41] iwlwifi: mvm: use firmware station lookup, combine code Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 30/41] iwlwifi: mvm: refactor d3 key update functions Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 31/41] iwlwifi: Add new PCI IDs for 9260 and 5165 series Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 32/41] iwlwifi: Add PCI IDs for the new 3168 series Emmanuel Grumbach
2015-12-01  9:58 ` [PATCH 33/41] iwlwifi: Add PCI IDs for the new series 8165 Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 34/41] iwlwifi: mvm: Align bt-coex priority with requirements Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 35/41] iwlwifi: change the Intel Wireless email address Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 36/41] iwlwifi: print index in api/capa flags parsing message Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 37/41] iwlwifi: mvm: rs: fix a warning message Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 38/41] iwlwifi: mvm: report wakeup for wowlan Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 39/41] iwlwifi: mvm: add 9000-series RX API Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 40/41] iwlwifi: mvm: ROC: Extend the ROC max delay duration & limit ROC duration Emmanuel Grumbach
2015-12-01  9:59 ` [PATCH 41/41] iwlwifi: remove IWL_DL_LED Emmanuel Grumbach
2015-12-03 15:28 ` pull request: iwlwifi-next 2015-12-01 Kalle Valo

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=1448963947-24302-14-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=golan.ben.ami@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).