[Pkg-xfce-devel] Bug#527603: Bug#527603: shown value for Link Quality is wrong

Yves-Alexis Perez corsac at debian.org
Fri Feb 25 14:13:25 UTC 2011


forwarded 527603 http://bugzilla.xfce.org/show_bug.cgi?id=7347 
thanks
On Sat, 2011-02-26 at 02:05 +1300, Hamish wrote:
> what is used is like (int)rint( log(qual) / log(max) * 100.), but I think the 
> correct calc would be without the two log()s. I've patched the deb-src locally and 
> rebuilt the package and now it matches what /proc/net/wireless and other X-widgets 
> like wicd-gtk report. the signal is yellow/red and at 40% like it should be!
> 
Current code is:

    /* thanks to google and wireless tools for this hint */
    stats->ws_quality = (int)rint(log(link) / log(max_qual) * 100.0);

so it seems that at one point at least it matched what wireless-tools
did.

Kernel code for the values used for max_qual says:

	/* Quality of link & SNR stuff */
	/* Quality range (link, level, noise)
	 * If the quality is absolute, it will be in the range [0 ; max_qual],
	 * if the quality is dBm, it will be in the range [max_qual ; 0].
	 * Don't forget that we use 8 bit arithmetics... */
	struct iw_quality	max_qual;	/* Quality of the link */
	/* This should contain the average/typical values of the quality
	 * indicator. This should be the threshold between a "good" and
	 * a "bad" link (example : monitor going from green to orange).
	 * Currently, user space apps like quality monitors don't have any
	 * way to calibrate the measurement. With this, they can split
	 * the range between 0 and max_qual in different quality level
	 * (using a geometric subdivision centered on the average).
	 * I expect that people doing the user space apps will feedback
	 * us on which value we need to put in each driver... */
	struct iw_quality	avg_qual;	/* Quality of the link */

For link it's:

/*
 *	Quality of the link
 */
struct	iw_quality
{
	__u8		qual;		/* link quality (%retries, SNR,
					   %missed beacons or better...) */
	__u8		level;		/* signal level (dBm) */
	__u8		noise;		/* noise level (dBm) */
	__u8		updated;	/* Flags to know if updated */
};

The first comment makes me wonder if all drivers are in log scale or
not, so it might be that the value is good on some drivers and not in
others.

All in all I'm not too sure about what to do (I'd like not to fix the
bug for you by breaking the plugin for other people) and I'm not really
sure it's even maintained upstream.

I've opened a bug on upstream bugzilla so you might want to add your
views there (http://bugzilla.xfce.org/show_bug.cgi?id=7347)

Regards,
-- 
Yves-Alexis






More information about the Pkg-xfce-devel mailing list