Skip to contentSkip to conversation

ath5k: Cleanup opmode setting logic.

PATCH In review [email protected] 2 participants 2 messages Nov 10, 2010 – Nov 11, 2010 Atheros ATH5K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath5k: Cleanup opmode setting logic.

From: Ben Greear <[email protected]>

An earlier review suggested moving the code in a small method that was only called once inline. This patch accomplishes that.

---
:100644 100644 b9f93fb... afd3094... M drivers/net/wireless/ath/ath5k/base.c

 drivers/net/wireless/ath/ath5k/base.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +4 -10
index b9f93fb..afd3094 100644
@@ -549,7 +549,7 @@ static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 	/* Calculate combined mode - when APs are active, operate in AP mode.
 	 * Otherwise use the mode of the new interface. This can currently
 	 * only deal with combinations of APs and STAs. Only one ad-hoc
-	 * interfaces is allowed above.
+	 * interfaces is allowed.
 	 */
 	if (avf->opmode == NL80211_IFTYPE_AP)
 		iter_data->opmode = NL80211_IFTYPE_AP;
@@ -558,14 +558,6 @@ static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
 			iter_data->opmode = avf->opmode;
 }
 
-static void ath_do_set_opmode(struct ath5k_softc *sc)
-{
-	struct ath5k_hw *ah = sc->ah;
-	ath5k_hw_set_opmode(ah, sc->opmode);
-	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
-		  sc->opmode, ath_opmode_to_string(sc->opmode));
-}
-
 static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
 					       struct ieee80211_vif *vif)
 {
@@ -595,7 +587,9 @@ static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
 		/* Nothing active, default to station mode */
 		sc->opmode = NL80211_IFTYPE_STATION;
 
-	ath_do_set_opmode(sc);
+	ath5k_hw_set_opmode(sc->ah, sc->opmode);
+	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
+		  sc->opmode, ath_opmode_to_string(sc->opmode));
 
 	if (iter_data.need_set_hw_addr && iter_data.found_active)
 		ath5k_hw_set_lladdr(sc->ah, iter_data.active_mac);
Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 46 lines · On Thu November 11 2010 04:43:51 [email protected] wrote:

From: Ben Greear <[email protected]>

An earlier review suggested moving the code in a small method that was only called once inline. This patch accomplishes that.

---

:100644 100644 b9f93fb... afd3094...
:M drivers/net/wireless/ath/ath5k/base.c

 drivers/net/wireless/ath/ath5k/base.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
(quoted diff) +0 -0

b/drivers/net/wireless/ath/ath5k/base.c index b9f93fb..afd3094 100644

drivers/net/wireless/ath/ath5k/base.c +0 -0
@@ -549,7 +549,7 @@ static void ath_vif_iter(void *data, u8 *mac, struct
 ieee80211_vif *vif) /* Calculate combined mode - when APs are active,

operate in AP mode. * Otherwise use the mode of the new interface. This can currently * only deal with combinations of APs and STAs. Only one ad-hoc

drivers/net/wireless/ath/ath5k/base.c +1 -9
-	 * interfaces is allowed above.
+	 * interfaces is allowed.
 	 */
 	if (avf->opmode == NL80211_IFTYPE_AP)
 		iter_data->opmode = NL80211_IFTYPE_AP;
@@ -558,14 +558,6 @@ static void ath_vif_iter(void *data, u8 *mac, struct
 ieee80211_vif *vif) iter_data->opmode = avf->opmode;
 }
 
-static void ath_do_set_opmode(struct ath5k_softc *sc)
-{
-	struct ath5k_hw *ah = sc->ah;
-	ath5k_hw_set_opmode(ah, sc->opmode);
-	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
-		  sc->opmode, ath_opmode_to_string(sc->opmode));
-}
-
 static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
 					       struct ieee80211_vif *vif)
 {
@@ -595,7 +587,9 @@ static void ath5k_update_bssid_mask_and_opmode(struct

ath5k_softc *sc, /* Nothing active, default to station mode */

drivers/net/wireless/ath/ath5k/base.c static void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc, · line 595

Quoted 9 lines
drivers/net/wireless/ath/ath5k/base.c +3 -1
 		sc->opmode = NL80211_IFTYPE_STATION;
 
-	ath_do_set_opmode(sc);
+	ath5k_hw_set_opmode(sc->ah, sc->opmode);
+	ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
+		  sc->opmode, ath_opmode_to_string(sc->opmode));
 
 	if (iter_data.need_set_hw_addr && iter_data.found_active)
 		ath5k_hw_set_lladdr(sc->ah, iter_data.active_mac);

Thanks!