From patchwork Mon Nov 7 14:59:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Berg X-Patchwork-Id: 9415355 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6296060585 for ; Mon, 7 Nov 2016 15:00:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55F4928C4A for ; Mon, 7 Nov 2016 15:00:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49DF628C4F; Mon, 7 Nov 2016 15:00:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE17528C4A for ; Mon, 7 Nov 2016 15:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932323AbcKGPAB (ORCPT ); Mon, 7 Nov 2016 10:00:01 -0500 Received: from s3.sipsolutions.net ([5.9.151.49]:36824 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbcKGO75 (ORCPT ); Mon, 7 Nov 2016 09:59:57 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1c3lOt-00031L-R9; Mon, 07 Nov 2016 15:59:56 +0100 From: Benjamin Berg To: Johannes Berg Cc: linux-wireless@vger.kernel.org, sw@simonwunderlich.de, Benjamin Berg Subject: [PATCH 7/8] Add flag for DFS handling in IBSS Date: Mon, 7 Nov 2016 15:59:42 +0100 Message-Id: <20161107145943.16761-8-benjamin@sipsolutions.net> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161107145943.16761-1-benjamin@sipsolutions.net> References: <20161107145943.16761-1-benjamin@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Simon Wunderlich When Userspace is capable of handling DFS, it can inform the kernel about that by sending the NL80211_ATTR_HANDLE_DFS attribute when joining an IBSS. DFS channels will then be unlocked. Note that this flag is only added for debugging purposes and therefore hidden from the user by prefixing with __ and not documenting it. Signed-off-by: Simon Wunderlich Signed-off-by: Benjamin Berg --- ibss.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ibss.c b/ibss.c index 84f1e95..7087cc9 100644 --- a/ibss.c +++ b/ibss.c @@ -47,6 +47,12 @@ static int join_ibss(struct nl80211_state *state, argc--; } + if (argc && strcmp(argv[0], "__dfs-enable") == 0) { + NLA_PUT_FLAG(msg, NL80211_ATTR_HANDLE_DFS); + argv++; + argc--; + } + if (argc) { if (mac_addr_a2n(abssid, argv[0]) == 0) { NLA_PUT(msg, NL80211_ATTR_MAC, 6, abssid);