OSDN Git Service

iwlwifi: mvm: set PROTECTED_TWT in MAC data policy
authorShaul Triebitz <shaul.triebitz@intel.com>
Fri, 11 Sep 2020 17:44:31 +0000 (20:44 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 1 Oct 2020 18:52:58 +0000 (21:52 +0300)
If Protected-TWT is supported by BSS and by us, set the
PROTECTED_TWT bit in the data_policy in the MAC context command.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200911204056.e5e36b41fbd7.I25be500451890be2165fa56cbe0b0a600b4a2a9e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

index 81bc05d..8c98def 100644 (file)
@@ -5,10 +5,9 @@
  *
  * GPL LICENSE SUMMARY
  *
- * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 - 2019 Intel Corporation
+ * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
  *
  * BSD LICENSE
  *
- * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 - 2019 Intel Corporation
+ * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -704,8 +702,12 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,
 
        if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) {
                cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX);
-               if (vif->bss_conf.twt_requester && IWL_MVM_USE_TWT)
+               if (vif->bss_conf.twt_requester && IWL_MVM_USE_TWT) {
                        ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED);
+                       if (vif->bss_conf.twt_protected)
+                               ctxt_sta->data_policy |=
+                                       cpu_to_le32(PROTECTED_TWT_SUPPORTED);
+               }
        }