Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3278097ybi; Fri, 19 Jul 2019 00:27:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX6YmfiqMucvTH0fuhrcgqaU3XoomK2cZbYK/C5PA9D0NPDJdmclFXrnqK99x0n6KQglSz X-Received: by 2002:a65:60d3:: with SMTP id r19mr27277038pgv.91.1563521278178; Fri, 19 Jul 2019 00:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563521278; cv=none; d=google.com; s=arc-20160816; b=atgEA+9yVYZoZ4qKUfQA7DekcNmH/hD5Z3M2v36m2tIGJ74DIRz63pX4jDCTc1gf8a QLXgXvj3urP9W/jyZsPsAI/zX95Zri5AQAIOyb+AzokVWFaFw7zH0x/4Ni887VqDwNXF HB5uB8I+95+PrtD8dXduqpdgm4ZSr29MLQhrFe2DSO7W4oByQtISLzfkCgPk49YT4eUB l3oHXeBLzX9pP6LAfth1ZtjZrQR0K0CxESMc3d3J1FdV/QYn/gDGQx+7baiyvqGMWyQ9 UeL2dkXSpGNTbM2Kc19XzG6s+kpEzW1wCDbf41u+OdcrwyfyQsKjhpHwC+vdtLKkuHzy W95w== 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=2nsp0fd+aUiv0X1C3BpqR0F1U8Vu/+dYHqCTCptYvwg=; b=qM0r13T30L86co7fcCkJ+ZhqlJ8UMg9J9/SL6msAs3xlV7uk7cm43ngMcm+p+Jhmo3 ljMSTrKSmAZwRMrPGvQulgARmS1oAwECGuDzP7SdXxOaus0pTo1U3GRMDKQB6W+A6wyJ 9r5plEatT1J/jLmstvj4lxuYGs3Esig/Rbun1S8EUuiSAG248MfQpEtIbQSOcSjtl4lM 0R0rLE2lY3EnxUR8ZEbellUMB49hQ/8FFEEUaJEI2c1fRDzxyP2BNWt6qife1xblppft TmfI+x+2Yg97IZpSKDb8T95GCkzc3OmH6YW4+Pq3JQgW3ZkT5sBDvIjpb7Mevnems1f/ DGTA== 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 ck13si585623pjb.47.2019.07.19.00.27.42; Fri, 19 Jul 2019 00:27:58 -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 S1726600AbfGSH1X (ORCPT + 99 others); Fri, 19 Jul 2019 03:27:23 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:4147 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726036AbfGSH1X (ORCPT ); Fri, 19 Jul 2019 03:27:23 -0400 X-UUID: a69de542ced147f3a1a4b1ceb27efe2f-20190719 X-UUID: a69de542ced147f3a1a4b1ceb27efe2f-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 160776184; Fri, 19 Jul 2019 15:27:18 +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 15:27:14 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 19 Jul 2019 15:27:14 +0800 Message-ID: <1563521234.8090.4.camel@mtkswgap22> Subject: Re: [PATCH 2/3] mt76: mt7615: add 4 WMM sets support From: Ryder Lee To: Roy Luo CC: Felix Fietkau , Lorenzo Bianconi , YF Luo , Yiwei Chung , Sean Wang , , , Date: Fri, 19 Jul 2019 15:27:14 +0800 In-Reply-To: References: <50d28c9b0f9e7d6b277d36fc93f55142d7535259.1563518381.git.ryder.lee@mediatek.com> <1dc3cbc32729be40d0e1f2ef831377f2cddf3df3.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-TM-SNTS-SMTP: D61FDE6DCE5E490ED94D7E171FF4DB4510347F1D7F8F881410629479B1536F882000:8 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 15:05 +0800, Roy Luo wrote: > > > > On Fri, Jul 19, 2019 at 2:55 PM Ryder Lee > wrote: > > 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; > > > > IIUC, vifs with the same wmm_idx will share the same WMM HW, thus the > same WMM parameter. > Shouldn't we assign wmm_idx based on that? I think that's what I did here. vif0 <-> wmm0, vif1 <->wmm1 ... > >