Lines Matching refs:bat_priv
69 static void batadv_mcast_start_timer(struct batadv_priv *bat_priv) in batadv_mcast_start_timer() argument
71 queue_delayed_work(batadv_event_workqueue, &bat_priv->mcast.work, in batadv_mcast_start_timer()
165 static u8 batadv_mcast_mla_rtr_flags_softif_get(struct batadv_priv *bat_priv, in batadv_mcast_mla_rtr_flags_softif_get() argument
168 struct net_device *dev = bridge ? bridge : bat_priv->soft_iface; in batadv_mcast_mla_rtr_flags_softif_get()
195 static u8 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv, in batadv_mcast_mla_rtr_flags_bridge_get() argument
198 struct net_device *dev = bat_priv->soft_iface; in batadv_mcast_mla_rtr_flags_bridge_get()
227 static u8 batadv_mcast_mla_rtr_flags_get(struct batadv_priv *bat_priv, in batadv_mcast_mla_rtr_flags_get() argument
232 flags &= batadv_mcast_mla_rtr_flags_softif_get(bat_priv, bridge); in batadv_mcast_mla_rtr_flags_get()
233 flags &= batadv_mcast_mla_rtr_flags_bridge_get(bat_priv, bridge); in batadv_mcast_mla_rtr_flags_get()
246 batadv_mcast_mla_flags_get(struct batadv_priv *bat_priv) in batadv_mcast_mla_flags_get() argument
248 struct net_device *dev = bat_priv->soft_iface; in batadv_mcast_mla_flags_get()
257 mla_flags.tvlv_flags |= batadv_mcast_mla_rtr_flags_get(bat_priv, in batadv_mcast_mla_flags_get()
652 static void batadv_mcast_mla_tt_retract(struct batadv_priv *bat_priv, in batadv_mcast_mla_tt_retract() argument
658 hlist_for_each_entry_safe(mcast_entry, tmp, &bat_priv->mcast.mla_list, in batadv_mcast_mla_tt_retract()
665 batadv_tt_local_remove(bat_priv, mcast_entry->addr, in batadv_mcast_mla_tt_retract()
682 static void batadv_mcast_mla_tt_add(struct batadv_priv *bat_priv, in batadv_mcast_mla_tt_add() argument
693 &bat_priv->mcast.mla_list)) in batadv_mcast_mla_tt_add()
696 if (!batadv_tt_local_add(bat_priv->soft_iface, in batadv_mcast_mla_tt_add()
702 hlist_add_head(&mcast_entry->list, &bat_priv->mcast.mla_list); in batadv_mcast_mla_tt_add()
729 batadv_mcast_querier_log(struct batadv_priv *bat_priv, char *str_proto, in batadv_mcast_querier_log() argument
734 batadv_info(bat_priv->soft_iface, "%s Querier appeared\n", in batadv_mcast_querier_log()
737 batadv_info(bat_priv->soft_iface, in batadv_mcast_querier_log()
740 else if (!bat_priv->mcast.mla_flags.bridged && !new_state->exists) in batadv_mcast_querier_log()
741 batadv_info(bat_priv->soft_iface, in batadv_mcast_querier_log()
748 batadv_dbg(BATADV_DBG_MCAST, bat_priv, in batadv_mcast_querier_log()
752 batadv_dbg(BATADV_DBG_MCAST, bat_priv, in batadv_mcast_querier_log()
775 batadv_mcast_bridge_log(struct batadv_priv *bat_priv, in batadv_mcast_bridge_log() argument
778 struct batadv_mcast_mla_flags *old_flags = &bat_priv->mcast.mla_flags; in batadv_mcast_bridge_log()
781 batadv_dbg(BATADV_DBG_MCAST, bat_priv, in batadv_mcast_bridge_log()
784 batadv_dbg(BATADV_DBG_MCAST, bat_priv, in batadv_mcast_bridge_log()
788 batadv_mcast_querier_log(bat_priv, "IGMP", in batadv_mcast_bridge_log()
791 batadv_mcast_querier_log(bat_priv, "MLD", in batadv_mcast_bridge_log()
805 static void batadv_mcast_flags_log(struct batadv_priv *bat_priv, u8 flags) in batadv_mcast_flags_log() argument
807 bool old_enabled = bat_priv->mcast.mla_flags.enabled; in batadv_mcast_flags_log()
808 u8 old_flags = bat_priv->mcast.mla_flags.tvlv_flags; in batadv_mcast_flags_log()
818 batadv_dbg(BATADV_DBG_MCAST, bat_priv, in batadv_mcast_flags_log()
837 batadv_mcast_mla_flags_update(struct batadv_priv *bat_priv, in batadv_mcast_mla_flags_update() argument
842 if (!memcmp(flags, &bat_priv->mcast.mla_flags, sizeof(*flags))) in batadv_mcast_mla_flags_update()
845 batadv_mcast_bridge_log(bat_priv, flags); in batadv_mcast_mla_flags_update()
846 batadv_mcast_flags_log(bat_priv, flags->tvlv_flags); in batadv_mcast_mla_flags_update()
851 batadv_tvlv_container_register(bat_priv, BATADV_TVLV_MCAST, 2, in batadv_mcast_mla_flags_update()
854 bat_priv->mcast.mla_flags = *flags; in batadv_mcast_mla_flags_update()
869 static void __batadv_mcast_mla_update(struct batadv_priv *bat_priv) in __batadv_mcast_mla_update() argument
871 struct net_device *soft_iface = bat_priv->soft_iface; in __batadv_mcast_mla_update()
876 flags = batadv_mcast_mla_flags_get(bat_priv); in __batadv_mcast_mla_update()
886 spin_lock(&bat_priv->mcast.mla_lock); in __batadv_mcast_mla_update()
887 batadv_mcast_mla_tt_retract(bat_priv, &mcast_list); in __batadv_mcast_mla_update()
888 batadv_mcast_mla_tt_add(bat_priv, &mcast_list); in __batadv_mcast_mla_update()
889 batadv_mcast_mla_flags_update(bat_priv, &flags); in __batadv_mcast_mla_update()
890 spin_unlock(&bat_priv->mcast.mla_lock); in __batadv_mcast_mla_update()
909 struct batadv_priv *bat_priv; in batadv_mcast_mla_update() local
913 bat_priv = container_of(priv_mcast, struct batadv_priv, mcast); in batadv_mcast_mla_update()
915 __batadv_mcast_mla_update(bat_priv); in batadv_mcast_mla_update()
916 batadv_mcast_start_timer(bat_priv); in batadv_mcast_mla_update()
958 static int batadv_mcast_forw_mode_check_ipv4(struct batadv_priv *bat_priv, in batadv_mcast_forw_mode_check_ipv4() argument
1022 static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv, in batadv_mcast_forw_mode_check_ipv6() argument
1064 static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv, in batadv_mcast_forw_mode_check() argument
1071 if (!atomic_read(&bat_priv->multicast_mode)) in batadv_mcast_forw_mode_check()
1076 return batadv_mcast_forw_mode_check_ipv4(bat_priv, skb, in batadv_mcast_forw_mode_check()
1083 return batadv_mcast_forw_mode_check_ipv6(bat_priv, skb, in batadv_mcast_forw_mode_check()
1101 static int batadv_mcast_forw_want_all_ip_count(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all_ip_count() argument
1106 return atomic_read(&bat_priv->mcast.num_want_all_ipv4); in batadv_mcast_forw_want_all_ip_count()
1108 return atomic_read(&bat_priv->mcast.num_want_all_ipv6); in batadv_mcast_forw_want_all_ip_count()
1125 static int batadv_mcast_forw_rtr_count(struct batadv_priv *bat_priv, in batadv_mcast_forw_rtr_count() argument
1130 return atomic_read(&bat_priv->mcast.num_want_all_rtr4); in batadv_mcast_forw_rtr_count()
1132 return atomic_read(&bat_priv->mcast.num_want_all_rtr6); in batadv_mcast_forw_rtr_count()
1147 batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb, in batadv_mcast_forw_mode() argument
1155 ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable, in batadv_mcast_forw_mode()
1164 tt_count = batadv_tt_global_hash_count(bat_priv, ethhdr->h_dest, in batadv_mcast_forw_mode()
1166 ip_count = batadv_mcast_forw_want_all_ip_count(bat_priv, ethhdr); in batadv_mcast_forw_mode()
1168 atomic_read(&bat_priv->mcast.num_want_all_unsnoopables); in batadv_mcast_forw_mode()
1169 rtr_count = batadv_mcast_forw_rtr_count(bat_priv, *is_routable); in batadv_mcast_forw_mode()
1178 if (total_count <= atomic_read(&bat_priv->multicast_fanout)) in batadv_mcast_forw_mode()
1193 static int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv, in batadv_mcast_forw_send_orig() argument
1204 if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid)) { in batadv_mcast_forw_send_orig()
1209 return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0, in batadv_mcast_forw_send_orig()
1227 batadv_mcast_forw_tt(struct batadv_priv *bat_priv, struct sk_buff *skb, in batadv_mcast_forw_tt() argument
1238 tt_global = batadv_tt_global_hash_find(bat_priv, addr, vid); in batadv_mcast_forw_tt()
1250 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, in batadv_mcast_forw_tt()
1275 batadv_mcast_forw_want_all_ipv4(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all_ipv4() argument
1284 &bat_priv->mcast.want_all_ipv4_list, in batadv_mcast_forw_want_all_ipv4()
1292 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node); in batadv_mcast_forw_want_all_ipv4()
1312 batadv_mcast_forw_want_all_ipv6(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all_ipv6() argument
1321 &bat_priv->mcast.want_all_ipv6_list, in batadv_mcast_forw_want_all_ipv6()
1329 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node); in batadv_mcast_forw_want_all_ipv6()
1350 batadv_mcast_forw_want_all(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all() argument
1355 return batadv_mcast_forw_want_all_ipv4(bat_priv, skb, vid); in batadv_mcast_forw_want_all()
1357 return batadv_mcast_forw_want_all_ipv6(bat_priv, skb, vid); in batadv_mcast_forw_want_all()
1378 batadv_mcast_forw_want_all_rtr4(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all_rtr4() argument
1387 &bat_priv->mcast.want_all_rtr4_list, in batadv_mcast_forw_want_all_rtr4()
1395 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node); in batadv_mcast_forw_want_all_rtr4()
1415 batadv_mcast_forw_want_all_rtr6(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_all_rtr6() argument
1424 &bat_priv->mcast.want_all_rtr6_list, in batadv_mcast_forw_want_all_rtr6()
1432 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node); in batadv_mcast_forw_want_all_rtr6()
1453 batadv_mcast_forw_want_rtr(struct batadv_priv *bat_priv, in batadv_mcast_forw_want_rtr() argument
1458 return batadv_mcast_forw_want_all_rtr4(bat_priv, skb, vid); in batadv_mcast_forw_want_rtr()
1460 return batadv_mcast_forw_want_all_rtr6(bat_priv, skb, vid); in batadv_mcast_forw_want_rtr()
1484 int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb, in batadv_mcast_forw_send() argument
1489 ret = batadv_mcast_forw_tt(bat_priv, skb, vid); in batadv_mcast_forw_send()
1495 ret = batadv_mcast_forw_want_all(bat_priv, skb, vid); in batadv_mcast_forw_send()
1504 ret = batadv_mcast_forw_want_rtr(bat_priv, skb, vid); in batadv_mcast_forw_send()
1527 static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv, in batadv_mcast_want_unsnoop_update() argument
1532 struct hlist_head *head = &bat_priv->mcast.want_all_unsnoopables_list; in batadv_mcast_want_unsnoop_update()
1539 atomic_inc(&bat_priv->mcast.num_want_all_unsnoopables); in batadv_mcast_want_unsnoop_update()
1541 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_unsnoop_update()
1546 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_unsnoop_update()
1550 atomic_dec(&bat_priv->mcast.num_want_all_unsnoopables); in batadv_mcast_want_unsnoop_update()
1552 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_unsnoop_update()
1557 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_unsnoop_update()
1572 static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv, in batadv_mcast_want_ipv4_update() argument
1577 struct hlist_head *head = &bat_priv->mcast.want_all_ipv4_list; in batadv_mcast_want_ipv4_update()
1584 atomic_inc(&bat_priv->mcast.num_want_all_ipv4); in batadv_mcast_want_ipv4_update()
1586 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv4_update()
1591 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv4_update()
1595 atomic_dec(&bat_priv->mcast.num_want_all_ipv4); in batadv_mcast_want_ipv4_update()
1597 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv4_update()
1602 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv4_update()
1617 static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv, in batadv_mcast_want_ipv6_update() argument
1622 struct hlist_head *head = &bat_priv->mcast.want_all_ipv6_list; in batadv_mcast_want_ipv6_update()
1629 atomic_inc(&bat_priv->mcast.num_want_all_ipv6); in batadv_mcast_want_ipv6_update()
1631 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv6_update()
1636 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv6_update()
1640 atomic_dec(&bat_priv->mcast.num_want_all_ipv6); in batadv_mcast_want_ipv6_update()
1642 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv6_update()
1647 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_ipv6_update()
1662 static void batadv_mcast_want_rtr4_update(struct batadv_priv *bat_priv, in batadv_mcast_want_rtr4_update() argument
1667 struct hlist_head *head = &bat_priv->mcast.want_all_rtr4_list; in batadv_mcast_want_rtr4_update()
1674 atomic_inc(&bat_priv->mcast.num_want_all_rtr4); in batadv_mcast_want_rtr4_update()
1676 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr4_update()
1681 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr4_update()
1685 atomic_dec(&bat_priv->mcast.num_want_all_rtr4); in batadv_mcast_want_rtr4_update()
1687 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr4_update()
1692 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr4_update()
1707 static void batadv_mcast_want_rtr6_update(struct batadv_priv *bat_priv, in batadv_mcast_want_rtr6_update() argument
1712 struct hlist_head *head = &bat_priv->mcast.want_all_rtr6_list; in batadv_mcast_want_rtr6_update()
1719 atomic_inc(&bat_priv->mcast.num_want_all_rtr6); in batadv_mcast_want_rtr6_update()
1721 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr6_update()
1726 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr6_update()
1730 atomic_dec(&bat_priv->mcast.num_want_all_rtr6); in batadv_mcast_want_rtr6_update()
1732 spin_lock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr6_update()
1737 spin_unlock_bh(&bat_priv->mcast.want_lists_lock); in batadv_mcast_want_rtr6_update()
1780 static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv, in batadv_mcast_tvlv_ogm_handler() argument
1804 batadv_mcast_want_unsnoop_update(bat_priv, orig, mcast_flags); in batadv_mcast_tvlv_ogm_handler()
1805 batadv_mcast_want_ipv4_update(bat_priv, orig, mcast_flags); in batadv_mcast_tvlv_ogm_handler()
1806 batadv_mcast_want_ipv6_update(bat_priv, orig, mcast_flags); in batadv_mcast_tvlv_ogm_handler()
1807 batadv_mcast_want_rtr4_update(bat_priv, orig, mcast_flags); in batadv_mcast_tvlv_ogm_handler()
1808 batadv_mcast_want_rtr6_update(bat_priv, orig, mcast_flags); in batadv_mcast_tvlv_ogm_handler()
1818 void batadv_mcast_init(struct batadv_priv *bat_priv) in batadv_mcast_init() argument
1820 batadv_tvlv_handler_register(bat_priv, batadv_mcast_tvlv_ogm_handler, in batadv_mcast_init()
1824 INIT_DELAYED_WORK(&bat_priv->mcast.work, batadv_mcast_mla_update); in batadv_mcast_init()
1825 batadv_mcast_start_timer(bat_priv); in batadv_mcast_init()
1836 struct batadv_priv *bat_priv) in batadv_mcast_mesh_info_put() argument
1838 u32 flags = bat_priv->mcast.mla_flags.tvlv_flags; in batadv_mcast_mesh_info_put()
1841 if (bat_priv->mcast.mla_flags.bridged) { in batadv_mcast_mesh_info_put()
1844 if (bat_priv->mcast.mla_flags.querier_ipv4.exists) in batadv_mcast_mesh_info_put()
1846 if (bat_priv->mcast.mla_flags.querier_ipv6.exists) in batadv_mcast_mesh_info_put()
1848 if (bat_priv->mcast.mla_flags.querier_ipv4.shadowing) in batadv_mcast_mesh_info_put()
1850 if (bat_priv->mcast.mla_flags.querier_ipv6.shadowing) in batadv_mcast_mesh_info_put()
1966 struct batadv_priv *bat_priv, long *bucket, long *idx) in __batadv_mcast_flags_dump() argument
1968 struct batadv_hashtable *hash = bat_priv->orig_hash; in __batadv_mcast_flags_dump()
2002 struct batadv_priv *bat_priv; in batadv_mcast_netlink_get_primary() local
2016 bat_priv = netdev_priv(soft_iface); in batadv_mcast_netlink_get_primary()
2018 hard_iface = batadv_primary_if_get_selected(bat_priv); in batadv_mcast_netlink_get_primary()
2046 struct batadv_priv *bat_priv; in batadv_mcast_flags_dump() local
2055 bat_priv = netdev_priv(primary_if->soft_iface); in batadv_mcast_flags_dump()
2056 ret = __batadv_mcast_flags_dump(msg, portid, cb, bat_priv, bucket, idx); in batadv_mcast_flags_dump()
2066 void batadv_mcast_free(struct batadv_priv *bat_priv) in batadv_mcast_free() argument
2068 cancel_delayed_work_sync(&bat_priv->mcast.work); in batadv_mcast_free()
2070 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2); in batadv_mcast_free()
2071 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 2); in batadv_mcast_free()
2074 batadv_mcast_mla_tt_retract(bat_priv, NULL); in batadv_mcast_free()
2083 struct batadv_priv *bat_priv = orig->bat_priv; in batadv_mcast_purge_orig() local
2087 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS); in batadv_mcast_purge_orig()
2088 batadv_mcast_want_ipv4_update(bat_priv, orig, BATADV_NO_FLAGS); in batadv_mcast_purge_orig()
2089 batadv_mcast_want_ipv6_update(bat_priv, orig, BATADV_NO_FLAGS); in batadv_mcast_purge_orig()
2090 batadv_mcast_want_rtr4_update(bat_priv, orig, in batadv_mcast_purge_orig()
2092 batadv_mcast_want_rtr6_update(bat_priv, orig, in batadv_mcast_purge_orig()