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

Commit c6ec66c2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ath10k: update wowlan config and rekey data store method"

parents 964ace7c b3ea6326
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)