aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1211rw/zd_chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_chip.c')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index f1519143f8a6..2c813d87092c 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -1616,3 +1616,24 @@ int zd_chip_set_multicast_hash(struct zd_chip *chip,
1616 1616
1617 return zd_iowrite32a(chip, ioreqs, ARRAY_SIZE(ioreqs)); 1617 return zd_iowrite32a(chip, ioreqs, ARRAY_SIZE(ioreqs));
1618} 1618}
1619
1620u64 zd_chip_get_tsf(struct zd_chip *chip)
1621{
1622 int r;
1623 static const zd_addr_t aw_pt_bi_addr[] =
1624 { CR_TSF_LOW_PART, CR_TSF_HIGH_PART };
1625 u32 values[2];
1626 u64 tsf;
1627
1628 mutex_lock(&chip->mutex);
1629 r = zd_ioread32v_locked(chip, values, (const zd_addr_t *)aw_pt_bi_addr,
1630 ARRAY_SIZE(aw_pt_bi_addr));
1631 mutex_unlock(&chip->mutex);
1632 if (r)
1633 return 0;
1634
1635 tsf = values[1];
1636 tsf = (tsf << 32) | values[0];
1637
1638 return tsf;
1639}