diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/scan.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 9fad1631d6cb..01c136d98c5b 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -614,7 +614,7 @@ ieee80211_bss(struct iw_request_info *info, | |||
614 | struct iw_event iwe; | 614 | struct iw_event iwe; |
615 | u8 *buf, *cfg, *p; | 615 | u8 *buf, *cfg, *p; |
616 | u8 *ie = bss->pub.information_elements; | 616 | u8 *ie = bss->pub.information_elements; |
617 | int rem = bss->pub.len_information_elements, i; | 617 | int rem = bss->pub.len_information_elements, i, sig; |
618 | bool ismesh = false; | 618 | bool ismesh = false; |
619 | 619 | ||
620 | memset(&iwe, 0, sizeof(iwe)); | 620 | memset(&iwe, 0, sizeof(iwe)); |
@@ -643,14 +643,23 @@ ieee80211_bss(struct iw_request_info *info, | |||
643 | iwe.cmd = IWEVQUAL; | 643 | iwe.cmd = IWEVQUAL; |
644 | iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED | | 644 | iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED | |
645 | IW_QUAL_NOISE_INVALID | | 645 | IW_QUAL_NOISE_INVALID | |
646 | IW_QUAL_QUAL_INVALID; | 646 | IW_QUAL_QUAL_UPDATED; |
647 | switch (bss->pub.signal_type) { | 647 | switch (bss->pub.signal_type) { |
648 | case CFG80211_SIGNAL_TYPE_MBM: | 648 | case CFG80211_SIGNAL_TYPE_MBM: |
649 | iwe.u.qual.level = bss->pub.signal / 100; | 649 | sig = bss->pub.signal / 100; |
650 | iwe.u.qual.level = sig; | ||
650 | iwe.u.qual.updated |= IW_QUAL_DBM; | 651 | iwe.u.qual.updated |= IW_QUAL_DBM; |
652 | if (sig < -110) /* rather bad */ | ||
653 | sig = -110; | ||
654 | else if (sig > -40) /* perfect */ | ||
655 | sig = -40; | ||
656 | /* will give a range of 0 .. 70 */ | ||
657 | iwe.u.qual.qual = sig + 110; | ||
651 | break; | 658 | break; |
652 | case CFG80211_SIGNAL_TYPE_UNSPEC: | 659 | case CFG80211_SIGNAL_TYPE_UNSPEC: |
653 | iwe.u.qual.level = bss->pub.signal; | 660 | iwe.u.qual.level = bss->pub.signal; |
661 | /* will give range 0 .. 100 */ | ||
662 | iwe.u.qual.qual = bss->pub.signal; | ||
654 | break; | 663 | break; |
655 | default: | 664 | default: |
656 | /* not reached */ | 665 | /* not reached */ |