qcacld-3.0: Move user configured SAP frequency to vdev

When MLO SAP is started with two different bands, the 2.4 GHz
link follows the 5GHz and restarts on the same channel
as 5 GHz link.

The user configured frequency for the SAP is cached on the
psoc, therefore during the concurrency check after bringing
up the second connection, 2.4 GHz link considers the new
user configured frequency of 5GHz link and moves to the same
channel.

Save the user configured frequency per vdev to prevent
cross-utilization.

Change-Id: I62f883bf818332bb7d0c838e6ed629a8f2d2f21b
CRs-Fixed: 3209394
This commit is contained in:
Surya Prakash Sivaraj
2022-06-06 15:57:07 +05:30
committed by Madan Koyyalamudi
parent 5f4f7cf521
commit 19dd97f211
11 changed files with 161 additions and 54 deletions

View File

@@ -400,6 +400,15 @@ struct wait_for_key_timer {
qdf_mc_timer_t timer;
};
/**
* struct mlme_ap_config - VDEV MLME legacy private SAP
* related configurations
* @user_config_sap_ch_freq : Frequency from userspace to start SAP
*/
struct mlme_ap_config {
qdf_freq_t user_config_sap_ch_freq;
};
/**
* struct mlme_legacy_priv - VDEV MLME legacy priv object
* @chan_switch_in_progress: flag to indicate that channel switch is in progress
@@ -444,6 +453,7 @@ struct wait_for_key_timer {
* @max_mcs_index: Max supported mcs index of vdev
* @vdev_traffic_type: to set if vdev is LOW_LATENCY or HIGH_TPUT
* @country_ie_for_all_band: take all band channel info in country ie
* @mlme_ap: SAP related vdev private configurations
*/
struct mlme_legacy_priv {
bool chan_switch_in_progress;
@@ -493,6 +503,7 @@ struct mlme_legacy_priv {
#endif
uint8_t vdev_traffic_type;
bool country_ie_for_all_band;
struct mlme_ap_config mlme_ap;
};
/**
@@ -1154,4 +1165,26 @@ void wlan_acquire_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
*/
void wlan_release_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
uint8_t *mac_addr);
/**
* wlan_get_sap_user_config_freq() - Get the user configured frequency
*
* @vdev: pointer to vdev
*
* Return: User configured sap frequency.
*/
qdf_freq_t
wlan_get_sap_user_config_freq(struct wlan_objmgr_vdev *vdev);
/**
* wlan_set_sap_user_config_freq() - Set the user configured frequency
*
* @vdev: pointer to vdev
* @freq: user configured SAP frequency
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_set_sap_user_config_freq(struct wlan_objmgr_vdev *vdev,
qdf_freq_t freq);
#endif

View File

@@ -3975,3 +3975,47 @@ QDF_STATUS wlan_mlme_get_mac_vdev_id(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_SUCCESS;
}
qdf_freq_t
wlan_get_sap_user_config_freq(struct wlan_objmgr_vdev *vdev)
{
struct mlme_legacy_priv *mlme_priv;
enum QDF_OPMODE opmode = QDF_MAX_NO_OF_MODE;
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
mlme_legacy_err("vdev legacy private object is NULL");
return 0;
}
opmode = wlan_vdev_mlme_get_opmode(vdev);
if (opmode != QDF_SAP_MODE && opmode != QDF_P2P_GO_MODE) {
mlme_debug("Cannot get user config freq for mode %d", opmode);
return 0;
}
return mlme_priv->mlme_ap.user_config_sap_ch_freq;
}
QDF_STATUS
wlan_set_sap_user_config_freq(struct wlan_objmgr_vdev *vdev,
qdf_freq_t freq)
{
struct mlme_legacy_priv *mlme_priv;
enum QDF_OPMODE opmode = QDF_MAX_NO_OF_MODE;
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
mlme_legacy_err("vdev legacy private object is NULL");
return QDF_STATUS_E_INVAL;
}
opmode = wlan_vdev_mlme_get_opmode(vdev);
if (opmode != QDF_SAP_MODE && opmode != QDF_P2P_GO_MODE) {
mlme_debug("Cannot set user config freq for mode %d", opmode);
return QDF_STATUS_E_FAILURE;
}
mlme_priv->mlme_ap.user_config_sap_ch_freq = freq;
return QDF_STATUS_SUCCESS;
}