OSDN Git Service

ath10k: update wowlan config and rekey data store method
authorSarada Prasanna Garnayak <sgarna@codeaurora.org>
Wed, 18 Apr 2018 09:58:42 +0000 (15:28 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 25 Apr 2018 10:07:11 +0000 (03:07 -0700)
In wow suspend method clean up the old configured wow events
before enabling the WLAN offloads and wakeup wow events.

The rekey data set ops is not part of the ieee80211 power
management ops so remove the rekey data set method from wow
and add it in ath10k mac layer.

CRs-Fixed: 2226944
Change-Id: Ida7592097f949734b5880c470845780295a695af
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/wow.c
drivers/net/wireless/ath/ath10k/wow.h

index fe86dc8..008fd63 100644 (file)
@@ -5665,6 +5665,22 @@ static void ath10k_set_key_h_def_keyidx(struct ath10k *ar,
                            arvif->vdev_id, ret);
 }
 
+static void ath10k_set_rekey_data(struct ieee80211_hw *hw,
+                                 struct ieee80211_vif *vif,
+                                 struct cfg80211_gtk_rekey_data *data)
+{
+       struct ath10k *ar = hw->priv;
+       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
+
+       mutex_lock(&ar->conf_mutex);
+       memcpy(&arvif->gtk_rekey_data.kek, data->kek, NL80211_KEK_LEN);
+       memcpy(&arvif->gtk_rekey_data.kck, data->kck, NL80211_KCK_LEN);
+       arvif->gtk_rekey_data.replay_ctr =
+                       be64_to_cpup((__be64 *)data->replay_ctr);
+       arvif->gtk_rekey_data.valid = true;
+       mutex_unlock(&ar->conf_mutex);
+}
+
 static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                          struct ieee80211_vif *vif, struct ieee80211_sta *sta,
                          struct ieee80211_key_conf *key)
@@ -7609,6 +7625,7 @@ static const struct ieee80211_ops ath10k_ops = {
        .bss_info_changed               = ath10k_bss_info_changed,
        .hw_scan                        = ath10k_hw_scan,
        .cancel_hw_scan                 = ath10k_cancel_hw_scan,
+       .set_rekey_data                 = ath10k_set_rekey_data,
        .set_key                        = ath10k_set_key,
        .set_default_unicast_key        = ath10k_set_default_unicast_key,
        .sta_state                      = ath10k_sta_state,
@@ -7644,7 +7661,6 @@ static const struct ieee80211_ops ath10k_ops = {
        .suspend                        = ath10k_wow_op_suspend,
        .resume                         = ath10k_wow_op_resume,
        .set_wakeup                     = ath10k_wow_op_set_wakeup,
-       .set_rekey_data                 = ath10k_wow_op_set_rekey_data,
 #endif
 #ifdef CONFIG_MAC80211_DEBUGFS
        .sta_add_debugfs                = ath10k_sta_add_debugfs,
index 69066ef..2280f47 100644 (file)
@@ -445,22 +445,6 @@ static int ath10k_config_wow_listen_interval(struct ath10k *ar)
        return 0;
 }
 
-void ath10k_wow_op_set_rekey_data(struct ieee80211_hw *hw,
-                                 struct ieee80211_vif *vif,
-                                 struct cfg80211_gtk_rekey_data *data)
-{
-       struct ath10k *ar = hw->priv;
-       struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
-
-       mutex_lock(&ar->conf_mutex);
-       memcpy(&arvif->gtk_rekey_data.kek, data->kek, NL80211_KEK_LEN);
-       memcpy(&arvif->gtk_rekey_data.kck, data->kck, NL80211_KCK_LEN);
-       arvif->gtk_rekey_data.replay_ctr =
-               cpu_to_le64(be64_to_cpup((__be64 *)data->replay_ctr));
-       arvif->gtk_rekey_data.valid = true;
-       mutex_unlock(&ar->conf_mutex);
-}
-
 static int ath10k_wow_config_gtk_offload(struct ath10k *ar, bool gtk_offload)
 {
        struct ath10k_vif *arvif;
@@ -509,6 +493,13 @@ int ath10k_wow_op_suspend(struct ieee80211_hw *hw,
                goto exit;
        }
 
+       ret =  ath10k_wow_cleanup(ar);
+       if (ret) {
+               ath10k_warn(ar, "failed to clear wow wakeup events: %d\n",
+                           ret);
+               goto exit;
+       }
+
        ret = ath10k_wow_config_gtk_offload(ar, true);
        if (ret) {
                ath10k_warn(ar, "failed to enable GTK offload: %d\n", ret);
@@ -521,18 +512,11 @@ int ath10k_wow_op_suspend(struct ieee80211_hw *hw,
                goto disable_gtk_offload;
        }
 
-       ret =  ath10k_wow_cleanup(ar);
-       if (ret) {
-               ath10k_warn(ar, "failed to clear wow wakeup events: %d\n",
-                           ret);
-               goto disable_ns_arp_offload;
-       }
-
        ret = ath10k_wow_set_wakeups(ar, wowlan);
        if (ret) {
                ath10k_warn(ar, "failed to set wow wakeup events: %d\n",
                            ret);
-               goto cleanup;
+               goto disable_ns_arp_offload;
        }
 
        ret = ath10k_config_wow_listen_interval(ar);
index a338817..2ca4ba4 100644 (file)
@@ -32,9 +32,6 @@ int ath10k_wow_op_suspend(struct ieee80211_hw *hw,
                          struct cfg80211_wowlan *wowlan);
 int ath10k_wow_op_resume(struct ieee80211_hw *hw);
 void ath10k_wow_op_set_wakeup(struct ieee80211_hw *hw, bool enabled);
-void ath10k_wow_op_set_rekey_data(struct ieee80211_hw *hw,
-                                 struct ieee80211_vif *vif,
-                                 struct cfg80211_gtk_rekey_data *data);
 #else
 
 static inline int ath10k_wow_init(struct ath10k *ar)