Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 246950
b: refs/heads/master
c: 8e22ad3
h: refs/heads/master
v: v3
  • Loading branch information
Rajkumar Manoharan authored and John W. Linville committed Apr 19, 2011
1 parent 35a8745 commit 23a60d1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dcf55fb5d43bd82e1e3bf94f065cfe8f75a4bc5a
refs/heads/master: 8e22ad323fb5b7cefb572bd8730e3abef95cdf90
36 changes: 22 additions & 14 deletions trunk/drivers/net/wireless/ath/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,34 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
ath_set_beacon(sc);
}

static bool ath_has_valid_bslot(struct ath_softc *sc)
{
struct ath_vif *avp;
int slot;
bool found = false;

for (slot = 0; slot < ATH_BCBUF; slot++) {
if (sc->beacon.bslot[slot]) {
avp = (void *)sc->beacon.bslot[slot]->drv_priv;
if (avp->is_bslot_active) {
found = true;
break;
}
}
}
return found;
}


void ath_set_beacon(struct ath_softc *sc)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;

switch (sc->sc_ah->opmode) {
case NL80211_IFTYPE_AP:
ath_beacon_config_ap(sc, cur_conf);
if (ath_has_valid_bslot(sc))
ath_beacon_config_ap(sc, cur_conf);
break;
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
Expand All @@ -780,20 +800,8 @@ void ath_set_beacon(struct ath_softc *sc)
void ath9k_set_beaconing_status(struct ath_softc *sc, bool status)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_vif *avp;
int slot;
bool found = false;

for (slot = 0; slot < ATH_BCBUF; slot++) {
if (sc->beacon.bslot[slot]) {
avp = (void *)sc->beacon.bslot[slot]->drv_priv;
if (avp->is_bslot_active) {
found = true;
break;
}
}
}
if (!found)
if (!ath_has_valid_bslot(sc))
return;

ath9k_ps_wakeup(sc);
Expand Down

0 comments on commit 23a60d1

Please sign in to comment.