|
@@ -50,6 +50,7 @@
|
|
|
#include "pld_common.h"
|
|
|
#include "wlan_reg_services_api.h"
|
|
|
#include <wlan_scan_utils_api.h>
|
|
|
+#include <wlan_cp_stats_mc_ucfg_api.h>
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
Function definitions
|
|
@@ -583,10 +584,13 @@ uint32_t sapweight_rssi_count(struct sap_context *sap_ctx, int8_t rssi,
|
|
|
*
|
|
|
* Return: chan status info
|
|
|
*/
|
|
|
-static struct lim_channel_status *sap_get_channel_status
|
|
|
+static struct channel_status *sap_get_channel_status
|
|
|
(struct mac_context *p_mac, uint32_t chan_freq)
|
|
|
{
|
|
|
- return csr_get_channel_status(p_mac, chan_freq);
|
|
|
+ if (!p_mac->sap.acs_with_more_param)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return ucfg_mc_cp_stats_get_channel_status(p_mac->pdev, chan_freq);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -597,9 +601,11 @@ static struct lim_channel_status *sap_get_channel_status
|
|
|
*/
|
|
|
static void sap_clear_channel_status(struct mac_context *p_mac)
|
|
|
{
|
|
|
- csr_clear_channel_status(p_mac);
|
|
|
-}
|
|
|
+ if (!p_mac->sap.acs_with_more_param)
|
|
|
+ return;
|
|
|
|
|
|
+ ucfg_mc_cp_stats_clear_channel_status(p_mac->pdev);
|
|
|
+}
|
|
|
/**
|
|
|
* sap_weight_channel_noise_floor() - compute noise floor weight
|
|
|
* @sap_ctx: sap context
|
|
@@ -608,7 +614,7 @@ static void sap_clear_channel_status(struct mac_context *p_mac)
|
|
|
* Return: channel noise floor weight
|
|
|
*/
|
|
|
static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx,
|
|
|
- struct lim_channel_status
|
|
|
+ struct channel_status
|
|
|
*channel_stat)
|
|
|
{
|
|
|
uint32_t noise_floor_weight;
|
|
@@ -623,7 +629,7 @@ static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx,
|
|
|
ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight,
|
|
|
softap_nf_weight_cfg);
|
|
|
|
|
|
- if (!channel_stat || channel_stat->channelfreq == 0)
|
|
|
+ if (!channel_stat || channel_stat->channel_freq == 0)
|
|
|
return softap_nf_weight_local;
|
|
|
|
|
|
noise_floor_weight = (channel_stat->noise_floor == 0) ? 0 :
|
|
@@ -640,7 +646,7 @@ static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx,
|
|
|
sap_debug("nf=%d, nfwc=%d, nfwl=%d, nfw=%d freq=%d",
|
|
|
channel_stat->noise_floor,
|
|
|
softap_nf_weight_cfg, softap_nf_weight_local,
|
|
|
- noise_floor_weight, channel_stat->channelfreq);
|
|
|
+ noise_floor_weight, channel_stat->channel_freq);
|
|
|
|
|
|
return noise_floor_weight;
|
|
|
}
|
|
@@ -653,7 +659,7 @@ static uint32_t sap_weight_channel_noise_floor(struct sap_context *sap_ctx,
|
|
|
* Return: channel free weight
|
|
|
*/
|
|
|
static uint32_t sap_weight_channel_free(struct sap_context *sap_ctx,
|
|
|
- struct lim_channel_status
|
|
|
+ struct channel_status
|
|
|
*channel_stat)
|
|
|
{
|
|
|
uint32_t channel_free_weight;
|
|
@@ -670,7 +676,7 @@ static uint32_t sap_weight_channel_free(struct sap_context *sap_ctx,
|
|
|
ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight,
|
|
|
softap_channel_free_weight_cfg);
|
|
|
|
|
|
- if (!channel_stat || channel_stat->channelfreq == 0)
|
|
|
+ if (!channel_stat || channel_stat->channel_freq == 0)
|
|
|
return softap_channel_free_weight_local;
|
|
|
|
|
|
rx_clear_count = channel_stat->rx_clear_count -
|
|
@@ -711,7 +717,7 @@ static uint32_t sap_weight_channel_free(struct sap_context *sap_ctx,
|
|
|
* Return: tx power range weight
|
|
|
*/
|
|
|
static uint32_t sap_weight_channel_txpwr_range(struct sap_context *sap_ctx,
|
|
|
- struct lim_channel_status
|
|
|
+ struct channel_status
|
|
|
*channel_stat)
|
|
|
{
|
|
|
uint32_t txpwr_weight_low_speed;
|
|
@@ -726,7 +732,7 @@ static uint32_t sap_weight_channel_txpwr_range(struct sap_context *sap_ctx,
|
|
|
ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight,
|
|
|
softap_txpwr_range_weight_cfg);
|
|
|
|
|
|
- if (!channel_stat || channel_stat->channelfreq == 0)
|
|
|
+ if (!channel_stat || channel_stat->channel_freq == 0)
|
|
|
return softap_txpwr_range_weight_local;
|
|
|
|
|
|
|
|
@@ -759,7 +765,7 @@ static uint32_t sap_weight_channel_txpwr_range(struct sap_context *sap_ctx,
|
|
|
* Return: tx power throughput weight
|
|
|
*/
|
|
|
static uint32_t sap_weight_channel_txpwr_tput(struct sap_context *sap_ctx,
|
|
|
- struct lim_channel_status
|
|
|
+ struct channel_status
|
|
|
*channel_stat)
|
|
|
{
|
|
|
uint32_t txpwr_weight_high_speed;
|
|
@@ -774,7 +780,7 @@ static uint32_t sap_weight_channel_txpwr_tput(struct sap_context *sap_ctx,
|
|
|
ACS_WEIGHT_CFG_TO_LOCAL(sap_ctx->auto_channel_select_weight,
|
|
|
softap_txpwr_tput_weight_cfg);
|
|
|
|
|
|
- if (!channel_stat || channel_stat->channelfreq == 0)
|
|
|
+ if (!channel_stat || channel_stat->channel_freq == 0)
|
|
|
return softap_txpwr_tput_weight_local;
|
|
|
|
|
|
txpwr_weight_high_speed = (channel_stat->chan_tx_pwr_throughput == 0)
|
|
@@ -806,7 +812,7 @@ static uint32_t sap_weight_channel_txpwr_tput(struct sap_context *sap_ctx,
|
|
|
*/
|
|
|
static
|
|
|
uint32_t sap_weight_channel_status(struct sap_context *sap_ctx,
|
|
|
- struct lim_channel_status *channel_stat)
|
|
|
+ struct channel_status *channel_stat)
|
|
|
{
|
|
|
return sap_weight_channel_noise_floor(sap_ctx, channel_stat) +
|
|
|
sap_weight_channel_free(sap_ctx, channel_stat) +
|
|
@@ -1403,8 +1409,8 @@ static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams,
|
|
|
SAPDFS_NORMALISE_1000 *
|
|
|
(sapweight_rssi_count(sap_ctx, rssi,
|
|
|
pSpectCh->bssCount) + sap_weight_channel_status(
|
|
|
- sap_ctx, sap_get_channel_status(mac,
|
|
|
- pSpectCh->chan_freq)));
|
|
|
+ sap_ctx, sap_get_channel_status(
|
|
|
+ mac, pSpectCh->chan_freq)));
|
|
|
else {
|
|
|
pSpectCh->weight = SAP_ACS_WEIGHT_MAX;
|
|
|
pSpectCh->rssiAgr = SOFTAP_MIN_RSSI;
|