Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f3e3323 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo
Browse files

rt2x00: allow to specify watchdog interval



Allow subdriver to change watchdog interval by intialize
link->watchdog_interval value before rt2x00link_register().

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 12e66ffb
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -325,6 +325,7 @@ struct link {
	 * to bring the device/driver back into the desired state.
	 * to bring the device/driver back into the desired state.
	 */
	 */
	struct delayed_work watchdog_work;
	struct delayed_work watchdog_work;
	unsigned int watchdog_interval;


	/*
	/*
	 * Work structure for scheduling periodic AGC adjustments.
	 * Work structure for scheduling periodic AGC adjustments.
+9 −4
Original line number Original line Diff line number Diff line
@@ -387,7 +387,7 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev)
	    rt2x00dev->ops->lib->watchdog)
	    rt2x00dev->ops->lib->watchdog)
		ieee80211_queue_delayed_work(rt2x00dev->hw,
		ieee80211_queue_delayed_work(rt2x00dev->hw,
					     &link->watchdog_work,
					     &link->watchdog_work,
					     WATCHDOG_INTERVAL);
					     link->watchdog_interval);
}
}


void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev)
void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev)
@@ -413,11 +413,16 @@ static void rt2x00link_watchdog(struct work_struct *work)
	if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
	if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
		ieee80211_queue_delayed_work(rt2x00dev->hw,
		ieee80211_queue_delayed_work(rt2x00dev->hw,
					     &link->watchdog_work,
					     &link->watchdog_work,
					     WATCHDOG_INTERVAL);
					     link->watchdog_interval);
}
}


void rt2x00link_register(struct rt2x00_dev *rt2x00dev)
void rt2x00link_register(struct rt2x00_dev *rt2x00dev)
{
{
	INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog);
	struct link *link = &rt2x00dev->link;
	INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner);

	INIT_DELAYED_WORK(&link->work, rt2x00link_tuner);
	INIT_DELAYED_WORK(&link->watchdog_work, rt2x00link_watchdog);

	if (link->watchdog_interval == 0)
		link->watchdog_interval = WATCHDOG_INTERVAL;
}
}