bsd: Set level correctly for non FreeBSD systems
Only FreeBSD treats rssi as dBm, other BSD have no special meaning to rssi. Signed-off-by: Roy Marples <roy@marples.name>
This commit is contained in:
parent
51269b386a
commit
18ae3a675c
1 changed files with 5 additions and 0 deletions
|
@ -1376,11 +1376,16 @@ wpa_driver_bsd_add_scan_entry(struct wpa_scan_results *res,
|
||||||
result->caps = sr->isr_capinfo;
|
result->caps = sr->isr_capinfo;
|
||||||
result->qual = sr->isr_rssi;
|
result->qual = sr->isr_rssi;
|
||||||
result->noise = sr->isr_noise;
|
result->noise = sr->isr_noise;
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
/*
|
/*
|
||||||
* the rssi value reported by the kernel is in 0.5dB steps relative to
|
* the rssi value reported by the kernel is in 0.5dB steps relative to
|
||||||
* the reported noise floor. see ieee80211_node.h for details.
|
* the reported noise floor. see ieee80211_node.h for details.
|
||||||
*/
|
*/
|
||||||
result->level = sr->isr_rssi / 2 + sr->isr_noise;
|
result->level = sr->isr_rssi / 2 + sr->isr_noise;
|
||||||
|
#else
|
||||||
|
result->level = sr->isr_rssi;
|
||||||
|
#endif
|
||||||
|
|
||||||
pos = (u8 *)(result + 1);
|
pos = (u8 *)(result + 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue