lkml.org 
[lkml]   [2018]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.17 229/336] mt76x2: fix avg_rssi estimation
    Date
    4.17-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

    [ Upstream commit c990affd5abce1f338ac52539e092dad04647fb6 ]

    Add leftover filter coefficients in IIR rssi estimation

    Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
    Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
    Acked-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/wireless/mediatek/mt76/mt76x2_phy.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    --- a/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c
    +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_phy.c
    @@ -492,8 +492,10 @@ mt76x2_phy_update_channel_gain(struct mt
    u8 gain_delta;
    int low_gain;

    - dev->cal.avg_rssi[0] = (dev->cal.avg_rssi[0] * 15) / 16 + (rssi0 << 8);
    - dev->cal.avg_rssi[1] = (dev->cal.avg_rssi[1] * 15) / 16 + (rssi1 << 8);
    + dev->cal.avg_rssi[0] = (dev->cal.avg_rssi[0] * 15) / 16 +
    + (rssi0 << 8) / 16;
    + dev->cal.avg_rssi[1] = (dev->cal.avg_rssi[1] * 15) / 16 +
    + (rssi1 << 8) / 16;
    dev->cal.avg_rssi_all = (dev->cal.avg_rssi[0] +
    dev->cal.avg_rssi[1]) / 512;


    \
     
     \ /
      Last update: 2018-08-01 20:11    [W:4.034 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site