diff options
author | Avinash Patil <patila@marvell.com> | 2013-06-10 18:40:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-17 14:38:51 -0400 |
commit | 3c68ef5b2223e084402a4fedbd4c31774f012f4f (patch) | |
tree | 5f6a2aee4425f7053baad63863a889346769c32d /drivers/net/wireless/mwifiex | |
parent | 1105a13bb8ad29cf83d46989ee462d196038be87 (diff) |
mwifiex: Add module parameter for regdomain
Allow a regulatory domain country code to be specified at boot
using a module argument. This overrides the firmware regulatory
mode.
This patch also enables uAP to operate in 11a mode with hostapd.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 856aea25052b..ef5fa890a286 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -20,6 +20,9 @@ | |||
20 | #include "cfg80211.h" | 20 | #include "cfg80211.h" |
21 | #include "main.h" | 21 | #include "main.h" |
22 | 22 | ||
23 | static char *reg_alpha2; | ||
24 | module_param(reg_alpha2, charp, 0); | ||
25 | |||
23 | static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = { | 26 | static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = { |
24 | { | 27 | { |
25 | .max = 2, .types = BIT(NL80211_IFTYPE_STATION), | 28 | .max = 2, .types = BIT(NL80211_IFTYPE_STATION), |
@@ -2485,6 +2488,17 @@ static const struct wiphy_wowlan_support mwifiex_wowlan_support = { | |||
2485 | }; | 2488 | }; |
2486 | #endif | 2489 | #endif |
2487 | 2490 | ||
2491 | static bool mwifiex_is_valid_alpha2(const char *alpha2) | ||
2492 | { | ||
2493 | if (!alpha2 || strlen(alpha2) != 2) | ||
2494 | return false; | ||
2495 | |||
2496 | if (isalpha(alpha2[0]) && isalpha(alpha2[1])) | ||
2497 | return true; | ||
2498 | |||
2499 | return false; | ||
2500 | } | ||
2501 | |||
2488 | /* | 2502 | /* |
2489 | * This function registers the device with CFG802.11 subsystem. | 2503 | * This function registers the device with CFG802.11 subsystem. |
2490 | * | 2504 | * |
@@ -2537,6 +2551,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) | |||
2537 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | | 2551 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | |
2538 | WIPHY_FLAG_AP_UAPSD | | 2552 | WIPHY_FLAG_AP_UAPSD | |
2539 | WIPHY_FLAG_CUSTOM_REGULATORY | | 2553 | WIPHY_FLAG_CUSTOM_REGULATORY | |
2554 | WIPHY_FLAG_STRICT_REGULATORY | | ||
2540 | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; | 2555 | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; |
2541 | 2556 | ||
2542 | wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); | 2557 | wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); |
@@ -2574,10 +2589,16 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) | |||
2574 | wiphy_free(wiphy); | 2589 | wiphy_free(wiphy); |
2575 | return ret; | 2590 | return ret; |
2576 | } | 2591 | } |
2577 | country_code = mwifiex_11d_code_2_region(priv->adapter->region_code); | 2592 | |
2578 | if (country_code) | 2593 | if (reg_alpha2 && mwifiex_is_valid_alpha2(reg_alpha2)) { |
2579 | dev_info(adapter->dev, | 2594 | wiphy_info(wiphy, "driver hint alpha2: %2.2s\n", reg_alpha2); |
2580 | "ignoring F/W country code %2.2s\n", country_code); | 2595 | regulatory_hint(wiphy, reg_alpha2); |
2596 | } else { | ||
2597 | country_code = mwifiex_11d_code_2_region(adapter->region_code); | ||
2598 | if (country_code) | ||
2599 | wiphy_info(wiphy, "ignoring F/W country code %2.2s\n", | ||
2600 | country_code); | ||
2601 | } | ||
2581 | 2602 | ||
2582 | adapter->wiphy = wiphy; | 2603 | adapter->wiphy = wiphy; |
2583 | return ret; | 2604 | return ret; |