aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/init.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2014-08-22 11:09:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-08-28 14:41:58 -0400
commit499afaccf6f3d5d3180f4155e85becf15d09ff71 (patch)
treeac1e66701d168d034b592c641fe9fdb8afe35dd5 /drivers/net/wireless/ath/ath9k/init.c
parentc7dd40c92af1f28b84995a07aa88ccd3068ee4de (diff)
ath9k: Isolate ath9k_use_chanctx module parameter
This patch ensures that the module parameter "use_chanctx" is visible only when CONFIG_ATH9K_CHANNEL_CONTEXT is selected. Also register the channel context callbacks with mac80211 only when it is explicitly enabled and compile them out of the driver when CONFIG_ATH9K_CHANNEL_CONTEXT is not selected. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/init.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c63
1 files changed, 38 insertions, 25 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 5c48be95f983..cfd475b475c3 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -61,10 +61,14 @@ static int ath9k_ps_enable;
61module_param_named(ps_enable, ath9k_ps_enable, int, 0444); 61module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
62MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave"); 62MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave");
63 63
64#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
65
64int ath9k_use_chanctx; 66int ath9k_use_chanctx;
65module_param_named(use_chanctx, ath9k_use_chanctx, int, 0444); 67module_param_named(use_chanctx, ath9k_use_chanctx, int, 0444);
66MODULE_PARM_DESC(use_chanctx, "Enable channel context for concurrency"); 68MODULE_PARM_DESC(use_chanctx, "Enable channel context for concurrency");
67 69
70#endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */
71
68bool is_ath9k_unloaded; 72bool is_ath9k_unloaded;
69 73
70#ifdef CONFIG_MAC80211_LEDS 74#ifdef CONFIG_MAC80211_LEDS
@@ -511,7 +515,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
511 sc->tx99_power = MAX_RATE_POWER + 1; 515 sc->tx99_power = MAX_RATE_POWER + 1;
512 init_waitqueue_head(&sc->tx_wait); 516 init_waitqueue_head(&sc->tx_wait);
513 sc->cur_chan = &sc->chanctx[0]; 517 sc->cur_chan = &sc->chanctx[0];
514 if (!ath9k_use_chanctx) 518 if (!ath9k_is_chanctx_enabled())
515 sc->cur_chan->hw_queue_base = 0; 519 sc->cur_chan->hw_queue_base = 0;
516 520
517 if (!pdata || pdata->use_eeprom) { 521 if (!pdata || pdata->use_eeprom) {
@@ -673,20 +677,14 @@ static const struct ieee80211_iface_limit wds_limits[] = {
673 { .max = 2048, .types = BIT(NL80211_IFTYPE_WDS) }, 677 { .max = 2048, .types = BIT(NL80211_IFTYPE_WDS) },
674}; 678};
675 679
680#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
681
676static const struct ieee80211_iface_limit if_limits_multi[] = { 682static const struct ieee80211_iface_limit if_limits_multi[] = {
677 { .max = 1, .types = BIT(NL80211_IFTYPE_STATION) }, 683 { .max = 1, .types = BIT(NL80211_IFTYPE_STATION) },
678 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 684 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
679 BIT(NL80211_IFTYPE_P2P_GO) }, 685 BIT(NL80211_IFTYPE_P2P_GO) },
680}; 686};
681 687
682static const struct ieee80211_iface_limit if_dfs_limits[] = {
683 { .max = 1, .types = BIT(NL80211_IFTYPE_AP) |
684#ifdef CONFIG_MAC80211_MESH
685 BIT(NL80211_IFTYPE_MESH_POINT) |
686#endif
687 BIT(NL80211_IFTYPE_ADHOC) },
688};
689
690static const struct ieee80211_iface_combination if_comb_multi[] = { 688static const struct ieee80211_iface_combination if_comb_multi[] = {
691 { 689 {
692 .limits = if_limits_multi, 690 .limits = if_limits_multi,
@@ -697,6 +695,16 @@ static const struct ieee80211_iface_combination if_comb_multi[] = {
697 }, 695 },
698}; 696};
699 697
698#endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */
699
700static const struct ieee80211_iface_limit if_dfs_limits[] = {
701 { .max = 1, .types = BIT(NL80211_IFTYPE_AP) |
702#ifdef CONFIG_MAC80211_MESH
703 BIT(NL80211_IFTYPE_MESH_POINT) |
704#endif
705 BIT(NL80211_IFTYPE_ADHOC) },
706};
707
700static const struct ieee80211_iface_combination if_comb[] = { 708static const struct ieee80211_iface_combination if_comb[] = {
701 { 709 {
702 .limits = if_limits, 710 .limits = if_limits,
@@ -764,26 +772,31 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
764 BIT(NL80211_IFTYPE_AP) | 772 BIT(NL80211_IFTYPE_AP) |
765 BIT(NL80211_IFTYPE_STATION) | 773 BIT(NL80211_IFTYPE_STATION) |
766 BIT(NL80211_IFTYPE_ADHOC) | 774 BIT(NL80211_IFTYPE_ADHOC) |
767 BIT(NL80211_IFTYPE_MESH_POINT); 775 BIT(NL80211_IFTYPE_MESH_POINT) |
768 if (!ath9k_use_chanctx) { 776 BIT(NL80211_IFTYPE_WDS);
777
769 hw->wiphy->iface_combinations = if_comb; 778 hw->wiphy->iface_combinations = if_comb;
770 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); 779 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
771 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_WDS);
772 } else {
773 hw->wiphy->iface_combinations = if_comb_multi;
774 hw->wiphy->n_iface_combinations =
775 ARRAY_SIZE(if_comb_multi);
776 hw->wiphy->max_scan_ssids = 255;
777 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
778 hw->wiphy->max_remain_on_channel_duration = 10000;
779 hw->chanctx_data_size = sizeof(void *);
780 hw->extra_beacon_tailroom =
781 sizeof(struct ieee80211_p2p_noa_attr) + 9;
782
783 ath_dbg(common, CHAN_CTX, "Use channel contexts\n");
784 }
785 } 780 }
786 781
782#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
783
784 if (ath9k_is_chanctx_enabled()) {
785 hw->wiphy->interface_modes &= ~ BIT(NL80211_IFTYPE_WDS);
786 hw->wiphy->iface_combinations = if_comb_multi;
787 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb_multi);
788 hw->wiphy->max_scan_ssids = 255;
789 hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
790 hw->wiphy->max_remain_on_channel_duration = 10000;
791 hw->chanctx_data_size = sizeof(void *);
792 hw->extra_beacon_tailroom =
793 sizeof(struct ieee80211_p2p_noa_attr) + 9;
794
795 ath_dbg(common, CHAN_CTX, "Use channel contexts\n");
796 }
797
798#endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */
799
787 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 800 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
788 801
789 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 802 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;