diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2015-04-21 17:33:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 08:35:22 -0400 |
commit | 032ed34a84263cdb396e4318fed6a92ed50add26 (patch) | |
tree | c725b36254a522ece47a83428df454eef60715ab | |
parent | d65d2b25d2761153390df8026cca1a528d9b6c5a (diff) |
staging: vt6655: CARDbUpdateTSF bss timestamp correct tsf counter value.
The TSF counter is not set correctly.
Use sync_tsf for last beacon value and get tsf local value.
Remove qwLocalTSF variable and call CARDbGetCurrentTSF.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6655/card.c | 10 | ||||
-rw-r--r-- | drivers/staging/vt6655/card.h | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 1cdcf49b2445..e00c0605d154 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c | |||
@@ -362,12 +362,16 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, u8 bb_type) | |||
362 | * Return Value: none | 362 | * Return Value: none |
363 | */ | 363 | */ |
364 | bool CARDbUpdateTSF(struct vnt_private *pDevice, unsigned char byRxRate, | 364 | bool CARDbUpdateTSF(struct vnt_private *pDevice, unsigned char byRxRate, |
365 | u64 qwBSSTimestamp, u64 qwLocalTSF) | 365 | u64 qwBSSTimestamp) |
366 | { | 366 | { |
367 | u64 local_tsf; | ||
367 | u64 qwTSFOffset = 0; | 368 | u64 qwTSFOffset = 0; |
368 | 369 | ||
369 | if (qwBSSTimestamp != qwLocalTSF) { | 370 | CARDbGetCurrentTSF(pDevice, &local_tsf); |
370 | qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, qwLocalTSF); | 371 | |
372 | if (qwBSSTimestamp != local_tsf) { | ||
373 | qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, | ||
374 | local_tsf); | ||
371 | /* adjust TSF, HW's TSF add TSF Offset reg */ | 375 | /* adjust TSF, HW's TSF add TSF Offset reg */ |
372 | VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST, (u32)qwTSFOffset); | 376 | VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST, (u32)qwTSFOffset); |
373 | VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST + 4, (u32)(qwTSFOffset >> 32)); | 377 | VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST + 4, (u32)(qwTSFOffset >> 32)); |
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h index 2dfc41952271..16cca49e680a 100644 --- a/drivers/staging/vt6655/card.h +++ b/drivers/staging/vt6655/card.h | |||
@@ -83,7 +83,7 @@ bool CARDbRadioPowerOff(struct vnt_private *); | |||
83 | bool CARDbRadioPowerOn(struct vnt_private *); | 83 | bool CARDbRadioPowerOn(struct vnt_private *); |
84 | bool CARDbSetPhyParameter(struct vnt_private *, u8); | 84 | bool CARDbSetPhyParameter(struct vnt_private *, u8); |
85 | bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate, | 85 | bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate, |
86 | u64 qwBSSTimestamp, u64 qwLocalTSF); | 86 | u64 qwBSSTimestamp); |
87 | bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval); | 87 | bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval); |
88 | 88 | ||
89 | #endif /* __CARD_H__ */ | 89 | #endif /* __CARD_H__ */ |
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 930bbbebc102..b3860477eceb 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c | |||
@@ -1478,7 +1478,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, | |||
1478 | if (changed & BSS_CHANGED_ASSOC && priv->op_mode != NL80211_IFTYPE_AP) { | 1478 | if (changed & BSS_CHANGED_ASSOC && priv->op_mode != NL80211_IFTYPE_AP) { |
1479 | if (conf->assoc) { | 1479 | if (conf->assoc) { |
1480 | CARDbUpdateTSF(priv, conf->beacon_rate->hw_value, | 1480 | CARDbUpdateTSF(priv, conf->beacon_rate->hw_value, |
1481 | conf->sync_device_ts, conf->sync_tsf); | 1481 | conf->sync_tsf); |
1482 | 1482 | ||
1483 | CARDbSetBeaconPeriod(priv, conf->beacon_int); | 1483 | CARDbSetBeaconPeriod(priv, conf->beacon_int); |
1484 | 1484 | ||