Changeset 1442

Show
Ignore:
Timestamp:
02/06/06 18:39:10 (3 years ago)
Author:
mrenzmann
Message:

Provide compatibility definitions for IW_QUAL_... constants when
WIRELESS_EXT 16 or lower is used. Make ieee80211_ioctl_getspy()
use set_quality() rather than modifying the quality stuff directly.

Signed-off-by: Michael Renzmann <mrenzmann@otaku42.de>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/net80211/ieee80211_wireless.c

    r1439 r1442  
    6868 
    6969/* 
     70 * Compatibility definition of statistics flags 
     71 * (bitmask in (struct iw_quality *)->updated) 
     72 */ 
     73#ifndef IW_QUAL_QUAL_UPDATED 
     74#define IW_QUAL_QUAL_UPDATED    0x01    /* Value was updated since last read */ 
     75#define IW_QUAL_LEVEL_UPDATED   0x02 
     76#define IW_QUAL_NOISE_UPDATED   0x04 
     77#define IW_QUAL_QUAL_INVALID    0x10    /* Driver doesn't provide value */ 
     78#define IW_QUAL_LEVEL_INVALID   0x20 
     79#define IW_QUAL_NOISE_INVALID   0x40 
     80#endif /* IW_QUAL_QUAL_UPDATED */ 
     81 
     82#ifndef IW_QUAL_ALL_UPDATED 
     83#define IW_QUAL_ALL_UPDATED \ 
     84        (IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_UPDATED) 
     85#endif 
     86#ifndef IW_QUAL_ALL_INVALID 
     87#define IW_QUAL_ALL_INVALID \ 
     88        (IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID | IW_QUAL_NOISE_INVALID) 
     89#endif 
     90 
     91/* 
    7092 * Units are in db above the noise floor. That means the 
    7193 * rssi values reported in the tx/rx descriptors in the 
     
    93115        iq->noise = 161;                /* -95dBm */ 
    94116        iq->level = iq->noise + iq->qual; 
    95         iq->updated = 7
    96 } 
    97  
     117        iq->updated = IW_QUAL_ALL_UPDATED
     118} 
     119         
    98120static struct iw_statistics * 
    99121ieee80211_iw_getstats(struct net_device *dev) 
     
    10111033 
    10121034        /* locate a node, copy its rssi value, convert to dBm */ 
    1013         for(i = 0; i < number; i++) { 
     1035        for (i = 0; i < number; i++) { 
    10141036                ni = ieee80211_find_node(nt, &vap->iv_spy.mac[i * IEEE80211_ADDR_LEN]); 
    1015                 if (ni && (ni->ni_vap == vap)) { /* check we are associated w/ this vap */ 
    1016                         spy_stat[i].qual = ni->ni_rssi; 
    1017                         spy_stat[i].noise = 161; /* -95dBm */ 
    1018                         spy_stat[i].level = spy_stat[i].qual + spy_stat[i].noise; 
    1019                         spy_stat[i].updated = IW_QUAL_NOISE_UPDATED | 
    1020                                 IW_QUAL_QUAL_UPDATED | 
    1021                                 IW_QUAL_LEVEL_UPDATED;  
    1022                 } else  
    1023                         spy_stat[i].updated = IW_QUAL_QUAL_INVALID | 
    1024                                 IW_QUAL_LEVEL_INVALID | 
    1025                                 IW_QUAL_NOISE_INVALID; 
     1037                /* check we are associated w/ this vap */ 
     1038                if (ni && (ni->ni_vap == vap)) 
     1039                        set_quality(&spy_stat[i], ni->ni_rssi); 
     1040                else  
     1041                        spy_stat[i].updated = IW_QUAL_ALL_INVALID; 
    10261042        } 
    10271043