aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/wmi.c
diff options
context:
space:
mode:
authorMaya Erez <qca_merez@qca.qualcomm.com>2016-11-23 09:06:40 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2016-11-23 09:49:48 -0500
commit2c207eb8e6ab3f46d6c6a0daab16dc756562802b (patch)
tree74487686679e7ac8044fb7bb52d7259b1ca313a9 /drivers/net/wireless/ath/wil6210/wmi.c
parentf9e3033ff7eb9a0018856f5295312f78828a34f2 (diff)
wil6210: add support for power save enable / disable
New power management wmi commands provide the ability to change the device power save profile (enable / disable power save). Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wmi.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 890960e9b1d3..8c60437e57e0 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -1563,6 +1563,40 @@ int wmi_addba_rx_resp(struct wil6210_priv *wil, u8 cid, u8 tid, u8 token,
1563 return rc; 1563 return rc;
1564} 1564}
1565 1565
1566int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil,
1567 enum wmi_ps_profile_type ps_profile)
1568{
1569 int rc;
1570 struct wmi_ps_dev_profile_cfg_cmd cmd = {
1571 .ps_profile = ps_profile,
1572 };
1573 struct {
1574 struct wmi_cmd_hdr wmi;
1575 struct wmi_ps_dev_profile_cfg_event evt;
1576 } __packed reply;
1577 u32 status;
1578
1579 wil_dbg_wmi(wil, "Setting ps dev profile %d\n", ps_profile);
1580
1581 reply.evt.status = cpu_to_le32(WMI_PS_CFG_CMD_STATUS_ERROR);
1582
1583 rc = wmi_call(wil, WMI_PS_DEV_PROFILE_CFG_CMDID, &cmd, sizeof(cmd),
1584 WMI_PS_DEV_PROFILE_CFG_EVENTID, &reply, sizeof(reply),
1585 100);
1586 if (rc)
1587 return rc;
1588
1589 status = le32_to_cpu(reply.evt.status);
1590
1591 if (status != WMI_PS_CFG_CMD_STATUS_SUCCESS) {
1592 wil_err(wil, "ps dev profile cfg failed with status %d\n",
1593 status);
1594 rc = -EINVAL;
1595 }
1596
1597 return rc;
1598}
1599
1566void wmi_event_flush(struct wil6210_priv *wil) 1600void wmi_event_flush(struct wil6210_priv *wil)
1567{ 1601{
1568 struct pending_wmi_event *evt, *t; 1602 struct pending_wmi_event *evt, *t;