aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2014-03-01 15:15:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-03-17 13:13:07 -0400
commit4c9a1f32600b9181558737dede31403c1ca05291 (patch)
tree9b10247f5e64da9dd4a74842fa355838f6e93951 /drivers/net
parentf84224402bddea8e2762869f4eaebc3b46be2aa0 (diff)
ath9k: move ath9k_beacon_config_adhoc to common
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c21
-rw-r--r--drivers/net/wireless/ath/ath9k/common-beacon.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/common-beacon.h2
3 files changed, 29 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 9333fa1c031f..01322a41e0fc 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -526,29 +526,12 @@ static void ath9k_beacon_config_adhoc(struct ath_softc *sc,
526{ 526{
527 struct ath_hw *ah = sc->sc_ah; 527 struct ath_hw *ah = sc->sc_ah;
528 struct ath_common *common = ath9k_hw_common(ah); 528 struct ath_common *common = ath9k_hw_common(ah);
529 u32 intval, nexttbtt;
530 529
531 ath9k_reset_beacon_status(sc); 530 ath9k_reset_beacon_status(sc);
532 531
533 intval = TU_TO_USEC(conf->beacon_interval); 532 ath9k_cmn_beacon_config_adhoc(ah, conf);
534
535 if (conf->ibss_creator)
536 nexttbtt = intval;
537 else
538 nexttbtt = ath9k_get_next_tbtt(sc, ath9k_hw_gettsf64(ah),
539 conf->beacon_interval);
540
541 if (conf->enable_beacon)
542 ah->imask |= ATH9K_INT_SWBA;
543 else
544 ah->imask &= ~ATH9K_INT_SWBA;
545
546 ath_dbg(common, BEACON,
547 "IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n",
548 (conf->enable_beacon) ? "Enable" : "Disable",
549 nexttbtt, intval, conf->beacon_interval);
550 533
551 ath9k_beacon_init(sc, nexttbtt, intval, conf->ibss_creator); 534 ath9k_beacon_init(sc, conf->nexttbtt, conf->intval, conf->ibss_creator);
552 535
553 /* 536 /*
554 * Set the global 'beacon has been configured' flag for the 537 * Set the global 'beacon has been configured' flag for the
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.c b/drivers/net/wireless/ath/ath9k/common-beacon.c
index 35cc9fddfb35..45bc899cbeb0 100644
--- a/drivers/net/wireless/ath/ath9k/common-beacon.c
+++ b/drivers/net/wireless/ath/ath9k/common-beacon.c
@@ -124,3 +124,28 @@ int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
124 return 0; 124 return 0;
125} 125}
126EXPORT_SYMBOL(ath9k_cmn_beacon_config_sta); 126EXPORT_SYMBOL(ath9k_cmn_beacon_config_sta);
127
128void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah,
129 struct ath_beacon_config *conf)
130{
131 struct ath_common *common = ath9k_hw_common(ah);
132
133 conf->intval = TU_TO_USEC(conf->beacon_interval);
134
135 if (conf->ibss_creator)
136 conf->nexttbtt = conf->intval;
137 else
138 conf->nexttbtt = ath9k_get_next_tbtt(ah, ath9k_hw_gettsf64(ah),
139 conf->beacon_interval);
140
141 if (conf->enable_beacon)
142 ah->imask |= ATH9K_INT_SWBA;
143 else
144 ah->imask &= ~ATH9K_INT_SWBA;
145
146 ath_dbg(common, BEACON,
147 "IBSS (%s) nexttbtt: %u intval: %u conf_intval: %u\n",
148 (conf->enable_beacon) ? "Enable" : "Disable",
149 conf->nexttbtt, conf->intval, conf->beacon_interval);
150}
151EXPORT_SYMBOL(ath9k_cmn_beacon_config_adhoc);
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.h b/drivers/net/wireless/ath/ath9k/common-beacon.h
index 51cbcb5c4b9f..d8e7c0db08a9 100644
--- a/drivers/net/wireless/ath/ath9k/common-beacon.h
+++ b/drivers/net/wireless/ath/ath9k/common-beacon.h
@@ -19,3 +19,5 @@ struct ath_beacon_config;
19int ath9k_cmn_beacon_config_sta(struct ath_hw *ah, 19int ath9k_cmn_beacon_config_sta(struct ath_hw *ah,
20 struct ath_beacon_config *conf, 20 struct ath_beacon_config *conf,
21 struct ath9k_beacon_state *bs); 21 struct ath9k_beacon_state *bs);
22void ath9k_cmn_beacon_config_adhoc(struct ath_hw *ah,
23 struct ath_beacon_config *conf);