Search Linux Wireless

PATCH: wireless: Allow active scanning while associated with custom world regulatory domain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <blaise.gassend_linux@xxxxxxx>
---
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,
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux