diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2015-09-27 09:17:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-29 04:19:53 +0200 |
commit | c15158797df6c36780bd07252eb079ff4c9d1706 (patch) | |
tree | 6627b28169608afd8014d7dbe8128d5e3a5155df /drivers/staging/vt6656 | |
parent | 113d6dc18e5e9334493a0f500c01a9e97796cd9b (diff) | |
download | linux-c15158797df6c36780bd07252eb079ff4c9d1706.tar.gz linux-c15158797df6c36780bd07252eb079ff4c9d1706.tar.bz2 linux-c15158797df6c36780bd07252eb079ff4c9d1706.zip |
staging: vt6656: implement TSF counter
The TSF counter is presently unused on driver in infrastructure mode.
It is needed to implement power saving functions and wireless stats that
are passed in interrupt handling.
Ensuring counter is synced with access point beacon.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index af572d718135..7246c7607361 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -757,6 +757,26 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, vnt_mac_reg_bits_off(priv, MAC_REG_TCR, TCR_AUTOBCNTX); } } + + if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INFO) && + priv->op_mode != NL80211_IFTYPE_AP) { + if (conf->assoc && conf->beacon_rate) { + vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL, + TFTCTL_TSFCNTREN); + + vnt_adjust_tsf(priv, conf->beacon_rate->hw_value, + conf->sync_tsf, priv->current_tsf); + + vnt_mac_set_beacon_interval(priv, conf->beacon_int); + + vnt_reset_next_tbtt(priv, conf->beacon_int); + } else { + vnt_clear_current_tsf(priv); + + vnt_mac_reg_bits_off(priv, MAC_REG_TFTCTL, + TFTCTL_TSFCNTREN); + } + } } static u64 vnt_prepare_multicast(struct ieee80211_hw *hw, |