Lines Matching refs:bat_priv
140 batadv_iv_ogm_orig_get(struct batadv_priv *bat_priv, const u8 *addr) in batadv_iv_ogm_orig_get() argument
145 orig_node = batadv_orig_hash_find(bat_priv, addr); in batadv_iv_ogm_orig_get()
149 orig_node = batadv_orig_node_new(bat_priv, addr); in batadv_iv_ogm_orig_get()
156 hash_added = batadv_hash_add(bat_priv->orig_hash, batadv_compare_orig, in batadv_iv_ogm_orig_get()
278 batadv_iv_ogm_emit_send_time(const struct batadv_priv *bat_priv) in batadv_iv_ogm_emit_send_time() argument
282 msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER; in batadv_iv_ogm_emit_send_time()
295 static u8 batadv_hop_penalty(u8 tq, const struct batadv_priv *bat_priv) in batadv_hop_penalty() argument
297 int hop_penalty = atomic_read(&bat_priv->hop_penalty); in batadv_hop_penalty()
336 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); in batadv_iv_ogm_send_to_if() local
369 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_send_to_if()
390 batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_TX); in batadv_iv_ogm_send_to_if()
391 batadv_add_counter(bat_priv, BATADV_CNT_MGMT_TX_BYTES, in batadv_iv_ogm_send_to_if()
440 struct batadv_priv *bat_priv, in batadv_iv_ogm_can_aggregate() argument
483 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_iv_ogm_can_aggregate()
544 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_aggregate_new() local
549 atomic_t *queue_left = own_packet ? NULL : &bat_priv->batman_queue_left; in batadv_iv_ogm_aggregate_new()
551 if (atomic_read(&bat_priv->aggregated_ogms) && in batadv_iv_ogm_aggregate_new()
564 queue_left, bat_priv, skb); in batadv_iv_ogm_aggregate_new()
588 batadv_forw_packet_ogmv1_queue(bat_priv, forw_packet_aggr, send_time); in batadv_iv_ogm_aggregate_new()
619 static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv, in batadv_iv_ogm_queue_add() argument
640 spin_lock_bh(&bat_priv->forw_bat_list_lock); in batadv_iv_ogm_queue_add()
642 if (atomic_read(&bat_priv->aggregated_ogms) && !own_packet) { in batadv_iv_ogm_queue_add()
644 &bat_priv->forw_bat_list, list) { in batadv_iv_ogm_queue_add()
646 bat_priv, packet_len, in batadv_iv_ogm_queue_add()
662 spin_unlock_bh(&bat_priv->forw_bat_list_lock); in batadv_iv_ogm_queue_add()
668 if (!own_packet && atomic_read(&bat_priv->aggregated_ogms)) in batadv_iv_ogm_queue_add()
678 spin_unlock_bh(&bat_priv->forw_bat_list_lock); in batadv_iv_ogm_queue_add()
690 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_forward() local
694 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "ttl exceeded\n"); in batadv_iv_ogm_forward()
718 bat_priv); in batadv_iv_ogm_forward()
720 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_forward()
729 batadv_iv_ogm_queue_add(bat_priv, (unsigned char *)batadv_ogm_packet, in batadv_iv_ogm_forward()
743 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); in batadv_iv_ogm_slide_own_bcast_window() local
744 struct batadv_hashtable *hash = bat_priv->orig_hash; in batadv_iv_ogm_slide_own_bcast_window()
765 batadv_bit_get_packet(bat_priv, word, 1, 0); in batadv_iv_ogm_slide_own_bcast_window()
782 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface); in batadv_iv_ogm_schedule_buff() local
806 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_iv_ogm_schedule_buff()
812 batadv_tt_local_commit_changes(bat_priv); in batadv_iv_ogm_schedule_buff()
813 tvlv_len = batadv_tvlv_container_ogm_append(bat_priv, ogm_buff, in batadv_iv_ogm_schedule_buff()
828 send_time = batadv_iv_ogm_emit_send_time(bat_priv); in batadv_iv_ogm_schedule_buff()
834 batadv_iv_ogm_queue_add(bat_priv, *ogm_buff, *ogm_buff_len, in batadv_iv_ogm_schedule_buff()
850 batadv_iv_ogm_queue_add(bat_priv, *ogm_buff, in batadv_iv_ogm_schedule_buff()
915 batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv, in batadv_iv_ogm_orig_update() argument
933 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_orig_update()
973 orig_tmp = batadv_iv_ogm_orig_get(bat_priv, ethhdr->h_source); in batadv_iv_ogm_orig_update()
985 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_orig_update()
1041 batadv_update_route(bat_priv, orig_node, if_outgoing, neigh_node); in batadv_iv_ogm_orig_update()
1069 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_calc_tq() local
1165 bat_priv); in batadv_iv_ogm_calc_tq()
1176 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_calc_tq()
1211 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_update_seqnos() local
1226 orig_node = batadv_iv_ogm_orig_get(bat_priv, batadv_ogm_packet->orig); in batadv_iv_ogm_update_seqnos()
1241 batadv_window_protected(bat_priv, seq_diff, in batadv_iv_ogm_update_seqnos()
1273 need_update |= batadv_bit_get_packet(bat_priv, bitmap, in batadv_iv_ogm_update_seqnos()
1284 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_update_seqnos()
1313 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_process_per_outif() local
1347 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1354 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1383 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1390 batadv_tvlv_ogm_receive(bat_priv, ogm_packet, orig_node); in batadv_iv_ogm_process_per_outif()
1398 orig_neigh_node = batadv_iv_ogm_orig_get(bat_priv, in batadv_iv_ogm_process_per_outif()
1405 batadv_nc_update_nc_node(bat_priv, orig_node, orig_neigh_node, in batadv_iv_ogm_process_per_outif()
1415 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1436 batadv_iv_ogm_orig_update(bat_priv, orig_node, in batadv_iv_ogm_process_per_outif()
1454 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1464 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1471 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1477 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1482 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process_per_outif()
1553 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_process() local
1590 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process()
1621 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process()
1628 orig_neigh_node = batadv_iv_ogm_orig_get(bat_priv, in batadv_iv_ogm_process()
1636 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process()
1643 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process()
1650 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_ogm_process()
1656 orig_node = batadv_iv_ogm_orig_get(bat_priv, ogm_packet->orig); in batadv_iv_ogm_process()
1668 if (hard_iface->soft_iface != bat_priv->soft_iface) in batadv_iv_ogm_process()
1688 struct batadv_priv *bat_priv; in batadv_iv_send_outstanding_bat_ogm_packet() local
1694 bat_priv = netdev_priv(forw_packet->if_incoming->soft_iface); in batadv_iv_send_outstanding_bat_ogm_packet()
1696 if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_DEACTIVATING) { in batadv_iv_send_outstanding_bat_ogm_packet()
1718 &bat_priv->forw_bat_list_lock)) in batadv_iv_send_outstanding_bat_ogm_packet()
1725 struct batadv_priv *bat_priv = netdev_priv(if_incoming->soft_iface); in batadv_iv_ogm_receive() local
1739 if (bat_priv->algo_ops->iface.enable != batadv_iv_ogm_iface_enable) in batadv_iv_ogm_receive()
1742 batadv_inc_counter(bat_priv, BATADV_CNT_MGMT_RX); in batadv_iv_ogm_receive()
1743 batadv_add_counter(bat_priv, BATADV_CNT_MGMT_RX_BYTES, in batadv_iv_ogm_receive()
1814 struct batadv_priv *bat_priv, in batadv_iv_ogm_orig_dump_subentry() argument
1878 struct batadv_priv *bat_priv, in batadv_iv_ogm_orig_dump_entry() argument
1906 bat_priv, if_outgoing, in batadv_iv_ogm_orig_dump_entry()
1939 struct batadv_priv *bat_priv, in batadv_iv_ogm_orig_dump_bucket() argument
1951 if (batadv_iv_ogm_orig_dump_entry(msg, portid, seq, bat_priv, in batadv_iv_ogm_orig_dump_bucket()
1975 struct batadv_priv *bat_priv, in batadv_iv_ogm_orig_dump() argument
1978 struct batadv_hashtable *hash = bat_priv->orig_hash; in batadv_iv_ogm_orig_dump()
1990 bat_priv, if_outgoing, head, in batadv_iv_ogm_orig_dump()
2102 struct batadv_priv *bat_priv, in batadv_iv_ogm_neigh_dump_hardif() argument
2134 struct batadv_priv *bat_priv, in batadv_iv_ogm_neigh_dump() argument
2148 bat_priv, in batadv_iv_ogm_neigh_dump()
2156 if (hard_iface->soft_iface != bat_priv->soft_iface) in batadv_iv_ogm_neigh_dump()
2164 bat_priv, in batadv_iv_ogm_neigh_dump()
2242 static void batadv_iv_init_sel_class(struct batadv_priv *bat_priv) in batadv_iv_init_sel_class() argument
2245 atomic_set(&bat_priv->gw.sel_class, 20); in batadv_iv_init_sel_class()
2249 batadv_iv_gw_get_best_gw_node(struct batadv_priv *bat_priv) in batadv_iv_gw_get_best_gw_node() argument
2261 hlist_for_each_entry_rcu(gw_node, &bat_priv->gw.gateway_list, list) { in batadv_iv_gw_get_best_gw_node()
2277 switch (atomic_read(&bat_priv->gw.sel_class)) { in batadv_iv_gw_get_best_gw_node()
2325 static bool batadv_iv_gw_is_eligible(struct batadv_priv *bat_priv, in batadv_iv_gw_is_eligible() argument
2337 if (atomic_read(&bat_priv->gw.sel_class) <= 2) in batadv_iv_gw_is_eligible()
2372 if ((atomic_read(&bat_priv->gw.sel_class) > 3) && in batadv_iv_gw_is_eligible()
2373 (orig_tq_avg - gw_tq_avg < atomic_read(&bat_priv->gw.sel_class))) in batadv_iv_gw_is_eligible()
2376 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_iv_gw_is_eligible()
2402 struct batadv_priv *bat_priv, in batadv_iv_gw_dump_entry() argument
2419 curr_gw = batadv_gw_get_selected_gw_node(bat_priv); in batadv_iv_gw_dump_entry()
2473 struct batadv_priv *bat_priv) in batadv_iv_gw_dump() argument
2480 spin_lock_bh(&bat_priv->gw.list_lock); in batadv_iv_gw_dump()
2481 cb->seq = bat_priv->gw.generation << 1 | 1; in batadv_iv_gw_dump()
2483 hlist_for_each_entry(gw_node, &bat_priv->gw.gateway_list, list) { in batadv_iv_gw_dump()
2487 if (batadv_iv_gw_dump_entry(msg, portid, cb, bat_priv, in batadv_iv_gw_dump()
2496 spin_unlock_bh(&bat_priv->gw.list_lock); in batadv_iv_gw_dump()