lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c83e14787bc86f8f8062e0aa44e03ef80c3fd38a.1563518381.git.ryder.lee@mediatek.com>
Date:   Fri, 19 Jul 2019 14:55:36 +0800
From:   Ryder Lee <ryder.lee@...iatek.com>
To:     Felix Fietkau <nbd@....name>,
        Lorenzo Bianconi <lorenzo.bianconi@...hat.com>
CC:     Roy Luo <royluo@...gle.com>, YF Luo <yf.luo@...iatek.com>,
        Yiwei Chung <yiwei.chung@...iatek.com>,
        Sean Wang <sean.wang@...iatek.com>,
        <linux-wireless@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, Ryder Lee <ryder.lee@...iatek.com>
Subject: [PATCH 3/3] mt76: mt7615: add cwmin/cwmax initial values

Add initial values in mt7615_mcu_set_wmm() to cleanup setup flow.

Signed-off-by: Ryder Lee <ryder.lee@...iatek.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