qcacld-3.0: Get sorted ACS channel list

Get sorted ACS channel list to select channels for ll_lt_sap

Change-Id: Id653136321a22ec091c5b4fe167911f8ea1d4b38
CRs-Fixed: 3567422
Цей коміт міститься в:
Jyoti Kumari
2023-07-17 00:16:07 +05:30
зафіксовано Rahul Choudhary
джерело 2987d54461
коміт 00a4ef030d
8 змінених файлів з 212 додано та 16 видалено

Переглянути файл

@@ -573,4 +573,30 @@ wlan_handle_emlsr_sta_concurrency(struct wlan_objmgr_psoc *psoc,
{
}
#endif
#ifdef WLAN_FEATURE_LL_LT_SAP
/**
* wlan_ll_sap_sort_channel_list() - Sort channel list
* @vdev_id: Vdev Id
* @list: Pointer to list
* @ch_info: Pointer to ch_info
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_ll_sap_sort_channel_list(uint8_t vdev_id, qdf_list_t *list,
struct sap_sel_ch_info *ch_info);
#endif
/**
* wlan_sap_get_user_config_acs_ch_list: Get user configured channel list
* @vdev_id: Vdev Id
* @filter: Filter to apply to get scan result
*
* Return: None
*
*/
void
wlan_sap_get_user_config_acs_ch_list(uint8_t vdev_id,
struct scan_filter *filter);
#endif

Переглянути файл

@@ -2251,6 +2251,22 @@ static QDF_STATUS ap_mlme_vdev_csa_complete(struct vdev_mlme_obj *vdev_mlme)
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_FEATURE_LL_LT_SAP
QDF_STATUS
wlan_ll_sap_sort_channel_list(uint8_t vdev_id, qdf_list_t *list,
struct sap_sel_ch_info *ch_info)
{
return wlansap_sort_channel_list(vdev_id, list, ch_info);
}
#endif
void
wlan_sap_get_user_config_acs_ch_list(uint8_t vdev_id,
struct scan_filter *filter)
{
wlansap_get_user_config_acs_ch_list(vdev_id, filter);
}
static struct vdev_mlme_ops sta_mlme_ops = {
.mlme_vdev_start_send = sta_mlme_vdev_start_send,
.mlme_vdev_restart_send = sta_mlme_vdev_restart_send,

Переглянути файл

@@ -15,6 +15,8 @@
*/
#include "wlan_ll_lt_sap_main.h"
#include "wlan_scan_ucfg_api.h"
#include "wlan_mlme_vdev_mgr_interface.h"
bool ll_lt_sap_is_supported(void)
{
@@ -23,3 +25,47 @@ bool ll_lt_sap_is_supported(void)
*/
return true;
}
QDF_STATUS
ll_lt_sap_get_sorted_user_config_acs_ch_list(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct sap_sel_ch_info *ch_info)
{
struct scan_filter *filter;
qdf_list_t *list = NULL;
struct wlan_objmgr_pdev *pdev;
struct wlan_objmgr_vdev *vdev;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_LL_SAP_ID);
if (!vdev) {
ll_sap_err("Invalid vdev for vdev_id %d", vdev_id);
return QDF_STATUS_E_FAILURE;
}
pdev = wlan_vdev_get_pdev(vdev);
filter = qdf_mem_malloc(sizeof(*filter));
if (!filter)
goto rel_ref;
wlan_sap_get_user_config_acs_ch_list(vdev_id, filter);
list = wlan_scan_get_result(pdev, filter);
qdf_mem_free(filter);
if (!list)
goto rel_ref;
status = wlan_ll_sap_sort_channel_list(vdev_id, list, ch_info);
wlan_scan_purge_results(list);
rel_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_LL_SAP_ID);
return status;
}

Переглянути файл

@@ -21,7 +21,8 @@
#ifndef _WLAN_LL_LT_SAP_MAIN_H_
#define _WLAN_LL_LT_SAP_MAIN_H_
#include <i_qdf_types.h>
#include "wlan_ll_sap_main.h"
#include "wlan_mlme_public_struct.h"
/**
* ll_lt_sap_is_supported() - Check if ll_lt_sap is supported or not
@@ -30,4 +31,17 @@
*/
bool ll_lt_sap_is_supported(void);
/**
* ll_lt_sap_get_sorted_user_config_acs_ch_list() - API to get sorted user
* configured channel list
* @psoc: Pointer to psoc object
* @vdev_id: Vdev Id
* @ch_info: Pointer to ch_info
*
* Return: QDF_STATUS
*/
QDF_STATUS ll_lt_sap_get_sorted_user_config_acs_ch_list(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct sap_sel_ch_info *ch_info);
#endif /* _WLAN_LL_SAP_MAIN_H_ */

Переглянути файл

