Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175265
b: refs/heads/master
c: e81589a
h: refs/heads/master
i:
  175263: b670554
v: v3
  • Loading branch information
Henk de Groot authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 7e23126 commit df13aa4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0f2cc5aea14a4dfd342616faade05b75cb6c309
refs/heads/master: e81589a70c9dbee888cce16e8bdfdc993299dc3f
31 changes: 25 additions & 6 deletions trunk/drivers/staging/wlags49_h2/wl_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,32 @@
#define TX_TIMEOUT ((800 * HZ) / 1000)


//#define HCF_MIN_COMM_QUALITY 0
//#define HCF_MAX_COMM_QUALITY 92
//#define HCF_MIN_SIGNAL_LEVEL 47
//#define HCF_MAX_SIGNAL_LEVEL 138
//#define HCF_MIN_NOISE_LEVEL 47
//#define HCF_MAX_NOISE_LEVEL 138
//#define HCF_0DBM_OFFSET 149

// PE1DNN
// Better data from the real world. Not scientific but empirical data gathered
// from a Thomson Speedtouch 110 which is identified as:
// PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
// Manufacture ID: 0156,0003
// Lowest measurment for noise floor seen is value 54
// Highest signal strength in close proximity to the AP seen is value 118
// Very good must be arround 100 (otherwise its never "full scale"
// All other constants are derrived from these. This makes the signal gauge
// work for me...
#define HCF_MIN_SIGNAL_LEVEL 54
#define HCF_MAX_SIGNAL_LEVEL 100
#define HCF_MIN_NOISE_LEVEL HCF_MIN_SIGNAL_LEVEL
#define HCF_MAX_NOISE_LEVEL HCF_MAX_SIGNAL_LEVEL
#define HCF_0DBM_OFFSET (HCF_MAX_SIGNAL_LEVEL + 1)
#define HCF_MIN_COMM_QUALITY 0
#define HCF_MAX_COMM_QUALITY 92
#define HCF_MIN_SIGNAL_LEVEL 47
#define HCF_MAX_SIGNAL_LEVEL 138
#define HCF_MIN_NOISE_LEVEL 47
#define HCF_MAX_NOISE_LEVEL 138
#define HCF_0DBM_OFFSET 149
#define HCF_MAX_COMM_QUALITY (HCF_MAX_SIGNAL_LEVEL - HCF_MIN_NOISE_LEVEL + 1)


/* For encryption (WEP) */
#define MIN_KEY_SIZE 5 // 40 bits RC4 - WEP
Expand Down
19 changes: 14 additions & 5 deletions trunk/drivers/staging/wlags49_h2/wl_wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ static int wireless_get_scan(struct net_device *dev, struct iw_request_info *inf
iwe.u.qual.level = dbm(probe_resp->signal);
iwe.u.qual.noise = dbm(probe_resp->silence);
iwe.u.qual.qual = iwe.u.qual.level - iwe.u.qual.noise;
iwe.u.qual.updated = lp->probe_results.scan_complete;
iwe.u.qual.updated = lp->probe_results.scan_complete | IW_QUAL_DBM;
iwe.len = IW_EV_QUAL_LEN;

buf = IWE_STREAM_ADD_EVENT(info, buf, buf_end, &iwe, IW_EV_QUAL_LEN);
Expand Down Expand Up @@ -3317,7 +3317,6 @@ struct iw_statistics * wl_wireless_stats( struct net_device *dev )
/* Get the current link quality information */
lp->ltvRecord.len = 1 + ( sizeof( *pQual ) / sizeof( hcf_16 ));
lp->ltvRecord.typ = CFG_COMMS_QUALITY;

status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));

if( status == HCF_SUCCESS ) {
Expand All @@ -3327,6 +3326,11 @@ struct iw_statistics * wl_wireless_stats( struct net_device *dev )
pStats->qual.qual = (u_char) CNV_LITTLE_TO_INT( pQual->coms_qual );
pStats->qual.level = (u_char) dbm( CNV_LITTLE_TO_INT( pQual->signal_lvl ));
pStats->qual.noise = (u_char) dbm( CNV_LITTLE_TO_INT( pQual->noise_lvl ));

pStats->qual.updated |= (IW_QUAL_QUAL_UPDATED |
IW_QUAL_LEVEL_UPDATED |
IW_QUAL_NOISE_UPDATED |
IW_QUAL_DBM);
#else
pStats->qual.qual = percent( CNV_LITTLE_TO_INT( pQual->coms_qual ),
HCF_MIN_COMM_QUALITY,
Expand All @@ -3339,9 +3343,11 @@ struct iw_statistics * wl_wireless_stats( struct net_device *dev )
pStats->qual.noise = percent( CNV_LITTLE_TO_INT( pQual->noise_lvl ),
HCF_MIN_NOISE_LEVEL,
HCF_MAX_NOISE_LEVEL );
#endif /* USE_DBM */

pStats->qual.updated |= 0x07;
pStats->qual.updated |= (IW_QUAL_QUAL_UPDATED |
IW_QUAL_LEVEL_UPDATED |
IW_QUAL_NOISE_UPDATED);
#endif /* USE_DBM */
} else {
memset( &( pStats->qual ), 0, sizeof( pStats->qual ));
}
Expand Down Expand Up @@ -3478,7 +3484,10 @@ inline void wl_spy_gather( struct net_device *dev, u_char *mac )
wstats.noise = (u_char) dbm(stats[0]);
wstats.qual = wstats.level > wstats.noise ? wstats.level - wstats.noise : 0;

wstats.updated = 7;
wstats.updated = (IW_QUAL_QUAL_UPDATED |
IW_QUAL_LEVEL_UPDATED |
IW_QUAL_NOISE_UPDATED |
IW_QUAL_DBM);

wireless_spy_update( dev, mac, &wstats );
}
Expand Down

0 comments on commit df13aa4

Please sign in to comment.