]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Use scan link ID 15 for all scan operations
authorAditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Thu, 17 Apr 2025 05:49:14 +0000 (11:19 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Fri, 16 May 2025 17:34:15 +0000 (10:34 -0700)
According to the code documentation in ath12k_mac_op_hw_scan(), "if no
links of an ML VIF are already active on the radio corresponding to the
given scan frequency, the scan link (link ID 15) should be used". This rule
should apply to non-ML interfaces as well to maintain uniformity across the
driver. However, currently, link 0 is selected as the scan link during
non-ML operations.

Update the code to use scan link ID 15 in all cases.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250417-fix_scan_vdev_handling-v3-2-9ec42513d26b@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/mac.c

index de5fb7d9ed52827f924eec7bece91805c017bf86..64a748c873f3b71f55a47804bab75c5f3840256c 100644 (file)
@@ -3480,25 +3480,18 @@ static struct ath12k_link_vif *ath12k_mac_assign_link_vif(struct ath12k_hw *ah,
        if (arvif)
                return arvif;
 
-       if (!vif->valid_links) {
-               /* Use deflink for Non-ML VIFs and mark the link id as 0
-                */
-               link_id = 0;
+       /* If this is the first link arvif being created for an ML VIF
+        * use the preallocated deflink memory except for scan arvifs
+        */
+       if (!ahvif->links_map && link_id != ATH12K_DEFAULT_SCAN_LINK) {
                arvif = &ahvif->deflink;
+
+               if (vif->type == NL80211_IFTYPE_STATION)
+                       arvif->is_sta_assoc_link = true;
        } else {
-               /* If this is the first link arvif being created for an ML VIF
-                * use the preallocated deflink memory except for scan arvifs
-                */
-               if (!ahvif->links_map && link_id != ATH12K_DEFAULT_SCAN_LINK) {
-                       arvif = &ahvif->deflink;
-                       if (vif->type == NL80211_IFTYPE_STATION)
-                               arvif->is_sta_assoc_link = true;
-               } else {
-                       arvif = (struct ath12k_link_vif *)
-                       kzalloc(sizeof(struct ath12k_link_vif), GFP_KERNEL);
-                       if (!arvif)
-                               return NULL;
-               }
+               arvif = kzalloc(sizeof(*arvif), GFP_KERNEL);
+               if (!arvif)
+                       return NULL;
        }
 
        ath12k_mac_init_arvif(ahvif, arvif, link_id);