|
@@ -234,6 +234,7 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
|
|
|
struct tx_beacon_header beacon_hdr;
|
|
|
struct ath9k_htc_tx_ctl tx_ctl;
|
|
|
struct ieee80211_tx_info *info;
|
|
|
+ struct ieee80211_mgmt *mgmt;
|
|
|
struct sk_buff *beacon;
|
|
|
u8 *tx_fhdr;
|
|
|
|
|
@@ -257,6 +258,13 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
|
|
|
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;
|
|
|
+
|
|
|
info = IEEE80211_SKB_CB(beacon);
|
|
|
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
|
|
|
struct ieee80211_hdr *hdr =
|
|
@@ -406,6 +414,34 @@ void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
|
|
|
"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 htc_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, ATH_DBG_CONFIG,
|
|
|
+ "tsfadjust is: %llu for bslot: %d\n",
|
|
|
+ (unsigned long long)tsfadjust, avp->bslot);
|
|
|
+}
|
|
|
+
|
|
|
static void ath9k_htc_beacon_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
|
|
|
{
|
|
|
bool *beacon_configured = (bool *)data;
|