|
@@ -737,6 +737,10 @@ sme_rrm_send_chan_load_report_xmit_ind(struct mac_context *mac,
|
|
|
struct chan_load_xmit_ind *chan_load_resp;
|
|
|
uint16_t length;
|
|
|
tpRrmSMEContext rrm_ctx = &mac->rrm.rrmSmeContext[measurement_index];
|
|
|
+ const struct bonded_channel_freq *range;
|
|
|
+ uint8_t chan_load = 0, temp_chan_load;
|
|
|
+ qdf_freq_t start_freq, end_freq, op_freq;
|
|
|
+ enum phy_ch_width req_chan_width;
|
|
|
|
|
|
length = sizeof(struct chan_load_xmit_ind);
|
|
|
chan_load_resp = qdf_mem_malloc(length);
|
|
@@ -752,9 +756,77 @@ sme_rrm_send_chan_load_report_xmit_ind(struct mac_context *mac,
|
|
|
chan_load_resp->op_class = rrm_ctx->regClass;
|
|
|
chan_load_resp->channel = rrm_ctx->chan_load_req_info.channel;
|
|
|
chan_load_resp->rrm_scan_tsf = rrm_ctx->chan_load_req_info.rrm_scan_tsf;
|
|
|
- wlan_cp_stats_get_rx_clear_count(mac->psoc, vdev_id,
|
|
|
- rrm_ctx->chan_load_req_info.channel,
|
|
|
- &chan_load_resp->chan_load);
|
|
|
+
|
|
|
+ op_freq = rrm_ctx->chan_load_req_info.req_freq;
|
|
|
+ req_chan_width = rrm_ctx->chan_load_req_info.req_chan_width;
|
|
|
+ if (req_chan_width == CH_WIDTH_INVALID) {
|
|
|
+ sme_debug("Invalid scanned_ch_width");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (req_chan_width == CH_WIDTH_20MHZ) {
|
|
|
+ start_freq = op_freq;
|
|
|
+ end_freq = op_freq;
|
|
|
+ sme_debug("cw %d: start_freq %d, end_freq %d", req_chan_width,
|
|
|
+ start_freq, end_freq);
|
|
|
+ } else if (req_chan_width == CH_WIDTH_320MHZ) {
|
|
|
+ if (!rrm_ctx->chan_load_req_info.bw_ind.is_bw_ind_element) {
|
|
|
+ sme_debug("is_bw_ind_element is false");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ qdf_mem_copy(&chan_load_resp->bw_ind,
|
|
|
+ &rrm_ctx->chan_load_req_info.bw_ind,
|
|
|
+ sizeof(chan_load_resp->bw_ind));
|
|
|
+ range = wlan_reg_get_bonded_chan_entry(op_freq,
|
|
|
+ rrm_ctx->chan_load_req_info.bw_ind.channel_width,
|
|
|
+ rrm_ctx->chan_load_req_info.bw_ind.center_freq);
|
|
|
+ if (!range) {
|
|
|
+ sme_debug("vdev %d : range is null for freq %d",
|
|
|
+ vdev_id, op_freq);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ start_freq = range->start_freq;
|
|
|
+ end_freq = range->end_freq;
|
|
|
+ sme_debug("cw %d: start_freq %d, end_freq %d", req_chan_width,
|
|
|
+ start_freq, end_freq);
|
|
|
+ } else {
|
|
|
+ if (rrm_ctx->chan_load_req_info.wide_bw.is_wide_bw_chan_switch) {
|
|
|
+ qdf_mem_copy(&chan_load_resp->wide_bw,
|
|
|
+ &rrm_ctx->chan_load_req_info.wide_bw,
|
|
|
+ sizeof(chan_load_resp->wide_bw));
|
|
|
+ req_chan_width =
|
|
|
+ rrm_ctx->chan_load_req_info.wide_bw.channel_width;
|
|
|
+ sme_debug("Fill wide_bw_chan_switch IE for cw:%d",
|
|
|
+ req_chan_width);
|
|
|
+ }
|
|
|
+
|
|
|
+ range =
|
|
|
+ wlan_reg_get_bonded_chan_entry(op_freq, req_chan_width, 0);
|
|
|
+ if (!range) {
|
|
|
+ sme_debug("range is NULL for freq %d, ch_width %d",
|
|
|
+ op_freq, req_chan_width);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ start_freq = range->start_freq;
|
|
|
+ end_freq = range->end_freq;
|
|
|
+ sme_debug("cw %d: start_freq %d, end_freq %d",
|
|
|
+ req_chan_width, start_freq, end_freq);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (; start_freq <= end_freq;) {
|
|
|
+ temp_chan_load =
|
|
|
+ wlan_cp_stats_get_rx_clear_count(mac->psoc,
|
|
|
+ vdev_id,
|
|
|
+ start_freq);
|
|
|
+ if (chan_load < temp_chan_load)
|
|
|
+ chan_load = temp_chan_load;
|
|
|
+
|
|
|
+ start_freq += BW_20_MHZ;
|
|
|
+ }
|
|
|
+
|
|
|
+ chan_load_resp->chan_load = chan_load;
|
|
|
|
|
|
sme_debug("SME Sending CHAN_LOAD_REPORT_RESP_XMIT_IND to PE");
|
|
|
umac_send_mb_message_to_mac(chan_load_resp);
|
|
@@ -1204,6 +1276,7 @@ sme_rrm_fill_freq_list_for_channel_load(struct mac_context *mac_ctx,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ sme_rrm_ctx->chan_load_req_info.req_chan_width = chan_width;
|
|
|
return mlme_update_freq_in_scan_start_req(vdev, req, chan_width,
|
|
|
scan_freq, cen320_freq);
|
|
|
}
|
|
@@ -1334,6 +1407,7 @@ static QDF_STATUS sme_rrm_process_chan_load_req_ind(struct mac_context *mac,
|
|
|
SIR_ESE_MAX_MEAS_IE_REQS);
|
|
|
sme_rrm_ctx->measurement_type = RRM_CHANNEL_LOAD;
|
|
|
sme_rrm_ctx->chan_load_req_info.channel = chan_load->channel;
|
|
|
+ sme_rrm_ctx->chan_load_req_info.req_freq = chan_load->req_freq;
|
|
|
|
|
|
qdf_mem_copy(&sme_rrm_ctx->chan_load_req_info.bw_ind,
|
|
|
&chan_load->bw_ind,
|
|
@@ -1342,13 +1416,14 @@ static QDF_STATUS sme_rrm_process_chan_load_req_ind(struct mac_context *mac,
|
|
|
&chan_load->wide_bw,
|
|
|
sizeof(sme_rrm_ctx->chan_load_req_info.wide_bw));
|
|
|
|
|
|
- sme_debug("idx:%d, token: %d randnIntvl: %d meas_duration %d, rrm_ctx dur %d reg_class: %d, type: %d, channel: %d, [bw_ind cw:%d, ccfs0:%d], [wide_bw cw:%d]",
|
|
|
+ sme_debug("idx:%d, token: %d randnIntvl: %d meas_duration %d, rrm_ctx dur %d reg_class: %d, type: %d, channel: %d, freq:%d, [bw_ind cw:%d, ccfs0:%d], [wide_bw cw:%d]",
|
|
|
chan_load->measurement_idx, sme_rrm_ctx->token,
|
|
|
sme_rrm_ctx->randnIntvl,
|
|
|
chan_load->meas_duration,
|
|
|
sme_rrm_ctx->duration[0], sme_rrm_ctx->regClass,
|
|
|
sme_rrm_ctx->measurement_type,
|
|
|
sme_rrm_ctx->chan_load_req_info.channel,
|
|
|
+ sme_rrm_ctx->chan_load_req_info.req_freq,
|
|
|
sme_rrm_ctx->chan_load_req_info.bw_ind.channel_width,
|
|
|
sme_rrm_ctx->chan_load_req_info.bw_ind.center_freq,
|
|
|
sme_rrm_ctx->chan_load_req_info.wide_bw.channel_width);
|