Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1357659pxm; Thu, 3 Mar 2022 16:07:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+G+CyDqTuI4AzR3+PT9fPN9NkuZ6s8HwZI5ZACVV1+sgBQlKKTvytZKSdj/I+2YNu+BJ9 X-Received: by 2002:aa7:94a4:0:b0:4f3:6215:5d1e with SMTP id a4-20020aa794a4000000b004f362155d1emr40911226pfl.73.1646352443827; Thu, 03 Mar 2022 16:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646352443; cv=none; d=google.com; s=arc-20160816; b=Zqba8uE2I0TOXtPm0cIPU+WLFbisX1ljXJumT5Nw4phUjbhWszd3NWQ5OXrNQS3QOO QH3+kyIK7zHIjSFov7yfwHP64ftnsotzxX52rx94LO7bD4NxH6ivafH6F2dHFX5SUoMX IgDeDANwI0i7GW4aV/9oa389hLRPS2bg88pMHsmSpSWS4hl3ZO/qzgcq2h3yGbjH16xr cOCaChZMOU8kcoQEGBOwwSN6Z9GrcgnDHsuYRpx3EgoYiItKit72uO8Sz1zfxZ6Flgue 4OIYUz9fL4kpaCOsiH9EGWxQ8swwGPx6ESnw+In/dJMiqxv4RgcqwMUWCt6BeaeRGRo7 Pc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=31OeFWWtEFWmCy18/jWijUcrkk1VNEZ9IXC4C5x+ha4=; b=YwR2hiRj4Msq65eKgSgN/1JNzpeblT2KmnT8XWuMEHAHiuH6cXu5B8Oyrsxd/cvaRv sZ1Ewpc2A6H3VjIC7knafmbwzF7m5uHxp6xK1vW7qDF/OILVW4bJK2uoHI67Ye0bfjaU EzM30quMzrgbVyIWhr/YeZCpSKPWHL1Z1Z+XwlDRDI6+g5MHM6PYR1eDbwT0X16q2bme 7U4urh0AgWN7uhwKn2foAZmX4XxyvvSXNkL5dlVZtCK9x3+1kCDvDZkGPUwct1Af1SuE PXhm318yT6ua52kxQjIUeK5eC13Bxe3i9rP5e/glOPKw0QAwRtmoTgz5QCx5lX7/Irje M5nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@w1.fi header.s=default header.b=wOGDUkwZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=w1.fi Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a170902700500b0015155a10ca8si3075286plk.148.2022.03.03.16.07.00; Thu, 03 Mar 2022 16:07:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@w1.fi header.s=default header.b=wOGDUkwZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=w1.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236903AbiCCWze (ORCPT + 72 others); Thu, 3 Mar 2022 17:55:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbiCCWzb (ORCPT ); Thu, 3 Mar 2022 17:55:31 -0500 Received: from mail.w1.fi (mail.w1.fi [212.71.239.96]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D5A2DF7 for ; Thu, 3 Mar 2022 14:54:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.w1.fi (Postfix) with ESMTP id B194710FB7; Thu, 3 Mar 2022 22:54:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at w1.fi Received: from mail.w1.fi ([127.0.0.1]) by localhost (mail.w1.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HbPdZCswDxCp; Thu, 3 Mar 2022 22:54:42 +0000 (UTC) Received: by jm (sSMTP sendmail emulation); Fri, 04 Mar 2022 00:54:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=w1.fi; s=default; t=1646348081; bh=3mVS+J+G6cZDzAsqcv2R5ouW8PV/U6R/T+sLY7znFUQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wOGDUkwZZLTFBn91A20ocZ9MIi034X1OARCyjB2CsjR8KaZw6nxw1RDwEbbkSR0SV EkZDH8DMPy3Hx4t7Z7UK2bwB8l/ApQ/ljhKKFi8w9uVIarRobCeLHAogAg/hLKZ0Oe u5it+QratGYS6GG72iGKKe1aZQjj/MIdm8zyV1E0LiTbEa8WvV5nttjzJrqwOMQFdD NOEVOoZ5gac6rOaJOvUni62KrOfzVcJqJYQt1GGwh9eJAZ/cUFGv/a2NVEEIBZSFtN 4wdl+RgQUYDp4QIr31VOERnw4N2Ti8JN+vWNVXKWo2xTfWRF+69qV04ooROmNPODEI Iikwuqjy6vVHA== Date: Fri, 4 Mar 2022 00:54:39 +0200 From: Jouni Malinen To: Lorenzo Bianconi Cc: hostap@lists.infradead.org, linux-wireless@vger.kernel.org, nbd@nbd.name, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, lorenzo.bianconi@redhat.com Subject: Re: [PATCH 6/9] DFS: introduce hostapd_dfs_request_channel_switch routine Message-ID: <20220303225439.GD33342@w1.fi> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Dec 20, 2021 at 04:48:21PM +0100, Lorenzo Bianconi wrote: > This is a preliminary patch to add Channel Switch Announcement for > background radar detection. > diff --git a/src/ap/dfs.c b/src/ap/dfs.c > @@ -940,6 +940,85 @@ int hostapd_is_dfs_chan_available(struct hostapd_iface *iface) > > +static int hostapd_dfs_request_channel_switch(struct hostapd_iface *iface, > + struct hostapd_hw_modes *cmode = iface->current_mode; > + int ieee80211_mode = IEEE80211_MODE_AP, err, i; That i needs to be unsigned int (like it was in the function from which it was moved to here) to avoid a compiler warning. > + u8 new_vht_oper_chwidth; > + new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); > + hostapd_set_oper_chwidth(iface->conf, > + hostapd_get_oper_chwidth(iface->conf)); This looks quite strange.. hostapd_dfs_start_channel_switch() used current_vht_oper_chwidth to store the current value from beginning of the function and restored it at this location. The new version in this helper function seems to something strange, or well, nothing. That does not feel correct. > static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) > { > - unsigned int i; That's where i was unsigned.. > - u8 current_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); And that's where the current value is picked at the beginning of hostapd_dfs_start_channel_switch(). > - new_vht_oper_chwidth = hostapd_get_oper_chwidth(iface->conf); > - hostapd_set_oper_chwidth(iface->conf, current_vht_oper_chwidth); And this looks quite different compared to what was in the new helper function. -- Jouni Malinen PGP id EFC895FA