|
@@ -2107,6 +2107,56 @@ static void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * sap_allocate_max_weight_ht40_24_g() - allocate max weight for 40Mhz
|
|
|
+ * to all 2.4Ghz channels
|
|
|
+ * @spect_info_params: Pointer to the tSapChSelSpectInfo structure
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static void sap_allocate_max_weight_ht40_24_g(
|
|
|
+ tSapChSelSpectInfo *spect_info_params)
|
|
|
+{
|
|
|
+ tSapSpectChInfo *spect_info;
|
|
|
+ uint8_t j;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Assign max weight for 40Mhz (SAP_ACS_WEIGHT_MAX * 2) to all
|
|
|
+ * 2.4 Ghz channels
|
|
|
+ */
|
|
|
+ spect_info = spect_info_params->pSpectCh;
|
|
|
+ for (j = 0; j < spect_info_params->numSpectChans; j++) {
|
|
|
+ if ((spect_info[j].chNum >= WLAN_REG_CH_NUM(CHAN_ENUM_1) &&
|
|
|
+ spect_info[j].chNum <= WLAN_REG_CH_NUM(CHAN_ENUM_14)))
|
|
|
+ spect_info[j].weight = SAP_ACS_WEIGHT_MAX * 2;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * sap_allocate_max_weight_ht40_5_g() - allocate max weight for 40Mhz
|
|
|
+ * to all 5Ghz channels
|
|
|
+ * @spect_info_params: Pointer to the tSapChSelSpectInfo structure
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static void sap_allocate_max_weight_ht40_5_g(
|
|
|
+ tSapChSelSpectInfo *spect_info_params)
|
|
|
+{
|
|
|
+ tSapSpectChInfo *spect_info;
|
|
|
+ uint8_t j;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Assign max weight for 40Mhz (SAP_ACS_WEIGHT_MAX * 2) to all
|
|
|
+ * 5 Ghz channels
|
|
|
+ */
|
|
|
+ spect_info = spect_info_params->pSpectCh;
|
|
|
+ for (j = 0; j < spect_info_params->numSpectChans; j++) {
|
|
|
+ if ((spect_info[j].chNum >= WLAN_REG_CH_NUM(CHAN_ENUM_36) &&
|
|
|
+ spect_info[j].chNum <= WLAN_REG_CH_NUM(CHAN_ENUM_165)))
|
|
|
+ spect_info[j].weight = SAP_ACS_WEIGHT_MAX * 2;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* sap_sort_chl_weight_ht40_24_g() - to sort channel with the least weight
|
|
|
* @pSpectInfoParams: Pointer to the tSapChSelSpectInfo structure
|
|
@@ -2232,6 +2282,16 @@ static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams,
|
|
|
pSpectInfo[j].weight = SAP_ACS_WEIGHT_MAX * 2;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ pSpectInfo = pSpectInfoParams->pSpectCh;
|
|
|
+ for (j = 0; j < (pSpectInfoParams->numSpectChans); j++) {
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
|
|
+ "In %s, Channel=%d Weight= %d rssi=%d bssCount=%d",
|
|
|
+ __func__, pSpectInfo->chNum, pSpectInfo->weight,
|
|
|
+ pSpectInfo->rssiAgr, pSpectInfo->bssCount);
|
|
|
+ pSpectInfo++;
|
|
|
+ }
|
|
|
+
|
|
|
sap_sort_chl_weight(pSpectInfoParams);
|
|
|
}
|
|
|
|
|
@@ -2369,12 +2429,16 @@ static void sap_sort_chl_weight_all(struct sap_context *sap_ctx,
|
|
|
|
|
|
switch (sap_ctx->acs_cfg->ch_width) {
|
|
|
case CH_WIDTH_40MHZ:
|
|
|
- if (eCSR_DOT11_MODE_11g == operatingBand)
|
|
|
- sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
|
|
|
- else if (eCSR_DOT11_MODE_11a == operatingBand)
|
|
|
- sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
|
|
|
- else {
|
|
|
+ /*
|
|
|
+ * Assign max weight to all 5Ghz channels when operating band
|
|
|
+ * is 11g and to all 2.4Ghz channels when operating band is 11a
|
|
|
+ * or 11abg to avoid selection in ACS algorithm for starting SAP
|
|
|
+ */
|
|
|
+ if (eCSR_DOT11_MODE_11g == operatingBand) {
|
|
|
sap_sort_chl_weight_ht40_24_g(pSpectInfoParams, domain);
|
|
|
+ sap_allocate_max_weight_ht40_5_g(pSpectInfoParams);
|
|
|
+ } else {
|
|
|
+ sap_allocate_max_weight_ht40_24_g(pSpectInfoParams);
|
|
|
sap_sort_chl_weight_ht40_5_g(pSpectInfoParams);
|
|
|
}
|
|
|
break;
|