Skip to content

Commit

Permalink
wcn36xx: Add Host suspend indication support
Browse files Browse the repository at this point in the history
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: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Tested-by: Benjamin Li <benl@squareup.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210605011140.2004643-11-bryan.odonoghue@linaro.org
  • Loading branch information
Bryan O'Donoghue authored and Kalle Valo committed Jun 14, 2021
1 parent bedf116 commit 60f0078
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/wcn36xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions drivers/net/wireless/ath/wcn36xx/smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/wcn36xx/smd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */

0 comments on commit 60f0078

Please sign in to comment.