lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0317/1039] mt76: connac: fix last_chan configuration in mt76_connac_mcu_rate_txpower_band
    Date
    From: Lorenzo Bianconi <lorenzo@kernel.org>

    [ Upstream commit 73c7c0443685d8d152c3451e7305a2c2bc47b32e ]

    last_ch configuration must not be dependent on the current configured band
    but it is defined by hw capabilities since the fw always expects the
    following order:
    - 2GHz
    - 5GHz
    - 6GHz

    Fixes: 9b2ea8eee42a1 ("mt76: connac: set 6G phymode in single-sku support")
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
    index 61c4c86e79c88..b15bbd650a90c 100644
    --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
    +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
    @@ -2008,12 +2008,12 @@ mt76_connac_mcu_rate_txpower_band(struct mt76_phy *phy,
    }
    batch_size = DIV_ROUND_UP(n_chan, batch_len);

    - if (!phy->cap.has_5ghz)
    - last_ch = chan_list_2ghz[n_chan - 1];
    - else if (phy->cap.has_6ghz)
    - last_ch = chan_list_6ghz[n_chan - 1];
    + if (phy->cap.has_6ghz)
    + last_ch = chan_list_6ghz[ARRAY_SIZE(chan_list_6ghz) - 1];
    + else if (phy->cap.has_5ghz)
    + last_ch = chan_list_5ghz[ARRAY_SIZE(chan_list_5ghz) - 1];
    else
    - last_ch = chan_list_5ghz[n_chan - 1];
    + last_ch = chan_list_2ghz[ARRAY_SIZE(chan_list_2ghz) - 1];

    for (i = 0; i < batch_size; i++) {
    struct mt76_connac_tx_power_limit_tlv tx_power_tlv = {};
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-24 23:09    [W:2.136 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site