ath9k: Fix BTCOEX timer triggering comparision
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tue, 4 Sep 2012 14:03:33 +0000 (19:33 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 11 Sep 2012 19:13:51 +0000 (15:13 -0400)
Its more correct to convert btcoex_period to 'us' while
comparing with btcoex_no_stomp which is in 'us'.
Did not find any functionality issues being fixed,
as the generic hardware timer triggers are usually
refreshed with the newer duty cycle.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/gpio.c

index 7373e4b92c92f6396380e2910f5cce1f6ec2b71f..2bb89b1a733b72095df4c054d7eacf2c048fd0a6 100644 (file)
@@ -473,7 +473,7 @@ struct ath_btcoex {
        unsigned long op_flags;
        int bt_stomp_type; /* Types of BT stomping */
        u32 btcoex_no_stomp; /* in usec */
-       u32 btcoex_period; /* in usec */
+       u32 btcoex_period; /* in msec */
        u32 btscan_no_stomp; /* in usec */
        u32 duty_cycle;
        u32 bt_wait_time;
index 9f83f71742a5ecb774f95c3d563f2e0dc7d37ab7..5046ca4e30a8adac40f1c7ef184cbe93d391886b 100644 (file)
@@ -228,7 +228,12 @@ static void ath_btcoex_period_timer(unsigned long data)
        ath9k_hw_btcoex_enable(ah);
        spin_unlock_bh(&btcoex->btcoex_lock);
 
-       if (btcoex->btcoex_period != btcoex->btcoex_no_stomp) {
+       /*
+        * btcoex_period is in msec while (btocex/btscan_)no_stomp are in usec,
+        * ensure that we properly convert btcoex_period to usec
+        * for any comparision with (btcoex/btscan_)no_stomp.
+        */
+       if (btcoex->btcoex_period * 1000 != btcoex->btcoex_no_stomp) {
                if (btcoex->hw_timer_enabled)
                        ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);