wifi: ath12k: Add support for handling incumbent signal interference in 6 GHz
v2 cover wifi: ath12k: Add support for handling incumbent signal interference in 6 GHz
This patch series adds the implementation of handling of interferences due to incumbent signals in 6 GHz channels. When an interference is detected, the firmware indicates it to the host using the WMI_DCS_INTERFERENCE_EVENT.
The driver is expected to parse the new WMI event to retrieve the interference information, validate the interference detected channel and bitmap, and indicate the interference to mac80211, which then notifies this interference to the userspace.
---
Changes in v2:
- Added an explicit len check in sub-TLV parser before accessing info.
---
Aishwarya R (2):
wifi: ath12k: Add support for handling incumbent signal interference
in 6 GHz
wifi: ath12k: Add debugfs support to simulate incumbent signal
interference
drivers/net/wireless/ath/ath12k/core.h | 8 + drivers/net/wireless/ath/ath12k/debugfs.c | 46 +++ drivers/net/wireless/ath/ath12k/mac.c | 46 +++ drivers/net/wireless/ath/ath12k/wmi.c | 425 ++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 72 +++- 5 files changed, 596 insertions(+), 1 deletion(-)
base-commit: e12d2d3983acb150fd987d19ec6a2a530da110df
Signature · 1 line
2.34.1
PATCH v2 1/2 wifi: ath12k: Add support for handling incumbent signal interference in 6 GHz
From: Aishwarya R <[email protected]>
When incumbent signal interference is detected by an AP/mesh interface operating in the 6 GHz band, as mandated by the FCC, it is expected to vacate the affected channels. The firmware indicates the interference to the host using the WMI_DCS_INTERFERENCE_EVENT.
To handle the new WMI event, first parse it to retrieve the interference information. Next, validate the interference-detected channel and the interference bitmap. The interference bitmap received from the firmware uses a mapping where bit 0 corresponds to the primary 20 MHz segment, regardless of its position within the operating bandwidth. Bit 1 represents the next adjacent 20 MHz segment, bit 2 the lower 20 MHz segment of the adjacent 40 MHz segment, and so on, progressing sequentially across the bandwidth. However, for userspace consumption via mac80211, this bitmap must be transformed into a standardized format such that each bit position directly maps to the corresponding sub-channel index within the operating bandwidth. Finally, indicate the transformed interference bitmap to mac80211, which then notifies userspace of the interference. Once the incumbent signal interference is detected, firmware suspends TX internally on the affected operating channel while userspace decides the mitigation action. Userspace is expected to trigger a channel switch or bandwidth reduction to mitigate the interference. Also, add a flag handling_in_progress to indicate that handling of interference is in progress. Set it to true after indicating to mac80211 about the interference. Reset the flag to false after the operating channel is switched by userspace. This prevents processing any further interference events when there is already a previous event being handled. Hence, further events are processed only after a channel switch request is received from userspace for the previous event.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/core.h | 8 + drivers/net/wireless/ath/ath12k/mac.c | 46 +++ drivers/net/wireless/ath/ath12k/wmi.c | 389 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 58 +++- 4 files changed, 500 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/core.h +8 -0
@@ -763,6 +763,14 @@ struct ath12k {struct ath12k_pdev_rssi_offsets rssi_info;struct ath12k_thermal thermal; + +/* Protected by ar->data_lock */ +struct ath12k_incumbent_signal_interference { +u32 center_freq; +enum nl80211_chan_width width; +u32 chan_bw_interference_bitmap; +bool handling_in_progress; + } incumbent_signal_interference; };struct ath12k_hw {
drivers/net/wireless/ath/ath12k/mac.c +46 -0
72 lines not on this page · raw message
drivers/net/wireless/ath/ath12k/wmi.c +389 -0
407 lines not on this page · raw message
drivers/net/wireless/ath/ath12k/wmi.h +57 -1
70 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v2 2/2 wifi: ath12k: Add debugfs support to simulate incumbent signal interference
In reply to Amith AFrom: Aishwarya R <[email protected]>
Add debugfs support to simulate incumbent signal interference from the host for testing purposes. The debugfs entry is created only for 6 GHz radio when firmware advertises the support through WMI_TLV_SERVICE_DCS_INCUMBENT_SIGNAL_INTERFERENCE_SUPPORT flag.
Debugfs command:
echo <interference_bitmap> > /sys/kernel/debug/ath12k/pci-000X/macX/simulate_incumbent_signal_interference
Each bit in the interference_bitmap represents a 20 MHz segment. Bit 0 corresponds to the primary 20 MHz segment, regardless of its position within the operating bandwidth. Bit 1 represents the next adjacent 20 MHz segment, bit 2 the lower 20 MHz segment of the adjacent 40 MHz segment, and so on-progressing sequentially across the bandwidth..
Example:
echo 0xF0 > /sys/kernel/debug/ath12k/pci-0002:01:00.0/mac0/simulate_incumbent_signal_interference This indicates that all the subchannels in the secondary 80 MHz segment
were affected.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/debugfs.c | 46 +++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.c | 36 ++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 14 +++++++ 3 files changed, 96 insertions(+)
drivers/net/wireless/ath/ath12k/debugfs.c +46 -0
@@ -1450,6 +1450,44 @@ static const struct file_operations fops_pdev_stats = { .llseek = default_llseek, }; +static ssize_t +ath12k_write_simulate_incumbent_signal_interference (struct file *file, +const char __user *user_buf, +size_t count,loff_t *ppos) +{ +struct ath12k *ar = file->private_data; +struct ath12k_hw *ah =ath12k_ar_to_ah (ar); +struct wiphy *wiphy =ath12k_ar_to_hw (ar)->wiphy; +u32 chan_bw_interference_bitmap; +int ret; + +if (ah->state !=ATH12K_HW_STATE_ON ) +return -ENETDOWN ; + +/* +* Bitmap uses the firmware primary-based ordering documented in +* ath12k_wmi_transform_interference_bitmap() & intf_map_80. +*/ +if (kstrtou32_from_user (user_buf, count,0 , &chan_bw_interference_bitmap)) +return -EINVAL ; + +wiphy_lock (wiphy); + ret =ath12k_wmi_simulate_incumbent_signal_interference (ar, chan_bw_interference_bitmap); +if (ret) + goto exit; + + ret = count; + +exit: +wiphy_unlock (wiphy); +return ret; +} + +static const struct file_operations fops_simulate_incumbent_signal_interference = { + .write = ath12k_write_simulate_incumbent_signal_interference, + .open = simple_open, +}; +static void ath12k_debugfs_fw_stats_register (struct ath12k *ar) {
@@ -1515,6 +1553,14 @@ void ath12k_debugfs_register(struct ath12k *ar) ar, &fops_tpc_stats_type);init_completion (&ar->debug.tpc_complete); +if (ar->mac.sbands[NL80211_BAND_6GHZ ].channels && +test_bit (WMI_TLV_SERVICE_DCS_INCUMBENT_SIGNAL_INTERFERENCE_SUPPORT , + ar->ab->wmi_ab.svc_map)) { +debugfs_create_file ("simulate_incumbent_signal_interference" ,0200 , + ar->debug.debugfs_pdev, ar, + &fops_simulate_incumbent_signal_interference); + } +ath12k_debugfs_htt_stats_register (ar);ath12k_debugfs_fw_stats_register (ar);
drivers/net/wireless/ath/ath12k/wmi.c +36 -0
@@ -10568,6 +10568,42 @@ int ath12k_wmi_send_tpc_stats_request(struct ath12k *ar,return ret; } +int ath12k_wmi_simulate_incumbent_signal_interference (struct ath12k *ar, +u32 chan_bw_interference_bitmap) +{ +struct wmi_unit_test_arg wmi_ut = {}; +struct ath12k_link_vif *arvif; +struct ath12k_vif *ahvif; +bool arvif_found = false; + +list_for_each_entry (arvif, &ar->arvifs, list) { + ahvif = arvif->ahvif; +if (arvif->is_started && ahvif->vdev_type ==WMI_VDEV_TYPE_AP ) { + arvif_found = true; +break ; + } + } + +if (!arvif_found) +return -EINVAL ; + + wmi_ut.args[ATH12K_WMI_INCUMBENT_SIGNAL_TEST_INTF ] = +ATH12K_WMI_UNIT_TEST_INCUMBENT_SIGNAL_INTF_TYPE ; + wmi_ut.args[ATH12K_WMI_INCUMBENT_SIGNAL_TEST_BITMAP ] = + chan_bw_interference_bitmap; + + wmi_ut.vdev_id = arvif->vdev_id; + wmi_ut.module_id =ATH12K_WMI_INCUMBENT_SIGNAL_UNIT_TEST_MODULE ; + wmi_ut.num_args =ATH12K_WMI_INCUMBENT_SIGNAL_MAX_TEST_ARGS ; + wmi_ut.diag_token =ATH12K_WMI_INCUMBENT_SIGNAL_UNIT_TEST_TOKEN ; + +ath12k_dbg (ar->ab,ATH12K_DBG_WMI , +"Triggering incumbent signal interference simulation, interference bitmap: 0x%x\n" , + chan_bw_interference_bitmap); + +return ath12k_wmi_send_unit_test_cmd (ar, &wmi_ut); +} +int ath12k_wmi_connect (struct ath12k_base *ab) {u32 i;
drivers/net/wireless/ath/ath12k/wmi.h +14 -0
@@ -2269,6 +2269,8 @@ enum wmi_tlv_service {WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT =281 , +WMI_TLV_SERVICE_DCS_INCUMBENT_SIGNAL_INTERFERENCE_SUPPORT =286 , +WMI_TLV_SERVICE_11BE =289 , WMI_TLV_SERVICE_WMSK_COMPACTION_RX_TLVS = 361,
@@ -4244,6 +4246,10 @@ struct wmi_addba_clear_resp_cmd {#define DFS_UNIT_TEST_MODULE 0x2b#define DFS_UNIT_TEST_TOKEN 0xAA +#define ATH12K_WMI_INCUMBENT_SIGNAL_UNIT_TEST_MODULE 0x18 +#define ATH12K_WMI_INCUMBENT_SIGNAL_UNIT_TEST_TOKEN 0 +#define ATH12K_WMI_UNIT_TEST_INCUMBENT_SIGNAL_INTF_TYPE 1 +enum dfs_test_args_idx {DFS_TEST_CMDID =0 ,DFS_TEST_PDEV_ID ,
@@ -4251,6 +4257,12 @@ enum dfs_test_args_idx { DFS_MAX_TEST_ARGS, }; +enum ath12k_wmi_incumbent_signal_test_args_idx { +ATH12K_WMI_INCUMBENT_SIGNAL_TEST_INTF , +ATH12K_WMI_INCUMBENT_SIGNAL_TEST_BITMAP , +ATH12K_WMI_INCUMBENT_SIGNAL_MAX_TEST_ARGS , +}; +/* update if another test command requires more */ #define WMI_UNIT_TEST_ARGS_MAX DFS_MAX_TEST_ARGS
@@ -6682,6 +6694,8 @@ int ath12k_wmi_send_vdev_set_tpc_power(struct ath12k *ar, struct ath12k_reg_tpc_power_info *param);int ath12k_wmi_send_mlo_link_set_active_cmd (struct ath12k_base *ab,struct wmi_mlo_link_set_active_arg *param); +int ath12k_wmi_simulate_incumbent_signal_interference (struct ath12k *ar, +u32 chan_bw_interference_bitmap);int ath12k_wmi_alloc (void );void ath12k_wmi_free (void );
Signature · 1 line
2.34.1
Quoted 27 lines · Amith A
This patch series adds the implementation of handling of interferences due to incumbent signals in 6 GHz channels. When an interference is detected, the firmware indicates it to the host using the
WMI_DCS_INTERFERENCE_EVENT.The driver is expected to parse the new WMI event to retrieve the interference information, validate the interference detected channel and bitmap, and indicate the interference to mac80211, which then notifies this interference to the userspace.
---
Changes in v2:
- Added an explicit len check in sub-TLV parser before accessing info.
---
Aishwarya R (2):
wifi: ath12k: Add support for handling incumbent signal interference
in 6 GHz
wifi: ath12k: Add debugfs support to simulate incumbent signal
interferencedrivers/net/wireless/ath/ath12k/core.h | 8 + drivers/net/wireless/ath/ath12k/debugfs.c | 46 +++ drivers/net/wireless/ath/ath12k/mac.c | 46 +++ drivers/net/wireless/ath/ath12k/wmi.c | 425 ++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 72 +++- 5 files changed, 596 insertions(+), 1 deletion(-)
Quoted 1 line
base-commit:
e12d2d3983acb150fd987d19ec6a2a530da110df
Quoted 27 lines · Amith A
This patch series adds the implementation of handling of interferences due to incumbent signals in 6 GHz channels. When an interference is detected, the firmware indicates it to the host using the
WMI_DCS_INTERFERENCE_EVENT.The driver is expected to parse the new WMI event to retrieve the interference information, validate the interference detected channel and bitmap, and indicate the interference to mac80211, which then notifies this interference to the userspace.
---
Changes in v2:
- Added an explicit len check in sub-TLV parser before accessing info.
---
Aishwarya R (2):
wifi: ath12k: Add support for handling incumbent signal interference
in 6 GHz
wifi: ath12k: Add debugfs support to simulate incumbent signal
interferencedrivers/net/wireless/ath/ath12k/core.h | 8 + drivers/net/wireless/ath/ath12k/debugfs.c | 46 +++ drivers/net/wireless/ath/ath12k/mac.c | 46 +++ drivers/net/wireless/ath/ath12k/wmi.c | 425 ++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 72 +++- 5 files changed, 596 insertions(+), 1 deletion(-)
Quoted 1 line
base-commit:
e12d2d3983acb150fd987d19ec6a2a530da110df
Quoted 2 lines
Signature · 1 line
2.34.1
Jeff Johnson
AppliedQuoted 11 lines · Amith A
This patch series adds the implementation of handling of interferences due to incumbent signals in 6 GHz channels. When an interference is detected, the firmware indicates it to the host using the
WMI_DCS_INTERFERENCE_EVENT.The driver is expected to parse the new WMI event to retrieve the interference information, validate the interference detected channel and bitmap, and indicate the interference to mac80211, which then notifies this interference to the userspace.
[...]
Applied, thanks!
[1/2] wifi: ath12k: Add support for handling incumbent signal interference in 6 GHz
commit: e7f9be2c7bfff07b5aba1e6eac3452cd729ad214
[2/2] wifi: ath12k: Add debugfs support to simulate incumbent signal interference
commit: afa1bd86eddd9f395bfa3d5cb3c7b5158e1383e0Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>