[openwrt/openwrt] mac80211: convert UniFi Outdoor+ HSR support to OF

LEDE Commits lede-commits at lists.infradead.org
Sun Jan 31 18:49:07 EST 2021


blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0c499f6068176c1139d5c6b7d89f454b03383453

commit 0c499f6068176c1139d5c6b7d89f454b03383453
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu Jan 7 01:03:05 2021 +0100

    mac80211: convert UniFi Outdoor+ HSR support to OF
    
    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 <mail at david-bauer.net>
---
 .../patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch  | 35 +++++++---------------
 .../generic/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..bc5c1ab4ef 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 <linux/ath9k_platform.h>
 +#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, "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 <linux/nl80211.h>
+@@ -18,6 +18,7 @@
  #include <linux/delay.h>
-+#include <linux/ath9k_platform.h>
  #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, "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 */



More information about the lede-commits mailing list