diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-09-26 09:19:48 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:17 -0400 |
commit | 51617f0b76389b29740aa9d7736df99b75d1d9ec (patch) | |
tree | dd67f62185bb98b35f796b083a82be44d895495a /net/mac80211/ieee80211_ioctl.c | |
parent | 53918994b7c8c3bf0af5f641e1f299856799d883 (diff) |
[PATCH] mac80211: remove all prism2 ioctls
This patch removes all prism2 ioctls.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 272 |
1 files changed, 0 insertions, 272 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 99023d0d7edc..3c324c3bcd9c 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -21,46 +21,11 @@ | |||
21 | 21 | ||
22 | #include <net/mac80211.h> | 22 | #include <net/mac80211.h> |
23 | #include "ieee80211_i.h" | 23 | #include "ieee80211_i.h" |
24 | #include "hostapd_ioctl.h" | ||
25 | #include "ieee80211_rate.h" | 24 | #include "ieee80211_rate.h" |
26 | #include "wpa.h" | 25 | #include "wpa.h" |
27 | #include "aes_ccm.h" | 26 | #include "aes_ccm.h" |
28 | 27 | ||
29 | 28 | ||
30 | /* | ||
31 | * Wow. This ioctl interface is such crap, it's tied | ||
32 | * to internal definitions. I hope it dies soon. | ||
33 | */ | ||
34 | static int mode_to_hostapd_mode(enum ieee80211_phymode mode) | ||
35 | { | ||
36 | switch (mode) { | ||
37 | case MODE_IEEE80211A: | ||
38 | return 0; | ||
39 | case MODE_IEEE80211B: | ||
40 | return 1; | ||
41 | case MODE_IEEE80211G: | ||
42 | return 3; | ||
43 | case NUM_IEEE80211_MODES: | ||
44 | WARN_ON(1); | ||
45 | break; | ||
46 | } | ||
47 | WARN_ON(1); | ||
48 | return -1; | ||
49 | } | ||
50 | |||
51 | static enum ieee80211_phymode hostapd_mode_to_mode(int hostapd_mode) | ||
52 | { | ||
53 | switch (hostapd_mode) { | ||
54 | case 0: | ||
55 | return MODE_IEEE80211A; | ||
56 | case 1: | ||
57 | return MODE_IEEE80211B; | ||
58 | case 3: | ||
59 | return MODE_IEEE80211G; | ||
60 | } | ||
61 | return NUM_IEEE80211_MODES; | ||
62 | } | ||
63 | |||
64 | static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, | 29 | static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, |
65 | int idx, int alg, int set_tx_key, | 30 | int idx, int alg, int set_tx_key, |
66 | const u8 *_key, size_t key_len) | 31 | const u8 *_key, size_t key_len) |
@@ -347,11 +312,6 @@ int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq) | |||
347 | struct ieee80211_channel *chan = &mode->channels[c]; | 312 | struct ieee80211_channel *chan = &mode->channels[c]; |
348 | if (chan->flag & IEEE80211_CHAN_W_SCAN && | 313 | if (chan->flag & IEEE80211_CHAN_W_SCAN && |
349 | ((chan->chan == channel) || (chan->freq == freq))) { | 314 | ((chan->chan == channel) || (chan->freq == freq))) { |
350 | /* Use next_mode as the mode preference to | ||
351 | * resolve non-unique channel numbers. */ | ||
352 | if (set && mode->mode != local->next_mode) | ||
353 | continue; | ||
354 | |||
355 | local->oper_channel = chan; | 315 | local->oper_channel = chan; |
356 | local->oper_hw_mode = mode; | 316 | local->oper_hw_mode = mode; |
357 | set++; | 317 | set++; |
@@ -844,220 +804,6 @@ static int ieee80211_ioctl_giwretry(struct net_device *dev, | |||
844 | return 0; | 804 | return 0; |
845 | } | 805 | } |
846 | 806 | ||
847 | static int ieee80211_ioctl_prism2_param(struct net_device *dev, | ||
848 | struct iw_request_info *info, | ||
849 | void *wrqu, char *extra) | ||
850 | { | ||
851 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
852 | struct ieee80211_sub_if_data *sdata; | ||
853 | int *i = (int *) extra; | ||
854 | int param = *i; | ||
855 | int value = *(i + 1); | ||
856 | int ret = 0; | ||
857 | int mode; | ||
858 | |||
859 | if (!capable(CAP_NET_ADMIN)) | ||
860 | return -EPERM; | ||
861 | |||
862 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
863 | |||
864 | switch (param) { | ||
865 | case PRISM2_PARAM_IEEE_802_1X: | ||
866 | if (local->ops->set_ieee8021x) | ||
867 | ret = local->ops->set_ieee8021x(local_to_hw(local), | ||
868 | value); | ||
869 | if (ret) | ||
870 | printk(KERN_DEBUG "%s: failed to set IEEE 802.1X (%d) " | ||
871 | "for low-level driver\n", dev->name, value); | ||
872 | else | ||
873 | sdata->ieee802_1x = value; | ||
874 | break; | ||
875 | |||
876 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: | ||
877 | if (sdata->type == IEEE80211_IF_TYPE_AP) { | ||
878 | if (value) | ||
879 | sdata->flags |= IEEE80211_SDATA_USE_PROTECTION; | ||
880 | else | ||
881 | sdata->flags &= ~IEEE80211_SDATA_USE_PROTECTION; | ||
882 | ieee80211_erp_info_change_notify(dev, | ||
883 | IEEE80211_ERP_CHANGE_PROTECTION); | ||
884 | } else { | ||
885 | ret = -ENOENT; | ||
886 | } | ||
887 | break; | ||
888 | |||
889 | case PRISM2_PARAM_PREAMBLE: | ||
890 | if (sdata->type == IEEE80211_IF_TYPE_AP) { | ||
891 | if (value) | ||
892 | sdata->flags |= IEEE80211_SDATA_SHORT_PREAMBLE; | ||
893 | else | ||
894 | sdata->flags &= ~IEEE80211_SDATA_SHORT_PREAMBLE; | ||
895 | ieee80211_erp_info_change_notify(dev, | ||
896 | IEEE80211_ERP_CHANGE_PREAMBLE); | ||
897 | } else { | ||
898 | ret = -ENOENT; | ||
899 | } | ||
900 | break; | ||
901 | |||
902 | case PRISM2_PARAM_SHORT_SLOT_TIME: | ||
903 | if (value) | ||
904 | local->hw.conf.flags |= IEEE80211_CONF_SHORT_SLOT_TIME; | ||
905 | else | ||
906 | local->hw.conf.flags &= ~IEEE80211_CONF_SHORT_SLOT_TIME; | ||
907 | if (ieee80211_hw_config(local)) | ||
908 | ret = -EINVAL; | ||
909 | break; | ||
910 | |||
911 | case PRISM2_PARAM_NEXT_MODE: | ||
912 | local->next_mode = hostapd_mode_to_mode(value); | ||
913 | break; | ||
914 | |||
915 | case PRISM2_PARAM_WIFI_WME_NOACK_TEST: | ||
916 | local->wifi_wme_noack_test = value; | ||
917 | break; | ||
918 | |||
919 | case PRISM2_PARAM_SCAN_FLAGS: | ||
920 | local->scan_flags = value; | ||
921 | break; | ||
922 | |||
923 | case PRISM2_PARAM_MIXED_CELL: | ||
924 | if (sdata->type != IEEE80211_IF_TYPE_STA && | ||
925 | sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
926 | ret = -EINVAL; | ||
927 | else { | ||
928 | if (value) | ||
929 | sdata->u.sta.flags |= IEEE80211_STA_MIXED_CELL; | ||
930 | else | ||
931 | sdata->u.sta.flags &= ~IEEE80211_STA_MIXED_CELL; | ||
932 | } | ||
933 | break; | ||
934 | |||
935 | case PRISM2_PARAM_HW_MODES: | ||
936 | mode = 1; | ||
937 | local->enabled_modes = 0; | ||
938 | while (value) { | ||
939 | if (value & 1) | ||
940 | local->enabled_modes |= | ||
941 | hostapd_mode_to_mode(mode); | ||
942 | mode <<= 1; | ||
943 | value >>= 1; | ||
944 | } | ||
945 | break; | ||
946 | |||
947 | case PRISM2_PARAM_CREATE_IBSS: | ||
948 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
949 | ret = -EINVAL; | ||
950 | else { | ||
951 | if (value) | ||
952 | sdata->u.sta.flags |= IEEE80211_STA_CREATE_IBSS; | ||
953 | else | ||
954 | sdata->u.sta.flags &= ~IEEE80211_STA_CREATE_IBSS; | ||
955 | } | ||
956 | break; | ||
957 | case PRISM2_PARAM_WMM_ENABLED: | ||
958 | if (sdata->type != IEEE80211_IF_TYPE_STA && | ||
959 | sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
960 | ret = -EINVAL; | ||
961 | else { | ||
962 | if (value) | ||
963 | sdata->u.sta.flags |= IEEE80211_STA_WMM_ENABLED; | ||
964 | else | ||
965 | sdata->u.sta.flags &= ~IEEE80211_STA_WMM_ENABLED; | ||
966 | } | ||
967 | break; | ||
968 | default: | ||
969 | ret = -EOPNOTSUPP; | ||
970 | break; | ||
971 | } | ||
972 | |||
973 | return ret; | ||
974 | } | ||
975 | |||
976 | |||
977 | static int ieee80211_ioctl_get_prism2_param(struct net_device *dev, | ||
978 | struct iw_request_info *info, | ||
979 | void *wrqu, char *extra) | ||
980 | { | ||
981 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
982 | struct ieee80211_sub_if_data *sdata; | ||
983 | int *param = (int *) extra; | ||
984 | int ret = 0; | ||
985 | int mode; | ||
986 | |||
987 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
988 | |||
989 | switch (*param) { | ||
990 | case PRISM2_PARAM_IEEE_802_1X: | ||
991 | *param = sdata->ieee802_1x; | ||
992 | break; | ||
993 | |||
994 | case PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES: | ||
995 | *param = !!(sdata->flags & IEEE80211_SDATA_USE_PROTECTION); | ||
996 | break; | ||
997 | |||
998 | case PRISM2_PARAM_PREAMBLE: | ||
999 | *param = !!(sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE); | ||
1000 | break; | ||
1001 | |||
1002 | case PRISM2_PARAM_SHORT_SLOT_TIME: | ||
1003 | *param = !!(local->hw.conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME); | ||
1004 | break; | ||
1005 | |||
1006 | case PRISM2_PARAM_NEXT_MODE: | ||
1007 | *param = local->next_mode; | ||
1008 | break; | ||
1009 | |||
1010 | case PRISM2_PARAM_WIFI_WME_NOACK_TEST: | ||
1011 | *param = local->wifi_wme_noack_test; | ||
1012 | break; | ||
1013 | |||
1014 | case PRISM2_PARAM_SCAN_FLAGS: | ||
1015 | *param = local->scan_flags; | ||
1016 | break; | ||
1017 | |||
1018 | case PRISM2_PARAM_HW_MODES: | ||
1019 | mode = 0; | ||
1020 | *param = 0; | ||
1021 | while (mode < NUM_IEEE80211_MODES) { | ||
1022 | if (local->enabled_modes & (1<<mode)) | ||
1023 | *param |= mode_to_hostapd_mode(1<<mode); | ||
1024 | mode++; | ||
1025 | } | ||
1026 | break; | ||
1027 | |||
1028 | case PRISM2_PARAM_CREATE_IBSS: | ||
1029 | if (sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
1030 | ret = -EINVAL; | ||
1031 | else | ||
1032 | *param = !!(sdata->u.sta.flags & | ||
1033 | IEEE80211_STA_CREATE_IBSS); | ||
1034 | break; | ||
1035 | |||
1036 | case PRISM2_PARAM_MIXED_CELL: | ||
1037 | if (sdata->type != IEEE80211_IF_TYPE_STA && | ||
1038 | sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
1039 | ret = -EINVAL; | ||
1040 | else | ||
1041 | *param = !!(sdata->u.sta.flags & | ||
1042 | IEEE80211_STA_MIXED_CELL); | ||
1043 | break; | ||
1044 | |||
1045 | case PRISM2_PARAM_WMM_ENABLED: | ||
1046 | if (sdata->type != IEEE80211_IF_TYPE_STA && | ||
1047 | sdata->type != IEEE80211_IF_TYPE_IBSS) | ||
1048 | ret = -EINVAL; | ||
1049 | else | ||
1050 | *param = !!(sdata->u.sta.flags & | ||
1051 | IEEE80211_STA_WMM_ENABLED); | ||
1052 | break; | ||
1053 | default: | ||
1054 | ret = -EOPNOTSUPP; | ||
1055 | break; | ||
1056 | } | ||
1057 | |||
1058 | return ret; | ||
1059 | } | ||
1060 | |||
1061 | static int ieee80211_ioctl_siwmlme(struct net_device *dev, | 807 | static int ieee80211_ioctl_siwmlme(struct net_device *dev, |
1062 | struct iw_request_info *info, | 808 | struct iw_request_info *info, |
1063 | struct iw_point *data, char *extra) | 809 | struct iw_point *data, char *extra) |
@@ -1313,14 +1059,6 @@ static int ieee80211_ioctl_siwencodeext(struct net_device *dev, | |||
1313 | } | 1059 | } |
1314 | 1060 | ||
1315 | 1061 | ||
1316 | static const struct iw_priv_args ieee80211_ioctl_priv[] = { | ||
1317 | { PRISM2_IOCTL_PRISM2_PARAM, | ||
1318 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "param" }, | ||
1319 | { PRISM2_IOCTL_GET_PRISM2_PARAM, | ||
1320 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, | ||
1321 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_param" }, | ||
1322 | }; | ||
1323 | |||
1324 | /* Structures to export the Wireless Handlers */ | 1062 | /* Structures to export the Wireless Handlers */ |
1325 | 1063 | ||
1326 | static const iw_handler ieee80211_handler[] = | 1064 | static const iw_handler ieee80211_handler[] = |
@@ -1383,19 +1121,9 @@ static const iw_handler ieee80211_handler[] = | |||
1383 | (iw_handler) NULL, /* -- hole -- */ | 1121 | (iw_handler) NULL, /* -- hole -- */ |
1384 | }; | 1122 | }; |
1385 | 1123 | ||
1386 | static const iw_handler ieee80211_private_handler[] = | ||
1387 | { /* SIOCIWFIRSTPRIV + */ | ||
1388 | (iw_handler) ieee80211_ioctl_prism2_param, /* 0 */ | ||
1389 | (iw_handler) ieee80211_ioctl_get_prism2_param, /* 1 */ | ||
1390 | }; | ||
1391 | |||
1392 | const struct iw_handler_def ieee80211_iw_handler_def = | 1124 | const struct iw_handler_def ieee80211_iw_handler_def = |
1393 | { | 1125 | { |
1394 | .num_standard = ARRAY_SIZE(ieee80211_handler), | 1126 | .num_standard = ARRAY_SIZE(ieee80211_handler), |
1395 | .num_private = ARRAY_SIZE(ieee80211_private_handler), | ||
1396 | .num_private_args = ARRAY_SIZE(ieee80211_ioctl_priv), | ||
1397 | .standard = (iw_handler *) ieee80211_handler, | 1127 | .standard = (iw_handler *) ieee80211_handler, |
1398 | .private = (iw_handler *) ieee80211_private_handler, | ||
1399 | .private_args = (struct iw_priv_args *) ieee80211_ioctl_priv, | ||
1400 | .get_wireless_stats = ieee80211_get_wireless_stats, | 1128 | .get_wireless_stats = ieee80211_get_wireless_stats, |
1401 | }; | 1129 | }; |