Commit 60f0078b authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Kalle Valo
Browse files

wcn36xx: Add Host suspend indication support



In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK
offload we need to send a unidirectional indication from host to wcn
indicating a transition to suspend.

Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and
perform GTK rekeys without waking the host.

Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: default avatarBenjamin Li <benl@squareup.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210605011140.2004643-11-bryan.odonoghue@linaro.org
parent bedf1169
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1125,6 +1125,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow)
		if (ret)
			goto out;
		ret = wcn36xx_smd_set_power_params(wcn, true);
		if (ret)
			goto out;
		ret = wcn36xx_smd_wlan_host_suspend_ind(wcn);
	}
out:
	mutex_unlock(&wcn->conf_mutex);
+19 −0
Original line number Diff line number Diff line
@@ -2966,6 +2966,25 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn,
	return ret;
}

int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn)
{
	struct wcn36xx_hal_wlan_host_suspend_ind_msg msg_body;
	int ret;

	mutex_lock(&wcn->hal_mutex);

	INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_SUSPEND_IND);
	msg_body.configured_mcst_bcst_filter_setting = 0;
	msg_body.active_session_count = 1;
	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);

	ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, msg_body.header.len);

	mutex_unlock(&wcn->hal_mutex);

	return ret;
}

int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev,
			    void *buf, int len, void *priv, u32 addr)
{
+2 −0
Original line number Diff line number Diff line
@@ -159,4 +159,6 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif,
int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn,
				     struct ieee80211_vif *vif);

int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn);

#endif	/* _SMD_H_ */