diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:02:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:02:57 -0400 |
commit | f541ae326fa120fa5c57433e4d9a133df212ce41 (patch) | |
tree | bdbd94ec72cfc601118051cb35e8617d55510177 /net/mac80211/cfg.c | |
parent | e255357764f92afcafafbd4879b222b8c752065a (diff) | |
parent | 0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff) |
Merge branch 'linus' into perfcounters/core-v2
Merge reason: we have gathered quite a few conflicts, need to merge upstream
Conflicts:
arch/powerpc/kernel/Makefile
arch/x86/ia32/ia32entry.S
arch/x86/include/asm/hardirq.h
arch/x86/include/asm/unistd_32.h
arch/x86/include/asm/unistd_64.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/irq.c
arch/x86/kernel/syscall_table_32.S
arch/x86/mm/iomap_32.c
include/linux/sched.h
kernel/Makefile
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 237 |
1 files changed, 195 insertions, 42 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 9d4e4d846ec1..e677b751d468 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -133,6 +133,9 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev, | |||
133 | case WLAN_CIPHER_SUITE_CCMP: | 133 | case WLAN_CIPHER_SUITE_CCMP: |
134 | alg = ALG_CCMP; | 134 | alg = ALG_CCMP; |
135 | break; | 135 | break; |
136 | case WLAN_CIPHER_SUITE_AES_CMAC: | ||
137 | alg = ALG_AES_CMAC; | ||
138 | break; | ||
136 | default: | 139 | default: |
137 | return -EINVAL; | 140 | return -EINVAL; |
138 | } | 141 | } |
@@ -275,6 +278,17 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, | |||
275 | else | 278 | else |
276 | params.cipher = WLAN_CIPHER_SUITE_WEP104; | 279 | params.cipher = WLAN_CIPHER_SUITE_WEP104; |
277 | break; | 280 | break; |
281 | case ALG_AES_CMAC: | ||
282 | params.cipher = WLAN_CIPHER_SUITE_AES_CMAC; | ||
283 | seq[0] = key->u.aes_cmac.tx_pn[5]; | ||
284 | seq[1] = key->u.aes_cmac.tx_pn[4]; | ||
285 | seq[2] = key->u.aes_cmac.tx_pn[3]; | ||
286 | seq[3] = key->u.aes_cmac.tx_pn[2]; | ||
287 | seq[4] = key->u.aes_cmac.tx_pn[1]; | ||
288 | seq[5] = key->u.aes_cmac.tx_pn[0]; | ||
289 | params.seq = seq; | ||
290 | params.seq_len = 6; | ||
291 | break; | ||
278 | } | 292 | } |
279 | 293 | ||
280 | params.key = key->conf.key; | 294 | params.key = key->conf.key; |
@@ -304,6 +318,22 @@ static int ieee80211_config_default_key(struct wiphy *wiphy, | |||
304 | return 0; | 318 | return 0; |
305 | } | 319 | } |
306 | 320 | ||
321 | static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy, | ||
322 | struct net_device *dev, | ||
323 | u8 key_idx) | ||
324 | { | ||
325 | struct ieee80211_sub_if_data *sdata; | ||
326 | |||
327 | rcu_read_lock(); | ||
328 | |||
329 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
330 | ieee80211_set_default_mgmt_key(sdata, key_idx); | ||
331 | |||
332 | rcu_read_unlock(); | ||
333 | |||
334 | return 0; | ||
335 | } | ||
336 | |||
307 | static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | 337 | static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) |
308 | { | 338 | { |
309 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 339 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
@@ -311,11 +341,15 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
311 | sinfo->filled = STATION_INFO_INACTIVE_TIME | | 341 | sinfo->filled = STATION_INFO_INACTIVE_TIME | |
312 | STATION_INFO_RX_BYTES | | 342 | STATION_INFO_RX_BYTES | |
313 | STATION_INFO_TX_BYTES | | 343 | STATION_INFO_TX_BYTES | |
344 | STATION_INFO_RX_PACKETS | | ||
345 | STATION_INFO_TX_PACKETS | | ||
314 | STATION_INFO_TX_BITRATE; | 346 | STATION_INFO_TX_BITRATE; |
315 | 347 | ||
316 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); | 348 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); |
317 | sinfo->rx_bytes = sta->rx_bytes; | 349 | sinfo->rx_bytes = sta->rx_bytes; |
318 | sinfo->tx_bytes = sta->tx_bytes; | 350 | sinfo->tx_bytes = sta->tx_bytes; |
351 | sinfo->rx_packets = sta->rx_packets; | ||
352 | sinfo->tx_packets = sta->tx_packets; | ||
319 | 353 | ||
320 | if (sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) { | 354 | if (sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) { |
321 | sinfo->filled |= STATION_INFO_SIGNAL; | 355 | sinfo->filled |= STATION_INFO_SIGNAL; |
@@ -417,7 +451,8 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
417 | * This is a kludge. beacon interval should really be part | 451 | * This is a kludge. beacon interval should really be part |
418 | * of the beacon information. | 452 | * of the beacon information. |
419 | */ | 453 | */ |
420 | if (params->interval) { | 454 | if (params->interval && (sdata->local->hw.conf.beacon_int != |
455 | params->interval)) { | ||
421 | sdata->local->hw.conf.beacon_int = params->interval; | 456 | sdata->local->hw.conf.beacon_int = params->interval; |
422 | err = ieee80211_hw_config(sdata->local, | 457 | err = ieee80211_hw_config(sdata->local, |
423 | IEEE80211_CONF_CHANGE_BEACON_INTERVAL); | 458 | IEEE80211_CONF_CHANGE_BEACON_INTERVAL); |
@@ -493,7 +528,8 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
493 | 528 | ||
494 | kfree(old); | 529 | kfree(old); |
495 | 530 | ||
496 | return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON); | 531 | return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON | |
532 | IEEE80211_IFCC_BEACON_ENABLED); | ||
497 | } | 533 | } |
498 | 534 | ||
499 | static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, | 535 | static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, |
@@ -504,9 +540,6 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
504 | 540 | ||
505 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 541 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
506 | 542 | ||
507 | if (sdata->vif.type != NL80211_IFTYPE_AP) | ||
508 | return -EINVAL; | ||
509 | |||
510 | old = sdata->u.ap.beacon; | 543 | old = sdata->u.ap.beacon; |
511 | 544 | ||
512 | if (old) | 545 | if (old) |
@@ -523,9 +556,6 @@ static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
523 | 556 | ||
524 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 557 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
525 | 558 | ||
526 | if (sdata->vif.type != NL80211_IFTYPE_AP) | ||
527 | return -EINVAL; | ||
528 | |||
529 | old = sdata->u.ap.beacon; | 559 | old = sdata->u.ap.beacon; |
530 | 560 | ||
531 | if (!old) | 561 | if (!old) |
@@ -541,9 +571,6 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
541 | 571 | ||
542 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 572 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
543 | 573 | ||
544 | if (sdata->vif.type != NL80211_IFTYPE_AP) | ||
545 | return -EINVAL; | ||
546 | |||
547 | old = sdata->u.ap.beacon; | 574 | old = sdata->u.ap.beacon; |
548 | 575 | ||
549 | if (!old) | 576 | if (!old) |
@@ -553,7 +580,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
553 | synchronize_rcu(); | 580 | synchronize_rcu(); |
554 | kfree(old); | 581 | kfree(old); |
555 | 582 | ||
556 | return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON); | 583 | return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED); |
557 | } | 584 | } |
558 | 585 | ||
559 | /* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ | 586 | /* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ |
@@ -630,6 +657,10 @@ static void sta_apply_parameters(struct ieee80211_local *local, | |||
630 | sta->flags &= ~WLAN_STA_WME; | 657 | sta->flags &= ~WLAN_STA_WME; |
631 | if (params->station_flags & STATION_FLAG_WME) | 658 | if (params->station_flags & STATION_FLAG_WME) |
632 | sta->flags |= WLAN_STA_WME; | 659 | sta->flags |= WLAN_STA_WME; |
660 | |||
661 | sta->flags &= ~WLAN_STA_MFP; | ||
662 | if (params->station_flags & STATION_FLAG_MFP) | ||
663 | sta->flags |= WLAN_STA_MFP; | ||
633 | spin_unlock_bh(&sta->lock); | 664 | spin_unlock_bh(&sta->lock); |
634 | } | 665 | } |
635 | 666 | ||
@@ -688,10 +719,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
688 | int err; | 719 | int err; |
689 | int layer2_update; | 720 | int layer2_update; |
690 | 721 | ||
691 | /* Prevent a race with changing the rate control algorithm */ | ||
692 | if (!netif_running(dev)) | ||
693 | return -ENETDOWN; | ||
694 | |||
695 | if (params->vlan) { | 722 | if (params->vlan) { |
696 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 723 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
697 | 724 | ||
@@ -820,14 +847,8 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
820 | struct sta_info *sta; | 847 | struct sta_info *sta; |
821 | int err; | 848 | int err; |
822 | 849 | ||
823 | if (!netif_running(dev)) | ||
824 | return -ENETDOWN; | ||
825 | |||
826 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 850 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
827 | 851 | ||
828 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
829 | return -ENOTSUPP; | ||
830 | |||
831 | rcu_read_lock(); | 852 | rcu_read_lock(); |
832 | sta = sta_info_get(local, next_hop); | 853 | sta = sta_info_get(local, next_hop); |
833 | if (!sta) { | 854 | if (!sta) { |
@@ -873,14 +894,8 @@ static int ieee80211_change_mpath(struct wiphy *wiphy, | |||
873 | struct mesh_path *mpath; | 894 | struct mesh_path *mpath; |
874 | struct sta_info *sta; | 895 | struct sta_info *sta; |
875 | 896 | ||
876 | if (!netif_running(dev)) | ||
877 | return -ENETDOWN; | ||
878 | |||
879 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 897 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
880 | 898 | ||
881 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
882 | return -ENOTSUPP; | ||
883 | |||
884 | rcu_read_lock(); | 899 | rcu_read_lock(); |
885 | 900 | ||
886 | sta = sta_info_get(local, next_hop); | 901 | sta = sta_info_get(local, next_hop); |
@@ -949,9 +964,6 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
949 | 964 | ||
950 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 965 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
951 | 966 | ||
952 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
953 | return -ENOTSUPP; | ||
954 | |||
955 | rcu_read_lock(); | 967 | rcu_read_lock(); |
956 | mpath = mesh_path_lookup(dst, sdata); | 968 | mpath = mesh_path_lookup(dst, sdata); |
957 | if (!mpath) { | 969 | if (!mpath) { |
@@ -973,9 +985,6 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
973 | 985 | ||
974 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 986 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
975 | 987 | ||
976 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
977 | return -ENOTSUPP; | ||
978 | |||
979 | rcu_read_lock(); | 988 | rcu_read_lock(); |
980 | mpath = mesh_path_lookup_by_idx(idx, sdata); | 989 | mpath = mesh_path_lookup_by_idx(idx, sdata); |
981 | if (!mpath) { | 990 | if (!mpath) { |
@@ -995,8 +1004,6 @@ static int ieee80211_get_mesh_params(struct wiphy *wiphy, | |||
995 | struct ieee80211_sub_if_data *sdata; | 1004 | struct ieee80211_sub_if_data *sdata; |
996 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1005 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
997 | 1006 | ||
998 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
999 | return -ENOTSUPP; | ||
1000 | memcpy(conf, &(sdata->u.mesh.mshcfg), sizeof(struct mesh_config)); | 1007 | memcpy(conf, &(sdata->u.mesh.mshcfg), sizeof(struct mesh_config)); |
1001 | return 0; | 1008 | return 0; |
1002 | } | 1009 | } |
@@ -1014,9 +1021,6 @@ static int ieee80211_set_mesh_params(struct wiphy *wiphy, | |||
1014 | struct ieee80211_sub_if_data *sdata; | 1021 | struct ieee80211_sub_if_data *sdata; |
1015 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1022 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1016 | 1023 | ||
1017 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
1018 | return -ENOTSUPP; | ||
1019 | |||
1020 | /* Set the config options which we are interested in setting */ | 1024 | /* Set the config options which we are interested in setting */ |
1021 | conf = &(sdata->u.mesh.mshcfg); | 1025 | conf = &(sdata->u.mesh.mshcfg); |
1022 | if (_chg_mesh_attr(NL80211_MESHCONF_RETRY_TIMEOUT, mask)) | 1026 | if (_chg_mesh_attr(NL80211_MESHCONF_RETRY_TIMEOUT, mask)) |
@@ -1064,9 +1068,6 @@ static int ieee80211_change_bss(struct wiphy *wiphy, | |||
1064 | 1068 | ||
1065 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1069 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1066 | 1070 | ||
1067 | if (sdata->vif.type != NL80211_IFTYPE_AP) | ||
1068 | return -EINVAL; | ||
1069 | |||
1070 | if (params->use_cts_prot >= 0) { | 1071 | if (params->use_cts_prot >= 0) { |
1071 | sdata->vif.bss_conf.use_cts_prot = params->use_cts_prot; | 1072 | sdata->vif.bss_conf.use_cts_prot = params->use_cts_prot; |
1072 | changed |= BSS_CHANGED_ERP_CTS_PROT; | 1073 | changed |= BSS_CHANGED_ERP_CTS_PROT; |
@@ -1141,6 +1142,150 @@ static int ieee80211_set_channel(struct wiphy *wiphy, | |||
1141 | return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); | 1142 | return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); |
1142 | } | 1143 | } |
1143 | 1144 | ||
1145 | #ifdef CONFIG_PM | ||
1146 | static int ieee80211_suspend(struct wiphy *wiphy) | ||
1147 | { | ||
1148 | return __ieee80211_suspend(wiphy_priv(wiphy)); | ||
1149 | } | ||
1150 | |||
1151 | static int ieee80211_resume(struct wiphy *wiphy) | ||
1152 | { | ||
1153 | return __ieee80211_resume(wiphy_priv(wiphy)); | ||
1154 | } | ||
1155 | #else | ||
1156 | #define ieee80211_suspend NULL | ||
1157 | #define ieee80211_resume NULL | ||
1158 | #endif | ||
1159 | |||
1160 | static int ieee80211_scan(struct wiphy *wiphy, | ||
1161 | struct net_device *dev, | ||
1162 | struct cfg80211_scan_request *req) | ||
1163 | { | ||
1164 | struct ieee80211_sub_if_data *sdata; | ||
1165 | |||
1166 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1167 | |||
1168 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | ||
1169 | sdata->vif.type != NL80211_IFTYPE_ADHOC && | ||
1170 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
1171 | return -EOPNOTSUPP; | ||
1172 | |||
1173 | return ieee80211_request_scan(sdata, req); | ||
1174 | } | ||
1175 | |||
1176 | static int ieee80211_auth(struct wiphy *wiphy, struct net_device *dev, | ||
1177 | struct cfg80211_auth_request *req) | ||
1178 | { | ||
1179 | struct ieee80211_sub_if_data *sdata; | ||
1180 | |||
1181 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1182 | |||
1183 | switch (req->auth_type) { | ||
1184 | case NL80211_AUTHTYPE_OPEN_SYSTEM: | ||
1185 | sdata->u.mgd.auth_algs = IEEE80211_AUTH_ALG_OPEN; | ||
1186 | break; | ||
1187 | case NL80211_AUTHTYPE_SHARED_KEY: | ||
1188 | sdata->u.mgd.auth_algs = IEEE80211_AUTH_ALG_SHARED_KEY; | ||
1189 | break; | ||
1190 | case NL80211_AUTHTYPE_FT: | ||
1191 | sdata->u.mgd.auth_algs = IEEE80211_AUTH_ALG_FT; | ||
1192 | break; | ||
1193 | case NL80211_AUTHTYPE_NETWORK_EAP: | ||
1194 | sdata->u.mgd.auth_algs = IEEE80211_AUTH_ALG_LEAP; | ||
1195 | break; | ||
1196 | default: | ||
1197 | return -EOPNOTSUPP; | ||
1198 | } | ||
1199 | |||
1200 | memcpy(sdata->u.mgd.bssid, req->peer_addr, ETH_ALEN); | ||
1201 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; | ||
1202 | sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET; | ||
1203 | |||
1204 | /* TODO: req->chan */ | ||
1205 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL; | ||
1206 | |||
1207 | if (req->ssid) { | ||
1208 | sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET; | ||
1209 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); | ||
1210 | sdata->u.mgd.ssid_len = req->ssid_len; | ||
1211 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL; | ||
1212 | } | ||
1213 | |||
1214 | kfree(sdata->u.mgd.sme_auth_ie); | ||
1215 | sdata->u.mgd.sme_auth_ie = NULL; | ||
1216 | sdata->u.mgd.sme_auth_ie_len = 0; | ||
1217 | if (req->ie) { | ||
1218 | sdata->u.mgd.sme_auth_ie = kmalloc(req->ie_len, GFP_KERNEL); | ||
1219 | if (sdata->u.mgd.sme_auth_ie == NULL) | ||
1220 | return -ENOMEM; | ||
1221 | memcpy(sdata->u.mgd.sme_auth_ie, req->ie, req->ie_len); | ||
1222 | sdata->u.mgd.sme_auth_ie_len = req->ie_len; | ||
1223 | } | ||
1224 | |||
1225 | sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME; | ||
1226 | sdata->u.mgd.state = IEEE80211_STA_MLME_DIRECT_PROBE; | ||
1227 | ieee80211_sta_req_auth(sdata); | ||
1228 | return 0; | ||
1229 | } | ||
1230 | |||
1231 | static int ieee80211_assoc(struct wiphy *wiphy, struct net_device *dev, | ||
1232 | struct cfg80211_assoc_request *req) | ||
1233 | { | ||
1234 | struct ieee80211_sub_if_data *sdata; | ||
1235 | int ret; | ||
1236 | |||
1237 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1238 | |||
1239 | if (memcmp(sdata->u.mgd.bssid, req->peer_addr, ETH_ALEN) != 0 || | ||
1240 | !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) | ||
1241 | return -ENOLINK; /* not authenticated */ | ||
1242 | |||
1243 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL; | ||
1244 | sdata->u.mgd.flags |= IEEE80211_STA_BSSID_SET; | ||
1245 | |||
1246 | /* TODO: req->chan */ | ||
1247 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_CHANNEL_SEL; | ||
1248 | |||
1249 | if (req->ssid) { | ||
1250 | sdata->u.mgd.flags |= IEEE80211_STA_SSID_SET; | ||
1251 | memcpy(sdata->u.mgd.ssid, req->ssid, req->ssid_len); | ||
1252 | sdata->u.mgd.ssid_len = req->ssid_len; | ||
1253 | sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_SSID_SEL; | ||
1254 | } else | ||
1255 | sdata->u.mgd.flags |= IEEE80211_STA_AUTO_SSID_SEL; | ||
1256 | |||
1257 | ret = ieee80211_sta_set_extra_ie(sdata, req->ie, req->ie_len); | ||
1258 | if (ret) | ||
1259 | return ret; | ||
1260 | |||
1261 | sdata->u.mgd.flags |= IEEE80211_STA_EXT_SME; | ||
1262 | sdata->u.mgd.state = IEEE80211_STA_MLME_ASSOCIATE; | ||
1263 | ieee80211_sta_req_auth(sdata); | ||
1264 | return 0; | ||
1265 | } | ||
1266 | |||
1267 | static int ieee80211_deauth(struct wiphy *wiphy, struct net_device *dev, | ||
1268 | struct cfg80211_deauth_request *req) | ||
1269 | { | ||
1270 | struct ieee80211_sub_if_data *sdata; | ||
1271 | |||
1272 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1273 | |||
1274 | /* TODO: req->ie */ | ||
1275 | return ieee80211_sta_deauthenticate(sdata, req->reason_code); | ||
1276 | } | ||
1277 | |||
1278 | static int ieee80211_disassoc(struct wiphy *wiphy, struct net_device *dev, | ||
1279 | struct cfg80211_disassoc_request *req) | ||
1280 | { | ||
1281 | struct ieee80211_sub_if_data *sdata; | ||
1282 | |||
1283 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1284 | |||
1285 | /* TODO: req->ie */ | ||
1286 | return ieee80211_sta_disassociate(sdata, req->reason_code); | ||
1287 | } | ||
1288 | |||
1144 | struct cfg80211_ops mac80211_config_ops = { | 1289 | struct cfg80211_ops mac80211_config_ops = { |
1145 | .add_virtual_intf = ieee80211_add_iface, | 1290 | .add_virtual_intf = ieee80211_add_iface, |
1146 | .del_virtual_intf = ieee80211_del_iface, | 1291 | .del_virtual_intf = ieee80211_del_iface, |
@@ -1149,6 +1294,7 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1149 | .del_key = ieee80211_del_key, | 1294 | .del_key = ieee80211_del_key, |
1150 | .get_key = ieee80211_get_key, | 1295 | .get_key = ieee80211_get_key, |
1151 | .set_default_key = ieee80211_config_default_key, | 1296 | .set_default_key = ieee80211_config_default_key, |
1297 | .set_default_mgmt_key = ieee80211_config_default_mgmt_key, | ||
1152 | .add_beacon = ieee80211_add_beacon, | 1298 | .add_beacon = ieee80211_add_beacon, |
1153 | .set_beacon = ieee80211_set_beacon, | 1299 | .set_beacon = ieee80211_set_beacon, |
1154 | .del_beacon = ieee80211_del_beacon, | 1300 | .del_beacon = ieee80211_del_beacon, |
@@ -1169,4 +1315,11 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1169 | .change_bss = ieee80211_change_bss, | 1315 | .change_bss = ieee80211_change_bss, |
1170 | .set_txq_params = ieee80211_set_txq_params, | 1316 | .set_txq_params = ieee80211_set_txq_params, |
1171 | .set_channel = ieee80211_set_channel, | 1317 | .set_channel = ieee80211_set_channel, |
1318 | .suspend = ieee80211_suspend, | ||
1319 | .resume = ieee80211_resume, | ||
1320 | .scan = ieee80211_scan, | ||
1321 | .auth = ieee80211_auth, | ||
1322 | .assoc = ieee80211_assoc, | ||
1323 | .deauth = ieee80211_deauth, | ||
1324 | .disassoc = ieee80211_disassoc, | ||
1172 | }; | 1325 | }; |