rpcd: iwinfo plugin fixes
[openwrt.git] / package / kernel / mac80211 / patches / 546-ath9k_platform_led_name.patch
1 From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2 Date: Sun, 31 Jan 2016 20:45:57 +0100
3 Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name
4
5 Enable platform-supplied WLAN LED name for ath9k device. It replaces generic
6 'ath9k-phy*' label with string set during platform initialization.
7
8 Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
9 ---
10  drivers/net/wireless/ath/ath9k/gpio.c |   10 +++++++---
11  include/linux/ath9k_platform.h        |    1 +
12  2 files changed, 8 insertions(+), 3 deletions(-)
13
14 --- a/drivers/net/wireless/ath/ath9k/gpio.c
15 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
16 @@ -132,15 +132,19 @@ void ath_init_leds(struct ath_softc *sc)
17         if (AR_SREV_9100(sc->sc_ah))
18                 return;
19  
20 -       snprintf(led_name, sizeof(led_name), "ath9k-%s",
21 -                wiphy_name(sc->hw->wiphy));
22 +       if (pdata && pdata->led_name)
23 +               strncpy(led_name, pdata->led_name, sizeof(led_name));
24 +       else
25 +               snprintf(led_name, sizeof(led_name), "ath9k-%s",
26 +                        wiphy_name(sc->hw->wiphy));
27  
28         if (ath9k_led_blink)
29                 trigger = sc->led_default_trigger;
30         else
31                 trigger = ieee80211_get_radio_led_name(sc->hw);
32  
33 -       ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high);
34 +       ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
35 +                           !sc->sc_ah->config.led_active_high);
36  
37         if (!pdata)
38                 return;
39 --- a/include/linux/ath9k_platform.h
40 +++ b/include/linux/ath9k_platform.h
41 @@ -45,6 +45,7 @@ struct ath9k_platform_data {
42  
43         int num_leds;
44         const struct gpio_led *leds;
45 +       const char *led_name;
46  };
47  
48  #endif /* _LINUX_ATH9K_PLATFORM_H */