Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp425465lqh; Thu, 28 Mar 2024 06:23:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvgPTal9fsrmwv+lJhsKHZ4llkE8Vxj4BNol8HCVg7D7c5KUBh9YvDigKTCyd0QfsVIJAb0mIExTdAxzQZLRGzbsoK6wc8Bu4WUsVdWg== X-Google-Smtp-Source: AGHT+IFhD642r8e01f0sJfhmq3yfnpc5XT8Wd01jkdx35QluTh3Y5U+rU9xOiYFK+KQhzxq4pEbm X-Received: by 2002:a17:902:d511:b0:1dd:8ed:997d with SMTP id b17-20020a170902d51100b001dd08ed997dmr3263635plg.3.1711632199286; Thu, 28 Mar 2024 06:23:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711632199; cv=pass; d=google.com; s=arc-20160816; b=N+96U3qiysqJcnl/Z7d/ptfaCX5GV89yKMYKiFtIbHY5H2qH6X3JDjpJ+GvlGDFXCh 3d664h/kOYTiwG6rORSug0ai0BbgDPxre6IDN3ge6SjwvF7alE/DmgaClnpUoTad9sfZ czZVMDW4+465mK7nTuqzu2hhhFKSlz+vkOuEmrxS2w4tEjdjWcLa2UZZpdiOEesrVcF/ b3tX5BqagKTZDdSuuvyj+Sh9xC7cTwchct13CDJHZIitgr+wcU2ho/PjbtM0FW70AYUk XmevBHXTh+mXgVKGkaWpJEe42salyasi2PUoaa/WXXiW0DmjySKgSmXGBcDBK88AvfJI PjLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=hBJJ0NlroRwEUwROKMDVanfjub6GNe9fdXa0RuT5jrE=; fh=AN3TPovGZlXbVOAi9DnJbFLhX12tsufHwxfR0pDbwBE=; b=bxQcM0R1qPde/SwuDG6kiwc/i4UKLYsy5Owy9p/T5HeK5jYti4lfmRH31GXMhsrW5d 968O1ZoobL1yefyb9k479m2Q+Lm7mIp5Jj3TJ4do/SVrRvJE8p0b+4ho94NCB/tG/uyS BHshhfMKdI6x2bLpgW1xrxH3iEJHe5I3nTLCjj8cfpjlfV50Kg2uQr8KyVBbqeQWhFn+ o8wEHWLgRwM6gC0Lh8HTJ8bbnwsqpnlkLzkW5xk/y1fzUVkdYW1ZQmiRCavNbzfJhi/h twb85GyxBkFMI/3+FbJBE5q1Le7K3toSpDKmdcMXMq+m0MFJUebeygYNUaBakURAu/y1 tmFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=jMefUahZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l3-20020a170903244300b001e2036dc675si1457568pls.561.2024.03.28.06.23.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 06:23:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=jMefUahZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C20DCB2287A for ; Thu, 28 Mar 2024 13:23:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1463C7EEF0; Thu, 28 Mar 2024 13:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="jMefUahZ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 A4D1864CE1 for ; Thu, 28 Mar 2024 13:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711632170; cv=none; b=ZN7LGgZrJYA3c557t1k0ifngs7SYIeoQ3NkZwdrmxl0DF2z8osdjQsMFJRVOxF/NJtnaCFLBBhuEt09Ger2H9g2TxA77DLAjWQXp9I439l0OcK8d+DkFJgLxRPnWEXkRbA0XTvS0eMjL+Sn0Tgv65w4FKVBwtCoNwTbzP0Qv9BU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711632170; c=relaxed/simple; bh=QBQiopUtOeTguZk9p12E2FJ8Vm/HB1rh0lsntrw8x6M=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=h8C3v3BfFHI5xWeaWNG8g8cBeKueqi8Xv9wzkczlXF6NsijVqOElP1LcXvz9dVmAQ07xbDw20f1SKvuXrkA/r2fKpdN0pvS6ZriAf2F+9gNcPzSVlk6rMhKVzJjeCIya5TYmT5Tca8l6AlGQH/OZAhySuhqcaD/qdEq27DgP3Po= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=jMefUahZ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=hBJJ0NlroRwEUwROKMDVanfjub6GNe9fdXa0RuT5jrE=; t=1711632167; x=1712841767; b=jMefUahZs8Q1ptFscYG5ZW2EL3sGlN4zAz44aA9W3uXBjU9 mMWSjpYnJhmbNZLg02UsY6+wTXdk6hbQj6hugbEhqIl2IMEFn3RcINuJa9smftMulxjPFC3FpqFqn adasjAsRf8UQ9zZE1mAKVm8oHH5WC+ITbgRrEo5BH2yXAs0JK7pkTtxzv3E6Ge6zAAALafpAnqMYJ L+gVhE7OLyesiPSJO3wla/f1VVxDgBVLIXk+XqGibhBPQHFtqn1wPFY+ahuIMz7cTRgPuGznJmXbl VvbCfCHI/qZZ3f3LrFVHuayfLF3bvv36MJj/23YnUDGx4zw0GQwhBgjQiQFS3wBA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rppiO-00000000zsp-22tR; Thu, 28 Mar 2024 14:22:44 +0100 Message-ID: <8e1d403251a8c8e5c9fe34d9dea51b8ea60b6b6b.camel@sipsolutions.net> Subject: Re: [PATCH 04/13] wifi: cfg80211/mac80211: extend iface comb advertisement for multi-hardware dev From: Johannes Berg To: Karthikeyan Periyasamy , ath12k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Vasanthakumar Thiagarajan Date: Thu, 28 Mar 2024 14:22:43 +0100 In-Reply-To: <20240328072916.1164195-5-quic_periyasa@quicinc.com> References: <20240328072916.1164195-1-quic_periyasa@quicinc.com> <20240328072916.1164195-5-quic_periyasa@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned Not sure why this is a combined cfg/mac patch, there doesn't seem to be all that much need for that? I'd probably rather see this and patch 6 squashed, but cfg/mac kept separate. On Thu, 2024-03-28 at 12:59 +0530, Karthikeyan Periyasamy wrote: >=20 > +static int > +ieee80211_check_per_hw_iface_comb(struct ieee80211_local *local, > + const struct ieee80211_iface_combination *c) > +{ > + int hw_idx, lmt_idx; > + u32 hw_idx_bm =3D 0; lmt_idx? (also that's only needed in the loop) bm? > + if (!local->hw.wiphy->num_hw) > + return -EINVAL; > + > + if (local->emulate_chanctx) > + return -EINVAL; > + > + for (hw_idx =3D 0; hw_idx < c->n_hw_list; hw_idx++) { > + const struct ieee80211_iface_per_hw *hl; hl? Could have a bit more evocative names :) I'd rather see 'i' for some iteration thingie than "lmt_idx" which means nothing on first reading either, but you start thinking it should mean something ... > +static bool > +cfg80211_hw_chans_includes_dfs(const struct ieee80211_chans_per_hw *chan= s) > +{ > + int i; > + > + for (i =3D 0; i < chans->n_chans; i++) { > + if (chans->chans[i].band =3D=3D NL80211_BAND_5GHZ && > + ((chans->chans[i].center_freq >=3D 5250 && > + chans->chans[i].center_freq <=3D 5340) || > + (chans->chans[i].center_freq >=3D 5480 && > + chans->chans[i].center_freq <=3D 5720))) ??? That's not how this works upstream. > + if (WARN_ON(hl->max_interfaces < 2 && > + (!comb->radar_detect_widths || > + !(cfg80211_hw_chans_includes_dfs(chans))))) No need for extra parentheses. > @@ -701,6 +786,13 @@ static int wiphy_verify_combinations(struct wiphy *w= iphy) > /* You can't even choose that many! */ > if (WARN_ON(cnt < c->max_interfaces)) > return -EINVAL; > + > + /* Do similar validations on the freq range specific interface > + * combinations when advertised. > + */ > + if (WARN_ON(c->n_hw_list && > + wiphy_verify_comb_per_hw(wiphy, c))) Don't need the n_hw_list check here, the function just does nothing if it's 0 anyway. johannes