Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1152702pxu; Thu, 8 Oct 2020 04:52:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz42UdgC0ACI3Yk8XHGkkjRomc/AF5cbtXenqTtkG+AsdYjUgYoCXsvbYg8x0qa3LvsGsk X-Received: by 2002:a17:906:79cf:: with SMTP id m15mr8304636ejo.11.1602157974575; Thu, 08 Oct 2020 04:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602157974; cv=none; d=google.com; s=arc-20160816; b=fWZKVmxS0813YTkU6Gu7jpEfuwFj2RB9UhXe4LbRuSZZaVSbE5BTWnnZd87A7cn/Jk L6bnciH1s4EfoaLMVDwg0oF6u9MckGvvdPhmJWF3dBnNP2M/AUqdBj8+/amOI4oxG2ye vSzfLjrfLUpZdGYRD/DA6uob8XdQJTP715Uc7hTtOaGmmoajnbrPyXh4k5DVwfDQ1tej NPVe35w++BBlD+2Ey3Ct8piZZDC5aKR1mLfKGr3rGR+j9sB2YTNK4/tXcnnykX9ci68a d2CrvzVBKtxWBgR19QW3K8xTLUyVGDIaR0IaQc2ZQDItJ7YAjoLNrivDWvEE88uuG6c3 Yslg== 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=R/triRHZgiS8ziMMu+emuBEwvRVGp9EpkK2dCaqv5xQ=; b=BCqnIVJi4P+q4KJIjTJYKQCJBYdwJGEYVmvMX6JAgPBBTbKRKi2BwFRX53jcQrQvvr CK1WopCT4yTbQ1pdQuEzAxz59QWuLQrGoh8LqJLUOvHqIt16JaVgQhYvZV/wiVlVY5nG cQiRIhAAsWGpUMvsE+KAdezhxEd+gKc/pCrI1OlGpiAWw5CQwH+G1x3KSjIyPA8aosGL 2J2R57m+VEXail3pghAJ3th9CMDPoRbDNW3HR4LJ9kqi0v3A3v10g1ZkYBdRVnENpNWk 4UVB3saEb2NHkXwwQBKaJtaeCXphEUZMRhPyhNeAJ9ppcgloBnw1lrw7JpCxpEZD55bt CLRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jaulp+zK; 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 di18si2881571edb.555.2020.10.08.04.52.29; Thu, 08 Oct 2020 04:52:54 -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=jaulp+zK; 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 S1729835AbgJHLd0 (ORCPT + 99 others); Thu, 8 Oct 2020 07:33:26 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:33947 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729404AbgJHLdY (ORCPT ); Thu, 8 Oct 2020 07:33:24 -0400 X-UUID: 4ffc26907ea74b4da5a0f8590493957f-20201008 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=R/triRHZgiS8ziMMu+emuBEwvRVGp9EpkK2dCaqv5xQ=; b=jaulp+zKzbNRqKeDRDqVtbdQWaTHc7yu7TbaNEy9LTBLvhed8wWCZYfP28PKbOPiXppRFGYPQNp9ENQ6mQYP8UBOins2oi1nJ1vb4OIXUcRCXIvnIKxgMEWGcQ0jm8CHi++0v7+cCBMQr5AUnUBPqKNFuKdoE2CD0zLV6kWv8sk=; X-UUID: 4ffc26907ea74b4da5a0f8590493957f-20201008 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.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 72673949; Thu, 08 Oct 2020 19:33:16 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 8 Oct 2020 19:33:13 +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, 8 Oct 2020 19:33:14 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 09/10] mt76: mt7915: add support to set txpower in testmode Date: Thu, 8 Oct 2020 19:29:03 +0800 Message-ID: <20201008112904.10620-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201008112904.10620-1-shayne.chen@mediatek.com> References: <20201008112904.10620-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 6D4527257F2D1665D4EBC857C2ABED4A507D876B70E565A05EE502DD8A7116DE2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org U3VwcG9ydCB0eF9wb3dlciBzZXR0aW5nIGluIHRlc3Rtb2RlLiBOb3RlIHRoYXQgdGhlIHR4IHBv d2VyIHZhbHVlIG9mDQ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