Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2942478pxk; Mon, 28 Sep 2020 04:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEN09FrcPDv7mYM7ko8f47QWteQ8wTh0NqQNCWwGEsYVZ/ZzmP7xt4XwRHQr56D2ToQ1uk X-Received: by 2002:a17:907:20d0:: with SMTP id qq16mr1099180ejb.65.1601292793023; Mon, 28 Sep 2020 04:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601292793; cv=none; d=google.com; s=arc-20160816; b=mx3MklbAifSbd475tp8NPxBBB3BfgzrSyA8rZeC2XMH1zv7k+ql5y52v51hPOxBfCc MWCEdiVD8p0hCfP9rARQ8V5p5BKeu7WPhCzcGud2KogjD+ESKcuITRQHWvtAlXHQv2gd XZhKSHrGP40F/C7rYZ/RrMAsGaJLXhHuHJOosfdnmUfSE1ndJERgzHgXZwBfToJ9+XsH pBQLWX2AUFWbIkXdsO9bUujjc74TJEzKamwrJanP5yITLO3l13at16ypwgcLSAyLmnw4 2CX7s0ObuJdyeSNac+f0xEqsimcCSIs67Fc5nKyXkJZit+/L0rtq5RRknD+bQ6skUxEQ iBgg== 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; bh=mDS4EPiYludx0wDgDHxzt7/dMwtoRX7h1St3/ZCk93s=; b=tML/4Cx+6mMgEGqqj4fQqzz7h5Zvq3qiCmjdQu6bFU6OcDYMg/YggP8flhqPTxhK7W wlPMRQ/m4SvltLhm/RvxOy9Y/h2z5Jk8u3MsVfJllBUAJFzLl5L8H98tB/nSA+uTPJB0 Biw+dbgGN2Txrh2SK7SG1vBzdMOmEmojmzVFgFm3KquBj5EuQqMu0vGaG7aEfPpc1jOA yYK6IFdPmd1lbII6v/EtwPPwudcuWpbn8RYukek9+92646cqu2Gsb37L19MOYN7yA9N4 TT7cARwx/rLJYLNOeEh3MjkZ3022vF0n9BBChfhtiEv5z+2F6X2M0WvDv/hId5erD8KK sfoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si391845edx.215.2020.09.28.04.32.46; Mon, 28 Sep 2020 04:33:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbgI1LbB (ORCPT + 99 others); Mon, 28 Sep 2020 07:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgI1LbB (ORCPT ); Mon, 28 Sep 2020 07:31:01 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA173C061755 for ; Mon, 28 Sep 2020 04:31:00 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kMrMx-00CS6v-7a; Mon, 28 Sep 2020 13:30:59 +0200 Message-ID: Subject: Re: [PATCH] nl80211: Trigger channel switch from driver From: Johannes Berg To: Shay Bar Cc: linux-wireless@vger.kernel.org, aviad.brikman@celeno.com, eliav.farber@celeno.com Date: Mon, 28 Sep 2020 13:30:58 +0200 In-Reply-To: <20200826131709.25530-1-shay.bar@celeno.com> References: <20200826131709.25530-1-shay.bar@celeno.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Aviad, Shay, > This patch add channel switch event from driver to hostap. > same as can be triggered from US via hostapd_cli chan_switch. (had to think about "US" here for a bit, "channel switch" totally sent my brain on the regulatory road ... heh) > using the already existing NL80211_CMD_CHANNEL_SWITCH. I'm a little confused as to how this would work - did the driver just *do* a channel switch? Or does it want to do a channel switch, and then hostapd has to deal with it? Is it able to? What happens if it doesn't do anything when this happens, e.g. an older version? > Signed-off-by: Aviad Brikman > Signed-off-by: Shay Bar > --- > include/net/cfg80211.h | 11 ++++++ > net/wireless/nl80211.c | 83 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h > index d9e6b9fbd95b..ae02d96eb8ec 100644 > --- a/include/net/cfg80211.h > +++ b/include/net/cfg80211.h > @@ -7416,6 +7416,17 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev, > struct cfg80211_chan_def *chandef, > u8 count); > > +/* > + * cfg80211_ch_switch - trigger channel switch from driver > + * same as is can be triggered from hostapd_cli chan_switch Not sure "same as ... hostapd_cli chan_switch" makes a lot of sense here in the kernel-doc, tbh. Also, you say "trigger" here, but ... > + * @dev: the device which switched channels "switched" here, which didn't help my above question at all. > + * @chandef: the new channel definition > + * @csa_count: the number of TBTTs until the channel switch happens though I guess this makes it a bit clearer, unless it can be zero? :) > + */ > +bool cfg80211_ch_switch(struct net_device *dev, > + struct cfg80211_chan_def *chandef, > + u8 csa_count); nit: indentation > + if (chandef->width == NL80211_CHAN_WIDTH_40) { > + enum nl80211_channel_type chan_type = NL80211_CHAN_HT40MINUS; > + > + if (chandef->center_freq1 > chandef->chan->center_freq) > + chan_type = NL80211_CHAN_HT40PLUS; > + > + if (nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, > + chan_type)) > + goto nla_put_failure; > + } This a bit ties in with the "compatibility" question above - does older hostapd even understand this? I'd suspect not, and then I'm not sure why you'd include these attributes? > The information transmitted is intended only for the person or entity > to which it is addressed and may contain confidential and/or > privileged material. Any retransmission, dissemination, copying or > other use of, or taking of any action in reliance upon this > information is prohibited. If you received this in error, please > contact the sender and delete the material from any computer. Nothing > contained herein shall be deemed as a representation, warranty or a > commitment by Celeno. No warranties are expressed or implied, > including, but not limited to, any implied warranties of non- > infringement, merchantability and fitness for a particular purpose. Hm. I guess I'm the "intended [...] person or entity" but I'm still a bit wary about applying patches with that, I guess. Thanks, johannes