aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/wext.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 736c32e340f2..207971e9ad72 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -1009,6 +1009,45 @@ static int ieee80211_ioctl_giwencode(struct net_device *dev,
1009 return 0; 1009 return 0;
1010} 1010}
1011 1011
1012static int ieee80211_ioctl_siwpower(struct net_device *dev,
1013 struct iw_request_info *info,
1014 struct iw_param *wrq,
1015 char *extra)
1016{
1017 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1018 struct ieee80211_conf *conf = &local->hw.conf;
1019
1020 if (wrq->disabled) {
1021 conf->flags &= ~IEEE80211_CONF_PS;
1022 return ieee80211_hw_config(local);
1023 }
1024
1025 switch (wrq->flags & IW_POWER_MODE) {
1026 case IW_POWER_ON: /* If not specified */
1027 case IW_POWER_MODE: /* If set all mask */
1028 case IW_POWER_ALL_R: /* If explicitely state all */
1029 conf->flags |= IEEE80211_CONF_PS;
1030 break;
1031 default: /* Otherwise we don't support it */
1032 return -EINVAL;
1033 }
1034
1035 return ieee80211_hw_config(local);
1036}
1037
1038static int ieee80211_ioctl_giwpower(struct net_device *dev,
1039 struct iw_request_info *info,
1040 union iwreq_data *wrqu,
1041 char *extra)
1042{
1043 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1044 struct ieee80211_conf *conf = &local->hw.conf;
1045
1046 wrqu->power.disabled = !(conf->flags & IEEE80211_CONF_PS);
1047
1048 return 0;
1049}
1050
1012static int ieee80211_ioctl_siwauth(struct net_device *dev, 1051static int ieee80211_ioctl_siwauth(struct net_device *dev,
1013 struct iw_request_info *info, 1052 struct iw_request_info *info,
1014 struct iw_param *data, char *extra) 1053 struct iw_param *data, char *extra)
@@ -1211,8 +1250,8 @@ static const iw_handler ieee80211_handler[] =
1211 (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */ 1250 (iw_handler) ieee80211_ioctl_giwretry, /* SIOCGIWRETRY */
1212 (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */ 1251 (iw_handler) ieee80211_ioctl_siwencode, /* SIOCSIWENCODE */
1213 (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */ 1252 (iw_handler) ieee80211_ioctl_giwencode, /* SIOCGIWENCODE */
1214 (iw_handler) NULL, /* SIOCSIWPOWER */ 1253 (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */
1215 (iw_handler) NULL, /* SIOCGIWPOWER */ 1254 (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */
1216 (iw_handler) NULL, /* -- hole -- */ 1255 (iw_handler) NULL, /* -- hole -- */
1217 (iw_handler) NULL, /* -- hole -- */ 1256 (iw_handler) NULL, /* -- hole -- */
1218 (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */ 1257 (iw_handler) ieee80211_ioctl_siwgenie, /* SIOCSIWGENIE */