aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-04-24 10:31:08 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-05-06 13:40:05 -0400
commitc43e93300a23545ba4a6fc73c42f20edf23a652e (patch)
treec97c017f4589f714c64671c4f8d2b2437e39c4a2
parentbb926924e9dc515e83a6a69e9b8b226638b9178d (diff)
iwlwifi: make LED support optional
If there's no LED on the system, it doesn't make a lot of sense to include close to 4k of LED-related code (mostly in mac80211), so instead of forcing LED support into the kernel, don't build iwlwifi/mac80211 LED support if there's no LED class support. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: EliadX Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/Kconfig12
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/Makefile3
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/led.h12
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/Makefile3
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h12
6 files changed, 38 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig
index 74b3b4de7bb7..b82d30c0f0c9 100644
--- a/drivers/net/wireless/iwlwifi/Kconfig
+++ b/drivers/net/wireless/iwlwifi/Kconfig
@@ -2,10 +2,6 @@ config IWLWIFI
2 tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) " 2 tristate "Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) "
3 depends on PCI && MAC80211 && HAS_IOMEM 3 depends on PCI && MAC80211 && HAS_IOMEM
4 select FW_LOADER 4 select FW_LOADER
5 select NEW_LEDS
6 select LEDS_CLASS
7 select LEDS_TRIGGERS
8 select MAC80211_LEDS
9 ---help--- 5 ---help---
10 Select to build the driver supporting the: 6 Select to build the driver supporting the:
11 7
@@ -43,6 +39,14 @@ config IWLWIFI
43 say M here and read <file:Documentation/kbuild/modules.txt>. The 39 say M here and read <file:Documentation/kbuild/modules.txt>. The
44 module will be called iwlwifi. 40 module will be called iwlwifi.
45 41
42config IWLWIFI_LEDS
43 bool
44 depends on IWLWIFI
45 depends on LEDS_CLASS
46 select LEDS_TRIGGERS
47 select MAC80211_LEDS
48 default y
49
46config IWLDVM 50config IWLDVM
47 tristate "Intel Wireless WiFi DVM Firmware support" 51 tristate "Intel Wireless WiFi DVM Firmware support"
48 depends on IWLWIFI 52 depends on IWLWIFI
diff --git a/drivers/net/wireless/iwlwifi/dvm/Makefile b/drivers/net/wireless/iwlwifi/dvm/Makefile
index dce7ab2e0c4b..4d19685f31c3 100644
--- a/drivers/net/wireless/iwlwifi/dvm/Makefile
+++ b/drivers/net/wireless/iwlwifi/dvm/Makefile
@@ -4,9 +4,10 @@ iwldvm-objs += main.o rs.o mac80211.o ucode.o tx.o
4iwldvm-objs += lib.o calib.o tt.o sta.o rx.o 4iwldvm-objs += lib.o calib.o tt.o sta.o rx.o
5 5
6iwldvm-objs += power.o 6iwldvm-objs += power.o
7iwldvm-objs += scan.o led.o 7iwldvm-objs += scan.o
8iwldvm-objs += rxon.o devices.o 8iwldvm-objs += rxon.o devices.o
9 9
10iwldvm-$(CONFIG_IWLWIFI_LEDS) += led.o
10iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o 11iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o
11 12
12ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../ 13ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 3441f70d0ff9..a6f22c32a279 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -888,9 +888,11 @@ struct iwl_priv {
888 888
889 struct iwl_event_log event_log; 889 struct iwl_event_log event_log;
890 890
891#ifdef CONFIG_IWLWIFI_LEDS
891 struct led_classdev led; 892 struct led_classdev led;
892 unsigned long blink_on, blink_off; 893 unsigned long blink_on, blink_off;
893 bool led_registered; 894 bool led_registered;
895#endif
894 896
895 /* WoWLAN GTK rekey data */ 897 /* WoWLAN GTK rekey data */
896 u8 kck[NL80211_KCK_LEN], kek[NL80211_KEK_LEN]; 898 u8 kck[NL80211_KCK_LEN], kek[NL80211_KEK_LEN];
diff --git a/drivers/net/wireless/iwlwifi/dvm/led.h b/drivers/net/wireless/iwlwifi/dvm/led.h
index 6a0817d9c4fa..1c6b2252d0f2 100644
--- a/drivers/net/wireless/iwlwifi/dvm/led.h
+++ b/drivers/net/wireless/iwlwifi/dvm/led.h
@@ -36,8 +36,20 @@ struct iwl_priv;
36#define IWL_LED_ACTIVITY (0<<1) 36#define IWL_LED_ACTIVITY (0<<1)
37#define IWL_LED_LINK (1<<1) 37#define IWL_LED_LINK (1<<1)
38 38
39#ifdef CONFIG_IWLWIFI_LEDS
39void iwlagn_led_enable(struct iwl_priv *priv); 40void iwlagn_led_enable(struct iwl_priv *priv);
40void iwl_leds_init(struct iwl_priv *priv); 41void iwl_leds_init(struct iwl_priv *priv);
41void iwl_leds_exit(struct iwl_priv *priv); 42void iwl_leds_exit(struct iwl_priv *priv);
43#else
44static inline void iwlagn_led_enable(struct iwl_priv *priv)
45{
46}
47static inline void iwl_leds_init(struct iwl_priv *priv)
48{
49}
50static inline void iwl_leds_exit(struct iwl_priv *priv)
51{
52}
53#endif
42 54
43#endif /* __iwl_leds_h__ */ 55#endif /* __iwl_leds_h__ */
diff --git a/drivers/net/wireless/iwlwifi/mvm/Makefile b/drivers/net/wireless/iwlwifi/mvm/Makefile
index ccdd3b7c4cce..c30d7f64ec1e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/Makefile
+++ b/drivers/net/wireless/iwlwifi/mvm/Makefile
@@ -3,8 +3,9 @@ iwlmvm-y += fw.o mac80211.o nvm.o ops.o phy-ctxt.o mac-ctxt.o
3iwlmvm-y += utils.o rx.o tx.o binding.o quota.o sta.o sf.o 3iwlmvm-y += utils.o rx.o tx.o binding.o quota.o sta.o sf.o
4iwlmvm-y += scan.o time-event.o rs.o 4iwlmvm-y += scan.o time-event.o rs.o
5iwlmvm-y += power.o coex.o 5iwlmvm-y += power.o coex.o
6iwlmvm-y += led.o tt.o offloading.o 6iwlmvm-y += tt.o offloading.o
7iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o 7iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o
8iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o
8iwlmvm-$(CONFIG_PM_SLEEP) += d3.o 9iwlmvm-$(CONFIG_PM_SLEEP) += d3.o
9 10
10ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../ 11ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index b52d1c97e289..1575ac7c5864 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -589,7 +589,9 @@ struct iwl_mvm {
589 u32 *fw_error_rxf; 589 u32 *fw_error_rxf;
590 u32 fw_error_rxf_len; 590 u32 fw_error_rxf_len;
591 591
592#ifdef CONFIG_IWLWIFI_LEDS
592 struct led_classdev led; 593 struct led_classdev led;
594#endif
593 595
594 struct ieee80211_vif *p2p_device_vif; 596 struct ieee80211_vif *p2p_device_vif;
595 597
@@ -896,8 +898,18 @@ int iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
896 struct iwl_rx_cmd_buffer *rxb, 898 struct iwl_rx_cmd_buffer *rxb,
897 struct iwl_device_cmd *cmd); 899 struct iwl_device_cmd *cmd);
898 900
901#ifdef CONFIG_IWLWIFI_LEDS
899int iwl_mvm_leds_init(struct iwl_mvm *mvm); 902int iwl_mvm_leds_init(struct iwl_mvm *mvm);
900void iwl_mvm_leds_exit(struct iwl_mvm *mvm); 903void iwl_mvm_leds_exit(struct iwl_mvm *mvm);
904#else
905static inline int iwl_mvm_leds_init(struct iwl_mvm *mvm)
906{
907 return 0;
908}
909static inline void iwl_mvm_leds_exit(struct iwl_mvm *mvm)
910{
911}
912#endif
901 913
902/* D3 (WoWLAN, NetDetect) */ 914/* D3 (WoWLAN, NetDetect) */
903int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); 915int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan);