Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2440755rdd; Fri, 12 Jan 2024 09:24:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqHSXg846rEVerB90FwipQLzyrqUK/oY3+Voshv3v+azwQvBYWyoKYmrb2YOUfa1ZCWKFZ X-Received: by 2002:ac8:5cce:0:b0:429:9a61:9b59 with SMTP id s14-20020ac85cce000000b004299a619b59mr1768515qta.29.1705080251640; Fri, 12 Jan 2024 09:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705080251; cv=none; d=google.com; s=arc-20160816; b=xcZhjQumrhbR/oQ2U2ubd3ITLpuas+a6Pqz/yjJplSRvdSHNmNCJhXlfk2HBxZsGAg g7qMBEaWv2F6cP2YSSbQyXrhvJKv06zZrxlThCqTiwh3FuhKsr3P5R+7ArXzLH5HrenY 3ZL/vA8PAsM26Z06/9MfSpdc10lC+THmHp7ugwhRxQI2snhPDVjjkdkSXHIE4P61R0Id ZqmsOCzlphi1X/AX6A4X2x/XmhrpLlJR2zKDv5/sZ7sWIGOHandsIXvwMYC3cQZ+DsZc nNLcWQLvB+7Yj5DyQIPswTA1WucyuxHzYmhFLE0dyGWWkECyAnvGA1OxtKDppvQDg5Me t0rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9wAIbQZ/OE9RX7AchYjlMnl8kxaKodRBO+ZNSGanaqA=; fh=GCRpT/7dbLSsQAWbCa8UoWpPButACfBkfM7tAyJ3xhE=; b=UBCSYj+cSTqcpmxvor1kke6hw8F5SRFV6f1bLcSp/S4WDwyhslNezrywKijjcPTjjJ 0prinjuP2HS2RHo4msZpHpWYYRKEI5Vo0KCxVwrGwGHcVQr5EIKq9GaBUh3mMlHcBaQv S5G0UEg6mKhi0dj492UE/DN5+ujlt9L13ye6h1GwEKqRRdwzcmpEOJhe0NJMq79ul6OI YESZurNjg7aaPjlmHv7ZxP93bCBO28t7+q8wj0CnGZzYyNiaxgr/uwaDhTIwHSwUXxv2 lTXCG6wtDhNGaipIemDBg5K8PXTijMcim5SwFPCLF6tU7qEG2ssOIhxe6habow1Of47m a3qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Zj3riIqV; spf=pass (google.com: domain of linux-wireless+bounces-1835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fk18-20020a05622a559200b004283ab4f730si3447824qtb.798.2024.01.12.09.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Zj3riIqV; spf=pass (google.com: domain of linux-wireless+bounces-1835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 597BC1C2221C for ; Fri, 12 Jan 2024 17:24:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECE322261E; Fri, 12 Jan 2024 17:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Zj3riIqV" X-Original-To: linux-wireless@vger.kernel.org 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 86BA422620 for ; Fri, 12 Jan 2024 17:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40CFRUrw002077; Fri, 12 Jan 2024 17:24:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=9wAIbQZ/OE9RX7AchYjlMnl8kxaKodRBO+ZNSGanaqA=; b=Zj 3riIqV0WAkyRO4XFwe6fW5kdOlG4C2xZgoCMA7y4rPQmE8QxJK/tHynkeBoPRe9/ /2BRa3D+gWCBdTlApKZWP+8n/eYkrwBFiF+/D/AcdFoy6fugCSCNjU6G0MxdJ+KV Ms1pD8jsrtu7T6v6KerRM/z0Adsflff6aFPoZ4lvFpEOEQs3AkH75bE9rC0O4v4s 8gjvp+B5krPmfxLZoYLReaFxp8yEAitgrO+XfEnoCrrUvOzNS2oFMMIRQcwzkSuL U7bo+sIAVIwhA9T/6aAn+08y2KeoPV6euec1v/HGnrN07F60U2OwFC6awfoYWQ8K E0WQGuPXXi/5Sg9yN27Q== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vk18d1crv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 17:24:01 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40CHO0GA008909 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 17:24:01 GMT Received: from [10.110.16.29] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 12 Jan 2024 09:24:00 -0800 Message-ID: Date: Fri, 12 Jan 2024 09:23:59 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/12] wifi: ath12k: Cache vdev configs before vdev create Content-Language: en-US To: Sriram R , CC: References: <20240111045045.28377-1-quic_srirrama@quicinc.com> <20240111045045.28377-8-quic_srirrama@quicinc.com> From: Jeff Johnson In-Reply-To: <20240111045045.28377-8-quic_srirrama@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: y1ESbIqP0ukk0ytPZw8tYbPG_N7LJhBY X-Proofpoint-ORIG-GUID: y1ESbIqP0ukk0ytPZw8tYbPG_N7LJhBY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxlogscore=701 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401120137 On 1/10/2024 8:50 PM, Sriram R wrote: > Since the vdev create for a corresponding vif is deferred > until a channel is assigned, cache the information which > are received through mac80211 ops between add_interface() > and assign_vif_chanctx() and set them once the vdev is > created on one of the ath12k radios as the channel gets > assigned via assign_vif_chanctx(). > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 > > Signed-off-by: Sriram R > --- ... > +static int ath12k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, > + struct ieee80211_vif *vif, struct ieee80211_sta *sta, > + struct ieee80211_key_conf *key) > +{ > + struct ath12k_hw *ah = ath12k_hw_to_ah(hw); > + struct ath12k *ar; > + struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); > + int ret; > + > + /* BIP needs to be done in software */ > + if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || > + key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || > + key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || > + key->cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) > + return 1; I know this in the existing code, but what is the significance of returning 1? Should this be returning a -errno like the error cases that follow? > + > + if (key->keyidx > WMI_MAX_KEY_INDEX) > + return -ENOSPC; > + > + mutex_lock(&ah->conf_mutex); > + > + ar = ath12k_get_ar_by_vif(hw, vif); > + if (!ar) { > + /* ar is expected to be valid when sta ptr is available */ > + if (sta) { > + mutex_unlock(&ah->conf_mutex); > + WARN_ON_ONCE(1); > + return -EINVAL; > + } > + arvif->cache.key_conf.cmd = cmd; > + arvif->cache.key_conf.key = key; > + arvif->cache.key_conf.changed = true; > + mutex_unlock(&ah->conf_mutex); > + return 0; > + } > + > + mutex_lock(&ar->conf_mutex); > + ret = ath12k_mac_set_key(ar, cmd, vif, sta, key); > mutex_unlock(&ar->conf_mutex); > + > mutex_unlock(&ah->conf_mutex); > return ret; > }