Commit 84fd7608 authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach

iwlwifi: mvm: add use_ps-poll debugfs power option

By default, when uapsd is not used, the ucode uses
null data packet to exit power-save and get then
pending frames.

However, some tests require the explicit usage of ps-poll.
Allow setting use_ps_poll power option (through debugfs)
to configure the ucode to use ps-poll instead.

The ucode configuration is done by setting the advanced-pm
flag while setting all the ACs to non-upasd mode.
Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 697162a1
...@@ -119,6 +119,10 @@ static void iwl_dbgfs_update_pm(struct iwl_mvm *mvm, ...@@ -119,6 +119,10 @@ static void iwl_dbgfs_update_pm(struct iwl_mvm *mvm,
IWL_DEBUG_POWER(mvm, "uapsd_misbehaving_enable=%d\n", val); IWL_DEBUG_POWER(mvm, "uapsd_misbehaving_enable=%d\n", val);
dbgfs_pm->uapsd_misbehaving = val; dbgfs_pm->uapsd_misbehaving = val;
break; break;
case MVM_DEBUGFS_PM_USE_PS_POLL:
IWL_DEBUG_POWER(mvm, "use_ps_poll=%d\n", val);
dbgfs_pm->use_ps_poll = val;
break;
} }
} }
...@@ -169,6 +173,10 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf, ...@@ -169,6 +173,10 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf,
if (sscanf(buf + 18, "%d", &val) != 1) if (sscanf(buf + 18, "%d", &val) != 1)
return -EINVAL; return -EINVAL;
param = MVM_DEBUGFS_PM_UAPSD_MISBEHAVING; param = MVM_DEBUGFS_PM_UAPSD_MISBEHAVING;
} else if (!strncmp("use_ps_poll=", buf, 12)) {
if (sscanf(buf + 12, "%d", &val) != 1)
return -EINVAL;
param = MVM_DEBUGFS_PM_USE_PS_POLL;
} else { } else {
return -EINVAL; return -EINVAL;
} }
......
...@@ -203,6 +203,7 @@ enum iwl_dbgfs_pm_mask { ...@@ -203,6 +203,7 @@ enum iwl_dbgfs_pm_mask {
MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD = BIT(7), MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD = BIT(7),
MVM_DEBUGFS_PM_SNOOZE_ENABLE = BIT(8), MVM_DEBUGFS_PM_SNOOZE_ENABLE = BIT(8),
MVM_DEBUGFS_PM_UAPSD_MISBEHAVING = BIT(9), MVM_DEBUGFS_PM_UAPSD_MISBEHAVING = BIT(9),
MVM_DEBUGFS_PM_USE_PS_POLL = BIT(10),
}; };
struct iwl_dbgfs_pm { struct iwl_dbgfs_pm {
...@@ -215,6 +216,7 @@ struct iwl_dbgfs_pm { ...@@ -215,6 +216,7 @@ struct iwl_dbgfs_pm {
u32 lprx_rssi_threshold; u32 lprx_rssi_threshold;
bool snooze_ena; bool snooze_ena;
bool uapsd_misbehaving; bool uapsd_misbehaving;
bool use_ps_poll;
int mask; int mask;
}; };
......
...@@ -198,8 +198,15 @@ static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm, ...@@ -198,8 +198,15 @@ static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm,
} }
} }
if (!(cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK))) if (!(cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK))) {
#ifdef CONFIG_IWLWIFI_DEBUGFS
/* set advanced pm flag with no uapsd ACs to enable ps-poll */
if (mvmvif->dbgfs_pm.use_ps_poll)
cmd->flags |=
cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
#endif
return; return;
}
cmd->flags |= cpu_to_le16(POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK); cmd->flags |= cpu_to_le16(POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment