diff mbox

[2/2] ath10k: set peer MFP flag in peer assoc command

Message ID 1444194961-12777-1-git-send-email-c_traja@qti.qualcomm.com (mailing list archive)
State Accepted
Headers show

Commit Message

c_traja@qti.qualcomm.com Oct. 7, 2015, 5:16 a.m. UTC
From: Tamizh chelvam <c_traja@qti.qualcomm.com>

Set peer's management frame protection flag in peer assoc command,
this setting will enable/disable encrytion of management frames in fw.

Setting of this flag is based on whether MFP is enabled/disabled at STA
and a firmware feature flag ATH10K_FW_FEATURE_MFP_SUPPORT. This is because
only firmwares 10.1.561 and above have support for MFP.

Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
Signed-off-by: Manikanta pubbisetty <c_mpubbi@qti.qualcomm.com>
---
Notes:
	This patch has dependency of following patch.
	Revert "mac80211: remove exposing 'mfp' to drivers"

 drivers/net/wireless/ath/ath10k/core.c   |    1 +
 drivers/net/wireless/ath/ath10k/core.h   |    3 +++
 drivers/net/wireless/ath/ath10k/htt_tx.c |    7 +++++++
 drivers/net/wireless/ath/ath10k/mac.c    |    8 +++++++-
 4 files changed, 18 insertions(+), 1 deletion(-)

Comments

kernel test robot Oct. 7, 2015, 5:34 a.m. UTC | #1
Hi Tamizh,

