diff mbox

ath9k_htc: turn on software mgmt crypto for secured mesh

Message ID 1415941631-24140-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Chun-Yeow Yeoh Nov. 14, 2014, 5:07 a.m. UTC
Secured mesh encrypts the unicast mgmt frame using the same
key that used for encrypting the unicast data frame. The patch
"ath9k_htc_firmware: fix the offset of CCMP header for mesh
data frame" applied to open-ath9k-htc-firmware allows the
ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
this is not working and we still need CCMP encryption of
management frames to be done in software. Fix this.

This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11n

and managed to work with peer mesh STA equipped with ath9k.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Oleksij Rempel Nov. 14, 2014, 8:54 a.m. UTC | #1
Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
> Secured mesh encrypts the unicast mgmt frame using the same
> key that used for encrypting the unicast data frame. The patch
> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
> data frame" applied to open-ath9k-htc-firmware allows the
> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
> this is not working and we still need CCMP encryption of
> management frames to be done in software. Fix this.
> 
> This patch is tested with the following hardwares:
> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
> - AR9271 802.11n
> 
> and managed to work with peer mesh STA equipped with ath9k.
> 
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
> ---
>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> index 689ac99..d3f65a2 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>  			key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>  			if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>  				key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
> -			if (priv->ah->sw_mgmt_crypto &&
> +			if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
> +			     priv->ah->sw_mgmt_crypto) &&
>  			    key->cipher == WLAN_CIPHER_SUITE_CCMP)
>  				key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>  			ret = 0;
> 


