Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Malcolm Priestley and committed by
Greg Kroah-Hartman
032ed34a d65d2b25

+9 -5
+7 -3
drivers/staging/vt6655/card.c
··· 362 362 * Return Value: none 363 363 */ 364 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 368 u64 qwTSFOffset = 0; 368 369 369 - if (qwBSSTimestamp != qwLocalTSF) { 370 - qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, qwLocalTSF); 370 + CARDbGetCurrentTSF(pDevice, &local_tsf); 371 + 372 + if (qwBSSTimestamp != local_tsf) { 373 + qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp, 374 + local_tsf); 371 375 /* adjust TSF, HW's TSF add TSF Offset reg */ 372 376 VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST, (u32)qwTSFOffset); 373 377 VNSvOutPortD(pDevice->PortOffset + MAC_REG_TSFOFST + 4, (u32)(qwTSFOffset >> 32));
+1 -1
drivers/staging/vt6655/card.h
··· 83 83 bool CARDbRadioPowerOn(struct vnt_private *); 84 84 bool CARDbSetPhyParameter(struct vnt_private *, u8); 85 85 bool CARDbUpdateTSF(struct vnt_private *, unsigned char byRxRate, 86 - u64 qwBSSTimestamp, u64 qwLocalTSF); 86 + u64 qwBSSTimestamp); 87 87 bool CARDbSetBeaconPeriod(struct vnt_private *, unsigned short wBeaconInterval); 88 88 89 89 #endif /* __CARD_H__ */
+1 -1
drivers/staging/vt6655/device_main.c
··· 1478 1478 if (changed & BSS_CHANGED_ASSOC && priv->op_mode != NL80211_IFTYPE_AP) { 1479 1479 if (conf->assoc) { 1480 1480 CARDbUpdateTSF(priv, conf->beacon_rate->hw_value, 1481 - conf->sync_device_ts, conf->sync_tsf); 1481 + conf->sync_tsf); 1482 1482 1483 1483 CARDbSetBeaconPeriod(priv, conf->beacon_int); 1484 1484