Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6798284ybi; Mon, 22 Jul 2019 01:52:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqydoJ6pPJg+VIcMOZT8scw9Zfk+bpl1EDhw7nGXtwvbO8+UES4Xj1p0IDTgwYKsSsjKsYbh X-Received: by 2002:a17:90a:3590:: with SMTP id r16mr76699687pjb.44.1563785548622; Mon, 22 Jul 2019 01:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563785548; cv=none; d=google.com; s=arc-20160816; b=TK2/1kBnFUfe8uWQS8JQM18j0xXYYfWa1KWql1VLOY5X+NPQEyeGYWQPEbzgHV/6b4 Z/3NQyGHa/a8xvAahTClTbIUuvJbdCYkh+SbQy1kup1X52yA5zO8I05tGJk2JrUHaZJG VCJPwl5Y5Ot4PXaxjNk/AHXtqFIKLOlF74dxicO1zqO6uayqrtLwjFZLYWnsHZRp7AnM k4VbKq3/uJQMHxcfl239d5kqoWwTH8K8TyJMPyQhu5a8GEL3NQZmYf1SHZdK8cW0YWfl bLD7xP6sp0YLr88jgwtytLkXEA6KeJZFyTTun7+ihwP5rbpw5cJZsqGw1z5vH1ZrMCvy jmUA== 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=/cEYu7twSv+Eid6HB7HRh5SMzrIeoM3vJ33aYYXi1Yw=; b=t3/fuLApq5vCcKwOui1JfdaFuOEEquNf8r4wJ9Qd7BSfkR3RhLRGwSBd1ywDtxyvF7 p0RvOb0+xiCwDy3bB85/07qf3nB8et064LQ4NKNbtDfeHC/43iz14Y/3gZpJEV4/M1oJ fMGr+jVdRgTAfcLzRRjiOuJ0vELkPPDaov7X0XL9oq/Im1Q+YiFbKr/dKH1RDqqnN3Ic DzCkkLMsPDul6BEnm/ir0MSZJzsHlq6BZzCVOjCkKFj2aFvDwByj/+FztsyqbXgrGslX m9oK0ZzMCnRqFf1vFwxFiIknTgKXgDAOBp0pHYxGD/wwrlP6+WKMLy9EHXzvB2Riwo9x McsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 w6si11367958pfn.84.2019.07.22.01.52.14; Mon, 22 Jul 2019 01:52:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 S1727753AbfGVIuU (ORCPT + 99 others); Mon, 22 Jul 2019 04:50:20 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:12377 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725989AbfGVIuT (ORCPT ); Mon, 22 Jul 2019 04:50:19 -0400 X-UUID: d25003901f06453d92403987751c353f-20190722 X-UUID: d25003901f06453d92403987751c353f-20190722 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1541259887; Mon, 22 Jul 2019 16:50:13 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 22 Jul 2019 16:50:10 +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; Mon, 22 Jul 2019 16:50:10 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , Ryder Lee Subject: [PATCH v1 2/2] mt76: mt7615: update cw_min/max related settings Date: Mon, 22 Jul 2019 16:50:09 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 1614E78AC7BB478B9D7593A764A2A4CFE08A5FE6E9043D679098553EAAF0811B2000:8 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add default values of cw_min/max and use fls() for configuration. Signed-off-by: Ryder Lee --- Changes since v1: - Restore each WMM_* bit and add WMM_PARAM_SET. - Use fls(). --- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 5fd162be3654..3563ddf17aad 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -626,6 +626,8 @@ int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue, #define WMM_CW_MIN_SET BIT(1) #define WMM_CW_MAX_SET BIT(2) #define WMM_TXOP_SET BIT(3) +#define WMM_PARAM_SET (WMM_AIFS_SET | WMM_CW_MIN_SET | \ + WMM_CW_MAX_SET | WMM_TXOP_SET) struct req_data { u8 number; u8 rsv[3]; @@ -638,19 +640,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 = 5, + .cw_max = cpu_to_le16(10), .txop = cpu_to_le16(params->txop), }; - if (params->cw_min) { - req.valid |= WMM_CW_MIN_SET; - req.cw_min = params->cw_min; - } - if (params->cw_max) { - req.valid |= WMM_CW_MAX_SET; - req.cw_max = cpu_to_le16(params->cw_max); - } + if (params->cw_min) + req.cw_min = fls(params->cw_min); + if (params->cw_max) + req.cw_max = cpu_to_le16(fls(params->cw_max)); return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EDCA_UPDATE, &req, sizeof(req), true); -- 2.18.0