diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 8e810cd2f583..47f91441b694 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1367,10 +1367,10 @@ struct hdd_adapter { /* debugfs entry */ struct dentry *debugfs_phy; /* - * The pre cac channel is saved here and will be used when the SAP's - * channel needs to be moved from the existing 2.4GHz channel. + * The pre cac channel frequency is saved here and will be used when + * the SAP's channel needs to be moved from the existing 2.4GHz channel. */ - uint8_t pre_cac_chan; + uint32_t pre_cac_freq; /* * Indicate if HO fails during disconnect so that @@ -1389,7 +1389,7 @@ struct hdd_adapter { uint32_t track_src_port; uint32_t track_dest_port; uint32_t track_dest_ipv4; - uint32_t mon_chan; + uint32_t mon_chan_freq; uint32_t mon_bandwidth; /* rcpi information */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 8167637704f9..17c9070d8ca9 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1144,7 +1144,8 @@ static void __wlan_hdd_sap_pre_cac_success(struct hdd_adapter *adapter) wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id, CSA_REASON_PRE_CAC_SUCCESS); i = hdd_softap_set_channel_change(ap_adapter->dev, - ap_adapter->pre_cac_chan, + wlan_reg_freq_to_chan(hdd_ctx->pdev, + ap_adapter->pre_cac_freq), CH_WIDTH_MAX, false); if (0 != i) { hdd_err("failed to change channel"); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 86be22597714..f53fa8f4f353 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6859,7 +6859,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, status); } - adapter->mon_chan = chan; + adapter->mon_chan_freq = wlan_reg_chan_to_freq(hdd_ctx->pdev, chan); adapter->mon_bandwidth = bandwidth; return qdf_status_to_os_return(status); } @@ -6913,6 +6913,7 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx) struct hdd_adapter *adapter; eConnectionState conn_state; bool value; + uint8_t chan; hdd_enter(); @@ -7000,9 +7001,11 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx) hdd_delete_sta(adapter); break; case QDF_MONITOR_MODE: + chan = wlan_reg_freq_to_chan(hdd_ctx->pdev, + adapter->mon_chan_freq); hdd_start_station_adapter(adapter); hdd_set_mon_rx_cb(adapter->dev); - wlan_hdd_set_mon_chan(adapter, adapter->mon_chan, + wlan_hdd_set_mon_chan(adapter, chan, adapter->mon_bandwidth); break; default: diff --git a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c index f1c4903255f8..abee7fe58f8e 100644 --- a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c +++ b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c @@ -371,7 +371,8 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx, goto stop_close_pre_cac_adapter; } - ap_adapter->pre_cac_chan = pre_cac_chan; + ap_adapter->pre_cac_freq = wlan_reg_chan_to_freq(hdd_ctx->pdev, + pre_cac_chan); *out_adapter = pre_cac_adapter;