Lines Matching refs:hard_iface
85 * @hard_iface: the interface to use to send the OGM
87 static void batadv_v_ogm_start_queue_timer(struct batadv_hard_iface *hard_iface)
93 queue_delayed_work(batadv_event_workqueue, &hard_iface->bat_v.aggr_wq,
105 * or hard_iface activation), but the work timer should not be reset
119 * @hard_iface: the interface to use to send the OGM
122 struct batadv_hard_iface *hard_iface)
124 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
126 if (hard_iface->if_status != BATADV_IF_ACTIVE) {
135 batadv_send_broadcast_skb(skb, hard_iface);
156 * @hard_iface: the interface to use to send the OGM
158 * Caller needs to hold the hard_iface->bat_v.aggr_list.lock.
163 struct batadv_hard_iface *hard_iface)
165 unsigned int max = min_t(unsigned int, hard_iface->net_dev->mtu,
169 lockdep_assert_held(&hard_iface->bat_v.aggr_list.lock);
171 return hard_iface->bat_v.aggr_len + ogm_len <= max;
176 * @hard_iface: the interface holding the aggregation queue
180 * Caller needs to hold the hard_iface->bat_v.aggr_list.lock.
182 static void batadv_v_ogm_aggr_list_free(struct batadv_hard_iface *hard_iface)
184 lockdep_assert_held(&hard_iface->bat_v.aggr_list.lock);
186 __skb_queue_purge(&hard_iface->bat_v.aggr_list);
187 hard_iface->bat_v.aggr_len = 0;
192 * @hard_iface: the interface with the aggregation queue to flush
199 * Caller needs to hold the hard_iface->bat_v.aggr_list.lock.
201 static void batadv_v_ogm_aggr_send(struct batadv_hard_iface *hard_iface)
203 unsigned int aggr_len = hard_iface->bat_v.aggr_len;
208 lockdep_assert_held(&hard_iface->bat_v.aggr_list.lock);
215 batadv_v_ogm_aggr_list_free(hard_iface);
222 while ((skb = __skb_dequeue(&hard_iface->bat_v.aggr_list))) {
223 hard_iface->bat_v.aggr_len -= batadv_v_ogm_len(skb);
231 batadv_v_ogm_send_to_if(skb_aggr, hard_iface);
237 * @hard_iface: the interface to queue the OGM on
240 struct batadv_hard_iface *hard_iface)
242 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
245 batadv_v_ogm_send_to_if(skb, hard_iface);
249 spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);
250 if (!batadv_v_ogm_queue_left(skb, hard_iface))
251 batadv_v_ogm_aggr_send(hard_iface);
253 hard_iface->bat_v.aggr_len += batadv_v_ogm_len(skb);
254 __skb_queue_tail(&hard_iface->bat_v.aggr_list, skb);
255 spin_unlock_bh(&hard_iface->bat_v.aggr_list.lock);
264 struct batadv_hard_iface *hard_iface;
304 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
305 if (hard_iface->soft_iface != bat_priv->soft_iface)
308 if (!kref_get_unless_zero(&hard_iface->refcount))
311 ret = batadv_hardif_no_broadcast(hard_iface, NULL, NULL);
330 hard_iface->net_dev->name, type);
332 batadv_hardif_put(hard_iface);
340 hard_iface->net_dev->name,
341 hard_iface->net_dev->dev_addr);
346 batadv_hardif_put(hard_iface);
350 batadv_v_ogm_queue_on_if(skb_tmp, hard_iface);
351 batadv_hardif_put(hard_iface);
389 struct batadv_hard_iface *hard_iface;
392 hard_iface = container_of(batv, struct batadv_hard_iface, bat_v);
394 spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);
395 batadv_v_ogm_aggr_send(hard_iface);
396 spin_unlock_bh(&hard_iface->bat_v.aggr_list.lock);
398 batadv_v_ogm_start_queue_timer(hard_iface);
403 * @hard_iface: the interface to prepare
409 int batadv_v_ogm_iface_enable(struct batadv_hard_iface *hard_iface)
411 struct batadv_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
413 batadv_v_ogm_start_queue_timer(hard_iface);
421 * @hard_iface: interface for which the resources have to be released
423 void batadv_v_ogm_iface_disable(struct batadv_hard_iface *hard_iface)
425 cancel_delayed_work_sync(&hard_iface->bat_v.aggr_wq);
427 spin_lock_bh(&hard_iface->bat_v.aggr_list.lock);
428 batadv_v_ogm_aggr_list_free(hard_iface);
429 spin_unlock_bh(&hard_iface->bat_v.aggr_list.lock);
860 struct batadv_hard_iface *hard_iface;
925 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
926 if (hard_iface->if_status != BATADV_IF_ACTIVE)
929 if (hard_iface->soft_iface != bat_priv->soft_iface)
932 if (!kref_get_unless_zero(&hard_iface->refcount))
935 ret = batadv_hardif_no_broadcast(hard_iface,
957 ogm_packet->orig, hard_iface->net_dev->name,
960 batadv_hardif_put(hard_iface);
966 if_incoming, hard_iface);
968 batadv_hardif_put(hard_iface);