]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: add channel 177 to the 5 GHz channel list
authorYingying Tang <yingying.tang@oss.qualcomm.com>
Wed, 15 Apr 2026 06:38:57 +0000 (12:08 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 11 May 2026 14:59:00 +0000 (07:59 -0700)
Add support for 5 GHz channel 177 with a center frequency of 5885 MHz and
Operating Class 125 per IEEE Std 802.11-2024 Table E-4.

Channels 169, 173, and 177 are in the 5.9 GHz band and must be disabled
when 5.9 GHz service bit is not supported. The 5.9 GHz band is only permitted
for WLAN operation under FCC regulations.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3

Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260415063857.2462256-1-yintang@qti.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/dp_rx.c
drivers/net/wireless/ath/ath12k/mac.c
drivers/net/wireless/ath/ath12k/wmi.h

index 8be435535a4e8b411168b3d8aa6e1c5aad2254a6..4edc8f4e0cb5f6637a319636b748a8763bcc3fd0 100644 (file)
@@ -542,8 +542,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)
 {
index cae00e0539df755f5cb3ca6b9a10ee1e6efaf410..a4fec1dc55c6d6facb87551964c02d7c99bc66c7 100644 (file)
 #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);
 
@@ -1314,9 +1319,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;
        }
 
index 9ce759626f181abff1b1cd28fe63f5775b68af4b..c6879f21a615c982dae848345f8dc8cfefc2d193 100644 (file)
@@ -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),
@@ -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[] = {
@@ -13891,6 +13895,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[])
@@ -14024,6 +14048,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];
index c644604c1426a0160a516eff622f0763ac5452d6..65ff41396c086f720aeb62d82b539506351b5ada 100644 (file)
@@ -2260,6 +2260,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,