2019-12-14 11:38:47

by Shayne Chen

[permalink] [raw]
Subject: [PATCH] mt76: do not overwrite max_tx_fragments if it has been set

Prevent the overwriting of max_tx_fragments if it has already been set
in chip-specific init routine.

Signed-off-by: Shayne Chen <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 00c2a875a596..0c71d671f29a 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -287,7 +287,9 @@ mt76_phy_init(struct mt76_dev *dev, struct ieee80211_hw *hw)
wiphy->available_antennas_rx = dev->phy.antenna_mask;

hw->txq_data_size = sizeof(struct mt76_txq);
- hw->max_tx_fragments = 16;
+
+ if (!hw->max_tx_fragments)
+ hw->max_tx_fragments = 16;

ieee80211_hw_set(hw, SIGNAL_DBM);
ieee80211_hw_set(hw, PS_NULLFUNC_STACK);
--
2.17.1