qcacld-3.0: Fix build error when enable 6g in kernel 4.4

When CONFIG_BAND_6GHZ and CFG80211_6GHZ_BAND_SUPPORTED are defined in
kernel 4.4, which means 6g feature is enabled, currently there is a
build error: wlan_hdd_iftype_data_alloc_6ghz is defined but not used.

To fix this issue, refine iftype_data_*g defination with below rules.
1. If CONFIG_BAND_6GHZ and CFG80211_6GHZ_BAND_SUPPORTED are defined,
iftype_data_2g, iftype_data_5g and iftype_data_6g will be defined no
matter the kernel version.
2. If the kernel version is not smaller than 4.19, iftype_data_2g and
iftype_data_5g will be defined.
3. If the kernel version is not smaller than 5.4 and CONFIG_BAND_6GHZ
is defined, iftype_data_6g will be defined.

Change-Id: If75bea9fc4c11d6cacd8dbf49455277f055ed8de
CRs-Fixed: 2600962
This commit is contained in:
bings 2019-12-23 17:41:52 +08:00 • committed by nshrivas
commit 3d9cd95e51
3 changed files with 25 additions and 27 deletions

View file

@ -1607,7 +1607,8 @@ struct hdd_context {
struct ieee80211_channel *channels_2ghz;
struct ieee80211_channel *channels_5ghz;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
#if (defined(CONFIG_BAND_6GHZ) && defined(CFG80211_6GHZ_BAND_SUPPORTED)) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
struct ieee80211_sband_iftype_data *iftype_data_2g;
struct ieee80211_sband_iftype_data *iftype_data_5g;
#endif

View file

@ -14998,6 +14998,8 @@ wlan_hdd_populate_srd_chan_info(struct hdd_context *hdd_ctx, uint32_t index)
#endif
#if (defined(CONFIG_BAND_6GHZ) && defined(CFG80211_6GHZ_BAND_SUPPORTED)) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
static QDF_STATUS
@ -15011,15 +15013,26 @@ wlan_hdd_iftype_data_alloc_6ghz(struct hdd_context *hdd_ctx)
return QDF_STATUS_SUCCESS;
}
static void
wlan_hdd_iftype_data_mem_free_6ghz(struct hdd_context *hdd_ctx)
{
qdf_mem_free(hdd_ctx->iftype_data_6g);
hdd_ctx->iftype_data_6g = NULL;
}
#else
static inline QDF_STATUS
wlan_hdd_iftype_data_alloc_6ghz(struct hdd_context *hdd_ctx)
{
return QDF_STATUS_SUCCESS;
}
static inline void
wlan_hdd_iftype_data_mem_free_6ghz(struct hdd_context *hdd_ctx)
{
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
static QDF_STATUS
wlan_hdd_iftype_data_alloc(struct hdd_context *hdd_ctx)
{
@ -15051,30 +15064,7 @@ wlan_hdd_iftype_data_alloc(struct hdd_context *hdd_ctx)
return QDF_STATUS_SUCCESS;
}
#else
static inline QDF_STATUS
wlan_hdd_iftype_data_alloc(struct hdd_context *hdd_ctx)
{
return QDF_STATUS_SUCCESS;
}
#endif
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
static void
wlan_hdd_iftype_data_mem_free_6ghz(struct hdd_context *hdd_ctx)
{
qdf_mem_free(hdd_ctx->iftype_data_6g);
hdd_ctx->iftype_data_6g = NULL;
}
#else
static inline void
wlan_hdd_iftype_data_mem_free_6ghz(struct hdd_context *hdd_ctx)
{
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
static void
wlan_hdd_iftype_data_mem_free(struct hdd_context *hdd_ctx)
{
@ -15085,6 +15075,13 @@ wlan_hdd_iftype_data_mem_free(struct hdd_context *hdd_ctx)
hdd_ctx->iftype_data_2g = NULL;
}
#else
static QDF_STATUS
wlan_hdd_iftype_data_alloc(struct hdd_context *hdd_ctx)
{
return QDF_STATUS_SUCCESS;
}
static inline void
wlan_hdd_iftype_data_mem_free(struct hdd_context *hdd_ctx)
{

View file

@ -1992,6 +1992,8 @@ static void hdd_extract_fw_version_info(struct hdd_context *hdd_ctx)
HDD_FW_VER_REL_ID(hdd_ctx->target_fw_vers_ext);
}
#if (defined(CONFIG_BAND_6GHZ) && defined(CFG80211_6GHZ_BAND_SUPPORTED)) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
static void
@ -2032,8 +2034,6 @@ hdd_update_wiphy_he_caps_6ghz(struct hdd_context *hdd_ctx)
}
#endif
#if defined(WLAN_FEATURE_11AX) && \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
static void hdd_update_wiphy_he_cap(struct hdd_context *hdd_ctx)
{
tDot11fIEhe_cap he_cap_cfg;