Selaa lähdekoodia

qcacld-3.0: Add support for CFG80211_REMOVE_IEEE80211_BACKPORT

CFG80211_REMOVE_IEEE80211_BACKPORT is added to indicate
backport of Change-Id: 57fbcce37be7c1d2622b56587c10ade00e96afa3
from upstream 4.7 kernel to 4.4.

Hence add this flag CFG80211_REMOVE_IEEE80211_BACKPORT to
support this compilation. Also introduce HDD_NUM_NL80211_BANDS.

Change-Id: I60a15a1273f939a0a288d08d03ccb5bf1bdcc429
CRs-Fixed: 2087917
Srinivas Girigowda 7 vuotta sitten
vanhempi
sitoutus
5da651bc36

+ 4 - 1
core/hdd/inc/wlan_hdd_main.h

@@ -92,12 +92,15 @@
 #define NUM_TX_QUEUES 4
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) || \
+	defined(CFG80211_REMOVE_IEEE80211_BACKPORT)
 #define HDD_NL80211_BAND_2GHZ   NL80211_BAND_2GHZ
 #define HDD_NL80211_BAND_5GHZ   NL80211_BAND_5GHZ
+#define HDD_NUM_NL80211_BANDS   NUM_NL80211_BANDS
 #else
 #define HDD_NL80211_BAND_2GHZ   IEEE80211_BAND_2GHZ
 #define HDD_NL80211_BAND_5GHZ   IEEE80211_BAND_5GHZ
+#define HDD_NUM_NL80211_BANDS   ((enum nl80211_band)IEEE80211_NUM_BANDS)
 #endif
 
 /** Length of the TX queue for the netdev */

+ 4 - 3
core/hdd/src/wlan_hdd_cfg80211.c

