diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index e63b7c40d0ee..b5015376d4ba 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -225,9 +225,9 @@ static int ath5k_reset_wake(struct ath5k_softc *sc); | |||
225 | static int ath5k_start(struct ieee80211_hw *hw); | 225 | static int ath5k_start(struct ieee80211_hw *hw); |
226 | static void ath5k_stop(struct ieee80211_hw *hw); | 226 | static void ath5k_stop(struct ieee80211_hw *hw); |
227 | static int ath5k_add_interface(struct ieee80211_hw *hw, | 227 | static int ath5k_add_interface(struct ieee80211_hw *hw, |
228 | struct ieee80211_if_init_conf *conf); | 228 | struct ieee80211_vif *vif); |
229 | static void ath5k_remove_interface(struct ieee80211_hw *hw, | 229 | static void ath5k_remove_interface(struct ieee80211_hw *hw, |
230 | struct ieee80211_if_init_conf *conf); | 230 | struct ieee80211_vif *vif); |
231 | static int ath5k_config(struct ieee80211_hw *hw, u32 changed); | 231 | static int ath5k_config(struct ieee80211_hw *hw, u32 changed); |
232 | static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw, | 232 | static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw, |
233 | int mc_count, struct dev_addr_list *mc_list); | 233 | int mc_count, struct dev_addr_list *mc_list); |
@@ -254,6 +254,8 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | |||
254 | u32 changes); | 254 | u32 changes); |
255 | static void ath5k_sw_scan_start(struct ieee80211_hw *hw); | 255 | static void ath5k_sw_scan_start(struct ieee80211_hw *hw); |
256 | static void ath5k_sw_scan_complete(struct ieee80211_hw *hw); | 256 | static void ath5k_sw_scan_complete(struct ieee80211_hw *hw); |
257 | static void ath5k_set_coverage_class(struct ieee80211_hw *hw, | ||
258 | u8 coverage_class); | ||
257 | 259 | ||
258 | static const struct ieee80211_ops ath5k_hw_ops = { | 260 | static const struct ieee80211_ops ath5k_hw_ops = { |
259 | .tx = ath5k_tx, | 261 | .tx = ath5k_tx, |
@@ -274,6 +276,7 @@ static const struct ieee80211_ops ath5k_hw_ops = { | |||
274 | .bss_info_changed = ath5k_bss_info_changed, | 276 | .bss_info_changed = ath5k_bss_info_changed, |
275 | .sw_scan_start = ath5k_sw_scan_start, | 277 | .sw_scan_start = ath5k_sw_scan_start, |
276 | .sw_scan_complete = ath5k_sw_scan_complete, | 278 | .sw_scan_complete = ath5k_sw_scan_complete, |
279 | .set_coverage_class = ath5k_set_coverage_class, | ||
277 | }; | 280 | }; |
278 | 281 | ||
279 | /* | 282 | /* |
@@ -2773,7 +2776,7 @@ static void ath5k_stop(struct ieee80211_hw *hw) | |||
2773 | } | 2776 | } |
2774 | 2777 | ||
2775 | static int ath5k_add_interface(struct ieee80211_hw *hw, | 2778 | static int ath5k_add_interface(struct ieee80211_hw *hw, |
2776 | struct ieee80211_if_init_conf *conf) | 2779 | struct ieee80211_vif *vif) |
2777 | { | 2780 | { |
2778 | struct ath5k_softc *sc = hw->priv; | 2781 | struct ath5k_softc *sc = hw->priv; |
2779 | int ret; | 2782 | int ret; |
@@ -2784,22 +2787,22 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
2784 | goto end; | 2787 | goto end; |
2785 | } | 2788 | } |
2786 | 2789 | ||
2787 | sc->vif = conf->vif; | 2790 | sc->vif = vif; |
2788 | 2791 | ||
2789 | switch (conf->type) { | 2792 | switch (vif->type) { |
2790 | case NL80211_IFTYPE_AP: | 2793 | case NL80211_IFTYPE_AP: |
2791 | case NL80211_IFTYPE_STATION: | 2794 | case NL80211_IFTYPE_STATION: |
2792 | case NL80211_IFTYPE_ADHOC: | 2795 | case NL80211_IFTYPE_ADHOC: |
2793 | case NL80211_IFTYPE_MESH_POINT: | 2796 | case NL80211_IFTYPE_MESH_POINT: |
2794 | case NL80211_IFTYPE_MONITOR: | 2797 | case NL80211_IFTYPE_MONITOR: |
2795 | sc->opmode = conf->type; | 2798 | sc->opmode = vif->type; |
2796 | break; | 2799 | break; |
2797 | default: | 2800 | default: |
2798 | ret = -EOPNOTSUPP; | 2801 | ret = -EOPNOTSUPP; |
2799 | goto end; | 2802 | goto end; |
2800 | } | 2803 | } |
2801 | 2804 | ||
2802 | ath5k_hw_set_lladdr(sc->ah, conf->mac_addr); | 2805 | ath5k_hw_set_lladdr(sc->ah, vif->addr); |
2803 | ath5k_mode_setup(sc); | 2806 | ath5k_mode_setup(sc); |
2804 | 2807 | ||
2805 | ret = 0; | 2808 | ret = 0; |
@@ -2810,13 +2813,13 @@ end: | |||
2810 | 2813 | ||
2811 | static void | 2814 | static void |
2812 | ath5k_remove_interface(struct ieee80211_hw *hw, | 2815 | ath5k_remove_interface(struct ieee80211_hw *hw, |
2813 | struct ieee80211_if_init_conf *conf) | 2816 | struct ieee80211_vif *vif) |
2814 | { | 2817 | { |
2815 | struct ath5k_softc *sc = hw->priv; | 2818 | struct ath5k_softc *sc = hw->priv; |
2816 | u8 mac[ETH_ALEN] = {}; | 2819 | u8 mac[ETH_ALEN] = {}; |
2817 | 2820 | ||
2818 | mutex_lock(&sc->lock); | 2821 | mutex_lock(&sc->lock); |
2819 | if (sc->vif != conf->vif) | 2822 | if (sc->vif != vif) |
2820 | goto end; | 2823 | goto end; |
2821 | 2824 | ||
2822 | ath5k_hw_set_lladdr(sc->ah, mac); | 2825 | ath5k_hw_set_lladdr(sc->ah, mac); |
@@ -3262,3 +3265,22 @@ static void ath5k_sw_scan_complete(struct ieee80211_hw *hw) | |||
3262 | ath5k_hw_set_ledstate(sc->ah, sc->assoc ? | 3265 | ath5k_hw_set_ledstate(sc->ah, sc->assoc ? |
3263 | AR5K_LED_ASSOC : AR5K_LED_INIT); | 3266 | AR5K_LED_ASSOC : AR5K_LED_INIT); |
3264 | } | 3267 | } |
3268 | |||
3269 | /** | ||
3270 | * ath5k_set_coverage_class - Set IEEE 802.11 coverage class | ||
3271 | * | ||
3272 | * @hw: struct ieee80211_hw pointer | ||
3273 | * @coverage_class: IEEE 802.11 coverage class number | ||
3274 | * | ||
3275 | * Mac80211 callback. Sets slot time, ACK timeout and CTS timeout for given | ||
3276 | * coverage class. The values are persistent, they are restored after device | ||
3277 | * reset. | ||
3278 | */ | ||
3279 | static void ath5k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) | ||
3280 | { | ||
3281 | struct ath5k_softc *sc = hw->priv; | ||
3282 | |||
3283 | mutex_lock(&sc->lock); | ||
3284 | ath5k_hw_set_coverage_class(sc->ah, coverage_class); | ||
3285 | mutex_unlock(&sc->lock); | ||
3286 | } | ||