Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp333078ybt; Fri, 19 Jun 2020 03:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqWfWmVxhwCj/vpBIfLkSywta4cLkr3bGqvv2KmdtaofKbhuuGUaEvnLbn30JFclUG+t5Y X-Received: by 2002:a05:6402:1750:: with SMTP id v16mr2547026edx.137.1592561233752; Fri, 19 Jun 2020 03:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592561233; cv=none; d=google.com; s=arc-20160816; b=Mk/Jf+mqH9ZGreJ788GxxtwSauQRZ0fEJqXowK69YUebzD+Ffk0yptdK91MMliXGPj t/dtExjCPFdTav9FlPC7pAniZBy4uxRxyYaHH1MGlhcDCziaJWCBpsuxy7V1zOx3P5lW +hbl3O6UeGsCBZkzrC8D1NZNne7FQEO6jA9Ah0f/4jwiX3VPi1LHfZBKr8r53ME/DOIk PMmSutwgamTUPYNMPGKJEEfTJotv2o3HKEBLb7PUlprFtVNXviWS9UIPITgYr1GgzdbB 4go/t8FNl4a3qVsJBfNILRhTBG1XnreuxQ7Bup7Yohnzzueh6CfxqJhOblelunmYIPQt eQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7R3+vIyIcJGIoNqgxDKbx7s8gBbCjRAh+DCyFKieXfA=; b=BqJPBQKupHPurLVH8/zt4thz2NbsHlWfF7UZK11vAaQvnixTQR9Sg6Lm83nafzQZoB zXcKBU56BRlQ+KHTTA2k1ftpnOduBgPifgq31IIEYaeqAE/y1IB/y4LO9Ze5cgXAFTmf iV14d8JOpTPNNqJa7Ebj20pNXM8xJnTDHvi337k+AaCqt2Uk1Sz9Uq9qTwPdoAEMe1/W lEwJX/bnrVcseOpMJNHJ3rYfVVkFhgCzF5wSPKfc0pLaUDJj7Kl9iWOpNeq+WrQl2n7g XTz3RYkqbMkx8nWjOrmTks/rgYEACZnDTBLOdjO6lu1oI3mCryDXUi94DUe4DEY+tQEh PnHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UU96WzUn; 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 dn18si4336210ejc.321.2020.06.19.03.06.40; Fri, 19 Jun 2020 03:07:13 -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=UU96WzUn; 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 S1732343AbgFSKEt (ORCPT + 99 others); Fri, 19 Jun 2020 06:04:49 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:47767 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732331AbgFSKEq (ORCPT ); Fri, 19 Jun 2020 06:04:46 -0400 X-UUID: 7cc5efdd2ab94716a9973988aa7f1614-20200619 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=7R3+vIyIcJGIoNqgxDKbx7s8gBbCjRAh+DCyFKieXfA=; b=UU96WzUn/HibU7uQGzUIUYR6RAe0yXjHVb+FoOkIZ/nhonnH48hnA65H+8rbRKFO98ETTugGpJv5HB86p+Vdw1PsSK+gNd8KtV7YsQicoSUuSMjojThAIk6k2so6LgNPfu97Sznk2nO+q8ftMdc/w2AmsNSjAmGN7bitghYuK5U=; X-UUID: 7cc5efdd2ab94716a9973988aa7f1614-20200619 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1076093704; Fri, 19 Jun 2020 18:04:43 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 19 Jun 2020 18:04:35 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 19 Jun 2020 18:04:35 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , "Evelyn Tsai" , linux-mediatek , Shayne Chen Subject: [PATCH v3 3/3] mt76: mt7915: directly read per-rate tx power from registers Date: Fri, 19 Jun 2020 18:04:25 +0800 Message-ID: <20200619100425.26351-3-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200619100425.26351-1-shayne.chen@mediatek.com> References: <20200619100425.26351-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org U2luY2UgZHJpdmVyIG5vIGxvbmdlciBoYW5kbGVyIHBlci1yYXRlIHR4IHBvd2VyIHNldHRpbmcs IHdlIG5lZWQgdG8NCnJlYWQgdGhlIHBvd2VyIHZhbHVlcyBkaXJlY3RseSBmcm9tIHJlZ2lzdGVy cy4NCg0KVGVzdGVkLWJ5Oi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