diff options
author | Mike McCormack <mikem@ring3k.org> | 2011-06-19 21:46:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-20 15:47:43 -0400 |
commit | 4b9d8d67b44aae18e1c4b71281f5cfc0f2105cf6 (patch) | |
tree | 7cc543a892d29f7a2f05ed629d4c8eb07b107f85 | |
parent | 9c0504403725ca77153a0bdad2f3bef0a05e32f0 (diff) |
rtlwifi: rtl8192cu: Remove unused parameter
rtl_ps_set_rf_state's protect_or_not parameter is not set to
true anywhere, except for commented out code.
It enables some legacy locking code, which is no longer used,
so delete the parameter and the old locking code.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/ps.c | 63 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/ps.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 3 |
3 files changed, 7 insertions, 62 deletions
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index d14c13d02177..3eb039a05286 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -79,53 +79,12 @@ EXPORT_SYMBOL(rtl_ps_disable_nic); | |||
79 | 79 | ||
80 | bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, | 80 | bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, |
81 | enum rf_pwrstate state_toset, | 81 | enum rf_pwrstate state_toset, |
82 | u32 changesource, bool protect_or_not) | 82 | u32 changesource) |
83 | { | 83 | { |
84 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 84 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
85 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); | 85 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
86 | bool actionallowed = false; | 86 | bool actionallowed = false; |
87 | u16 rfwait_cnt = 0; | ||
88 | 87 | ||
89 | /*protect_or_not = true; */ | ||
90 | |||
91 | if (protect_or_not) | ||
92 | goto no_protect; | ||
93 | |||
94 | /* | ||
95 | *Only one thread can change | ||
96 | *the RF state at one time, and others | ||
97 | *should wait to be executed. | ||
98 | */ | ||
99 | while (true) { | ||
100 | spin_lock(&rtlpriv->locks.rf_ps_lock); | ||
101 | if (ppsc->rfchange_inprogress) { | ||
102 | spin_unlock(&rtlpriv->locks.rf_ps_lock); | ||
103 | |||
104 | RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, | ||
105 | ("RF Change in progress!" | ||
106 | "Wait to set..state_toset(%d).\n", | ||
107 | state_toset)); | ||
108 | |||
109 | /* Set RF after the previous action is done. */ | ||
110 | while (ppsc->rfchange_inprogress) { | ||
111 | rfwait_cnt++; | ||
112 | mdelay(1); | ||
113 | |||
114 | /* | ||
115 | *Wait too long, return false to avoid | ||
116 | *to be stuck here. | ||
117 | */ | ||
118 | if (rfwait_cnt > 100) | ||
119 | return false; | ||
120 | } | ||
121 | } else { | ||
122 | ppsc->rfchange_inprogress = true; | ||
123 | spin_unlock(&rtlpriv->locks.rf_ps_lock); | ||
124 | break; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | no_protect: | ||
129 | switch (state_toset) { | 88 | switch (state_toset) { |
130 | case ERFON: | 89 | case ERFON: |
131 | ppsc->rfoff_reason &= (~changesource); | 90 | ppsc->rfoff_reason &= (~changesource); |
@@ -167,12 +126,6 @@ no_protect: | |||
167 | if (actionallowed) | 126 | if (actionallowed) |
168 | rtlpriv->cfg->ops->set_rf_power_state(hw, state_toset); | 127 | rtlpriv->cfg->ops->set_rf_power_state(hw, state_toset); |
169 | 128 | ||
170 | if (!protect_or_not) { | ||
171 | spin_lock(&rtlpriv->locks.rf_ps_lock); | ||
172 | ppsc->rfchange_inprogress = false; | ||
173 | spin_unlock(&rtlpriv->locks.rf_ps_lock); | ||
174 | } | ||
175 | |||
176 | return actionallowed; | 129 | return actionallowed; |
177 | } | 130 | } |
178 | EXPORT_SYMBOL(rtl_ps_set_rf_state); | 131 | EXPORT_SYMBOL(rtl_ps_set_rf_state); |
@@ -195,8 +148,7 @@ static void _rtl_ps_inactive_ps(struct ieee80211_hw *hw) | |||
195 | } | 148 | } |
196 | } | 149 | } |
197 | 150 | ||
198 | rtl_ps_set_rf_state(hw, ppsc->inactive_pwrstate, | 151 | rtl_ps_set_rf_state(hw, ppsc->inactive_pwrstate, RF_CHANGE_BY_IPS); |
199 | RF_CHANGE_BY_IPS, false); | ||
200 | 152 | ||
201 | if (ppsc->inactive_pwrstate == ERFOFF && | 153 | if (ppsc->inactive_pwrstate == ERFOFF && |
202 | rtlhal->interface == INTF_PCI) { | 154 | rtlhal->interface == INTF_PCI) { |
@@ -587,7 +539,7 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | |||
587 | } | 539 | } |
588 | 540 | ||
589 | spin_lock(&rtlpriv->locks.lps_lock); | 541 | spin_lock(&rtlpriv->locks.lps_lock); |
590 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS, false); | 542 | rtl_ps_set_rf_state(hw, ERFON, RF_CHANGE_BY_PS); |
591 | spin_unlock(&rtlpriv->locks.lps_lock); | 543 | spin_unlock(&rtlpriv->locks.lps_lock); |
592 | } | 544 | } |
593 | 545 | ||
@@ -621,15 +573,8 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
621 | if (rtlpriv->link_info.busytraffic) | 573 | if (rtlpriv->link_info.busytraffic) |
622 | return; | 574 | return; |
623 | 575 | ||
624 | spin_lock(&rtlpriv->locks.rf_ps_lock); | ||
625 | if (rtlpriv->psc.rfchange_inprogress) { | ||
626 | spin_unlock(&rtlpriv->locks.rf_ps_lock); | ||
627 | return; | ||
628 | } | ||
629 | spin_unlock(&rtlpriv->locks.rf_ps_lock); | ||
630 | |||
631 | spin_lock(&rtlpriv->locks.lps_lock); | 576 | spin_lock(&rtlpriv->locks.lps_lock); |
632 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS, false); | 577 | rtl_ps_set_rf_state(hw, ERFSLEEP, RF_CHANGE_BY_PS); |
633 | spin_unlock(&rtlpriv->locks.lps_lock); | 578 | spin_unlock(&rtlpriv->locks.lps_lock); |
634 | 579 | ||
635 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && | 580 | if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_ASPM && |
diff --git a/drivers/net/wireless/rtlwifi/ps.h b/drivers/net/wireless/rtlwifi/ps.h index e3bf89840370..84628e6041c7 100644 --- a/drivers/net/wireless/rtlwifi/ps.h +++ b/drivers/net/wireless/rtlwifi/ps.h | |||
@@ -33,8 +33,7 @@ | |||
33 | #define MAX_SW_LPS_SLEEP_INTV 5 | 33 | #define MAX_SW_LPS_SLEEP_INTV 5 |
34 | 34 | ||
35 | bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, | 35 | bool rtl_ps_set_rf_state(struct ieee80211_hw *hw, |
36 | enum rf_pwrstate state_toset, u32 changesource, | 36 | enum rf_pwrstate state_toset, u32 changesource); |
37 | bool protect_or_not); | ||
38 | bool rtl_ps_enable_nic(struct ieee80211_hw *hw); | 37 | bool rtl_ps_enable_nic(struct ieee80211_hw *hw); |
39 | bool rtl_ps_disable_nic(struct ieee80211_hw *hw); | 38 | bool rtl_ps_disable_nic(struct ieee80211_hw *hw); |
40 | void rtl_ips_nic_off(struct ieee80211_hw *hw); | 39 | void rtl_ips_nic_off(struct ieee80211_hw *hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c index 5fab47b2218e..9ed5e245e942 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c | |||
@@ -994,7 +994,8 @@ int rtl92se_hw_init(struct ieee80211_hw *hw) | |||
994 | 994 | ||
995 | rtlpriv->psc.rfoff_reason = RF_CHANGE_BY_INIT; | 995 | rtlpriv->psc.rfoff_reason = RF_CHANGE_BY_INIT; |
996 | rtlpriv->psc.rfpwr_state = ERFON; | 996 | rtlpriv->psc.rfpwr_state = ERFON; |
997 | rtl_ps_set_rf_state(hw, ERFOFF, rfoffreason, true); | 997 | /* FIXME: check spinlocks if this block is uncommented */ |
998 | rtl_ps_set_rf_state(hw, ERFOFF, rfoffreason); | ||
998 | } else { | 999 | } else { |
999 | /* gpio radio on/off is out of adapter start */ | 1000 | /* gpio radio on/off is out of adapter start */ |
1000 | if (rtlpriv->psc.hwradiooff == false) { | 1001 | if (rtlpriv->psc.hwradiooff == false) { |