Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3248275ybi; Thu, 18 Jul 2019 23:56:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrKd5gm6pX//oHVWk7sKCIQHiVe3YNFkc8Jpmvp5NGXMmcIrmmoaKTPxt7vWfAK0U1xg3q X-Received: by 2002:a17:90a:b394:: with SMTP id e20mr55459473pjr.76.1563519380537; Thu, 18 Jul 2019 23:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563519380; cv=none; d=google.com; s=arc-20160816; b=NFAav0DXWY0+cNhIeykrc16CkoaEzBC7++DTrkg4AWs0dsiXnahsPYFJRcwozvIas2 uODi/A8RIc8eAcPW2Sl1wdP+6P4kTPEOVcXqPMGqpT4RNHjEAfMKObTUkWQ+xRQ1aLHI dV3PfqKJDC8jB5ar8enlRH+qV1HMdUqWAzceyhevx8ncYq8wA6bjkLOHFCFQj2DN398F 6jFpziAyYHT1uJFm6Ai53xU9N1aOVGPPGFOURlvtf0K9y40MXAKSfzg0TCIyLCwOmWlc 8n8/Noeh0wmoF/AvQkpqE5LW8P1CbSH2IUES47i+I8SkE3wzURZRCSigJlPykSDf/7Tc Vm3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=5ukHYPdkXV2cNp7lrUG6gyKhjZiO5+Yc4G1+84INQH4=; b=lUdc7S+cgnxX0Kicu1l1vKidVhzUnxh/c6tB0GL3PyYuvoEu3Hrlq5x+cwR5TkDyX/ mQUg/ZFDuv7rZN7y0mutfvhzBGxjZU9SMFXO3bPVnaZ/t49V354Rf3p9Y5Z2D+1aeNpn YY/0FBq5r3Dsi1vnZqSbgczFT2IDeHwLSW9EFP4sakTNBim0LsB6FW+byaAK6bnUYnG9 MtkX9tK/YYbPeGZGLF9rbhGiJKH5xlRnIMNoC5DL9OqySZThWyRyiERTwLiyfCOdCWvh LKFDc+KiltHUEqOmZtkKbAMDJclkubISWCe8MaEZ9echsNKGCULpUS76UpwXXkDACgxy SPFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si950128pgs.106.2019.07.18.23.56.05; Thu, 18 Jul 2019 23:56:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbfGSGzr (ORCPT + 99 others); Fri, 19 Jul 2019 02:55:47 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:29417 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725616AbfGSGzq (ORCPT ); Fri, 19 Jul 2019 02:55:46 -0400 X-UUID: af31ce153ea848c1bc425f9b6cf813ef-20190719 X-UUID: af31ce153ea848c1bc425f9b6cf813ef-20190719 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1331009977; Fri, 19 Jul 2019 14:55:39 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 19 Jul 2019 14:55:38 +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; Fri, 19 Jul 2019 14:55:38 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , , Ryder Lee Subject: [PATCH 3/3] mt76: mt7615: add cwmin/cwmax initial values Date: Fri, 19 Jul 2019 14:55:36 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: <50d28c9b0f9e7d6b277d36fc93f55142d7535259.1563518381.git.ryder.lee@mediatek.com> References: <50d28c9b0f9e7d6b277d36fc93f55142d7535259.1563518381.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add initial values in mt7615_mcu_set_wmm() to cleanup setup flow. Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 5fd162be3654..154c09428b69 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -622,10 +622,7 @@ int mt7615_mcu_set_rts_thresh(struct mt7615_dev *dev, u32 val) int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue, const struct ieee80211_tx_queue_params *params) { -#define WMM_AIFS_SET BIT(0) -#define WMM_CW_MIN_SET BIT(1) -#define WMM_CW_MAX_SET BIT(2) -#define WMM_TXOP_SET BIT(3) +#define WMM_PARAM_SET GENMASK(3, 0) struct req_data { u8 number; u8 rsv[3]; @@ -638,19 +635,17 @@ int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue, } __packed req = { .number = 1, .queue = queue, - .valid = WMM_AIFS_SET | WMM_TXOP_SET, + .valid = WMM_PARAM_SET, .aifs = params->aifs, + .cw_min = BIT(5) - 1, + .cw_max = cpu_to_le16(BIT(10) - 1), .txop = cpu_to_le16(params->txop), }; - if (params->cw_min) { - req.valid |= WMM_CW_MIN_SET; + if (params->cw_min) req.cw_min = params->cw_min; - } - if (params->cw_max) { - req.valid |= WMM_CW_MAX_SET; + if (params->cw_max) req.cw_max = cpu_to_le16(params->cw_max); - } return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EDCA_UPDATE, &req, sizeof(req), true); -- 2.18.0