Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath12k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ struct ath12k_sta {
#define ATH12K_MAX_5GHZ_FREQ (ATH12K_5GHZ_MAX_CENTER + ATH12K_HALF_20MHZ_BW)
#define ATH12K_MIN_6GHZ_FREQ (ATH12K_6GHZ_MIN_CENTER - ATH12K_HALF_20MHZ_BW)
#define ATH12K_MAX_6GHZ_FREQ (ATH12K_6GHZ_MAX_CENTER + ATH12K_HALF_20MHZ_BW)
#define ATH12K_NUM_CHANS 101
#define ATH12K_MAX_5GHZ_CHAN 173
#define ATH12K_NUM_CHANS 102
#define ATH12K_MAX_5GHZ_CHAN 177

static inline bool ath12k_is_2ghz_channel_freq(u32 freq)
{
Expand Down
11 changes: 9 additions & 2 deletions drivers/net/wireless/ath/ath12k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include "dp_mon.h"
#include "debugfs_htt_stats.h"

#define ATH12K_2GHZ_MIN_CHAN_NUM 1
#define ATH12K_2GHZ_MAX_CHAN_NUM 14
#define ATH12K_5GHZ_MIN_CHAN_NUM 36
#define ATH12K_5GHZ_MAX_CHAN_NUM 177

static int ath12k_dp_rx_tid_delete_handler(struct ath12k_base *ab,
struct ath12k_dp_rx_tid_rxq *rx_tid);

Expand Down Expand Up @@ -1288,9 +1293,11 @@ void ath12k_dp_rx_h_ppdu(struct ath12k_pdev_dp *dp_pdev,
center_freq <= ATH12K_MAX_6GHZ_FREQ) {
rx_status->band = NL80211_BAND_6GHZ;
rx_status->freq = center_freq;
} else if (channel_num >= 1 && channel_num <= 14) {
} else if (channel_num >= ATH12K_2GHZ_MIN_CHAN_NUM &&
channel_num <= ATH12K_2GHZ_MAX_CHAN_NUM) {
rx_status->band = NL80211_BAND_2GHZ;
} else if (channel_num >= 36 && channel_num <= 173) {
} else if (channel_num >= ATH12K_5GHZ_MIN_CHAN_NUM &&
channel_num <= ATH12K_5GHZ_MAX_CHAN_NUM) {
rx_status->band = NL80211_BAND_5GHZ;
}

Expand Down
26 changes: 26 additions & 0 deletions drivers/net/wireless/ath/ath12k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
.max_power = 30, \
}

#define ATH12K_5_9_GHZ_MIN_FREQ 5845
#define ATH12K_5_9_GHZ_MAX_FREQ 5885

static const struct ieee80211_channel ath12k_2ghz_channels[] = {
CHAN2G(1, 2412, 0),
CHAN2G(2, 2417, 0),
Expand Down Expand Up @@ -96,6 +99,7 @@ static const struct ieee80211_channel ath12k_5ghz_channels[] = {
CHAN5G(165, 5825, 0),
CHAN5G(169, 5845, 0),
CHAN5G(173, 5865, 0),
CHAN5G(177, 5885, 0),
};

static const struct ieee80211_channel ath12k_6ghz_channels[] = {
Expand Down Expand Up @@ -13880,6 +13884,26 @@ static int ath12k_mac_update_band(struct ath12k *ar,
return 0;
}

static void ath12k_mac_update_5_9_ghz_ch_list(struct ath12k *ar,
struct ieee80211_supported_band *band)
{
int i;

if (test_bit(WMI_TLV_SERVICE_5_9GHZ_SUPPORT,
ar->ab->wmi_ab.svc_map))
return;

guard(spinlock_bh)(&ar->ab->base_lock);
if (ar->ab->dfs_region != ATH12K_DFS_REG_FCC)
return;

for (i = 0; i < band->n_channels; i++) {
if (band->channels[i].center_freq >= ATH12K_5_9_GHZ_MIN_FREQ &&
band->channels[i].center_freq <= ATH12K_5_9_GHZ_MAX_FREQ)
band->channels[i].flags |= IEEE80211_CHAN_DISABLED;
}
}

static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
u32 supported_bands,
struct ieee80211_supported_band *bands[])
Expand Down Expand Up @@ -14013,6 +14037,8 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
band->n_bitrates = ath12k_a_rates_size;
band->bitrates = ath12k_a_rates;

ath12k_mac_update_5_9_ghz_ch_list(ar, band);

if (ab->hw_params->single_pdev_only) {
phy_id = ath12k_get_phy_id(ar, WMI_HOST_WLAN_5GHZ_CAP);
reg_cap = &ab->hal_reg_cap[phy_id];
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath12k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -2259,6 +2259,7 @@ enum wmi_tlv_service {
WMI_TLV_SERVICE_FREQINFO_IN_METADATA = 219,
WMI_TLV_SERVICE_EXT2_MSG = 220,
WMI_TLV_SERVICE_BEACON_PROTECTION_SUPPORT = 244,
WMI_TLV_SERVICE_5_9GHZ_SUPPORT = 247,
WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249,
WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT = 253,

Expand Down