@@ -11370,7 +11370,8 @@ int wlan_hdd_cfg80211_update_band(hdd_context_t *hdd_ctx, struct wiphy *wiphy,
 	enum channel_state channelEnabledState;
 
 	ENTER();
-	for (i = 0; i < NUM_NL80211_BANDS; i++) {
+
+	for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) {
 
 		if (NULL == wiphy->bands[i])
 			continue;
@@ -11571,7 +11572,7 @@ int wlan_hdd_cfg80211_init(struct device *dev,
 			sizeof(hdd_channels_5_ghz));
 	}
 
-	for (i = 0; i < NUM_NL80211_BANDS; i++) {
+	for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) {
 
 		if (NULL == wiphy->bands[i])
 			continue;
@@ -11659,7 +11660,7 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy)
 {
 	int i;
 
-	for (i = 0; i < NUM_NL80211_BANDS; i++) {
+	for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) {
 		if (NULL != wiphy->bands[i] &&
 		   (NULL != wiphy->bands[i]->channels)) {
 			qdf_mem_free(wiphy->bands[i]->channels);

+ 0 - 8
core/hdd/src/wlan_hdd_cfg80211.h

@@ -419,14 +419,6 @@ static inline void wlan_hdd_cfg80211_indicate_disconnect(struct net_device *dev,
 struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
 						tSirBssDescription *bss_desc);
 
-/*
- * As of 4.7, ieee80211_band is removed; add shims so we can reference
- * nl80211_band instead
- */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
-#define NUM_NL80211_BANDS ((enum nl80211_band)IEEE80211_NUM_BANDS)
-#endif
-
 /**
  * hdd_rate_info_bw: an HDD internal rate bandwidth representation
  * @HDD_RATE_BW_5: 5MHz

+ 1 - 1
core/hdd/src/wlan_hdd_ext_scan.c

@@ -2399,7 +2399,7 @@ static void hdd_remove_passive_channels(struct wiphy *wiphy,
 	int i, j, k;
 
 	for (i = 0; i < *num_channels; i++)
-		for (j = 0; j < NUM_NL80211_BANDS; j++) {
+		for (j = 0; j < HDD_NUM_NL80211_BANDS; j++) {
 			if (wiphy->bands[j] == NULL)
 				continue;
 			for (k = 0; k < wiphy->bands[j]->n_channels; k++) {

+ 1 - 1
core/hdd/src/wlan_hdd_ocb.c

@@ -129,7 +129,7 @@ static int dot11p_validate_channel(struct wiphy *wiphy,
 	struct ieee80211_supported_band *current_band;
 	struct ieee80211_channel *current_channel;
 
-	for (band_idx = 0; band_idx < NUM_NL80211_BANDS; band_idx++) {
+	for (band_idx = 0; band_idx < HDD_NUM_NL80211_BANDS; band_idx++) {
 		current_band = wiphy->bands[band_idx];
 		if (!current_band)
 			continue;

+ 2 - 2
core/hdd/src/wlan_hdd_regulatory.c

@@ -389,7 +389,7 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx,
 
 	band_capability = hdd_ctx->config->nBandCapability;
 
-	for (band_num = 0; band_num < NUM_NL80211_BANDS; band_num++) {
+	for (band_num = 0; band_num < HDD_NUM_NL80211_BANDS; band_num++) {
 
 		if (wiphy->bands[band_num] == NULL)
 			continue;
@@ -636,7 +636,7 @@ static void hdd_restore_custom_reg_settings(struct wiphy *wiphy,
 	    (country_alpha2[1] == '0') &&
 	    (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)) {
 
-		for (band = 0; band < NUM_NL80211_BANDS; band++) {
+		for (band = 0; band < HDD_NUM_NL80211_BANDS; band++) {
 			sband = wiphy->bands[band];
 			if (!sband)
 				continue;

+ 4 - 4
core/hdd/src/wlan_hdd_scan.c

@@ -1528,7 +1528,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 			tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES], tmp)
 			n_channels++;
 	} else {
-		for (band = 0; band < NUM_NL80211_BANDS; band++)
+		for (band = 0; band < HDD_NUM_NL80211_BANDS; band++)
 			if (wiphy->bands[band])
 				n_channels += wiphy->bands[band]->n_channels;
 	}
@@ -1588,7 +1588,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 			count++;
 		}
 	} else {
-		for (band = 0; band < NUM_NL80211_BANDS; band++) {
+		for (band = 0; band < HDD_NUM_NL80211_BANDS; band++) {
 			if (!wiphy->bands[band])
 				continue;
 			for (j = 0; j < wiphy->bands[band]->n_channels;
@@ -1630,7 +1630,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 				request->ie_len);
 	}
 
-	for (count = 0; count < NUM_NL80211_BANDS; count++)
+	for (count = 0; count < HDD_NUM_NL80211_BANDS; count++)
 		if (wiphy->bands[count])
 			request->rates[count] =
 				(1 << wiphy->bands[count]->n_bitrates) - 1;
@@ -1640,7 +1640,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 				    tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES],
 				    tmp) {
 			band = nla_type(attr);
-			if (band >= NUM_NL80211_BANDS)
+			if (band >= HDD_NUM_NL80211_BANDS)
 				continue;
 			if (!wiphy->bands[band])
 				continue;

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

@@ -3734,7 +3734,7 @@ static bool wlan_hdd_update_survey_info(struct wiphy *wiphy,
 
 	mutex_lock(&pHddCtx->chan_info_lock);
 
-	for (i = 0; i < NUM_NL80211_BANDS && !filled; i++) {
+	for (i = 0; i < HDD_NUM_NL80211_BANDS && !filled; i++) {
 		if (wiphy->bands[i] == NULL)
 			continue;
 
@@ -3795,7 +3795,6 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
 	if (pHddCtx->config->fEnableSNRMonitoring == 0)
 		return -ENONET;
 
-
 	if (pHddStaCtx->hdd_ReassocScenario) {
 		hdd_info("Roaming in progress, hence return");
 		return -ENONET;