aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
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