@@ -555,6 +555,8 @@ struct ath11k {
#endif
bool dfs_block_radar_events;
struct ath11k_thermal thermal;
+ struct completion target_suspend;
+ bool target_suspend_ack;
};
struct ath11k_band_cap {
@@ -328,8 +328,18 @@ void ath11k_htc_rx_completion_handler(struct ath11k_base *ab,
complete(&htc->ctl_resp);
break;
+ case ATH11K_HTC_MSG_SEND_SUSPEND_COMPLETE:
+ htc->htc_ops.target_send_suspend_complete(ab->pdevs[0].ar, true);
+ break;
+ case ATH11K_HTC_MSG_NACK_SUSPEND:
+ htc->htc_ops.target_send_suspend_complete(ab->pdevs[0].ar, false);
+ break;
+ case ATH11K_HTC_MSG_WAKEUP_FROM_SUSPEND_ID:
+ htc->htc_ops.target_wakeup_from_suspend(ab->pdevs[0].ar);
+ break;
default:
- ath11k_warn(ab, "ignoring unsolicited htc ep0 event\n");
+ ath11k_warn(ab, "ignoring unsolicited htc ep0 event %ld\n",
+ FIELD_GET(HTC_MSG_MESSAGEID, msg->msg_svc_id));
break;
}
goto out;
@@ -720,6 +730,19 @@ int ath11k_htc_start(struct ath11k_htc *htc)
return 0;
}
+static void ath11k_send_suspend_complete(struct ath11k *ar, bool ack)
+{
+ ath11k_dbg(ar->ab, ATH11K_DBG_BOOT, "boot suspend complete %d\n", ack);
+
+ ar->target_suspend_ack = ack;
+ complete(&ar->target_suspend);
+}
+
+static void ath11k_wakeup_from_suspend(struct ath11k *ar)
+{
+ ath11k_dbg(ar->ab, ATH11K_DBG_BOOT, "wakeup from suspend is received\n");
+}
+
int ath11k_htc_init(struct ath11k_base *ab)
{
struct ath11k_htc *htc = &ab->htc;
@@ -731,6 +754,11 @@ int ath11k_htc_init(struct ath11k_base *ab)
ath11k_htc_reset_endpoint_states(htc);
+ htc->htc_ops.target_send_suspend_complete =
+ ath11k_send_suspend_complete;
+ htc->htc_ops.target_wakeup_from_suspend =
+ ath11k_wakeup_from_suspend;
+
htc->ab = ab;
switch (ab->wmi_ab.preferred_hw_mode) {
@@ -13,6 +13,7 @@
#include <linux/timer.h>
struct ath11k_base;
+struct ath11k;
#define HTC_HDR_ENDPOINTID GENMASK(7, 0)
#define HTC_HDR_FLAGS GENMASK(15, 8)
@@ -65,7 +66,10 @@ enum ath11k_htc_msg_id {
ATH11K_HTC_MSG_CONNECT_SERVICE_RESP_ID = 3,
ATH11K_HTC_MSG_SETUP_COMPLETE_ID = 4,
ATH11K_HTC_MSG_SETUP_COMPLETE_EX_ID = 5,
- ATH11K_HTC_MSG_SEND_SUSPEND_COMPLETE = 6
+ ATH11K_HTC_MSG_SEND_SUSPEND_COMPLETE = 6,
+ ATH11K_HTC_MSG_NACK_SUSPEND = 7,
+ ATH11K_HTC_MSG_WAKEUP_FROM_SUSPEND_ID = 8
+
};
enum ath11k_htc_version {
@@ -222,7 +226,8 @@ enum ath11k_htc_ep_id {
};
struct ath11k_htc_ops {
- void (*target_send_suspend_complete)(struct ath11k_base *ar);
+ void (*target_send_suspend_complete)(struct ath11k *ar, bool ack);
+ void (*target_wakeup_from_suspend)(struct ath11k *ar);
};
struct ath11k_htc_ep_ops {
@@ -6403,6 +6403,7 @@ int ath11k_mac_allocate(struct ath11k_base *ab)
init_completion(&ar->scan.started);
init_completion(&ar->scan.completed);
init_completion(&ar->thermal.wmi_sync);
+ init_completion(&ar->target_suspend);
INIT_DELAYED_WORK(&ar->scan.timeout, ath11k_scan_timeout_work);
INIT_WORK(&ar->regd_update_work, ath11k_regd_update_work);