Lines Matching refs:hard_iface

173 batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface,
181 hard_iface, neigh_addr);
191 static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
197 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
201 atomic_set(&hard_iface->bat_iv.ogm_seqno, random_seqno);
203 hard_iface->bat_iv.ogm_buff_len = BATADV_OGM_HLEN;
204 ogm_buff = kmalloc(hard_iface->bat_iv.ogm_buff_len, GFP_ATOMIC);
206 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
210 hard_iface->bat_iv.ogm_buff = ogm_buff;
220 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
225 static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface)
227 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
229 kfree(hard_iface->bat_iv.ogm_buff);
230 hard_iface->bat_iv.ogm_buff = NULL;
232 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
235 static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface)
240 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
242 ogm_buff = hard_iface->bat_iv.ogm_buff;
248 hard_iface->net_dev->dev_addr);
250 hard_iface->net_dev->dev_addr);
253 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
257 batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface)
262 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
264 ogm_buff = hard_iface->bat_iv.ogm_buff;
272 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
333 struct batadv_hard_iface *hard_iface)
335 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
343 if (hard_iface->if_status != BATADV_IF_ACTIVE)
358 forw_packet->if_incoming == hard_iface)
376 hard_iface->net_dev->name,
377 hard_iface->net_dev->dev_addr);
392 batadv_send_broadcast_skb(skb, hard_iface);
737 * @hard_iface: the interface for which the windows have to be shifted
740 batadv_iv_ogm_slide_own_bcast_window(struct batadv_hard_iface *hard_iface)
742 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
759 if (orig_ifinfo->if_outgoing != hard_iface)
777 * @hard_iface: interface whose ogm buffer should be transmitted
779 static void batadv_iv_ogm_schedule_buff(struct batadv_hard_iface *hard_iface)
781 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
782 unsigned char **ogm_buff = &hard_iface->bat_iv.ogm_buff;
785 int *ogm_buff_len = &hard_iface->bat_iv.ogm_buff_len;
790 lockdep_assert_held(&hard_iface->bat_iv.ogm_buff_mutex);
802 if (hard_iface->if_status == BATADV_IF_TO_BE_ACTIVATED)
803 hard_iface->if_status = BATADV_IF_ACTIVE;
807 if (hard_iface == primary_if) {
821 seqno = (u32)atomic_read(&hard_iface->bat_iv.ogm_seqno);
823 atomic_inc(&hard_iface->bat_iv.ogm_seqno);
825 batadv_iv_ogm_slide_own_bcast_window(hard_iface);
829 if (hard_iface != primary_if) {
834 hard_iface, hard_iface, 1, send_time);
843 if (tmp_hard_iface->soft_iface != hard_iface->soft_iface)
850 *ogm_buff_len, hard_iface,
861 static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
863 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE ||
864 hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)
867 mutex_lock(&hard_iface->bat_iv.ogm_buff_mutex);
868 batadv_iv_ogm_schedule_buff(hard_iface);
869 mutex_unlock(&hard_iface->bat_iv.ogm_buff_mutex);
1554 struct batadv_hard_iface *hard_iface;
1598 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
1599 if (hard_iface->if_status != BATADV_IF_ACTIVE)
1602 if (hard_iface->soft_iface != if_incoming->soft_iface)
1606 hard_iface->net_dev->dev_addr))
1610 hard_iface->net_dev->dev_addr))
1614 hard_iface->net_dev->dev_addr))
1663 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
1664 if (hard_iface->if_status != BATADV_IF_ACTIVE)
1667 if (hard_iface->soft_iface != bat_priv->soft_iface)
1670 if (!kref_get_unless_zero(&hard_iface->refcount))
1674 if_incoming, hard_iface);
1676 batadv_hardif_put(hard_iface);
2092 * @hard_iface: Hard interface to dump the neighbours for
2102 struct batadv_hard_iface *hard_iface,
2109 &hard_iface->neigh_list, list) {
2136 struct batadv_hard_iface *hard_iface;
2153 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list,
2155 if (hard_iface->soft_iface != bat_priv->soft_iface)
2164 hard_iface, &idx)) {
2231 static void batadv_iv_iface_enabled(struct batadv_hard_iface *hard_iface)
2234 batadv_iv_ogm_schedule(hard_iface);