From nobody Mon Feb 9 03:02:54 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8319027C161 for ; Fri, 11 Apr 2025 03:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744340708; cv=none; b=OKqHE3+xaxE7H/pi+S5wGb9bNDDSRl2FZPiEjk4XdEMZLvgIhco4VwJzYmUZz7tr3LCOaeNLbBnp10eiTurgNQGKl6S6v0Ud7v0w11MjfgYDcMI1fWO7ctJF2rZbv7WqHOUbBuyecdUs912AcbIjyGUJFErFKWzs0B1xYzJ4lns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744340708; c=relaxed/simple; bh=yqkUrrshGxQMM3xt8UAmdk7dsU+XQXBHuxWSKfezfa8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QUQHo03SwneV2lJ/tGY4E9vFL/2ZL9q4erWBfVyOpSOtwrdWb8KPQCp55yoWc0zqFzije6w2lpV0kaiQ4BKf6X5HhSRW0I34vNPTxXA8MJTYjWPIMvAx3JZv1YkiTmoYQv/gyJWopY1WKOWnxZECLon7lBaPifDL+DNAMBZuGCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=h1hfm8oW; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="h1hfm8oW" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53AFoURu019634 for ; Fri, 11 Apr 2025 03:05:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NeQx3uLyqs9WE6eGZ1STDiV37icOyW5A+kSz0CQyn1Q=; b=h1hfm8oW0bY8ZhOp Lzjq8PStgg9ygzN7KP43vPaSn0zlTsv6Ha+duW9QsKAbiJx1oHFTzFLLnCsFb00z jQvA1yAUj7xNmeiVSp1bkjg8F6egbLmqh5+sWIhewwSEm0Xui7lYhr14CvPZUu5Z FWu5B4eI4+JlvdmMW1m6IqW94mAuFOrwXK771rEGE2TZJiA8Yd8U6rcXEJZYxHCv a99JYey+YQZq5MgdFqEWkq3jpID/6c8zHC1nBR0r7C1kLPSD5RgFu+xLuozztneR MH1HAUn4V0Ro063lGCBz08MT79VXZhkPRnwZ0jjsy5gZg+Ne2VqSXa+61Ed7ADKa giFbtA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45twcrs4as-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 11 Apr 2025 03:05:04 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-af5b9f0e075so621435a12.3 for ; Thu, 10 Apr 2025 20:05:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744340703; x=1744945503; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NeQx3uLyqs9WE6eGZ1STDiV37icOyW5A+kSz0CQyn1Q=; b=Zoh4cQPZ7yD9RKtJ4/RvbkA0O5HNwihiOVHpqTOXNkTj9sj1+NfBL7YYnFot9h5gkK IA1/ZGjWmACON6b1VqxURtQ1FOYpcPsmjmhaM+xx9K3HT5bh0y4juQt56D2VNg4Z7bCW 8ItWlG5cx/alluGFsu4qxkiR0mtRD/ST+6qESGyEZnkDos5uqCGJdEMGIA6avSiM5a5d iihfzQJJSUBARGlF2R0Hy3cSbm+suTWK+XcJcfsuW59Lz8TRVdGcpK5GVvd6pfPFKO5k 7VL4T/Xa/rhw8ce0Wni5XowlqnSdIQqoFeC3caREj1QjoHe9k1VVAqE4B4euyVQnUBgJ e4pQ== X-Forwarded-Encrypted: i=1; AJvYcCXbymKhTURdXf6EGVbPP9YR6NcPDT4PEHiQsv+VeYKTVk965kmkOfUoMn+8TgHEWX7b06wpt5erncx2PJw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/CjdxcYACfyPUviErL6HvNLDOjpsPCKmMm7xkGevZDE153k+F 6e5pvlnQ9GUdCh+SdjmaJBvVNxxkDw6lbNtiNg8MRcrdkp7w60ly2K6Cen681Vv5MCmZEcKmlFV LcYBL6ZvuBgfZ9Ez5Ik67KfyKXTY+uyAUeC7mh80twPwYNSVaXJiLZaDaKjB1HfI= X-Gm-Gg: ASbGncva3LqWUIjcKigEsSRO/xBLu28MyJKpjrZ6Ac3N2xv9N1OXCKSwg3iaGW5vBYc ZMqmWzWKrCZ/vdDOXAutKkCzeithh0Kx5W1gf6LbUt8KO2Urqyl0r1p41cLStc/nUZxir06uSqH MEUXKJEox5C4wJZ1lPyH2r+zXsMy47VtPBkbOu4VOfFwjj0KCil8p1MaA1BPYLzSb/mEUoR1JE7 gdL8+Ge47NTH7O8aZxZtU4CTzqojjQ//d3VjfAGnZmm1KDN0D4I5N2VanRRZlh7k3HyrXQK4AAB iZo/Hx4yszeiSJlQRHYUHBYqhoijMP2YkFKdI14brMt7/ud43zTeQkuKg+RfjnbHl2nYwpa44xA corg6QJMXVPnktKL8jeUzu5rwrIhNF2aIaMpe X-Received: by 2002:a17:902:e886:b0:223:58ff:c722 with SMTP id d9443c01a7336-22bea4bd841mr18742325ad.28.1744340702876; Thu, 10 Apr 2025 20:05:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFi1w9hqm7k0eeSxhd4/OeOCeNVskfPOWILNkPCEyraSrbb2rPO6sHpmLchCsf4OlCODFPSOw== X-Received: by 2002:a17:902:e886:b0:223:58ff:c722 with SMTP id d9443c01a7336-22bea4bd841mr18741985ad.28.1744340702468; Thu, 10 Apr 2025 20:05:02 -0700 (PDT) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22ac7ccca88sm38425205ad.256.2025.04.10.20.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 20:05:02 -0700 (PDT) From: Aditya Kumar Singh Date: Fri, 11 Apr 2025 08:34:50 +0530 Subject: [PATCH ath-next 1/2] wifi: ath12k: handle scan link during vdev create Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250411-fix_scan_vdev_handling-v1-1-07d8b4a5d19d@oss.qualcomm.com> References: <20250411-fix_scan_vdev_handling-v1-0-07d8b4a5d19d@oss.qualcomm.com> In-Reply-To: <20250411-fix_scan_vdev_handling-v1-0-07d8b4a5d19d@oss.qualcomm.com> To: Jeff Johnson Cc: ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: aufmezAb8ZSKmoqJpPlLNFNBjOlTLgTF X-Authority-Analysis: v=2.4 cv=QuVe3Uyd c=1 sm=1 tr=0 ts=67f886e0 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=dhThNb0MqnHfOkfGsx8A:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-GUID: aufmezAb8ZSKmoqJpPlLNFNBjOlTLgTF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-11_01,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=992 bulkscore=0 priorityscore=1501 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504110021 For scanning purposes, the driver can use link ID 15 (scan link). A future change will make non-ML interfaces to select the scan link. In this scenario, arvif->link_id will be used to retrieve the link configuration in ath12k_mac_vdev_create(). However, link ID 15 is not recognized as a valid link ID in the upper kernel, which will result in a failure to fetch link_conf and subsequently cause the scan to fail. To avoid this issue, ensure link_conf is fetched only when the link ID is within the valid range. Since link_conf cannot be retrieved using the scan link, use vif->addr as the Ethernet address for creating the scan vdev. This address will serve as the source address (address 2) in the probe request frames during scanning. Additionally, use the automatic Tx power value for the vdev. As this is a scan vdev, these values do not affect the scan functionality. Note that vif->addr will only be taken when a valid link_conf can not be fetched. Otherwise, link_conf's address will be taken as address 2. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/ath/ath12k/mac.c | 33 ++++++++++++++++++-------------= -- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index 2b6bdc3d2b11a8a5f5733352826c724c671fd49a..4b3469380fb46a629fad7a9a40a= 44e761ef33fa5 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -8262,7 +8262,7 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct = ath12k_link_vif *arvif) struct ieee80211_vif *vif =3D ath12k_ahvif_to_vif(ahvif); struct ath12k_wmi_vdev_create_arg vdev_arg =3D {0}; struct ath12k_wmi_peer_create_arg peer_param =3D {0}; - struct ieee80211_bss_conf *link_conf; + struct ieee80211_bss_conf *link_conf =3D NULL; u32 param_id, param_value; u16 nss; int i; @@ -8277,22 +8277,21 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struc= t ath12k_link_vif *arvif) if (vif->type =3D=3D NL80211_IFTYPE_MONITOR && ar->monitor_vdev_created) return -EINVAL; =20 - /* If no link is active and scan vdev is requested - * use a default link conf for scan address purpose. - */ - if (arvif->link_id =3D=3D ATH12K_DEFAULT_SCAN_LINK && vif->valid_links) - link_id =3D ffs(vif->valid_links) - 1; - else - link_id =3D arvif->link_id; + link_id =3D arvif->link_id; =20 - link_conf =3D wiphy_dereference(hw->wiphy, vif->link_conf[link_id]); - if (!link_conf) { - ath12k_warn(ar->ab, "unable to access bss link conf in vdev create for v= if %pM link %u\n", - vif->addr, arvif->link_id); - return -ENOLINK; + if (link_id < IEEE80211_MLD_MAX_NUM_LINKS) { + link_conf =3D wiphy_dereference(hw->wiphy, vif->link_conf[link_id]); + if (!link_conf) { + ath12k_warn(ar->ab, "unable to access bss link conf in vdev create for = vif %pM link %u\n", + vif->addr, arvif->link_id); + return -ENOLINK; + } } =20 - memcpy(arvif->bssid, link_conf->addr, ETH_ALEN); + if (link_conf) + memcpy(arvif->bssid, link_conf->addr, ETH_ALEN); + else + memcpy(arvif->bssid, vif->addr, ETH_ALEN); =20 arvif->ar =3D ar; vdev_id =3D __ffs64(ab->free_vdev_map); @@ -8447,7 +8446,11 @@ int ath12k_mac_vdev_create(struct ath12k *ar, struct= ath12k_link_vif *arvif) break; } =20 - arvif->txpower =3D link_conf->txpower; + if (link_conf) + arvif->txpower =3D link_conf->txpower; + else + arvif->txpower =3D NL80211_TX_POWER_AUTOMATIC; + ret =3D ath12k_mac_txpower_recalc(ar); if (ret) goto err_peer_del; --=20 2.34.1 From nobody Mon Feb 9 03:02:54 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC3AD27C175 for ; Fri, 11 Apr 2025 03:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744340710; cv=none; b=c7zcu7sgf0arRDBISk8TnJ0Pe8ZNIlky2y4OHNpoHfrH/IuJsghcjQVYmX5OvLIRHtheBhNUXGUGT2znFrSZRXY0VQTleOMOeO8djo1s3KTk+7CSnAQDadxQV8+gP9BoJtlQccIi7rfBzS21CXXPlmQlCVw89aDchWo/gX+Vxag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744340710; c=relaxed/simple; bh=DuO9+hqiGBd+cfzlKQvTpPQkKVqn9qahoQ3y/HKEVlI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ejcv4bphw78HoTKCOBfSdo5nt6yaUZPrn1wungTDAtl7nSQewMZncxbDhNuABoGEnpERnH3B1jlhVnltmUFJdlxhVMzEy0Bl7l0/H78P8JiCYfu6K22Rt8cDWoWJAuOjtqcxCEjAj1T3rmOFEn21+BwvNcUnUjudpfZh1UxPN3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=oAM3cTkR; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="oAM3cTkR" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 53AG2G8r030686 for ; Fri, 11 Apr 2025 03:05:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JN+Uci4EgrW94KJgIsI5THib/jPzDg7I4/82AuQoOXs=; b=oAM3cTkRrt19YYyl NP2G3HTSNGV/lL176CuStsm1ODbepOTwfwKZuzpRZ7JmzJG+88AyzZdmtuxlhvrk gm2BLESyyoHXp3sq+fqj8MfEXerF7shFC/81hZyfOzL7ENLlZlP5ygPxanUcisa6 A6dV/+vEkyDeY0tMdVLFrlq9HFuyof8/vk30k4wIFIzvjkUYsPWSp9JCQw3v9PEB dWsjAVyy125NKFS/dKqDCdARz7yPoCx+fbS+KkPBov3V2dV3/stoUKX9XWQKZt4B z1+DSGtYfSCIG6h45jGrHVNF5Zn4q/Z3CBYjQU6Ns8537HQ5wB7YKINXjZ2P7wYH ytc+xg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45twftrrqd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 11 Apr 2025 03:05:05 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2ff52e1c56fso1811380a91.2 for ; Thu, 10 Apr 2025 20:05:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744340705; x=1744945505; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JN+Uci4EgrW94KJgIsI5THib/jPzDg7I4/82AuQoOXs=; b=QYyEmEEybmlpEVuveoOOZ308rm8tMD8I60sH9X1Tg8TrCzGRnCAyo69bRqLahJrZAT mr5xhk7aLshGrIDrBumldYRUYMxIwzS/Z+3Aioda8GdnBNZybAxbLiNA/X9MzieOj1T0 upUDYozzd2ywGZboGY25zeCUDP2WHqlylEr5ysrJgBJXbJqyx1zqV75Xd/3Y6m6x1KPK zDVkWnGrncuYM//VvBq16LaxwisuRLtFNCK+3DCJEqd1l3zACPegobjE9/jMrmzQ8v3f 9DQOuASh/eumQVO2kOGsbV7osc83P0Zs/uSBgzS8alpXYPXn97M4wC/xeNV1xcN6enp7 T2Wg== X-Forwarded-Encrypted: i=1; AJvYcCURylVOwDCwB4OiZ08+CgdwvtXHf9zIFtGCMP+ITYQYbv9bJk6G1D1ptliUwyf6nRXbpmMYq9uaniJUon8=@vger.kernel.org X-Gm-Message-State: AOJu0Yyj5bghGPV1pGhZiX+2w3+Wn4W58Hs9PaS6PC+9SwXUNBltQdNf 5hvkT8XaiqWIYxyxhR/Bx0YEjB18phl2MM9Id+hqNZSkDvisdCLDnqxAlOSIhS8imnaCNTdHk21 raLz7T2cPid5RKCmLZEjoi1Spg1K0ml2oYSdK1ZpBz2YBdi4fOu4aoGow41yWCARanqjJAy8= X-Gm-Gg: ASbGncvyuEDGbb5GBeUMGoSyfOfpZqcWQf8Z8sU3GsBNuQO51IsH9i7i/sgfr2x+EJT WyYrAi40Gwt31vHZjiZfWAQ91kRnLTnJGgcp/nkbm4oObQ8DULcmcSr2k9gI1woKPWKq9LrlDxn pI+sVHsvSvtWeG1CX+fjXGiLxwx5XfL+DB66h5w3icALcyd4NP3YjAtSBDBNNL7q0/KrVi/S5BE ekaZpKwe1I9B0moSHMIvsMkM54+ZhM/MqdPw4lZWjxX3kT3OfM09SPZ+brHjjwA1zryibjFV9Rq GpI9yxgff0hp6oeq65eIWDHbK7spGbMDozReyFlxIPRmnfw6xCCegkQwO/V9Plwm0o7OgZarNuR qsCWgtHq7b2X1LDNvdSm03Wdghrvfl0SxbL60 X-Received: by 2002:a17:90a:d44d:b0:2fe:a614:5cf7 with SMTP id 98e67ed59e1d1-308236244f3mr1884741a91.3.1744340704763; Thu, 10 Apr 2025 20:05:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFw3aUHRcQ8EhaIL95aG+J1wgT0E2sTrzFKeDpRppMCbJ0z8YGzrCZWpdAJnx18k6Dqno47tg== X-Received: by 2002:a17:90a:d44d:b0:2fe:a614:5cf7 with SMTP id 98e67ed59e1d1-308236244f3mr1884712a91.3.1744340704381; Thu, 10 Apr 2025 20:05:04 -0700 (PDT) Received: from hu-adisi-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22ac7ccca88sm38425205ad.256.2025.04.10.20.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Apr 2025 20:05:04 -0700 (PDT) From: Aditya Kumar Singh Date: Fri, 11 Apr 2025 08:34:51 +0530 Subject: [PATCH ath-next 2/2] wifi: ath12k: Use scan link ID 15 for all scan operations Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250411-fix_scan_vdev_handling-v1-2-07d8b4a5d19d@oss.qualcomm.com> References: <20250411-fix_scan_vdev_handling-v1-0-07d8b4a5d19d@oss.qualcomm.com> In-Reply-To: <20250411-fix_scan_vdev_handling-v1-0-07d8b4a5d19d@oss.qualcomm.com> To: Jeff Johnson Cc: ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Aditya Kumar Singh X-Mailer: b4 0.14.2 X-Authority-Analysis: v=2.4 cv=B5+50PtM c=1 sm=1 tr=0 ts=67f886e1 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=PUz9acJwvWvt2_6aZDkA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: ALQl3Xhu8V9P-a8a82Tql5rhCo-D35Yh X-Proofpoint-ORIG-GUID: ALQl3Xhu8V9P-a8a82Tql5rhCo-D35Yh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-11_01,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 priorityscore=1501 adultscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504110021 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 Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/ath/ath12k/mac.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index 4b3469380fb46a629fad7a9a40a44e761ef33fa5..7d96052bb0ccb1230ac446ffbfd= 20c5f6a463b5a 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -3463,23 +3463,15 @@ static struct ath12k_link_vif *ath12k_mac_assign_li= nk_vif(struct ath12k_hw *ah, if (arvif) return arvif; =20 - if (!vif->valid_links) { - /* Use deflink for Non-ML VIFs and mark the link id as 0 - */ - link_id =3D 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 !=3D ATH12K_DEFAULT_SCAN_LINK) { arvif =3D &ahvif->deflink; } 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 !=3D ATH12K_DEFAULT_SCAN_LINK) { - arvif =3D &ahvif->deflink; - } else { - arvif =3D (struct ath12k_link_vif *) - kzalloc(sizeof(struct ath12k_link_vif), GFP_KERNEL); - if (!arvif) - return NULL; - } + arvif =3D kzalloc(sizeof(*arvif), GFP_KERNEL); + if (!arvif) + return NULL; } =20 ath12k_mac_init_arvif(ahvif, arvif, link_id); --=20 2.34.1