Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2425944rdd; Fri, 12 Jan 2024 09:03:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuFKu5SIgojklzFy6EJ1J3EMk7M8q10qFe7EMHqGJzS/imdkC4hH4ioxra+GbRJogGZr9N X-Received: by 2002:a05:6512:3b9d:b0:50e:6d96:4b3c with SMTP id g29-20020a0565123b9d00b0050e6d964b3cmr952865lfv.81.1705078994838; Fri, 12 Jan 2024 09:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705078994; cv=none; d=google.com; s=arc-20160816; b=qGAlJwhugFUJyZB4xHJR1CsT/ApyC9EROPgazrJlMQA55+LxTC6GI9WmoWcLMwFmBS sUtlMpYgHi4dS0jWPpuYtZVRPnLy9RDPLMiofVRUAqHlw4whJpLAtbYvLkoavS7I/F1l tK4y+XdOxNL09gnZrgTCuvzXUTMwr7zIWBWyqlc4UO2OnrTUnLbhNvQ72VLTk/WB7e0s JPFcTau4XGt2QBSwfTFHl32qNskY11N8d7cfXhbq3MeNyJ1jT+9c2aYRdL1WLAvDA9oc UqP1I7qM9eKIRyCP1bbpgKQe1VBS3Fwxw4uhnlgnj01Ne8m8hDInGO9DvZNRUGFajvbl W4+w== 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=i76A4sLOKOSNPIcFjNajS2rtvzLP+pE0ISwWXQdn0No=; fh=a99peabwGfv5l9fkON9XHdVmErGM41iq5ivBcenxvHM=; b=huSYrQl04X0DcqILsk0H3ucCcKTPgCsVTDYayMCw8kugwzS9vSikXVnil/2mINY78w Wi1bh9sJOZDp7M1thOxVS70kQ+9gHrIhf3j9opsnYyC8rPFqR5clzPUh8vu4mxoEXrlK p3HSPW7t8dtauAgMhSIeULRToN7LKkK9xnr9bBTjLgTZRAXD35wyGHtCKJ+9B41Bf/X4 GRBQKOV5m/zdPKqsQa9owVUq1UWLdv9D98pbquYnF1sOwzS01OnBZ9mQV2FZO0vGgGcR l6kYTalB7Li3qgY80K8nyXsjnJH707CR5Zuo1JcYRxiLT9rPP/uQyEzt5H4QCPuGRVkM GKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nEanatMe; spf=pass (google.com: domain of linux-wireless+bounces-1825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1825-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n17-20020a05640205d100b00558a6025384si1341192edx.68.2024.01.12.09.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:03:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nEanatMe; spf=pass (google.com: domain of linux-wireless+bounces-1825-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1825-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 86CD21F243C9 for ; Fri, 12 Jan 2024 17:03:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43FE31B58E; Fri, 12 Jan 2024 17:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="nEanatMe" 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 EC9111B585 for ; Fri, 12 Jan 2024 17:03:07 +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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40CCWIE7032347; Fri, 12 Jan 2024 17:03:04 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=i76A4sLOKOSNPIcFjNajS2rtvzLP+pE0ISwWXQdn0No=; b=nE anatMeYY+cHbYUmikDtSJ1lkMCLy6vJAsgIm6fKs12R8zS1NteAzIbKyGhuvSGr7 jX5dG8mw2UD+QnAvKljAVsjhVw1PmqxPn5FPfNaMdQmEOYzpzfk1zF0gkCCQVDBP NG7PApA2bh6WnIjHBd0gx19mRO+da40jpvXPlr006ZweXeb/imZvjR5GOwoia029 qZRvCfShkk0mtSIBnpE6RgdKsFRf4vSNRFKHlQogLlZ8bWcKsjxcV6q/6UXDfJzJ gF4s0ivwUBea2WzZZzIDPQ2G1Cs+TEel9DsyPutXan0VdwWBIGHEZE82qmY3pizC 0C73KVBM4XjlI0nbFq7Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vjpuj2m8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 17:03:03 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40CH33m5011320 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Jan 2024 17:03:03 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:03:02 -0800 Message-ID: Date: Fri, 12 Jan 2024 09:03:01 -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 01/12] wifi: ath12k: add multiple radio support in a single MAC HW un/register Content-Language: en-US To: Sriram R , CC: , Karthikeyan Periyasamy References: <20240111045045.28377-1-quic_srirrama@quicinc.com> <20240111045045.28377-2-quic_srirrama@quicinc.com> From: Jeff Johnson In-Reply-To: <20240111045045.28377-2-quic_srirrama@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: p767pKjM_0X6gvvmBJwoMfpv3dKnGqUG X-Proofpoint-ORIG-GUID: p767pKjM_0X6gvvmBJwoMfpv3dKnGqUG 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 mlxscore=0 spamscore=0 mlxlogscore=807 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401120134 On 1/10/2024 8:50 PM, Sriram R wrote: ... > @@ -7553,10 +7553,12 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar, > > static u16 ath12k_mac_get_ifmodes(struct ath12k_hw *ah) > { > - struct ath12k *ar = ath12k_ah_to_ar(ah); > + struct ath12k *ar; > + int i; > u16 interface_modes = U16_MAX; > > - interface_modes &= ar->ab->hw_params->interface_modes; > + for_each_ar(i, ah, ar) > + interface_modes &= ar->ab->hw_params->interface_modes; This logic sets interface_modes to be the modes that are supported on every radio (starts with all modes supported and then masks off the ones that are not supported on a given radio). That means that if radio 0 supports a mode that radio 1 does not support, then we don't advertise support for that mode. Just want to verify that is the correct logic, and that instead we don't want to start with no modes supported and then OR in the ones that are supported so that we get the list of modes that are supported on ANY radio instead of ALL radios. > > return interface_modes == U16_MAX ? 0 : interface_modes; > } > @@ -7564,15 +7566,19 @@ static u16 ath12k_mac_get_ifmodes(struct ath12k_hw *ah) > static bool ath12k_mac_is_iface_mode_enable(struct ath12k_hw *ah, > enum nl80211_iftype type) > { > - struct ath12k *ar = ath12k_ah_to_ar(ah); > + struct ath12k *ar; > + int i; > u16 interface_modes, mode; > bool is_enable = true; > > mode = BIT(type); > - > - interface_modes = ar->ab->hw_params->interface_modes; > - if (!(interface_modes & mode)) > - is_enable = false; > + for_each_ar(i, ah, ar) { > + interface_modes = ar->ab->hw_params->interface_modes; > + if (!(interface_modes & mode)) { > + is_enable = false; note that in the example I mentioned above, this logic could say a given mode is enabled even though the bit isn't set in the interface_modes listed above > + break; > + } > + } > > return is_enable;