qcacld-3.0: Populate 6GHz channel list to wiphy

Use separate band - NL80211_BAND_6GHZ for 6GHz channel
list population. And 6GHz channels are reported only
when CFG80211_6GHZ_BAND_SUPPORTED and CONFIG_BAND_6GHZ
feature flags are defined.

Change-Id: Ieec30b304a7c3e8e856f290afdb4177206aeb2c7
CRs-Fixed: 2524262
This commit is contained in:
Liangwei Dong
2019-08-09 17:59:46 +08:00
committed by nshrivas
parent b3d5253c22
commit 692455f021
3 changed files with 81 additions and 2 deletions

View File

@@ -168,6 +168,11 @@ static inline bool in_compat_syscall(void) { return is_compat_task(); }
#define HDD_NUM_NL80211_BANDS ((enum nl80211_band)IEEE80211_NUM_BANDS)
#endif
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
#define HDD_NL80211_BAND_6GHZ NL80211_BAND_6GHZ
#endif
#define TSF_GPIO_PIN_INVALID 255
/** Length of the TX queue for the netdev */

View File

@@ -372,6 +372,62 @@ static struct ieee80211_supported_band wlan_hdd_band_5_ghz = {
.vht_cap.vht_supported = 1,
};
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
static struct ieee80211_channel hdd_channels_6_ghz[NUM_6GHZ_CHANNELS];
static struct ieee80211_supported_band wlan_hdd_band_6_ghz = {
.channels = NULL,
.n_channels = 0,
.band = HDD_NL80211_BAND_6GHZ,
.bitrates = a_mode_rates,
.n_bitrates = a_mode_rates_size,
.ht_cap.ht_supported = 1,
.ht_cap.cap = IEEE80211_HT_CAP_SGI_20
| IEEE80211_HT_CAP_GRN_FLD
| IEEE80211_HT_CAP_DSSSCCK40
| IEEE80211_HT_CAP_LSIG_TXOP_PROT
| IEEE80211_HT_CAP_SGI_40
| IEEE80211_HT_CAP_SUP_WIDTH_20_40,
.ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
.ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
.ht_cap.mcs.rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
.ht_cap.mcs.rx_highest = cpu_to_le16(72),
.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
.vht_cap.vht_supported = 1,
};
#define HDD_SET_6GHZCHAN(ch, freq, chan, flag) { \
(ch).band = HDD_NL80211_BAND_6GHZ; \
(ch).center_freq = (freq); \
(ch).hw_value = (chan); \
(ch).flags = (flag); \
(ch).max_antenna_gain = 0; \
(ch).max_power = 0; \
}
static void hdd_init_6ghz(struct hdd_context *hdd_ctx)
{
uint32_t i;
struct wiphy *wiphy = hdd_ctx->wiphy;
struct ieee80211_channel *chlist = hdd_channels_6_ghz;
uint32_t num = ARRAY_SIZE(hdd_channels_6_ghz);
qdf_mem_zero(chlist, sizeof(*chlist) * num);
for (i = 0; i < num; i++)
HDD_SET_6GHZCHAN(chlist[i], 5945 + i * 20, 1 + i * 4, \
IEEE80211_CHAN_DISABLED);
wiphy->bands[HDD_NL80211_BAND_6GHZ] = &wlan_hdd_band_6_ghz;
wiphy->bands[HDD_NL80211_BAND_6GHZ]->channels = chlist;
wiphy->bands[HDD_NL80211_BAND_6GHZ]->n_channels = num;
}
#else
static void hdd_init_6ghz(struct hdd_context *hdd_ctx)
{
}
#endif
/* This structure contain information what kind of frame are expected in
* TX/RX direction for each kind of interface
*/
@@ -15067,6 +15123,8 @@ QDF_STATUS wlan_hdd_update_wiphy_supported_band(struct hdd_context *hdd_ctx)
HDD_NL80211_BAND_5GHZ]->channels +
len_5g_ch, len_srd_ch);
hdd_init_6ghz(hdd_ctx);
return QDF_STATUS_SUCCESS;
}

View File

@@ -1357,6 +1357,22 @@ void hdd_send_wiphy_regd_sync_event(struct hdd_context *hdd_ctx)
}
#endif
#if defined(CONFIG_BAND_6GHZ) && (defined(CFG80211_6GHZ_BAND_SUPPORTED) || \
(KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE))
static void
fill_wiphy_6ghz_band_channels(struct wiphy *wiphy,
struct regulatory_channel *chan_list)
{
fill_wiphy_band_channels(wiphy, chan_list, NL80211_BAND_6GHZ);
}
#else
static void
fill_wiphy_6ghz_band_channels(struct wiphy *wiphy,
struct regulatory_channel *chan_list)
{
}
#endif
static void hdd_regulatory_dyn_cbk(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *chan_list,
@@ -1377,7 +1393,7 @@ static void hdd_regulatory_dyn_cbk(struct wlan_objmgr_psoc *psoc,
fill_wiphy_band_channels(wiphy, chan_list, NL80211_BAND_2GHZ);
fill_wiphy_band_channels(wiphy, chan_list, NL80211_BAND_5GHZ);
fill_wiphy_6ghz_band_channels(wiphy, chan_list);
cc_src = ucfg_reg_get_cc_and_src(hdd_ctx->psoc, alpha2);
qdf_mem_copy(hdd_ctx->reg.alpha2, alpha2, REG_ALPHA2_LEN + 1);
sme_set_cc_src(hdd_ctx->mac_handle, cc_src);
@@ -1440,7 +1456,7 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
NL80211_BAND_2GHZ);
fill_wiphy_band_channels(wiphy, cur_chan_list,
NL80211_BAND_5GHZ);
fill_wiphy_6ghz_band_channels(wiphy, cur_chan_list);
cc_src = ucfg_reg_get_cc_and_src(hdd_ctx->psoc, alpha2);
qdf_mem_copy(hdd_ctx->reg.alpha2, alpha2, REG_ALPHA2_LEN + 1);
sme_set_cc_src(hdd_ctx->mac_handle, cc_src);