Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3131547pxt; Mon, 9 Aug 2021 18:07:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWdCuVEMF2eunbhfTMfJePW/1wcf9Zs4i+iWHeWXImLd9s0jSnRgyGoJ3L5Mlu7qnzpVd8 X-Received: by 2002:a92:d586:: with SMTP id a6mr228523iln.283.1628557645728; Mon, 09 Aug 2021 18:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628557645; cv=none; d=google.com; s=arc-20160816; b=aWoBMjDZ0Fcj4A/HrEEYhfnE547JNNac9ebAwnT1ZprHNlKO39LK4Nv/WTHPTGjbhr W7yMmzag9GqCpdnYYfE38BeL1plIwWUQ5WROkdRXyTEwCwBqEOAYMxdXPr3ZteXQCmyc EiVaSsdEPn0+Jhy+Uf63siV3jFZVZ1l3LhcSLOn3hKFfh93JA+c8+f7PYizmC6ZRBK7v ej4cMffSQMKat0sAl28a31NfR9D9idsLV8A8OJzQQaYyriy5FQz10AwrgDJQI/YiXrHo nQwglIaRZICyVmaUBrx/11Lh1bU1TheJbLnUkmaRROAgIpbK/IGILQsLa/J0+ljBRbe5 KHmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=hxX1kCecuIB2DgJ4eqpo1M1SCBkC/CzOdmx0IzYcwIw=; b=hK0S/87K1few6hXGGVyfUODsBzyporeSpS0n3cZ+6VE0Qm14Vk6VPIrrAhslHIGHb4 dhJGDI0VoMyOYtrLcHBFXi7Ho8aq31Xv/cDZQwPXJ1ViU4bC3jTmLSPYB3it4HcPZUhx iOhOGVMpzkIe8fKprDLbnIjeIghBoYAbojWW8iN9xEv7kOyYveACI4xaFRqqS3ROtLx/ h8LYhcowiVi1WIUZbhE/ED7qQ9L0VqQl6d5M27bY7iosqNlmPFnKbOdaKfZv51oLs706 p3sMo7pQC3Gi0ixRuTnNYGnWJTpssgCc1gIebJeyVcbeX73z+eYSFfyTT03vissCnh9L CceA== 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 d2si20107884iow.58.2021.08.09.18.07.03; Mon, 09 Aug 2021 18:07:25 -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 S234080AbhHIVOK (ORCPT + 99 others); Mon, 9 Aug 2021 17:14:10 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:46936 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229516AbhHIVOJ (ORCPT ); Mon, 9 Aug 2021 17:14:09 -0400 X-UUID: f979d803fb0c4455bb0e271c7fecbbff-20210810 X-UUID: f979d803fb0c4455bb0e271c7fecbbff-20210810 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1741321336; Tue, 10 Aug 2021 05:13:45 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Aug 2021 05:13:44 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Aug 2021 05:13:44 +0800 From: To: , CC: , , , , , , , , , , , , , , , Subject: [PATCH] mt76: fix determining multicast frame in sta mode Date: Tue, 10 Aug 2021 05:13:43 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang We should use hdr->addr3 as the destination address to determine the frame is multicast frame or not when the device is running in sta mode. We can simply use ieee80211_get_DA for ap mode and sta mode both cases. Signed-off-by: Sean Wang Tested-by: Joshua Emele Tested-by: YN Chen --- v1: patch is generated on the top of mt76 with the additional patches [1/2] mt76: mt7915: send EAPOL frames at lowest rate [2/2] mt76: mt7921: send EAPOL frames at lowest rate [v2] mt76: add support for setting mcast rate --- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index 3972c56136a2..be5f68485337 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -965,7 +965,7 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi, val = FIELD_PREP(MT_TXD2_FRAME_TYPE, frame_type) | FIELD_PREP(MT_TXD2_SUB_TYPE, frame_subtype) | FIELD_PREP(MT_TXD2_MULTICAST, - is_multicast_ether_addr(hdr->addr1)); + is_multicast_ether_addr(ieee80211_get_DA(hdr))); txwi[2] = cpu_to_le32(val); if (!(info->flags & IEEE80211_TX_CTL_AMPDU)) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 5455231f5188..756b7c283a57 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -617,7 +617,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_rate *rate = &info->control.rates[0]; bool ext_phy = info->hw_queue & MT_TX_HW_QUEUE_EXT_PHY; - bool multicast = is_multicast_ether_addr(hdr->addr1); + bool multicast = is_multicast_ether_addr(ieee80211_get_DA(hdr)); struct ieee80211_vif *vif = info->control.vif; bool is_mmio = mt76_is_mmio(&dev->mt76); u32 val, sz_txd = is_mmio ? MT_TXD_SIZE : MT_USB_TXD_SIZE; diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 975e81e09a70..8b9dd77968fa 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -918,7 +918,7 @@ mt7915_mac_write_txwi_80211(struct mt7915_dev *dev, __le32 *txwi, u8 fc_type, fc_stype; u32 val; - *mcast = is_multicast_ether_addr(hdr->addr1); + *mcast = is_multicast_ether_addr(ieee80211_get_DA(hdr)); if (ieee80211_is_action(fc) && mgmt->u.action.category == WLAN_CATEGORY_BACK && diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 7c95189cf8cf..755a8777e47e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -663,7 +663,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi, struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - bool multicast = is_multicast_ether_addr(hdr->addr1); + bool multicast = is_multicast_ether_addr(ieee80211_get_DA(hdr)); u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; __le16 fc = hdr->frame_control; u8 fc_type, fc_stype; -- 2.25.1