]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - hwsim.c
info: macro-ify ext_feat_print()
[thirdparty/iw.git] / hwsim.c
diff --git a/hwsim.c b/hwsim.c
index 188c1cbbfb58b0f7ecbf32fb3ece4df6e0ccdfcc..6f82207541a1ad1e1906b6338cb225439293a214 100644 (file)
--- a/hwsim.c
+++ b/hwsim.c
@@ -1,4 +1,3 @@
-#include <net/if.h>
 #include <errno.h>
 #include <string.h>
 
@@ -52,8 +51,9 @@ static int print_hwsim_ps_handler(struct nl_msg *msg, void *arg)
        return NL_SKIP;
 }
 
-static int handle_hwsim_getps(struct nl80211_state *state, struct nl_cb *cb,
-                             struct nl_msg *msg, int argc, char **argv)
+static int handle_hwsim_getps(struct nl80211_state *state,
+                             struct nl_msg *msg, int argc, char **argv,
+                             enum id_input id)
 {
        struct nlattr *tmdata;
 
@@ -65,16 +65,16 @@ static int handle_hwsim_getps(struct nl80211_state *state, struct nl_cb *cb,
 
        nla_nest_end(msg, tmdata);
 
-       nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
-                 print_hwsim_ps_handler, NULL);
+       register_handler(print_hwsim_ps_handler, NULL);
        return 0;
  nla_put_failure:
        return -ENOBUFS;
 }
 COMMAND(hwsim, getps, "", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_getps, "");
 
-static int handle_hwsim_setps(struct nl80211_state *state, struct nl_cb *cb,
-                             struct nl_msg *msg, int argc, char **argv)
+static int handle_hwsim_setps(struct nl80211_state *state,
+                             struct nl_msg *msg, int argc, char **argv,
+                             enum id_input id)
 {
        struct nlattr *tmdata;
        __u32 ps;
@@ -96,16 +96,16 @@ static int handle_hwsim_setps(struct nl80211_state *state, struct nl_cb *cb,
 
        nla_nest_end(msg, tmdata);
 
-       nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
-                 print_hwsim_ps_handler, NULL);
+       register_handler(print_hwsim_ps_handler, NULL);
        return 0;
  nla_put_failure:
        return -ENOBUFS;
 }
 COMMAND(hwsim, setps, "<value>", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_setps, "");
 
-static int handle_hwsim_stop_queues(struct nl80211_state *state, struct nl_cb *cb,
-                                   struct nl_msg *msg, int argc, char **argv)
+static int handle_hwsim_stop_queues(struct nl80211_state *state,
+                                   struct nl_msg *msg, int argc, char **argv,
+                                   enum id_input id)
 {
        struct nlattr *tmdata;
 
@@ -125,8 +125,9 @@ static int handle_hwsim_stop_queues(struct nl80211_state *state, struct nl_cb *c
 }
 COMMAND(hwsim, stopqueues, "", NL80211_CMD_TESTMODE, 0, CIB_PHY, handle_hwsim_stop_queues, "");
 
-static int handle_hwsim_wake_queues(struct nl80211_state *state, struct nl_cb *cb,
-                                   struct nl_msg *msg, int argc, char **argv)
+static int handle_hwsim_wake_queues(struct nl80211_state *state,
+                                   struct nl_msg *msg, int argc, char **argv,
+                                   enum id_input id)
 {
        struct nlattr *tmdata;