|
@@ -1589,50 +1589,30 @@ static void init_config_param(struct mac_context *mac)
|
|
|
mac->roam.configParam.doBMPSWorkaround = 0;
|
|
|
}
|
|
|
|
|
|
-/* This function flushes the roam scan cache */
|
|
|
-QDF_STATUS csr_flush_cfg_bg_scan_roam_channel_list(struct mac_context *mac,
|
|
|
- uint8_t sessionId)
|
|
|
+void csr_flush_cfg_bg_scan_roam_channel_list(tCsrChannelInfo *channel_info)
|
|
|
{
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
- tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
|
|
|
- &mac->roam.neighborRoamInfo[sessionId];
|
|
|
-
|
|
|
/* Free up the memory first (if required) */
|
|
|
- if (pNeighborRoamInfo->cfgParams.channelInfo.freq_list) {
|
|
|
- qdf_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.
|
|
|
- freq_list);
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.freq_list = NULL;
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = 0;
|
|
|
+ if (channel_info->freq_list) {
|
|
|
+ qdf_mem_free(channel_info->freq_list);
|
|
|
+ channel_info->freq_list = NULL;
|
|
|
+ channel_info->numOfChannels = 0;
|
|
|
}
|
|
|
- return status;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * This function flushes the roam scan cache and creates fresh cache
|
|
|
- * based on the input channel list
|
|
|
- */
|
|
|
QDF_STATUS csr_create_bg_scan_roam_channel_list(struct mac_context *mac,
|
|
|
- uint8_t sessionId,
|
|
|
+ tCsrChannelInfo *channel_info,
|
|
|
const uint8_t *chan_list,
|
|
|
const uint8_t num_chan)
|
|
|
{
|
|
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
- tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
|
|
|
- &mac->roam.neighborRoamInfo[sessionId];
|
|
|
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = num_chan;
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.freq_list =
|
|
|
- qdf_mem_malloc(sizeof(uint32_t) * num_chan);
|
|
|
- if (!pNeighborRoamInfo->cfgParams.channelInfo.freq_list) {
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = 0;
|
|
|
+ channel_info->freq_list = qdf_mem_malloc(sizeof(uint32_t) * num_chan);
|
|
|
+ if (!channel_info->freq_list)
|
|
|
return QDF_STATUS_E_NOMEM;
|
|
|
- }
|
|
|
|
|
|
- /* Update the roam global structure */
|
|
|
- sme_chan_to_freq_list(mac->pdev,
|
|
|
- pNeighborRoamInfo->cfgParams.channelInfo.
|
|
|
- freq_list, chan_list, num_chan);
|
|
|
+ channel_info->numOfChannels = num_chan;
|
|
|
+ sme_chan_to_freq_list(mac->pdev, channel_info->freq_list,
|
|
|
+ chan_list, num_chan);
|
|
|
return status;
|
|
|
}
|
|
|
|
|
@@ -17664,23 +17644,23 @@ csr_check_band_channel_match(enum band_info band, uint8_t channel)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * csr_fetch_ch_lst_from_ini() - fetch channel list from ini and update req msg
|
|
|
+ * csr_populate_roam_chan_list()
|
|
|
* parameters
|
|
|
* @mac_ctx: global mac ctx
|
|
|
- * @roam_info: roam info struct
|
|
|
- * @req_buf: out param, roam offload scan request packet
|
|
|
+ * @dst: Destination roam network to populate the roam chan list
|
|
|
+ * @src: Source channel list
|
|
|
*
|
|
|
- * Return: result of operation
|
|
|
+ * Return: QDF_STATUS enumeration
|
|
|
*/
|
|
|
static QDF_STATUS
|
|
|
-csr_fetch_ch_lst_from_ini(struct mac_context *mac_ctx,
|
|
|
- tpCsrNeighborRoamControlInfo roam_info,
|
|
|
- struct roam_offload_scan_req *req_buf)
|
|
|
+csr_populate_roam_chan_list(struct mac_context *mac_ctx,
|
|
|
+ tSirRoamNetworkType *dst,
|
|
|
+ tCsrChannelInfo *src)
|
|
|
{
|
|
|
enum band_info band;
|
|
|
uint8_t i = 0;
|
|
|
uint8_t num_channels = 0;
|
|
|
- uint32_t *freq_lst = roam_info->cfgParams.channelInfo.freq_list;
|
|
|
+ uint32_t *freq_lst = src->freq_list;
|
|
|
uint16_t unsafe_chan[NUM_CHANNELS];
|
|
|
uint16_t unsafe_chan_cnt = 0;
|
|
|
uint16_t cnt = 0;
|
|
@@ -17710,7 +17690,12 @@ csr_fetch_ch_lst_from_ini(struct mac_context *mac_ctx,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- for (i = 0; i < roam_info->cfgParams.channelInfo.numOfChannels; i++) {
|
|
|
+ num_channels = dst->ChannelCount;
|
|
|
+ for (i = 0; i < src->numOfChannels; i++) {
|
|
|
+ if (csr_is_channel_present_in_list(dst->ChannelCache,
|
|
|
+ num_channels,
|
|
|
+ wlan_reg_freq_to_chan(mac_ctx->pdev, *freq_lst)))
|
|
|
+ continue;
|
|
|
if (!csr_check_band_freq_match(
|
|
|
band, *freq_lst))
|
|
|
continue;
|
|
@@ -17750,13 +17735,43 @@ csr_fetch_ch_lst_from_ini(struct mac_context *mac_ctx,
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- req_buf->ConnectedNetwork.ChannelCache[num_channels++] =
|
|
|
+ dst->ChannelCache[num_channels++] =
|
|
|
wlan_reg_freq_to_chan(mac_ctx->pdev, *freq_lst);
|
|
|
freq_lst++;
|
|
|
+ }
|
|
|
+ dst->ChannelCount = num_channels;
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
|
|
|
+/**
|
|
|
+ * csr_fetch_ch_lst_from_ini() - fetch channel list from ini and update req msg
|
|
|
+ * parameters
|
|
|
+ * @mac_ctx: global mac ctx
|
|
|
+ * @roam_info: roam info struct
|
|
|
+ * @req_buf: out param, roam offload scan request packet
|
|
|
+ *
|
|
|
+ * Return: result of operation
|
|
|
+ */
|
|
|
+static QDF_STATUS
|
|
|
+csr_fetch_ch_lst_from_ini(struct mac_context *mac_ctx,
|
|
|
+ tpCsrNeighborRoamControlInfo roam_info,
|
|
|
+ struct roam_offload_scan_req *req_buf)
|
|
|
+{
|
|
|
+ QDF_STATUS status;
|
|
|
+ tCsrChannelInfo *specific_chan_info;
|
|
|
+
|
|
|
+ specific_chan_info = &roam_info->cfgParams.specific_chan_info;
|
|
|
+
|
|
|
+ status = csr_populate_roam_chan_list(mac_ctx,
|
|
|
+ &req_buf->ConnectedNetwork,
|
|
|
+ specific_chan_info);
|
|
|
+ if (status != QDF_STATUS_SUCCESS) {
|
|
|
+ sme_err("Failed to copy channels to roam list");
|
|
|
+ return status;
|
|
|
}
|
|
|
- req_buf->ConnectedNetwork.ChannelCount = num_channels;
|
|
|
req_buf->ChannelCacheType = CHANNEL_LIST_STATIC;
|
|
|
+
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
@@ -17984,6 +17999,9 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx,
|
|
|
struct roam_offload_scan_req *req_buf = NULL;
|
|
|
tpCsrChannelInfo curr_ch_lst_info =
|
|
|
&roam_info->roamChannelInfo.currentChannelListInfo;
|
|
|
+ tCsrChannelInfo *specific_chan_info;
|
|
|
+
|
|
|
+ specific_chan_info = &roam_info->cfgParams.specific_chan_info;
|
|
|
#ifdef FEATURE_WLAN_ESE
|
|
|
/*
|
|
|
* this flag will be true if connection is ESE and no neighbor
|
|
@@ -18121,7 +18139,7 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx,
|
|
|
* the occupied channels list.
|
|
|
* Give Preference to INI Channels
|
|
|
*/
|
|
|
- if (roam_info->cfgParams.channelInfo.numOfChannels) {
|
|
|
+ if (specific_chan_info->numOfChannels) {
|
|
|
status = csr_fetch_ch_lst_from_ini(mac_ctx,
|
|
|
roam_info,
|
|
|
req_buf);
|