diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/Kconfig | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-spectrum.c | 198 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 27 |
8 files changed, 33 insertions, 247 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index e44e572acb92..dc8ed1527666 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig | |||
@@ -3,12 +3,6 @@ config IWLWIFI | |||
3 | depends on PCI && MAC80211 | 3 | depends on PCI && MAC80211 |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | 5 | ||
6 | config IWLWIFI_SPECTRUM_MEASUREMENT | ||
7 | bool "Enable Spectrum Measurement in iwlagn driver" | ||
8 | depends on IWLWIFI | ||
9 | ---help--- | ||
10 | This option will enable spectrum measurement for the iwlagn driver. | ||
11 | |||
12 | config IWLWIFI_DEBUG | 6 | config IWLWIFI_DEBUG |
13 | bool "Enable full debugging output in iwlagn and iwl3945 drivers" | 7 | bool "Enable full debugging output in iwlagn and iwl3945 drivers" |
14 | depends on IWLWIFI | 8 | depends on IWLWIFI |
@@ -120,9 +114,3 @@ config IWL3945 | |||
120 | inserted in and removed from the running kernel whenever you want), | 114 | inserted in and removed from the running kernel whenever you want), |
121 | say M here and read <file:Documentation/kbuild/modules.txt>. The | 115 | say M here and read <file:Documentation/kbuild/modules.txt>. The |
122 | module will be called iwl3945. | 116 | module will be called iwl3945. |
123 | |||
124 | config IWL3945_SPECTRUM_MEASUREMENT | ||
125 | bool "Enable Spectrum Measurement in iwl3945 driver" | ||
126 | depends on IWL3945 | ||
127 | ---help--- | ||
128 | This option will enable spectrum measurement for the iwl3945 driver. | ||
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile index bdaa924d2853..4e378faee650 100644 --- a/drivers/net/wireless/iwlwifi/Makefile +++ b/drivers/net/wireless/iwlwifi/Makefile | |||
@@ -3,7 +3,6 @@ iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o | |||
3 | iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o iwl-calib.o | 3 | iwlcore-objs += iwl-rx.o iwl-tx.o iwl-sta.o iwl-calib.o |
4 | iwlcore-objs += iwl-scan.o iwl-led.o | 4 | iwlcore-objs += iwl-scan.o iwl-led.o |
5 | iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o | 5 | iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o |
6 | iwlcore-$(CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT) += iwl-spectrum.o | ||
7 | iwlcore-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o | 6 | iwlcore-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o |
8 | 7 | ||
9 | CFLAGS_iwl-devtrace.o := -I$(src) | 8 | CFLAGS_iwl-devtrace.o := -I$(src) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index d4500b5e0175..4a268927377b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -73,13 +73,7 @@ | |||
73 | #define VD | 73 | #define VD |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | #ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT | 76 | #define DRV_VERSION IWLWIFI_VERSION VD |
77 | #define VS "s" | ||
78 | #else | ||
79 | #define VS | ||
80 | #endif | ||
81 | |||
82 | #define DRV_VERSION IWLWIFI_VERSION VD VS | ||
83 | 77 | ||
84 | 78 | ||
85 | MODULE_DESCRIPTION(DRV_DESCRIPTION); | 79 | MODULE_DESCRIPTION(DRV_DESCRIPTION); |
@@ -889,6 +883,8 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
889 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; | 883 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; |
890 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; | 884 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; |
891 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; | 885 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; |
886 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = | ||
887 | iwl_rx_spectrum_measure_notif; | ||
892 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; | 888 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; |
893 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = | 889 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = |
894 | iwl_rx_pm_debug_statistics_notif; | 890 | iwl_rx_pm_debug_statistics_notif; |
@@ -902,7 +898,6 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
902 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_reply_statistics; | 898 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_reply_statistics; |
903 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_rx_statistics; | 899 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_rx_statistics; |
904 | 900 | ||
905 | iwl_setup_spectrum_handlers(priv); | ||
906 | iwl_setup_rx_scan_handlers(priv); | 901 | iwl_setup_rx_scan_handlers(priv); |
907 | 902 | ||
908 | /* status change handler */ | 903 | /* status change handler */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index e14e32976b80..ec1fe1d7cc9a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -429,6 +429,8 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); | |||
429 | /* Handlers */ | 429 | /* Handlers */ |
430 | void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, | 430 | void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, |
431 | struct iwl_rx_mem_buffer *rxb); | 431 | struct iwl_rx_mem_buffer *rxb); |
432 | void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv, | ||
433 | struct iwl_rx_mem_buffer *rxb); | ||
432 | void iwl_rx_statistics(struct iwl_priv *priv, | 434 | void iwl_rx_statistics(struct iwl_priv *priv, |
433 | struct iwl_rx_mem_buffer *rxb); | 435 | struct iwl_rx_mem_buffer *rxb); |
434 | void iwl_reply_statistics(struct iwl_priv *priv, | 436 | void iwl_reply_statistics(struct iwl_priv *priv, |
@@ -531,14 +533,6 @@ int iwl_send_calib_results(struct iwl_priv *priv); | |||
531 | int iwl_calib_set(struct iwl_calib_result *res, const u8 *buf, int len); | 533 | int iwl_calib_set(struct iwl_calib_result *res, const u8 *buf, int len); |
532 | void iwl_calib_free_results(struct iwl_priv *priv); | 534 | void iwl_calib_free_results(struct iwl_priv *priv); |
533 | 535 | ||
534 | /******************************************************************************* | ||
535 | * Spectrum Measureemtns in iwl-spectrum.c | ||
536 | ******************************************************************************/ | ||
537 | #ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT | ||
538 | void iwl_setup_spectrum_handlers(struct iwl_priv *priv); | ||
539 | #else | ||
540 | static inline void iwl_setup_spectrum_handlers(struct iwl_priv *priv) {} | ||
541 | #endif | ||
542 | /***************************************************** | 536 | /***************************************************** |
543 | * S e n d i n g H o s t C o m m a n d s * | 537 | * S e n d i n g H o s t C o m m a n d s * |
544 | *****************************************************/ | 538 | *****************************************************/ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index d9f325bd4b69..9b0a5cbc20f9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1055,11 +1055,10 @@ struct iwl_priv { | |||
1055 | 1055 | ||
1056 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; | 1056 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; |
1057 | 1057 | ||
1058 | #if defined(CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT) || defined(CONFIG_IWL3945_SPECTRUM_MEASUREMENT) | ||
1059 | /* spectrum measurement report caching */ | 1058 | /* spectrum measurement report caching */ |
1060 | struct iwl_spectrum_notification measure_report; | 1059 | struct iwl_spectrum_notification measure_report; |
1061 | u8 measurement_status; | 1060 | u8 measurement_status; |
1062 | #endif | 1061 | |
1063 | /* ucode beacon time */ | 1062 | /* ucode beacon time */ |
1064 | u32 ucode_beacon_time; | 1063 | u32 ucode_beacon_time; |
1065 | int missed_beacon_threshold; | 1064 | int missed_beacon_threshold; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index ea309f42a78a..5df66382d922 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -512,6 +512,24 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, | |||
512 | } | 512 | } |
513 | EXPORT_SYMBOL(iwl_rx_missed_beacon_notif); | 513 | EXPORT_SYMBOL(iwl_rx_missed_beacon_notif); |
514 | 514 | ||
515 | void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv, | ||
516 | struct iwl_rx_mem_buffer *rxb) | ||
517 | { | ||
518 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | ||
519 | struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif); | ||
520 | |||
521 | if (!report->state) { | ||
522 | IWL_DEBUG_11H(priv, | ||
523 | "Spectrum Measure Notification: Start\n"); | ||
524 | return; | ||
525 | } | ||
526 | |||
527 | memcpy(&priv->measure_report, report, sizeof(*report)); | ||
528 | priv->measurement_status |= MEASUREMENT_READY; | ||
529 | } | ||
530 | EXPORT_SYMBOL(iwl_rx_spectrum_measure_notif); | ||
531 | |||
532 | |||
515 | 533 | ||
516 | /* Calculate noise level, based on measurements during network silence just | 534 | /* Calculate noise level, based on measurements during network silence just |
517 | * before arriving beacon. This measurement can be done only if we know | 535 | * before arriving beacon. This measurement can be done only if we know |
diff --git a/drivers/net/wireless/iwlwifi/iwl-spectrum.c b/drivers/net/wireless/iwlwifi/iwl-spectrum.c deleted file mode 100644 index da166d1d1b13..000000000000 --- a/drivers/net/wireless/iwlwifi/iwl-spectrum.c +++ /dev/null | |||
@@ -1,198 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved. | ||
4 | * | ||
5 | * Portions of this file are derived from the ipw3945 project, as well | ||
6 | * as portions of the ieee80211 subsystem header files. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of version 2 of the GNU General Public License as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along with | ||
18 | * this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
20 | * | ||
21 | * The full GNU General Public License is included in this distribution in the | ||
22 | * file called LICENSE. | ||
23 | * | ||
24 | * Contact Information: | ||
25 | * Intel Linux Wireless <ilw@linux.intel.com> | ||
26 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
27 | * | ||
28 | *****************************************************************************/ | ||
29 | |||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/init.h> | ||
33 | #include <linux/pci.h> | ||
34 | #include <linux/delay.h> | ||
35 | #include <linux/skbuff.h> | ||
36 | #include <linux/netdevice.h> | ||
37 | #include <linux/wireless.h> | ||
38 | |||
39 | #include <net/mac80211.h> | ||
40 | |||
41 | #include "iwl-eeprom.h" | ||
42 | #include "iwl-dev.h" | ||
43 | #include "iwl-core.h" | ||
44 | #include "iwl-io.h" | ||
45 | #include "iwl-spectrum.h" | ||
46 | |||
47 | #define BEACON_TIME_MASK_LOW 0x00FFFFFF | ||
48 | #define BEACON_TIME_MASK_HIGH 0xFF000000 | ||
49 | #define TIME_UNIT 1024 | ||
50 | |||
51 | /* | ||
52 | * extended beacon time format | ||
53 | * time in usec will be changed into a 32-bit value in 8:24 format | ||
54 | * the high 1 byte is the beacon counts | ||
55 | * the lower 3 bytes is the time in usec within one beacon interval | ||
56 | */ | ||
57 | |||
58 | /* TOOD: was used in sysfs debug interface need to add to mac */ | ||
59 | #if 0 | ||
60 | static u32 iwl_usecs_to_beacons(u32 usec, u32 beacon_interval) | ||
61 | { | ||
62 | u32 quot; | ||
63 | u32 rem; | ||
64 | u32 interval = beacon_interval * 1024; | ||
65 | |||
66 | if (!interval || !usec) | ||
67 | return 0; | ||
68 | |||
69 | quot = (usec / interval) & (BEACON_TIME_MASK_HIGH >> 24); | ||
70 | rem = (usec % interval) & BEACON_TIME_MASK_LOW; | ||
71 | |||
72 | return (quot << 24) + rem; | ||
73 | } | ||
74 | |||
75 | /* base is usually what we get from ucode with each received frame, | ||
76 | * the same as HW timer counter counting down | ||
77 | */ | ||
78 | |||
79 | static __le32 iwl_add_beacon_time(u32 base, u32 addon, u32 beacon_interval) | ||
80 | { | ||
81 | u32 base_low = base & BEACON_TIME_MASK_LOW; | ||
82 | u32 addon_low = addon & BEACON_TIME_MASK_LOW; | ||
83 | u32 interval = beacon_interval * TIME_UNIT; | ||
84 | u32 res = (base & BEACON_TIME_MASK_HIGH) + | ||
85 | (addon & BEACON_TIME_MASK_HIGH); | ||
86 | |||
87 | if (base_low > addon_low) | ||
88 | res += base_low - addon_low; | ||
89 | else if (base_low < addon_low) { | ||
90 | res += interval + base_low - addon_low; | ||
91 | res += (1 << 24); | ||
92 | } else | ||
93 | res += (1 << 24); | ||
94 | |||
95 | return cpu_to_le32(res); | ||
96 | } | ||
97 | static int iwl_get_measurement(struct iwl_priv *priv, | ||
98 | struct ieee80211_measurement_params *params, | ||
99 | u8 type) | ||
100 | { | ||
101 | struct iwl4965_spectrum_cmd spectrum; | ||
102 | struct iwl_rx_packet *res; | ||
103 | struct iwl_host_cmd cmd = { | ||
104 | .id = REPLY_SPECTRUM_MEASUREMENT_CMD, | ||
105 | .data = (void *)&spectrum, | ||
106 | .meta.flags = CMD_WANT_SKB, | ||
107 | }; | ||
108 | u32 add_time = le64_to_cpu(params->start_time); | ||
109 | int rc; | ||
110 | int spectrum_resp_status; | ||
111 | int duration = le16_to_cpu(params->duration); | ||
112 | |||
113 | if (iwl_is_associated(priv)) | ||
114 | add_time = | ||
115 | iwl_usecs_to_beacons( | ||
116 | le64_to_cpu(params->start_time) - priv->last_tsf, | ||
117 | le16_to_cpu(priv->rxon_timing.beacon_interval)); | ||
118 | |||
119 | memset(&spectrum, 0, sizeof(spectrum)); | ||
120 | |||
121 | spectrum.channel_count = cpu_to_le16(1); | ||
122 | spectrum.flags = | ||
123 | RXON_FLG_TSF2HOST_MSK | RXON_FLG_ANT_A_MSK | RXON_FLG_DIS_DIV_MSK; | ||
124 | spectrum.filter_flags = MEASUREMENT_FILTER_FLAG; | ||
125 | cmd.len = sizeof(spectrum); | ||
126 | spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len)); | ||
127 | |||
128 | if (iwl_is_associated(priv)) | ||
129 | spectrum.start_time = | ||
130 | iwl_add_beacon_time(priv->last_beacon_time, | ||
131 | add_time, | ||
132 | le16_to_cpu(priv->rxon_timing.beacon_interval)); | ||
133 | else | ||
134 | spectrum.start_time = 0; | ||
135 | |||
136 | spectrum.channels[0].duration = cpu_to_le32(duration * TIME_UNIT); | ||
137 | spectrum.channels[0].channel = params->channel; | ||
138 | spectrum.channels[0].type = type; | ||
139 | if (priv->active_rxon.flags & RXON_FLG_BAND_24G_MSK) | ||
140 | spectrum.flags |= RXON_FLG_BAND_24G_MSK | | ||
141 | RXON_FLG_AUTO_DETECT_MSK | RXON_FLG_TGG_PROTECT_MSK; | ||
142 | |||
143 | rc = iwl_send_cmd_sync(priv, &cmd); | ||
144 | if (rc) | ||
145 | return rc; | ||
146 | |||
147 | res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; | ||
148 | if (res->hdr.flags & IWL_CMD_FAILED_MSK) { | ||
149 | IWL_ERR(priv, "Bad return from REPLY_RX_ON_ASSOC command\n"); | ||
150 | rc = -EIO; | ||
151 | } | ||
152 | |||
153 | spectrum_resp_status = le16_to_cpu(res->u.spectrum.status); | ||
154 | switch (spectrum_resp_status) { | ||
155 | case 0: /* Command will be handled */ | ||
156 | if (res->u.spectrum.id != 0xff) { | ||
157 | IWL_DEBUG_INFO(priv, | ||
158 | "Replaced existing measurement: %d\n", | ||
159 | res->u.spectrum.id); | ||
160 | priv->measurement_status &= ~MEASUREMENT_READY; | ||
161 | } | ||
162 | priv->measurement_status |= MEASUREMENT_ACTIVE; | ||
163 | rc = 0; | ||
164 | break; | ||
165 | |||
166 | case 1: /* Command will not be handled */ | ||
167 | rc = -EAGAIN; | ||
168 | break; | ||
169 | } | ||
170 | |||
171 | dev_kfree_skb_any(cmd.meta.u.skb); | ||
172 | |||
173 | return rc; | ||
174 | } | ||
175 | #endif | ||
176 | |||
177 | static void iwl_rx_spectrum_measure_notif(struct iwl_priv *priv, | ||
178 | struct iwl_rx_mem_buffer *rxb) | ||
179 | { | ||
180 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | ||
181 | struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif); | ||
182 | |||
183 | if (!report->state) { | ||
184 | IWL_DEBUG_11H(priv, | ||
185 | "Spectrum Measure Notification: Start\n"); | ||
186 | return; | ||
187 | } | ||
188 | |||
189 | memcpy(&priv->measure_report, report, sizeof(*report)); | ||
190 | priv->measurement_status |= MEASUREMENT_READY; | ||
191 | } | ||
192 | |||
193 | void iwl_setup_spectrum_handlers(struct iwl_priv *priv) | ||
194 | { | ||
195 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = | ||
196 | iwl_rx_spectrum_measure_notif; | ||
197 | } | ||
198 | EXPORT_SYMBOL(iwl_setup_spectrum_handlers); | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 9c0b6ebbdc59..cd42b5838b38 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include "iwl-helpers.h" | 56 | #include "iwl-helpers.h" |
57 | #include "iwl-core.h" | 57 | #include "iwl-core.h" |
58 | #include "iwl-dev.h" | 58 | #include "iwl-dev.h" |
59 | #include "iwl-spectrum.h" | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * module name, copyright, version, etc. | 62 | * module name, copyright, version, etc. |
@@ -70,13 +71,12 @@ | |||
70 | #define VD | 71 | #define VD |
71 | #endif | 72 | #endif |
72 | 73 | ||
73 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | 74 | /* |
74 | #define VS "s" | 75 | * add "s" to indicate spectrum measurement included. |
75 | #else | 76 | * we add it here to be consistent with previous releases in which |
76 | #define VS | 77 | * this was configurable. |
77 | #endif | 78 | */ |
78 | 79 | #define DRV_VERSION IWLWIFI_VERSION VD "s" | |
79 | #define DRV_VERSION IWLWIFI_VERSION VD VS | ||
80 | #define DRV_COPYRIGHT "Copyright(c) 2003-2010 Intel Corporation" | 80 | #define DRV_COPYRIGHT "Copyright(c) 2003-2010 Intel Corporation" |
81 | #define DRV_AUTHOR "<ilw@linux.intel.com>" | 81 | #define DRV_AUTHOR "<ilw@linux.intel.com>" |
82 | 82 | ||
@@ -689,10 +689,6 @@ drop: | |||
689 | return -1; | 689 | return -1; |
690 | } | 690 | } |
691 | 691 | ||
692 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | ||
693 | |||
694 | #include "iwl-spectrum.h" | ||
695 | |||
696 | #define BEACON_TIME_MASK_LOW 0x00FFFFFF | 692 | #define BEACON_TIME_MASK_LOW 0x00FFFFFF |
697 | #define BEACON_TIME_MASK_HIGH 0xFF000000 | 693 | #define BEACON_TIME_MASK_HIGH 0xFF000000 |
698 | #define TIME_UNIT 1024 | 694 | #define TIME_UNIT 1024 |
@@ -819,7 +815,6 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, | |||
819 | 815 | ||
820 | return rc; | 816 | return rc; |
821 | } | 817 | } |
822 | #endif | ||
823 | 818 | ||
824 | static void iwl3945_rx_reply_alive(struct iwl_priv *priv, | 819 | static void iwl3945_rx_reply_alive(struct iwl_priv *priv, |
825 | struct iwl_rx_mem_buffer *rxb) | 820 | struct iwl_rx_mem_buffer *rxb) |
@@ -962,6 +957,8 @@ static void iwl3945_setup_rx_handlers(struct iwl_priv *priv) | |||
962 | priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta; | 957 | priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta; |
963 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; | 958 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; |
964 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; | 959 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; |
960 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = | ||
961 | iwl_rx_spectrum_measure_notif; | ||
965 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; | 962 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; |
966 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = | 963 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = |
967 | iwl_rx_pm_debug_statistics_notif; | 964 | iwl_rx_pm_debug_statistics_notif; |
@@ -975,7 +972,6 @@ static void iwl3945_setup_rx_handlers(struct iwl_priv *priv) | |||
975 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics; | 972 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics; |
976 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics; | 973 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics; |
977 | 974 | ||
978 | iwl_setup_spectrum_handlers(priv); | ||
979 | iwl_setup_rx_scan_handlers(priv); | 975 | iwl_setup_rx_scan_handlers(priv); |
980 | priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif; | 976 | priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif; |
981 | 977 | ||
@@ -3569,8 +3565,6 @@ static ssize_t store_filter_flags(struct device *d, | |||
3569 | static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags, | 3565 | static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags, |
3570 | store_filter_flags); | 3566 | store_filter_flags); |
3571 | 3567 | ||
3572 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | ||
3573 | |||
3574 | static ssize_t show_measurement(struct device *d, | 3568 | static ssize_t show_measurement(struct device *d, |
3575 | struct device_attribute *attr, char *buf) | 3569 | struct device_attribute *attr, char *buf) |
3576 | { | 3570 | { |
@@ -3640,7 +3634,6 @@ static ssize_t store_measurement(struct device *d, | |||
3640 | 3634 | ||
3641 | static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR, | 3635 | static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR, |
3642 | show_measurement, store_measurement); | 3636 | show_measurement, store_measurement); |
3643 | #endif /* CONFIG_IWL3945_SPECTRUM_MEASUREMENT */ | ||
3644 | 3637 | ||
3645 | static ssize_t store_retry_rate(struct device *d, | 3638 | static ssize_t store_retry_rate(struct device *d, |
3646 | struct device_attribute *attr, | 3639 | struct device_attribute *attr, |
@@ -3823,9 +3816,7 @@ static struct attribute *iwl3945_sysfs_entries[] = { | |||
3823 | &dev_attr_dump_errors.attr, | 3816 | &dev_attr_dump_errors.attr, |
3824 | &dev_attr_flags.attr, | 3817 | &dev_attr_flags.attr, |
3825 | &dev_attr_filter_flags.attr, | 3818 | &dev_attr_filter_flags.attr, |
3826 | #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT | ||
3827 | &dev_attr_measurement.attr, | 3819 | &dev_attr_measurement.attr, |
3828 | #endif | ||
3829 | &dev_attr_retry_rate.attr, | 3820 | &dev_attr_retry_rate.attr, |
3830 | &dev_attr_statistics.attr, | 3821 | &dev_attr_statistics.attr, |
3831 | &dev_attr_status.attr, | 3822 | &dev_attr_status.attr, |