Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2364748rwd; Fri, 2 Jun 2023 08:26:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eW7lMl5pteZnAhG/HctTj778I1ydZW5pfY8cyqwsTZ5ptPZufkOLRQOGxsVt55TxFvfj+ X-Received: by 2002:a05:6a20:e610:b0:10f:92c6:9a36 with SMTP id my16-20020a056a20e61000b0010f92c69a36mr12046832pzb.32.1685719568620; Fri, 02 Jun 2023 08:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685719568; cv=none; d=google.com; s=arc-20160816; b=AOJR5y5823vI4wGYpMU4ctJFXSCyhXfZ/P4QCtvQQ871mEB9PVkEqAB4HWww532a7b rz572DFjE9QSHVux3uVbO/7FQQLVwch7GOl1bvz9QJulyTG/FwJBAMRasIStTJ6aFnpN PTg9bQpNufTZLDYnIgEyRaSbDNZ0/tyD/T3fJho8NzxufHZifirheUIH3vNpTC6QcXk3 3m+UPsV25aX4AnOMgnrMWdhjMZsqwPOWOS9pkYhfIw+25XBko/wUKZVZxBawd+GJLxtL vtWb+hxrcE/LB5B8u6Am2qpDr2Ds3wMCOu1UZvp+wV4SShwa7S/VLQPbKaaDtv9ZB/vB 1NLw== 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 :dkim-signature; bh=RZXEZCw31FaBhMKsyB3zJ9VlZt6/IvYCVkFUTILKzDs=; b=zTy2jlw6foGLLZVEVheZvMKdGlqI8iSy2IqGgXdrKYbn/2OdsP4kcxDTZo0vMnYpaC 4NbNXeBw8J5a/abB5O9BVK870M3RhYDvSHeZZ5esoeIEgN3EqPJym2f0R0TrZPjcJtr2 adbpgo8fqpxWhvN/hW66Y5p+4SyoSES4D3eWWy01c9CBxPcvfq6TpxNEXs4doVwmZTCi Ok3RL72OyGp9Qp6Cxb1fH2OWGDCJ2AGk6OTAeXz5iDbrk5rOoqfbuaq56RqT4i5mutz9 hraa8mHz7dHxuk9SOYiGjnX0HF5+KZ3k8e4Ck5H4LtFNTBYTNo7uUt4Q6dJ83muxca9T NC4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=L98F6NxX; 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=pass (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 f12-20020a170902ab8c00b001ac83d19265si1032085plr.291.2023.06.02.08.25.59; Fri, 02 Jun 2023 08:26:08 -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; dkim=pass header.i=@mediatek.com header.s=dk header.b=L98F6NxX; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235974AbjFBPV7 (ORCPT + 64 others); Fri, 2 Jun 2023 11:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbjFBPV4 (ORCPT ); Fri, 2 Jun 2023 11:21:56 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71DE8E60 for ; Fri, 2 Jun 2023 08:21:38 -0700 (PDT) X-UUID: 285ead36015911ee9cb5633481061a41-20230602 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=RZXEZCw31FaBhMKsyB3zJ9VlZt6/IvYCVkFUTILKzDs=; b=L98F6NxX1wBCwh4Dq4iasl/BC2wlVWSD1b0PMLvCEldS2tSH6m3BBBnmvYFsIlFJQfHd1w0kjtp9NveCybu5qwrjpycRTzgzmO3+9+uNRYcDY1XFKt1JQ+11t1pf38ExAai98593j9mxtx660HDh28twmRIiOJJDTSS8vJcVGT8=; X-CID-UNFAMILIAR: 1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:a68c733a-060f-4251-902b-843b44164178,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:100 X-CID-INFO: VERSION:1.1.25,REQID:a68c733a-060f-4251-902b-843b44164178,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:100,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:100 X-CID-META: VersionHash:d5b0ae3,CLOUDID:fded663d-7aa7-41f3-a6bd-0433bee822f3,B ulkID:230602232135DUKTBA6Z,BulkQuantity:0,Recheck:0,SF:29|28|16|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 285ead36015911ee9cb5633481061a41-20230602 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1168887386; Fri, 02 Jun 2023 23:21:33 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 2 Jun 2023 23:21:32 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 2 Jun 2023 23:21:32 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek , Shayne Chen Subject: [PATCH 01/12] wifi: mt76: mt7996: move radio ctrl commands to proper functions Date: Fri, 2 Jun 2023 23:20:57 +0800 Message-ID: <20230602152108.26860-1-shayne.chen@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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY,URIBL_BLOCKED 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 Move radio enable/disable commands into functions for configuring per-phy radio. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index 0975774fe244..8a1edc5c1288 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -43,6 +43,10 @@ int mt7996_run(struct ieee80211_hw *hw) if (ret) goto out; + ret = mt7996_mcu_set_radio_en(phy, true); + if (ret) + goto out; + ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH); if (ret) goto out; @@ -82,6 +86,8 @@ static void mt7996_stop(struct ieee80211_hw *hw) mutex_lock(&dev->mt76.mutex); + mt7996_mcu_set_radio_en(phy, false); + clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); mutex_unlock(&dev->mt76.mutex); @@ -190,10 +196,6 @@ static int mt7996_add_interface(struct ieee80211_hw *hw, if (ret) goto out; - ret = mt7996_mcu_set_radio_en(phy, true); - if (ret) - goto out; - dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx); phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); @@ -253,7 +255,6 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw, phy->monitor_vif = NULL; mt7996_mcu_add_dev_info(phy, vif, false); - mt7996_mcu_set_radio_en(phy, false); rcu_assign_pointer(dev->mt76.wcid[idx], NULL); -- 2.39.2