-void tally_update(void)
-{
- unsigned int time;
-
-#ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
- unsigned int main_not_free, ext_not_free;
-
- main_not_free = get(AR9170_MAC_REG_CHANNEL_BUSY);
- ext_not_free = get(AR9170_MAC_REG_EXT_BUSY);
- time = get_clock_counter();
-
- if (fw.phy.state == CARL9170_PHY_ON) {
- unsigned int us_delta = (time - fw.tally_clock) / max(fw.ticks_per_usec, 40u);
-
- fw.tally.active += us_delta;
- fw.tally.main_free += main_not_free;
- fw.tally.ext_free += ext_not_free;
- }
-#else
- time = get_clock_counter();
-
-#endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
-
- fw.tally_clock = time;
-}
-