aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 10:13:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:36 -0400
commit2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch)
tree9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/ath/ath5k/base.c
parent57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (diff)
mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the BSSID and beacon updates, while bss_info_changed contains most other BSS information for each interface. This patch removes config_interface and rolls all the information it previously passed to drivers into bss_info_changed. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c71
1 files changed, 27 insertions, 44 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index e4b1d9efa42e..410fc4cfc4c6 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -227,9 +227,6 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
227static void ath5k_remove_interface(struct ieee80211_hw *hw, 227static void ath5k_remove_interface(struct ieee80211_hw *hw,
228 struct ieee80211_if_init_conf *conf); 228 struct ieee80211_if_init_conf *conf);
229static int ath5k_config(struct ieee80211_hw *hw, u32 changed); 229static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
230static int ath5k_config_interface(struct ieee80211_hw *hw,
231 struct ieee80211_vif *vif,
232 struct ieee80211_if_conf *conf);
233static void ath5k_configure_filter(struct ieee80211_hw *hw, 230static void ath5k_configure_filter(struct ieee80211_hw *hw,
234 unsigned int changed_flags, 231 unsigned int changed_flags,
235 unsigned int *new_flags, 232 unsigned int *new_flags,
@@ -259,7 +256,6 @@ static const struct ieee80211_ops ath5k_hw_ops = {
259 .add_interface = ath5k_add_interface, 256 .add_interface = ath5k_add_interface,
260 .remove_interface = ath5k_remove_interface, 257 .remove_interface = ath5k_remove_interface,
261 .config = ath5k_config, 258 .config = ath5k_config,
262 .config_interface = ath5k_config_interface,
263 .configure_filter = ath5k_configure_filter, 259 .configure_filter = ath5k_configure_filter,
264 .set_key = ath5k_set_key, 260 .set_key = ath5k_set_key,
265 .get_stats = ath5k_get_stats, 261 .get_stats = ath5k_get_stats,
@@ -2764,44 +2760,6 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
2764 return ret; 2760 return ret;
2765} 2761}
2766 2762
2767static int
2768ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2769 struct ieee80211_if_conf *conf)
2770{
2771 struct ath5k_softc *sc = hw->priv;
2772 struct ath5k_hw *ah = sc->ah;
2773 int ret = 0;
2774
2775 mutex_lock(&sc->lock);
2776 if (sc->vif != vif) {
2777 ret = -EIO;
2778 goto unlock;
2779 }
2780 if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) {
2781 /* Cache for later use during resets */
2782 memcpy(ah->ah_bssid, conf->bssid, ETH_ALEN);
2783 /* XXX: assoc id is set to 0 for now, mac80211 doesn't have
2784 * a clean way of letting us retrieve this yet. */
2785 ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
2786 mmiowb();
2787 }
2788 if (conf->changed & IEEE80211_IFCC_BEACON &&
2789 (vif->type == NL80211_IFTYPE_ADHOC ||
2790 vif->type == NL80211_IFTYPE_MESH_POINT ||
2791 vif->type == NL80211_IFTYPE_AP)) {
2792 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
2793 if (!beacon) {
2794 ret = -ENOMEM;
2795 goto unlock;
2796 }
2797 ath5k_beacon_update(sc, beacon);
2798 }
2799
2800unlock:
2801 mutex_unlock(&sc->lock);
2802 return ret;
2803}
2804
2805#define SUPPORTED_FIF_FLAGS \ 2763#define SUPPORTED_FIF_FLAGS \
2806 FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | \ 2764 FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | \
2807 FIF_PLCPFAIL | FIF_CONTROL | FIF_OTHER_BSS | \ 2765 FIF_PLCPFAIL | FIF_CONTROL | FIF_OTHER_BSS | \
@@ -3082,15 +3040,40 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
3082 u32 changes) 3040 u32 changes)
3083{ 3041{
3084 struct ath5k_softc *sc = hw->priv; 3042 struct ath5k_softc *sc = hw->priv;
3043 struct ath5k_hw *ah = sc->ah;
3044
3045 mutex_lock(&sc->lock);
3046 if (WARN_ON(sc->vif != vif))
3047 goto unlock;
3048
3049 if (changes & BSS_CHANGED_BSSID) {
3050 /* Cache for later use during resets */
3051 memcpy(ah->ah_bssid, bss_conf->bssid, ETH_ALEN);
3052 /* XXX: assoc id is set to 0 for now, mac80211 doesn't have
3053 * a clean way of letting us retrieve this yet. */
3054 ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
3055 mmiowb();
3056 }
3085 3057
3086 if (changes & BSS_CHANGED_BEACON_INT) 3058 if (changes & BSS_CHANGED_BEACON_INT)
3087 sc->bintval = bss_conf->beacon_int; 3059 sc->bintval = bss_conf->beacon_int;
3088 3060
3089 if (changes & BSS_CHANGED_ASSOC) { 3061 if (changes & BSS_CHANGED_ASSOC) {
3090 mutex_lock(&sc->lock);
3091 sc->assoc = bss_conf->assoc; 3062 sc->assoc = bss_conf->assoc;
3092 if (sc->opmode == NL80211_IFTYPE_STATION) 3063 if (sc->opmode == NL80211_IFTYPE_STATION)
3093 set_beacon_filter(hw, sc->assoc); 3064 set_beacon_filter(hw, sc->assoc);
3094 mutex_unlock(&sc->lock);
3095 } 3065 }
3066
3067 if (changes & BSS_CHANGED_BEACON &&
3068 (vif->type == NL80211_IFTYPE_ADHOC ||
3069 vif->type == NL80211_IFTYPE_MESH_POINT ||
3070 vif->type == NL80211_IFTYPE_AP)) {
3071 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
3072
3073 if (beacon)
3074 ath5k_beacon_update(sc, beacon);
3075 }
3076
3077 unlock:
3078 mutex_unlock(&sc->lock);
3096} 3079}