aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-06-01 05:44:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-03 14:14:40 -0400
commitcb551df2028017c71b07db9537efb90abcf9cc7d (patch)
tree25c34d275a459020662c8f7d0a7e2c73632ecc6f
parent881ac6a53587acb12b009a3053830295688f2c70 (diff)
ath9k_htc: Add PS wrappers
The HW has to be awake when registers are accessed. Ensure this is so by using the PS wrappers at appropriate places. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index ae84c7bf355a..f4ae62a19ef4 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1357,6 +1357,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1357out: 1357out:
1358 ath9k_htc_ps_restore(priv); 1358 ath9k_htc_ps_restore(priv);
1359 mutex_unlock(&priv->mutex); 1359 mutex_unlock(&priv->mutex);
1360
1360 return ret; 1361 return ret;
1361} 1362}
1362 1363
@@ -1373,6 +1374,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
1373 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1374 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
1374 1375
1375 mutex_lock(&priv->mutex); 1376 mutex_lock(&priv->mutex);
1377 ath9k_htc_ps_wakeup(priv);
1376 1378
1377 memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif)); 1379 memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif));
1378 memcpy(&hvif.myaddr, vif->addr, ETH_ALEN); 1380 memcpy(&hvif.myaddr, vif->addr, ETH_ALEN);
@@ -1383,6 +1385,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
1383 ath9k_htc_remove_station(priv, vif, NULL); 1385 ath9k_htc_remove_station(priv, vif, NULL);
1384 priv->vif = NULL; 1386 priv->vif = NULL;
1385 1387
1388 ath9k_htc_ps_restore(priv);
1386 mutex_unlock(&priv->mutex); 1389 mutex_unlock(&priv->mutex);
1387} 1390}
1388 1391
@@ -1479,8 +1482,8 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
1479 u32 rfilt; 1482 u32 rfilt;
1480 1483
1481 mutex_lock(&priv->mutex); 1484 mutex_lock(&priv->mutex);
1482
1483 ath9k_htc_ps_wakeup(priv); 1485 ath9k_htc_ps_wakeup(priv);
1486
1484 changed_flags &= SUPPORTED_FILTERS; 1487 changed_flags &= SUPPORTED_FILTERS;
1485 *total_flags &= SUPPORTED_FILTERS; 1488 *total_flags &= SUPPORTED_FILTERS;
1486 1489
@@ -1504,6 +1507,7 @@ static void ath9k_htc_sta_notify(struct ieee80211_hw *hw,
1504 int ret; 1507 int ret;
1505 1508
1506 mutex_lock(&priv->mutex); 1509 mutex_lock(&priv->mutex);
1510 ath9k_htc_ps_wakeup(priv);
1507 1511
1508 switch (cmd) { 1512 switch (cmd) {
1509 case STA_NOTIFY_ADD: 1513 case STA_NOTIFY_ADD:
@@ -1518,6 +1522,7 @@ static void ath9k_htc_sta_notify(struct ieee80211_hw *hw,
1518 break; 1522 break;
1519 } 1523 }
1520 1524
1525 ath9k_htc_ps_restore(priv);
1521 mutex_unlock(&priv->mutex); 1526 mutex_unlock(&priv->mutex);
1522} 1527}
1523 1528
@@ -1533,6 +1538,7 @@ static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
1533 return 0; 1538 return 0;
1534 1539
1535 mutex_lock(&priv->mutex); 1540 mutex_lock(&priv->mutex);
1541 ath9k_htc_ps_wakeup(priv);
1536 1542
1537 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); 1543 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
1538 1544
@@ -1553,6 +1559,7 @@ static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
1553 if (ret) 1559 if (ret)
1554 ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); 1560 ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n");
1555 1561
1562 ath9k_htc_ps_restore(priv);
1556 mutex_unlock(&priv->mutex); 1563 mutex_unlock(&priv->mutex);
1557 1564
1558 return ret; 1565 return ret;
@@ -1695,7 +1702,9 @@ static u64 ath9k_htc_get_tsf(struct ieee80211_hw *hw)
1695 u64 tsf; 1702 u64 tsf;
1696 1703
1697 mutex_lock(&priv->mutex); 1704 mutex_lock(&priv->mutex);
1705 ath9k_htc_ps_wakeup(priv);
1698 tsf = ath9k_hw_gettsf64(priv->ah); 1706 tsf = ath9k_hw_gettsf64(priv->ah);
1707 ath9k_htc_ps_restore(priv);
1699 mutex_unlock(&priv->mutex); 1708 mutex_unlock(&priv->mutex);
1700 1709
1701 return tsf; 1710 return tsf;
@@ -1706,7 +1715,9 @@ static void ath9k_htc_set_tsf(struct ieee80211_hw *hw, u64 tsf)
1706 struct ath9k_htc_priv *priv = hw->priv; 1715 struct ath9k_htc_priv *priv = hw->priv;
1707 1716
1708 mutex_lock(&priv->mutex); 1717 mutex_lock(&priv->mutex);
1718 ath9k_htc_ps_wakeup(priv);
1709 ath9k_hw_settsf64(priv->ah, tsf); 1719 ath9k_hw_settsf64(priv->ah, tsf);
1720 ath9k_htc_ps_restore(priv);
1710 mutex_unlock(&priv->mutex); 1721 mutex_unlock(&priv->mutex);
1711} 1722}
1712 1723
@@ -1714,11 +1725,11 @@ static void ath9k_htc_reset_tsf(struct ieee80211_hw *hw)
1714{ 1725{
1715 struct ath9k_htc_priv *priv = hw->priv; 1726 struct ath9k_htc_priv *priv = hw->priv;
1716 1727
1717 ath9k_htc_ps_wakeup(priv);
1718 mutex_lock(&priv->mutex); 1728 mutex_lock(&priv->mutex);
1729 ath9k_htc_ps_wakeup(priv);
1719 ath9k_hw_reset_tsf(priv->ah); 1730 ath9k_hw_reset_tsf(priv->ah);
1720 mutex_unlock(&priv->mutex);
1721 ath9k_htc_ps_restore(priv); 1731 ath9k_htc_ps_restore(priv);
1732 mutex_unlock(&priv->mutex);
1722} 1733}
1723 1734
1724static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw, 1735static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
@@ -1776,8 +1787,8 @@ static void ath9k_htc_sw_scan_complete(struct ieee80211_hw *hw)
1776{ 1787{
1777 struct ath9k_htc_priv *priv = hw->priv; 1788 struct ath9k_htc_priv *priv = hw->priv;
1778 1789
1779 ath9k_htc_ps_wakeup(priv);
1780 mutex_lock(&priv->mutex); 1790 mutex_lock(&priv->mutex);
1791 ath9k_htc_ps_wakeup(priv);
1781 spin_lock_bh(&priv->beacon_lock); 1792 spin_lock_bh(&priv->beacon_lock);
1782 priv->op_flags &= ~OP_SCANNING; 1793 priv->op_flags &= ~OP_SCANNING;
1783 spin_unlock_bh(&priv->beacon_lock); 1794 spin_unlock_bh(&priv->beacon_lock);
@@ -1785,8 +1796,8 @@ static void ath9k_htc_sw_scan_complete(struct ieee80211_hw *hw)
1785 if (priv->op_flags & OP_ASSOCIATED) 1796 if (priv->op_flags & OP_ASSOCIATED)
1786 ath9k_htc_beacon_config(priv, priv->vif); 1797 ath9k_htc_beacon_config(priv, priv->vif);
1787 ath_start_ani(priv); 1798 ath_start_ani(priv);
1788 mutex_unlock(&priv->mutex);
1789 ath9k_htc_ps_restore(priv); 1799 ath9k_htc_ps_restore(priv);
1800 mutex_unlock(&priv->mutex);
1790} 1801}
1791 1802
1792static int ath9k_htc_set_rts_threshold(struct ieee80211_hw *hw, u32 value) 1803static int ath9k_htc_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
@@ -1800,8 +1811,10 @@ static void ath9k_htc_set_coverage_class(struct ieee80211_hw *hw,
1800 struct ath9k_htc_priv *priv = hw->priv; 1811 struct ath9k_htc_priv *priv = hw->priv;
1801 1812
1802 mutex_lock(&priv->mutex); 1813 mutex_lock(&priv->mutex);
1814 ath9k_htc_ps_wakeup(priv);
1803 priv->ah->coverage_class = coverage_class; 1815 priv->ah->coverage_class = coverage_class;
1804 ath9k_hw_init_global_settings(priv->ah); 1816 ath9k_hw_init_global_settings(priv->ah);
1817 ath9k_htc_ps_restore(priv);
1805 mutex_unlock(&priv->mutex); 1818 mutex_unlock(&priv->mutex);
1806} 1819}
1807 1820