aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2014-03-01 15:15:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-03-17 13:13:06 -0400
commit92c3f7ef2c59de5c6b58504d330a59f8e8d78e88 (patch)
treee12d62c3fe3b04870f33c6cd54c094b8cac20496
parenteefa01ddd57893c7f4482024029fec323c8e1b89 (diff)
ath9k_htc: use common->op_flags
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h3
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_beacon.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c26
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c3
5 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index d5a10882bd74..707c5b418dc6 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -437,11 +437,8 @@ static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
437} 437}
438#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 438#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
439 439
440#define OP_INVALID BIT(0)
441#define OP_SCANNING BIT(1)
442#define OP_BT_PRIORITY_DETECTED BIT(3) 440#define OP_BT_PRIORITY_DETECTED BIT(3)
443#define OP_BT_SCAN BIT(4) 441#define OP_BT_SCAN BIT(4)
444#define OP_ANI_RUNNING BIT(5)
445#define OP_TSF_RESET BIT(6) 442#define OP_TSF_RESET BIT(6)
446 443
447struct ath9k_htc_priv { 444struct ath9k_htc_priv {
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index 4540eacee093..9ff9e6e5df06 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -343,7 +343,7 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
343 vif = priv->beacon.bslot[slot]; 343 vif = priv->beacon.bslot[slot];
344 avp = (struct ath9k_htc_vif *)vif->drv_priv; 344 avp = (struct ath9k_htc_vif *)vif->drv_priv;
345 345
346 if (unlikely(test_bit(OP_SCANNING, &priv->op_flags))) { 346 if (unlikely(test_bit(ATH_OP_SCANNING, &common->op_flags))) {
347 spin_unlock_bh(&priv->beacon_lock); 347 spin_unlock_bh(&priv->beacon_lock);
348 return; 348 return;
349 } 349 }
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 6eb19b8352ba..4b3b4dd49a42 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -459,8 +459,6 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
459 struct ath_common *common; 459 struct ath_common *common;
460 int i, ret = 0, csz = 0; 460 int i, ret = 0, csz = 0;
461 461
462 set_bit(OP_INVALID, &priv->op_flags);
463
464 ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL); 462 ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL);
465 if (!ah) 463 if (!ah)
466 return -ENOMEM; 464 return -ENOMEM;
@@ -485,6 +483,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
485 common->priv = priv; 483 common->priv = priv;
486 common->debug_mask = ath9k_debug; 484 common->debug_mask = ath9k_debug;
487 common->btcoex_enabled = ath9k_htc_btcoex_enable == 1; 485 common->btcoex_enabled = ath9k_htc_btcoex_enable == 1;
486 set_bit(ATH_OP_INVALID, &common->op_flags);
488 487
489 spin_lock_init(&priv->beacon_lock); 488 spin_lock_init(&priv->beacon_lock);
490 spin_lock_init(&priv->tx.tx_lock); 489 spin_lock_init(&priv->tx.tx_lock);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 40733d03e1a2..6e17c08422c0 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -250,7 +250,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
250 u8 cmd_rsp; 250 u8 cmd_rsp;
251 int ret; 251 int ret;
252 252
253 if (test_bit(OP_INVALID, &priv->op_flags)) 253 if (test_bit(ATH_OP_INVALID, &common->op_flags))
254 return -EIO; 254 return -EIO;
255 255
256 fastcc = !!(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL); 256 fastcc = !!(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL);
@@ -304,7 +304,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
304 304
305 htc_start(priv->htc); 305 htc_start(priv->htc);
306 306
307 if (!test_bit(OP_SCANNING, &priv->op_flags) && 307 if (!test_bit(ATH_OP_SCANNING, &common->op_flags) &&
308 !(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) 308 !(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL))
309 ath9k_htc_vif_reconfig(priv); 309 ath9k_htc_vif_reconfig(priv);
310 310
@@ -748,7 +748,7 @@ void ath9k_htc_start_ani(struct ath9k_htc_priv *priv)
748 common->ani.shortcal_timer = timestamp; 748 common->ani.shortcal_timer = timestamp;
749 common->ani.checkani_timer = timestamp; 749 common->ani.checkani_timer = timestamp;
750 750
751 set_bit(OP_ANI_RUNNING, &priv->op_flags); 751 set_bit(ATH_OP_ANI_RUN, &common->op_flags);
752 752
753 ieee80211_queue_delayed_work(common->hw, &priv->ani_work, 753 ieee80211_queue_delayed_work(common->hw, &priv->ani_work,
754 msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); 754 msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
@@ -756,8 +756,9 @@ void ath9k_htc_start_ani(struct ath9k_htc_priv *priv)
756 756
757void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv) 757void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv)
758{ 758{
759 struct ath_common *common = ath9k_hw_common(priv->ah);
759 cancel_delayed_work_sync(&priv->ani_work); 760 cancel_delayed_work_sync(&priv->ani_work);
760 clear_bit(OP_ANI_RUNNING, &priv->op_flags); 761 clear_bit(ATH_OP_ANI_RUN, &common->op_flags);
761} 762}
762 763
763void ath9k_htc_ani_work(struct work_struct *work) 764void ath9k_htc_ani_work(struct work_struct *work)
@@ -942,7 +943,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
942 ath_dbg(common, CONFIG, 943 ath_dbg(common, CONFIG,
943 "Failed to update capability in target\n"); 944 "Failed to update capability in target\n");
944 945
945 clear_bit(OP_INVALID, &priv->op_flags); 946 clear_bit(ATH_OP_INVALID, &common->op_flags);
946 htc_start(priv->htc); 947 htc_start(priv->htc);
947 948
948 spin_lock_bh(&priv->tx.tx_lock); 949 spin_lock_bh(&priv->tx.tx_lock);
@@ -971,7 +972,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
971 972
972 mutex_lock(&priv->mutex); 973 mutex_lock(&priv->mutex);
973 974
974 if (test_bit(OP_INVALID, &priv->op_flags)) { 975 if (test_bit(ATH_OP_INVALID, &common->op_flags)) {
975 ath_dbg(common, ANY, "Device not present\n"); 976 ath_dbg(common, ANY, "Device not present\n");
976 mutex_unlock(&priv->mutex); 977 mutex_unlock(&priv->mutex);
977 return; 978 return;
@@ -1013,7 +1014,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
1013 ath9k_htc_ps_restore(priv); 1014 ath9k_htc_ps_restore(priv);
1014 ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP); 1015 ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP);
1015 1016
1016 set_bit(OP_INVALID, &priv->op_flags); 1017 set_bit(ATH_OP_INVALID, &common->op_flags);
1017 1018
1018 ath_dbg(common, CONFIG, "Driver halt\n"); 1019 ath_dbg(common, CONFIG, "Driver halt\n");
1019 mutex_unlock(&priv->mutex); 1020 mutex_unlock(&priv->mutex);
@@ -1087,7 +1088,7 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1087 ath9k_htc_set_opmode(priv); 1088 ath9k_htc_set_opmode(priv);
1088 1089
1089 if ((priv->ah->opmode == NL80211_IFTYPE_AP) && 1090 if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
1090 !test_bit(OP_ANI_RUNNING, &priv->op_flags)) { 1091 !test_bit(ATH_OP_ANI_RUN, &common->op_flags)) {
1091 ath9k_hw_set_tsfadjust(priv->ah, true); 1092 ath9k_hw_set_tsfadjust(priv->ah, true);
1092 ath9k_htc_start_ani(priv); 1093 ath9k_htc_start_ani(priv);
1093 } 1094 }
@@ -1245,13 +1246,14 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
1245 u64 multicast) 1246 u64 multicast)
1246{ 1247{
1247 struct ath9k_htc_priv *priv = hw->priv; 1248 struct ath9k_htc_priv *priv = hw->priv;
1249 struct ath_common *common = ath9k_hw_common(priv->ah);
1248 u32 rfilt; 1250 u32 rfilt;
1249 1251
1250 mutex_lock(&priv->mutex); 1252 mutex_lock(&priv->mutex);
1251 changed_flags &= SUPPORTED_FILTERS; 1253 changed_flags &= SUPPORTED_FILTERS;
1252 *total_flags &= SUPPORTED_FILTERS; 1254 *total_flags &= SUPPORTED_FILTERS;
1253 1255
1254 if (test_bit(OP_INVALID, &priv->op_flags)) { 1256 if (test_bit(ATH_OP_INVALID, &common->op_flags)) {
1255 ath_dbg(ath9k_hw_common(priv->ah), ANY, 1257 ath_dbg(ath9k_hw_common(priv->ah), ANY,
1256 "Unable to configure filter on invalid state\n"); 1258 "Unable to configure filter on invalid state\n");
1257 mutex_unlock(&priv->mutex); 1259 mutex_unlock(&priv->mutex);
@@ -1670,10 +1672,11 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
1670static void ath9k_htc_sw_scan_start(struct ieee80211_hw *hw) 1672static void ath9k_htc_sw_scan_start(struct ieee80211_hw *hw)
1671{ 1673{
1672 struct ath9k_htc_priv *priv = hw->priv; 1674 struct ath9k_htc_priv *priv = hw->priv;
1675 struct ath_common *common = ath9k_hw_common(priv->ah);
1673 1676
1674 mutex_lock(&priv->mutex); 1677 mutex_lock(&priv->mutex);
1675 spin_lock_bh(&priv->beacon_lock); 1678 spin_lock_bh(&priv->beacon_lock);
1676 set_bit(OP_SCANNING, &priv->op_flags); 1679 set_bit(ATH_OP_SCANNING, &common->op_flags);
1677 spin_unlock_bh(&priv->beacon_lock); 1680 spin_unlock_bh(&priv->beacon_lock);
1678 cancel_work_sync(&priv->ps_work); 1681 cancel_work_sync(&priv->ps_work);
1679 ath9k_htc_stop_ani(priv); 1682 ath9k_htc_stop_ani(priv);
@@ -1683,10 +1686,11 @@ static void ath9k_htc_sw_scan_start(struct ieee80211_hw *hw)
1683static void ath9k_htc_sw_scan_complete(struct ieee80211_hw *hw) 1686static void ath9k_htc_sw_scan_complete(struct ieee80211_hw *hw)
1684{ 1687{
1685 struct ath9k_htc_priv *priv = hw->priv; 1688 struct ath9k_htc_priv *priv = hw->priv;
1689 struct ath_common *common = ath9k_hw_common(priv->ah);
1686 1690
1687 mutex_lock(&priv->mutex); 1691 mutex_lock(&priv->mutex);
1688 spin_lock_bh(&priv->beacon_lock); 1692 spin_lock_bh(&priv->beacon_lock);
1689 clear_bit(OP_SCANNING, &priv->op_flags); 1693 clear_bit(ATH_OP_SCANNING, &common->op_flags);
1690 spin_unlock_bh(&priv->beacon_lock); 1694 spin_unlock_bh(&priv->beacon_lock);
1691 ath9k_htc_ps_wakeup(priv); 1695 ath9k_htc_ps_wakeup(priv);
1692 ath9k_htc_vif_reconfig(priv); 1696 ath9k_htc_vif_reconfig(priv);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 47b2bfcd8223..e8149e3dbdd5 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -924,9 +924,10 @@ static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
924 924
925void ath9k_host_rx_init(struct ath9k_htc_priv *priv) 925void ath9k_host_rx_init(struct ath9k_htc_priv *priv)
926{ 926{
927 struct ath_common *common = ath9k_hw_common(priv->ah);
927 ath9k_hw_rxena(priv->ah); 928 ath9k_hw_rxena(priv->ah);
928 ath9k_htc_opmode_init(priv); 929 ath9k_htc_opmode_init(priv);
929 ath9k_hw_startpcureceive(priv->ah, test_bit(OP_SCANNING, &priv->op_flags)); 930 ath9k_hw_startpcureceive(priv->ah, test_bit(ATH_OP_SCANNING, &common->op_flags));
930} 931}
931 932
932static inline void convert_htc_flag(struct ath_rx_status *rx_stats, 933static inline void convert_htc_flag(struct ath_rx_status *rx_stats,