]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ath9k: move ath9k_beacon_config_adhoc to common
authorOleksij Rempel <linux@rempel-privat.de>
Sat, 1 Mar 2014 20:15:58 +0000 (21:15 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Mar 2014 17:13:07 +0000 (13:13 -0400)
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/common-beacon.c
drivers/net/wireless/ath/ath9k/common-beacon.h

index 9333fa1c031f39e86dfaba8612baa33bf64b9397..01322a41e0fc53bc2580e348e1997239a953e375 100644 (file)
@@ -526,29 +526,12 @@ static void ath9k_beacon_config_adhoc(struct ath_softc *sc,
 {
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
-       u32 intval, nexttbtt;
 
        ath9k_reset_beacon_status(sc);
 
-       intval = TU_TO_USEC(conf->beacon_interval);
-
-       if (conf->ibss_creator)
-               nexttbtt = intval;
-       else
-               nexttbtt = ath9k_get_next_tbtt(sc, ath9k_hw_gettsf64(ah),
-                                              conf->beacon_interval);
-
-       if (conf->enable_beacon)
-               ah->imask |= ATH9K_INT_SWBA;
-       else
-               ah->imask &= ~ATH9K_INT_SWBA;
-
-       ath_dbg(common, BEACON,
-               "IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n",
-               (conf->enable_beacon) ? "Enable" : "Disable",
-               nexttbtt, intval, conf->beacon_interval);
+       ath9k_cmn_beacon_config_adhoc(ah, conf);
 
-       ath9k_beacon_init(sc, nexttbtt, intval, conf->ibss_creator);
+       ath9k_beacon_init(sc, conf->nexttbtt, conf->intval, conf->ibss_creator);
 
        /*
         * Set the global 'beacon has been configured' flag for the
index 35cc9fddfb3538f5865f711ae44a0ad8bcc49fc7..45bc899cbeb0d97e759329c4322aaa185dff5486 100644 (file)
@@ -124,3 +124,28 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
        return 0;
 }
 EXPORT_SYMBOL(ath9k_cmn_beacon_config_sta);
+
+void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah,
+                                  struct ath_beacon_config *conf)
+{
+       struct ath_common *common = ath9k_hw_common(ah);
+
+       conf->intval = TU_TO_USEC(conf->beacon_interval);
+
+       if (conf->ibss_creator)
+               conf->nexttbtt = conf->intval;
+       else
+               conf->nexttbtt = ath9k_get_next_tbtt(ah, ath9k_hw_gettsf64(ah),
+                                              conf->beacon_interval);
+
+       if (conf->enable_beacon)
+               ah->imask |= ATH9K_INT_SWBA;
+       else
+               ah->imask &= ~ATH9K_INT_SWBA;
+
+       ath_dbg(common, BEACON,
+               "IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n",
+               (conf->enable_beacon) ? "Enable" : "Disable",
+               conf->nexttbtt, conf->intval, conf->beacon_interval);
+}
+EXPORT_SYMBOL(ath9k_cmn_beacon_config_adhoc);
index 51cbcb5c4b9f9dc1ae71085dd0415b6b0122c73b..d8e7c0db08a98f48b8be94e0388785e2a95e16a1 100644 (file)
@@ -19,3 +19,5 @@ struct ath_beacon_config;
 int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
                                struct ath_beacon_config *conf,
                                struct ath9k_beacon_state *bs);
+void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah,
+                                  struct ath_beacon_config *conf);