mac80211: add RedPine RS9113 module support
authorEvgeniy Didin <Evgeniy.Didin@synopsys.com>
Wed, 4 Apr 2018 10:52:24 +0000 (13:52 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 18 Apr 2018 21:56:55 +0000 (23:56 +0200)
RedPine RS9113 wireless module requires rsi91x driver to be built
and linux-firmware/rsi/rs9113_wlan_qspi.rps to be installed.
Also we add patch for successful compilation of rsi91x driver.

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: John Crispin <john@phrozen.org>
package/firmware/linux-firmware/rsi.mk [new file with mode: 0644]
package/kernel/mac80211/Makefile
package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off [new file with mode: 0644]

diff --git a/package/firmware/linux-firmware/rsi.mk b/package/firmware/linux-firmware/rsi.mk
new file mode 100644 (file)
index 0000000..6d960a2
--- /dev/null
@@ -0,0 +1,6 @@
+Package/rs9113-firmware = $(call Package/firmware-default,RedPine Signals rs9113 firmware)
+define Package/rs9113-firmware/install
+       $(INSTALL_DIR) $(1)/lib/firmware/rsi
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/rsi/rs9113_wlan_qspi.rps $(1)/lib/firmware/rsi
+endef
+$(eval $(call BuildPackage,rs9113-firmware))
index 22ed841394f7eff6fe6619529f02522275dfebe4..73345ef5765d345a78e6a01a76838fcff07f45ea 100644 (file)
@@ -36,6 +36,7 @@ PKG_DRIVERS = \
        mt7601u \
        mwl8k mwifiex-pcie mwifiex-sdio \
        p54-common p54-pci p54-spi p54-usb \
+       rsi91x rsi91x-usb rsi91x-sdio\
        rt2x00-lib rt2x00-pci rt2x00-usb \
        rt2400-pci rt2500-pci rt2500-usb \
        rt2800-lib rt2800-mmio rt2800-pci rt2800-soc rt2800-usb \
@@ -1169,6 +1170,31 @@ define KernelPackage/p54-spi
   AUTOLOAD:=$(call AutoProbe,p54spi)
 endef
 
+define KernelPackage/rsi91x
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Redpine Signals Inc 91x WLAN driver support
+  DEPENDS+= +kmod-mac80211 +rs9113-firmware
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
+endef
+
+define KernelPackage/rsi91x-usb
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Redpine Signals USB bus support
+  DEPENDS+= +kmod-mac80211 +kmod-usb2 +kmod-rsi91x +rs9113-firmware
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_usb.ko
+  AUTOLOAD:=$(call AutoProbe,rsi_usb)
+endef
+
+define KernelPackage/rsi91x-sdio
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Redpine Signals SDIO bus support
+  DEPENDS+= +kmod-mac80211 +kmod-mmc +kmod-rsi91x +rs9113-firmware
+  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,rsi_sdio)
+endef
+
+
+
 define KernelPackage/rt2x00/Default
   $(call KernelPackage/mac80211/Default)
   TITLE:=Ralink Drivers for RT2x00 cards
@@ -1691,6 +1717,9 @@ config-$(call config_package,wl12xx) += WL12XX
 config-$(call config_package,wl18xx) += WL18XX
 config-y += WL_TI WILINK_PLATFORM_DATA
 config-$(call config_package,zd1211rw) += ZD1211RW
+config-$(call config_package,rsi91x) += RSI_91X
+config-$(call config_package,rsi91x-usb) += RSI_USB
+config-$(call config_package,rsi91x-sdio) += RSI_SDIO
 
 config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI
 config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI
@@ -1883,6 +1912,9 @@ $(eval $(call KernelPackage,p54-common))
 $(eval $(call KernelPackage,p54-pci))
 $(eval $(call KernelPackage,p54-usb))
 $(eval $(call KernelPackage,p54-spi))
+$(eval $(call KernelPackage,rsi91x))
+$(eval $(call KernelPackage,rsi91x-usb))
+$(eval $(call KernelPackage,rsi91x-sdio))
 $(eval $(call KernelPackage,rt2x00-lib))
 $(eval $(call KernelPackage,rt2x00-mmio))
 $(eval $(call KernelPackage,rt2x00-pci))
