From patchwork Sat Dec 14 11:22:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shayne Chen X-Patchwork-Id: 11292187 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89A4A930 for ; Sat, 14 Dec 2019 11:37:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 601D2214D8 for ; Sat, 14 Dec 2019 11:37:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Spb7eG4s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726103AbfLNLhz (ORCPT ); Sat, 14 Dec 2019 06:37:55 -0500 Received: from mailgw02.mediatek.com ([216.200.240.185]:40034 "EHLO mailgw02.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfLNLhz (ORCPT ); Sat, 14 Dec 2019 06:37:55 -0500 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Sat, 14 Dec 2019 06:37:55 EST X-UUID: 0d80f49c04a44ca3ab62fc25a93521be-20191214 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=tu9Jxro/WRqZ8zFULZtR4PTpeFKrsiSb8i5Fjp7K8r0=; b=Spb7eG4sloYHT1JwoOCvxMlcMZ85bc/WwqYNUdxfO62wQAVoX6dvDfB6Y4G41B6M8yjACN/VZxQUh8RnM5jbraYfxzQJ9ZhPLI1o3lJbuRuT+rQiwoXV4K6BiL2GGJU1HfbiHe0i9qFAwhxkFTAd9ykTKYbaO0Xa6a0vInb9eiw=; X-UUID: 0d80f49c04a44ca3ab62fc25a93521be-20191214 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 265399583; Sat, 14 Dec 2019 03:32:42 -0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 14 Dec 2019 19:25:55 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 14 Dec 2019 19:25:14 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Lorenzo Bianconi , Ryder Lee , Roy Luo , linux-mediatek , Shayne Chen Subject: [PATCH] mt76: do not overwrite max_tx_fragments if it has been set Date: Sat, 14 Dec 2019 19:22:04 +0800 Message-ID: <20191214112204.32701-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-SNTS-SMTP: 6C614476A65735D8D959C8976F109021CB8C575DD9BAB6DA3602F85CBB2D2B3C2000:8 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Prevent the overwriting of max_tx_fragments if it has already been set in chip-specific init routine. Signed-off-by: Shayne Chen --- 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);