X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=package%2Fkernel%2Fmac80211%2Fpatches%2F530-ath9k_extra_leds.patch;h=3cfffa03e49ba685e8f5ffb3b06e1b74f8a7dcb0;hb=6e97442105366adb25aa32c35d2fc97e29145064;hp=41081dcb6a169a15ed7a2ca3b46cb067bb9710e6;hpb=7a260c3620ec4c89c39c5eb396d64c114d3c3243;p=lede.git diff --git a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch index 41081dcb6a..3cfffa03e4 100644 --- a/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/530-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -558,6 +558,9 @@ struct ath9k_wow_pattern { +@@ -806,6 +806,9 @@ static inline int ath9k_dump_btcoex(stru void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); void ath_fill_led_pin(struct ath_softc *sc); @@ -10,9 +10,9 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -733,6 +736,13 @@ enum spectral_mode { - SPECTRAL_CHANSCAN, - }; +@@ -945,6 +948,13 @@ void ath_ant_comb_scan(struct ath_softc + + #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ +struct ath_led { + struct list_head list; @@ -24,8 +24,8 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -775,9 +785,8 @@ struct ath_softc { - struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; +@@ -996,9 +1006,8 @@ struct ath_softc { + spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS - bool led_registered; @@ -35,18 +35,20 @@ + struct list_head leds; #endif - struct ath9k_hw_cal_data caldata; + #ifdef CPTCFG_ATH9K_DEBUGFS --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c -@@ -24,40 +24,102 @@ +@@ -24,45 +24,102 @@ static void ath_led_brightness(struct led_classdev *led_cdev, enum led_brightness brightness) { - struct ath_softc *sc = container_of(led_cdev, struct ath_softc, led_cdev); -- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, (brightness == LED_OFF)); +- u32 val = (brightness == LED_OFF); + struct ath_led *led = container_of(led_cdev, struct ath_led, cdev); + struct ath_softc *sc = led->sc; -+ + +- if (sc->sc_ah->config.led_active_high) +- val = !val; + ath9k_ps_wakeup(sc); + ath9k_hw_set_gpio(sc->sc_ah, led->gpio->gpio, + (brightness != LED_OFF) ^ led->gpio->active_low); @@ -61,7 +63,8 @@ + led->cdev.name = gpio->name; + led->cdev.default_trigger = gpio->default_trigger; + led->cdev.brightness_set = ath_led_brightness; -+ + +- ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, val); + ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->cdev); + if (ret < 0) + return ret; @@ -136,7 +139,7 @@ if (AR_SREV_9100(sc->sc_ah)) return; -- if (!led_blink) +- if (!ath9k_led_blink) - sc->led_cdev.default_trigger = - ieee80211_get_radio_led_name(sc->hw); - @@ -150,7 +153,7 @@ - ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &sc->led_cdev); - if (ret < 0) - return; -+ if (led_blink) ++ if (ath9k_led_blink) + trigger = sc->led_default_trigger; + else + trigger = ieee80211_get_radio_led_name(sc->hw); @@ -162,7 +165,7 @@ void ath_fill_led_pin(struct ath_softc *sc) --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -1016,7 +1016,7 @@ int ath9k_init_device(u16 devid, struct +@@ -944,7 +944,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CPTCFG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ @@ -173,7 +176,7 @@ #endif --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1874,6 +1874,61 @@ static const struct file_operations fops +@@ -1393,6 +1393,61 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -235,7 +238,7 @@ int ath9k_init_debug(struct ath_hw *ah) { -@@ -1897,6 +1952,10 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1417,6 +1472,10 @@ int ath9k_init_debug(struct ath_hw *ah) &fops_eeprom); debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_chanbw); @@ -243,6 +246,6 @@ + debugfs_create_file("gpio_led", S_IWUSR, + sc->debug.debugfs_phy, sc, &fops_gpio_led); +#endif - debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, - &fops_dma); - debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc, + debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy, + read_file_dma); + debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy,