diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-04-24 10:31:08 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-06 13:40:05 -0400 |
commit | c43e93300a23545ba4a6fc73c42f20edf23a652e (patch) | |
tree | c97c017f4589f714c64671c4f8d2b2437e39c4a2 | |
parent | bb926924e9dc515e83a6a69e9b8b226638b9178d (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/Kconfig | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/dev.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/led.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/Makefile | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 12 |
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 | ||
42 | config 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 | |||
46 | config IWLDVM | 50 | config 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 | |||
4 | iwldvm-objs += lib.o calib.o tt.o sta.o rx.o | 4 | iwldvm-objs += lib.o calib.o tt.o sta.o rx.o |
5 | 5 | ||
6 | iwldvm-objs += power.o | 6 | iwldvm-objs += power.o |
7 | iwldvm-objs += scan.o led.o | 7 | iwldvm-objs += scan.o |
8 | iwldvm-objs += rxon.o devices.o | 8 | iwldvm-objs += rxon.o devices.o |
9 | 9 | ||
10 | iwldvm-$(CONFIG_IWLWIFI_LEDS) += led.o | ||
10 | iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o | 11 | iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o |
11 | 12 | ||
12 | ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../ | 13 | ccflags-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 | ||
39 | void iwlagn_led_enable(struct iwl_priv *priv); | 40 | void iwlagn_led_enable(struct iwl_priv *priv); |
40 | void iwl_leds_init(struct iwl_priv *priv); | 41 | void iwl_leds_init(struct iwl_priv *priv); |
41 | void iwl_leds_exit(struct iwl_priv *priv); | 42 | void iwl_leds_exit(struct iwl_priv *priv); |
43 | #else | ||
44 | static inline void iwlagn_led_enable(struct iwl_priv *priv) | ||
45 | { | ||
46 | } | ||
47 | static inline void iwl_leds_init(struct iwl_priv *priv) | ||
48 | { | ||
49 | } | ||
50 | static 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 | |||
3 | iwlmvm-y += utils.o rx.o tx.o binding.o quota.o sta.o sf.o | 3 | iwlmvm-y += utils.o rx.o tx.o binding.o quota.o sta.o sf.o |
4 | iwlmvm-y += scan.o time-event.o rs.o | 4 | iwlmvm-y += scan.o time-event.o rs.o |
5 | iwlmvm-y += power.o coex.o | 5 | iwlmvm-y += power.o coex.o |
6 | iwlmvm-y += led.o tt.o offloading.o | 6 | iwlmvm-y += tt.o offloading.o |
7 | iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o | 7 | iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o |
8 | iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o | ||
8 | iwlmvm-$(CONFIG_PM_SLEEP) += d3.o | 9 | iwlmvm-$(CONFIG_PM_SLEEP) += d3.o |
9 | 10 | ||
10 | ccflags-y += -D__CHECK_ENDIAN__ -I$(src)/../ | 11 | ccflags-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 | ||
899 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); | 902 | int iwl_mvm_leds_init(struct iwl_mvm *mvm); |
900 | void iwl_mvm_leds_exit(struct iwl_mvm *mvm); | 903 | void iwl_mvm_leds_exit(struct iwl_mvm *mvm); |
904 | #else | ||
905 | static inline int iwl_mvm_leds_init(struct iwl_mvm *mvm) | ||
906 | { | ||
907 | return 0; | ||
908 | } | ||
909 | static inline void iwl_mvm_leds_exit(struct iwl_mvm *mvm) | ||
910 | { | ||
911 | } | ||
912 | #endif | ||
901 | 913 | ||
902 | /* D3 (WoWLAN, NetDetect) */ | 914 | /* D3 (WoWLAN, NetDetect) */ |
903 | int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); | 915 | int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan); |