Explorar o código

qcacld-3.0: Fix 11BE compilations when kernel doesn't support 11be

Along with 11BE feature macro, check for Kernel 11be macro to avoid
compilation issues when kernel doesn't support 11be.

Change-Id: I9fb84b6263cbdca4cde93e3a581acdbfe0fe2b34
CRs-Fixed: 3066175
Bapiraju Alla %!s(int64=3) %!d(string=hai) anos
pai
achega
f1fe15362c

+ 2 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -1949,7 +1949,7 @@ enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width)
 	case CH_WIDTH_10MHZ:
 		bw = HW_MODE_10_MHZ;
 		break;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		bw = HW_MODE_320_MHZ;
 		break;
@@ -1988,7 +1988,7 @@ enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw)
 	case HW_MODE_10_MHZ:
 		ch_width = CH_WIDTH_10MHZ;
 		break;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case HW_MODE_320_MHZ:
 		ch_width = CH_WIDTH_320MHZ;
 		break;

+ 1 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -433,7 +433,7 @@ static const uint8_t *cm_diag_get_akm_str(enum mgmt_auth_type auth_type,
 		return "NONE";
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static enum mgmt_dot11_mode
 cm_diag_eht_dot11_mode_from_phy_mode(enum wlan_phymode phymode)
 {

+ 1 - 1
core/hdd/inc/wlan_hdd_eht.h

@@ -30,7 +30,7 @@ struct wma_tgt_cfg;
 struct hdd_beacon_data;
 struct sap_config;
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 /**
  * hdd_update_tgt_eht_cap() - Update EHT related capabilities
  * @hdd_ctx: HDD context

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

@@ -3026,7 +3026,7 @@ static void wlan_hdd_handle_zero_acs_list(struct hdd_context *hdd_ctx,
 	hdd_debug("retore acs chan list to single freq %d", acs_chan_default);
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static void wlan_hdd_set_sap_acs_ch_width_320(struct sap_config *sap_config)
 {
 	sap_config->acs_cfg.ch_width = CH_WIDTH_320MHZ;
@@ -15445,7 +15445,7 @@ hdd_convert_phy_bw_to_nl_bw(enum phy_ch_width bw)
 		return NL80211_CHAN_WIDTH_5;
 	case CH_WIDTH_10MHZ:
 		return NL80211_CHAN_WIDTH_10;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		return NL80211_CHAN_WIDTH_320;
 #endif

+ 2 - 0
core/hdd/src/wlan_hdd_eht.c

@@ -31,6 +31,7 @@
 #include "wma_api.h"
 #include "wlan_hdd_sysfs.h"
 
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 #define CHAN_WIDTH_SET_40MHZ_IN_2G \
 	IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G
 #define CHAN_WIDTH_SET_40MHZ_80MHZ_IN_5G \
@@ -322,3 +323,4 @@ void hdd_sysfs_11be_rate_destroy(struct hdd_adapter *adapter)
 	device_remove_file(&adapter->dev->dev, &dev_attr_11be_rate);
 }
 
+#endif

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

@@ -861,7 +861,7 @@ static int hdd_stop_bss_link(struct hdd_adapter *adapter)
 	return errno;
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static void
 wlan_hdd_set_chandef_320mhz(struct cfg80211_chan_def *chandef,
 			    struct hdd_chan_change_params chan_change)

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

@@ -1145,7 +1145,7 @@ static int pcie_gen_speed;
 /* Variable to hold connection mode including module parameter con_mode */
 static int curr_con_mode;
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static enum phy_ch_width hdd_get_eht_phy_ch_width_from_target(void)
 {
 	uint32_t max_fw_bw = sme_get_eht_ch_width();
@@ -19135,7 +19135,7 @@ static const struct hdd_chwidth_info chwidth_info[] = {
 		.ch_bw_str = "10MHz",
 		.phy_chwidth = CH_WIDTH_10MHZ,
 	},
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	[NL80211_CHAN_WIDTH_320] = {
 		.sir_chwidth_valid = true,
 		.sir_chwidth = eHT_CHANNEL_WIDTH_320MHZ,

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

@@ -1104,7 +1104,7 @@ void hdd_reg_notifier(struct wiphy *wiphy,
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static void fill_wiphy_channel_320mhz(struct ieee80211_channel *wiphy_chan,
 				      uint16_t max_bw)
 {

+ 1 - 1
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -2904,7 +2904,7 @@ lim_convert_channel_width_enum(enum phy_ch_width ch_width)
 		return eHT_CHANNEL_WIDTH_160MHZ;
 	case CH_WIDTH_80P80MHZ:
 		return eHT_CHANNEL_WIDTH_80P80MHZ;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		return eHT_CHANNEL_WIDTH_320MHZ;
 #endif

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -116,7 +116,7 @@ static const enum phy_ch_width get_next_higher_bw[] = {
 	[CH_WIDTH_20MHZ] = CH_WIDTH_40MHZ,
 	[CH_WIDTH_40MHZ] = CH_WIDTH_80MHZ,
 	[CH_WIDTH_80MHZ] = CH_WIDTH_160MHZ,
-#ifndef WLAN_FEATURE_11BE
+#if !defined(WLAN_FEATURE_11BE) || !defined(CFG80211_11BE_BASIC)
 	[CH_WIDTH_160MHZ] = CH_WIDTH_INVALID
 #else
 	[CH_WIDTH_160MHZ] = CH_WIDTH_320MHZ,

+ 1 - 1
core/mac/src/pe/lim/lim_utils.h

@@ -759,7 +759,7 @@ static inline uint16_t ch_width_in_mhz(enum phy_ch_width ch_width)
 		return 5;
 	case CH_WIDTH_10MHZ:
 		return 10;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		return 320;
 #endif

+ 1 - 1
core/sap/src/sap_api_link_cntl.c

@@ -81,7 +81,7 @@
  * Function Declarations and Documentation
  * -------------------------------------------------------------------------*/
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static inline bool sap_acs_cfg_is_chwidth_320mhz(uint16_t width)
 {
 	return width == CH_WIDTH_320MHZ;

+ 2 - 2
core/sap/src/sap_ch_select.c

@@ -1826,7 +1826,7 @@ static void sap_sort_chl_weight_160_mhz(struct mac_context *mac_ctx,
 	}
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 /**
  * sap_sort_chl_weight_320_mhz() - to sort the channels with the least weight
  * @pSpectInfoParams: Pointer to the tSapChSelSpectInfo structure
@@ -2418,7 +2418,7 @@ static void sap_sort_chl_weight_all(struct mac_context *mac_ctx,
 	case CH_WIDTH_160MHZ:
 		sap_sort_chl_weight_160_mhz(mac_ctx, pSpectInfoParams);
 		break;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		sap_sort_chl_weight_320_mhz(mac_ctx, pSpectInfoParams);
 		break;

+ 1 - 1
core/sap/src/sap_module.c

@@ -1190,7 +1190,7 @@ QDF_STATUS wlansap_deauth_sta(struct sap_context *sap_ctx,
 				   params);
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static enum phy_ch_width
 wlansap_get_target_eht_phy_ch_width(void)
 {

+ 1 - 1
core/wma/src/wma_dev_if.c

@@ -3780,7 +3780,7 @@ QDF_STATUS wma_post_vdev_start_setup(uint8_t vdev_id)
 
 	wma_vdev_set_he_bss_params(wma, vdev_id,
 				   &mlme_obj->proto.he_ops_info);
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	wma_vdev_set_eht_bss_params(wma, vdev_id,
 				    &mlme_obj->proto.eht_ops_info);
 #endif

+ 2 - 0
core/wma/src/wma_eht.c

@@ -25,6 +25,7 @@
 #include "service_ready_param.h"
 #include "target_if.h"
 
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 /**
  * wma_convert_eht_cap() - convert EHT capabilities into dot11f structure
  * @eht_cap: pointer to dot11f structure
@@ -494,3 +495,4 @@ void wma_set_peer_assoc_params_bw_320(struct peer_assoc_params *params,
 	if (ch_width == CH_WIDTH_320MHZ)
 		params->bw_320 = 1;
 }
+#endif

+ 1 - 1
core/wma/src/wma_eht.h

@@ -19,7 +19,7 @@
 
 #include "wma.h"
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 /*
  * wma_eht_update_tgt_services() - update tgt cfg to indicate 11be support
  * @wmi_handle: pointer to WMI handle

+ 1 - 1
core/wma/src/wma_features.c

@@ -636,7 +636,7 @@ QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE handle,
 					    &peer_set_param_fp);
 }
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static enum wlan_phymode
 wma_eht_chan_phy_mode(uint32_t freq, uint8_t dot11_mode, uint16_t bw_val,
 		      enum phy_ch_width chan_width)

+ 2 - 2
core/wma/src/wma_scan_roam.c

@@ -114,7 +114,7 @@ wma_map_phy_ch_bw_to_wmi_channel_width(enum phy_ch_width ch_width)
 		return WMI_HOST_CHAN_WIDTH_5;
 	case CH_WIDTH_10MHZ:
 		return WMI_HOST_CHAN_WIDTH_10;
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 	case CH_WIDTH_320MHZ:
 		return WMI_HOST_CHAN_WIDTH_320;
 #endif
@@ -128,7 +128,7 @@ wma_map_phy_ch_bw_to_wmi_channel_width(enum phy_ch_width ch_width)
 #define WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ        2
 #define WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ 3
 
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 static void wma_update_ch_list_11be_params(struct ch_params *ch)
 {
 	ch->ch_width = CH_WIDTH_320MHZ;

+ 1 - 1
core/wma/src/wma_utils.c

@@ -3284,7 +3284,7 @@ wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type,
 			phymode = WLAN_PHYMODE_11A;
 			break;
 		}
-#ifdef WLAN_FEATURE_11BE
+#if defined(WLAN_FEATURE_11BE) && defined(CFG80211_11BE_BASIC)
 		if (is_eht) {
 			if (ch_width == CH_WIDTH_160MHZ)
 				phymode = WLAN_PHYMODE_11BEA_EHT160;