Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp199291pxj; Tue, 1 Jun 2021 19:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbOkBBvVXFhVRMFckzNpVy3ToP2gSX/2fQ6ZsZWtKCxjW1ZDM1HDiL9J5FFYwfa2RDO1fp X-Received: by 2002:a05:6e02:138a:: with SMTP id d10mr8316594ilo.263.1622600055849; Tue, 01 Jun 2021 19:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622600055; cv=none; d=google.com; s=arc-20160816; b=sTb7goz06f/A2jrG2HF6wXrwV5YNx3HazdRBodkEFW6SyiIDr64cn5V6gRRMrZtBlw If0pT+EExjSjHTPQO+FTFXYDYh+BtIM8trnfwrbPHYEYoAHRby0HvKI7NNH43P5ox9Xo bg2yaEEHHuGdIcXTHAKH1NsKL1r3nsN1IrrnEz49cIPC47p0gDJvp3pBzeZQ12aGjtYB On6FXa11qs/CjN3bxSKYXvggyJzX1JMaHLJsk604KeHOa5+HBtS8P2jGcIfAeQDlg71c kg8OzV4L5Qm7z3axvoeOFVfH9Cx26NJI6zjW07PqZ7D5AAJlGAug7oc5naG/L6VDG5e2 pIow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ogoQ4feGTe8aLORblBaoyRf73uw52fIqnaLV5tt85Eg=; b=nx5UWSZYp+de9Fa+A1oU8UqkGox3iuOGXk2WWqlv3RZ1OjQ9hPDF27bdoFg+0ldmVE +2DgdcdfuJEyYEqL44gtOgX2lLyqwsUOoj7pscKyrVzaka5tM3XUUJrYZxXYanjUl2RD YbwTt4fcP86eXei8VsNQ/Fqpf/hJBw05HTkQE3HdEzTQOm9AgW2OEnHrsg3JxH6ekV56 x1X98g/Is4k4XTsgPKZZFtPKzgK373rEK+caQK3cdsgH4wEMOYIqBSgnAv72sF2oV+a7 1zZ08HR2GdTyoZf3VYxy6w2jbNsTphmODuLgwKZ/55UtNn8qmBEU5pUEQ/+PEtz1xCAc 24Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r4si22026591ilb.18.2021.06.01.19.13.59; Tue, 01 Jun 2021 19:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 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 S230204AbhFBBwG (ORCPT + 99 others); Tue, 1 Jun 2021 21:52:06 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:57902 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230205AbhFBBwF (ORCPT ); Tue, 1 Jun 2021 21:52:05 -0400 X-UUID: b27c6118a37447869ea3bb621c9b2f81-20210602 X-UUID: b27c6118a37447869ea3bb621c9b2f81-20210602 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1301431755; Wed, 02 Jun 2021 09:50:20 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Jun 2021 09:50:18 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 2 Jun 2021 09:50:18 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , Ryder Lee Subject: [PATCH 2/2] mt76: mt7915: setup drr group for peers Date: Wed, 2 Jun 2021 09:50:17 +0800 Message-ID: <6c7c14984826d3a69b6a381a83259b8df63c13c1.1622591903.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <56332dd6ef478da69d4a5319c3745116072e1949.1622591903.git.ryder.lee@mediatek.com> References: <56332dd6ef478da69d4a5319c3745116072e1949.1622591903.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a prerequisite for MU functionality. Tested-by: Evelyn Tsai Signed-off-by: Ryder Lee --- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 655fabd32c1e..49321b4dcf71 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -2332,6 +2332,32 @@ int mt7915_mcu_add_he(struct mt7915_dev *dev, struct ieee80211_vif *vif, MCU_EXT_CMD(STA_REC_UPDATE), true); } +static int +mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif, + struct ieee80211_sta *sta) +{ +#define MT_STA_BSS_GROUP 1 + struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; + struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; + struct { + __le32 action; + u8 wlan_idx_lo; + u8 status; + u8 wlan_idx_hi; + u8 rsv0[5]; + __le32 val; + u8 rsv1[8]; + } __packed req = { + .action = cpu_to_le32(MT_STA_BSS_GROUP), + .wlan_idx_lo = to_wcid_lo(msta->wcid.idx), + .wlan_idx_hi = to_wcid_hi(msta->wcid.idx), + .val = cpu_to_le32(mvif->idx % 16), + }; + + return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SET_DRR_CTRL), &req, + sizeof(req), true); +} + int mt7915_mcu_add_sta_adv(struct mt7915_dev *dev, struct ieee80211_vif *vif, struct ieee80211_sta *sta, bool enable) { @@ -2341,6 +2367,10 @@ int mt7915_mcu_add_sta_adv(struct mt7915_dev *dev, struct ieee80211_vif *vif, return 0; /* must keep the order */ + ret = mt7915_mcu_add_group(dev, vif, sta); + if (ret) + return ret; + ret = mt7915_mcu_add_txbf(dev, vif, sta, enable); if (ret) return ret; -- 2.18.0