diff options
| author | Malcolm Priestley <tvboxspy@gmail.com> | 2014-08-10 15:22:00 +0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 23:23:15 +0400 |
| commit | 4a5f718409f92f3bc12ee8020a4874d004f612ba (patch) | |
| tree | 18135797412c0768ebecb28c0b6c380da0658a57 | |
| parent | 989ae8601b28b053d4882ad70ce62420f19f9e91 (diff) | |
| download | linux-4a5f718409f92f3bc12ee8020a4874d004f612ba.tar.xz | |
staging: vt6655: CARDbSetBeaconPeriod call CARDbGetCurrentTSF to get TBTT
There is already a function to get next TBTT.
Replace code with CARDqGetNextTBTT.
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 | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index a5da3d26c36f..931fca8bb471 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -606,29 +606,11 @@ bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, u64 qwBSSTimes bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval) { PSDevice pDevice = (PSDevice) pDeviceHandler; - unsigned int uBeaconInterval = 0; - unsigned int uLowNextTBTT = 0; - unsigned int uHighRemain = 0; - unsigned int uLowRemain = 0; u64 qwNextTBTT = 0; CARDbGetCurrentTSF(pDevice->PortOffset, &qwNextTBTT); //Get Local TSF counter - uBeaconInterval = wBeaconInterval * 1024; - // Next TBTT = ((local_current_TSF / beacon_interval) + 1) * beacon_interval - uLowNextTBTT = ((qwNextTBTT & 0xffffffffULL) >> 10) << 10; - uLowRemain = (uLowNextTBTT) % uBeaconInterval; - // high dword (mod) bcn - uHighRemain = (((0xffffffff % uBeaconInterval) + 1) * (u32)(qwNextTBTT >> 32)) - % uBeaconInterval; - uLowRemain = (uHighRemain + uLowRemain) % uBeaconInterval; - uLowRemain = uBeaconInterval - uLowRemain; - - // check if carry when add one beacon interval - if ((~uLowNextTBTT) < uLowRemain) - qwNextTBTT = ((qwNextTBTT >> 32) + 1) << 32; - - qwNextTBTT = (qwNextTBTT & 0xffffffff00000000ULL) | - (u64)(uLowNextTBTT + uLowRemain); + + qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval); // set HW beacon interval VNSvOutPortW(pDevice->PortOffset + MAC_REG_BI, wBeaconInterval); |
