From 81ee935a4826de354858ff5626bcd1742cea49c1 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 21 Sep 2022 15:31:47 -0700 Subject: [PATCH] offchannel: add priority to start call This will let the caller specify their own priority. --- src/dpp.c | 1 + src/offchannel.c | 9 ++++----- src/offchannel.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dpp.c b/src/dpp.c index 2c8832ff..6abf539a 100644 --- a/src/dpp.c +++ b/src/dpp.c @@ -1622,6 +1622,7 @@ static void dpp_start_offchannel(struct dpp_sm *dpp, uint32_t freq) * called). */ uint32_t id = offchannel_start(netdev_get_wdev_id(dpp->netdev), + WIPHY_WORK_PRIORITY_OFFCHANNEL, freq, dpp->dwell, dpp_roc_started, dpp, dpp_presence_timeout); diff --git a/src/offchannel.c b/src/offchannel.c index 80d4ad56..b9cdc117 100644 --- a/src/offchannel.c +++ b/src/offchannel.c @@ -150,9 +150,9 @@ static const struct wiphy_radio_work_item_ops offchannel_work_ops = { .destroy = offchannel_work_destroy, }; -uint32_t offchannel_start(uint64_t wdev_id, uint32_t freq, uint32_t duration, - offchannel_started_cb_t started, void *user_data, - offchannel_destroy_cb_t destroy) +uint32_t offchannel_start(uint64_t wdev_id, int priority, uint32_t freq, + uint32_t duration, offchannel_started_cb_t started, + void *user_data, offchannel_destroy_cb_t destroy) { struct offchannel_info *info = l_new(struct offchannel_info, 1); @@ -169,8 +169,7 @@ uint32_t offchannel_start(uint64_t wdev_id, uint32_t freq, uint32_t duration, info->error = -ECANCELED; return wiphy_radio_work_insert(wiphy_find_by_wdev(wdev_id), &info->work, - WIPHY_WORK_PRIORITY_OFFCHANNEL, - &offchannel_work_ops); + priority, &offchannel_work_ops); } void offchannel_cancel(uint64_t wdev_id, uint32_t id) diff --git a/src/offchannel.h b/src/offchannel.h index 1ffa94f1..7912f1e8 100644 --- a/src/offchannel.h +++ b/src/offchannel.h @@ -23,7 +23,7 @@ typedef void (*offchannel_started_cb_t)(void *user_data); typedef void (*offchannel_destroy_cb_t)(int error, void *user_data); -uint32_t offchannel_start(uint64_t wdev_id, uint32_t freq, uint32_t duration, - offchannel_started_cb_t started, void *user_data, - offchannel_destroy_cb_t destroy); +uint32_t offchannel_start(uint64_t wdev_id, int priority, uint32_t freq, + uint32_t duration, offchannel_started_cb_t started, + void *user_data, offchannel_destroy_cb_t destroy); void offchannel_cancel(uint64_t wdev_id, uint32_t id);