Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp232548ybh; Thu, 12 Mar 2020 00:45:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtvJZwAKJdBcVxlj4qPo/7ynRJcfg6hGY9oKC8+Ng/5CIImelUVsyx0V80Dlexl0pfp2PlW X-Received: by 2002:a05:6830:10da:: with SMTP id z26mr4991311oto.27.1583999127526; Thu, 12 Mar 2020 00:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583999127; cv=none; d=google.com; s=arc-20160816; b=VLRZZohVWf8sTVOCyThFhPN98Do+ygwgMPxL/l9fyIGiG06hAR7f0zsY0zS0RQj0Rq BO6ZTAS+2T2SubwFT9U9Uak+hxV8GjSrz3dO4CslYvhZuJefnX9CSgqr/fReyXpCfybi bnie1fE4ba8A1M/kGI6QQAWz1lo0ZTHaqRjlZFjg01Zzqn4kc7TL+EIrNdy1LYdSJvnc m2kco+UoZRcv8gLaCJi0Ut0FH0uE1I56lOifQplB4VLwMUfQuUF+LBJEqoc+squk4E16 UdIqlokU9aWvwDGLw0NsmYrLF/ce2DIsM/UtjqRJ6L+iOXsIvXBFpGB/Al/+19eaEXD+ hm4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:authenticated-by; bh=/wR7JsoS+8JnO4CIBIejt74Y1MGTtLMm4QF6wfiApCI=; b=fLURVHxh71dgpixts4ZN1brl9Kbz1gsGOwSTwTEsBiIggyiGUimYt/F2djdgvfIRfc Lv7o9A6K/D8Uwol1XYnpVRTsOU9gYoL3JqZbpi2K9v6XWBp4ir5+Dh2ksHSsWuYa03rP V6vinL3/NbbOSP5tsmYtEGan66cHddv6AktoTyRCv1vo0d/w3Xa/HgwMu6a5MoM+gBXm i/NNnecfq72jcub8r1qNQDWTjALLqFeIuYRE0cP2mzQDDXm0aKukTN3/Knh7/QAtTGrc IXUzx0v8Hx2hBvmaYqZ3zHjuLJx4xz+LM/5MXc3gY+ga+kMlt8hziV9zR16P/BiyO6y+ fchw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f187si2356528oia.218.2020.03.12.00.45.15; Thu, 12 Mar 2020 00:45:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388042AbgCLHoI (ORCPT + 99 others); Thu, 12 Mar 2020 03:44:08 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:57767 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387930AbgCLHoI (ORCPT ); Thu, 12 Mar 2020 03:44:08 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID 02C7hjZ0024403, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTEXMB06.realtek.com.tw[172.21.6.99]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id 02C7hjZ0024403 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Mar 2020 15:43:45 +0800 Received: from RTEXMB04.realtek.com.tw (172.21.6.97) by RTEXMB06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Thu, 12 Mar 2020 15:43:45 +0800 Received: from localhost.localdomain (172.21.68.128) by RTEXMB04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Thu, 12 Mar 2020 15:43:45 +0800 From: To: , CC: , , , Subject: [PATCH] mac80211: driver can remain on channel if not using chan_ctx Date: Thu, 12 Mar 2020 15:43:37 +0800 Message-ID: <20200312074337.16198-1-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.128] X-ClientProxiedBy: RTEXMB02.realtek.com.tw (172.21.6.95) To RTEXMB04.realtek.com.tw (172.21.6.97) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang Some of the drivers are not using channel context, but let the stack to control/switch channels instead. For such cases, driver can still remain on channel because the mac80211 stack actually supports it. The stack will check if the driver is using chan_ctx and has ops->remain_on_channel been hooked. Otherwise it will start its ROC work to remain on channel. So, even if the driver is not using chan_ctx, the driver is still capable of doing remain on channel. Signed-off-by: Yan-Hsuan Chuang --- net/mac80211/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 944e86da5c65..fcb0e6e6b4dd 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -576,7 +576,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, WIPHY_FLAG_REPORTS_OBSS | WIPHY_FLAG_OFFCHAN_TX; - if (ops->remain_on_channel) + if (!use_chanctx || ops->remain_on_channel) wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; wiphy->features |= NL80211_FEATURE_SK_TX_STATUS | -- 2.17.1