Commit ea39d1a4 authored by Joerg Albert's avatar Joerg Albert Committed by John W. Linville

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: default avatarJoerg Albert <jal2@gmx.de>
Signed-off-by: default avatarChristian Lamparter <chunkeey@web.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a0bf797f
...@@ -178,6 +178,7 @@ struct ar9170 { ...@@ -178,6 +178,7 @@ struct ar9170 {
/* beaconing */ /* beaconing */
struct sk_buff *beacon; struct sk_buff *beacon;
struct work_struct beacon_work; struct work_struct beacon_work;
bool enable_beacon;
/* cryptographic engine */ /* cryptographic engine */
u64 usedkeys; u64 usedkeys;
......
...@@ -383,24 +383,26 @@ int ar9170_set_beacon_timers(struct ar9170 *ar) ...@@ -383,24 +383,26 @@ int ar9170_set_beacon_timers(struct ar9170 *ar)
if (ar->vif) { if (ar->vif) {
v |= ar->vif->bss_conf.beacon_int; v |= ar->vif->bss_conf.beacon_int;
switch (ar->vif->type) { if (ar->enable_beacon) {
case NL80211_IFTYPE_MESH_POINT: switch (ar->vif->type) {
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_MESH_POINT:
v |= BIT(25); case NL80211_IFTYPE_ADHOC:
break; v |= BIT(25);
case NL80211_IFTYPE_AP: break;
v |= BIT(24); case NL80211_IFTYPE_AP:
pretbtt = (ar->vif->bss_conf.beacon_int - 6) << 16; v |= BIT(24);
break; pretbtt = (ar->vif->bss_conf.beacon_int - 6) <<
default: 16;
break;
default:
break; break;
}
} }
v |= ar->vif->bss_conf.dtim_period << 16; v |= ar->vif->bss_conf.dtim_period << 16;
} }
ar9170_regwrite_begin(ar); ar9170_regwrite_begin(ar);
ar9170_regwrite(AR9170_MAC_REG_PRETBTT, pretbtt); ar9170_regwrite(AR9170_MAC_REG_PRETBTT, pretbtt);
ar9170_regwrite(AR9170_MAC_REG_BCN_PERIOD, v); ar9170_regwrite(AR9170_MAC_REG_BCN_PERIOD, v);
ar9170_regwrite_finish(); ar9170_regwrite_finish();
......
...@@ -2148,11 +2148,17 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2148,11 +2148,17 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
goto out; goto out;
} }
if (changed & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) { if (changed & BSS_CHANGED_BEACON_ENABLED)
ar->enable_beacon = bss_conf->enable_beacon;
if (changed & BSS_CHANGED_BEACON) {
err = ar9170_update_beacon(ar); err = ar9170_update_beacon(ar);
if (err) if (err)
goto out; goto out;
}
if (changed & (BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON |
BSS_CHANGED_BEACON_INT)) {
err = ar9170_set_beacon_timers(ar); err = ar9170_set_beacon_timers(ar);
if (err) if (err)
goto out; goto out;
...@@ -2165,12 +2171,6 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2165,12 +2171,6 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
#endif /* CONFIG_AR9170_LEDS */ #endif /* CONFIG_AR9170_LEDS */
} }
if (changed & BSS_CHANGED_BEACON_INT) {
err = ar9170_set_beacon_timers(ar);
if (err)
goto out;
}
if (changed & BSS_CHANGED_HT) { if (changed & BSS_CHANGED_HT) {
/* TODO */ /* TODO */
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment