diff options
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 109 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/init.c | 4 |
3 files changed, 62 insertions, 57 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 7e92dc9799ac..44fdd39e1701 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -2755,57 +2755,6 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev) | |||
2755 | return ar; | 2755 | return ar; |
2756 | } | 2756 | } |
2757 | 2757 | ||
2758 | int ath6kl_register_ieee80211_hw(struct ath6kl *ar) | ||
2759 | { | ||
2760 | struct wiphy *wiphy = ar->wiphy; | ||
2761 | int ret; | ||
2762 | |||
2763 | wiphy->mgmt_stypes = ath6kl_mgmt_stypes; | ||
2764 | |||
2765 | wiphy->max_remain_on_channel_duration = 5000; | ||
2766 | |||
2767 | /* set device pointer for wiphy */ | ||
2768 | set_wiphy_dev(wiphy, ar->dev); | ||
2769 | |||
2770 | wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | | ||
2771 | BIT(NL80211_IFTYPE_ADHOC) | | ||
2772 | BIT(NL80211_IFTYPE_AP); | ||
2773 | if (ar->p2p) { | ||
2774 | wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_GO) | | ||
2775 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
2776 | } | ||
2777 | |||
2778 | /* max num of ssids that can be probed during scanning */ | ||
2779 | wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; | ||
2780 | wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */ | ||
2781 | wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz; | ||
2782 | wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz; | ||
2783 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | ||
2784 | |||
2785 | wiphy->cipher_suites = cipher_suites; | ||
2786 | wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); | ||
2787 | |||
2788 | wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | | ||
2789 | WIPHY_WOWLAN_DISCONNECT | | ||
2790 | WIPHY_WOWLAN_GTK_REKEY_FAILURE | | ||
2791 | WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | | ||
2792 | WIPHY_WOWLAN_EAP_IDENTITY_REQ | | ||
2793 | WIPHY_WOWLAN_4WAY_HANDSHAKE; | ||
2794 | wiphy->wowlan.n_patterns = WOW_MAX_FILTERS_PER_LIST; | ||
2795 | wiphy->wowlan.pattern_min_len = 1; | ||
2796 | wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE; | ||
2797 | |||
2798 | wiphy->max_sched_scan_ssids = 10; | ||
2799 | |||
2800 | ret = wiphy_register(wiphy); | ||
2801 | if (ret < 0) { | ||
2802 | ath6kl_err("couldn't register wiphy device\n"); | ||
2803 | return ret; | ||
2804 | } | ||
2805 | |||
2806 | return 0; | ||
2807 | } | ||
2808 | |||
2809 | static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif) | 2758 | static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif) |
2810 | { | 2759 | { |
2811 | vif->aggr_cntxt = aggr_init(vif->ndev); | 2760 | vif->aggr_cntxt = aggr_init(vif->ndev); |
@@ -2907,8 +2856,64 @@ err: | |||
2907 | return NULL; | 2856 | return NULL; |
2908 | } | 2857 | } |
2909 | 2858 | ||
2910 | void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar) | 2859 | int ath6kl_cfg80211_init(struct ath6kl *ar) |
2860 | { | ||
2861 | struct wiphy *wiphy = ar->wiphy; | ||
2862 | int ret; | ||
2863 | |||
2864 | wiphy->mgmt_stypes = ath6kl_mgmt_stypes; | ||
2865 | |||
2866 | wiphy->max_remain_on_channel_duration = 5000; | ||
2867 | |||
2868 | /* set device pointer for wiphy */ | ||
2869 | set_wiphy_dev(wiphy, ar->dev); | ||
2870 | |||
2871 | wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | | ||
2872 | BIT(NL80211_IFTYPE_ADHOC) | | ||
2873 | BIT(NL80211_IFTYPE_AP); | ||
2874 | if (ar->p2p) { | ||
2875 | wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_GO) | | ||
2876 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
2877 | } | ||
2878 | |||
2879 | /* max num of ssids that can be probed during scanning */ | ||
2880 | wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; | ||
2881 | wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */ | ||
2882 | wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz; | ||
2883 | wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz; | ||
2884 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | ||
2885 | |||
2886 | wiphy->cipher_suites = cipher_suites; | ||
2887 | wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); | ||
2888 | |||
2889 | wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT | | ||
2890 | WIPHY_WOWLAN_DISCONNECT | | ||
2891 | WIPHY_WOWLAN_GTK_REKEY_FAILURE | | ||
2892 | WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | | ||
2893 | WIPHY_WOWLAN_EAP_IDENTITY_REQ | | ||
2894 | WIPHY_WOWLAN_4WAY_HANDSHAKE; | ||
2895 | wiphy->wowlan.n_patterns = WOW_MAX_FILTERS_PER_LIST; | ||
2896 | wiphy->wowlan.pattern_min_len = 1; | ||
2897 | wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE; | ||
2898 | |||
2899 | wiphy->max_sched_scan_ssids = 10; | ||
2900 | |||
2901 | ret = wiphy_register(wiphy); | ||
2902 | if (ret < 0) { | ||
2903 | ath6kl_err("couldn't register wiphy device\n"); | ||
2904 | return ret; | ||
2905 | } | ||
2906 | |||
2907 | return 0; | ||
2908 | } | ||
2909 | |||
2910 | void ath6kl_cfg80211_cleanup(struct ath6kl *ar) | ||
2911 | { | 2911 | { |
2912 | wiphy_unregister(ar->wiphy); | 2912 | wiphy_unregister(ar->wiphy); |
2913 | |||
2914 | /* | ||
2915 | * FIXME: should be removed as we remove wiphy in | ||
2916 | * ath6kl_core_free(). Most likely this causes a use after free. | ||
2917 | */ | ||
2913 | wiphy_free(ar->wiphy); | 2918 | wiphy_free(ar->wiphy); |
2914 | } | 2919 | } |
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h index aa961694cf99..08d97691039c 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.h +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h | |||
@@ -27,10 +27,7 @@ enum ath6kl_cfg_suspend_mode { | |||
27 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, | 27 | struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, |
28 | enum nl80211_iftype type, | 28 | enum nl80211_iftype type, |
29 | u8 fw_vif_idx, u8 nw_type); | 29 | u8 fw_vif_idx, u8 nw_type); |
30 | int ath6kl_register_ieee80211_hw(struct ath6kl *ar); | ||
31 | struct ath6kl *ath6kl_core_alloc(struct device *dev); | 30 | struct ath6kl *ath6kl_core_alloc(struct device *dev); |
32 | void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar); | ||
33 | |||
34 | void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted); | 31 | void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted); |
35 | 32 | ||
36 | void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel, | 33 | void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel, |
@@ -58,4 +55,7 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif); | |||
58 | void ath6kl_cfg80211_stop(struct ath6kl_vif *vif); | 55 | void ath6kl_cfg80211_stop(struct ath6kl_vif *vif); |
59 | void ath6kl_cfg80211_stop_all(struct ath6kl *ar); | 56 | void ath6kl_cfg80211_stop_all(struct ath6kl *ar); |
60 | 57 | ||
58 | int ath6kl_cfg80211_init(struct ath6kl *ar); | ||
59 | void ath6kl_cfg80211_cleanup(struct ath6kl *ar); | ||
60 | |||
61 | #endif /* ATH6KL_CFG80211_H */ | 61 | #endif /* ATH6KL_CFG80211_H */ |
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 3cc4e0842add..7e56a6aa70b9 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c | |||
@@ -625,7 +625,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar) | |||
625 | kfree(ar->fw_patch); | 625 | kfree(ar->fw_patch); |
626 | kfree(ar->fw_testscript); | 626 | kfree(ar->fw_testscript); |
627 | 627 | ||
628 | ath6kl_deinit_ieee80211_hw(ar); | 628 | ath6kl_cfg80211_cleanup(ar); |
629 | } | 629 | } |
630 | 630 | ||
631 | /* firmware upload */ | 631 | /* firmware upload */ |
@@ -1722,7 +1722,7 @@ int ath6kl_core_init(struct ath6kl *ar) | |||
1722 | 1722 | ||
1723 | ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi); | 1723 | ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi); |
1724 | 1724 | ||
1725 | ret = ath6kl_register_ieee80211_hw(ar); | 1725 | ret = ath6kl_cfg80211_init(ar); |
1726 | if (ret) | 1726 | if (ret) |
1727 | goto err_node_cleanup; | 1727 | goto err_node_cleanup; |
1728 | 1728 | ||