Lines Matching defs:bat_priv
208 * @bat_priv: the bat priv with all the soft interface information
214 const u8 *dst, struct batadv_priv *bat_priv,
232 batadv_netlink_tpmeter_notify(bat_priv, dst, result, test_time,
240 * @bat_priv: the bat priv with all the soft interface information
245 struct batadv_priv *bat_priv,
248 batadv_tp_batctl_notify(reason, dst, bat_priv, 0, 0, cookie);
253 * @bat_priv: the bat priv with all the soft interface information
261 static struct batadv_tp_vars *batadv_tp_list_find(struct batadv_priv *bat_priv,
267 hlist_for_each_entry_rcu(pos, &bat_priv->tp_list, list) {
289 * @bat_priv: the bat priv with all the soft interface information
300 batadv_tp_list_find_session(struct batadv_priv *bat_priv, const u8 *dst,
306 hlist_for_each_entry_rcu(pos, &bat_priv->tp_list, list) {
368 * @bat_priv: the bat priv with all the soft interface information
371 static void batadv_tp_sender_cleanup(struct batadv_priv *bat_priv,
376 spin_lock_bh(&tp_vars->bat_priv->tp_list_lock);
378 spin_unlock_bh(&tp_vars->bat_priv->tp_list_lock);
383 atomic_dec(&tp_vars->bat_priv->tp_num);
398 * @bat_priv: the bat priv with all the soft interface information
401 static void batadv_tp_sender_end(struct batadv_priv *bat_priv,
406 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
410 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
414 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
423 bat_priv,
488 struct batadv_priv *bat_priv = tp_vars->bat_priv;
511 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
621 * @bat_priv: the bat priv with all the soft interface information
626 static void batadv_tp_recv_ack(struct batadv_priv *bat_priv,
644 tp_vars = batadv_tp_list_find_session(bat_priv, icmp->orig,
657 primary_if = batadv_primary_if_get_selected(bat_priv);
661 orig_node = batadv_orig_hash_find(bat_priv, icmp->orig);
699 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
810 struct batadv_priv *bat_priv = tp_vars->bat_priv;
822 orig_node = batadv_orig_hash_find(bat_priv, tp_vars->other_end);
829 primary_if = batadv_primary_if_get_selected(bat_priv);
870 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
892 batadv_tp_sender_end(bat_priv, tp_vars);
893 batadv_tp_sender_cleanup(bat_priv, tp_vars);
908 struct batadv_priv *bat_priv = tp_vars->bat_priv;
919 bat_priv, session_cookie);
925 batadv_tp_sender_cleanup(bat_priv, tp_vars);
934 * @bat_priv: the bat priv with all the soft interface information
939 void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst,
953 spin_lock_bh(&bat_priv->tp_list_lock);
954 tp_vars = batadv_tp_list_find(bat_priv, dst);
956 spin_unlock_bh(&bat_priv->tp_list_lock);
958 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
961 dst, bat_priv, session_cookie);
965 if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
966 spin_unlock_bh(&bat_priv->tp_list_lock);
967 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
970 bat_priv, session_cookie);
976 spin_unlock_bh(&bat_priv->tp_list_lock);
977 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
981 dst, bat_priv, session_cookie);
1020 tp_vars->bat_priv = bat_priv;
1034 hlist_add_head_rcu(&tp_vars->list, &bat_priv->tp_list);
1035 spin_unlock_bh(&bat_priv->tp_list_lock);
1041 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1059 * @bat_priv: the bat priv with all the soft interface information
1063 void batadv_tp_stop(struct batadv_priv *bat_priv, const u8 *dst,
1069 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1072 orig_node = batadv_orig_hash_find(bat_priv, dst);
1076 tp_vars = batadv_tp_list_find(bat_priv, orig_node->orig);
1078 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1110 struct batadv_priv *bat_priv;
1112 bat_priv = tp_vars->bat_priv;
1122 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1126 spin_lock_bh(&tp_vars->bat_priv->tp_list_lock);
1128 spin_unlock_bh(&tp_vars->bat_priv->tp_list_lock);
1133 atomic_dec(&bat_priv->tp_num);
1148 * @bat_priv: the bat priv with all the soft interface information
1158 static int batadv_tp_send_ack(struct batadv_priv *bat_priv, const u8 *dst,
1168 orig_node = batadv_orig_hash_find(bat_priv, dst);
1174 primary_if = batadv_primary_if_get_selected(bat_priv);
1329 * @bat_priv: the bat priv with all the soft interface information
1335 batadv_tp_init_recv(struct batadv_priv *bat_priv,
1340 spin_lock_bh(&bat_priv->tp_list_lock);
1341 tp_vars = batadv_tp_list_find_session(bat_priv, icmp->orig,
1346 if (!atomic_add_unless(&bat_priv->tp_num, 1, BATADV_TP_MAX_NUM)) {
1347 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1360 tp_vars->bat_priv = bat_priv;
1367 hlist_add_head_rcu(&tp_vars->list, &bat_priv->tp_list);
1375 spin_unlock_bh(&bat_priv->tp_list_lock);
1382 * @bat_priv: the bat priv with all the soft interface information
1387 static void batadv_tp_recv_msg(struct batadv_priv *bat_priv,
1402 tp_vars = batadv_tp_init_recv(bat_priv, icmp);
1404 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1409 tp_vars = batadv_tp_list_find_session(bat_priv, icmp->orig,
1412 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1420 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,
1458 batadv_tp_send_ack(bat_priv, icmp->orig, tp_vars->last_recv,
1467 * @bat_priv: the bat priv with all the soft interface information
1470 void batadv_tp_meter_recv(struct batadv_priv *bat_priv, struct sk_buff *skb)
1478 batadv_tp_recv_msg(bat_priv, skb);
1481 batadv_tp_recv_ack(bat_priv, skb);
1484 batadv_dbg(BATADV_DBG_TP_METER, bat_priv,