/* * Copyright (c) 2010-2011 Atheros Communications Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* * For WIFI Beacon Distribution * Long slot time : 2x cwmin * Short slot time : 4x cwmin
*/ if (ah->slottime == 20)
qi.tqi_cwmin = 2*qi_be.tqi_cwmin; else
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
qi.tqi_cwmax = qi_be.tqi_cwmax;
}
if (!ath9k_hw_set_txq_props(ah, priv->beacon.beaconq, &qi)) {
ath_err(ath9k_hw_common(ah), "Unable to update beacon queue %u!\n", priv->beacon.beaconq);
} else {
ath9k_hw_resettxqueue(ah, priv->beacon.beaconq);
}
}
/* * Both nexttbtt and intval have to be in usecs.
*/ staticvoid ath9k_htc_beacon_init(struct ath9k_htc_priv *priv, struct ath_beacon_config *conf, bool reset_tsf)
{ struct ath_hw *ah = priv->ah; int ret __attribute__ ((unused));
__be32 htc_imask = 0;
u8 cmd_rsp;
if (unlikely(test_bit(ATH_OP_SCANNING, &common->op_flags))) {
spin_unlock_bh(&priv->beacon_lock); return;
}
/* Get a new beacon */
beacon = ieee80211_beacon_get(priv->hw, vif, 0); if (!beacon) {
spin_unlock_bh(&priv->beacon_lock); return;
}
/* * Update the TSF adjust value here, the HW will * add this value for every beacon.
*/
mgmt = (struct ieee80211_mgmt *)beacon->data;
mgmt->u.beacon.timestamp = avp->tsfadjust;
ath_dbg(common, CONFIG, "Removed interface at beacon slot: %d\n",
avp->bslot);
}
/* * Calculate the TSF adjustment value for all slots * other than zero.
*/ void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv, struct ieee80211_vif *vif)
{ struct ath_common *common = ath9k_hw_common(priv->ah); struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv; struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf;
u64 tsfadjust;
if (avp->bslot == 0) return;
/* * The beacon interval cannot be different for multi-AP mode, * and we reach here only for VIF slots greater than zero, * so beacon_interval is guaranteed to be set in cur_conf.
*/
tsfadjust = cur_conf->beacon_interval * avp->bslot / ATH9K_HTC_MAX_BCN_VIF;
avp->tsfadjust = cpu_to_le64(TU_TO_USEC(tsfadjust));
ath_dbg(common, CONFIG, "tsfadjust is: %llu for bslot: %d\n",
(unsignedlonglong)tsfadjust, avp->bslot);
}
/* * Changing the beacon interval when multiple AP interfaces * are configured will affect beacon transmission of all * of them.
*/ if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
(priv->num_ap_vif > 1) &&
(vif->type == NL80211_IFTYPE_AP) &&
(cur_conf->beacon_interval != bss_conf->beacon_int)) {
ath_dbg(common, CONFIG, "Changing beacon interval of multiple AP interfaces !\n"); returnfalse;
}
/* * If the HW is operating in AP mode, any new station interfaces that * are added cannot change the beacon parameters.
*/ if (priv->num_ap_vif &&
(vif->type != NL80211_IFTYPE_AP)) {
ath_dbg(common, CONFIG, "HW in AP mode, cannot set STA beacon parameters\n"); returnfalse;
}
/* * The beacon parameters are configured only for the first * station interface.
*/ if ((priv->ah->opmode == NL80211_IFTYPE_STATION) &&
(priv->num_sta_vif > 1) &&
(vif->type == NL80211_IFTYPE_STATION)) {
beacon_configured = false;
ieee80211_iterate_active_interfaces_atomic(
priv->hw, IEEE80211_IFACE_ITER_RESUME_ALL,
ath9k_htc_beacon_iter, &beacon_configured);
if (beacon_configured) {
ath_dbg(common, CONFIG, "Beacon already configured for a station interface\n"); returnfalse;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.