Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp815617lqt; Thu, 6 Jun 2024 21:58:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9tC5fZkQRDs1KP+ywtxa5CZwVVdG5NkJQXM1xw3S2hPNWZGftIq1T74749TXE5E/fONke+kNbctYqOcrGzHdOpmKTFrj1ijh84cAaIw== X-Google-Smtp-Source: AGHT+IEQ5JIPE1tBL7DI+uW8kuibsZaxg+MXikumnsHEkPnb9SIW8VapF3xf8dXrkl6nApZTNWgR X-Received: by 2002:a05:6102:160a:b0:48a:5adf:f5ea with SMTP id ada2fe7eead31-48c275692b2mr1331497137.3.1717736323093; Thu, 06 Jun 2024 21:58:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717736323; cv=pass; d=google.com; s=arc-20160816; b=FuQY5NafGnpxh83KkVEg1sBMUEH1JEauqevUEkwxiHzjY8f1gehpiJjynzZ/ygD10j 0rXqUJ+4jZKD4gMqP1bY4Y9zBwgEsSt1Cve4uBGCTF20Mq4utaU/lDcf6HhAYVIqv+yw mpQwG250eknjyP01uqnmm7BpLCl75amdjBpYdC/IZIg2QWlTr14DcB1sNK7Iewntn0uK ADv9jH6Xm4/fsdVFyB/up08JlFCIU27Y98OD6/zzE2r3JZpmRHWepE/dgjjs/NkiV0hU rM5yeU2bF6r+fYsp6tDKoAQr5d778/Et6lSMn2OkJ94x81ZH+mctArT5a0w45Ofh9qrK s1wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=EccwJHAinwc9IMjUb7fiTtEJxEtENX38H43DKLAFQkc=; fh=FWLqcmcJXA/Yc+Oa6pEJCbMdlHxZCj5KpkEYmY/2e+M=; b=zC4kr6MQPuMCgSNn6Wg4vuxjsbiudMFiCUaoUodzjSz1DnvK/Q11jN3R5n/I0y0uzi SJ9Hglclgk4Hb0jRI2vOvcnnibR1PFlYIVWl5KGSstSPIu3CT+oFI/tnmmUrbFDG9e4Q G4pOa+3V64HaSuidF17oyXGYRGKlqwgA/VJqLYWD7iRbTUTraUZxxAD4FFTSPYIllz5n 3SPfu1X6uN9dtZbNr1nsK3Bx83Zf0Nb+DY/5+xAiFumzINxPNlH0xKDxdId3oKX4W8nF 20bXwkpOVJvgiK42bf98z1KgttO/LpuRqz6YURq6XoSLVHAg79P0DD21WRVd3exDCVmg 66wA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=EW2tfOqw; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795332ebd9esi287525485a.422.2024.06.06.21.58.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 21:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8658-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=fail header.i=@nbd.name header.s=20160729 header.b=EW2tfOqw; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-wireless+bounces-8658-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8658-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name 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 A64521C22681 for ; Fri, 7 Jun 2024 04:58:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 959F11B59A; Fri, 7 Jun 2024 04:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="EW2tfOqw" X-Original-To: linux-wireless@vger.kernel.org Received: from nbd.name (nbd.name [46.4.11.11]) (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 76E8338F96 for ; Fri, 7 Jun 2024 04:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717735780; cv=none; b=aQo4vNFe8cft38dGD3EjN9spMc1uF/95IyE3TmDdJLjXDwA+3AaNQB14LCZUNRIk8OAQ5a0lM9IfkNz3wHnWvTCYdD52ktSqUe/3XBbfY0zbpb1SM3S6+snBOKdX9IIhAdTb7M59EMjREg6MhMWW2885PNb/CFD53ENJ3YX5UEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717735780; c=relaxed/simple; bh=sXmpSin4xcz5U9ACd2ZqKeulnpSQC1g4svY7/I36A08=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cUJJaSQWgeUqqbBGACrJYe3mq7t3ARGJNMwKH3NXhZh3xh3AsrCpzSEIIRzKKrlyvIC4byysnI4zTSJkbQR+b/4nFvtZmu7kQTfvY5yOKR4FQNhuCiAJ3ma/jFG3+NsEpH8IXBgozHcdhTpjc84gWgE3HwzwHKireBOi5U+M2Bs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=EW2tfOqw; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EccwJHAinwc9IMjUb7fiTtEJxEtENX38H43DKLAFQkc=; b=EW2tfOqwV8QCWppc2SazdrLbZN qNMvidONddX4wfTovCMsysKsQUMNX7pxxn96y9EFa+wwn1TY4N4sWI7rdVVrgO2YetSm6m+jOfP+8 AfO/zOp6PfE5Umou5xEkgP07SAatMlw4v4a1F0GyLPZ0Jp2z1KBOvmO97Uy6whhDpBEA=; Received: from p4ff13226.dip0.t-ipconnect.de ([79.241.50.38] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1sFRXj-008n8Q-2E; Fri, 07 Jun 2024 06:49:35 +0200 Message-ID: <900697d8-9db7-49a5-9949-1e256e96b0c2@nbd.name> Date: Fri, 7 Jun 2024 06:49:35 +0200 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: [RFC v3 6/8] wifi: mac80211: extend ifcomb check functions for multi-radio To: Karthikeyan Periyasamy , linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, quic_adisi@quicinc.com, ath12k@lists.infradead.org References: Content-Language: en-US From: Felix Fietkau Autocrypt: addr=nbd@nbd.name; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pEDKq57OhxJVv1Q8XkA9Dn1SBOjNB l25vJDFAT9ntp9THeDD2fv15yk4EKpWhu4H00/YX8KkhFsrtUs69+vZQwc0cRmVsaXggRmll dGthdSA8bmJkQG5iZC5uYW1lPsJgBBMRAgAgBQJGoeQnAhsjBgsJCAcDAgQVAggDBBYCAwEC HgECF4AACgkQ130UHQKnbvXsvgCgjsAIIOsY7xZ8VcSm7NABpi91yTMAniMMmH7FRenEAYMa VrwYTIThkTlQzsFNBEah5FQQCACMIep/hTzgPZ9HbCTKm9xN4bZX0JjrqjFem1Nxf3MBM5vN CYGBn8F4sGIzPmLhl4xFeq3k5irVg/YvxSDbQN6NJv8o+tP6zsMeWX2JjtV0P4aDIN1pK2/w VxcicArw0VYdv2ZCarccFBgH2a6GjswqlCqVM3gNIMI8ikzenKcso8YErGGiKYeMEZLwHaxE Y7mTPuOTrWL8uWWRL5mVjhZEVvDez6em/OYvzBwbkhImrryF29e3Po2cfY2n7EKjjr3/141K DHBBdgXlPNfDwROnA5ugjjEBjwkwBQqPpDA7AYPvpHh5vLbZnVGu5CwG7NAsrb2isRmjYoqk wu++3117AAMFB/9S0Sj7qFFQcD4laADVsabTpNNpaV4wAgVTRHKV/kC9luItzwDnUcsZUPdQ f3MueRJ3jIHU0UmRBG3uQftqbZJj3ikhnfvyLmkCNe+/hXhPu9sGvXyi2D4vszICvc1KL4RD aLSrOsROx22eZ26KqcW4ny7+va2FnvjsZgI8h4sDmaLzKczVRIiLITiMpLFEU/VoSv0m1F4B FtRgoiyjFzigWG0MsTdAN6FJzGh4mWWGIlE7o5JraNhnTd+yTUIPtw3ym6l8P+gbvfoZida0 TspgwBWLnXQvP5EDvlZnNaKa/3oBes6z0QdaSOwZCRA3QSLHBwtgUsrT6RxRSweLrcabwkkE GBECAAkFAkah5FQCGwwACgkQ130UHQKnbvW2GgCeMncXpbbWNT2AtoAYICrKyX5R3iMAoMhw cL98efvrjdstUfTCP2pfetyN In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07.06.24 06:45, Karthikeyan Periyasamy wrote: > > > On 6/6/2024 11:37 PM, Felix Fietkau wrote: >> Add support for counting global and per-radio max/current number of >> channels, as well as checking radio-specific interface combinations. >> >> Signed-off-by: Felix Fietkau >> --- >> net/mac80211/cfg.c | 7 +- >> net/mac80211/chan.c | 17 +++-- >> net/mac80211/ibss.c | 2 +- >> net/mac80211/ieee80211_i.h | 6 +- >> net/mac80211/iface.c | 2 +- >> net/mac80211/util.c | 131 +++++++++++++++++++++++++++----------- >> 6 files changed, 116 insertions(+), 49 deletions(-) >> > > ... > >> >> +static u32 >> +__ieee80211_get_radio_mask(struct ieee80211_sub_if_data *sdata) >> +{ >> + struct ieee80211_local *local = sdata->local; >> + struct ieee80211_chanctx_conf *conf; >> + struct ieee80211_link_data *link; >> + u32 mask = 0; >> + >> + for_each_sdata_link(local, link) { >> + conf = rcu_dereference(link->conf->chanctx_conf); >> + if (!conf || conf->radio_idx < 0) >> + continue; >> + >> + mask |= BIT(conf->radio_idx); >> + } >> + >> + return mask; >> +} >> + > > I believe __ieee80211_get_radio_mask(sdata) should return the radio mask > used by this sdata right ? > > if so, then you should not use "for_each_sdata_link(local, link)" > because it iterate for all the sdata in the given local and give the > radio mask. So always return all the radio (bitmap mask) used by the > wiphy currently. > > You can use either of below one > > for_each_vif_active_link() > > or > > for (link_id = 0; link_id < ARRAY_SIZE(sdata->link); link_id++) Right, I copied the wrong code :) Will fix, thanks. - Felix