Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1696778rdb; Wed, 20 Sep 2023 17:39:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg2OzIcK8kT8XoFVtlOYMEwBQIZHF3uuKrR2sYAT+kK7Vcg5u8ZbGVcAzubN2XUgci7HWp X-Received: by 2002:a05:6a00:1587:b0:690:d0d4:b757 with SMTP id u7-20020a056a00158700b00690d0d4b757mr4299735pfk.20.1695256763545; Wed, 20 Sep 2023 17:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695256763; cv=none; d=google.com; s=arc-20160816; b=ZAb0UQL7bEbY6vysh+Rsj2LQ4/oepdpipIYCwibKV70PpbxaGqW9NZmwPe886Q2DhB W5YInKdbY2eWQpGH5SqGDYiiASir/T34TJUQnsaY5Sd4QMQwMQv+LIiK7rzH3igmoLHN PdhSvGgbmHycP90xCxwUxArGHJqAAclTSiJO/8U6J0FNoAygGaIHuGkD0f26+8uQGFC4 4Xmrr7DOo7S2kmPiazshje11v++uuSWZce/t1SAczGqz2Iyiss4J1r/nBwwrt1WkdHJS K9AVUXfAdBQ4qgCAW+7YF2yiygbXid7kYchuqcj7G1K1SrFncaHNKSB24t5mUelmwPjb 2Lmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5TQNBnjZavPEW8nuhSc1iyFLUh3K3tECuSrRfKTT8g4=; fh=TSuyMlfOTyCx0zt3ucDyTttlN37QPvmvgk5pf20rBgY=; b=z+PRUiyyfeQTvtSqW7Gm0t/QEzObca/kI5XnThT1reZsyXpIan+zcCxlIsjrUHlovg f1EPWmzv4+A+HN8D0F0dijM33UWjuJRZOtkW7T4c0x67hHhXaF8W12j6JTnVHXjkjsMA FXtimlDCe2HGGjgPZeQSgNW4zn1kGTcFu7ZRLbfwTi7g19DeWNtxROErzsDVip4jUEp+ aOvnGk9o9fyCUD4NfMKjVY9O0+15PMjIBmj6vdxCz2tqCFO19YmH9AX8Lr+jDY8hdQTW 7lh8Qrq7AIF/2F8nwCkxhMA3Ce7acOpmXV3MthkSxSbJ8ZWyaBlj5cnXHnLiUDx9AcNL ZpEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y21-20020a056a00191500b0068fbbef7909si309278pfi.256.2023.09.20.17.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 17:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 796DD809848B; Wed, 20 Sep 2023 17:37:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbjIUAga (ORCPT + 56 others); Wed, 20 Sep 2023 20:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjIUAg2 (ORCPT ); Wed, 20 Sep 2023 20:36:28 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9684D7 for ; Wed, 20 Sep 2023 17:36:19 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 38L0a9a451966988, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.92/5.92) with ESMTPS id 38L0a9a451966988 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Sep 2023 08:36:09 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 21 Sep 2023 08:36:09 +0800 Received: from [127.0.1.1] (172.16.16.112) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 21 Sep 2023 08:36:09 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 1/4] wifi: rtw89: mcc: fix NoA start time when GO is auxiliary Date: Thu, 21 Sep 2023 08:35:56 +0800 Message-ID: <20230921003559.11588-2-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921003559.11588-1-pkshih@realtek.com> References: <20230921003559.11588-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.16.16.112] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 17:37:17 -0700 (PDT) From: Zong-Zhe Yang Under TDMA-based MCC (multi-channel concurrency), there are two roles, reference and auxiliary. We arrange MCC timeline based on time domain of reference role. Then, we calculate NoA start time according to MCC timeline. Besides, when MCC runs GO+STA mode, we plan an offset between GO time domain and STA time domain to make their TBTTs have a time gap. However, if GO is auxiliary role instead of reference role, NoA start time is described by STA time domain instead of GO time domain. To fix this, we apply the offset mentioned above to NoA start time to convert time domain from STA to GO. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/chan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/chan.c b/drivers/net/wireless/realtek/rtw89/chan.c index fb68d7f8ec3a..5564067c45cc 100644 --- a/drivers/net/wireless/realtek/rtw89/chan.c +++ b/drivers/net/wireless/realtek/rtw89/chan.c @@ -1430,6 +1430,7 @@ static void rtw89_mcc_handle_beacon_noa(struct rtw89_dev *rtwdev, bool enable) struct rtw89_mcc_role *aux = &mcc->role_aux; struct rtw89_mcc_config *config = &mcc->config; struct rtw89_mcc_pattern *pattern = &config->pattern; + struct rtw89_mcc_sync *sync = &config->sync; struct ieee80211_p2p_noa_desc noa_desc = {}; u64 start_time = config->start_tsf; u32 interval = config->mcc_interval; @@ -1449,6 +1450,9 @@ static void rtw89_mcc_handle_beacon_noa(struct rtw89_dev *rtwdev, bool enable) ieee80211_tu_to_usec(config->beacon_offset) + ieee80211_tu_to_usec(pattern->toa_aux); duration = config->mcc_interval - aux->duration; + + /* convert time domain from sta(ref) to GO(aux) */ + start_time += ieee80211_tu_to_usec(sync->offset); } else { rtw89_debug(rtwdev, RTW89_DBG_CHAN, "MCC find no GO: skip updating beacon NoA\n"); -- 2.25.1