]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - hwsim.c
iw: remove cb from arguments and simplify valid handler
[thirdparty/iw.git] / hwsim.c
diff --git a/hwsim.c b/hwsim.c
index 08c9c2e62ee3825d9cea25ff17edf70c9b80b53a..faa197b154569b86fb4740b2e00245eeb531ad6d 100644 (file)
--- a/hwsim.c
+++ b/hwsim.c
@@ -52,7 +52,7 @@ 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,
+static int handle_hwsim_getps(struct nl80211_state *state,
                              struct nl_msg *msg, int argc, char **argv,
                              enum id_input id)
 {
@@ -66,15 +66,14 @@ 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,
+static int handle_hwsim_setps(struct nl80211_state *state,
                              struct nl_msg *msg, int argc, char **argv,
                              enum id_input id)
 {
@@ -98,15 +97,14 @@ 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,
+static int handle_hwsim_stop_queues(struct nl80211_state *state,
                                    struct nl_msg *msg, int argc, char **argv,
                                    enum id_input id)
 {
@@ -128,7 +126,7 @@ 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,
+static int handle_hwsim_wake_queues(struct nl80211_state *state,
                                    struct nl_msg *msg, int argc, char **argv,
                                    enum id_input id)
 {