Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp412920pxk; Thu, 24 Sep 2020 08:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9EugfuiDcjxDXY4wn1nWOOzmvYT7JPeYvh2g+G/vEdhmktJ26r8K17v57BbxYjKdh52Ov X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr510359edw.38.1600961690915; Thu, 24 Sep 2020 08:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600961690; cv=none; d=google.com; s=arc-20160816; b=Yl1ySCi2j31veC0cdOQsCQ+RJC+PxxkqtlcyGruFfsojTKNc3ebWrYpj1TMJYPWjsJ PFiotsuhQtfWYlIhooUXJHY6x/au8RhpsXZbaJAKM78gPjVCznNR36ac1s5406mAzON0 t3AYC3lj1IevJZ3hVF0pJ6TGQCWHIDK/29slHypT/TIlBTOFIxcuZtC21mRiQGQBZgR0 k0Z4VGKLuFj9IYNPG/s/Mtmpc5zsACqypw74tMOKQo56LukhY0OIja3F420VjiXtJWLo PgnWKUN3DUUJhz7H00jqXAr2y2uOgQdvuh8sIe2trQXqpmb/wCEeuTeUOLDYzkwt8S+0 pqWA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OTCsfNo99ojtjb1h0R1ye7ZsuTV+XjaLXSyLcJ3cg0E=; b=fylminwPw5HAXo4hjN1nKf6gGcPg2wp6eQCi+ixW+LhQIaECDxoHHVFLPHGAUQAist KyBch5vse3NE8GpqTPdRw4tqJZ1hR5gbzR8dm5tFu+8Uj3iF+IAV3Pfw29JgumoHMlG3 K0Q5IiaeFLNr86NW5csHqsx+Sq+/Y+7Px++ITyVIwZfT3XEOnriJ0a6S0uvdjEFbUI3r ABNNCCkCkCBpSv0PWAgL8kcUNGfAf86ylsYJ6MCRsuKMS/t5n/l6HKkPYgUV42CRAe4y bVxVmOhRNXg5E1o9jPUtSm6bjTJotfrh7KBPYxyN1CP3LhAXxdA16NKZ0qRBLgdO3pu/ xuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QCasCKcx; 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 lr25si2414884ejb.42.2020.09.24.08.34.17; Thu, 24 Sep 2020 08:34:50 -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=QCasCKcx; 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 S1728509AbgIXPdg (ORCPT + 99 others); Thu, 24 Sep 2020 11:33:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:39966 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728333AbgIXPdg (ORCPT ); Thu, 24 Sep 2020 11:33:36 -0400 X-UUID: 87b2f657d67645e7a48469864f6354a2-20200924 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:Message-ID:Date:Subject:CC:To:From; bh=OTCsfNo99ojtjb1h0R1ye7ZsuTV+XjaLXSyLcJ3cg0E=; b=QCasCKcx9+Q0MxhQuaujX8t7kahuG83drD+kHDEORaNJEGY/Uh9h0AXjX/FEK8AcDBqvHgCrci9kmOJaep+72eaaL6NqZ6QC/S9dmxHZWQlBapyKYGJ1Dj6RlwPKMAL85pMAwPxyp3KzsaD3TIh5eF+N0Zkuwejkl1pT2qxzApM=; X-UUID: 87b2f657d67645e7a48469864f6354a2-20200924 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] 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 938191805; Thu, 24 Sep 2020 23:23:19 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 24 Sep 2020 23:23:13 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 24 Sep 2020 23:23:13 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , Evelyn Tsai , , , Ryder Lee Subject: [PATCH 1/2] mt76: mt7915: measure channel noise and report it via survey Date: Thu, 24 Sep 2020 23:23:13 +0800 Message-ID: <670fe8dcb9e1308041047718af241225ff5614bb.1600960534.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 7E353855B9F60CF3FD2186DF9C4F0CBE4BA96433650EDF6132C8388890D68BEE2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org UmVhZCBwZXItc3RyZWFtIG1lYXN1cmVtZW50cyBldmVyeSAxMDAgbXMgYW5kIGJ1aWxkIGEgc2lt cGxlIG1vdmluZyBhdmVyYWdlLg0KDQpUZXN0ZWQtYnk6IFNoYXluZSBDaGVuIDxzaGF5bmUuY2hl bkBtZWRpYXRlay5jb20+DQpTa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