diff --git a/package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off b/package/kernel/mac80211/patches/970-rsi-fix-kbuild-reported-build-errors-with-CONFIG_PM-off
new file mode 100644 (file)
index 0000000..3b139ee
--- /dev/null
@@ -0,0 +1,93 @@
+From e6b3b2ed3d270b3c7080c9cf7d28636dc74b0387 Mon Sep 17 00:00:00 2001
+From: Amitkumar Karwar <amit.karwar@redpinesignals.com>
+Date: Wed, 1 Nov 2017 17:42:45 +0530
+Subject: rsi: fix kbuild reported build errors with CONFIG_PM off
+
+Some wowlan related code was outside CONFIG_PM flag which caused these
+build errors. They are fixed by moving that code under CONFIG_PM flag.
+
+Reported-by: kbuild test robot <fengguang.wu@intel.com>
+Fixes: ef71ed0608c ("rsi: sdio: Add WOWLAN support for S5 shutdown state")
+Fixes: a24e35fcee0 ("rsi: sdio: Add WOWLAN support for S4 hibernate state")
+Fixes: e1ced6422a3 ("rsi: sdio: add WOWLAN support for S3 suspend state")
+Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/rsi/rsi_91x_mac80211.c | 5 ++++-
+ drivers/net/wireless/rsi/rsi_91x_mgmt.c     | 2 ++
+ drivers/net/wireless/rsi/rsi_common.h       | 2 ++
+ drivers/net/wireless/rsi/rsi_mgmt.h         | 2 ++
+ 4 files changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
++++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+@@ -1752,6 +1752,7 @@ static int rsi_mac80211_cancel_roc(struc
+       return 0;
+ }
++#ifdef CONFIG_PM
+ static const struct wiphy_wowlan_support rsi_wowlan_support = {
+       .flags = WIPHY_WOWLAN_ANY |
+                WIPHY_WOWLAN_MAGIC_PKT |
+@@ -1824,7 +1825,6 @@ int rsi_config_wowlan(struct rsi_hw *ada
+ }
+ EXPORT_SYMBOL(rsi_config_wowlan);
+-#ifdef CONFIG_PM
+ static int rsi_mac80211_suspend(struct ieee80211_hw *hw,
+                               struct cfg80211_wowlan *wowlan)
+ {
+@@ -1977,7 +1977,10 @@ int rsi_mac80211_attach(struct rsi_commo
+       wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER;
+       wiphy->reg_notifier = rsi_reg_notify;
++#ifdef CONFIG_PM
+       wiphy->wowlan = &rsi_wowlan_support;
++#endif
++
+       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+       /* Wi-Fi direct parameters */
+--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
++++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+@@ -1597,6 +1597,7 @@ static int rsi_send_beacon(struct rsi_co
+       return 0;
+ }
++#ifdef CONFIG_PM
+ int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
+                           u16 sleep_status)
+ {
+@@ -1630,6 +1631,7 @@ int rsi_send_wowlan_request(struct rsi_c
+       return rsi_send_internal_mgmt_frame(common, skb);
+ }
++#endif
+ /**
+  * rsi_handle_ta_confirm_type() - This function handles the confirm frames.
+--- a/drivers/net/wireless/rsi/rsi_common.h
++++ b/drivers/net/wireless/rsi/rsi_common.h
+@@ -83,7 +83,9 @@ u16 rsi_get_connected_channel(struct iee
+ struct rsi_hw *rsi_91x_init(void);
+ void rsi_91x_deinit(struct rsi_hw *adapter);
+ int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len);
++#ifdef CONFIG_PM
+ int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
++#endif
+ struct rsi_sta *rsi_find_sta(struct rsi_common *common, u8 *mac_addr);
+ struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac);
+ void rsi_roc_timeout(struct timer_list *t);
+--- a/drivers/net/wireless/rsi/rsi_mgmt.h
++++ b/drivers/net/wireless/rsi/rsi_mgmt.h
+@@ -668,8 +668,10 @@ int rsi_band_check(struct rsi_common *co
+ int rsi_send_rx_filter_frame(struct rsi_common *common, u16 rx_filter_word);
+ int rsi_send_radio_params_update(struct rsi_common *common);
+ int rsi_set_antenna(struct rsi_common *common, u8 antenna);
++#ifdef CONFIG_PM
+ int rsi_send_wowlan_request(struct rsi_common *common, u16 flags,
+                           u16 sleep_status);
++#endif
+ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable,
+                       struct ieee80211_vif *vif);
+ #endif