Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2811092ybl; Sat, 14 Dec 2019 19:57:28 -0800 (PST) X-Google-Smtp-Source: APXvYqzuz0AhCVwI1cMnAvr0taDosyvhlrGrntmVOwb16RDE5SkLrwzirpu3+i+aVidpvvWmNEk+ X-Received: by 2002:a05:6830:15d9:: with SMTP id j25mr23279378otr.279.1576382248076; Sat, 14 Dec 2019 19:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576382248; cv=none; d=google.com; s=arc-20160816; b=pcRi6a/oJx//HkbDVNA+CPbNhvAhfGC+/0ENQGTe5oWZ8ambBK1eer6daOCalux2Un Fh64dOBoOQrJYQN5n5vAhhPt40Z6uqfvBxYHXQ/DKK0ZF7mZes36N+tpC4y+JJ8TkpSt Jav2fbRHE8zGpvbpcf5Qk2HPadxP8bYbOl26Q90Bo0hkQdP4E9cMuEUvCi/BxKvL8aBt ECspT148qgG+fugoxHdPSJ10vFjgcHGFa52bdKt06O3SZuzSNrl3UcW95gA6PRsYOCBB l5aKucNlRCe1dy6VwgEWFm/82jMlOXmQK0wmmvKKDdkrgWk0Fj+ilw4LU/Q1Phg9ZfWX hrcA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=MvnbWM1VPsxTrRV3tUt59T8bb49saFjEAy9blQfNuV0=; b=pPnG8Zi65HipH1z6RoPbu2ULy2LyIwYTggU0ul8nZCT0UHdiK+aixkc8OOrcGWtQx/ uUc9phV7zqbFVii81S0Qh1XJhdBbEIMN0Qd62PCWXuyK7Ul0apZxnLYjG/YjvgGocqrt jYbi6PM3Hj/27EBroQ/ilborY+clXBUhiSwkg7UCh0fp7qFhuITMiextk+YWnZ8ebPeQ 2IhU532uw8SHcBbfJ5CuvSE1U1ep9CIPtGauLgwf46Th03cKFR4QPgzBU2CmxU/xEut+ fKzlJQXz+O9Jv+wAH9qrruPVAVgFA+PokhWhElg9fNDdaOH2kmO2LGKKT7uP6PqCJTKI Jolg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hjFaGBFo; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id x126si7914784oix.53.2019.12.14.19.56.56; Sat, 14 Dec 2019 19:57:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hjFaGBFo; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 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 S1726019AbfLOD4l (ORCPT + 99 others); Sat, 14 Dec 2019 22:56:41 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:18549 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725933AbfLOD4l (ORCPT ); Sat, 14 Dec 2019 22:56:41 -0500 X-UUID: efaae02709d14da28a7fe9e96562c0d2-20191215 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=MvnbWM1VPsxTrRV3tUt59T8bb49saFjEAy9blQfNuV0=; b=hjFaGBFoymon7ur2E+42OvSkC0EA7HnHK7cImowmiLP6G9n35K5c2pXfxLgFVdVDIZzbmWvGndLigJsW16TeWZLpS7RcBTC7sfF1CKSNbnX8qmgmEDv6+UH1mlmYovUzOV6IxPm/gW5HOOfzHsPt0NyYf1RHN/1yMoZ3fc6dOi8=; X-UUID: efaae02709d14da28a7fe9e96562c0d2-20191215 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1482699382; Sun, 15 Dec 2019 11:56:35 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 15 Dec 2019 11:56:59 +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.1395.4 via Frontend Transport; Sun, 15 Dec 2019 11:56:21 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Roy Luo , , , , Ryder Lee Subject: [PATCH 1/2] mt76: mt7615: rework set_channel function Date: Sun, 15 Dec 2019 11:56:31 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 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 Tm8gbmVlZCB0byBzZW5kIGJvdGggTUNVX0VYVF9DTURfU0VUX1JYX1BBVEggYW5kIE1DVV9FWFRf Q01EX0NIQU5ORUxfU1dJVENIDQp0b2dldGhlciB0byBNQ1UuDQoNClNwbGl0IHRoZW0gb3V0IGJ5 IHBhc3NpbmcgdGhlIHByb3BlciBjb21tYW5kIGluIHRoZSBjb3JyZXNwb25kaW5nIGZsb3cuDQoN ClNpZ25lZC1vZmYtYnk6IFJ5ZGVyIExlZSA8cnlkZXIubGVlQG1lZGlhdGVrLmNvbT4NCi0tLQ0K IC4u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