Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp239953rdb; Mon, 15 Jan 2024 20:46:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0fWbA6uj7iPM8GwSOHIMrpZBoM63aZmvcpJ0Yh7wxlGCsb8J/jposNhAUgyDbSL8PrM0W X-Received: by 2002:a05:620a:2404:b0:783:1697:7657 with SMTP id d4-20020a05620a240400b0078316977657mr5269089qkn.43.1705380375412; Mon, 15 Jan 2024 20:46:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705380375; cv=none; d=google.com; s=arc-20160816; b=Iami6TmrCFoYVuoRFiDd3rG6VXMsBYeza3fyeySy5Fo5N+pukb7GCd8T/WR6VYdlf2 ++q/vccxWFSsPIjkdTGc8iHCGynLCKPLWFKRqqaeftUJt4pOMO7gV+GUwVijorkwFUjx DUakjwIfybfK1BJVaphmOA9/tmrONvy2ObwPMia+7Xq3ShqTVT53DdQDs7G+/+PITRp3 +OWuK34jjoxfX9eqjmvQTl9ZL2T2KjYXdGre41NlG72/KwFCpjaTEwKIq7OIWbI0fGuj J2oJXluTlUgRiUIqFnpl+6vTfXGKW++jWXkz2E5ierB5VfJuFrtS1J3yeqJQuG0pW84G YBSw== 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=fwRt4ShUkKf5hBERPdC1lT0Bavy272wqYTsEgEKcGKU=; fh=14/Im+TAtlBZ08EFpSWg5aONZid79IjVba+5WlgfrxM=; b=bSPnNF3ciqx/POWxLT6F9rqpf9MZJRhq4gTPgZDZtQvamMFueU+KANxP37wnesHRry nV/dliYLgO/N10uS7u416u4go263YkBMT4R60Zr30dzOPKa8lko7Z8rddllS1BRW5fUP zkO78KOq7dUlo2UGKwCYoY3VpNzHxp/yUvzUffJpmA6GZBknZ8Fd/NnjBza3TBEEVxrY Nk00/0epljYKaYdpofmk3Tnr/MFTnNxNOQFjPUa9dcje8+2mQyZhqpn+/goWV4g52dHs R21cmoi9bPhzaDKOkoBgru75GAcOttpYPBog0QxBpvFnQ8I5vohhOe/OGasfIH2aCjfQ SYgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SCswTzkw; spf=pass (google.com: domain of linux-wireless+bounces-1957-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1957-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. [147.75.199.223]) by mx.google.com with ESMTPS id r1-20020a05620a298100b0078347fb1f27si8267702qkp.149.2024.01.15.20.46.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 20:46:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1957-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SCswTzkw; spf=pass (google.com: domain of linux-wireless+bounces-1957-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1957-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 1ADEF1C229B9 for ; Tue, 16 Jan 2024 04:46:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D09379C1; Tue, 16 Jan 2024 04:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="SCswTzkw" 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 3C6D8256A for ; Tue, 16 Jan 2024 04:46:08 +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 40G48CLI003035; Tue, 16 Jan 2024 04:46:00 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=fwRt4ShUkKf5hBERPdC1lT0Bavy272wqYTsEgEKcGKU=; b=SC swTzkwhBGBXpuqyMR6GfVuvSfTfUFhdmpCv6HQU5H92yAybC3ke1d4YyssAuTQXG 3pNd48jy3lj0NAwliY7tQD0rFBP83uEVMHD+fVZjgrxmQ81j6OwJuHoPOUAQXuKB qMsgwwk6Vgl8zaAlLzFwe6pSd9vBfY890tL1pxks4zg0jOaWW4rjgckS1qy1aO5l G11rTMcsZtRXimN7TbRibdf7FeuJ+JbO9eGh3QeXwL6DdC98zJ4C5KbMM9h3j67n EV3dOjfSOKrL1zr+bb0BnKDUFDim1o0WyOYmL7yBaNR54VkAiQG7HmX4W6FPb90t eTIU/s86RG0rNAKMMpUQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vn2bjhv6b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 04:45:59 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40G4jxUs029630 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 04:45:59 GMT Received: from [10.50.41.2] (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; Mon, 15 Jan 2024 20:45:57 -0800 Message-ID: Date: Tue, 16 Jan 2024 10:15:52 +0530 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 01/12] wifi: ath12k: add multiple radio support in a single MAC HW un/register Content-Language: en-US To: Jeff Johnson , Sriram R , CC: References: <20240111045045.28377-1-quic_srirrama@quicinc.com> <20240111045045.28377-2-quic_srirrama@quicinc.com> From: Karthikeyan Periyasamy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed 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: BcYh23J5ipajN6ibLlEM9IN6ev7gfJEN X-Proofpoint-ORIG-GUID: BcYh23J5ipajN6ibLlEM9IN6ev7gfJEN 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 clxscore=1015 priorityscore=1501 mlxscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=814 adultscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160034 On 1/12/2024 10:33 PM, Jeff Johnson wrote: > 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. Yes, interface_modes to be the modes that are supported on every radio not any radio. Any radio support can be add in the future ath12k driver once the hw specific interface mode support is added in mac80211/cfg80211. >> >> 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 The condition check "if (!(interface_modes & mode))" become true when the the bit isn't set in the interface_modes. So no issues. Thanks, Karthikeyan