aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_main.c
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-02-20 21:19:53 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-23 16:25:28 -0500
commita5fae37d118bb633708b2787e53871e38bf3b15e (patch)
treed09d61f5dce40c260dbd54dfb968de9671b26e3f /drivers/net/wireless/ath/ath9k/htc_drv_main.c
parenta236254c35f04a4d47c701ed3ec4a0b5dcb097b0 (diff)
ath9k_htc: Configure beacon timers in AP mode
Handle multi-interface situations by checking if AP interfaces are already present. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index f384b358b48..7367d6c1c64 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -110,6 +110,9 @@ static void ath9k_htc_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
110 struct ath9k_htc_priv *priv = data; 110 struct ath9k_htc_priv *priv = data;
111 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 111 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
112 112
113 if ((vif->type == NL80211_IFTYPE_AP) && bss_conf->enable_beacon)
114 priv->reconfig_beacon = true;
115
113 if (bss_conf->assoc) { 116 if (bss_conf->assoc) {
114 priv->rearm_ani = true; 117 priv->rearm_ani = true;
115 priv->reconfig_beacon = true; 118 priv->reconfig_beacon = true;
@@ -288,6 +291,11 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
288 goto err; 291 goto err;
289 292
290 htc_start(priv->htc); 293 htc_start(priv->htc);
294
295 if (!(priv->op_flags & OP_SCANNING) &&
296 !(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL))
297 ath9k_htc_vif_reconfig(priv);
298
291err: 299err:
292 ath9k_htc_ps_restore(priv); 300 ath9k_htc_ps_restore(priv);
293 return ret; 301 return ret;
@@ -1620,17 +1628,40 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
1620 common->curbssid, common->curaid); 1628 common->curbssid, common->curaid);
1621 } 1629 }
1622 1630
1623 if ((changed & BSS_CHANGED_BEACON_INT) || 1631 if ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon) {
1624 (changed & BSS_CHANGED_BEACON) || 1632 ath_dbg(common, ATH_DBG_CONFIG,
1625 ((changed & BSS_CHANGED_BEACON_ENABLED) && 1633 "Beacon enabled for BSS: %pM\n", bss_conf->bssid);
1626 bss_conf->enable_beacon)) {
1627 priv->op_flags |= OP_ENABLE_BEACON; 1634 priv->op_flags |= OP_ENABLE_BEACON;
1628 ath9k_htc_beacon_config(priv, vif); 1635 ath9k_htc_beacon_config(priv, vif);
1629 } 1636 }
1630 1637
1631 if ((changed & BSS_CHANGED_BEACON_ENABLED) && 1638 if ((changed & BSS_CHANGED_BEACON_ENABLED) && !bss_conf->enable_beacon) {
1632 !bss_conf->enable_beacon) { 1639 /*
1633 priv->op_flags &= ~OP_ENABLE_BEACON; 1640 * Disable SWBA interrupt only if there are no
1641 * AP/IBSS interfaces.
1642 */
1643 if ((priv->num_ap_vif <= 1) || priv->num_ibss_vif) {
1644 ath_dbg(common, ATH_DBG_CONFIG,
1645 "Beacon disabled for BSS: %pM\n",
1646 bss_conf->bssid);
1647 priv->op_flags &= ~OP_ENABLE_BEACON;
1648 ath9k_htc_beacon_config(priv, vif);
1649 }
1650 }
1651
1652 if (changed & BSS_CHANGED_BEACON_INT) {
1653 /*
1654 * Reset the HW TSF for the first AP interface.
1655 */
1656 if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
1657 (priv->nvifs == 1) &&
1658 (priv->num_ap_vif == 1) &&
1659 (vif->type == NL80211_IFTYPE_AP)) {
1660 priv->op_flags |= OP_TSF_RESET;
1661 }
1662 ath_dbg(common, ATH_DBG_CONFIG,
1663 "Beacon interval changed for BSS: %pM\n",
1664 bss_conf->bssid);
1634 ath9k_htc_beacon_config(priv, vif); 1665 ath9k_htc_beacon_config(priv, vif);
1635 } 1666 }
1636 1667