aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211
diff options
context:
space:
mode:
authorJames Ketrenos <jketreno@linux.intel.com>2005-09-13 18:35:21 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-16 03:06:32 -0400
commit74079fdce472a2b16d502fe39e06b135ef06c69b (patch)
treea2f097836efccc5b4758888bd97599aecd56e37e /net/ieee80211
parentb1b508e1b13529b3cc5b59c352f49b9b58a302b6 (diff)
[PATCH] ieee80211 Added wireless spy support
Added wireless spy support to Rx code path. Signed-off-by: James Ketrenos <jketreno@linux.intel.com> NOTE: Looks like scripts/Lindent generated output different than the Lindented version already in-kernel, hence all the whitespace deltas... *sigh* Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'net/ieee80211')
-rw-r--r--net/ieee80211/ieee80211_crypt.c24
-rw-r--r--net/ieee80211/ieee80211_crypt_ccmp.c26
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c26
-rw-r--r--net/ieee80211/ieee80211_crypt_wep.c26
-rw-r--r--net/ieee80211/ieee80211_rx.c43
5 files changed, 78 insertions, 67 deletions
diff --git a/net/ieee80211/ieee80211_crypt.c b/net/ieee80211/ieee80211_crypt.c
index 61a9d92e455b..dc835f68edd3 100644
--- a/net/ieee80211/ieee80211_crypt.c
+++ b/net/ieee80211/ieee80211_crypt.c
@@ -191,18 +191,18 @@ static void ieee80211_crypt_null_deinit(void *priv)
191} 191}
192 192
193static struct ieee80211_crypto_ops ieee80211_crypt_null = { 193static struct ieee80211_crypto_ops ieee80211_crypt_null = {
194 .name = "NULL", 194 .name = "NULL",
195 .init = ieee80211_crypt_null_init, 195 .init = ieee80211_crypt_null_init,
196 .deinit = ieee80211_crypt_null_deinit, 196 .deinit = ieee80211_crypt_null_deinit,
197 .encrypt_mpdu = NULL, 197 .encrypt_mpdu = NULL,
198 .decrypt_mpdu = NULL, 198 .decrypt_mpdu = NULL,
199 .encrypt_msdu = NULL, 199 .encrypt_msdu = NULL,
200 .decrypt_msdu = NULL, 200 .decrypt_msdu = NULL,
201 .set_key = NULL, 201 .set_key = NULL,
202 .get_key = NULL, 202 .get_key = NULL,
203 .extra_prefix_len = 0, 203 .extra_prefix_len = 0,
204 .extra_postfix_len = 0, 204 .extra_postfix_len = 0,
205 .owner = THIS_MODULE, 205 .owner = THIS_MODULE,
206}; 206};
207 207
208static int __init ieee80211_crypto_init(void) 208static int __init ieee80211_crypto_init(void)
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 8fc13f45971e..7b6290885e7d 100644
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -426,19 +426,19 @@ static char *ieee80211_ccmp_print_stats(char *p, void *priv)
426} 426}
427 427
428static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = { 428static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = {
429 .name = "CCMP", 429 .name = "CCMP",
430 .init = ieee80211_ccmp_init, 430 .init = ieee80211_ccmp_init,
431 .deinit = ieee80211_ccmp_deinit, 431 .deinit = ieee80211_ccmp_deinit,
432 .encrypt_mpdu = ieee80211_ccmp_encrypt, 432 .encrypt_mpdu = ieee80211_ccmp_encrypt,
433 .decrypt_mpdu = ieee80211_ccmp_decrypt, 433 .decrypt_mpdu = ieee80211_ccmp_decrypt,
434 .encrypt_msdu = NULL, 434 .encrypt_msdu = NULL,
435 .decrypt_msdu = NULL, 435 .decrypt_msdu = NULL,
436 .set_key = ieee80211_ccmp_set_key, 436 .set_key = ieee80211_ccmp_set_key,
437 .get_key = ieee80211_ccmp_get_key, 437 .get_key = ieee80211_ccmp_get_key,
438 .print_stats = ieee80211_ccmp_print_stats, 438 .print_stats = ieee80211_ccmp_print_stats,
439 .extra_prefix_len = CCMP_HDR_LEN, 439 .extra_prefix_len = CCMP_HDR_LEN,
440 .extra_postfix_len = CCMP_MIC_LEN, 440 .extra_postfix_len = CCMP_MIC_LEN,
441 .owner = THIS_MODULE, 441 .owner = THIS_MODULE,
442}; 442};
443 443
444static int __init ieee80211_crypto_ccmp_init(void) 444static int __init ieee80211_crypto_ccmp_init(void)
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index d4f9164be1a1..dca380e57454 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -654,19 +654,19 @@ static char *ieee80211_tkip_print_stats(char *p, void *priv)
654} 654}
655 655
656static struct ieee80211_crypto_ops ieee80211_crypt_tkip = { 656static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
657 .name = "TKIP", 657 .name = "TKIP",
658 .init = ieee80211_tkip_init, 658 .init = ieee80211_tkip_init,
659 .deinit = ieee80211_tkip_deinit, 659 .deinit = ieee80211_tkip_deinit,
660 .encrypt_mpdu = ieee80211_tkip_encrypt, 660 .encrypt_mpdu = ieee80211_tkip_encrypt,
661 .decrypt_mpdu = ieee80211_tkip_decrypt, 661 .decrypt_mpdu = ieee80211_tkip_decrypt,
662 .encrypt_msdu = ieee80211_michael_mic_add, 662 .encrypt_msdu = ieee80211_michael_mic_add,
663 .decrypt_msdu = ieee80211_michael_mic_verify, 663 .decrypt_msdu = ieee80211_michael_mic_verify,
664 .set_key = ieee80211_tkip_set_key, 664 .set_key = ieee80211_tkip_set_key,
665 .get_key = ieee80211_tkip_get_key, 665 .get_key = ieee80211_tkip_get_key,
666 .print_stats = ieee80211_tkip_print_stats, 666 .print_stats = ieee80211_tkip_print_stats,
667 .extra_prefix_len = 4 + 4, /* IV + ExtIV */ 667 .extra_prefix_len = 4 + 4, /* IV + ExtIV */
668 .extra_postfix_len = 8 + 4, /* MIC + ICV */ 668 .extra_postfix_len = 8 + 4, /* MIC + ICV */
669 .owner = THIS_MODULE, 669 .owner = THIS_MODULE,
670}; 670};
671 671
672static int __init ieee80211_crypto_tkip_init(void) 672static int __init ieee80211_crypto_tkip_init(void)
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c
index b4d2514a0902..ebe16155e792 100644
--- a/net/ieee80211/ieee80211_crypt_wep.c
+++ b/net/ieee80211/ieee80211_crypt_wep.c
@@ -229,19 +229,19 @@ static char *prism2_wep_print_stats(char *p, void *priv)
229} 229}
230 230
231static struct ieee80211_crypto_ops ieee80211_crypt_wep = { 231static struct ieee80211_crypto_ops ieee80211_crypt_wep = {
232 .name = "WEP", 232 .name = "WEP",
233 .init = prism2_wep_init, 233 .init = prism2_wep_init,
234 .deinit = prism2_wep_deinit, 234 .deinit = prism2_wep_deinit,
235 .encrypt_mpdu = prism2_wep_encrypt, 235 .encrypt_mpdu = prism2_wep_encrypt,
236 .decrypt_mpdu = prism2_wep_decrypt, 236 .decrypt_mpdu = prism2_wep_decrypt,
237 .encrypt_msdu = NULL, 237 .encrypt_msdu = NULL,
238 .decrypt_msdu = NULL, 238 .decrypt_msdu = NULL,
239 .set_key = prism2_wep_set_key, 239 .set_key = prism2_wep_set_key,
240 .get_key = prism2_wep_get_key, 240 .get_key = prism2_wep_get_key,
241 .print_stats = prism2_wep_print_stats, 241 .print_stats = prism2_wep_print_stats,
242 .extra_prefix_len = 4, /* IV */ 242 .extra_prefix_len = 4, /* IV */
243 .extra_postfix_len = 4, /* ICV */ 243 .extra_postfix_len = 4, /* ICV */
244 .owner = THIS_MODULE, 244 .owner = THIS_MODULE,
245}; 245};
246 246
247static int __init ieee80211_crypto_wep_init(void) 247static int __init ieee80211_crypto_wep_init(void)
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 74c4ed77cfd9..6bbaa44a0d03 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -378,33 +378,47 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
378 frag = WLAN_GET_SEQ_FRAG(sc); 378 frag = WLAN_GET_SEQ_FRAG(sc);
379 hdrlen = ieee80211_get_hdrlen(fc); 379 hdrlen = ieee80211_get_hdrlen(fc);
380 380
381#ifdef NOT_YET
382#if WIRELESS_EXT > 15
383 /* Put this code here so that we avoid duplicating it in all 381 /* Put this code here so that we avoid duplicating it in all
384 * Rx paths. - Jean II */ 382 * Rx paths. - Jean II */
385#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ 383#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */
386 /* If spy monitoring on */ 384 /* If spy monitoring on */
387 if (iface->spy_data.spy_number > 0) { 385 if (ieee->spy_data.spy_number > 0) {
388 struct iw_quality wstats; 386 struct iw_quality wstats;
389 wstats.level = rx_stats->signal; 387
390 wstats.noise = rx_stats->noise; 388 wstats.updated = 0;
391 wstats.updated = 6; /* No qual value */ 389 if (rx_stats->mask & IEEE80211_STATMASK_RSSI) {
390 wstats.level = rx_stats->rssi;
391 wstats.updated |= IW_QUAL_LEVEL_UPDATED;
392 } else
393 wstats.updated |= IW_QUAL_LEVEL_INVALID;
394
395 if (rx_stats->mask & IEEE80211_STATMASK_NOISE) {
396 wstats.noise = rx_stats->noise;
397 wstats.updated |= IW_QUAL_NOISE_UPDATED;
398 } else
399 wstats.updated |= IW_QUAL_NOISE_INVALID;
400
401 if (rx_stats->mask & IEEE80211_STATMASK_SIGNAL) {
402 wstats.qual = rx_stats->signal;
403 wstats.updated |= IW_QUAL_QUAL_UPDATED;
404 } else
405 wstats.updated |= IW_QUAL_QUAL_INVALID;
406
392 /* Update spy records */ 407 /* Update spy records */
393 wireless_spy_update(dev, hdr->addr2, &wstats); 408 wireless_spy_update(ieee->dev, hdr->addr2, &wstats);
394 } 409 }
395#endif /* IW_WIRELESS_SPY */ 410#endif /* IW_WIRELESS_SPY */
396#endif /* WIRELESS_EXT > 15 */ 411
412#ifdef NOT_YET
397 hostap_update_rx_stats(local->ap, hdr, rx_stats); 413 hostap_update_rx_stats(local->ap, hdr, rx_stats);
398#endif 414#endif
399 415
400#if WIRELESS_EXT > 15
401 if (ieee->iw_mode == IW_MODE_MONITOR) { 416 if (ieee->iw_mode == IW_MODE_MONITOR) {
402 ieee80211_monitor_rx(ieee, skb, rx_stats); 417 ieee80211_monitor_rx(ieee, skb, rx_stats);
403 stats->rx_packets++; 418 stats->rx_packets++;
404 stats->rx_bytes += skb->len; 419 stats->rx_bytes += skb->len;
405 return 1; 420 return 1;
406 } 421 }
407#endif
408 422
409 if (ieee->host_decrypt) { 423 if (ieee->host_decrypt) {
410 int idx = 0; 424 int idx = 0;
@@ -771,8 +785,7 @@ static inline int ieee80211_is_ofdm_rate(u8 rate)
771 return 0; 785 return 0;
772} 786}
773 787
774static inline int ieee80211_network_init(struct ieee80211_device *ieee, 788static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response
775 struct ieee80211_probe_response
776 *beacon, 789 *beacon,
777 struct ieee80211_network *network, 790 struct ieee80211_network *network,
778 struct ieee80211_rx_stats *stats) 791 struct ieee80211_rx_stats *stats)
@@ -1028,11 +1041,9 @@ static inline void update_network(struct ieee80211_network *dst,
1028} 1041}
1029 1042
1030static inline void ieee80211_process_probe_response(struct ieee80211_device 1043static inline void ieee80211_process_probe_response(struct ieee80211_device
1031 *ieee, 1044 *ieee, struct
1032 struct
1033 ieee80211_probe_response 1045 ieee80211_probe_response
1034 *beacon, 1046 *beacon, struct ieee80211_rx_stats
1035 struct ieee80211_rx_stats
1036 *stats) 1047 *stats)
1037{ 1048{
1038 struct ieee80211_network network; 1049 struct ieee80211_network network;