Skip to content

Commit c83c500

Browse files
Carl HuangKalle Valo
authored andcommitted
ath11k: enable idle power save mode
Host sends wmi command to allow hardware enter idle power save mode in ath11k_mac_op_start function. hw parameter idle_ps indicates whether idle power save is supported. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang <cjhuang@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1601544890-13450-8-git-send-email-kvalo@codeaurora.org
1 parent 9b30997 commit c83c500

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
6464
BIT(NL80211_IFTYPE_MESH_POINT),
6565
.supports_monitor = true,
6666
.supports_shadow_regs = false,
67+
.idle_ps = false,
6768
},
6869
{
6970
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -100,6 +101,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
100101
BIT(NL80211_IFTYPE_MESH_POINT),
101102
.supports_monitor = true,
102103
.supports_shadow_regs = false,
104+
.idle_ps = false,
103105
},
104106
{
105107
.name = "qca6390 hw2.0",
@@ -135,6 +137,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
135137
BIT(NL80211_IFTYPE_AP),
136138
.supports_monitor = false,
137139
.supports_shadow_regs = true,
140+
.idle_ps = true,
138141
},
139142
};
140143

drivers/net/wireless/ath/ath11k/hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct ath11k_hw_params {
160160
u16 interface_modes;
161161
bool supports_monitor;
162162
bool supports_shadow_regs;
163+
bool idle_ps;
163164
};
164165

165166
struct ath11k_hw_ops {

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4208,6 +4208,15 @@ static int ath11k_mac_op_start(struct ieee80211_hw *hw)
42084208
rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx],
42094209
&ab->pdevs[ar->pdev_idx]);
42104210

4211+
/* allow device to enter IMPS */
4212+
if (ab->hw_params.idle_ps) {
4213+
ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_IDLE_PS_CONFIG,
4214+
1, pdev->pdev_id);
4215+
if (ret) {
4216+
ath11k_err(ab, "failed to enable idle ps: %d\n", ret);
4217+
goto err;
4218+
}
4219+
}
42114220
return 0;
42124221

42134222
err:

0 commit comments

Comments
 (0)