mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: connac: use a helper to cache txpower_cur
The cached txpower value is derived from the bounded channel power after applying the chainmask path delta. Use a helper for that conversion so callers do not open-code it. -- v2: - Rebased onto the latest mt76 tree - Added Reported-by, Tested-by, Co-developed-by and Signed-off-by tags Reported-by: Devin Wittmayer <[email protected]> Closes: https://lore.kernel.org/linux-wireless/[email protected]/ Tested-by: Devin Wittmayer <[email protected]> Tested-by: Satadru Pramanik <[email protected]> Co-developed-by: Devin Wittmayer <[email protected]> Signed-off-by: Devin Wittmayer <[email protected]> Signed-off-by: Sean Wang <[email protected]> Reported-by: Lucid Duck <[email protected]> Tested-by: Lucid Duck <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -275,6 +275,15 @@ int mt76_connac_init_tx_queues(struct mt76_phy *phy, int idx, int n_desc,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_connac_init_tx_queues);
|
||||
|
||||
void mt76_connac_set_txpower_cur(struct mt76_phy *phy, s8 max_power)
|
||||
{
|
||||
int delta;
|
||||
|
||||
delta = mt76_tx_power_path_delta(hweight16(phy->chainmask));
|
||||
phy->txpower_cur = max_power - delta;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_connac_set_txpower_cur);
|
||||
|
||||
#define __bitrate_mask_check(_mcs, _mode) \
|
||||
({ \
|
||||
u8 i = 0; \
|
||||
|
||||
Reference in New Issue
Block a user