diff options
Diffstat (limited to 'net/mac80211/wext.c')
-rw-r--r-- | net/mac80211/wext.c | 70 |
1 files changed, 2 insertions, 68 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index d4e61dc903e8..f77929802c7a 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -255,72 +255,6 @@ static int ieee80211_ioctl_giwrate(struct net_device *dev, | |||
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
257 | 257 | ||
258 | static int ieee80211_ioctl_siwpower(struct net_device *dev, | ||
259 | struct iw_request_info *info, | ||
260 | struct iw_param *wrq, | ||
261 | char *extra) | ||
262 | { | ||
263 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
264 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
265 | struct ieee80211_conf *conf = &local->hw.conf; | ||
266 | int timeout = 0; | ||
267 | bool ps; | ||
268 | |||
269 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) | ||
270 | return -EOPNOTSUPP; | ||
271 | |||
272 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | ||
273 | return -EINVAL; | ||
274 | |||
275 | if (wrq->disabled) { | ||
276 | ps = false; | ||
277 | timeout = 0; | ||
278 | goto set; | ||
279 | } | ||
280 | |||
281 | switch (wrq->flags & IW_POWER_MODE) { | ||
282 | case IW_POWER_ON: /* If not specified */ | ||
283 | case IW_POWER_MODE: /* If set all mask */ | ||
284 | case IW_POWER_ALL_R: /* If explicitely state all */ | ||
285 | ps = true; | ||
286 | break; | ||
287 | default: /* Otherwise we ignore */ | ||
288 | return -EINVAL; | ||
289 | } | ||
290 | |||
291 | if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT)) | ||
292 | return -EINVAL; | ||
293 | |||
294 | if (wrq->flags & IW_POWER_TIMEOUT) | ||
295 | timeout = wrq->value / 1000; | ||
296 | |||
297 | set: | ||
298 | if (ps == sdata->u.mgd.powersave && timeout == conf->dynamic_ps_timeout) | ||
299 | return 0; | ||
300 | |||
301 | sdata->u.mgd.powersave = ps; | ||
302 | conf->dynamic_ps_timeout = timeout; | ||
303 | |||
304 | if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS) | ||
305 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | ||
306 | |||
307 | ieee80211_recalc_ps(local, -1); | ||
308 | |||
309 | return 0; | ||
310 | } | ||
311 | |||
312 | static int ieee80211_ioctl_giwpower(struct net_device *dev, | ||
313 | struct iw_request_info *info, | ||
314 | union iwreq_data *wrqu, | ||
315 | char *extra) | ||
316 | { | ||
317 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
318 | |||
319 | wrqu->power.disabled = !sdata->u.mgd.powersave; | ||
320 | |||
321 | return 0; | ||
322 | } | ||
323 | |||
324 | /* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ | 258 | /* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ |
325 | static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev) | 259 | static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev) |
326 | { | 260 | { |
@@ -436,8 +370,8 @@ static const iw_handler ieee80211_handler[] = | |||
436 | (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */ | 370 | (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */ |
437 | (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */ | 371 | (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */ |
438 | (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */ | 372 | (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */ |
439 | (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */ | 373 | (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */ |
440 | (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */ | 374 | (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */ |
441 | (iw_handler) NULL, /* -- hole -- */ | 375 | (iw_handler) NULL, /* -- hole -- */ |
442 | (iw_handler) NULL, /* -- hole -- */ | 376 | (iw_handler) NULL, /* -- hole -- */ |
443 | (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */ | 377 | (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */ |