@@ -23,9 +23,6 @@ config ATH9K
depends on MAC80211 && HAS_DMA
select ATH9K_HW
select ATH9K_COMMON
- imply NEW_LEDS
- imply LEDS_CLASS
- imply MAC80211_LEDS
help
This module adds support for wireless adapters based on
Atheros IEEE 802.11n AR5008, AR9001 and AR9002 family
@@ -38,6 +35,18 @@ config ATH9K
If you choose to build a module, it'll be called ath9k.
+config ATH9K_LEDS
+ bool "Atheros ath9k LED triggers"
+ default y
+ depends on ATH9K || ATH9K_HTC
+ depends on NEW_LEDS
+ select LEDS_CLASS
+ select MAC80211_LEDS
+ help
+ This option enables a few LED triggers for different
+ packet receive/transmit events on Atheros family
+ of wireless cards (PCI and HTC).
+
config ATH9K_PCI
bool "Atheros ath9k PCI/PCIe bus support"
default y
@@ -178,9 +187,6 @@ config ATH9K_HTC
depends on USB && MAC80211
select ATH9K_HW
select ATH9K_COMMON
- imply NEW_LEDS
- imply LEDS_CLASS
- imply MAC80211_LEDS
help
Support for Atheros HTC based cards.
Chipsets supported: AR9271
@@ -839,7 +839,7 @@ static inline int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
#define ATH_LED_PIN_9485 6
#define ATH_LED_PIN_9462 4
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
void ath_init_leds(struct ath_softc *sc);
void ath_deinit_leds(struct ath_softc *sc);
#else
@@ -1030,7 +1030,7 @@ struct ath_softc {
struct ath_chanctx *cur_chan;
spinlock_t chan_lock;
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
bool led_registered;
char led_name[32];
struct led_classdev led_cdev;
@@ -20,7 +20,7 @@
/* LED functions */
/********************************/
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
static void ath_fill_led_pin(struct ath_softc *sc)
{
@@ -44,7 +44,7 @@
extern struct ieee80211_ops ath9k_htc_ops;
extern int htc_modparam_nohwcrypt;
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
extern int ath9k_htc_led_blink;
#endif
@@ -510,7 +510,7 @@ struct ath9k_htc_priv {
bool ps_enabled;
bool ps_idle;
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
enum led_brightness brightness;
bool led_registered;
char led_name[32];
@@ -604,7 +604,7 @@ void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
void ath9k_configure_leds(struct ath9k_htc_priv *priv);
void ath9k_init_leds(struct ath9k_htc_priv *priv);
void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
@@ -222,7 +222,7 @@ void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
/* LED */
/*******/
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
void ath9k_led_work(struct work_struct *work)
{
struct ath9k_htc_priv *priv = container_of(work,
@@ -42,7 +42,7 @@ int htc_use_dev_fw = 0;
module_param_named(use_dev_fw, htc_use_dev_fw, int, 0444);
MODULE_PARM_DESC(use_dev_fw, "Use development FW version");
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
int ath9k_htc_led_blink = 1;
module_param_named(blink, ath9k_htc_led_blink, int, 0444);
MODULE_PARM_DESC(blink, "Enable LED blink on activity");
@@ -867,7 +867,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv,
goto err_rx;
ath9k_hw_disable(priv->ah);
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
/* must be initialized before ieee80211_register_hw */
priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_htc_tpt_blink,
@@ -1007,7 +1007,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
cancel_work_sync(&priv->fatal_work);
cancel_work_sync(&priv->ps_work);
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
cancel_work_sync(&priv->led_work);
#endif
ath9k_htc_stop_ani(priv);
@@ -82,7 +82,7 @@ MODULE_PARM_DESC(use_msi, "Use MSI instead of INTx if possible");
bool is_ath9k_unloaded;
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
static const struct ieee80211_tpt_blink ath9k_tpt_blink[] = {
{ .throughput = 0 * 1024, .blink_time = 334 },
{ .throughput = 1 * 1024, .blink_time = 260 },
@@ -1035,7 +1035,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
ath9k_init_txpower_limits(sc);
-#ifdef CONFIG_MAC80211_LEDS
+#ifdef CONFIG_ATH9K_LEDS
/* must be initialized before ieee80211_register_hw */
sc->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(sc->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath9k_tpt_blink,
After commit 72cdab808714 ("ath9k: Do not select MAC80211_LEDS by default") a configuration like: - MAC80211_LEDS=y - LEDS_CLASS=m - NEW_LEDS=y - ATH9K=y leads to a build failure: /usr/bin/ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_deinit_leds': drivers/net/wireless/ath/ath9k/gpio.c:69: undefined reference to `led_classdev_unregister' /usr/bin/ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `led_classdev_register': include/linux/leds.h:190: undefined reference to `led_classdev_register_ext' To be able to use LED triggers, the LEDS_CLASS can only be a module if ath9k driver is a module as well. Reported-by: kernel test robot <lkp@intel.com> Fixes: 72cdab808714 ("ath9k: Do not select MAC80211_LEDS by default") Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- drivers/net/wireless/ath/ath9k/Kconfig | 18 ++++++++++++------ drivers/net/wireless/ath/ath9k/ath9k.h | 4 ++-- drivers/net/wireless/ath/ath9k/gpio.c | 2 +- drivers/net/wireless/ath/ath9k/htc.h | 6 +++--- drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 4 ++-- 8 files changed, 24 insertions(+), 18 deletions(-)