GNOME Bugzilla – Bug 162728
wireless signal strength display wrong for cards that report dBm
Last modified: 2006-03-31 18:09:07 UTC
Some wirless network cards report the signal strength in dBm rather than a percentage. However, the gnome wireless applet and the gnome network monitor both read /proc/net/wireless, and expect the 'level' to be a percantage. I have a Cisco Aironet 350 card. The card reports the signal dBm as a signed 8bit value. Since the unsigned representation of the strength is always greater than 128, the gnome applets report the card to be always at 100% signal strength. The iwconfig utility does report the signal strength correctly. I am including an excrept from iwlib.c (from linux wireless-tools package) /* People are very often confused by the 8 bit arithmetic happening * here. * All the values here are encoded in a 8 bit integer. 8 bit integers * are either unsigned [0 ; 255], signed [-128 ; +127] or * negative [-255 ; 0]. * Further, on 8 bits, 0x100 == 256 == 0. * * Relative/percent values are always encoded unsigned, between 0 and 255. * Absolute/dBm values are always encoded negative, between -255 and 0. * * How do we separate relative from absolute values ? We use the * range to do that. The range allow to specify the real min/max * of the value. As the range struct only specify one bound of the * value, we assume that the other bound is 0 (zero). * For relative values, range is [0 ; range->max]. * For absolute values, range is [range->max ; 0]. * * Let's take two example : * 1) value is 75%. qual->value = 75 ; range->max_qual.value = 100 * 2) value is -54dBm. noise floor of the radio is -104dBm. * qual->value = -54 = 202 ; range->max_qual.value = -104 = 152 * * Jean II */
This should be okay to fix. Without knowing it, is this something HAL could help us with, maybe?
I have done some more digging around with the gnome-netstatus source and with the linux wireless extensions source. It seems that that problem is even more subtle, and is not limited to cisco aironet wireless cards. My other computer has a prism54 based wireless card. Oddly enough that card is also permanently pegged at 100% signal strength all the time. To fix things quickly on my computer I decided to hack the kernel module for the wireless card to start reporting a number less than a 100 for signal strength (I find that easier to do than all the bonobo/activation magic in the applets that trajects 4 miles above my head). To my shock, the signal strength reported by the wireless-applet and by the gnome-netstatus applet is not the signal-level reported by the kernel modules!! The applets are instead reading the link-quality statistic reported by the kernel modules and displaying that as "signal strength". I don't want to be pedantic, but thats not the same thing (maybe we can display both?). Secondly, it seems that the /proc/net/wireless interface does not have enough information in it one to be able to judge what kind of information is being reported by the wirless module. The 'iwconfig' tool has the logic to figure out if the signal strength is dBm or a relative value. One option is to parse the output from 'iwconfig' rather than parsing /proc/net/wirless. If HAL does this, even better. But..... you folks are the real experts.
Going to reassign to netstatus, since we've dropped wireless-applet for G10.
I suppose this is a duplicate of bug 119472, no?
Seems to be a duplicate of 119472. *** This bug has been marked as a duplicate of 119472 ***