diff mbox

rt2800usb: enable MFP if hw crypt is disabled

Message ID 1461135572-7468-1-git-send-email-yeohchunyeow@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Chun-Yeow Yeoh April 20, 2016, 6:59 a.m. UTC
If rt2800usb is loaded with nohwcrypt=1, mac80211 takes
care of the crypto with software encryption/decryption
and thus, MFP can be used.

Tested for secured mesh using ath9k_htc and ath9k.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 1 +
 1 file changed, 1 insertion(+)

--
2.3.0

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

Comments

Stanislaw Gruszka April 20, 2016, 4:04 p.m. UTC | #1
On Wed, Apr 20, 2016 at 02:59:32PM +0800, Chun-Yeow Yeoh wrote:
> If rt2800usb is loaded with nohwcrypt=1, mac80211 takes
> care of the crypto with software encryption/decryption
> and thus, MFP can be used.
> 
> Tested for secured mesh using ath9k_htc and ath9k.
> 
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
> index 4b0bb6b..84ea329 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
> @@ -48,6 +48,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
> 
>  static bool rt2800usb_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev)
>  {
> +	ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
>  	return modparam_nohwcrypt;

You set MFP feature regardless if actually hwcrypt is disabled or not.
Beside this should not be done in function which is intended to test
if hw crypto is disabled. Please set the future in place where other
hw->flags are set.

Thanks
Stanislaw
--
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 April 20, 2016, 4:42 p.m. UTC | #2
Noted. Patch v2 sent.

----
Chun-Yeow

On Thu, Apr 21, 2016 at 12:04 AM, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> On Wed, Apr 20, 2016 at 02:59:32PM +0800, Chun-Yeow Yeoh wrote:
>> If rt2800usb is loaded with nohwcrypt=1, mac80211 takes
>> care of the crypto with software encryption/decryption
>> and thus, MFP can be used.
>>
>> Tested for secured mesh using ath9k_htc and ath9k.
>>
>> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
>> ---
>>  drivers/net/wireless/ralink/rt2x00/rt2800usb.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
>> index 4b0bb6b..84ea329 100644
>> --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
>> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
>> @@ -48,6 +48,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
>>
>>  static bool rt2800usb_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev)
>>  {
>> +     ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
>>       return modparam_nohwcrypt;
>
> You set MFP feature regardless if actually hwcrypt is disabled or not.
> Beside this should not be done in function which is intended to test
> if hw crypto is disabled. Please set the future in place where other
> hw->flags are set.
>
> Thanks
> Stanislaw
--
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/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
index 4b0bb6b..84ea329 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
@@ -48,6 +48,7 @@  MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

 static bool rt2800usb_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev)
 {
+	ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
 	return modparam_nohwcrypt;
 }