qcacld-3.0: Add weightage to valid non-pcl channels

In scenarios where p2p is going to be the first connection,
while performing group negotiation, pass up the allowed non-pcl
channels with valid weight so that supplicant can include these
channels as well during negotiation.
Passing interface mode to policy_mgr_get_valid_chan_weights and
populating the channel list based on policy_mgr_is_concurrency_allowed
api for the given mode and assign WEIGHT_OF_NON_PCL_CHANNELS for all
allowed channels.

Change-Id: I8ff08163e6490642f9c2ebd9ca08f1275a2bb1b8
CRs-Fixed: 2734756
This commit is contained in:
nakul kachhwaha 2020-07-16 16:31:31 +05:30 • committed by snandini
commit dcd3e2a624
5 changed files with 23 additions and 11 deletions

View file

@ -2099,6 +2099,7 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(
* @psoc: PSOC object information
* @weight: Pointer to the structure containing pcl, saved channel list and
* weighed channel list
* @mode: Policy manager connection mode
*
* Provides the weightage for all valid channels. This compares the PCL list
* with the valid channel list. The channels present in the PCL get their
@ -2108,7 +2109,8 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(
* Return: QDF_STATUS
*/
QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
struct policy_mgr_pcl_chan_weights *weight);
struct policy_mgr_pcl_chan_weights *weight,
enum policy_mgr_con_mode mode);
/**
* policy_mgr_set_hw_mode_on_channel_switch() - Set hw mode

View file

@ -2376,7 +2376,8 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
}
QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
struct policy_mgr_pcl_chan_weights *weight)
struct policy_mgr_pcl_chan_weights *weight,
enum policy_mgr_con_mode mode)
{
uint32_t i, j;
struct policy_mgr_conc_connection_info
@ -2393,16 +2394,20 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
qdf_mem_set(weight->weighed_valid_list, NUM_CHANNELS,
WEIGHT_OF_DISALLOWED_CHANNELS);
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
if (policy_mgr_mode_specific_connection_count(
psoc, PM_STA_MODE, NULL) > 0) {
if ((mode == PM_P2P_GO_MODE || mode == PM_P2P_CLIENT_MODE) ||
(mode == PM_STA_MODE &&
policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
NULL) > 0)) {
/*
* Store the STA mode's parameter and temporarily delete it
* from the concurrency table. This way the allow concurrency
* check can be used as though a new connection is coming up,
* allowing to detect the disallowed channels.
*/
policy_mgr_store_and_del_conn_info(psoc, PM_STA_MODE, false,
info, &num_cxn_del);
if (mode == PM_STA_MODE)
policy_mgr_store_and_del_conn_info(psoc, mode,
false, info,
&num_cxn_del);
/*
* There is a small window between releasing the above lock
* and acquiring the same in policy_mgr_allow_concurrency,
@ -2410,14 +2415,16 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
*/
for (i = 0; i < weight->saved_num_chan; i++) {
if (policy_mgr_is_concurrency_allowed
(psoc, PM_STA_MODE, weight->saved_chan_list[i],
(psoc, mode, weight->saved_chan_list[i],
HW_MODE_20_MHZ)) {
weight->weighed_valid_list[i] =
WEIGHT_OF_NON_PCL_CHANNELS;
}
}
/* Restore the connection info */
policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del);
if (mode == PM_STA_MODE)
policy_mgr_restore_deleted_conn_info(psoc, info,
num_cxn_del);
}
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);

View file

@ -85,7 +85,8 @@ wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc,
weights->saved_num_chan = 0;
status = policy_mgr_get_valid_chan_weights(
psoc, (struct policy_mgr_pcl_chan_weights *)weights);
psoc, (struct policy_mgr_pcl_chan_weights *)weights,
PM_STA_MODE);
qdf_mem_free(freq_list);

View file

@ -10965,7 +10965,8 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
chan_weights->saved_num_chan = NUM_CHANNELS;
sme_get_valid_channels(chan_weights->saved_chan_list,
&chan_weights->saved_num_chan);
policy_mgr_get_valid_chan_weights(hdd_ctx->psoc, chan_weights);
policy_mgr_get_valid_chan_weights(hdd_ctx->psoc, chan_weights,
intf_mode);
w_pcl = qdf_mem_malloc(sizeof(struct weighed_pcl) * NUM_CHANNELS);
if (!w_pcl) {
qdf_mem_free(chan_weights);

View file

@ -9084,7 +9084,8 @@ QDF_STATUS wma_send_set_pcl_cmd(tp_wma_handle wma_handle,
msg->chan_weights.saved_num_chan = wma_handle->saved_chan.num_channels;
status = policy_mgr_get_valid_chan_weights(wma_handle->psoc,
(struct policy_mgr_pcl_chan_weights *)&msg->chan_weights);
(struct policy_mgr_pcl_chan_weights *)&msg->chan_weights,
PM_STA_MODE);
for (i = 0; i < msg->chan_weights.saved_num_chan; i++) {
msg->chan_weights.weighed_valid_list[i] =