Lines Matching refs:bat_priv

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