Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170507
b: refs/heads/master
c: 269ad81
h: refs/heads/master
i:
  170505: ccf0fd7
  170503: bbf65e7
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 7, 2009
1 parent 16d1d35 commit bb368fd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 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: 766ec4a9a813ae262b61842020f150f865c1b10a
refs/heads/master: 269ad8120b2e1f01a7bcea4bdb175142a0e62171
43 changes: 21 additions & 22 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,47 +1332,48 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
}
}

static void ath_btcoex_set_weight(struct ath_btcoex_hw *btcoex_hw,
u32 bt_weight,
u32 wlan_weight)
static void ath9k_hw_btcoex_set_weight(struct ath_hw *ah,
u32 bt_weight,
u32 wlan_weight)
{
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;

btcoex_hw->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) |
SM(wlan_weight, AR_BTCOEX_WL_WGHT);
SM(wlan_weight, AR_BTCOEX_WL_WGHT);
}

static void ath9k_hw_btcoex_init_weight(struct ath_hw *ah)
{
ath_btcoex_set_weight(&ah->btcoex_hw, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, AR_STOMP_LOW_WLAN_WGHT);
}

/*
* Configures appropriate weight based on stomp type.
*/
static void ath_btcoex_bt_stomp(struct ath_softc *sc,
struct ath_btcoex_hw *btcoex_hw,
int stomp_type)
static void ath9k_btcoex_bt_stomp(struct ath_softc *sc,
enum ath_stomp_type stomp_type)
{
struct ath_hw *ah = sc->sc_ah;

switch (stomp_type) {
case ATH_BTCOEX_STOMP_ALL:
ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
AR_STOMP_ALL_WLAN_WGHT);
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_ALL_WLAN_WGHT);
break;
case ATH_BTCOEX_STOMP_LOW:
ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_LOW_WLAN_WGHT);
break;
case ATH_BTCOEX_STOMP_NONE:
ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
AR_STOMP_NONE_WLAN_WGHT);
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
AR_STOMP_NONE_WLAN_WGHT);
break;
default:
DPRINTF(sc->sc_ah, ATH_DBG_BTCOEX, "Invalid Stomptype\n");
DPRINTF(ah, ATH_DBG_BTCOEX, "Invalid Stomptype\n");
break;
}

ath9k_hw_btcoex_enable(sc->sc_ah);
ath9k_hw_btcoex_enable(ah);
}

/*
Expand All @@ -1385,13 +1386,12 @@ 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;
struct ath_btcoex_hw *btcoex_hw= &ah->btcoex_hw;

ath_detect_bt_priority(sc);

spin_lock_bh(&btcoex->btcoex_lock);

ath_btcoex_bt_stomp(sc, btcoex_hw, btcoex->bt_stomp_type);
ath9k_btcoex_bt_stomp(sc, btcoex->bt_stomp_type);

spin_unlock_bh(&btcoex->btcoex_lock);

Expand Down Expand Up @@ -1420,16 +1420,15 @@ static void ath_btcoex_no_stomp_timer(void *arg)
struct ath_softc *sc = (struct ath_softc *)arg;
struct ath_hw *ah = sc->sc_ah;
struct ath_btcoex *btcoex = &sc->btcoex;
struct ath_btcoex_hw *btcoex_hw= &ah->btcoex_hw;

DPRINTF(ah, ATH_DBG_BTCOEX, "no stomp timer running \n");

spin_lock_bh(&btcoex->btcoex_lock);

if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW)
ath_btcoex_bt_stomp(sc, btcoex_hw, ATH_BTCOEX_STOMP_NONE);
ath9k_btcoex_bt_stomp(sc, ATH_BTCOEX_STOMP_NONE);
else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL)
ath_btcoex_bt_stomp(sc, btcoex_hw, ATH_BTCOEX_STOMP_LOW);
ath9k_btcoex_bt_stomp(sc, ATH_BTCOEX_STOMP_LOW);

spin_unlock_bh(&btcoex->btcoex_lock);
}
Expand Down

0 comments on commit bb368fd

Please sign in to comment.