]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: use arvif instead of link_conf in ath12k_mac_set_key()
authorAditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Tue, 4 Feb 2025 17:05:11 +0000 (22:35 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 11 Feb 2025 15:27:09 +0000 (07:27 -0800)
Currently, in ath12k_mac_set_key(), if sta is not present, the address is
retrieved from link_conf's bssid or addr member, depending on the interface
type.

When operating as an ML station and during shutdown, link_conf will not be
available. This can result in the following error:

ath12k_pci 0004:01:00.0: unable to access bss link conf in set key for vif AA:BB:CC:DD:EE:FF link 1

The primary purpose of accessing link_conf is to obtain the address for
finding the peer. However, since arvif is always valid in this call, it can
be used instead.

Add change to use arvif instead of link_conf.

A subsequent change will expose this issue but since tear down will give
error, this is included first.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1.97421.5 # Nicolas Escande

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Tested-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://patch.msgid.link/20250204-unlink_link_arvif_from_chanctx-v2-5-764fb5973c1a@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/mac.c

index b7f605eeb254f3587e0a21bb778ddedb872ab29d..97d7f95a3796de9157c434002061d026a439f1ee 100644 (file)
@@ -4668,9 +4668,6 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd,
                              struct ath12k_link_sta *arsta,
                              struct ieee80211_key_conf *key)
 {
-       struct ath12k_vif *ahvif = arvif->ahvif;
-       struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif);
-       struct ieee80211_bss_conf *link_conf;
        struct ieee80211_sta *sta = NULL;
        struct ath12k_base *ab = ar->ab;
        struct ath12k_peer *peer;
@@ -4687,19 +4684,10 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd,
        if (test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags))
                return 1;
 
-       link_conf = ath12k_mac_get_link_bss_conf(arvif);
-       if (!link_conf) {
-               ath12k_warn(ab, "unable to access bss link conf in set key for vif %pM link %u\n",
-                           vif->addr, arvif->link_id);
-               return -ENOLINK;
-       }
-
        if (sta)
                peer_addr = arsta->addr;
-       else if (ahvif->vdev_type == WMI_VDEV_TYPE_STA)
-               peer_addr = link_conf->bssid;
        else
-               peer_addr = link_conf->addr;
+               peer_addr = arvif->bssid;
 
        key->hw_key_idx = key->keyidx;