From patchwork Sat Jan 23 00:58:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1430617 X-Patchwork-Delegate: mail@david-bauer.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=ylF2CsPq; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DMyW30gfNz9sT6 for ; Sat, 23 Jan 2021 12:01:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=V4DJud0EL2blscropjwV+iAwAqWdu7f0UbKVEiXvnLg=; b=ylF2CsPq/JIdxSYI5s2BO4glko GMwfEUU2dHcCToMXw6qBePFQsnx08Qvsm3mdjveo6m3K/NIE6e7+ZMzeinL189aBvliGBqSfgiR8Q 6Wp7XGZoqEi5Hjezn0PaJSrGoiP8ZVRLduD9jrwJI+RkgxuTMXIZmA+9AweyNnZbaNkuRxXk5ltZa LVNn9Y8451KF7vgc5kedumq3sCVKhmSofIqB/FFqx8Vjf4hLHg2fEQY/qz2jttz6onASw+SHErvav RQsrFKkaZQeDUL4d1jZQsqD3VEi7le3rvGEqvfkMH1UAK5lGeHXPGOZsWVUncpRgDXQSKbBYL7z/9 eDrj1owQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l37Go-00022v-9A; Sat, 23 Jan 2021 00:59:18 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l37Gl-00021n-9h for openwrt-devel@lists.openwrt.org; Sat, 23 Jan 2021 00:59:16 +0000 Received: from localhost.localdomain (p200300e53f07540090b3f01584654f50.dip0.t-ipconnect.de [IPv6:2003:e5:3f07:5400:90b3:f015:8465:4f50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 834482F065 for ; Sat, 23 Jan 2021 01:59:10 +0100 (CET) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/2] mac80211: convert UniFi Outdoor+ HSR support to OF Date: Sat, 23 Jan 2021 01:58:53 +0100 Message-Id: <20210123005854.576853-1-mail@david-bauer.net> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210122_195915_462731_26FCC17F X-CRM114-Status: GOOD ( 14.91 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Enable support for the Ubiquiti UniFi Outdoor+ RF filter via device-tree. The old way of using platform data is not required anymore, as it was only used on the now removed ar71xx target. Signed-off-by: David Bauer --- .../ath/551-ath9k_ubnt_uap_plus_hsr.patch | 35 ++++++------------- .../files/include/linux/ath9k_platform.h | 2 -- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch index 4454baeef1..24cffb0e0e 100644 --- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch @@ -1,27 +1,26 @@ --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c -@@ -15,6 +15,8 @@ +@@ -15,6 +15,7 @@ */ #include "ath9k.h" -+#include +#include "hsr.h" /* Set/change channels. If the channel is really being changed, it's done * by reseting the chip. To accomplish this we must first cleanup any pending -@@ -22,6 +24,7 @@ +@@ -22,6 +23,7 @@ */ static int ath_set_channel(struct ath_softc *sc) { -+ struct ath9k_platform_data *pdata = sc->dev->platform_data; ++ struct device_node *np = sc->dev->of_node; struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_hw *hw = sc->hw; -@@ -42,6 +45,11 @@ static int ath_set_channel(struct ath_so +@@ -42,6 +44,11 @@ static int ath_set_channel(struct ath_so ath_dbg(common, CONFIG, "Set channel: %d MHz width: %d\n", chan->center_freq, chandef->width); -+ if (pdata && pdata->ubnt_hsr) { ++ if (of_property_read_bool(np, "ath9k,ubnt-hsr")) { + ath9k_hsr_enable(ah, chandef->width, chan->center_freq); + ath9k_hsr_status(ah); + } @@ -332,30 +331,27 @@ +#endif /* HSR_H */ --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -16,8 +16,10 @@ - - #include +@@ -18,6 +18,7 @@ #include -+#include #include "ath9k.h" #include "btcoex.h" +#include "hsr.h" u8 ath9k_parse_mpdudensity(u8 mpdudensity) { -@@ -649,6 +651,7 @@ void ath_reset_work(struct work_struct * +@@ -649,6 +650,7 @@ void ath_reset_work(struct work_struct * static int ath9k_start(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; -+ struct ath9k_platform_data *pdata = sc->dev->platform_data; ++ struct device_node *np = sc->dev->of_node; struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; -@@ -727,6 +730,11 @@ static int ath9k_start(struct ieee80211_ +@@ -727,6 +729,11 @@ static int ath9k_start(struct ieee80211_ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); } -+ if (pdata && pdata->ubnt_hsr) { ++ if (of_property_read_bool(np, "ath9k,ubnt-hsr")) { + ath9k_hsr_init(ah); + ath9k_hsr_disable(ah); + } @@ -373,17 +369,6 @@ ath9k-$(CPTCFG_ATH9K_DEBUGFS) += debug.o ---- a/include/linux/ath9k_platform.h -+++ b/include/linux/ath9k_platform.h -@@ -53,6 +53,8 @@ struct ath9k_platform_data { - unsigned num_btns; - const struct gpio_keys_button *btns; - unsigned btn_poll_interval; -+ -+ bool ubnt_hsr; - }; - - #endif /* _LINUX_ATH9K_PLATFORM_H */ --- a/local-symbols +++ b/local-symbols @@ -112,6 +112,7 @@ ATH9K_WOW= diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h index f1f2ad419c..e210108568 100644 --- a/target/linux/generic/files/include/linux/ath9k_platform.h +++ b/target/linux/generic/files/include/linux/ath9k_platform.h @@ -53,8 +53,6 @@ struct ath9k_platform_data { unsigned num_btns; const struct gpio_keys_button *btns; unsigned btn_poll_interval; - - bool ubnt_hsr; }; #endif /* _LINUX_ATH9K_PLATFORM_H */