Commit 658358ce authored by Johannes Berg's avatar Johannes Berg

mac80211: fix throughput LED trigger

As I was testing with hwsim, I missed that my previous commit to
make LED work depend on activation broke the code because I missed
removing the old trigger struct and some code was still using it,
now erroneously, causing crashes.

Fix this by always using the correct struct.
Reported-by: default avatarFelix Fietkau <nbd@openwrt.org>
Tested-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 890b7878
...@@ -1038,7 +1038,6 @@ enum queue_stop_reason { ...@@ -1038,7 +1038,6 @@ enum queue_stop_reason {
#ifdef CONFIG_MAC80211_LEDS #ifdef CONFIG_MAC80211_LEDS
struct tpt_led_trigger { struct tpt_led_trigger {
struct led_trigger trig;
char name[32]; char name[32];
const struct ieee80211_tpt_blink *blink_table; const struct ieee80211_tpt_blink *blink_table;
unsigned int blink_table_len; unsigned int blink_table_len;
......
...@@ -276,10 +276,10 @@ static void tpt_trig_timer(unsigned long data) ...@@ -276,10 +276,10 @@ static void tpt_trig_timer(unsigned long data)
} }
} }
read_lock(&tpt_trig->trig.leddev_list_lock); read_lock(&local->tpt_led.leddev_list_lock);
list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list) list_for_each_entry(led_cdev, &local->tpt_led.led_cdevs, trig_list)
led_blink_set(led_cdev, &on, &off); led_blink_set(led_cdev, &on, &off);
read_unlock(&tpt_trig->trig.leddev_list_lock); read_unlock(&local->tpt_led.leddev_list_lock);
} }
const char * const char *
...@@ -341,10 +341,10 @@ static void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local) ...@@ -341,10 +341,10 @@ static void ieee80211_stop_tpt_led_trig(struct ieee80211_local *local)
tpt_trig->running = false; tpt_trig->running = false;
del_timer_sync(&tpt_trig->timer); del_timer_sync(&tpt_trig->timer);
read_lock(&tpt_trig->trig.leddev_list_lock); read_lock(&local->tpt_led.leddev_list_lock);
list_for_each_entry(led_cdev, &tpt_trig->trig.led_cdevs, trig_list) list_for_each_entry(led_cdev, &local->tpt_led.led_cdevs, trig_list)
led_set_brightness(led_cdev, LED_OFF); led_set_brightness(led_cdev, LED_OFF);
read_unlock(&tpt_trig->trig.leddev_list_lock); read_unlock(&local->tpt_led.leddev_list_lock);
} }
void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local, void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment