From patchwork Wed Jun 11 20:08:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 4338241 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BE9C4BEEAA for ; Wed, 11 Jun 2014 20:08:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E77A520254 for ; Wed, 11 Jun 2014 20:08:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA395202DD for ; Wed, 11 Jun 2014 20:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbaFKUIj (ORCPT ); Wed, 11 Jun 2014 16:08:39 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:56384 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbaFKUIj (ORCPT ); Wed, 11 Jun 2014 16:08:39 -0400 Received: from ben-dt2.candelatech.com (firewall.candelatech.com [70.89.124.249]) by mail2.candelatech.com (Postfix) with ESMTP id 79A9340A9E6; Wed, 11 Jun 2014 13:08:38 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: kvalo@qca.qualcomm.com, Ben Greear Subject: [RFC] wireless: improve dfs-region intersection. Date: Wed, 11 Jun 2014 13:08:34 -0700 Message-Id: <1402517314-20110-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.11.7 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear If one is UN-SET, use the other. Seems this would be more correct that what we have now. Signed-off-by: Ben Greear --- Someone that understands this code better than I do should review this well before it is considered for upstream. I'm not sure it is actually needed. net/wireless/reg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 785e516..b87035f 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -727,8 +727,15 @@ static enum nl80211_dfs_regions reg_intersect_dfs_region(const enum nl80211_dfs_regions dfs_region1, const enum nl80211_dfs_regions dfs_region2) { - if (dfs_region1 != dfs_region2) + if (dfs_region1 != dfs_region2) { + pr_info("intersect-dfs-region, region1: %d region2: %d\n", + dfs_region1, dfs_region2); + if (dfs_region1 == NL80211_DFS_UNSET) + return dfs_region2; + if (dfs_region2 == NL80211_DFS_UNSET) + return dfs_region1; return NL80211_DFS_UNSET; + } return dfs_region1; }