]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add radio_work_is_connect() helper
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 Feb 2017 21:55:48 +0000 (23:55 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Feb 2017 21:58:56 +0000 (23:58 +0200)
This avoids duplicated code to check for different types of connection
radio work items.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/wpa_supplicant.c

index 11046bb9a8d929e004ab176bb6ffda4d59dae88f..f89a71a61024b8f7dce1f0ea8c60b07bbd4c71fa 100644 (file)
@@ -4367,6 +4367,13 @@ static void radio_work_free(struct wpa_radio_work *work)
 }
 
 
+static int radio_work_is_connect(struct wpa_radio_work *work)
+{
+       return os_strcmp(work->type, "sme-connect") == 0 ||
+               os_strcmp(work->type, "connect") == 0;
+}
+
+
 static int radio_work_is_scan(struct wpa_radio_work *work)
 {
        return os_strcmp(work->type, "scan") == 0 ||
@@ -4403,8 +4410,7 @@ static struct wpa_radio_work * radio_work_get_next_work(struct wpa_radio *radio)
                return NULL;
        }
 
-       if (os_strcmp(active_work->type, "sme-connect") == 0 ||
-           os_strcmp(active_work->type, "connect") == 0) {
+       if (radio_work_is_connect(active_work)) {
                /*
                 * If the active work is either connect or sme-connect,
                 * do not parallelize them with other radio works.
@@ -4423,8 +4429,7 @@ static struct wpa_radio_work * radio_work_get_next_work(struct wpa_radio *radio)
                 * If connect or sme-connect are enqueued, parallelize only
                 * those operations ahead of them in the queue.
                 */
-               if (os_strcmp(tmp->type, "connect") == 0 ||
-                   os_strcmp(tmp->type, "sme-connect") == 0)
+               if (radio_work_is_connect(tmp))
                        break;
 
                /* Serialize parallel scan and p2p_scan operations on the same