wifi: cfg80211: add flush functions for wiphy work

There may be sometimes reasons to actually run the work
if it's pending, add flush functions for both regular and
delayed wiphy work that will do this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg
2023-08-28 13:59:33 +02:00
parent 7483a2147a
commit 56cfb8ce1f
4 changed files with 57 additions and 5 deletions

View File

@@ -5826,6 +5826,16 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work);
*/
void wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *work);
/**
* wiphy_work_flush - flush previously queued work
* @wiphy: the wiphy, for debug purposes
* @work: the work to flush, this can be %NULL to flush all work
*
* Flush the work (i.e. run it if pending). This must be called
* under the wiphy mutex acquired by wiphy_lock().
*/
void wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *work);
struct wiphy_delayed_work {
struct wiphy_work work;
struct wiphy *wiphy;
@@ -5869,6 +5879,17 @@ void wiphy_delayed_work_queue(struct wiphy *wiphy,
void wiphy_delayed_work_cancel(struct wiphy *wiphy,
struct wiphy_delayed_work *dwork);
/**
* wiphy_delayed work_flush - flush previously queued delayed work
* @wiphy: the wiphy, for debug purposes
* @work: the work to flush
*
* Flush the work (i.e. run it if pending). This must be called
* under the wiphy mutex acquired by wiphy_lock().
*/
void wiphy_delayed_work_flush(struct wiphy *wiphy,
struct wiphy_delayed_work *dwork);
/**
* struct wireless_dev - wireless device state
*