Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4634598iog; Wed, 22 Jun 2022 02:49:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vTz2CMNb/OqyYmhzN2Kyy5VGTM3KrP9hr9MdtRO4VYDA1eI7tDAJjS78bHq5WNOOoiTHUJ X-Received: by 2002:a17:902:8bc1:b0:16a:187c:8719 with SMTP id r1-20020a1709028bc100b0016a187c8719mr18879508plo.43.1655891396070; Wed, 22 Jun 2022 02:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655891396; cv=none; d=google.com; s=arc-20160816; b=RIkSt/7QvD7MSGWE8wR7MMFfMKW6LGRgCVUMTXl1U0Q3T8ouhNYoIlX9UQJdTeDoIU frvRWsiYh+aE716cgP7cTNMRWsiEUFRb6O87W7Tv3uAcwVZ+yMPjDCS3R0uX5pFZofMa O7oes1WSKTMznJJWVk7HhsP+YHQALDC0pt8IGh2MU5crGX4+geYT7nFv6jHG8YvLbJCJ wEUUhxxrRLjWKUjGoymgaUj15PWWyt5eai+ufvPv7WTNbS1fHruNxImX2WjClAuhcNaS id3DuiomIqzrQ5yQzgJux7lSk/naBoQQEnFR8/AO6OTFJAwm6hB4dw0T60Vlfd9hNC5Q iVUQ== 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=zKkAu8sBmZ8AUWqqGaZNWJ0ySqq2Qh8VC8e0QTwAd24=; b=tt0TxDevlqOjwMeqLko+V5kp6hKnhHMsn5GAFBe81eXWMBbnjsIjR83t4bkfNfuqqy 5lh2FfP0ldMDDBwLvopITFao+ezBL82h7dTibRiECjs+azNRUirX6gPz6bMA7I/MKpxR hD0lgwMVIfxm5PbL/I8WMghgwG/guyas8ap99RbEDMGwkZwp1D9v+gZAGROrja2vw4Ik BkAWDR9nSHlPgTIPblGyjXpFoWyFy2yntDeSIGktHWyA7eR5UQv2Y8H/FNhAYi2XTInE Ysv/rszxjzEuCslWyDhnlAgj8hujGYs1ElHoF/wu22Gj0iFi7w4EvWFL/ouemA82LWvY 9waQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s77-20020a632c50000000b003fd085317e3si16252751pgs.176.2022.06.22.02.49.46; Wed, 22 Jun 2022 02:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbiFVJr1 (ORCPT + 65 others); Wed, 22 Jun 2022 05:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347200AbiFVJrY (ORCPT ); Wed, 22 Jun 2022 05:47:24 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104B33A1BB for ; Wed, 22 Jun 2022 02:47:21 -0700 (PDT) X-UUID: a2d8e2180a8649f0b8cfa243daa68730-20220622 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.6,REQID:eefcebbe-8d76-4a5f-94bc-c87817a75ce7,OB:0,LO B:0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,RULE:Release_Ham,AC TION:release,TS:105 X-CID-INFO: VERSION:1.1.6,REQID:eefcebbe-8d76-4a5f-94bc-c87817a75ce7,OB:0,LOB: 0,IP:0,URL:5,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,RULE:Spam_GS981B3D,AC TION:quarantine,TS:105 X-CID-META: VersionHash:b14ad71,CLOUDID:e1e3be2d-1756-4fa3-be7f-474a6e4be921,C OID:05257f553409,Recheck:0,SF:28|17|19|48,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,QS:nil,BEC:nil,COL:0 X-UUID: a2d8e2180a8649f0b8cfa243daa68730-20220622 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 248377425; Wed, 22 Jun 2022 17:47:17 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Wed, 22 Jun 2022 17:47:17 +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, 22 Jun 2022 17:47:17 +0800 From: MeiChia Chiu To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , Ryder Lee , , , MeiChia Chiu , Money Wang Subject: [PATCH] mt76: mt7915: update the maximum size of beacon offload Date: Wed, 22 Jun 2022 17:46:55 +0800 Message-ID: <20220622094655.26594-1-MeiChia.Chiu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Since an in-band discovery frame is offloaded by MCU, here we enlarge the command size to accommodate the additional content. Reviewed-by: Ryder Lee Signed-off-by: Money Wang Signed-off-by: MeiChia Chiu --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 9 +++++++-- drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 3a7051858892..417f6402aff4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1980,6 +1980,12 @@ mt7915_mcu_beacon_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vi len = sizeof(*discov) + MT_TXD_SIZE + skb->len; len = (len & 0x3) ? ((len | 0x3) + 1) : len; + if (len > (MAX_BSS_OFFLOAD_SIZE - rskb->len)) { + dev_err(dev->mt76.dev, "inband discovery size limit exceed\n"); + dev_kfree_skb(skb); + return; + } + tlv = mt7915_mcu_add_nested_subtlv(rskb, BSS_INFO_BCN_DISCOV, len, &bcn->sub_ntlv, &bcn->len); discov = (struct bss_info_inband_discovery *)tlv; @@ -2002,7 +2008,6 @@ mt7915_mcu_beacon_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vi int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int en, u32 changed) { -#define MAX_BEACON_SIZE 512 struct mt7915_dev *dev = mt7915_hw_dev(hw); struct mt7915_phy *phy = mt7915_hw_phy(hw); struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; @@ -2011,7 +2016,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct sk_buff *skb, *rskb; struct tlv *tlv; struct bss_info_bcn *bcn; - int len = MT7915_BEACON_UPDATE_SIZE + MAX_BEACON_SIZE; + int len = MAX_BSS_OFFLOAD_SIZE; bool ext_phy = phy != &dev->phy; if (vif->bss_conf.nontransmitted) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h index 5abde482a97f..f73259d376b0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -489,6 +489,12 @@ enum { SER_RECOVER }; +#define MAX_BEACON_SIZE 512 +#define MAX_INBND_FRME_SIZE 256 +#define MAX_BSS_OFFLOAD_SIZE (MAX_BEACON_SIZE + \ + MAX_INBND_FRME_SIZE + \ + MT7915_BEACON_UPDATE_SIZE) + #define MT7915_BSS_UPDATE_MAX_SIZE (sizeof(struct sta_req_hdr) + \ sizeof(struct bss_info_omac) + \ sizeof(struct bss_info_basic) +\ -- 2.18.0