]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - station.c
iw: remove cb from arguments and simplify valid handler
[thirdparty/iw.git] / station.c
index 894d978f049110770fc955b3225a6c525fbfccb3..b5ccf4a6f65a0435816509c2bde92be70a2fa334 100644 (file)
--- a/station.c
+++ b/station.c
@@ -347,7 +347,6 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
 }
 
 static int handle_station_get(struct nl80211_state *state,
-                             struct nl_cb *cb,
                              struct nl_msg *msg,
                              int argc, char **argv,
                              enum id_input id)
@@ -370,7 +369,7 @@ static int handle_station_get(struct nl80211_state *state,
 
        NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
 
-       nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_sta_handler, NULL);
+       register_handler(print_sta_handler, NULL);
 
        return 0;
  nla_put_failure:
@@ -401,7 +400,6 @@ static const struct cmd *select_station_cmd(int argc, char **argv)
 }
 
 static int handle_station_set_plink(struct nl80211_state *state,
-                             struct nl_cb *cb,
                              struct nl_msg *msg,
                              int argc, char **argv,
                              enum id_input id)
@@ -451,7 +449,6 @@ COMMAND_ALIAS(station, set, "<MAC address> plink_action <open|block>",
        select_station_cmd, station_set_plink);
 
 static int handle_station_set_vlan(struct nl80211_state *state,
-                                  struct nl_cb *cb,
                                   struct nl_msg *msg,
                                   int argc, char **argv,
                                   enum id_input id)
@@ -499,7 +496,6 @@ COMMAND_ALIAS(station, set, "<MAC address> vlan <ifindex>",
        select_station_cmd, station_set_vlan);
 
 static int handle_station_set_mesh_power_mode(struct nl80211_state *state,
-                                             struct nl_cb *cb,
                                              struct nl_msg *msg,
                                              int argc, char **argv,
                                              enum id_input id)
@@ -552,12 +548,11 @@ COMMAND_ALIAS(station, set, "<MAC address> mesh_power_mode "
        select_station_cmd, station_set_mesh_power_mode);
 
 static int handle_station_dump(struct nl80211_state *state,
-                              struct nl_cb *cb,
                               struct nl_msg *msg,
                               int argc, char **argv,
                               enum id_input id)
 {
-       nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_sta_handler, NULL);
+       register_handler(print_sta_handler, NULL);
        return 0;
 }
 COMMAND(station, dump, NULL,