Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e850f68b authored by Bob Copeland's avatar Bob Copeland Committed by John W. Linville
Browse files

mac80211: fix sign error in pid controller



While testing the pid rate controller in mac80211_hwsim, I noticed
that once the controller reached 54 Mbit rates, it would fail to
lower the rate when necessary.  The debug log shows:

1945 186786 pf_sample 50 3534 3577 50

My interpretation is that the fixed point scaling of the target
error value (pf) is incorrect: the error value of 50 compared to
a target of 14 case should result in a scaling value of
(14-50) = -36 * 256 or -9216, but instead it is (14 * 256)-50, or
3534.

Correct this by doing fixed point scaling after subtraction.

Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
Acked-by: default avatarStefano Brivio <stefano.brivio@polimi.it>
Acked-by: default avatarMattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb5d2db5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment