Lines Matching refs:bat_priv
68 * @bat_priv: the bat priv with all the soft interface information
70 static void batadv_mcast_start_timer(struct batadv_priv *bat_priv)
72 queue_delayed_work(batadv_event_workqueue, &bat_priv->mcast.work,
154 * @bat_priv: the bat priv with all the soft interface information
167 static u8 batadv_mcast_mla_rtr_flags_softif_get(struct batadv_priv *bat_priv,
170 struct net_device *dev = bridge ? bridge : bat_priv->soft_iface;
185 * @bat_priv: the bat priv with all the soft interface information
198 static u8 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv,
202 struct net_device *dev = bat_priv->soft_iface;
235 batadv_mcast_mla_rtr_flags_bridge_get(struct batadv_priv *bat_priv,
247 * @bat_priv: the bat priv with all the soft interface information
260 static u8 batadv_mcast_mla_rtr_flags_get(struct batadv_priv *bat_priv,
265 flags &= batadv_mcast_mla_rtr_flags_softif_get(bat_priv, bridge);
266 flags &= batadv_mcast_mla_rtr_flags_bridge_get(bat_priv, bridge);
273 * @bat_priv: the bat priv with all the soft interface information
279 batadv_mcast_mla_flags_get(struct batadv_priv *bat_priv)
281 struct net_device *dev = bat_priv->soft_iface;
290 mla_flags.tvlv_flags |= batadv_mcast_mla_rtr_flags_get(bat_priv,
678 * @bat_priv: the bat priv with all the soft interface information
686 static void batadv_mcast_mla_tt_retract(struct batadv_priv *bat_priv,
692 hlist_for_each_entry_safe(mcast_entry, tmp, &bat_priv->mcast.mla_list,
699 batadv_tt_local_remove(bat_priv, mcast_entry->addr,
710 * @bat_priv: the bat priv with all the soft interface information
716 static void batadv_mcast_mla_tt_add(struct batadv_priv *bat_priv,
727 &bat_priv->mcast.mla_list))
730 if (!batadv_tt_local_add(bat_priv->soft_iface,
736 hlist_add_head(&mcast_entry->list, &bat_priv->mcast.mla_list);
743 * @bat_priv: the bat priv with all the soft interface information
763 batadv_mcast_querier_log(struct batadv_priv *bat_priv, char *str_proto,
768 batadv_info(bat_priv->soft_iface, "%s Querier appeared\n",
771 batadv_info(bat_priv->soft_iface,
774 else if (!bat_priv->mcast.mla_flags.bridged && !new_state->exists)
775 batadv_info(bat_priv->soft_iface,
782 batadv_dbg(BATADV_DBG_MCAST, bat_priv,
786 batadv_dbg(BATADV_DBG_MCAST, bat_priv,
795 * @bat_priv: the bat priv with all the soft interface information
809 batadv_mcast_bridge_log(struct batadv_priv *bat_priv,
812 struct batadv_mcast_mla_flags *old_flags = &bat_priv->mcast.mla_flags;
815 batadv_dbg(BATADV_DBG_MCAST, bat_priv,
818 batadv_dbg(BATADV_DBG_MCAST, bat_priv,
822 batadv_mcast_querier_log(bat_priv, "IGMP",
825 batadv_mcast_querier_log(bat_priv, "MLD",
833 * @bat_priv: the bat priv with all the soft interface information
839 static void batadv_mcast_flags_log(struct batadv_priv *bat_priv, u8 flags)
841 bool old_enabled = bat_priv->mcast.mla_flags.enabled;
842 u8 old_flags = bat_priv->mcast.mla_flags.tvlv_flags;
852 batadv_dbg(BATADV_DBG_MCAST, bat_priv,
864 * @bat_priv: the bat priv with all the soft interface information
871 batadv_mcast_mla_flags_update(struct batadv_priv *bat_priv,
876 if (!memcmp(flags, &bat_priv->mcast.mla_flags, sizeof(*flags)))
879 batadv_mcast_bridge_log(bat_priv, flags);
880 batadv_mcast_flags_log(bat_priv, flags->tvlv_flags);
885 batadv_tvlv_container_register(bat_priv, BATADV_TVLV_MCAST, 2,
888 bat_priv->mcast.mla_flags = *flags;
893 * @bat_priv: the bat priv with all the soft interface information
898 * Note that non-conflicting reads and writes to bat_priv->mcast.mla_list
903 static void __batadv_mcast_mla_update(struct batadv_priv *bat_priv)
905 struct net_device *soft_iface = bat_priv->soft_iface;
910 flags = batadv_mcast_mla_flags_get(bat_priv);
920 spin_lock(&bat_priv->mcast.mla_lock);
921 batadv_mcast_mla_tt_retract(bat_priv, &mcast_list);
922 batadv_mcast_mla_tt_add(bat_priv, &mcast_list);
923 batadv_mcast_mla_flags_update(bat_priv, &flags);
924 spin_unlock(&bat_priv->mcast.mla_lock);
943 struct batadv_priv *bat_priv;
947 bat_priv = container_of(priv_mcast, struct batadv_priv, mcast);
949 __batadv_mcast_mla_update(bat_priv);
950 batadv_mcast_start_timer(bat_priv);
981 * @bat_priv: the bat priv with all the soft interface information
992 static int batadv_mcast_forw_mode_check_ipv4(struct batadv_priv *bat_priv,
1046 * @bat_priv: the bat priv with all the soft interface information
1056 static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv,
1088 * @bat_priv: the bat priv with all the soft interface information
1098 static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv,
1105 if (!atomic_read(&bat_priv->multicast_mode))
1110 return batadv_mcast_forw_mode_check_ipv4(bat_priv, skb,
1117 return batadv_mcast_forw_mode_check_ipv6(bat_priv, skb,
1128 * @bat_priv: the bat priv with all the soft interface information
1135 static int batadv_mcast_forw_want_all_ip_count(struct batadv_priv *bat_priv,
1140 return atomic_read(&bat_priv->mcast.num_want_all_ipv4);
1142 return atomic_read(&bat_priv->mcast.num_want_all_ipv6);
1151 * @bat_priv: the bat priv with all the soft interface information
1159 static int batadv_mcast_forw_rtr_count(struct batadv_priv *bat_priv,
1164 return atomic_read(&bat_priv->mcast.num_want_all_rtr4);
1166 return atomic_read(&bat_priv->mcast.num_want_all_rtr6);
1174 * @bat_priv: the bat priv with all the soft interface information
1181 batadv_mcast_forw_tt_node_get(struct batadv_priv *bat_priv,
1184 return batadv_transtable_search(bat_priv, NULL, ethhdr->h_dest,
1190 * @bat_priv: the bat priv with all the soft interface information
1196 batadv_mcast_forw_ipv4_node_get(struct batadv_priv *bat_priv)
1202 &bat_priv->mcast.want_all_ipv4_list,
1217 * @bat_priv: the bat priv with all the soft interface information
1223 batadv_mcast_forw_ipv6_node_get(struct batadv_priv *bat_priv)
1229 &bat_priv->mcast.want_all_ipv6_list,
1244 * @bat_priv: the bat priv with all the soft interface information
1252 batadv_mcast_forw_ip_node_get(struct batadv_priv *bat_priv,
1257 return batadv_mcast_forw_ipv4_node_get(bat_priv);
1259 return batadv_mcast_forw_ipv6_node_get(bat_priv);
1268 * @bat_priv: the bat priv with all the soft interface information
1274 batadv_mcast_forw_unsnoop_node_get(struct batadv_priv *bat_priv)
1280 &bat_priv->mcast.want_all_unsnoopables_list,
1295 * @bat_priv: the bat priv with all the soft interface information
1301 batadv_mcast_forw_rtr4_node_get(struct batadv_priv *bat_priv)
1307 &bat_priv->mcast.want_all_rtr4_list,
1322 * @bat_priv: the bat priv with all the soft interface information
1328 batadv_mcast_forw_rtr6_node_get(struct batadv_priv *bat_priv)
1334 &bat_priv->mcast.want_all_rtr6_list,
1349 * @bat_priv: the bat priv with all the soft interface information
1357 batadv_mcast_forw_rtr_node_get(struct batadv_priv *bat_priv,
1362 return batadv_mcast_forw_rtr4_node_get(bat_priv);
1364 return batadv_mcast_forw_rtr6_node_get(bat_priv);
1373 * @bat_priv: the bat priv with all the soft interface information
1383 batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
1392 ret = batadv_mcast_forw_mode_check(bat_priv, skb, &is_unsnoopable,
1401 tt_count = batadv_tt_global_hash_count(bat_priv, ethhdr->h_dest,
1403 ip_count = batadv_mcast_forw_want_all_ip_count(bat_priv, ethhdr);
1405 atomic_read(&bat_priv->mcast.num_want_all_unsnoopables);
1406 rtr_count = batadv_mcast_forw_rtr_count(bat_priv, *is_routable);
1413 *orig = batadv_mcast_forw_tt_node_get(bat_priv, ethhdr);
1415 *orig = batadv_mcast_forw_ip_node_get(bat_priv, ethhdr);
1417 *orig = batadv_mcast_forw_unsnoop_node_get(bat_priv);
1419 *orig = batadv_mcast_forw_rtr_node_get(bat_priv,
1429 mcast_fanout = atomic_read(&bat_priv->multicast_fanout);
1440 * @bat_priv: the bat priv with all the soft interface information
1447 int batadv_mcast_forw_send_orig(struct batadv_priv *bat_priv,
1458 if (batadv_bla_is_backbone_gw_orig(bat_priv, orig_node->orig, vid)) {
1463 return batadv_send_skb_unicast(bat_priv, skb, BATADV_UNICAST, 0,
1469 * @bat_priv: the bat priv with all the soft interface information
1481 batadv_mcast_forw_tt(struct batadv_priv *bat_priv, struct sk_buff *skb,
1492 tt_global = batadv_tt_global_hash_find(bat_priv, addr, vid);
1504 batadv_mcast_forw_send_orig(bat_priv, newskb, vid,
1517 * @bat_priv: the bat priv with all the soft interface information
1529 batadv_mcast_forw_want_all_ipv4(struct batadv_priv *bat_priv,
1538 &bat_priv->mcast.want_all_ipv4_list,
1546 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node);
1554 * @bat_priv: the bat priv with all the soft interface information
1566 batadv_mcast_forw_want_all_ipv6(struct batadv_priv *bat_priv,
1575 &bat_priv->mcast.want_all_ipv6_list,
1583 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node);
1591 * @bat_priv: the bat priv with all the soft interface information
1604 batadv_mcast_forw_want_all(struct batadv_priv *bat_priv,
1609 return batadv_mcast_forw_want_all_ipv4(bat_priv, skb, vid);
1611 return batadv_mcast_forw_want_all_ipv6(bat_priv, skb, vid);
1620 * @bat_priv: the bat priv with all the soft interface information
1632 batadv_mcast_forw_want_all_rtr4(struct batadv_priv *bat_priv,
1641 &bat_priv->mcast.want_all_rtr4_list,
1649 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node);
1657 * @bat_priv: the bat priv with all the soft interface information
1669 batadv_mcast_forw_want_all_rtr6(struct batadv_priv *bat_priv,
1678 &bat_priv->mcast.want_all_rtr6_list,
1686 batadv_mcast_forw_send_orig(bat_priv, newskb, vid, orig_node);
1694 * @bat_priv: the bat priv with all the soft interface information
1707 batadv_mcast_forw_want_rtr(struct batadv_priv *bat_priv,
1712 return batadv_mcast_forw_want_all_rtr4(bat_priv, skb, vid);
1714 return batadv_mcast_forw_want_all_rtr6(bat_priv, skb, vid);
1723 * @bat_priv: the bat priv with all the soft interface information
1738 int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
1743 ret = batadv_mcast_forw_tt(bat_priv, skb, vid);
1749 ret = batadv_mcast_forw_want_all(bat_priv, skb, vid);
1758 ret = batadv_mcast_forw_want_rtr(bat_priv, skb, vid);
1771 * @bat_priv: the bat priv with all the soft interface information
1781 static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
1786 struct hlist_head *head = &bat_priv->mcast.want_all_unsnoopables_list;
1793 atomic_inc(&bat_priv->mcast.num_want_all_unsnoopables);
1795 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1800 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1804 atomic_dec(&bat_priv->mcast.num_want_all_unsnoopables);
1806 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1811 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1817 * @bat_priv: the bat priv with all the soft interface information
1826 static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
1831 struct hlist_head *head = &bat_priv->mcast.want_all_ipv4_list;
1838 atomic_inc(&bat_priv->mcast.num_want_all_ipv4);
1840 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1845 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1849 atomic_dec(&bat_priv->mcast.num_want_all_ipv4);
1851 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1856 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1862 * @bat_priv: the bat priv with all the soft interface information
1871 static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
1876 struct hlist_head *head = &bat_priv->mcast.want_all_ipv6_list;
1883 atomic_inc(&bat_priv->mcast.num_want_all_ipv6);
1885 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1890 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1894 atomic_dec(&bat_priv->mcast.num_want_all_ipv6);
1896 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1901 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1907 * @bat_priv: the bat priv with all the soft interface information
1916 static void batadv_mcast_want_rtr4_update(struct batadv_priv *bat_priv,
1921 struct hlist_head *head = &bat_priv->mcast.want_all_rtr4_list;
1928 atomic_inc(&bat_priv->mcast.num_want_all_rtr4);
1930 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1935 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1939 atomic_dec(&bat_priv->mcast.num_want_all_rtr4);
1941 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1946 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1952 * @bat_priv: the bat priv with all the soft interface information
1961 static void batadv_mcast_want_rtr6_update(struct batadv_priv *bat_priv,
1966 struct hlist_head *head = &bat_priv->mcast.want_all_rtr6_list;
1973 atomic_inc(&bat_priv->mcast.num_want_all_rtr6);
1975 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1980 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
1984 atomic_dec(&bat_priv->mcast.num_want_all_rtr6);
1986 spin_lock_bh(&bat_priv->mcast.want_lists_lock);
1991 spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
2028 * @bat_priv: the bat priv with all the soft interface information
2034 static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv,
2058 batadv_mcast_want_unsnoop_update(bat_priv, orig, mcast_flags);
2059 batadv_mcast_want_ipv4_update(bat_priv, orig, mcast_flags);
2060 batadv_mcast_want_ipv6_update(bat_priv, orig, mcast_flags);
2061 batadv_mcast_want_rtr4_update(bat_priv, orig, mcast_flags);
2062 batadv_mcast_want_rtr6_update(bat_priv, orig, mcast_flags);
2070 * @bat_priv: the bat priv with all the soft interface information
2072 void batadv_mcast_init(struct batadv_priv *bat_priv)
2074 batadv_tvlv_handler_register(bat_priv, batadv_mcast_tvlv_ogm_handler,
2078 INIT_DELAYED_WORK(&bat_priv->mcast.work, batadv_mcast_mla_update);
2079 batadv_mcast_start_timer(bat_priv);
2085 * @bat_priv: the bat priv with all the soft interface information
2092 static void batadv_mcast_flags_print_header(struct batadv_priv *bat_priv,
2095 struct batadv_mcast_mla_flags *mla_flags = &bat_priv->mcast.mla_flags;
2140 struct batadv_priv *bat_priv = netdev_priv(net_dev);
2142 struct batadv_hashtable *hash = bat_priv->orig_hash;
2152 batadv_mcast_flags_print_header(bat_priv, seq);
2195 * @bat_priv: the bat priv with all the soft interface information
2200 struct batadv_priv *bat_priv)
2202 u32 flags = bat_priv->mcast.mla_flags.tvlv_flags;
2205 if (bat_priv->mcast.mla_flags.bridged) {
2208 if (bat_priv->mcast.mla_flags.querier_ipv4.exists)
2210 if (bat_priv->mcast.mla_flags.querier_ipv6.exists)
2212 if (bat_priv->mcast.mla_flags.querier_ipv4.shadowing)
2214 if (bat_priv->mcast.mla_flags.querier_ipv6.shadowing)
2321 * @bat_priv: the bat priv with all the soft interface information
2330 struct batadv_priv *bat_priv, long *bucket, long *idx)
2332 struct batadv_hashtable *hash = bat_priv->orig_hash;
2366 struct batadv_priv *bat_priv;
2380 bat_priv = netdev_priv(soft_iface);
2382 hard_iface = batadv_primary_if_get_selected(bat_priv);
2411 struct batadv_priv *bat_priv;
2420 bat_priv = netdev_priv(primary_if->soft_iface);
2421 ret = __batadv_mcast_flags_dump(msg, portid, cb, bat_priv, bucket, idx);
2429 * @bat_priv: the bat priv with all the soft interface information
2431 void batadv_mcast_free(struct batadv_priv *bat_priv)
2433 cancel_delayed_work_sync(&bat_priv->mcast.work);
2435 batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
2436 batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
2439 batadv_mcast_mla_tt_retract(bat_priv, NULL);
2448 struct batadv_priv *bat_priv = orig->bat_priv;
2452 batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
2453 batadv_mcast_want_ipv4_update(bat_priv, orig, BATADV_NO_FLAGS);
2454 batadv_mcast_want_ipv6_update(bat_priv, orig, BATADV_NO_FLAGS);
2455 batadv_mcast_want_rtr4_update(bat_priv, orig,
2457 batadv_mcast_want_rtr6_update(bat_priv, orig,