Hmm.. may be we should generally do it here:
        if ((vif->type == NL80211_IFTYPE_ADHOC ||
             vif->type == NL80211_IFTYPE_MESH_POINT) &&
            (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
             key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
            !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {

or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
usb devices?
Chun-Yeow Yeoh Nov. 14, 2014, 9:06 a.m. UTC | #2
On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>> Secured mesh encrypts the unicast mgmt frame using the same
>> key that used for encrypting the unicast data frame. The patch
>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>> data frame" applied to open-ath9k-htc-firmware allows the
>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>> this is not working and we still need CCMP encryption of
>> management frames to be done in software. Fix this.
>>
>> This patch is tested with the following hardwares:
>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>> - AR9271 802.11n
>>
>> and managed to work with peer mesh STA equipped with ath9k.
>>
>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>> ---
>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>> index 689ac99..d3f65a2 100644
>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>> -                     if (priv->ah->sw_mgmt_crypto &&
>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>> +                          priv->ah->sw_mgmt_crypto) &&
>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>                       ret = 0;
>>
>
>
> Hmm.. may be we should generally do it here:
>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>

Not so sure doing here is correctly. It is a pairwise key for unicast
management frame, right?

> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
> usb devices?

All ath9k USB devices don't have MFP support?

---
ChunYeow
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chun-Yeow Yeoh Nov. 14, 2014, 9:18 a.m. UTC | #3
Hi, Oleksij Rpel

If we do it in ath9k_hw_init_mfp, these MAC version are related to USB devices:

AR_SREV_VERSION_9271
AR_SREV_VERSION_9280
AR_SREV_VERSION_9287

Right?

----
ChunYeow

On Fri, Nov 14, 2014 at 5:06 PM, Yeoh Chun-Yeow <yeohchunyeow@gmail.com> wrote:
> On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>>> Secured mesh encrypts the unicast mgmt frame using the same
>>> key that used for encrypting the unicast data frame. The patch
>>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>>> data frame" applied to open-ath9k-htc-firmware allows the
>>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>>> this is not working and we still need CCMP encryption of
>>> management frames to be done in software. Fix this.
>>>
>>> This patch is tested with the following hardwares:
>>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>>> - AR9271 802.11n
>>>
>>> and managed to work with peer mesh STA equipped with ath9k.
>>>
>>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>>> ---
>>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> index 689ac99..d3f65a2 100644
>>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>>> -                     if (priv->ah->sw_mgmt_crypto &&
>>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>>> +                          priv->ah->sw_mgmt_crypto) &&
>>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>>                       ret = 0;
>>>
>>
>>
>> Hmm.. may be we should generally do it here:
>>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>>
>
> Not so sure doing here is correctly. It is a pairwise key for unicast
> management frame, right?
>
>> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
>> usb devices?
>
> All ath9k USB devices don't have MFP support?
>
> ---
> ChunYeow
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Oleksij Rempel Nov. 14, 2014, 9:51 a.m. UTC | #4
Am 14.11.2014 um 10:18 schrieb Yeoh Chun-Yeow:
> Hi, Oleksij Rpel
> 
> If we do it in ath9k_hw_init_mfp, these MAC version are related to USB devices:
> 
> AR_SREV_VERSION_9271
> AR_SREV_VERSION_9280
> AR_SREV_VERSION_9287
> 
> Right?

yes. ar9271 with usb interface. ar9280 and ar9287 are pcie attached to
ar7010 cpu.

> ----
> ChunYeow
> 
> On Fri, Nov 14, 2014 at 5:06 PM, Yeoh Chun-Yeow <yeohchunyeow@gmail.com> wrote:
>> On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>>>> Secured mesh encrypts the unicast mgmt frame using the same
>>>> key that used for encrypting the unicast data frame. The patch
>>>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>>>> data frame" applied to open-ath9k-htc-firmware allows the
>>>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>>>> this is not working and we still need CCMP encryption of
>>>> management frames to be done in software. Fix this.
>>>>
>>>> This patch is tested with the following hardwares:
>>>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>>>> - AR9271 802.11n
>>>>
>>>> and managed to work with peer mesh STA equipped with ath9k.
>>>>
>>>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>>>> ---
>>>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> index 689ac99..d3f65a2 100644
>>>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>>>> -                     if (priv->ah->sw_mgmt_crypto &&
>>>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>>>> +                          priv->ah->sw_mgmt_crypto) &&
>>>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>>>                       ret = 0;
>>>>
>>>
>>>
>>> Hmm.. may be we should generally do it here:
>>>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>>>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>>>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>>>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>>>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>>>
>>
>> Not so sure doing here is correctly. It is a pairwise key for unicast
>> management frame, right?
>>
>>> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
>>> usb devices?
>>
>> All ath9k USB devices don't have MFP support?
>>
>> ---
>> ChunYeow
Oleksij Rempel Nov. 14, 2014, 9:57 a.m. UTC | #5
Am 14.11.2014 um 10:06 schrieb Yeoh Chun-Yeow:
> On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>>> Secured mesh encrypts the unicast mgmt frame using the same
>>> key that used for encrypting the unicast data frame. The patch
>>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>>> data frame" applied to open-ath9k-htc-firmware allows the
>>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>>> this is not working and we still need CCMP encryption of
>>> management frames to be done in software. Fix this.
>>>
>>> This patch is tested with the following hardwares:
>>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>>> - AR9271 802.11n
>>>
>>> and managed to work with peer mesh STA equipped with ath9k.
>>>
>>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>>> ---
>>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> index 689ac99..d3f65a2 100644
>>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>>> -                     if (priv->ah->sw_mgmt_crypto &&
>>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>>> +                          priv->ah->sw_mgmt_crypto) &&
>>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>>                       ret = 0;
>>>
>>
>>
>> Hmm.. may be we should generally do it here:
>>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>>
> 
> Not so sure doing here is correctly. It is a pairwise key for unicast
> management frame, right?

yes.
this code is identical to ath9k, so i will move it to common. This is
the reason of my doubts.

>> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
>> usb devices?
> 
> All ath9k USB devices don't have MFP support?

Hmm... do you have docs?
Chun-Yeow Yeoh Nov. 14, 2014, 11 a.m. UTC | #6
Unfortunately, I don't have any docs for this. Any others?

---
ChunYeow

On Fri, Nov 14, 2014 at 5:57 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 14.11.2014 um 10:06 schrieb Yeoh Chun-Yeow:
>> On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>>>> Secured mesh encrypts the unicast mgmt frame using the same
>>>> key that used for encrypting the unicast data frame. The patch
>>>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>>>> data frame" applied to open-ath9k-htc-firmware allows the
>>>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>>>> this is not working and we still need CCMP encryption of
>>>> management frames to be done in software. Fix this.
>>>>
>>>> This patch is tested with the following hardwares:
>>>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>>>> - AR9271 802.11n
>>>>
>>>> and managed to work with peer mesh STA equipped with ath9k.
>>>>
>>>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>>>> ---
>>>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> index 689ac99..d3f65a2 100644
>>>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>>>> -                     if (priv->ah->sw_mgmt_crypto &&
>>>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>>>> +                          priv->ah->sw_mgmt_crypto) &&
>>>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>>>                       ret = 0;
>>>>
>>>
>>>
>>> Hmm.. may be we should generally do it here:
>>>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>>>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>>>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>>>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>>>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>>>
>>
>> Not so sure doing here is correctly. It is a pairwise key for unicast
>> management frame, right?
>
> yes.
> this code is identical to ath9k, so i will move it to common. This is
> the reason of my doubts.
>
>>> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
>>> usb devices?
>>
>> All ath9k USB devices don't have MFP support?
>
> Hmm... do you have docs?
>
> --
> Regards,
> Oleksij
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chun-Yeow Yeoh Nov. 14, 2014, 11:02 a.m. UTC | #7
On Fri, Nov 14, 2014 at 5:51 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 14.11.2014 um 10:18 schrieb Yeoh Chun-Yeow:
>> Hi, Oleksij Rpel
>>
>> If we do it in ath9k_hw_init_mfp, these MAC version are related to USB devices:
>>
>> AR_SREV_VERSION_9271
>> AR_SREV_VERSION_9280
>> AR_SREV_VERSION_9287
>>
>> Right?
>
> yes. ar9271 with usb interface. ar9280 and ar9287 are pcie attached to
> ar7010 cpu.
>

Alright, I will work out the patch using ath9k_hw_init_mfp.

---
ChunYeow

>> ----
>> ChunYeow
>>
>> On Fri, Nov 14, 2014 at 5:06 PM, Yeoh Chun-Yeow <yeohchunyeow@gmail.com> wrote:
>>> On Fri, Nov 14, 2014 at 4:54 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>>>> Am 14.11.2014 um 06:07 schrieb Chun-Yeow Yeoh:
>>>>> Secured mesh encrypts the unicast mgmt frame using the same
>>>>> key that used for encrypting the unicast data frame. The patch
>>>>> "ath9k_htc_firmware: fix the offset of CCMP header for mesh
>>>>> data frame" applied to open-ath9k-htc-firmware allows the
>>>>> ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
>>>>> this is not working and we still need CCMP encryption of
>>>>> management frames to be done in software. Fix this.
>>>>>
>>>>> This patch is tested with the following hardwares:
>>>>> - TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
>>>>> - AR9271 802.11n
>>>>>
>>>>> and managed to work with peer mesh STA equipped with ath9k.
>>>>>
>>>>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>>>>> ---
>>>>>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 ++-
>>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>>> index 689ac99..d3f65a2 100644
>>>>> --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>>> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
>>>>> @@ -1447,7 +1447,8 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,
>>>>>                       key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>>>>                       if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
>>>>>                               key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
>>>>> -                     if (priv->ah->sw_mgmt_crypto &&
>>>>> +                     if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
>>>>> +                          priv->ah->sw_mgmt_crypto) &&
>>>>>                           key->cipher == WLAN_CIPHER_SUITE_CCMP)
>>>>>                               key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>>>>>                       ret = 0;
>>>>>
>>>>
>>>>
>>>> Hmm.. may be we should generally do it here:
>>>>         if ((vif->type == NL80211_IFTYPE_ADHOC ||
>>>>              vif->type == NL80211_IFTYPE_MESH_POINT) &&
>>>>             (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
>>>>              key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
>>>>             !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
>>>>
>>>
>>> Not so sure doing here is correctly. It is a pairwise key for unicast
>>> management frame, right?
>>>
>>>> or probably set "sw_mgmt_crypto = true" in ath9k_hw_init_mfp() for all
>>>> usb devices?
>>>
>>> All ath9k USB devices don't have MFP support?
>>>
>>> ---
>>> ChunYeow
>
>
> --
> Regards,
> Oleksij
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 689ac99..d3f65a2 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1447,7 +1447,8 @@  static int ath9k_htc_set_key(struct ieee80211_hw *hw,
 			key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
 			if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
 				key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
-			if (priv->ah->sw_mgmt_crypto &&
+			if ((vif->type == NL80211_IFTYPE_MESH_POINT ||
+			     priv->ah->sw_mgmt_crypto) &&
 			    key->cipher == WLAN_CIPHER_SUITE_CCMP)
 				key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
 			ret = 0;