Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5403682pxu; Thu, 22 Oct 2020 01:02:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVwKYfOrI93U0ayh6aOAj4kLGtnmBXevh2OkyLG8notNuqtK7Hid4AD8xkmgEF/2j5u57o X-Received: by 2002:a17:906:a1d8:: with SMTP id bx24mr1050571ejb.161.1603353738508; Thu, 22 Oct 2020 01:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603353738; cv=none; d=google.com; s=arc-20160816; b=y8mgHb7zI30gztqje2PMQVGUrDOVHWjctW6x/zZl7lDnfcQFSqW/lDd5oPuR41bHAZ oEPbPG/PkrqBKVShibDHZp92eqAsJo1ccFYSHTEMgsQBYS61+fMLxYEsexXlBtBSy9DI 0mJQt8LIMbA8kaybCWUVTbkQqBX5oWvDWGs1PIlHKdDiBZlcTYxzD43YMTTQ5EoD56xd /QHR9NJbxeXkpmzVxfA7ytBcDSN9/ynkb1LqKV5RgkkU+Lz3/RcMy7cT0VykyriO/dGq aW/bwWMkaUC0ZHMp8v+4xIVp06VTNh16faXpBIXZwiBY4zKOATsrze2bwDri1oK9eVYb WBNw== 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=ubohY/g8g7z0KWnRlK8MD461CtBHRICaCK/003ikeWU=; b=WiJI2ncWuyR8Rwm2f/t7KX/IL/daaKpnJ3arW2gwI8CTZsOFAbKLVE9Pu0NaUdHD9P ITs1OCaKuofbMihI4O7rRCt8ryT+mnXhKe6aWaMop+Lz9Mw2E6SPtEmQ9AzbxNr5YcUQ yqZkwk10jC3XJenn7y5EMAj2fhIi88FYH4WTRpRSEsp1P9GP0acwFox6w/ESdcDzsUrC Z7hXyAUPoaVW5Fwfa8yzCFp7rL1p2oBPCFaQGwavu06MXUhf/HitNWYtAN7rZxHhTBY7 YgJVMIg71COq7g6BQ89t67rjbgCpWFXFn1i/IOqWtXaYSbHuyCLHIRm5nUITpzUvRp75 hLoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WJl4jBdR; 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 m13si470640edq.514.2020.10.22.01.01.54; Thu, 22 Oct 2020 01:02:18 -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=WJl4jBdR; 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 S2895059AbgJVC2v (ORCPT + 99 others); Wed, 21 Oct 2020 22:28:51 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:43007 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2443052AbgJVC2t (ORCPT ); Wed, 21 Oct 2020 22:28:49 -0400 X-UUID: 51ec72cbd3db47368d3d8dfa18ca1eab-20201022 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=ubohY/g8g7z0KWnRlK8MD461CtBHRICaCK/003ikeWU=; b=WJl4jBdRPiLEMFiMyJm/5QsPW/TJIrNDypKlCNkKw7zUZDopxv00RtW1oGZQ2nLPIf6Adl94kVBhmcgqNYRoHeGwfcrhbxnePP8V05OjJ410maxX0rOaHMnacwRX0OAg57+2Q2rF61KdQrQQGA2naTLSQFIMkShK2f+Gr6/bCrY=; X-UUID: 51ec72cbd3db47368d3d8dfa18ca1eab-20201022 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 2094947617; Thu, 22 Oct 2020 10:28:43 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 22 Oct 2020 10:28:40 +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; Thu, 22 Oct 2020 10:28:40 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH v4 09/10] mt76: mt7915: add support to set txpower in testmode Date: Thu, 22 Oct 2020 10:28:19 +0800 Message-ID: <20201022022820.3077-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201022022820.3077-1-shayne.chen@mediatek.com> References: <20201022022820.3077-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 5D845305484DD9A37B32C0F4A5DE34B00AF662C04656B7EB7C84E42D6C7FB5842000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org U3VwcG9ydCB0eF9wb3dlciBzZXR0aW5nIGluIHRlc3Rtb2RlLiBOb3RlIHRoYXQgdGhlIHR4IHBv d2VyIHZhbHVlIG9mDQphbnRl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