Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3714417pxu; Sun, 11 Oct 2020 21:40:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwklBRH1zkjHO2w98g6fUf8D+vIprtuE469fwcLDYykrkCIVlff7hxcik/Fk38fmVFmmquT X-Received: by 2002:aa7:cf17:: with SMTP id a23mr11996280edy.298.1602477620728; Sun, 11 Oct 2020 21:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602477620; cv=none; d=google.com; s=arc-20160816; b=AJys1vakdXkhGKMoDatBrY7ErbaD1Lpg6LS0470YYi9pvQsk2uV1PjBFr7OHVl7jTy go5ABOtxXFX8oNdbo3WsLpMQoM4oNBGscdxvebpniARR3iSz09s1oqvPlXPUbot8S5Hv SJOmK8iQxhOEKKclKdpkOUNcE+4KJ11FhYw1mjwOdKGD9x7nHpxODBTZAxv739GIGnnZ zJ15bJt6bPkf3eCYBxy6chxow2HS2A/WdwMMtO9GpFai4ojTSDdmnJAEVsYxHdP0I+x2 gigk4/5s/dccvLQIhGuyT8dMjAD3qjbWfR6+nfMxeiVxntCHMGfjfOXKG4GkOfPVIJn6 XaBw== 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 :dkim-signature; bh=2TN7jVjMjbxZZhJmbSbjCMoCBxy54utpQMS3/Gy+B9A=; b=aEGPcIE7lidgRTZ2R49FmQLBIuWqoZC/NqK7w57P6SbkBuxqFrQIJNYNNLk8dep76P uP8aw1pIRWSn64hchkH93fW/Ws1tmoITWEtRi+qwxwuvAlOWJh+dMff6608ZhHDXsR/V pxaP6IavEmduabz0TWq9ibXQH1VaTy61CNj79M6y/BHPoq/IVdvl1go+pX/2jPqv9syn aQ5Hb3LPGFpQftinAZ/pUUbSGtyriAYp2Oi2HQuQqem+eu//EeEb6TtV58lAhbBMpcee wJWWLaP9eeLGS2aL0PdEqyqX/Byzsvg1whpahR5+RVf+yuwp7I7pOHR2NIMfKMJXXCMQ Nw2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Si6WkEj2; 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=pass (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 du16si2183340ejc.643.2020.10.11.21.39.41; Sun, 11 Oct 2020 21:40:20 -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; dkim=pass header.i=@mediatek.com header.s=dk header.b=Si6WkEj2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727216AbgJLD0g (ORCPT + 99 others); Sun, 11 Oct 2020 23:26:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:54570 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727157AbgJLD0f (ORCPT ); Sun, 11 Oct 2020 23:26:35 -0400 X-UUID: cf09e9cf8070453980e45c223ade5ef9-20201012 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=2TN7jVjMjbxZZhJmbSbjCMoCBxy54utpQMS3/Gy+B9A=; b=Si6WkEj2IPJWjZh+HBwTN/7+HqAHOKO35N7xTtLc0AqmAc9mbMUBtvhZ7iIjdR1IYPoKcUJXMbXLuK/yo5waK7FqXpRo/eW2L+lPGPF7Ol5vbHKizUNKmDcPpo+nS2e0DQRpmLBPN7I9385OEPSJPvcbDaC5oM7sVsBD811Xwxs=; X-UUID: cf09e9cf8070453980e45c223ade5ef9-20201012 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1491985267; Mon, 12 Oct 2020 11:26:31 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Oct 2020 11:26:28 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 12 Oct 2020 11:26:28 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH v2 09/10] mt76: mt7915: add support to set txpower in testmode Date: Mon, 12 Oct 2020 11:25:37 +0800 Message-ID: <20201012032538.21314-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201012032538.21314-1-shayne.chen@mediatek.com> References: <20201012032538.21314-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org U3VwcG9ydCB0eF9wb3dlciBzZXR0aW5nIGluIHRlc3Rtb2RlLiBOb3RlIHRoYXQgdGhlIHR4IHBv d2VyIHZhbHVlIG9mDQphbnRlbm5hIDEtMyBlcXVhbCB0byBhbnRlbm5hIDAuDQoNClJldmlld2Vk LWJ5OiBSeWRlciBMZWUgPHJ5ZGV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