aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/ieee80211_rx.c
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/ieee80211_rx.c
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/ieee80211_rx.c')
-rw-r--r--net/ieee80211/ieee80211_rx.c43
1 files changed, 27 insertions, 16 deletions
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;