summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/common-beacon.c
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2015-11-27 09:37:18 +0100
committerKalle Valo <kvalo@qca.qualcomm.com>2015-12-08 16:51:05 +0200
commit05a85a6c42b59cd97d49314ad3d1939039eb9aee (patch)
tree2f75351967558d78b3b744b898f365eb0ec5ded3 /drivers/net/wireless/ath/ath9k/common-beacon.c
parent02edab5b5f82fcb35696b2606e840a3ec87d7954 (diff)
downloadblackbird-op-linux-05a85a6c42b59cd97d49314ad3d1939039eb9aee.tar.gz
blackbird-op-linux-05a85a6c42b59cd97d49314ad3d1939039eb9aee.zip
ath9k: remove ath9k_mod_tsf64_tu
Remove ath9k_mod_tsf64_tu() function while we could use div_u64_rem() function. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/common-beacon.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/common-beacon.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-beacon.c b/drivers/net/wireless/ath/ath9k/common-beacon.c
index 6ad44470d0f2..01d6d3205a65 100644
--- a/drivers/net/wireless/ath/ath9k/common-beacon.c
+++ b/drivers/net/wireless/ath/ath9k/common-beacon.c
@@ -18,30 +18,16 @@
#define FUDGE 2
-/* Calculate the modulo of a 64 bit TSF snapshot with a TU divisor */
-static u32 ath9k_mod_tsf64_tu(u64 tsf, u32 div_tu)
-{
- u32 tsf_mod, tsf_hi, tsf_lo, mod_hi, mod_lo;
-
- tsf_mod = tsf & (BIT(10) - 1);
- tsf_hi = tsf >> 32;
- tsf_lo = ((u32) tsf) >> 10;
-
- mod_hi = tsf_hi % div_tu;
- mod_lo = ((mod_hi << 22) + tsf_lo) % div_tu;
-
- return (mod_lo << 10) | tsf_mod;
-}
-
static u32 ath9k_get_next_tbtt(struct ath_hw *ah, u64 tsf,
unsigned int interval)
{
- unsigned int offset;
+ unsigned int offset, divisor;
tsf += TU_TO_USEC(FUDGE + ah->config.sw_beacon_response_time);
- offset = ath9k_mod_tsf64_tu(tsf, interval);
+ divisor = TU_TO_USEC(interval);
+ div_u64_rem(tsf, divisor, &offset);
- return (u32) tsf + TU_TO_USEC(interval) - offset;
+ return (u32) tsf + divisor - offset;
}
/*
OpenPOWER on IntegriCloud