Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3248368ybi; Thu, 18 Jul 2019 23:56:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5KvZMrDgs6sTjvwffI46rMG5aUz1NyWjfa/d0uzzXs1I/6njRLDq+3XyRQ6R8URRTPpgH X-Received: by 2002:a65:654f:: with SMTP id a15mr50953207pgw.73.1563519386720; Thu, 18 Jul 2019 23:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563519386; cv=none; d=google.com; s=arc-20160816; b=Kv0uWBD4iNatMBPhzqDY9ndXJ6LuYBbs4fGThMexMQTXh8PP95Vo0jxOWWy38rNjqa CYSKftios6I1u2HmTIJ0SJ9yiJn5b01uS8KDuxKgr5gRJe/uFlZCnWlfwA0s6k2bchZn LVId9Lvvm/bdXrXGML5jguQ/E2MmjBEXAGyowR840yltf4VGwbMUqW7GgN2exR/jyUYG JngegOZoBDxTC5iFhFGqPtuJcv/Qjq30dnKu2pOO/gQfNuxLoyyvGt1wxbPn1zY+rwvH Rla7Cx7iWpkpvGXUHRWkgk2jWqLu7o17m52ypaWa2wOKfW9qw1e9XuZoKHKeUfFvtcZg RZrQ== 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=DwwsUbQlFu9Ryeg6qNLXnBGD1wd0UlHw/2hdWjSWyRI=; b=FucQFn8uRIZRSxBvMsnhphn8Hkvq0lzwja4DOc2HfoDELwsRYiOzNSC8aHxKNWe1kl n3O5cflBnS24yEZCgHxwsSNGbIp/WuH5k9uitFpM9ABfJfa/viOLMwgEgv3LaS+6QPhl w/5QLVI8kb1uKjkGXnvMv5CPT2m1CCS1kIYNX7pxf3Ptp9ojmE5+p/3SuHV4/47XlWC/ SxNNxCdvv+D3sMlh7Z+f7n15o0Njz27kvuSIaykv3SbKqlbRdi+xg+Rqsrpgv+02m/S3 JjyeBpTl295RmwTKVlO0S+lOL5Rt/SzDb1tXSNbtnELyERzZIRiWfvzpozmNvf4Qt/dG g3YA== 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 t130si1618984pgc.237.2019.07.18.23.56.12; Thu, 18 Jul 2019 23:56:26 -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 S1726646AbfGSGzu (ORCPT + 99 others); Fri, 19 Jul 2019 02:55:50 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:60254 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726239AbfGSGzs (ORCPT ); Fri, 19 Jul 2019 02:55:48 -0400 X-UUID: 0c4c6d630b0c45e985598dd24eee1c43-20190719 X-UUID: 0c4c6d630b0c45e985598dd24eee1c43-20190719 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1245973637; Fri, 19 Jul 2019 14:55:40 +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; 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 2/3] mt76: mt7615: add 4 WMM sets support Date: Fri, 19 Jul 2019 14:55:35 +0800 Message-ID: <1dc3cbc32729be40d0e1f2ef831377f2cddf3df3.1563518381.git.ryder.lee@mediatek.com> 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-TM-SNTS-SMTP: 2C4497259A2F9BF68D2E70D97F9FFFBF3138A1BF62EE7AB0F6C1F04274B5F6F72000:8 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org MT7615 hardware supoorts 4 WMM sets, so this patch adds them accordingly. Also remove incorrect queue mapping in .conf_tx Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 5 +++-- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 16 ++++++---------- .../net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 + 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 8f9a2bb68ded..d85b3904f33a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -314,7 +314,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_vif *vif = info->control.vif; int tx_count = 8; - u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0; + u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0, wmm_idx = 0; __le16 fc = hdr->frame_control; u16 seqno = 0; u32 val; @@ -323,6 +323,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; omac_idx = mvif->omac_idx; + wmm_idx = mvif->wmm_idx; } if (sta) { @@ -335,7 +336,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4; if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) { - q_idx = skb_get_queue_mapping(skb); + q_idx = skb_get_queue_mapping(skb) + wmm_idx * MT7615_MAX_WMM_SETS; p_fmt = MT_TX_TYPE_CT; } else if (ieee80211_is_beacon(fc)) { q_idx = MT_LMAC_BCN0; diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index 2c702b31d55f..ea48dcdb65c0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -85,9 +85,9 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, } mvif->omac_idx = idx; - /* TODO: DBDC support. Use band 0 and wmm 0 for now */ + /* TODO: DBDC support. Use band 0 for now */ mvif->band_idx = 0; - mvif->wmm_idx = 0; + mvif->wmm_idx = mvif->idx % MT7615_MAX_WMM_SETS; ret = mt7615_mcu_set_dev_info(dev, vif, 1); if (ret) @@ -241,16 +241,12 @@ static int mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) { + struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_dev *dev = hw->priv; - static const u8 wmm_queue_map[] = { - [IEEE80211_AC_BK] = 0, - [IEEE80211_AC_BE] = 1, - [IEEE80211_AC_VI] = 2, - [IEEE80211_AC_VO] = 3, - }; - /* TODO: hw wmm_set 1~3 */ - return mt7615_mcu_set_wmm(dev, wmm_queue_map[queue], params); + queue += mvif->wmm_idx * MT7615_MAX_WMM_SETS; + + return mt7615_mcu_set_wmm(dev, queue, params); } static void mt7615_configure_filter(struct ieee80211_hw *hw, diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h index 2f43101343c3..f3f1738a01e7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h @@ -10,6 +10,7 @@ #include "regs.h" #define MT7615_MAX_INTERFACES 4 +#define MT7615_MAX_WMM_SETS 4 #define MT7615_WTBL_SIZE 128 #define MT7615_WTBL_RESERVED (MT7615_WTBL_SIZE - 1) #define MT7615_WTBL_STA (MT7615_WTBL_RESERVED - \ -- 2.18.0