Commit 74bba5e5 authored by Wen Gong's avatar Wen Gong Committed by Kalle Valo

ath11k: enable 6G channels for WCN6855

For some chips such as WCN6855, single_pdev_only is set in struct
ath11k_hw_params which means ath11k calls ieee80211_register_hw() only
once and create only one device interface, and that device interface
supports all 2G/5G/6G channels.

ath11k_mac_setup_channels_rates() sets up the channels and it is called
for each device interface. It is called only once for single_pdev_only,
and then set up all channels for 2G/5G/6G. The logic of
ath11k_mac_setup_channels_rates() is not suitable for single_pdev_only,
it leads to all 6G channels being disabled for the device interface
which is single_pdev_only such as WCN6855.

Add channel frequency checks for the 6G band and enable the 6G channels
properly based on what is supported by the chip.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
Signed-off-by: default avatarWen Gong <wgong@codeaurora.org>
Signed-off-by: default avatarJouni Malinen <jouni@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210804181217.88751-3-jouni@codeaurora.org
parent 54f40f55
...@@ -7312,7 +7312,7 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, ...@@ -7312,7 +7312,7 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,
u32 supported_bands) u32 supported_bands)
{ {
struct ieee80211_supported_band *band; struct ieee80211_supported_band *band;
struct ath11k_hal_reg_capabilities_ext *reg_cap; struct ath11k_hal_reg_capabilities_ext *reg_cap, *temp_reg_cap;
void *channels; void *channels;
u32 phy_id; u32 phy_id;
...@@ -7322,6 +7322,7 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, ...@@ -7322,6 +7322,7 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,
ATH11K_NUM_CHANS); ATH11K_NUM_CHANS);
reg_cap = &ar->ab->hal_reg_cap[ar->pdev_idx]; reg_cap = &ar->ab->hal_reg_cap[ar->pdev_idx];
temp_reg_cap = reg_cap;
if (supported_bands & WMI_HOST_WLAN_2G_CAP) { if (supported_bands & WMI_HOST_WLAN_2G_CAP) {
channels = kmemdup(ath11k_2ghz_channels, channels = kmemdup(ath11k_2ghz_channels,
...@@ -7340,11 +7341,11 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, ...@@ -7340,11 +7341,11 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,
if (ar->ab->hw_params.single_pdev_only) { if (ar->ab->hw_params.single_pdev_only) {
phy_id = ath11k_get_phy_id(ar, WMI_HOST_WLAN_2G_CAP); phy_id = ath11k_get_phy_id(ar, WMI_HOST_WLAN_2G_CAP);
reg_cap = &ar->ab->hal_reg_cap[phy_id]; temp_reg_cap = &ar->ab->hal_reg_cap[phy_id];
} }
ath11k_mac_update_ch_list(ar, band, ath11k_mac_update_ch_list(ar, band,
reg_cap->low_2ghz_chan, temp_reg_cap->low_2ghz_chan,
reg_cap->high_2ghz_chan); temp_reg_cap->high_2ghz_chan);
} }
if (supported_bands & WMI_HOST_WLAN_5G_CAP) { if (supported_bands & WMI_HOST_WLAN_5G_CAP) {
...@@ -7364,9 +7365,15 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, ...@@ -7364,9 +7365,15 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,
band->n_bitrates = ath11k_a_rates_size; band->n_bitrates = ath11k_a_rates_size;
band->bitrates = ath11k_a_rates; band->bitrates = ath11k_a_rates;
ar->hw->wiphy->bands[NL80211_BAND_6GHZ] = band; ar->hw->wiphy->bands[NL80211_BAND_6GHZ] = band;
if (ar->ab->hw_params.single_pdev_only) {
phy_id = ath11k_get_phy_id(ar, WMI_HOST_WLAN_5G_CAP);
temp_reg_cap = &ar->ab->hal_reg_cap[phy_id];
}
ath11k_mac_update_ch_list(ar, band, ath11k_mac_update_ch_list(ar, band,
reg_cap->low_5ghz_chan, temp_reg_cap->low_5ghz_chan,
reg_cap->high_5ghz_chan); temp_reg_cap->high_5ghz_chan);
} }
if (reg_cap->low_5ghz_chan < ATH11K_MIN_6G_FREQ) { if (reg_cap->low_5ghz_chan < ATH11K_MIN_6G_FREQ) {
...@@ -7389,12 +7396,12 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar, ...@@ -7389,12 +7396,12 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,
if (ar->ab->hw_params.single_pdev_only) { if (ar->ab->hw_params.single_pdev_only) {
phy_id = ath11k_get_phy_id(ar, WMI_HOST_WLAN_5G_CAP); phy_id = ath11k_get_phy_id(ar, WMI_HOST_WLAN_5G_CAP);
reg_cap = &ar->ab->hal_reg_cap[phy_id]; temp_reg_cap = &ar->ab->hal_reg_cap[phy_id];
} }
ath11k_mac_update_ch_list(ar, band, ath11k_mac_update_ch_list(ar, band,
reg_cap->low_5ghz_chan, temp_reg_cap->low_5ghz_chan,
reg_cap->high_5ghz_chan); temp_reg_cap->high_5ghz_chan);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment