diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-08-28 17:01:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:50 -0400 |
commit | d6f2da5b33911a31eb61e1790ef8e555e9605837 (patch) | |
tree | 14dbd81d232b3d942fc093e24a7a70193f613f3e /net/mac80211/ieee80211_ioctl.c | |
parent | badffb725c86cc2d46f7cb3f520f58f1c863b56c (diff) |
[MAC80211]: Remove bitfields from struct ieee80211_if_sta
mac80211, remove bitfields from struct ieee80211_if_sta
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 643c8855801c..ea2e0f958ac3 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -270,7 +270,7 @@ static int ieee80211_ioctl_siwgenie(struct net_device *dev, | |||
270 | int ret = ieee80211_sta_set_extra_ie(dev, extra, data->length); | 270 | int ret = ieee80211_sta_set_extra_ie(dev, extra, data->length); |
271 | if (ret) | 271 | if (ret) |
272 | return ret; | 272 | return ret; |
273 | sdata->u.sta.auto_bssid_sel = 0; | 273 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; |
274 | ieee80211_sta_req_auth(dev, &sdata->u.sta); | 274 | ieee80211_sta_req_auth(dev, &sdata->u.sta); |
275 | return 0; | 275 | return 0; |
276 | } | 276 | } |
@@ -502,13 +502,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
502 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 502 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
503 | 503 | ||
504 | if (sdata->type == IEEE80211_IF_TYPE_STA) | 504 | if (sdata->type == IEEE80211_IF_TYPE_STA) |
505 | sdata->u.sta.auto_channel_sel = 0; | 505 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL; |
506 | 506 | ||
507 | /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */ | 507 | /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */ |
508 | if (freq->e == 0) { | 508 | if (freq->e == 0) { |
509 | if (freq->m < 0) { | 509 | if (freq->m < 0) { |
510 | if (sdata->type == IEEE80211_IF_TYPE_STA) | 510 | if (sdata->type == IEEE80211_IF_TYPE_STA) |
511 | sdata->u.sta.auto_channel_sel = 1; | 511 | sdata->u.sta.flags |= |
512 | IEEE80211_STA_AUTO_CHANNEL_SEL; | ||
512 | return 0; | 513 | return 0; |
513 | } else | 514 | } else |
514 | return ieee80211_set_channel(local, freq->m, -1); | 515 | return ieee80211_set_channel(local, freq->m, -1); |
@@ -563,7 +564,10 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev, | |||
563 | sdata->u.sta.ssid_len = len; | 564 | sdata->u.sta.ssid_len = len; |
564 | return 0; | 565 | return 0; |
565 | } | 566 | } |
566 | sdata->u.sta.auto_ssid_sel = !data->flags; | 567 | if (data->flags) |
568 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_SSID_SEL; | ||
569 | else | ||
570 | sdata->u.sta.flags |= IEEE80211_STA_AUTO_SSID_SEL; | ||
567 | ret = ieee80211_sta_set_ssid(dev, ssid, len); | 571 | ret = ieee80211_sta_set_ssid(dev, ssid, len); |
568 | if (ret) | 572 | if (ret) |
569 | return ret; | 573 | return ret; |
@@ -630,13 +634,13 @@ static int ieee80211_ioctl_siwap(struct net_device *dev, | |||
630 | ETH_ALEN); | 634 | ETH_ALEN); |
631 | return 0; | 635 | return 0; |
632 | } | 636 | } |
633 | if (is_zero_ether_addr((u8 *) &ap_addr->sa_data)) { | 637 | if (is_zero_ether_addr((u8 *) &ap_addr->sa_data)) |
634 | sdata->u.sta.auto_bssid_sel = 1; | 638 | sdata->u.sta.flags |= IEEE80211_STA_AUTO_BSSID_SEL | |
635 | sdata->u.sta.auto_channel_sel = 1; | 639 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
636 | } else if (is_broadcast_ether_addr((u8 *) &ap_addr->sa_data)) | 640 | else if (is_broadcast_ether_addr((u8 *) &ap_addr->sa_data)) |
637 | sdata->u.sta.auto_bssid_sel = 1; | 641 | sdata->u.sta.flags |= IEEE80211_STA_AUTO_BSSID_SEL; |
638 | else | 642 | else |
639 | sdata->u.sta.auto_bssid_sel = 0; | 643 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; |
640 | ret = ieee80211_sta_set_bssid(dev, (u8 *) &ap_addr->sa_data); | 644 | ret = ieee80211_sta_set_bssid(dev, (u8 *) &ap_addr->sa_data); |
641 | if (ret) | 645 | if (ret) |
642 | return ret; | 646 | return ret; |
@@ -1104,8 +1108,12 @@ static int ieee80211_ioctl_prism2_param(struct net_device *dev, | |||
1104 | if (sdata->type != IEEE80211_IF_TYPE_STA && | 1108 | if (sdata->type != IEEE80211_IF_TYPE_STA && |
1105 | sdata->type != IEEE80211_IF_TYPE_IBSS) | 1109 | sdata->type != IEEE80211_IF_TYPE_IBSS) |
1106 | ret = -EINVAL; | 1110 | ret = -EINVAL; |
1107 | else | 1111 | else { |
1108 | sdata->u.sta.mixed_cell = !!value; | 1112 | if (value) |
1113 | sdata->u.sta.flags |= IEEE80211_STA_MIXED_CELL; | ||
1114 | else | ||
1115 | sdata->u.sta.flags &= ~IEEE80211_STA_MIXED_CELL; | ||
1116 | } | ||
1109 | break; | 1117 | break; |
1110 | 1118 | ||
1111 | case PRISM2_PARAM_HW_MODES: | 1119 | case PRISM2_PARAM_HW_MODES: |
@@ -1115,15 +1123,23 @@ static int ieee80211_ioctl_prism2_param(struct net_device *dev, | |||
1115 | case PRISM2_PARAM_CREATE_IBSS: | 1123 | case PRISM2_PARAM_CREATE_IBSS: |
1116 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) | 1124 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) |
1117 | ret = -EINVAL; | 1125 | ret = -EINVAL; |
1118 | else | 1126 | else { |
1119 | sdata->u.sta.create_ibss = !!value; | 1127 | if (value) |
1128 | sdata->u.sta.flags |= IEEE80211_STA_CREATE_IBSS; | ||
1129 | else | ||
1130 | sdata->u.sta.flags &= ~IEEE80211_STA_CREATE_IBSS; | ||
1131 | } | ||
1120 | break; | 1132 | break; |
1121 | case PRISM2_PARAM_WMM_ENABLED: | 1133 | case PRISM2_PARAM_WMM_ENABLED: |
1122 | if (sdata->type != IEEE80211_IF_TYPE_STA && | 1134 | if (sdata->type != IEEE80211_IF_TYPE_STA && |
1123 | sdata->type != IEEE80211_IF_TYPE_IBSS) | 1135 | sdata->type != IEEE80211_IF_TYPE_IBSS) |
1124 | ret = -EINVAL; | 1136 | ret = -EINVAL; |
1125 | else | 1137 | else { |
1126 | sdata->u.sta.wmm_enabled = !!value; | 1138 | if (value) |
1139 | sdata->u.sta.flags |= IEEE80211_STA_WMM_ENABLED; | ||
1140 | else | ||
1141 | sdata->u.sta.flags &= ~IEEE80211_STA_WMM_ENABLED; | ||
1142 | } | ||
1127 | break; | 1143 | break; |
1128 | default: | 1144 | default: |
1129 | ret = -EOPNOTSUPP; | 1145 | ret = -EOPNOTSUPP; |
@@ -1186,7 +1202,8 @@ static int ieee80211_ioctl_get_prism2_param(struct net_device *dev, | |||
1186 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) | 1202 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) |
1187 | ret = -EINVAL; | 1203 | ret = -EINVAL; |
1188 | else | 1204 | else |
1189 | *param = !!sdata->u.sta.create_ibss; | 1205 | *param = !!(sdata->u.sta.flags & |
1206 | IEEE80211_STA_CREATE_IBSS); | ||
1190 | break; | 1207 | break; |
1191 | 1208 | ||
1192 | case PRISM2_PARAM_MIXED_CELL: | 1209 | case PRISM2_PARAM_MIXED_CELL: |
@@ -1194,14 +1211,16 @@ static int ieee80211_ioctl_get_prism2_param(struct net_device *dev, | |||
1194 | sdata->type != IEEE80211_IF_TYPE_IBSS) | 1211 | sdata->type != IEEE80211_IF_TYPE_IBSS) |
1195 | ret = -EINVAL; | 1212 | ret = -EINVAL; |
1196 | else | 1213 | else |
1197 | *param = !!sdata->u.sta.mixed_cell; | 1214 | *param = !!(sdata->u.sta.flags & |
1215 | IEEE80211_STA_MIXED_CELL); | ||
1198 | break; | 1216 | break; |
1199 | case PRISM2_PARAM_WMM_ENABLED: | 1217 | case PRISM2_PARAM_WMM_ENABLED: |
1200 | if (sdata->type != IEEE80211_IF_TYPE_STA && | 1218 | if (sdata->type != IEEE80211_IF_TYPE_STA && |
1201 | sdata->type != IEEE80211_IF_TYPE_IBSS) | 1219 | sdata->type != IEEE80211_IF_TYPE_IBSS) |
1202 | ret = -EINVAL; | 1220 | ret = -EINVAL; |
1203 | else | 1221 | else |
1204 | *param = !!sdata->u.sta.wmm_enabled; | 1222 | *param = !!(sdata->u.sta.flags & |
1223 | IEEE80211_STA_WMM_ENABLED); | ||
1205 | break; | 1224 | break; |
1206 | default: | 1225 | default: |
1207 | ret = -EOPNOTSUPP; | 1226 | ret = -EOPNOTSUPP; |