diff options
author | Ben Greear <greearb@candelatech.com> | 2010-11-10 14:43:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-16 16:37:07 -0500 |
commit | 7afbb2f07028183f50ae4f7ce4dab1f32b36cf48 (patch) | |
tree | 65973745adb9014a3dd59fc9d2feed41cbeef131 | |
parent | 6ee63f55c7754462a45315ac93027a1df60667c9 (diff) |
ath5k: Cleanup opmode setting logic.
An earlier review suggested moving the code in a small
method that was only called once inline. This patch
accomplishes that.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index fe116de41361..13735cc899a5 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -549,7 +549,7 @@ static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
549 | /* Calculate combined mode - when APs are active, operate in AP mode. | 549 | /* Calculate combined mode - when APs are active, operate in AP mode. |
550 | * Otherwise use the mode of the new interface. This can currently | 550 | * Otherwise use the mode of the new interface. This can currently |
551 | * only deal with combinations of APs and STAs. Only one ad-hoc | 551 | * only deal with combinations of APs and STAs. Only one ad-hoc |
552 | * interfaces is allowed above. | 552 | * interfaces is allowed. |
553 | */ | 553 | */ |
554 | if (avf->opmode == NL80211_IFTYPE_AP) | 554 | if (avf->opmode == NL80211_IFTYPE_AP) |
555 | iter_data->opmode = NL80211_IFTYPE_AP; | 555 | iter_data->opmode = NL80211_IFTYPE_AP; |
@@ -558,14 +558,6 @@ static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
558 | iter_data->opmode = avf->opmode; | 558 | iter_data->opmode = avf->opmode; |
559 | } | 559 | } |
560 | 560 | ||
561 | static void ath_do_set_opmode(struct ath5k_softc *sc) | ||
562 | { | ||
563 | struct ath5k_hw *ah = sc->ah; | ||
564 | ath5k_hw_set_opmode(ah, sc->opmode); | ||
565 | ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n", | ||
566 | sc->opmode, ath_opmode_to_string(sc->opmode)); | ||
567 | } | ||
568 | |||
569 | static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, | 561 | static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, |
570 | struct ieee80211_vif *vif) | 562 | struct ieee80211_vif *vif) |
571 | { | 563 | { |
@@ -595,7 +587,9 @@ static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, | |||
595 | /* Nothing active, default to station mode */ | 587 | /* Nothing active, default to station mode */ |
596 | sc->opmode = NL80211_IFTYPE_STATION; | 588 | sc->opmode = NL80211_IFTYPE_STATION; |
597 | 589 | ||
598 | ath_do_set_opmode(sc); | 590 | ath5k_hw_set_opmode(sc->ah, sc->opmode); |
591 | ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n", | ||
592 | sc->opmode, ath_opmode_to_string(sc->opmode)); | ||
599 | 593 | ||
600 | if (iter_data.need_set_hw_addr && iter_data.found_active) | 594 | if (iter_data.need_set_hw_addr && iter_data.found_active) |
601 | ath5k_hw_set_lladdr(sc->ah, iter_data.active_mac); | 595 | ath5k_hw_set_lladdr(sc->ah, iter_data.active_mac); |