aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2011-03-06 12:23:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-03-11 14:15:35 -0500
commitd0c331aff99ca75f9aa0f794cf68b572d8ec7c5a (patch)
tree4e553cfb5bb9e9b3edf9aef0984a892bb25e4e17 /drivers/net/wireless
parent8d5eab5aa676378b4c9daa62d10d08a0bca04677 (diff)
wl1251: remove wl1251_ps_set_elp function
wl1251_ps_set_elp() only does acx_sleep_auth call and takes the chip from/to ELP, however all callers of wl1251_ps_set_mode() have already taken the chip out of ELP and puts it back to ELP when they finish. This makes ELP calls (and register writes they result in) superfluous. So remove wl1251_ps_set_elp function and call acx_sleep_auth directly. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Kalle Valo <kvalo@adurom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/wl1251/ps.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/drivers/net/wireless/wl1251/ps.c b/drivers/net/wireless/wl1251/ps.c
index 9ba23ede51bd..842155e65a80 100644
--- a/drivers/net/wireless/wl1251/ps.c
+++ b/drivers/net/wireless/wl1251/ps.c
@@ -102,38 +102,6 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl)
102 return 0; 102 return 0;
103} 103}
104 104
105static int wl1251_ps_set_elp(struct wl1251 *wl, bool enable)
106{
107 int ret;
108
109 if (enable) {
110 wl1251_debug(DEBUG_PSM, "sleep auth psm/elp");
111
112 ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP);
113 if (ret < 0)
114 return ret;
115
116 wl1251_ps_elp_sleep(wl);
117 } else {
118 wl1251_debug(DEBUG_PSM, "sleep auth cam");
119
120 /*
121 * When the target is in ELP, we can only
122 * access the ELP control register. Thus,
123 * we have to wake the target up before
124 * changing the power authorization.
125 */
126
127 wl1251_ps_elp_wakeup(wl);
128
129 ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_CAM);
130 if (ret < 0)
131 return ret;
132 }
133
134 return 0;
135}
136
137int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) 105int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
138{ 106{
139 int ret; 107 int ret;
@@ -162,7 +130,7 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
162 if (ret < 0) 130 if (ret < 0)
163 return ret; 131 return ret;
164 132
165 ret = wl1251_ps_set_elp(wl, true); 133 ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP);
166 if (ret < 0) 134 if (ret < 0)
167 return ret; 135 return ret;
168 136
@@ -171,7 +139,8 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
171 case STATION_ACTIVE_MODE: 139 case STATION_ACTIVE_MODE:
172 default: 140 default:
173 wl1251_debug(DEBUG_PSM, "leaving psm"); 141 wl1251_debug(DEBUG_PSM, "leaving psm");
174 ret = wl1251_ps_set_elp(wl, false); 142
143 ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_CAM);
175 if (ret < 0) 144 if (ret < 0)
176 return ret; 145 return ret;
177 146