From 9d117c8b8502817c8ccbd8126e2d94d2c3aa38fd Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Thu, 25 Jul 2019 15:55:11 +0800 Subject: [PATCH] qcacld-3.0: Replace channel with channel frequency Replace pre_cac_chan with pre_cac_freq and mon_chan with mon_chan_freq in struct hdd_adapter. Change-Id: I413ff83c244e1ebb7deaa2dec52df76b4b957f53 CRs-Fixed: 2496812 --- core/hdd/inc/wlan_hdd_main.h | 8 ++++---- core/hdd/src/wlan_hdd_hostapd.c | 3 ++- core/hdd/src/wlan_hdd_main.c | 7 +++++-- core/hdd/src/wlan_hdd_sap_cond_chan_switch.c | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 8e810cd2f5..47f91441b6 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 8167637704..17c9070d8c 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 86be225977..f53fa8f4f3 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 f1c4903255..abee7fe58f 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;