init.c (c7dd40c92af1f28b84995a07aa88ccd3068ee4de) | init.c (499afaccf6f3d5d3180f4155e85becf15d09ff71) |
---|---|
1/* 2 * Copyright (c) 2008-2011 Atheros Communications Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 47 unchanged lines hidden (view full) --- 56static int ath9k_bt_ant_diversity; 57module_param_named(bt_ant_diversity, ath9k_bt_ant_diversity, int, 0444); 58MODULE_PARM_DESC(bt_ant_diversity, "Enable WLAN/BT RX antenna diversity"); 59 60static int ath9k_ps_enable; 61module_param_named(ps_enable, ath9k_ps_enable, int, 0444); 62MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave"); 63 | 1/* 2 * Copyright (c) 2008-2011 Atheros Communications Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 47 unchanged lines hidden (view full) --- 56static int ath9k_bt_ant_diversity; 57module_param_named(bt_ant_diversity, ath9k_bt_ant_diversity, int, 0444); 58MODULE_PARM_DESC(bt_ant_diversity, "Enable WLAN/BT RX antenna diversity"); 59 60static int ath9k_ps_enable; 61module_param_named(ps_enable, ath9k_ps_enable, int, 0444); 62MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave"); 63 |
64#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT 65 |
|
64int ath9k_use_chanctx; 65module_param_named(use_chanctx, ath9k_use_chanctx, int, 0444); 66MODULE_PARM_DESC(use_chanctx, "Enable channel context for concurrency"); 67 | 66int ath9k_use_chanctx; 67module_param_named(use_chanctx, ath9k_use_chanctx, int, 0444); 68MODULE_PARM_DESC(use_chanctx, "Enable channel context for concurrency"); 69 |
70#endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */ 71 |
|
68bool is_ath9k_unloaded; 69 70#ifdef CONFIG_MAC80211_LEDS 71static const struct ieee80211_tpt_blink ath9k_tpt_blink[] = { 72 { .throughput = 0 * 1024, .blink_time = 334 }, 73 { .throughput = 1 * 1024, .blink_time = 260 }, 74 { .throughput = 5 * 1024, .blink_time = 220 }, 75 { .throughput = 10 * 1024, .blink_time = 190 }, --- 430 unchanged lines hidden (view full) --- 506 sc->sc_ah = ah; 507 pCap = &ah->caps; 508 509 common = ath9k_hw_common(ah); 510 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET); 511 sc->tx99_power = MAX_RATE_POWER + 1; 512 init_waitqueue_head(&sc->tx_wait); 513 sc->cur_chan = &sc->chanctx[0]; | 72bool is_ath9k_unloaded; 73 74#ifdef CONFIG_MAC80211_LEDS 75static const struct ieee80211_tpt_blink ath9k_tpt_blink[] = { 76 { .throughput = 0 * 1024, .blink_time = 334 }, 77 { .throughput = 1 * 1024, .blink_time = 260 }, 78 { .throughput = 5 * 1024, .blink_time = 220 }, 79 { .throughput = 10 * 1024, .blink_time = 190 }, --- 430 unchanged lines hidden (view full) --- 510 sc->sc_ah = ah; 511 pCap = &ah->caps; 512 513 common = ath9k_hw_common(ah); 514 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET); 515 sc->tx99_power = MAX_RATE_POWER + 1; 516 init_waitqueue_head(&sc->tx_wait); 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; 516 517 if (!pdata || pdata->use_eeprom) { 518 ah->ah_flags |= AH_USE_EEPROM; 519 sc->sc_ah->led_pin = -1; 520 } else { 521 sc->sc_ah->gpio_mask = pdata->gpio_mask; 522 sc->sc_ah->gpio_val = pdata->gpio_val; --- 145 unchanged lines hidden (view full) --- 668 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 669 BIT(NL80211_IFTYPE_P2P_GO) }, 670}; 671 672static const struct ieee80211_iface_limit wds_limits[] = { 673 { .max = 2048, .types = BIT(NL80211_IFTYPE_WDS) }, 674}; 675 | 519 sc->cur_chan->hw_queue_base = 0; 520 521 if (!pdata || pdata->use_eeprom) { 522 ah->ah_flags |= AH_USE_EEPROM; 523 sc->sc_ah->led_pin = -1; 524 } else { 525 sc->sc_ah->gpio_mask = pdata->gpio_mask; 526 sc->sc_ah->gpio_val = pdata->gpio_val; --- 145 unchanged lines hidden (view full) --- 672 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 673 BIT(NL80211_IFTYPE_P2P_GO) }, 674}; 675 676static const struct ieee80211_iface_limit wds_limits[] = { 677 { .max = 2048, .types = BIT(NL80211_IFTYPE_WDS) }, 678}; 679 |
680#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT 681 |
|
676static const struct ieee80211_iface_limit if_limits_multi[] = { 677 { .max = 1, .types = BIT(NL80211_IFTYPE_STATION) }, 678 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 679 BIT(NL80211_IFTYPE_P2P_GO) }, 680}; 681 | 682static const struct ieee80211_iface_limit if_limits_multi[] = { 683 { .max = 1, .types = BIT(NL80211_IFTYPE_STATION) }, 684 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 685 BIT(NL80211_IFTYPE_P2P_GO) }, 686}; 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[] = { 691 { 692 .limits = if_limits_multi, 693 .n_limits = ARRAY_SIZE(if_limits_multi), 694 .max_interfaces = 2, 695 .num_different_channels = 2, 696 .beacon_int_infra_match = true, 697 }, 698}; 699 | 688static const struct ieee80211_iface_combination if_comb_multi[] = { 689 { 690 .limits = if_limits_multi, 691 .n_limits = ARRAY_SIZE(if_limits_multi), 692 .max_interfaces = 2, 693 .num_different_channels = 2, 694 .beacon_int_infra_match = true, 695 }, 696}; 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[] = { 701 { 702 .limits = if_limits, 703 .n_limits = ARRAY_SIZE(if_limits), 704 .max_interfaces = 2048, 705 .num_different_channels = 1, 706 .beacon_int_infra_match = true, 707 }, --- 51 unchanged lines hidden (view full) --- 759 760 if (!config_enabled(CONFIG_ATH9K_TX99)) { 761 hw->wiphy->interface_modes = 762 BIT(NL80211_IFTYPE_P2P_GO) | 763 BIT(NL80211_IFTYPE_P2P_CLIENT) | 764 BIT(NL80211_IFTYPE_AP) | 765 BIT(NL80211_IFTYPE_STATION) | 766 BIT(NL80211_IFTYPE_ADHOC) | | 708static const struct ieee80211_iface_combination if_comb[] = { 709 { 710 .limits = if_limits, 711 .n_limits = ARRAY_SIZE(if_limits), 712 .max_interfaces = 2048, 713 .num_different_channels = 1, 714 .beacon_int_infra_match = true, 715 }, --- 51 unchanged lines hidden (view full) --- 767 768 if (!config_enabled(CONFIG_ATH9K_TX99)) { 769 hw->wiphy->interface_modes = 770 BIT(NL80211_IFTYPE_P2P_GO) | 771 BIT(NL80211_IFTYPE_P2P_CLIENT) | 772 BIT(NL80211_IFTYPE_AP) | 773 BIT(NL80211_IFTYPE_STATION) | 774 BIT(NL80211_IFTYPE_ADHOC) | |
767 BIT(NL80211_IFTYPE_MESH_POINT); 768 if (!ath9k_use_chanctx) { | 775 BIT(NL80211_IFTYPE_MESH_POINT) | 776 BIT(NL80211_IFTYPE_WDS); 777 |
769 hw->wiphy->iface_combinations = if_comb; 770 hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); | 778 hw->wiphy->iface_combinations = 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; | 780 } |
782 | 781 |
783 ath_dbg(common, CHAN_CTX, "Use channel contexts\n"); 784 } | 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"); |
785 } 786 | 796 } 797 |
798#endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */ 799 |
|
787 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 788 789 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 790 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; 791 hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; 792 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ; 793 hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; 794 hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; --- 196 unchanged lines hidden --- | 800 hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 801 802 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 803 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; 804 hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; 805 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ; 806 hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; 807 hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; --- 196 unchanged lines hidden --- |