aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoerg Albert <jal2@gmx.de>2009-08-21 17:25:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:41 -0400
commitea39d1a4027cca99cc75126f574633c3b72da04a (patch)
treea6b831d1a6568aca80c4b91ba8b7a8802f11bace /drivers
parenta0bf797ff10cdbc15e8abe1309e7ab397f61691f (diff)
ar9170: cleanup of bss_info_changed and beacon config
Add beacon control by BSS_CHANGED_BEACON_ENABLED and bss_conf->enable_beacon from mac80211. Signed-off-by: Joerg Albert <jal2@gmx.de> Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ar9170/ar9170.h1
-rw-r--r--drivers/net/wireless/ath/ar9170/mac.c24
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c14
3 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
index ce407248d7d8..914e4718a9a8 100644
--- a/drivers/net/wireless/ath/ar9170/ar9170.h
+++ b/drivers/net/wireless/ath/ar9170/ar9170.h
@@ -178,6 +178,7 @@ struct ar9170 {
178 /* beaconing */ 178 /* beaconing */
179 struct sk_buff *beacon; 179 struct sk_buff *beacon;
180 struct work_struct beacon_work; 180 struct work_struct beacon_work;
181 bool enable_beacon;
181 182
182 /* cryptographic engine */ 183 /* cryptographic engine */
183 u64 usedkeys; 184 u64 usedkeys;
diff --git a/drivers/net/wireless/ath/ar9170/mac.c b/drivers/net/wireless/ath/ar9170/mac.c
index 60049366e863..614e3218a2bc 100644
--- a/drivers/net/wireless/ath/ar9170/mac.c
+++ b/drivers/net/wireless/ath/ar9170/mac.c
@@ -383,24 +383,26 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
383 if (ar->vif) { 383 if (ar->vif) {
384 v |= ar->vif->bss_conf.beacon_int; 384 v |= ar->vif->bss_conf.beacon_int;
385 385
386 switch (ar->vif->type) { 386 if (ar->enable_beacon) {
387 case NL80211_IFTYPE_MESH_POINT: 387 switch (ar->vif->type) {
388 case NL80211_IFTYPE_ADHOC: 388 case NL80211_IFTYPE_MESH_POINT:
389 v |= BIT(25); 389 case NL80211_IFTYPE_ADHOC:
390 break; 390 v |= BIT(25);
391 case NL80211_IFTYPE_AP: 391 break;
392 v |= BIT(24); 392 case NL80211_IFTYPE_AP:
393 pretbtt = (ar->vif->bss_conf.beacon_int - 6) << 16; 393 v |= BIT(24);
394 break; 394 pretbtt = (ar->vif->bss_conf.beacon_int - 6) <<
395 default: 395 16;
396 break;
397 default:
396 break; 398 break;
399 }
397 } 400 }
398 401
399 v |= ar->vif->bss_conf.dtim_period << 16; 402 v |= ar->vif->bss_conf.dtim_period << 16;
400 } 403 }
401 404
402 ar9170_regwrite_begin(ar); 405 ar9170_regwrite_begin(ar);
403
404 ar9170_regwrite(AR9170_MAC_REG_PRETBTT, pretbtt); 406 ar9170_regwrite(AR9170_MAC_REG_PRETBTT, pretbtt);
405 ar9170_regwrite(AR9170_MAC_REG_BCN_PERIOD, v); 407 ar9170_regwrite(AR9170_MAC_REG_BCN_PERIOD, v);
406 ar9170_regwrite_finish(); 408 ar9170_regwrite_finish();
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 658b32312caf..c0fc3554c924 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2148,11 +2148,17 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
2148 goto out; 2148 goto out;
2149 } 2149 }
2150 2150
2151 if (changed & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) { 2151 if (changed & BSS_CHANGED_BEACON_ENABLED)
2152 ar->enable_beacon = bss_conf->enable_beacon;
2153
2154 if (changed & BSS_CHANGED_BEACON) {
2152 err = ar9170_update_beacon(ar); 2155 err = ar9170_update_beacon(ar);
2153 if (err) 2156 if (err)
2154 goto out; 2157 goto out;
2158 }
2155 2159
2160 if (changed & (BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON |
2161 BSS_CHANGED_BEACON_INT)) {
2156 err = ar9170_set_beacon_timers(ar); 2162 err = ar9170_set_beacon_timers(ar);
2157 if (err) 2163 if (err)
2158 goto out; 2164 goto out;
@@ -2165,12 +2171,6 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
2165#endif /* CONFIG_AR9170_LEDS */ 2171#endif /* CONFIG_AR9170_LEDS */
2166 } 2172 }
2167 2173
2168 if (changed & BSS_CHANGED_BEACON_INT) {
2169 err = ar9170_set_beacon_timers(ar);
2170 if (err)
2171 goto out;
2172 }
2173
2174 if (changed & BSS_CHANGED_HT) { 2174 if (changed & BSS_CHANGED_HT) {
2175 /* TODO */ 2175 /* TODO */
2176 err = 0; 2176 err = 0;