Browse Source

qcacld-3.0: Replace hdd_wlan_get_freq() with converged service

Currently HDD defines function hdd_wlan_get_freq() which uses
it own static table to perform channel to frequency mapping. This
duplicates functionality provided by the converged regulatory
function wlan_reg_chan_to_freq(), so remove hdd_wlan_get_freq()
and update its only client to use wlan_reg_chan_to_freq().

Change-Id: I6fcb11b9b967ab77dcd7c8d0c1bc185ee3c18913
CRs-Fixed: 2215576
Jeff Johnson 7 years ago
parent
commit
32bd9740ce
3 changed files with 4 additions and 49 deletions
  1. 0 7
      core/hdd/inc/wlan_hdd_wext.h
  2. 4 2
      core/hdd/src/wlan_hdd_stats.c
  3. 0 40
      core/hdd/src/wlan_hdd_wext.c

+ 0 - 7
core/hdd/inc/wlan_hdd_wext.h

@@ -199,12 +199,6 @@ enum hdd_wlan_wmm_ts_info_ack_policy {
 #define QCN_OUI_TYPE   "\x8c\xfd\xf0\x01"
 #define QCN_OUI_TYPE_SIZE  4
 
-struct ccp_freq_chan_map {
-	/* List of frequencies */
-	uint32_t freq;
-	uint32_t chan;
-};
-
 /* Packet Types. */
 #define WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
 #define WLAN_KEEP_ALIVE_NULL_PKT              1
@@ -257,7 +251,6 @@ void hdd_unregister_wext(struct net_device *dev);
  */
 void hdd_register_wext(struct net_device *dev);
 
-int hdd_wlan_get_freq(uint32_t chan, uint32_t *freq);
 void hdd_display_stats_help(void);
 void hdd_wlan_get_version(struct hdd_context *hdd_ctx,
 			 union iwreq_data *wrqu, char *extra);

+ 4 - 2
core/hdd/src/wlan_hdd_stats.c

@@ -37,6 +37,7 @@
 #include "wlan_hdd_hostapd.h"
 #include "wlan_hdd_request_manager.h"
 #include "wlan_hdd_debugfs_llstat.h"
+#include "wlan_reg_services_api.h"
 
 /* 11B, 11G Rate table include Basic rate and Extended rate
  * The IDX field is the rate index
@@ -4579,7 +4580,8 @@ static bool wlan_fill_survey_result(struct survey_info *survey, int opfreq,
 #endif
 
 static bool wlan_hdd_update_survey_info(struct wiphy *wiphy,
-		struct hdd_adapter *adapter, struct survey_info *survey, int idx)
+					struct hdd_adapter *adapter,
+					struct survey_info *survey, int idx)
 {
 	bool filled = false;
 	int i, j = 0;
@@ -4588,7 +4590,7 @@ static bool wlan_hdd_update_survey_info(struct wiphy *wiphy,
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	sme_get_operation_channel(hdd_ctx->hHal, &channel, adapter->session_id);
-	hdd_wlan_get_freq(channel, &opfreq);
+	opfreq = wlan_reg_chan_to_freq(hdd_ctx->hdd_pdev, channel);
 
 	mutex_lock(&hdd_ctx->chan_info_lock);
 

+ 0 - 40
core/hdd/src/wlan_hdd_wext.c

@@ -109,23 +109,6 @@
 #define HDD_SET_MCBC_FILTERS_TO_FW      1
 #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0
 
-/* To Validate Channel against the Frequency and Vice-Versa */
-static const struct ccp_freq_chan_map freq_chan_map[] = {
-	{2412, 1}, {2417, 2}, {2422, 3}, {2427, 4}, {2432, 5}, {2437, 6},
-	{2442, 7}, {2447, 8}, {2452, 9}, {2457, 10}, {2462, 11}, {2467, 12},
-	{2472, 13}, {2484, 14}, {4920, 240}, {4940, 244}, {4960, 248},
-	{4980, 252}, {5040, 208}, {5060, 212}, {5080, 216}, {5180, 36},
-	{5200, 40}, {5220, 44}, {5240, 48}, {5260, 52}, {5280, 56},
-	{5300, 60}, {5320, 64}, {5500, 100}, {5520, 104}, {5540, 108},
-	{5560, 112}, {5580, 116}, {5600, 120}, {5620, 124}, {5640, 128},
-	{5660, 132}, {5680, 136}, {5700, 140}, {5720, 144}, {5745, 149},
-	{5765, 153}, {5785, 157}, {5805, 161}, {5825, 165}, {5852, 170},
-	{5855, 171}, {5860, 172}, {5865, 173}, {5870, 174}, {5875, 175},
-	{5880, 176}, {5885, 177}, {5890, 178}, {5895, 179}, {5900, 180},
-	{5905, 181}, {5910, 182}, {5915, 183}, {5920, 184} };
-
-#define FREQ_CHAN_MAP_TABLE_SIZE QDF_ARRAY_SIZE(freq_chan_map)
-
 /* Private ioctls and their sub-ioctls */
 #define WLAN_PRIV_SET_INT_GET_NONE    (SIOCIWFIRSTPRIV + 0)
 #define WE_SET_11D_STATE     1
@@ -3459,29 +3442,6 @@ static QDF_STATUS hdd_wlan_get_ibss_peer_info_all(struct hdd_adapter *adapter)
 	return status;
 }
 
-/**
- * hdd_wlan_get_freq() - Convert channel to frequency
- * @channel: channel to be converted
- * @pfreq: where to store the frequency
- *
- * Return: 1 on success, otherwise a negative errno
- */
-int hdd_wlan_get_freq(uint32_t channel, uint32_t *pfreq)
-{
-	int i;
-
-	if (channel > 0) {
-		for (i = 0; i < FREQ_CHAN_MAP_TABLE_SIZE; i++) {
-			if (channel == freq_chan_map[i].chan) {
-				*pfreq = freq_chan_map[i].freq;
-				return 1;
-			}
-		}
-	}
-	hdd_err("Invalid channel no=%d!!", channel);
-	return -EINVAL;
-}
-
 /**
  * hdd_get_ldpc() - Get adapter LDPC
  * @adapter: adapter being queried