qcacld-3.0: Set PS config per vdev
Currently the PS config received from kernel/userspace is set to mac_ctx globally. This causes PS config set for one vdev to override on the other vdev. To avoid this, set the PS config per vdev. Change-Id: I6a2e2a9d8fb67b94d9d5f1d4164077990bdaf4a5 CRs-Fixed: 3007060
This commit is contained in:

committed by
Madan Koyyalamudi

parent
9cce6d9b2d
commit
100c310363
@@ -404,6 +404,7 @@ struct wait_for_key_timer {
|
|||||||
* @last_delba_sent_time: Last delba sent time to handle back to back delba
|
* @last_delba_sent_time: Last delba sent time to handle back to back delba
|
||||||
* requests from some IOT APs
|
* requests from some IOT APs
|
||||||
* @ba_2k_jump_iot_ap: This is set to true if connected to the ba 2k jump IOT AP
|
* @ba_2k_jump_iot_ap: This is set to true if connected to the ba 2k jump IOT AP
|
||||||
|
* @is_usr_ps_enabled: Is Power save enabled
|
||||||
*/
|
*/
|
||||||
struct mlme_legacy_priv {
|
struct mlme_legacy_priv {
|
||||||
bool chan_switch_in_progress;
|
bool chan_switch_in_progress;
|
||||||
@@ -442,6 +443,7 @@ struct mlme_legacy_priv {
|
|||||||
#endif
|
#endif
|
||||||
qdf_time_t last_delba_sent_time;
|
qdf_time_t last_delba_sent_time;
|
||||||
bool ba_2k_jump_iot_ap;
|
bool ba_2k_jump_iot_ap;
|
||||||
|
bool is_usr_ps_enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3317,4 +3317,23 @@ wlan_mlme_set_last_delba_sent_time(struct wlan_objmgr_vdev *vdev,
|
|||||||
*/
|
*/
|
||||||
qdf_time_t
|
qdf_time_t
|
||||||
wlan_mlme_get_last_delba_sent_time(struct wlan_objmgr_vdev *vdev);
|
wlan_mlme_get_last_delba_sent_time(struct wlan_objmgr_vdev *vdev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mlme_set_user_ps() - Set the PS user config
|
||||||
|
* @vdev: Vdev object pointer
|
||||||
|
* @ps_enable: User PS enable
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS
|
||||||
|
*/
|
||||||
|
QDF_STATUS mlme_set_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||||
|
bool ps_enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mlme_get_user_ps() - Set the user ps flag
|
||||||
|
* @psoc: Pointer to psoc object
|
||||||
|
* @vdev_id: vdev id
|
||||||
|
*
|
||||||
|
* Return: True if user_ps flag is set
|
||||||
|
*/
|
||||||
|
bool mlme_get_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
|
||||||
#endif /* _WLAN_MLME_API_H_ */
|
#endif /* _WLAN_MLME_API_H_ */
|
||||||
|
@@ -4271,6 +4271,34 @@ ucfg_mlme_set_roam_reason_vsie_status(struct wlan_objmgr_psoc *psoc,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ucfg_mlme_set_user_ps() - Set the PS user config
|
||||||
|
* @psoc: pointer to psoc object
|
||||||
|
* @vdev_id: Vdev id
|
||||||
|
* @ps_enable: Flag to indicate if user PS is enabled
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
QDF_STATUS ucfg_mlme_set_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||||
|
bool ps_enable)
|
||||||
|
{
|
||||||
|
return mlme_set_user_ps(psoc, vdev_id, ps_enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ucfg_mlme_get_user_ps() - Get user PS flag
|
||||||
|
* @psoc: pointer to psoc object
|
||||||
|
* @vdev_id: Vdev id
|
||||||
|
*
|
||||||
|
* Return: True if user ps is enabled else false
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
bool ucfg_mlme_get_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
|
||||||
|
{
|
||||||
|
return mlme_get_user_ps(psoc, vdev_id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ucfg_mlme_set_ft_over_ds() - update ft_over_ds status with user configured
|
* ucfg_mlme_set_ft_over_ds() - update ft_over_ds status with user configured
|
||||||
* value
|
* value
|
||||||
|
@@ -5093,3 +5093,48 @@ wlan_mlme_get_last_delba_sent_time(struct wlan_objmgr_vdev *vdev)
|
|||||||
|
|
||||||
return mlme_priv->last_delba_sent_time;
|
return mlme_priv->last_delba_sent_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDF_STATUS mlme_set_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||||
|
bool ps_enable)
|
||||||
|
{
|
||||||
|
struct wlan_objmgr_vdev *vdev;
|
||||||
|
struct mlme_legacy_priv *mlme_priv;
|
||||||
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
|
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||||
|
WLAN_MLME_OBJMGR_ID);
|
||||||
|
if (!vdev)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
|
||||||
|
if (mlme_priv) {
|
||||||
|
mlme_priv->is_usr_ps_enabled = ps_enable;
|
||||||
|
status = QDF_STATUS_SUCCESS;
|
||||||
|
mlme_legacy_debug("vdev:%d user PS:%d", vdev_id,
|
||||||
|
mlme_priv->is_usr_ps_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool mlme_get_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
|
||||||
|
{
|
||||||
|
struct wlan_objmgr_vdev *vdev;
|
||||||
|
struct mlme_legacy_priv *mlme_priv;
|
||||||
|
bool usr_ps_enable = false;
|
||||||
|
|
||||||
|
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||||
|
WLAN_MLME_OBJMGR_ID);
|
||||||
|
if (!vdev)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
|
||||||
|
if (mlme_priv)
|
||||||
|
usr_ps_enable = mlme_priv->is_usr_ps_enabled;
|
||||||
|
|
||||||
|
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_OBJMGR_ID);
|
||||||
|
|
||||||
|
return usr_ps_enable;
|
||||||
|
}
|
||||||
|
@@ -679,16 +679,16 @@ out:
|
|||||||
*/
|
*/
|
||||||
static void hdd_send_ps_config_to_fw(struct hdd_adapter *adapter)
|
static void hdd_send_ps_config_to_fw(struct hdd_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct mac_context *mac_ctx;
|
|
||||||
struct hdd_context *hdd_ctx;
|
struct hdd_context *hdd_ctx;
|
||||||
|
bool usr_ps_cfg;
|
||||||
|
|
||||||
if (hdd_validate_adapter(adapter))
|
if (hdd_validate_adapter(adapter))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||||
mac_ctx = MAC_CONTEXT(hdd_ctx->mac_handle);
|
|
||||||
|
|
||||||
if (mac_ctx->usr_cfg_ps_enable)
|
usr_ps_cfg = ucfg_mlme_get_user_ps(hdd_ctx->psoc, adapter->vdev_id);
|
||||||
|
if (usr_ps_cfg)
|
||||||
sme_ps_enable_disable(hdd_ctx->mac_handle, adapter->vdev_id,
|
sme_ps_enable_disable(hdd_ctx->mac_handle, adapter->vdev_id,
|
||||||
SME_PS_ENABLE);
|
SME_PS_ENABLE);
|
||||||
else
|
else
|
||||||
@@ -1983,7 +1983,7 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
sme_save_usr_ps_cfg(mac_handle, true);
|
ucfg_mlme_set_user_ps(hdd_ctx->psoc, adapter->vdev_id, true);
|
||||||
ucfg_mlme_is_bmps_enabled(hdd_ctx->psoc, &is_bmps_enabled);
|
ucfg_mlme_is_bmps_enabled(hdd_ctx->psoc, &is_bmps_enabled);
|
||||||
if (is_bmps_enabled) {
|
if (is_bmps_enabled) {
|
||||||
hdd_debug("Wlan driver Entering Power save");
|
hdd_debug("Wlan driver Entering Power save");
|
||||||
@@ -2011,7 +2011,7 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
|
|||||||
} else {
|
} else {
|
||||||
hdd_debug("Wlan driver Entering Full Power");
|
hdd_debug("Wlan driver Entering Full Power");
|
||||||
|
|
||||||
sme_save_usr_ps_cfg(mac_handle, false);
|
ucfg_mlme_set_user_ps(hdd_ctx->psoc, adapter->vdev_id, false);
|
||||||
/*
|
/*
|
||||||
* Enter Full power command received from GUI
|
* Enter Full power command received from GUI
|
||||||
* this means we are disconnected
|
* this means we are disconnected
|
||||||
|
@@ -3607,7 +3607,7 @@ static int hdd_we_set_power(struct hdd_adapter *adapter, int value)
|
|||||||
switch (value) {
|
switch (value) {
|
||||||
case 1:
|
case 1:
|
||||||
/* Enable PowerSave */
|
/* Enable PowerSave */
|
||||||
sme_save_usr_ps_cfg(mac_handle, true);
|
ucfg_mlme_set_user_ps(hdd_ctx->psoc, adapter->vdev_id, true);
|
||||||
sme_ps_enable_disable(mac_handle, adapter->vdev_id,
|
sme_ps_enable_disable(mac_handle, adapter->vdev_id,
|
||||||
SME_PS_ENABLE);
|
SME_PS_ENABLE);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3615,7 +3615,7 @@ static int hdd_we_set_power(struct hdd_adapter *adapter, int value)
|
|||||||
/* Disable PowerSave */
|
/* Disable PowerSave */
|
||||||
sme_ps_enable_disable(mac_handle, adapter->vdev_id,
|
sme_ps_enable_disable(mac_handle, adapter->vdev_id,
|
||||||
SME_PS_DISABLE);
|
SME_PS_DISABLE);
|
||||||
sme_save_usr_ps_cfg(mac_handle, false);
|
ucfg_mlme_set_user_ps(hdd_ctx->psoc, adapter->vdev_id, false);
|
||||||
return 0;
|
return 0;
|
||||||
case 3:
|
case 3:
|
||||||
/* Enable UASPD */
|
/* Enable UASPD */
|
||||||
|
@@ -786,7 +786,6 @@ struct mac_context {
|
|||||||
/* 11k Offload Support */
|
/* 11k Offload Support */
|
||||||
bool is_11k_offload_supported;
|
bool is_11k_offload_supported;
|
||||||
uint8_t reject_addba_req;
|
uint8_t reject_addba_req;
|
||||||
bool usr_cfg_ps_enable;
|
|
||||||
uint16_t usr_cfg_ba_buff_size;
|
uint16_t usr_cfg_ba_buff_size;
|
||||||
bool is_usr_cfg_amsdu_enabled;
|
bool is_usr_cfg_amsdu_enabled;
|
||||||
uint8_t no_ack_policy_cfg[QCA_WLAN_AC_ALL];
|
uint8_t no_ack_policy_cfg[QCA_WLAN_AC_ALL];
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2015-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -82,15 +82,5 @@ void sme_auto_ps_entry_timer_expired(void *ps_param);
|
|||||||
QDF_STATUS sme_ps_close(mac_handle_t mac_handle);
|
QDF_STATUS sme_ps_close(mac_handle_t mac_handle);
|
||||||
QDF_STATUS sme_ps_close_per_session(mac_handle_t mac_handle,
|
QDF_STATUS sme_ps_close_per_session(mac_handle_t mac_handle,
|
||||||
uint32_t session_id);
|
uint32_t session_id);
|
||||||
|
|
||||||
/**
|
|
||||||
* sme_save_usr_ps_cfg(): saves user power save config
|
|
||||||
* @mac_handle: Opaque handle to the global MAC context
|
|
||||||
* @val: set val
|
|
||||||
*
|
|
||||||
* Returns: QDF_STATUS
|
|
||||||
*/
|
|
||||||
void sme_save_usr_ps_cfg(mac_handle_t mac_handle, bool val);
|
|
||||||
|
|
||||||
#endif /* #if !defined(__SME_POWER_SAVE_API_H) */
|
#endif /* #if !defined(__SME_POWER_SAVE_API_H) */
|
||||||
|
|
||||||
|
@@ -2225,7 +2225,7 @@ sme_process_sta_twt_del_dialog_event(
|
|||||||
struct wmi_twt_del_dialog_complete_event_param *param)
|
struct wmi_twt_del_dialog_complete_event_param *param)
|
||||||
{
|
{
|
||||||
twt_del_dialog_cb callback;
|
twt_del_dialog_cb callback;
|
||||||
bool is_evt_allowed;
|
bool is_evt_allowed, usr_cfg_ps_enable;
|
||||||
enum wlan_twt_commands active_cmd = WLAN_TWT_NONE;
|
enum wlan_twt_commands active_cmd = WLAN_TWT_NONE;
|
||||||
|
|
||||||
is_evt_allowed = mlme_twt_is_command_in_progress(
|
is_evt_allowed = mlme_twt_is_command_in_progress(
|
||||||
@@ -2244,7 +2244,8 @@ sme_process_sta_twt_del_dialog_event(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mac->usr_cfg_ps_enable &&
|
usr_cfg_ps_enable = mlme_get_user_ps(mac->psoc, param->vdev_id);
|
||||||
|
if (!usr_cfg_ps_enable &&
|
||||||
param->status == WMI_HOST_DEL_TWT_STATUS_OK)
|
param->status == WMI_HOST_DEL_TWT_STATUS_OK)
|
||||||
param->status = WMI_HOST_DEL_TWT_STATUS_PS_DISABLE_TEARDOWN;
|
param->status = WMI_HOST_DEL_TWT_STATUS_PS_DISABLE_TEARDOWN;
|
||||||
|
|
||||||
@@ -13538,6 +13539,7 @@ QDF_STATUS sme_add_dialog_cmd(mac_handle_t mac_handle,
|
|||||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||||
struct scheduler_msg twt_msg = {0};
|
struct scheduler_msg twt_msg = {0};
|
||||||
bool is_twt_cmd_in_progress, is_twt_notify_in_progress;
|
bool is_twt_cmd_in_progress, is_twt_notify_in_progress;
|
||||||
|
bool usr_cfg_ps_enable;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
void *wma_handle;
|
void *wma_handle;
|
||||||
struct wmi_twt_add_dialog_param *cmd_params;
|
struct wmi_twt_add_dialog_param *cmd_params;
|
||||||
@@ -13545,7 +13547,8 @@ QDF_STATUS sme_add_dialog_cmd(mac_handle_t mac_handle,
|
|||||||
|
|
||||||
SME_ENTER();
|
SME_ENTER();
|
||||||
|
|
||||||
if (!mac->usr_cfg_ps_enable) {
|
usr_cfg_ps_enable = mlme_get_user_ps(mac->psoc, twt_params->vdev_id);
|
||||||
|
if (!usr_cfg_ps_enable) {
|
||||||
sme_debug("Power save mode disable");
|
sme_debug("Power save mode disable");
|
||||||
return QDF_STATUS_E_INVAL;
|
return QDF_STATUS_E_INVAL;
|
||||||
}
|
}
|
||||||
|
@@ -333,6 +333,7 @@ QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
|
|||||||
uint32_t session_id, enum sme_ps_cmd command)
|
uint32_t session_id, enum sme_ps_cmd command)
|
||||||
{
|
{
|
||||||
struct wlan_mlme_powersave *powersave_params;
|
struct wlan_mlme_powersave *powersave_params;
|
||||||
|
bool usr_cfg_ps_enable;
|
||||||
|
|
||||||
QDF_BUG(session_id < WLAN_MAX_VDEVS);
|
QDF_BUG(session_id < WLAN_MAX_VDEVS);
|
||||||
if (session_id >= WLAN_MAX_VDEVS)
|
if (session_id >= WLAN_MAX_VDEVS)
|
||||||
@@ -345,8 +346,10 @@ QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == SME_PS_ENABLE && !mac_ctx->usr_cfg_ps_enable) {
|
usr_cfg_ps_enable = mlme_get_user_ps(mac_ctx->psoc, session_id);
|
||||||
sme_debug("Cannot initiate PS. PS is disabled by usr(ioctl)");
|
if (command == SME_PS_ENABLE && !usr_cfg_ps_enable) {
|
||||||
|
sme_debug("vdev:%d Cannot initiate PS. PS is disabled by usr(ioctl)",
|
||||||
|
session_id);
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +358,7 @@ QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
|
|||||||
* for connected state as firmware can handle this
|
* for connected state as firmware can handle this
|
||||||
*/
|
*/
|
||||||
if (!cm_is_vdevid_connected(mac_ctx->pdev, session_id)) {
|
if (!cm_is_vdevid_connected(mac_ctx->pdev, session_id)) {
|
||||||
sme_debug("STA not infra/connected state Session_id: %d",
|
sme_debug("vdev:%d STA not infra/connected state",
|
||||||
session_id);
|
session_id);
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -363,14 +366,6 @@ QDF_STATUS sme_enable_sta_ps_check(struct mac_context *mac_ctx,
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sme_save_usr_ps_cfg(mac_handle_t mac_handle, bool val)
|
|
||||||
{
|
|
||||||
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
|
|
||||||
|
|
||||||
mac_ctx->usr_cfg_ps_enable = val;
|
|
||||||
sme_debug("usr_cfg_ps_enable %d", val);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sme_ps_enable_disable(): function to enable/disable PS.
|
* sme_ps_enable_disable(): function to enable/disable PS.
|
||||||
* @mac_handle: Opaque handle to the global MAC context
|
* @mac_handle: Opaque handle to the global MAC context
|
||||||
@@ -749,8 +744,11 @@ QDF_STATUS sme_ps_enable_auto_ps_timer(mac_handle_t mac_handle,
|
|||||||
struct ps_params *ps_param = &ps_global_info->ps_params[session_id];
|
struct ps_params *ps_param = &ps_global_info->ps_params[session_id];
|
||||||
QDF_STATUS qdf_status;
|
QDF_STATUS qdf_status;
|
||||||
QDF_TIMER_STATE cur_state;
|
QDF_TIMER_STATE cur_state;
|
||||||
|
bool usr_cfg_ps_enable;
|
||||||
|
|
||||||
if (!timeout && !mac_ctx->usr_cfg_ps_enable) {
|
usr_cfg_ps_enable =
|
||||||
|
mlme_get_user_ps(mac_ctx->psoc, session_id);
|
||||||
|
if (!timeout && !usr_cfg_ps_enable) {
|
||||||
sme_debug("auto_ps_timer called with timeout 0; ignore");
|
sme_debug("auto_ps_timer called with timeout 0; ignore");
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -808,13 +806,12 @@ QDF_STATUS sme_ps_disable_auto_ps_timer(mac_handle_t mac_handle,
|
|||||||
|
|
||||||
QDF_STATUS sme_ps_open(mac_handle_t mac_handle)
|
QDF_STATUS sme_ps_open(mac_handle_t mac_handle)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
|
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||||
|
|
||||||
mac_ctx->usr_cfg_ps_enable = true;
|
|
||||||
|
|
||||||
for (i = 0; i < WLAN_MAX_VDEVS; i++) {
|
for (i = 0; i < WLAN_MAX_VDEVS; i++) {
|
||||||
|
mlme_set_user_ps(mac->psoc, i, true);
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != sme_ps_open_per_session(mac_handle,
|
if (QDF_STATUS_SUCCESS != sme_ps_open_per_session(mac_handle,
|
||||||
i)) {
|
i)) {
|
||||||
sme_err("PMC Init Failed for session: %d", i);
|
sme_err("PMC Init Failed for session: %d", i);
|
||||||
|
Reference in New Issue
Block a user