Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3ea6326 authored by Sarada Prasanna Garnayak's avatar Sarada Prasanna Garnayak Committed by Gerrit - the friendly Code Review server
Browse files

ath10k: update wowlan config and rekey data store method



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: default avatarSarada Prasanna Garnayak <sgarna@codeaurora.org>
parent 226713a8
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -5641,6 +5641,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)
@@ -7568,6 +7584,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,
@@ -7603,7 +7620,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,
+8 −24
Original line number Diff line number Diff line
@@ -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);
+0 −3
Original line number Diff line number Diff line
@@ -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)