diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/Kconfig | 12 | ||||
-rw-r--r-- | net/mac80211/Makefile | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211.c | 16 | ||||
-rw-r--r-- | net/mac80211/ieee80211_common.h | 91 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 21 | ||||
-rw-r--r-- | net/mac80211/ieee80211_rate.c | 24 | ||||
-rw-r--r-- | net/mac80211/ieee80211_rate.h | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 18 | ||||
-rw-r--r-- | net/mac80211/rc80211_simple.c | 25 | ||||
-rw-r--r-- | net/mac80211/rx.c | 2 | ||||
-rw-r--r-- | net/mac80211/wep.c | 2 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 18 |
13 files changed, 91 insertions, 146 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 6fffb3845ab6..ce176e691afe 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -13,6 +13,18 @@ config MAC80211 | |||
13 | This option enables the hardware independent IEEE 802.11 | 13 | This option enables the hardware independent IEEE 802.11 |
14 | networking stack. | 14 | networking stack. |
15 | 15 | ||
16 | config MAC80211_RCSIMPLE | ||
17 | bool "'simple' rate control algorithm" if EMBEDDED | ||
18 | default y | ||
19 | depends on MAC80211 | ||
20 | help | ||
21 | This option allows you to turn off the 'simple' rate | ||
22 | control algorithm in mac80211. If you do turn it off, | ||
23 | you absolutely need another rate control algorithm. | ||
24 | |||
25 | Say Y unless you know you will have another algorithm | ||
26 | available. | ||
27 | |||
16 | config MAC80211_LEDS | 28 | config MAC80211_LEDS |
17 | bool "Enable LED triggers" | 29 | bool "Enable LED triggers" |
18 | depends on MAC80211 && LEDS_TRIGGERS | 30 | depends on MAC80211 && LEDS_TRIGGERS |
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile index 219cd9f9341f..1e6237b34846 100644 --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile | |||
@@ -1,8 +1,9 @@ | |||
1 | obj-$(CONFIG_MAC80211) += mac80211.o rc80211_simple.o | 1 | obj-$(CONFIG_MAC80211) += mac80211.o |
2 | 2 | ||
3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o | 3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o |
4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o | 4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o |
5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o | 5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o |
6 | mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o | ||
6 | 7 | ||
7 | mac80211-objs := \ | 8 | mac80211-objs := \ |
8 | ieee80211.o \ | 9 | ieee80211.o \ |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index f484ca7ade9c..e0ee65a969bc 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -1072,7 +1072,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
1072 | ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev)); | 1072 | ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev)); |
1073 | ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP); | 1073 | ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP); |
1074 | 1074 | ||
1075 | result = ieee80211_init_rate_ctrl_alg(local, NULL); | 1075 | result = ieee80211_init_rate_ctrl_alg(local, |
1076 | hw->rate_control_algorithm); | ||
1076 | if (result < 0) { | 1077 | if (result < 0) { |
1077 | printk(KERN_DEBUG "%s: Failed to initialize rate control " | 1078 | printk(KERN_DEBUG "%s: Failed to initialize rate control " |
1078 | "algorithm\n", wiphy_name(local->hw.wiphy)); | 1079 | "algorithm\n", wiphy_name(local->hw.wiphy)); |
@@ -1233,8 +1234,17 @@ static int __init ieee80211_init(void) | |||
1233 | 1234 | ||
1234 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); | 1235 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); |
1235 | 1236 | ||
1237 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
1238 | ret = ieee80211_rate_control_register(&mac80211_rcsimple); | ||
1239 | if (ret) | ||
1240 | return ret; | ||
1241 | #endif | ||
1242 | |||
1236 | ret = ieee80211_wme_register(); | 1243 | ret = ieee80211_wme_register(); |
1237 | if (ret) { | 1244 | if (ret) { |
1245 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
1246 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | ||
1247 | #endif | ||
1238 | printk(KERN_DEBUG "ieee80211_init: failed to " | 1248 | printk(KERN_DEBUG "ieee80211_init: failed to " |
1239 | "initialize WME (err=%d)\n", ret); | 1249 | "initialize WME (err=%d)\n", ret); |
1240 | return ret; | 1250 | return ret; |
@@ -1248,6 +1258,10 @@ static int __init ieee80211_init(void) | |||
1248 | 1258 | ||
1249 | static void __exit ieee80211_exit(void) | 1259 | static void __exit ieee80211_exit(void) |
1250 | { | 1260 | { |
1261 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
1262 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | ||
1263 | #endif | ||
1264 | |||
1251 | ieee80211_wme_unregister(); | 1265 | ieee80211_wme_unregister(); |
1252 | ieee80211_debugfs_netdev_exit(); | 1266 | ieee80211_debugfs_netdev_exit(); |
1253 | } | 1267 | } |
diff --git a/net/mac80211/ieee80211_common.h b/net/mac80211/ieee80211_common.h deleted file mode 100644 index c15295d43d87..000000000000 --- a/net/mac80211/ieee80211_common.h +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | /* | ||
2 | * IEEE 802.11 driver (80211.o) -- hostapd interface | ||
3 | * Copyright 2002-2004, Instant802 Networks, Inc. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef IEEE80211_COMMON_H | ||
11 | #define IEEE80211_COMMON_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | /* | ||
16 | * This is common header information with user space. It is used on all | ||
17 | * frames sent to wlan#ap interface. | ||
18 | */ | ||
19 | |||
20 | #define IEEE80211_FI_VERSION 0x80211001 | ||
21 | |||
22 | struct ieee80211_frame_info { | ||
23 | __be32 version; | ||
24 | __be32 length; | ||
25 | __be64 mactime; | ||
26 | __be64 hosttime; | ||
27 | __be32 phytype; | ||
28 | __be32 channel; | ||
29 | __be32 datarate; | ||
30 | __be32 antenna; | ||
31 | __be32 priority; | ||
32 | __be32 ssi_type; | ||
33 | __be32 ssi_signal; | ||
34 | __be32 ssi_noise; | ||
35 | __be32 preamble; | ||
36 | __be32 encoding; | ||
37 | |||
38 | /* Note: this structure is otherwise identical to capture format used | ||
39 | * in linux-wlan-ng, but this additional field is used to provide meta | ||
40 | * data about the frame to hostapd. This was the easiest method for | ||
41 | * providing this information, but this might change in the future. */ | ||
42 | __be32 msg_type; | ||
43 | } __attribute__ ((packed)); | ||
44 | |||
45 | |||
46 | enum ieee80211_msg_type { | ||
47 | ieee80211_msg_normal = 0, | ||
48 | ieee80211_msg_tx_callback_ack = 1, | ||
49 | ieee80211_msg_tx_callback_fail = 2, | ||
50 | /* hole at 3, was ieee80211_msg_passive_scan but unused */ | ||
51 | /* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */ | ||
52 | ieee80211_msg_michael_mic_failure = 5, | ||
53 | /* hole at 6, was monitor but never sent to userspace */ | ||
54 | ieee80211_msg_sta_not_assoc = 7, | ||
55 | /* 8 was ieee80211_msg_set_aid_for_sta */ | ||
56 | /* 9 was ieee80211_msg_key_threshold_notification */ | ||
57 | /* 11 was ieee80211_msg_radar */ | ||
58 | }; | ||
59 | |||
60 | struct ieee80211_msg_key_notification { | ||
61 | int tx_rx_count; | ||
62 | char ifname[IFNAMSIZ]; | ||
63 | u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */ | ||
64 | }; | ||
65 | |||
66 | |||
67 | enum ieee80211_phytype { | ||
68 | ieee80211_phytype_fhss_dot11_97 = 1, | ||
69 | ieee80211_phytype_dsss_dot11_97 = 2, | ||
70 | ieee80211_phytype_irbaseband = 3, | ||
71 | ieee80211_phytype_dsss_dot11_b = 4, | ||
72 | ieee80211_phytype_pbcc_dot11_b = 5, | ||
73 | ieee80211_phytype_ofdm_dot11_g = 6, | ||
74 | ieee80211_phytype_pbcc_dot11_g = 7, | ||
75 | ieee80211_phytype_ofdm_dot11_a = 8, | ||
76 | }; | ||
77 | |||
78 | enum ieee80211_ssi_type { | ||
79 | ieee80211_ssi_none = 0, | ||
80 | ieee80211_ssi_norm = 1, /* normalized, 0-1000 */ | ||
81 | ieee80211_ssi_dbm = 2, | ||
82 | ieee80211_ssi_raw = 3, /* raw SSI */ | ||
83 | }; | ||
84 | |||
85 | struct ieee80211_radar_info { | ||
86 | int channel; | ||
87 | int radar; | ||
88 | int radar_type; | ||
89 | }; | ||
90 | |||
91 | #endif /* IEEE80211_COMMON_H */ | ||
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index d575ccd67e91..72e1c93dd87e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -230,6 +230,7 @@ struct ieee80211_if_vlan { | |||
230 | #define IEEE80211_STA_AUTO_SSID_SEL BIT(10) | 230 | #define IEEE80211_STA_AUTO_SSID_SEL BIT(10) |
231 | #define IEEE80211_STA_AUTO_BSSID_SEL BIT(11) | 231 | #define IEEE80211_STA_AUTO_BSSID_SEL BIT(11) |
232 | #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) | 232 | #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) |
233 | #define IEEE80211_STA_PRIVACY_INVOKED BIT(13) | ||
233 | struct ieee80211_if_sta { | 234 | struct ieee80211_if_sta { |
234 | enum { | 235 | enum { |
235 | IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, | 236 | IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, |
@@ -261,7 +262,6 @@ struct ieee80211_if_sta { | |||
261 | unsigned long request; | 262 | unsigned long request; |
262 | struct sk_buff_head skb_queue; | 263 | struct sk_buff_head skb_queue; |
263 | 264 | ||
264 | int key_management_enabled; | ||
265 | unsigned long last_probe; | 265 | unsigned long last_probe; |
266 | 266 | ||
267 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) | 267 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) |
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec2cff7..7027eed4d4ae 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -917,7 +917,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
917 | struct iw_request_info *info, | 917 | struct iw_request_info *info, |
918 | struct iw_param *data, char *extra) | 918 | struct iw_param *data, char *extra) |
919 | { | 919 | { |
920 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
921 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 920 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
922 | int ret = 0; | 921 | int ret = 0; |
923 | 922 | ||
@@ -927,18 +926,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
927 | case IW_AUTH_CIPHER_GROUP: | 926 | case IW_AUTH_CIPHER_GROUP: |
928 | case IW_AUTH_WPA_ENABLED: | 927 | case IW_AUTH_WPA_ENABLED: |
929 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: | 928 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: |
930 | break; | ||
931 | case IW_AUTH_KEY_MGMT: | 929 | case IW_AUTH_KEY_MGMT: |
930 | break; | ||
931 | case IW_AUTH_PRIVACY_INVOKED: | ||
932 | if (sdata->type != IEEE80211_IF_TYPE_STA) | 932 | if (sdata->type != IEEE80211_IF_TYPE_STA) |
933 | ret = -EINVAL; | 933 | ret = -EINVAL; |
934 | else { | 934 | else { |
935 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; | ||
935 | /* | 936 | /* |
936 | * Key management was set by wpa_supplicant, | 937 | * Privacy invoked by wpa_supplicant, store the |
937 | * we only need this to associate to a network | 938 | * value and allow associating to a protected |
938 | * that has privacy enabled regardless of not | 939 | * network without having a key up front. |
939 | * having a key. | ||
940 | */ | 940 | */ |
941 | sdata->u.sta.key_management_enabled = !!data->value; | 941 | if (data->value) |
942 | sdata->u.sta.flags |= | ||
943 | IEEE80211_STA_PRIVACY_INVOKED; | ||
942 | } | 944 | } |
943 | break; | 945 | break; |
944 | case IW_AUTH_80211_AUTH_ALG: | 946 | case IW_AUTH_80211_AUTH_ALG: |
@@ -948,11 +950,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
948 | else | 950 | else |
949 | ret = -EOPNOTSUPP; | 951 | ret = -EOPNOTSUPP; |
950 | break; | 952 | break; |
951 | case IW_AUTH_PRIVACY_INVOKED: | ||
952 | if (local->ops->set_privacy_invoked) | ||
953 | ret = local->ops->set_privacy_invoked( | ||
954 | local_to_hw(local), data->value); | ||
955 | break; | ||
956 | default: | 953 | default: |
957 | ret = -EOPNOTSUPP; | 954 | ret = -EOPNOTSUPP; |
958 | break; | 955 | break; |
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index 93abb8fff141..7254bd609839 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
@@ -25,13 +25,25 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops) | |||
25 | { | 25 | { |
26 | struct rate_control_alg *alg; | 26 | struct rate_control_alg *alg; |
27 | 27 | ||
28 | if (!ops->name) | ||
29 | return -EINVAL; | ||
30 | |||
31 | mutex_lock(&rate_ctrl_mutex); | ||
32 | list_for_each_entry(alg, &rate_ctrl_algs, list) { | ||
33 | if (!strcmp(alg->ops->name, ops->name)) { | ||
34 | /* don't register an algorithm twice */ | ||
35 | WARN_ON(1); | ||
36 | return -EALREADY; | ||
37 | } | ||
38 | } | ||
39 | |||
28 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); | 40 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); |
29 | if (alg == NULL) { | 41 | if (alg == NULL) { |
42 | mutex_unlock(&rate_ctrl_mutex); | ||
30 | return -ENOMEM; | 43 | return -ENOMEM; |
31 | } | 44 | } |
32 | alg->ops = ops; | 45 | alg->ops = ops; |
33 | 46 | ||
34 | mutex_lock(&rate_ctrl_mutex); | ||
35 | list_add_tail(&alg->list, &rate_ctrl_algs); | 47 | list_add_tail(&alg->list, &rate_ctrl_algs); |
36 | mutex_unlock(&rate_ctrl_mutex); | 48 | mutex_unlock(&rate_ctrl_mutex); |
37 | 49 | ||
@@ -61,9 +73,12 @@ ieee80211_try_rate_control_ops_get(const char *name) | |||
61 | struct rate_control_alg *alg; | 73 | struct rate_control_alg *alg; |
62 | struct rate_control_ops *ops = NULL; | 74 | struct rate_control_ops *ops = NULL; |
63 | 75 | ||
76 | if (!name) | ||
77 | return NULL; | ||
78 | |||
64 | mutex_lock(&rate_ctrl_mutex); | 79 | mutex_lock(&rate_ctrl_mutex); |
65 | list_for_each_entry(alg, &rate_ctrl_algs, list) { | 80 | list_for_each_entry(alg, &rate_ctrl_algs, list) { |
66 | if (!name || !strcmp(alg->ops->name, name)) | 81 | if (!strcmp(alg->ops->name, name)) |
67 | if (try_module_get(alg->ops->module)) { | 82 | if (try_module_get(alg->ops->module)) { |
68 | ops = alg->ops; | 83 | ops = alg->ops; |
69 | break; | 84 | break; |
@@ -80,9 +95,12 @@ ieee80211_rate_control_ops_get(const char *name) | |||
80 | { | 95 | { |
81 | struct rate_control_ops *ops; | 96 | struct rate_control_ops *ops; |
82 | 97 | ||
98 | if (!name) | ||
99 | name = "simple"; | ||
100 | |||
83 | ops = ieee80211_try_rate_control_ops_get(name); | 101 | ops = ieee80211_try_rate_control_ops_get(name); |
84 | if (!ops) { | 102 | if (!ops) { |
85 | request_module("rc80211_%s", name ? name : "default"); | 103 | request_module("rc80211_%s", name); |
86 | ops = ieee80211_try_rate_control_ops_get(name); | 104 | ops = ieee80211_try_rate_control_ops_get(name); |
87 | } | 105 | } |
88 | return ops; | 106 | return ops; |
diff --git a/net/mac80211/ieee80211_rate.h b/net/mac80211/ieee80211_rate.h index 7cd1ebab4f83..23688139ffb3 100644 --- a/net/mac80211/ieee80211_rate.h +++ b/net/mac80211/ieee80211_rate.h | |||
@@ -65,6 +65,9 @@ struct rate_control_ref { | |||
65 | struct kref kref; | 65 | struct kref kref; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* default 'simple' algorithm */ | ||
69 | extern struct rate_control_ops mac80211_rcsimple; | ||
70 | |||
68 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 71 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
69 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 72 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
70 | 73 | ||
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index fc6a3ff3d902..015b3f879aa9 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -704,10 +704,11 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
704 | { | 704 | { |
705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
706 | struct ieee80211_sta_bss *bss; | 706 | struct ieee80211_sta_bss *bss; |
707 | int res = 0; | 707 | int bss_privacy; |
708 | int wep_privacy; | ||
709 | int privacy_invoked; | ||
708 | 710 | ||
709 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL) || | 711 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL)) |
710 | ifsta->key_management_enabled) | ||
711 | return 0; | 712 | return 0; |
712 | 713 | ||
713 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, | 714 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, |
@@ -715,13 +716,16 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
715 | if (!bss) | 716 | if (!bss) |
716 | return 0; | 717 | return 0; |
717 | 718 | ||
718 | if (ieee80211_sta_wep_configured(dev) != | 719 | bss_privacy = !!(bss->capability & WLAN_CAPABILITY_PRIVACY); |
719 | !!(bss->capability & WLAN_CAPABILITY_PRIVACY)) | 720 | wep_privacy = !!ieee80211_sta_wep_configured(dev); |
720 | res = 1; | 721 | privacy_invoked = !!(ifsta->flags & IEEE80211_STA_PRIVACY_INVOKED); |
721 | 722 | ||
722 | ieee80211_rx_bss_put(dev, bss); | 723 | ieee80211_rx_bss_put(dev, bss); |
723 | 724 | ||
724 | return res; | 725 | if ((bss_privacy == wep_privacy) || (bss_privacy == privacy_invoked)) |
726 | return 0; | ||
727 | |||
728 | return 1; | ||
725 | } | 729 | } |
726 | 730 | ||
727 | 731 | ||
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c index 314b8de88862..da72737364e4 100644 --- a/net/mac80211/rc80211_simple.c +++ b/net/mac80211/rc80211_simple.c | |||
@@ -7,7 +7,6 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | 10 | #include <linux/init.h> |
12 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
13 | #include <linux/types.h> | 12 | #include <linux/types.h> |
@@ -29,8 +28,6 @@ | |||
29 | #define RATE_CONTROL_INTERVAL (HZ / 20) | 28 | #define RATE_CONTROL_INTERVAL (HZ / 20) |
30 | #define RATE_CONTROL_MIN_TX 10 | 29 | #define RATE_CONTROL_MIN_TX 10 |
31 | 30 | ||
32 | MODULE_ALIAS("rc80211_default"); | ||
33 | |||
34 | static void rate_control_rate_inc(struct ieee80211_local *local, | 31 | static void rate_control_rate_inc(struct ieee80211_local *local, |
35 | struct sta_info *sta) | 32 | struct sta_info *sta) |
36 | { | 33 | { |
@@ -394,8 +391,7 @@ static void rate_control_simple_remove_sta_debugfs(void *priv, void *priv_sta) | |||
394 | } | 391 | } |
395 | #endif | 392 | #endif |
396 | 393 | ||
397 | static struct rate_control_ops rate_control_simple = { | 394 | struct rate_control_ops mac80211_rcsimple = { |
398 | .module = THIS_MODULE, | ||
399 | .name = "simple", | 395 | .name = "simple", |
400 | .tx_status = rate_control_simple_tx_status, | 396 | .tx_status = rate_control_simple_tx_status, |
401 | .get_rate = rate_control_simple_get_rate, | 397 | .get_rate = rate_control_simple_get_rate, |
@@ -410,22 +406,3 @@ static struct rate_control_ops rate_control_simple = { | |||
410 | .remove_sta_debugfs = rate_control_simple_remove_sta_debugfs, | 406 | .remove_sta_debugfs = rate_control_simple_remove_sta_debugfs, |
411 | #endif | 407 | #endif |
412 | }; | 408 | }; |
413 | |||
414 | |||
415 | static int __init rate_control_simple_init(void) | ||
416 | { | ||
417 | return ieee80211_rate_control_register(&rate_control_simple); | ||
418 | } | ||
419 | |||
420 | |||
421 | static void __exit rate_control_simple_exit(void) | ||
422 | { | ||
423 | ieee80211_rate_control_unregister(&rate_control_simple); | ||
424 | } | ||
425 | |||
426 | |||
427 | subsys_initcall(rate_control_simple_init); | ||
428 | module_exit(rate_control_simple_exit); | ||
429 | |||
430 | MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211"); | ||
431 | MODULE_LICENSE("GPL"); | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index ece77766ea2b..428a9fcf57d6 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -509,9 +509,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | |||
509 | rx->key->tx_rx_count++; | 509 | rx->key->tx_rx_count++; |
510 | /* TODO: add threshold stuff again */ | 510 | /* TODO: add threshold stuff again */ |
511 | } else { | 511 | } else { |
512 | #ifdef CONFIG_MAC80211_DEBUG | ||
512 | if (net_ratelimit()) | 513 | if (net_ratelimit()) |
513 | printk(KERN_DEBUG "%s: RX protected frame," | 514 | printk(KERN_DEBUG "%s: RX protected frame," |
514 | " but have no key\n", rx->dev->name); | 515 | " but have no key\n", rx->dev->name); |
516 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
515 | return TXRX_DROP; | 517 | return TXRX_DROP; |
516 | } | 518 | } |
517 | 519 | ||
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index a84a23310ff4..9bf0e1cc530a 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -314,9 +314,11 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx) | |||
314 | 314 | ||
315 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { | 315 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { |
316 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { | 316 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { |
317 | #ifdef CONFIG_MAC80211_DEBUG | ||
317 | if (net_ratelimit()) | 318 | if (net_ratelimit()) |
318 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " | 319 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " |
319 | "failed\n", rx->dev->name); | 320 | "failed\n", rx->dev->name); |
321 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
320 | return TXRX_DROP; | 322 | return TXRX_DROP; |
321 | } | 323 | } |
322 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { | 324 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 6695efba57ec..20cec1cb956f 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -323,9 +323,12 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
323 | &rx->u.rx.tkip_iv32, | 323 | &rx->u.rx.tkip_iv32, |
324 | &rx->u.rx.tkip_iv16); | 324 | &rx->u.rx.tkip_iv16); |
325 | if (res != TKIP_DECRYPT_OK || wpa_test) { | 325 | if (res != TKIP_DECRYPT_OK || wpa_test) { |
326 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from " | 326 | #ifdef CONFIG_MAC80211_DEBUG |
327 | "%s (res=%d)\n", | 327 | if (net_ratelimit()) |
328 | rx->dev->name, print_mac(mac, rx->sta->addr), res); | 328 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX " |
329 | "frame from %s (res=%d)\n", rx->dev->name, | ||
330 | print_mac(mac, rx->sta->addr), res); | ||
331 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
329 | return TXRX_DROP; | 332 | return TXRX_DROP; |
330 | } | 333 | } |
331 | 334 | ||
@@ -594,9 +597,12 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
594 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, | 597 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, |
595 | skb->data + skb->len - CCMP_MIC_LEN, | 598 | skb->data + skb->len - CCMP_MIC_LEN, |
596 | skb->data + hdrlen + CCMP_HDR_LEN)) { | 599 | skb->data + hdrlen + CCMP_HDR_LEN)) { |
597 | printk(KERN_DEBUG "%s: CCMP decrypt failed for RX " | 600 | #ifdef CONFIG_MAC80211_DEBUG |
598 | "frame from %s\n", rx->dev->name, | 601 | if (net_ratelimit()) |
599 | print_mac(mac, rx->sta->addr)); | 602 | printk(KERN_DEBUG "%s: CCMP decrypt failed " |
603 | "for RX frame from %s\n", rx->dev->name, | ||
604 | print_mac(mac, rx->sta->addr)); | ||
605 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
600 | return TXRX_DROP; | 606 | return TXRX_DROP; |
601 | } | 607 | } |
602 | } | 608 | } |