]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - reg.c
iw: fix some scan code indentation
[thirdparty/iw.git] / reg.c
diff --git a/reg.c b/reg.c
index 79843aac7e0e1d7dae2dab2103972e86ad60bd73..cadff3884c041c2a9b615701c939771119854929 100644 (file)
--- a/reg.c
+++ b/reg.c
@@ -1,4 +1,3 @@
-#include <net/if.h>
 #include <errno.h>
 #include <string.h>
 #include <stdbool.h>
@@ -205,7 +204,7 @@ static int print_reg_handler(struct nl_msg *msg, void *arg)
                PARSE_FLAG(NL80211_RRF_DFS, "DFS");
                PARSE_FLAG(NL80211_RRF_PTP_ONLY, "PTP-ONLY");
                PARSE_FLAG(NL80211_RRF_AUTO_BW, "AUTO-BW");
-               PARSE_FLAG(NL80211_RRF_GO_CONCURRENT, "GO-CONCURRENT");
+               PARSE_FLAG(NL80211_RRF_IR_CONCURRENT, "IR-CONCURRENT");
                PARSE_FLAG(NL80211_RRF_NO_HT40MINUS, "NO-HT40MINUS");
                PARSE_FLAG(NL80211_RRF_NO_HT40PLUS, "NO-HT40PLUS");
                PARSE_FLAG(NL80211_RRF_NO_80MHZ, "NO-80MHZ");
@@ -245,14 +244,14 @@ static int handle_reg_get(struct nl80211_state *state,
        int err;
 
        err = handle_cmd(state, CIB_NONE, 2, dump_args);
-       /* dump might fail since it's not supported on older kernels */
-       if (err == -EOPNOTSUPP) {
-               register_handler(print_reg_handler,
-                         NULL);
+       /*
+        * dump might fail since it's not supported on older kernels,
+        * in that case the handler is still registered already
+        */
+       if (err == -EOPNOTSUPP)
                return 0;
-       }
 
-       return err;
+       return err ?: HANDLER_RET_DONE;
 }
 COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_NONE, handle_reg_get,
        "Print out the kernel's current regulatory domain information.");
@@ -260,3 +259,13 @@ COMMAND(reg, get, NULL, NL80211_CMD_GET_REG, 0, CIB_PHY, handle_reg_get,
        "Print out the devices' current regulatory domain information.");
 HIDDEN(reg, dump, NULL, NL80211_CMD_GET_REG, NLM_F_DUMP, CIB_NONE,
        handle_reg_dump);
+
+static int handle_reg_reload(struct nl80211_state *state,
+                            struct nl_msg *msg,
+                            int argc, char **argv,
+                            enum id_input id)
+{
+       return 0;
+}
+COMMAND(reg, reload, NULL, NL80211_CMD_RELOAD_REGDB, 0, CIB_NONE,
+       handle_reg_reload, "Reload the kernel's regulatory database.");