aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-26 09:19:48 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:17 -0400
commit51617f0b76389b29740aa9d7736df99b75d1d9ec (patch)
treedd67f62185bb98b35f796b083a82be44d895495a
parent53918994b7c8c3bf0af5f641e1f299856799d883 (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>
-rw-r--r--net/mac80211/hostapd_ioctl.h61
-rw-r--r--net/mac80211/ieee80211_i.h5
-rw-r--r--net/mac80211/ieee80211_ioctl.c272
-rw-r--r--net/mac80211/ieee80211_sta.c1
4 files changed, 0 insertions, 339 deletions
diff --git a/net/mac80211/hostapd_ioctl.h b/net/mac80211/hostapd_ioctl.h
deleted file mode 100644
index 2300c5516458..000000000000
--- a/net/mac80211/hostapd_ioctl.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Host AP (software wireless LAN access point) user space daemon for
3 * Host AP kernel driver
4 * Copyright 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
5 * Copyright 2002-2004, Instant802 Networks, Inc.
6 * Copyright 2005, Devicescape Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef HOSTAPD_IOCTL_H
14#define HOSTAPD_IOCTL_H
15
16#ifdef __KERNEL__
17#include <linux/types.h>
18#endif /* __KERNEL__ */
19
20#define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
21#define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
22#define PRISM2_IOCTL_HOSTAPD (SIOCIWFIRSTPRIV + 3)
23
24/* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes:
25 * This table is no longer added to, the whole sub-ioctl
26 * mess shall be deleted completely. */
27enum {
28 PRISM2_PARAM_IEEE_802_1X = 23,
29
30 /* Instant802 additions */
31 PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001,
32 PRISM2_PARAM_PREAMBLE = 1003,
33 PRISM2_PARAM_SHORT_SLOT_TIME = 1006,
34 PRISM2_PARAM_NEXT_MODE = 1008,
35 PRISM2_PARAM_WIFI_WME_NOACK_TEST = 1033,
36 PRISM2_PARAM_SCAN_FLAGS = 1035,
37 PRISM2_PARAM_HW_MODES = 1036,
38 PRISM2_PARAM_CREATE_IBSS = 1037,
39 PRISM2_PARAM_WMM_ENABLED = 1038,
40 PRISM2_PARAM_MIXED_CELL = 1039,
41};
42
43/* Data structures used for get_hw_features ioctl */
44struct hostapd_ioctl_hw_modes_hdr {
45 int mode;
46 int num_channels;
47 int num_rates;
48};
49
50struct ieee80211_channel_data {
51 short chan; /* channel number (IEEE 802.11) */
52 short freq; /* frequency in MHz */
53 int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
54};
55
56struct ieee80211_rate_data {
57 int rate; /* rate in 100 kbps */
58 int flags; /* IEEE80211_RATE_ flags */
59};
60
61#endif /* HOSTAPD_IOCTL_H */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 38e0a467fa8e..d2f8c8e57ac4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -449,11 +449,6 @@ struct ieee80211_local {
449 449
450 struct rate_control_ref *rate_ctrl; 450 struct rate_control_ref *rate_ctrl;
451 451
452 int next_mode; /* MODE_IEEE80211*
453 * The mode preference for next channel change. This is
454 * used to select .11g vs. .11b channels (or 4.9 GHz vs.
455 * .11a) when the channel number is not unique. */
456
457 /* Supported and basic rate filters for different modes. These are 452 /* Supported and basic rate filters for different modes. These are
458 * pointers to -1 terminated lists and rates in 100 kbps units. */ 453 * pointers to -1 terminated lists and rates in 100 kbps units. */
459 int *supp_rates[NUM_IEEE80211_MODES]; 454 int *supp_rates[NUM_IEEE80211_MODES];
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 */
34static 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
51static 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
64static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, 29static 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
847static 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
977static 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
1061static int ieee80211_ioctl_siwmlme(struct net_device *dev, 807static 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
1316static 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
1326static const iw_handler ieee80211_handler[] = 1064static 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
1386static 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
1392const struct iw_handler_def ieee80211_iw_handler_def = 1124const 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};
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 651aaba1add4..cf50a7bfb970 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -31,7 +31,6 @@
31#include <net/mac80211.h> 31#include <net/mac80211.h>
32#include "ieee80211_i.h" 32#include "ieee80211_i.h"
33#include "ieee80211_rate.h" 33#include "ieee80211_rate.h"
34#include "hostapd_ioctl.h"
35 34
36#define IEEE80211_AUTH_TIMEOUT (HZ / 5) 35#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
37#define IEEE80211_AUTH_MAX_TRIES 3 36#define IEEE80211_AUTH_MAX_TRIES 3