Loading drivers/net/wireless/ath/wil6210/wmi.c +43 −3 Original line number Diff line number Diff line Loading @@ -2196,6 +2196,16 @@ int wmi_link_maintain_cfg_write(struct wil6210_priv *wil, return rc; } static const char *suspend_status2name(u8 status) { switch (status) { case WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE: return "LINK_NOT_IDLE"; default: return "Untracked status"; } } int wmi_suspend(struct wil6210_priv *wil) { int rc; Loading @@ -2211,7 +2221,7 @@ int wmi_suspend(struct wil6210_priv *wil) wil->suspend_resp_rcvd = false; wil->suspend_resp_comp = false; reply.evt.status = WMI_TRAFFIC_SUSPEND_REJECTED; reply.evt.status = WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE; rc = wmi_call(wil, WMI_TRAFFIC_SUSPEND_CMDID, &cmd, sizeof(cmd), WMI_TRAFFIC_SUSPEND_EVENTID, &reply, sizeof(reply), Loading Loading @@ -2243,8 +2253,9 @@ int wmi_suspend(struct wil6210_priv *wil) } wil_dbg_wmi(wil, "suspend_response_completed rcvd\n"); if (reply.evt.status == WMI_TRAFFIC_SUSPEND_REJECTED) { wil_dbg_pm(wil, "device rejected the suspend\n"); if (reply.evt.status != WMI_TRAFFIC_SUSPEND_APPROVED) { wil_dbg_pm(wil, "device rejected the suspend, %s\n", suspend_status2name(reply.evt.status)); wil->suspend_stats.rejected_by_device++; } rc = reply.evt.status; Loading @@ -2256,21 +2267,50 @@ int wmi_suspend(struct wil6210_priv *wil) return rc; } static void resume_triggers2string(u32 triggers, char *string, int str_size) { string[0] = '\0'; if (!triggers) { strlcat(string, " UNKNOWN", str_size); return; } if (triggers & WMI_RESUME_TRIGGER_HOST) strlcat(string, " HOST", str_size); if (triggers & WMI_RESUME_TRIGGER_UCAST_RX) strlcat(string, " UCAST_RX", str_size); if (triggers & WMI_RESUME_TRIGGER_BCAST_RX) strlcat(string, " BCAST_RX", str_size); if (triggers & WMI_RESUME_TRIGGER_WMI_EVT) strlcat(string, " WMI_EVT", str_size); } int wmi_resume(struct wil6210_priv *wil) { int rc; char string[100]; struct { struct wmi_cmd_hdr wmi; struct wmi_traffic_resume_event evt; } __packed reply; reply.evt.status = WMI_TRAFFIC_RESUME_FAILED; reply.evt.resume_triggers = WMI_RESUME_TRIGGER_UNKNOWN; rc = wmi_call(wil, WMI_TRAFFIC_RESUME_CMDID, NULL, 0, WMI_TRAFFIC_RESUME_EVENTID, &reply, sizeof(reply), WIL_WAIT_FOR_SUSPEND_RESUME_COMP); if (rc) return rc; resume_triggers2string(le32_to_cpu(reply.evt.resume_triggers), string, sizeof(string)); wil_dbg_pm(wil, "device resume %s, resume triggers:%s (0x%x)\n", reply.evt.status ? "failed" : "passed", string, le32_to_cpu(reply.evt.resume_triggers)); return reply.evt.status; } Loading drivers/net/wireless/ath/wil6210/wmi.h +14 −3 Original line number Diff line number Diff line Loading @@ -2270,7 +2270,7 @@ struct wmi_link_maintain_cfg_read_done_event { enum wmi_traffic_suspend_status { WMI_TRAFFIC_SUSPEND_APPROVED = 0x0, WMI_TRAFFIC_SUSPEND_REJECTED = 0x1, WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE = 0x1, }; /* WMI_TRAFFIC_SUSPEND_EVENTID */ Loading @@ -2284,10 +2284,21 @@ enum wmi_traffic_resume_status { WMI_TRAFFIC_RESUME_FAILED = 0x1, }; enum wmi_resume_trigger { WMI_RESUME_TRIGGER_UNKNOWN = 0x0, WMI_RESUME_TRIGGER_HOST = 0x1, WMI_RESUME_TRIGGER_UCAST_RX = 0x2, WMI_RESUME_TRIGGER_BCAST_RX = 0x4, WMI_RESUME_TRIGGER_WMI_EVT = 0x8, }; /* WMI_TRAFFIC_RESUME_EVENTID */ struct wmi_traffic_resume_event { /* enum wmi_traffic_resume_status_e */ /* enum wmi_traffic_resume_status */ u8 status; u8 reserved[3]; /* enum wmi_resume_trigger bitmap */ __le32 resume_triggers; } __packed; /* Power Save command completion status codes */ Loading Loading
drivers/net/wireless/ath/wil6210/wmi.c +43 −3 Original line number Diff line number Diff line Loading @@ -2196,6 +2196,16 @@ int wmi_link_maintain_cfg_write(struct wil6210_priv *wil, return rc; } static const char *suspend_status2name(u8 status) { switch (status) { case WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE: return "LINK_NOT_IDLE"; default: return "Untracked status"; } } int wmi_suspend(struct wil6210_priv *wil) { int rc; Loading @@ -2211,7 +2221,7 @@ int wmi_suspend(struct wil6210_priv *wil) wil->suspend_resp_rcvd = false; wil->suspend_resp_comp = false; reply.evt.status = WMI_TRAFFIC_SUSPEND_REJECTED; reply.evt.status = WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE; rc = wmi_call(wil, WMI_TRAFFIC_SUSPEND_CMDID, &cmd, sizeof(cmd), WMI_TRAFFIC_SUSPEND_EVENTID, &reply, sizeof(reply), Loading Loading @@ -2243,8 +2253,9 @@ int wmi_suspend(struct wil6210_priv *wil) } wil_dbg_wmi(wil, "suspend_response_completed rcvd\n"); if (reply.evt.status == WMI_TRAFFIC_SUSPEND_REJECTED) { wil_dbg_pm(wil, "device rejected the suspend\n"); if (reply.evt.status != WMI_TRAFFIC_SUSPEND_APPROVED) { wil_dbg_pm(wil, "device rejected the suspend, %s\n", suspend_status2name(reply.evt.status)); wil->suspend_stats.rejected_by_device++; } rc = reply.evt.status; Loading @@ -2256,21 +2267,50 @@ int wmi_suspend(struct wil6210_priv *wil) return rc; } static void resume_triggers2string(u32 triggers, char *string, int str_size) { string[0] = '\0'; if (!triggers) { strlcat(string, " UNKNOWN", str_size); return; } if (triggers & WMI_RESUME_TRIGGER_HOST) strlcat(string, " HOST", str_size); if (triggers & WMI_RESUME_TRIGGER_UCAST_RX) strlcat(string, " UCAST_RX", str_size); if (triggers & WMI_RESUME_TRIGGER_BCAST_RX) strlcat(string, " BCAST_RX", str_size); if (triggers & WMI_RESUME_TRIGGER_WMI_EVT) strlcat(string, " WMI_EVT", str_size); } int wmi_resume(struct wil6210_priv *wil) { int rc; char string[100]; struct { struct wmi_cmd_hdr wmi; struct wmi_traffic_resume_event evt; } __packed reply; reply.evt.status = WMI_TRAFFIC_RESUME_FAILED; reply.evt.resume_triggers = WMI_RESUME_TRIGGER_UNKNOWN; rc = wmi_call(wil, WMI_TRAFFIC_RESUME_CMDID, NULL, 0, WMI_TRAFFIC_RESUME_EVENTID, &reply, sizeof(reply), WIL_WAIT_FOR_SUSPEND_RESUME_COMP); if (rc) return rc; resume_triggers2string(le32_to_cpu(reply.evt.resume_triggers), string, sizeof(string)); wil_dbg_pm(wil, "device resume %s, resume triggers:%s (0x%x)\n", reply.evt.status ? "failed" : "passed", string, le32_to_cpu(reply.evt.resume_triggers)); return reply.evt.status; } Loading
drivers/net/wireless/ath/wil6210/wmi.h +14 −3 Original line number Diff line number Diff line Loading @@ -2270,7 +2270,7 @@ struct wmi_link_maintain_cfg_read_done_event { enum wmi_traffic_suspend_status { WMI_TRAFFIC_SUSPEND_APPROVED = 0x0, WMI_TRAFFIC_SUSPEND_REJECTED = 0x1, WMI_TRAFFIC_SUSPEND_REJECTED_LINK_NOT_IDLE = 0x1, }; /* WMI_TRAFFIC_SUSPEND_EVENTID */ Loading @@ -2284,10 +2284,21 @@ enum wmi_traffic_resume_status { WMI_TRAFFIC_RESUME_FAILED = 0x1, }; enum wmi_resume_trigger { WMI_RESUME_TRIGGER_UNKNOWN = 0x0, WMI_RESUME_TRIGGER_HOST = 0x1, WMI_RESUME_TRIGGER_UCAST_RX = 0x2, WMI_RESUME_TRIGGER_BCAST_RX = 0x4, WMI_RESUME_TRIGGER_WMI_EVT = 0x8, }; /* WMI_TRAFFIC_RESUME_EVENTID */ struct wmi_traffic_resume_event { /* enum wmi_traffic_resume_status_e */ /* enum wmi_traffic_resume_status */ u8 status; u8 reserved[3]; /* enum wmi_resume_trigger bitmap */ __le32 resume_triggers; } __packed; /* Power Save command completion status codes */ Loading