From patchwork Thu Feb 13 00:21:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blaise Gassend X-Patchwork-Id: 3641661 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 BFFD8BF13A for ; Thu, 13 Feb 2014 00:21:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1F5F20123 for ; Thu, 13 Feb 2014 00:21:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC4812011B for ; Thu, 13 Feb 2014 00:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbaBMAVp (ORCPT ); Wed, 12 Feb 2014 19:21:45 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:59159 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbaBMAVo (ORCPT ); Wed, 12 Feb 2014 19:21:44 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so9711967pde.34 for ; Wed, 12 Feb 2014 16:21:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-type; bh=VM/KjcqNK3XzYdlFtkRk+lSijdwdP/1F7M/sB4Qk8Hg=; b=MtQ86lQpAkaX3ohQhUJoalwzuhUdBDx1EvU/Chnt4SK9Tc6I0JTrdE1UNMIOqCLHXx EpNtA0li0SsVcWfkvbwfhpWHIvvZ8GTOBNRVqwz6yRlGJwSr4tBIcigSDRIESQKo35Mf 3VuSpsMLgk60pyFCZQeyJ6pSTmhj9uSMZAXuvwvK3fP7i798pG3X7jZhN6D1ez6vuQqE ggfAnFdFPmqB3HsGBiqhf6h8I38Gwyzw6ZhfrYMxRx8A0q0z7rzlisf0zSNWI+vGXfcf 7PazjqKC5dBTdp7MkGCPvvVDjq0/hbDp241yjVvb3Itw22nwG274hrulNODB9FiETFnI LSBA== X-Gm-Message-State: ALoCoQnkqMArrLoIWbs+8dt3NaDKN1sfeOONjd51tT2s8FW9JU2UPkOUC1IRiw1tngF8W4n6aKjb X-Received: by 10.68.93.132 with SMTP id cu4mr54291280pbb.129.1392250904201; Wed, 12 Feb 2014 16:21:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.70.1.73 with HTTP; Wed, 12 Feb 2014 16:21:24 -0800 (PST) From: Blaise Gassend Date: Wed, 12 Feb 2014 16:21:24 -0800 Message-ID: Subject: PATCH: wireless: Allow active scanning while associated with custom world regulatory domain To: John Linville Cc: linux-wireless@vger.kernel.org, Catalin Drula , Johannes Berg , mcgrof@qca.qualcomm.com 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.6 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 Currently ath9k sets a custom world regulatory domain with only passive scanning allowed throughout the 5 GHz band. Once you associate to an AP, the passive scanning limitation gets added to the country IE regulatory domain for the AP. However, once you are associated you are no longer in a world regulatory domain so beacon hints stop working. As a result active scanning is forbidden, and there is no mechanism to enable it. This is despite the fact that active scanning would be allowed when not associated (thanks to beacon hints), and is allowed by the country IE regulatory domain. The following patch considers that IEEE80211_CHAN_PASSIVE_SCAN from the custom world regulatory domain should be ignored once we are associated, since we now actually know which regulatory domain we are in. If the custom regulatory domain was disabling certain frequencies, those frequencies will still be disabled with this patch applied. Signed-off-by: Blaise Gassend --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/modules/backports-20131025/net/wireless/reg.c b/modules/backports-20131025/net/wireless/reg.c --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -837,8 +837,6 @@ static void handle_channel(struct wiphy request_wiphy = wiphy_idx_to_wiphy(lr->wiphy_idx); - flags = chan->orig_flags; - reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(chan->center_freq)); if (IS_ERR(reg_rule)) { /* @@ -892,7 +890,16 @@ static void handle_channel(struct wiphy chan->dfs_state = NL80211_DFS_USABLE; chan->dfs_state_entered = jiffies; - chan->beacon_found = false; + /* + * Clear IEEE80211_CHAN_PASSIVE_SCAN from the driver's flags to + * allow the associated country IE to permit active scanning on + * frequencies that only allow passive scanning according to the + * driver's world regulatory domain. Prior to association, beacon + * hints would enable active scanning on these channels. + */ + flags = chan->orig_flags & ~IEEE80211_CHAN_PASSIVE_SCAN; + + chan->beacon_found = false; chan->flags = flags | bw_flags | map_regdom_flags(reg_rule->flags); chan->max_antenna_gain = min_t(int, chan->orig_mag,