diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2010-11-18 00:46:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-22 15:48:51 -0500 |
commit | b2e253cf300c5e33f49b7dd8b593bfc722177401 (patch) | |
tree | 0da4d4121996f7869b0ce5ac469c6dd5e7c7beaa /include/net | |
parent | b0e2880b0518ad11af20c7c93ec5cac93f9f03b0 (diff) |
cfg80211: Fix regulatory bug with multiple cards and delays
When two cards are connected with the same regulatory domain
if CRDA had a delayed response then cfg80211's own set regulatory
domain would still be the world regulatory domain. There was a bug
on cfg80211's logic such that it assumed that once you pegged a
request as the last request it was already the currently set
regulatory domain. This would mean we would race setting a stale
regulatory domain to secondary cards which had the same regulatory
domain since the alpha2 would match.
We fix this by processing each regulatory request atomically,
and only move on to the next one once we get it fully processed.
In the case CRDA is not present we will simply world roam.
This issue is only present when you have a slow system and the
CRDA processing is delayed. Because of this it is not a known
regression.
Without this fix when a delay is present with CRDA the second card
would end up with an intersected regulatory domain and not allow it
to use the channels it really is designed for. When two cards with
two different regulatory domains were inserted you'd end up
rejecting the second card's regulatory domain request.
This fails with mac80211_hswim's regtest=2 (two requests, same alpha2)
and regtest=3 (two requests, different alpha2) module parameter
options.
This was reproduced and tested against mac80211_hwsim using this
CRDA delayer:
#!/bin/bash
echo $COUNTRY >> /tmp/log
sleep 2
/sbin/crda.orig
And these regulatory tests:
modprobe mac80211_hwsim regtest=2
modprobe mac80211_hwsim regtest=3
Reported-by: Mark Mentovai <mark@moxienet.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/regulatory.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 9e103a4e91ee..356d6e3dc20a 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -43,6 +43,12 @@ enum environment_cap { | |||
43 | * @intersect: indicates whether the wireless core should intersect | 43 | * @intersect: indicates whether the wireless core should intersect |
44 | * the requested regulatory domain with the presently set regulatory | 44 | * the requested regulatory domain with the presently set regulatory |
45 | * domain. | 45 | * domain. |
46 | * @processed: indicates whether or not this requests has already been | ||
47 | * processed. When the last request is processed it means that the | ||
48 | * currently regulatory domain set on cfg80211 is updated from | ||
49 | * CRDA and can be used by other regulatory requests. When a | ||
50 | * the last request is not yet processed we must yield until it | ||
51 | * is processed before processing any new requests. | ||
46 | * @country_ie_checksum: checksum of the last processed and accepted | 52 | * @country_ie_checksum: checksum of the last processed and accepted |
47 | * country IE | 53 | * country IE |
48 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | 54 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
@@ -54,6 +60,7 @@ struct regulatory_request { | |||
54 | enum nl80211_reg_initiator initiator; | 60 | enum nl80211_reg_initiator initiator; |
55 | char alpha2[2]; | 61 | char alpha2[2]; |
56 | bool intersect; | 62 | bool intersect; |
63 | bool processed; | ||
57 | enum environment_cap country_ie_env; | 64 | enum environment_cap country_ie_env; |
58 | struct list_head list; | 65 | struct list_head list; |
59 | }; | 66 | }; |