Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp543497pxb; Mon, 25 Oct 2021 13:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDwUZiZT8wyQGGNUWzXjk1ig5RHxkI5MgjUoPCz1KzYjXWxwKpEf7xFEEEe5hr9B4insyh X-Received: by 2002:a17:907:2d12:: with SMTP id gs18mr24333227ejc.353.1635193463044; Mon, 25 Oct 2021 13:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635193463; cv=none; d=google.com; s=arc-20160816; b=J1Uyo2IbL8qEM6Yl96Nbi3pF7X9IiIHQvwTAhx8E+d8hPnsuePLjCHcjJTurQNEstA zdIbC9TMdbKrd//2JdBZ8AnTypzuJLUS8+z/s7rCVUE7rNgsxByXu+Dns8kllw7X4oH2 tYvpgnGsKwMkY6NJFFrYxLAIORLWWlxb4faKuE1/6qbRm/Atft37b7m50Qd/kQvU9dRM 891FIUpoiFVVbvPJ+lMX6IP14G6A3EfQySMPLYEHVBXZOrqluUe/fm4LodUu8gPqbV0I F7vjhC1KLlWMtRkMch6i5ubz0ZDAcoLtMn+AW6Cbib2Dl1M/1ijwYzHbg+hkVmvZtYaG inPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=1F87+sikkubQJPygLdQF6HOpYZ2B2TtzpImTpNaIQ6Q=; b=y/GR0q3GYK3sqmzV1VmFlEg8BU/Aib5cmdAPygrQBgbJ1xsIUgk4veA6fX1ZadhiZ3 s5oNWfi0dXbJivA5H6q22Ki09AgUsesewgzt7tvinm5VKuGK5Q1c34SeJJtzmeSct/zR KveaR96CqYlGocyZYtjQucdTmJ/tZo66V/IUceZ09d0SeWj93ikuIepc+7nVbffCQhRM QRbZ3CajkBOUec3vXicu12DnKaHHZaCIu3EQc7bBm1hwHCVh9fweRzj4aBU8rOQuO0af lmoPbamcBjJ7g7BDdhkuMT+irPeW7qDuUNr3sFz1uBV7TfvvPWX2K+3n5cn/MO4Mjvqd LZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=cTiutT2H; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc2si30813465ejc.725.2021.10.25.13.24.07; Mon, 25 Oct 2021 13:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=cTiutT2H; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236656AbhJYUX7 (ORCPT + 67 others); Mon, 25 Oct 2021 16:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235133AbhJYUXy (ORCPT ); Mon, 25 Oct 2021 16:23:54 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CBDAC0EC84E for ; Mon, 25 Oct 2021 12:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: 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=1F87+sikkubQJPygLdQF6HOpYZ2B2TtzpImTpNaIQ6Q=; t=1635191972; x=1636401572; b=cTiutT2H4VjUq+lZy1eGWjj0NVLgSw5Tq5G3c9br5bvuCIe xrgCyGKGBrU/hPMilPxpYaMdtDisKBSag8lCU51CYbvKlL8KISLWi+2rRQqc2xgZNQYPjPRWcuUrb s+P25EQpG2kXEUMtaE6ZuPrOshV+gbDTfEdSak3gGJy6A/tpeu4BI86XuQbqBYwIzhfDMk/p/WwaK h2+gZYBiD18vfzXA/l4TlHrAx4lkeKV7UUxEXb/2Y4SPkHBvrTpPmesQ1rG6oLE/cOD3paMy68WF8 b7WYPOvkXy4acTFPr6bFraFPxjsSg5fL/7TJ1GD6tuf4hCRshWdU3LL92PC0b3uA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1mf681-006qIl-Ak; Mon, 25 Oct 2021 21:59:29 +0200 Message-ID: <9de7dbefe3cf0682fd28e5f4c42324e6a58ce508.camel@sipsolutions.net> Subject: Re: [PATCH v3 1/3] nl80211: Extended ROC support for 40-80 MHz bandwidth From: Johannes Berg To: P Praneesh , ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Sathishkumar Muruganandam Date: Mon, 25 Oct 2021 21:59:28 +0200 In-Reply-To: <1634906227-22028-2-git-send-email-ppranees@codeaurora.org> References: <1634906227-22028-1-git-send-email-ppranees@codeaurora.org> <1634906227-22028-2-git-send-email-ppranees@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2021-10-22 at 18:07 +0530, P Praneesh wrote: > > --- a/include/net/cfg80211.h > +++ b/include/net/cfg80211.h > @@ -4181,7 +4181,7 @@ struct cfg80211_ops { >   > > > >   int (*remain_on_channel)(struct wiphy *wiphy, >   struct wireless_dev *wdev, > - struct ieee80211_channel *chan, > + struct cfg80211_chan_def *chandef, >   unsigned int duration, >   u64 *cookie); I find it's odd you update this, but > >   if (!roc->mgmt_tx_cookie) >   cfg80211_remain_on_channel_expired(&roc->sdata->wdev, > - roc->cookie, roc->chan, > + roc->cookie, > + roc->chandef.chan, >   GFP_KERNEL); not the reporting API? Would seem better to pass back the whole thing? > @@ -211,6 +212,7 @@ static unsigned long ieee80211_end_finished_rocs(struct ieee80211_local *local, >   * ROC session before the actual requested time. In such a case >   * end the ROC session (disregarding the remaining time). >   */ > + >   if (roc->abort || roc->hw_begun || remaining <= 0) >   ieee80211_roc_notify_destroy(roc); spurious change? > @@ -311,7 +316,7 @@ static void _ieee80211_start_next_roc(struct ieee80211_local *local) >   list_for_each_entry(tmp, &local->roc_list, list) { >   if (tmp == roc) >   continue; > - if (tmp->sdata != roc->sdata || tmp->chan != roc->chan) > + if (tmp->sdata != roc->sdata || tmp->chandef.chan != roc->chandef.chan) >   break; This really doesn't work - you need to actually compare the chandefs for being identical or at least compatible when merging etc. happens here. At least if we want mac80211 to support this feature (more on that later) > @@ -331,7 +337,7 @@ static void _ieee80211_start_next_roc(struct ieee80211_local *local) >   */ >   list_for_each_entry(tmp, &local->roc_list, list) { >   if (tmp->sdata != roc->sdata || > - tmp->chan != roc->chan) > + tmp->chandef.chan != roc->chandef.chan) >   break; likewise > + roc->chandef.chan = chandef->chan; > + roc->chandef.width = chandef->width; > + roc->chandef.center_freq1 = chandef->center_freq1; > + roc->chandef.center_freq2 = chandef->center_freq2; That probably should use a struct assignment - there are some more struct members you're now not setting. > >   mutex_lock(&local->mtx); > - ret = ieee80211_start_roc_work(local, sdata, chan, > - duration, cookie, NULL, > - IEEE80211_ROC_TYPE_NORMAL); > + if (chandef) { > + ret = ieee80211_start_roc_work(local, sdata, chandef, > + duration, cookie, NULL, > + IEEE80211_ROC_TYPE_NORMAL); > + } No need for braces, but how would that actually be NULL?! > > + chandef.chan = params->chan; Uh, well, the other fields of a stack struct really want to be initialized too :) > @@ -1244,8 +1244,9 @@ TRACE_EVENT(drv_remain_on_channel, >   TP_fast_assign( >   LOCAL_ASSIGN; >   VIF_ASSIGN; > - __entry->center_freq = chan->center_freq; > - __entry->freq_offset = chan->freq_offset; > + CHANDEF_ASSIGN(chandef); > + __entry->center_freq = chandef->chan->center_freq; > + __entry->freq_offset = chandef->chan->freq_offset; Why would we need center_freq/freq_offset if we have a whole chandef? We're not usually taking much care with compatibility here with tracing. > --- a/net/wireless/nl80211.c > +++ b/net/wireless/nl80211.c > @@ -11282,7 +11282,7 @@ static int nl80211_remain_on_channel(struct > sk_buff *skb, > goto free_msg; > } > > - err = rdev_remain_on_channel(rdev, wdev, chandef.chan, > + err = rdev_remain_on_channel(rdev, wdev, &chandef, > duration, &cookie); > > if (err) > Really though, the biggest issue I see with this that you added no feature advertisement, no checks for the channel even being valid, nothing? Seems like we should have some kind of feature check, at least to reject 40/80/160/whatever bandwidths with all the existing drivers you only updated the API on, but didn't actually implement the new changes? I.e. this really needs to be opt-in somehow. And for mac80211 we need to implement some different merge logic, etc., it seems. johannes