[auto build test ERROR on next-20151006 -- if it's inappropriate base, please ignore]

config: xtensa-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_peer_assoc_h_crypto':
>> drivers/net/wireless/ath/ath10k/mac.c:2014:9: error: 'struct ieee80211_sta' has no member named 'mfp'
     if (sta->mfp &&
            ^

vim +2014 drivers/net/wireless/ath/ath10k/mac.c

  2008	
  2009		if (wpaie) {
  2010			ath10k_dbg(ar, ATH10K_DBG_WMI, "%s: wpa ie found\n", __func__);
  2011			arg->peer_flags |= ar->wmi.peer_flags->need_gtk_2_way;
  2012		}
  2013	
> 2014		if (sta->mfp &&
  2015		    test_bit(ATH10K_FW_FEATURE_MFP_SUPPORT, ar->fw_features)) {
  2016			arg->peer_flags |= ar->wmi.peer_flags->pmf;
  2017		}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Kalle Valo Oct. 7, 2015, 8:22 a.m. UTC | #2
kbuild test robot <lkp@intel.com> writes:

> Hi Tamizh,
>
> [auto build test ERROR on next-20151006 -- if it's inappropriate base, please ignore]
>
> config: xtensa-allyesconfig (attached as .config)
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=xtensa 
>
> All errors (new ones prefixed by >>):
>
>    drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_peer_assoc_h_crypto':
>>> drivers/net/wireless/ath/ath10k/mac.c:2014:9: error: 'struct ieee80211_sta' has no member named 'mfp'
>      if (sta->mfp &&

This is expected as the patch depends on not yet commited patch 'Revert
"mac80211: remove exposing 'mfp' to drivers"'.
c_traja@qti.qualcomm.com Oct. 7, 2015, 8:59 a.m. UTC | #3
kbuild test robot <lkp@intel.com> writes:

>> Hi Tamizh,
>>
>> [auto build test ERROR on next-20151006 -- if it's inappropriate base, please ignore]
>>
>> config: xtensa-allyesconfig (attached as .config)
>> reproduce:
> >        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # save the attached .config to linux build tree
>>         make.cross ARCH=xtensa 
>>
>> All errors (new ones prefixed by >>):
>>
>>    drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_peer_assoc_h_crypto':
>>>> drivers/net/wireless/ath/ath10k/mac.c:2014:9: error: 'struct ieee80211_sta' has no member named 'mfp'
>>      if (sta->mfp &&

>This is expected as the patch depends on not yet commited patch 'Revert
>"mac80211: remove exposing 'mfp' to drivers"'.

Yes, I have mention about the dependency in commit log notes. I have sent the required patch previous to this patch sets.
Kalle Valo Oct. 31, 2015, 9:38 a.m. UTC | #4
<c_traja@qti.qualcomm.com> writes:

> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
>
> Set peer's management frame protection flag in peer assoc command,
> this setting will enable/disable encrytion of management frames in fw.
>
> Setting of this flag is based on whether MFP is enabled/disabled at STA
> and a firmware feature flag ATH10K_FW_FEATURE_MFP_SUPPORT. This is because
> only firmwares 10.1.561 and above have support for MFP.
>
> Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
> Signed-off-by: Manikanta pubbisetty <c_mpubbi@qti.qualcomm.com>

There was a trivial conflict, please check my conflict resolution in the
pending branch:

https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c33d4ded1d2db2166c14afe602fe7ef645a5b16b
c_traja@qti.qualcomm.com Nov. 4, 2015, 5:20 a.m. UTC | #5
>> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
>>
>> Set peer's management frame protection flag in peer assoc command, 
>> this setting will enable/disable encrytion of management frames in fw.
>>
>> Setting of this flag is based on whether MFP is enabled/disabled at 
>> STA and a firmware feature flag ATH10K_FW_FEATURE_MFP_SUPPORT. This is 
>> because only firmwares 10.1.561 and above have support for MFP.
>>
>> Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
>> Signed-off-by: Manikanta pubbisetty <c_mpubbi@qti.qualcomm.com>

>There was a trivial conflict, please check my conflict resolution in the pending branch:

>https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c33d4ded1d2db2166c14afe602fe7ef645a5b16b


When I try to apply this patch. I got following conflict.

Checking patch drivers/net/wireless/ath/ath10k/core.c...
Checking patch drivers/net/wireless/ath/ath10k/core.h...
Hunk #1 succeeded at 512 (offset -1 lines).
Checking patch drivers/net/wireless/ath/ath10k/htt_tx.c...
Checking patch drivers/net/wireless/ath/ath10k/mac.c...
error: while searching for:
                ath10k_dbg(ar, ATH10K_DBG_WMI, "%s: wpa ie found\n", __func__);
                arg->peer_flags |= ar->wmi.peer_flags->need_gtk_2_way;
        }
}

static void ath10k_peer_assoc_h_rates(struct ath10k *ar,

error: patch failed: drivers/net/wireless/ath/ath10k/mac.c:2009
Hunk #3 succeeded at 2480 (offset -6 lines).
Applied patch drivers/net/wireless/ath/ath10k/core.c cleanly.
Applied patch drivers/net/wireless/ath/ath10k/core.h cleanly.
Applied patch drivers/net/wireless/ath/ath10k/htt_tx.c cleanly.
Applying patch drivers/net/wireless/ath/ath10k/mac.c with 1 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Hunk #3 applied cleanly.
Kalle Valo Nov. 4, 2015, 7:57 a.m. UTC | #6
"Raja, Tamizh Chelvam" <c_traja@qti.qualcomm.com> writes:

>>> From: Tamizh chelvam <c_traja@qti.qualcomm.com>
>>>
>>> Set peer's management frame protection flag in peer assoc command, 
>>> this setting will enable/disable encrytion of management frames in fw.
>>>
>>> Setting of this flag is based on whether MFP is enabled/disabled at 
>>> STA and a firmware feature flag ATH10K_FW_FEATURE_MFP_SUPPORT. This is 
>>> because only firmwares 10.1.561 and above have support for MFP.
>>>
>>> Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
>>> Signed-off-by: Manikanta pubbisetty <c_mpubbi@qti.qualcomm.com>
>
>>There was a trivial conflict, please check my conflict resolution in the pending branch:
>
>>https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=c33d4ded1d2db2166c14afe602fe7ef645a5b16b
>
>
> When I try to apply this patch. I got following conflict.
>
> Checking patch drivers/net/wireless/ath/ath10k/core.c...
> Checking patch drivers/net/wireless/ath/ath10k/core.h...
> Hunk #1 succeeded at 512 (offset -1 lines).
> Checking patch drivers/net/wireless/ath/ath10k/htt_tx.c...
> Checking patch drivers/net/wireless/ath/ath10k/mac.c...
> error: while searching for:

I don't know what you are trying to do, but I apply the patches from the
pending branch to ath-next. You might get a conflict if you apply the
patch to another branch.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 879625a..6a2dd34 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -151,6 +151,7 @@  static const char *const ath10k_core_fw_feature_str[] = {
 	[ATH10K_FW_FEATURE_NO_NWIFI_DECAP_4ADDR_PADDING] = "no-4addr-pad",
 	[ATH10K_FW_FEATURE_SUPPORTS_SKIP_CLOCK_INIT] = "skip-clock-init",
 	[ATH10K_FW_FEATURE_RAW_MODE_SUPPORT] = "raw-mode",
+	[ATH10K_FW_FEATURE_MFP_SUPPORT] = "mfp",
 };
 
 static unsigned int ath10k_core_get_fw_feature_str(char *buf,
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 3e4668e..0e23400 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -469,6 +469,9 @@  enum ath10k_fw_features {
 	 */
 	ATH10K_FW_FEATURE_RAW_MODE_SUPPORT = 10,
 
+	/* Firmware supports management frame protection */
+	ATH10K_FW_FEATURE_MFP_SUPPORT = 11,
+
 	/* keep last */
 	ATH10K_FW_FEATURE_COUNT,
 };
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index eb5ba9b..cd72860 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -459,6 +459,13 @@  int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 	}
 	msdu_id = res;
 
+	if ((ieee80211_is_action(hdr->frame_control) ||
+	     ieee80211_is_deauth(hdr->frame_control) ||
+	     ieee80211_is_disassoc(hdr->frame_control)) &&
+	     ieee80211_has_protected(hdr->frame_control)) {
+		skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
+	}
+
 	txdesc = ath10k_htc_alloc_skb(ar, len);
 	if (!txdesc) {
 		res = -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index dc80d0b..71cba8c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1968,6 +1968,7 @@  static void ath10k_peer_assoc_h_basic(struct ath10k *ar,
 
 static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,
 				       struct ieee80211_vif *vif,
+				       struct ieee80211_sta *sta,
 				       struct wmi_peer_assoc_complete_arg *arg)
 {
 	struct ieee80211_bss_conf *info = &vif->bss_conf;
@@ -2009,6 +2010,11 @@  static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,
 		ath10k_dbg(ar, ATH10K_DBG_WMI, "%s: wpa ie found\n", __func__);
 		arg->peer_flags |= ar->wmi.peer_flags->need_gtk_2_way;
 	}
+
+	if (sta->mfp &&
+	    test_bit(ATH10K_FW_FEATURE_MFP_SUPPORT, ar->fw_features)) {
+		arg->peer_flags |= ar->wmi.peer_flags->pmf;
+	}
 }
 
 static void ath10k_peer_assoc_h_rates(struct ath10k *ar,
@@ -2479,7 +2485,7 @@  static int ath10k_peer_assoc_prepare(struct ath10k *ar,
 	memset(arg, 0, sizeof(*arg));
 
 	ath10k_peer_assoc_h_basic(ar, vif, sta, arg);
-	ath10k_peer_assoc_h_crypto(ar, vif, arg);
+	ath10k_peer_assoc_h_crypto(ar, vif, sta, arg);
 	ath10k_peer_assoc_h_rates(ar, vif, sta, arg);
 	ath10k_peer_assoc_h_ht(ar, vif, sta, arg);
 	ath10k_peer_assoc_h_vht(ar, vif, sta, arg);