diff options
author | Ben Greear <greearb@candelatech.com> | 2011-01-15 14:13:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-19 11:36:11 -0500 |
commit | 4801416c76a3a355076d6d371c00270dfe332e1c (patch) | |
tree | e445749a5c5549e1f919e0a9a3f2d5956ae699b5 /drivers/net/wireless/ath/ath9k/beacon.c | |
parent | f0b8220c64242e19f41ad1b4eec3225d53715cbe (diff) |
ath9k: Fix up hardware mode and beacons with multiple vifs.
When using a mixture of AP and Station interfaces,
the hardware mode was using the type of the
last VIF registered. Instead, we should keep track
of the number of different types of vifs and set the
mode accordingly.
In addtion, use the vif type instead of hardware opmode
when dealing with beacons.
Attempt to move some of the common setup code into smaller
methods so we can re-use it when changing vif mode as
well as adding/deleting vifs.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/beacon.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 385ba03134ba..8de591e5b851 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -244,9 +244,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) | |||
244 | struct ath_buf, list); | 244 | struct ath_buf, list); |
245 | list_del(&avp->av_bcbuf->list); | 245 | list_del(&avp->av_bcbuf->list); |
246 | 246 | ||
247 | if (sc->sc_ah->opmode == NL80211_IFTYPE_AP || | 247 | if (ath9k_uses_beacons(vif->type)) { |
248 | sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC || | ||
249 | sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) { | ||
250 | int slot; | 248 | int slot; |
251 | /* | 249 | /* |
252 | * Assign the vif to a beacon xmit slot. As | 250 | * Assign the vif to a beacon xmit slot. As |
@@ -282,7 +280,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) | |||
282 | /* NB: the beacon data buffer must be 32-bit aligned. */ | 280 | /* NB: the beacon data buffer must be 32-bit aligned. */ |
283 | skb = ieee80211_beacon_get(sc->hw, vif); | 281 | skb = ieee80211_beacon_get(sc->hw, vif); |
284 | if (skb == NULL) { | 282 | if (skb == NULL) { |
285 | ath_dbg(common, ATH_DBG_BEACON, "cannot get skb\n"); | 283 | ath_err(common, "ieee80211_beacon_get failed\n"); |
286 | return -ENOMEM; | 284 | return -ENOMEM; |
287 | } | 285 | } |
288 | 286 | ||
@@ -720,10 +718,10 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif) | |||
720 | iftype = sc->sc_ah->opmode; | 718 | iftype = sc->sc_ah->opmode; |
721 | } | 719 | } |
722 | 720 | ||
723 | cur_conf->listen_interval = 1; | 721 | cur_conf->listen_interval = 1; |
724 | cur_conf->dtim_count = 1; | 722 | cur_conf->dtim_count = 1; |
725 | cur_conf->bmiss_timeout = | 723 | cur_conf->bmiss_timeout = |
726 | ATH_DEFAULT_BMISS_LIMIT * cur_conf->beacon_interval; | 724 | ATH_DEFAULT_BMISS_LIMIT * cur_conf->beacon_interval; |
727 | 725 | ||
728 | /* | 726 | /* |
729 | * It looks like mac80211 may end up using beacon interval of zero in | 727 | * It looks like mac80211 may end up using beacon interval of zero in |