Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340898
b: refs/heads/master
c: 750f32c
h: refs/heads/master
v: v3
  • Loading branch information
Sujith Manoharan authored and John W. Linville committed Oct 19, 2012
1 parent 9fd95e1 commit 1f5b341
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78b1775ba03c2edcc8d765dd53a7e171b18e79ac
refs/heads/master: 750f32cf0a6e2a4d798e09da4079ede7d1721e54
27 changes: 18 additions & 9 deletions trunk/drivers/net/wireless/ath/ath9k/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ static void ath_btcoex_period_timer(unsigned long data)
struct ath_softc *sc = (struct ath_softc *) data;
struct ath_hw *ah = sc->sc_ah;
struct ath_btcoex *btcoex = &sc->btcoex;
enum ath_stomp_type stomp_type;
u32 timer_period;
bool is_btscan;
unsigned long flags;

spin_lock_irqsave(&sc->sc_pm_lock, flags);
Expand All @@ -228,19 +228,28 @@ static void ath_btcoex_period_timer(unsigned long data)
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);

ath9k_ps_wakeup(sc);

if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
ath_detect_bt_priority(sc);
is_btscan = test_bit(BT_OP_SCAN, &btcoex->op_flags);

if (ah->caps.hw_caps & ATH9K_HW_CAP_MCI)
ath_mci_ftp_adjust(sc);

spin_lock_bh(&btcoex->btcoex_lock);

ath9k_hw_btcoex_bt_stomp(ah, is_btscan ? ATH_BTCOEX_STOMP_ALL :
btcoex->bt_stomp_type);
stomp_type = btcoex->bt_stomp_type;
timer_period = btcoex->btcoex_no_stomp;

if (!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI)) {
if (test_bit(BT_OP_SCAN, &btcoex->op_flags)) {
stomp_type = ATH_BTCOEX_STOMP_ALL;
timer_period = btcoex->btscan_no_stomp;
}
}

ath9k_hw_btcoex_bt_stomp(ah, stomp_type);
ath9k_hw_btcoex_enable(ah);

spin_unlock_bh(&btcoex->btcoex_lock);

/*
Expand All @@ -252,17 +261,16 @@ static void ath_btcoex_period_timer(unsigned long data)
if (btcoex->hw_timer_enabled)
ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);

timer_period = is_btscan ? btcoex->btscan_no_stomp :
btcoex->btcoex_no_stomp;
ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, timer_period,
timer_period * 10);
btcoex->hw_timer_enabled = true;
}

ath9k_ps_restore(sc);

skip_hw_wakeup:
timer_period = btcoex->btcoex_period;
mod_timer(&btcoex->period_timer, jiffies + msecs_to_jiffies(timer_period));
mod_timer(&btcoex->period_timer,
jiffies + msecs_to_jiffies(btcoex->btcoex_period));
}

/*
Expand All @@ -282,7 +290,8 @@ static void ath_btcoex_no_stomp_timer(void *arg)
spin_lock_bh(&btcoex->btcoex_lock);

if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW ||
test_bit(BT_OP_SCAN, &btcoex->op_flags))
(!(ah->caps.hw_caps & ATH9K_HW_CAP_MCI) &&
test_bit(BT_OP_SCAN, &btcoex->op_flags)))
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE);
else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL)
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_LOW);
Expand Down

0 comments on commit 1f5b341

Please sign in to comment.