Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194991
b: refs/heads/master
c: 2ff6575
h: refs/heads/master
i:
  194989: 1ad02c9
  194987: 75f0057
  194983: 53c6c55
  194975: 8f629c1
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed May 7, 2010
1 parent f655903 commit 9295565
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 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: bc6fb35644ee46725f51ef27e901bd5d7e52c101
refs/heads/master: 2ff6575b1e497f88acf2c7de7e1ba015267b689d
26 changes: 19 additions & 7 deletions trunk/drivers/net/wireless/ath/ath9k/htc_drv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
return 0;
}

static int ath9k_htc_radio_enable(struct ieee80211_hw *hw)
static int ath9k_htc_radio_enable(struct ieee80211_hw *hw, bool led)
{
struct ath9k_htc_priv *priv = hw->priv;
struct ath_hw *ah = priv->ah;
Expand Down Expand Up @@ -1147,6 +1147,13 @@ static int ath9k_htc_radio_enable(struct ieee80211_hw *hw)
priv->tx_queues_stop = false;
spin_unlock_bh(&priv->tx_lock);

if (led) {
/* Enable LED */
ath9k_hw_cfg_output(ah, ah->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
ath9k_hw_set_gpio(ah, ah->led_pin, 0);
}

ieee80211_wake_queues(hw);

return ret;
Expand All @@ -1158,13 +1165,13 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
int ret = 0;

mutex_lock(&priv->mutex);
ret = ath9k_htc_radio_enable(hw);
ret = ath9k_htc_radio_enable(hw, false);
mutex_unlock(&priv->mutex);

return ret;
}

static void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
static void ath9k_htc_radio_disable(struct ieee80211_hw *hw, bool led)
{
struct ath9k_htc_priv *priv = hw->priv;
struct ath_hw *ah = priv->ah;
Expand All @@ -1177,6 +1184,12 @@ static void ath9k_htc_radio_disable(struct ieee80211_hw *hw)
return;
}

if (led) {
/* Disable LED */
ath9k_hw_set_gpio(ah, ah->led_pin, 1);
ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
}

/* Cancel all the running timers/work .. */
cancel_work_sync(&priv->ps_work);
cancel_delayed_work_sync(&priv->ath9k_ani_work);
Expand Down Expand Up @@ -1217,7 +1230,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
struct ath9k_htc_priv *priv = hw->priv;

mutex_lock(&priv->mutex);
ath9k_htc_radio_disable(hw);
ath9k_htc_radio_disable(hw, false);
mutex_unlock(&priv->mutex);
}

Expand Down Expand Up @@ -1337,7 +1350,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)

if (enable_radio) {
ath9k_htc_setpower(priv, ATH9K_PM_AWAKE);
ath9k_htc_radio_enable(hw);
ath9k_htc_radio_enable(hw, true);
ath_print(common, ATH_DBG_CONFIG,
"not-idle: enabling radio\n");
}
Expand Down Expand Up @@ -1389,10 +1402,9 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
if (priv->ps_idle) {
ath_print(common, ATH_DBG_CONFIG,
"idle: disabling radio\n");
ath9k_htc_radio_disable(hw);
ath9k_htc_radio_disable(hw, true);
}


mutex_unlock(&priv->mutex);

return 0;
Expand Down

0 comments on commit 9295565

Please sign in to comment.