@@ -460,11 +460,11 @@ struct sap_acs_cfg {
/* ACS Algo Input */
uint8_t acs_mode;
eCsrPhyMode hw_mode;
uint32_t start_ch_freq;
uint32_t end_ch_freq;
uint32_t *freq_list;
qdf_freq_t start_ch_freq;
qdf_freq_t end_ch_freq;
qdf_freq_t *freq_list;
uint8_t ch_list_count;
uint32_t *master_freq_list;
qdf_freq_t *master_freq_list;
uint8_t master_ch_list_count;
bool master_ch_list_updated;
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
@@ -1936,6 +1936,27 @@ void wlansap_update_ll_lt_sap_acs_result(struct sap_context *sap_ctx,
*/
int wlansap_update_sap_chan_list(struct sap_config *sap_config,
qdf_freq_t *freq_list, uint16_t count);
/**
* wlansap_sort_channel_list() - Sort channel list
* @vdev_id: Vdev Id
* @list: List of channels which needs to sort
* @ch_info: Fill sorted channels list in ch_info
*
* Return: QDF_STATUS
*/
QDF_STATUS wlansap_sort_channel_list(uint8_t vdev_id, qdf_list_t *list,
struct sap_sel_ch_info *ch_info);
/**
* wlansap_get_user_config_acs_ch_list() - Get user config ACS channel list
* @vdev_id: Vdev Id
* @filter: Filter to apply to get scan result
*
* Return: None
*/
void wlansap_get_user_config_acs_ch_list(uint8_t vdev_id,
struct scan_filter *filter);
#ifdef __cplusplus
}
#endif

Переглянути файл

@@ -2772,23 +2772,22 @@ sap_acs_next_lower_bandwidth(enum phy_ch_width ch_width)
return wlan_reg_get_next_lower_bandwidth(ch_width);
}
static void sap_sort_channel_list(struct mac_context *mac_ctx,
uint8_t vdev_id,
qdf_list_t *ch_list,
struct sap_sel_ch_info *ch_info,
v_REGDOMAIN_t *domain,
uint32_t *operating_band)
void sap_sort_channel_list(struct mac_context *mac_ctx, uint8_t vdev_id,
qdf_list_t *ch_list, struct sap_sel_ch_info *ch_info,
v_REGDOMAIN_t *domain, uint32_t *operating_band)
{
uint8_t country[CDS_COUNTRY_CODE_LEN + 1];
struct sap_context *sap_ctx;
enum phy_ch_width cur_bw;
v_REGDOMAIN_t reg_domain;
uint32_t op_band;
sap_ctx = mac_ctx->sap.sapCtxList[vdev_id].sap_context;
cur_bw = sap_ctx->acs_cfg->ch_width;
/* Initialize the structure pointed by spect_info */
if (!sap_chan_sel_init(mac_ctx, ch_info, sap_ctx, false)) {
sap_err("Ch Select initialization failed");
sap_err("vdev %d ch select initialization failed", vdev_id);
return;
}
@@ -2801,14 +2800,20 @@ static void sap_sort_channel_list(struct mac_context *mac_ctx,
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
wlan_reg_read_current_country(mac_ctx->psoc, country);
wlan_reg_get_domain_from_country_code(domain, country, SOURCE_DRIVER);
wlan_reg_get_domain_from_country_code(&reg_domain, country,
SOURCE_DRIVER);
SET_ACS_BAND(*operating_band, sap_ctx);
SET_ACS_BAND(op_band, sap_ctx);
/* Sort the ch lst as per the computed weights, lesser weight first. */
sap_sort_chl_weight_all(mac_ctx, sap_ctx, ch_info, *operating_band,
*domain, &cur_bw);
sap_sort_chl_weight_all(mac_ctx, sap_ctx, ch_info, op_band,
reg_domain, &cur_bw);
sap_ctx->acs_cfg->ch_width = cur_bw;
if (domain)
*domain = reg_domain;
if (operating_band)
*operating_band = op_band;
}
uint32_t sap_select_channel(mac_handle_t mac_handle,

Переглянути файл

@@ -316,6 +316,23 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(mac_handle_t mac_handle,
uint32_t scanid,
eCsrScanStatus scan_status);
/**
* sap_sort_channel_list() - Sort channel list based on channel weight
* @mac_ctx: Pointer to mac_context
* @vdev_id: Vdev ID
* @ch_list: Pointer to qdf_list_t
* @ch_info: Pointer to sap_sel_ch_info structure
* @domain: Regulatory Domain
* @operating_band: Operating band
*
* Return: None
*
*/
void
sap_sort_channel_list(struct mac_context *mac_ctx, uint8_t vdev_id,
qdf_list_t *ch_list, struct sap_sel_ch_info *ch_info,
v_REGDOMAIN_t *domain, uint32_t *operating_band);
/**
* sap_select_channel() - select SAP channel
* @mac_handle: Opaque handle to the global MAC context

Переглянути файл

@@ -4344,3 +4344,54 @@ void wlansap_update_ll_lt_sap_acs_result(struct sap_context *sap_ctx,
sap_ctx->acs_cfg->pri_ch_freq = last_acs_freq;
sap_ctx->acs_cfg->ht_sec_ch_freq = 0;
}
QDF_STATUS wlansap_sort_channel_list(uint8_t vdev_id, qdf_list_t *list,
struct sap_sel_ch_info *ch_info)
{
struct mac_context *mac_ctx;
mac_ctx = sap_get_mac_context();
if (!mac_ctx) {
sap_err("Invalid MAC context");
return QDF_STATUS_E_FAILURE;
}
sap_sort_channel_list(mac_ctx, vdev_id, list,
ch_info, NULL, NULL);
return QDF_STATUS_SUCCESS;
}
void wlansap_get_user_config_acs_ch_list(uint8_t vdev_id,
struct scan_filter *filter)
{
struct mac_context *mac_ctx;
struct sap_context *sap_ctx;
uint8_t ch_count = 0;
mac_ctx = sap_get_mac_context();
if (!mac_ctx) {
sap_err("Invalid MAC context");
return;
}
if (vdev_id >= WLAN_UMAC_VDEV_ID_MAX)
return;
sap_ctx = mac_ctx->sap.sapCtxList[vdev_id].sap_context;
if (!sap_ctx) {
sap_err("vdev %d sap_ctx is NULL", vdev_id);
return;
}
ch_count = sap_ctx->acs_cfg->master_ch_list_count;
if (!ch_count || ch_count > NUM_CHANNELS)
return;
filter->num_of_channels = ch_count;
qdf_mem_copy(filter->chan_freq_list, sap_ctx->acs_cfg->master_freq_list,
filter->num_of_channels *
sizeof(filter->chan_freq_list[0]));
}