rc80211-pid: export human-readable target_pf value to debugfs
authorStefano Brivio <stefano.brivio@polimi.it>
Sun, 23 Dec 2007 03:39:17 +0000 (04:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:00:50 +0000 (15:00 -0800)
Export the non-shifted target_pf value to debugfs, so that it's human-readable.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac80211/rc80211_pid.h
net/mac80211/rc80211_pid_algo.c

index 425eb708182ad050dd672f3c7ef9568441f0a6a2..81aa4ea19958e6ddb13da395d63fa6ce0b55a067 100644 (file)
@@ -38,7 +38,7 @@
  * link quality is good, the controller will fail to adjust failed frames
  * percentage to the target. This is intentional.
  */
-#define RC_PID_TARGET_PF (11 << RC_PID_ARITH_SHIFT)
+#define RC_PID_TARGET_PF 11
 
 /* Rate behaviour normalization quantity over time. */
 #define RC_PID_NORM_OFFSET 3
index 631e46888267457604cc40f7bab08ca9917d59c2..b84e51480c844f90f818519155bf3bdc9fa1a75c 100644 (file)
@@ -210,7 +210,7 @@ static void rate_control_pid_sample(struct rc_pid_info *pinfo,
        rate_control_pid_normalize(pinfo, mode->num_rates);
 
        /* Compute the proportional, integral and derivative errors. */
-       err_prop = pinfo->target - pf;
+       err_prop = (pinfo->target << RC_PID_ARITH_SHIFT) - pf;
 
        err_avg = spinfo->err_avg_sc >> pinfo->smoothing_shift;
        spinfo->err_avg_sc = spinfo->err_avg_sc - err_avg + err_prop;