Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3439118ybi; Fri, 19 Jul 2019 03:18:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIaXLH+eYr2f+5Rmu2Ge3Y3403+k/uR9qpTZZJgSqI0WkV5L63wMQX774xp1MMJOr4zytu X-Received: by 2002:a17:90a:bf92:: with SMTP id d18mr58249650pjs.128.1563531523092; Fri, 19 Jul 2019 03:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563531523; cv=none; d=google.com; s=arc-20160816; b=qXxgnbIZUeRlAq1yV0L4/dQGjo1VGMVYMn9SmV6dqukjx82/NUhwfPBlOnEx3sGTcR P6IGsPM703o8bnTJcB2cSGN90hZ0ov6THkAWoKrY5isF9rHuaYqVu4MzuLkkRivHajGa SawHNSOVVq4/BIpxhDN2rXnujsaT25kNq6a/MAJ+7UofkVnJJRKbOdMB2uTZ47Uv43cz NQlfLY2AG3GUfkEkWEk2TzNzWb3Hg1L1VpVOTPiSRLnKhwikIWNHFHFlcjCwCJSM5Ofu xgaEfeChovO7hHAseuA8OwUHoHkG/1FV23la4hL4ljqPP1umffWN67mFrBL/Jpo1v0g5 Kuqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=T6yrkPV33NtYMrkVrB+PuyOVR/51WgeiZFMBDkQbGjo=; b=thbsDjlnrYHL/X4/o6B6r40Mss30Jtylv9DvZXTz3ypL5xz9tbatQsg0qTGMRLVtCK WL11T37rpk4cWjsqAdjB1vFUNEJOU9t9eGiIoBaNievl9s64jQ2xZ/7zcKZFzKsHTPjz UMOZ/0VEPB5Cla4hxy8e4PB1/NKX5JbaQFGLrrRXHO4rY1PoGXEllYUXlBJgWlLl8gob tcyemEkk/W5/2IkYTz7ELVlGkgcu8swvM6eyqQChrrcZPPQgtlB55hWKJv3/pK/v9yIb eQK3n4YBEg6t10orGziRbHHVhJzGKenntvABOf4H6z/NNkDRsidErf0QdDqJviOfB34i jvWA== 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 cp10si211313plb.301.2019.07.19.03.18.26; Fri, 19 Jul 2019 03:18:43 -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 S1727290AbfGSKSC (ORCPT + 99 others); Fri, 19 Jul 2019 06:18:02 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:53594 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725794AbfGSKSC (ORCPT ); Fri, 19 Jul 2019 06:18:02 -0400 X-UUID: 263050394edc4ec59f48a13859d9414e-20190719 X-UUID: 263050394edc4ec59f48a13859d9414e-20190719 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2101253499; Fri, 19 Jul 2019 18:17:57 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 19 Jul 2019 18:17:56 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 19 Jul 2019 18:17:56 +0800 Message-ID: <1563531476.17970.2.camel@mtkswgap22> Subject: Re: [PATCH 3/3] mt76: mt7615: add cwmin/cwmax initial values From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , Date: Fri, 19 Jul 2019 18:17:56 +0800 In-Reply-To: References: <50d28c9b0f9e7d6b277d36fc93f55142d7535259.1563518381.git.ryder.lee@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-07-19 at 14:55 +0800, Ryder Lee wrote: > 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); > - } I should use fls() here and will send a v2 > return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EDCA_UPDATE, > &req, sizeof(req), true);