linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request: iwlwifi 2014-11-23
@ 2014-11-23 19:56 Emmanuel Grumbach
  2014-11-23 19:57 ` [PATCH] iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands Emmanuel Grumbach
  2014-11-24 18:55 ` pull request: iwlwifi 2014-11-23 John W. Linville
  0 siblings, 2 replies; 3+ messages in thread
From: Emmanuel Grumbach @ 2014-11-23 19:56 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Emmanuel Grumbach

Hi John,

I have a trivial patch for 3.18. details below.
Thanks!

The following changes since commit 87dd634ae72bb8f6d0dd12f1cbbc67c7da6dba3b:

  iwlwifi: pcie: fix prph dump length (2014-11-11 07:24:57 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-john-2014-11-23

for you to fetch changes up to 5ac6c72e594471acfa5b00210c51d533a73413ad:

  iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands (2014-11-23 21:50:57 +0200)

----------------------------------------------------------------
Not all the firmware know how to handle the HOT_SPOT_CMD.
Make sure that the firmware will know this command before
sending it. This avoids a firmware crash.

----------------------------------------------------------------
Luciano Coelho (1):
      iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands

 drivers/net/wireless/iwlwifi/iwl-fw.h       |  2 ++
 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands
  2014-11-23 19:56 pull request: iwlwifi 2014-11-23 Emmanuel Grumbach
@ 2014-11-23 19:57 ` Emmanuel Grumbach
  2014-11-24 18:55 ` pull request: iwlwifi 2014-11-23 John W. Linville
  1 sibling, 0 replies; 3+ messages in thread
From: Emmanuel Grumbach @ 2014-11-23 19:57 UTC (permalink / raw)
  To: linux-wireless; +Cc: Luciano Coelho, Emmanuel Grumbach

From: Luciano Coelho <luciano.coelho@intel.com>

Older firmwares do not provide support for the HOT_SPOT_CMD command.
Check for the appropriate TLV flag that declares hotspot support in
the firmware to prevent a firmware assertion failure that can be
triggered from the userspace,

Cc: stable@vger.kernel.org [3.17+]
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-fw.h       |  2 ++
 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h
index 4f6e668..b894a84 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw.h
@@ -155,6 +155,7 @@ enum iwl_ucode_tlv_api {
  * @IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT: supports Quiet Period requests
  * @IWL_UCODE_TLV_CAPA_DQA_SUPPORT: supports dynamic queue allocation (DQA),
  *	which also implies support for the scheduler configuration command
+ * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command
  */
 enum iwl_ucode_tlv_capa {
 	IWL_UCODE_TLV_CAPA_D0I3_SUPPORT			= BIT(0),
@@ -163,6 +164,7 @@ enum iwl_ucode_tlv_capa {
 	IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT	= BIT(10),
 	IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT		= BIT(11),
 	IWL_UCODE_TLV_CAPA_DQA_SUPPORT			= BIT(12),
+	IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT		= BIT(18),
 };
 
 /* The default calibrate table size if not specified by firmware file */
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index b624058..b6d2683 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -2448,9 +2448,15 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,
 
 	switch (vif->type) {
 	case NL80211_IFTYPE_STATION:
-		/* Use aux roc framework (HS20) */
-		ret = iwl_mvm_send_aux_roc_cmd(mvm, channel,
-					       vif, duration);
+		if (mvm->fw->ucode_capa.capa[0] &
+		    IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT) {
+			/* Use aux roc framework (HS20) */
+			ret = iwl_mvm_send_aux_roc_cmd(mvm, channel,
+						       vif, duration);
+			goto out_unlock;
+		}
+		IWL_ERR(mvm, "hotspot not supported\n");
+		ret = -EINVAL;
 		goto out_unlock;
 	case NL80211_IFTYPE_P2P_DEVICE:
 		/* handle below */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: pull request: iwlwifi 2014-11-23
  2014-11-23 19:56 pull request: iwlwifi 2014-11-23 Emmanuel Grumbach
  2014-11-23 19:57 ` [PATCH] iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands Emmanuel Grumbach
@ 2014-11-24 18:55 ` John W. Linville
  1 sibling, 0 replies; 3+ messages in thread
From: John W. Linville @ 2014-11-24 18:55 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless, Emmanuel Grumbach

On Sun, Nov 23, 2014 at 09:56:23PM +0200, Emmanuel Grumbach wrote:
> Hi John,
> 
> I have a trivial patch for 3.18. details below.
> Thanks!
> 
> The following changes since commit 87dd634ae72bb8f6d0dd12f1cbbc67c7da6dba3b:
> 
>   iwlwifi: pcie: fix prph dump length (2014-11-11 07:24:57 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-john-2014-11-23
> 
> for you to fetch changes up to 5ac6c72e594471acfa5b00210c51d533a73413ad:
> 
>   iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands (2014-11-23 21:50:57 +0200)
> 
> ----------------------------------------------------------------
> Not all the firmware know how to handle the HOT_SPOT_CMD.
> Make sure that the firmware will know this command before
> sending it. This avoids a firmware crash.

Pulling now...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-24 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-23 19:56 pull request: iwlwifi 2014-11-23 Emmanuel Grumbach
2014-11-23 19:57 ` [PATCH] iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands Emmanuel Grumbach
2014-11-24 18:55 ` pull request: iwlwifi 2014-11-23 John W. Linville

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).