0080-mac80211-ath9k-enable-platform-WLAN-LED-name.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 29 May 2016 12:56:43 +0200
  3. Subject: mac80211: ath9k: enable platform WLAN LED name
  4. Enable platform-supplied WLAN LED name for ath9k device.
  5. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  6. Acked-by: Hartmut Knaack <knaack.h@gmx.de>
  7. Backport of r48879
  8. diff --git a/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch
  9. new file mode 100644
  10. index 0000000..8d2d899
  11. --- /dev/null
  12. +++ b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch
  13. @@ -0,0 +1,48 @@
  14. +From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  15. +Date: Sun, 31 Jan 2016 20:45:57 +0100
  16. +Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name
  17. +
  18. +Enable platform-supplied WLAN LED name for ath9k device. It replaces generic
  19. +'ath9k-phy*' label with string set during platform initialization.
  20. +
  21. +Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  22. +---
  23. + drivers/net/wireless/ath/ath9k/gpio.c | 10 +++++++---
  24. + include/linux/ath9k_platform.h | 1 +
  25. + 2 files changed, 8 insertions(+), 3 deletions(-)
  26. +
  27. +--- a/drivers/net/wireless/ath/ath9k/gpio.c
  28. ++++ b/drivers/net/wireless/ath/ath9k/gpio.c
  29. +@@ -132,15 +132,19 @@ void ath_init_leds(struct ath_softc *sc)
  30. + if (AR_SREV_9100(sc->sc_ah))
  31. + return;
  32. +
  33. +- snprintf(led_name, sizeof(led_name), "ath9k-%s",
  34. +- wiphy_name(sc->hw->wiphy));
  35. ++ if (pdata && pdata->led_name)
  36. ++ strncpy(led_name, pdata->led_name, sizeof(led_name));
  37. ++ else
  38. ++ snprintf(led_name, sizeof(led_name), "ath9k-%s",
  39. ++ wiphy_name(sc->hw->wiphy));
  40. +
  41. + if (ath9k_led_blink)
  42. + trigger = sc->led_default_trigger;
  43. + else
  44. + trigger = ieee80211_get_radio_led_name(sc->hw);
  45. +
  46. +- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high);
  47. ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
  48. ++ !sc->sc_ah->config.led_active_high);
  49. +
  50. + if (!pdata)
  51. + return;
  52. +--- a/include/linux/ath9k_platform.h
  53. ++++ b/include/linux/ath9k_platform.h
  54. +@@ -45,6 +45,7 @@ struct ath9k_platform_data {
  55. +
  56. + int num_leds;
  57. + const struct gpio_led *leds;
  58. ++ const char *led_name;
  59. + };
  60. +
  61. + #endif /* _LINUX_ATH9K_PLATFORM_H */
  62. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c
  63. index d382453..bf80d4d 100644
  64. --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c
  65. +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c
  66. @@ -39,6 +39,18 @@ __init void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin)
  67. }
  68. }
  69. +__init void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name)
  70. +{
  71. + switch (wmac) {
  72. + case 0:
  73. + ap9x_wmac0_data.led_name = led_name;
  74. + break;
  75. + case 1:
  76. + ap9x_wmac1_data.led_name = led_name;
  77. + break;
  78. + }
  79. +}
  80. +
  81. __init struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac)
  82. {
  83. switch (wmac) {
  84. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h
  85. index ad288cb..dcfe541 100644
  86. --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h
  87. +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h
  88. @@ -19,6 +19,7 @@ void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin);
  89. void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val);
  90. void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds,
  91. int num_leds);
  92. +void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name);
  93. struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac);
  94. void ap91_pci_init(u8 *cal_data, u8 *mac_addr);
  95. @@ -33,6 +34,8 @@ static inline void ap9x_pci_setup_wmac_gpio(unsigned wmac,
  96. static inline void ap9x_pci_setup_wmac_leds(unsigned wmac,
  97. struct gpio_led *leds,
  98. int num_leds) {}
  99. +static inline void ap9x_pci_setup_wmac_led_name(unsigned wmac,
  100. + const char *led_name) {}
  101. static inline struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac)
  102. {
  103. return NULL;
  104. diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h
  105. index 30ce216..823e5ac 100644
  106. --- a/target/linux/generic/files/include/linux/ath9k_platform.h
  107. +++ b/target/linux/generic/files/include/linux/ath9k_platform.h
  108. @@ -45,6 +45,7 @@ struct ath9k_platform_data {
  109. int num_leds;
  110. const struct gpio_led *leds;
  111. + const char *led_name;
  112. };
  113. #endif /* _LINUX_ATH9K_PLATFORM_H */