Lines Matching full:vlan
131 struct batadv_softif_vlan *vlan; in batadv_interface_set_mac_addr() local
146 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { in batadv_interface_set_mac_addr()
147 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, in batadv_interface_set_mac_addr()
149 batadv_tt_local_add(dev, addr->sa_data, vlan->vid, in batadv_interface_set_mac_addr()
511 * batadv_softif_vlan_release() - release vlan from lists and queue for free
513 * @ref: kref pointer of the vlan object
517 struct batadv_softif_vlan *vlan; in batadv_softif_vlan_release() local
519 vlan = container_of(ref, struct batadv_softif_vlan, refcount); in batadv_softif_vlan_release()
521 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
522 hlist_del_rcu(&vlan->list); in batadv_softif_vlan_release()
523 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
525 kfree_rcu(vlan, rcu); in batadv_softif_vlan_release()
529 * batadv_softif_vlan_put() - decrease the vlan object refcounter and
531 * @vlan: the vlan object to release
533 void batadv_softif_vlan_put(struct batadv_softif_vlan *vlan) in batadv_softif_vlan_put() argument
535 if (!vlan) in batadv_softif_vlan_put()
538 kref_put(&vlan->refcount, batadv_softif_vlan_release); in batadv_softif_vlan_put()
542 * batadv_softif_vlan_get() - get the vlan object for a specific vid
544 * @vid: the identifier of the vlan object to retrieve
546 * Return: the private data of the vlan matching the vid passed as argument or
552 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; in batadv_softif_vlan_get() local
562 vlan = vlan_tmp; in batadv_softif_vlan_get()
567 return vlan; in batadv_softif_vlan_get()
571 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
573 * @vid: the VLAN identifier
579 struct batadv_softif_vlan *vlan; in batadv_softif_create_vlan() local
584 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_softif_create_vlan()
585 if (vlan) { in batadv_softif_create_vlan()
586 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
591 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); in batadv_softif_create_vlan()
592 if (!vlan) { in batadv_softif_create_vlan()
597 vlan->bat_priv = bat_priv; in batadv_softif_create_vlan()
598 vlan->vid = vid; in batadv_softif_create_vlan()
599 kref_init(&vlan->refcount); in batadv_softif_create_vlan()
601 atomic_set(&vlan->ap_isolation, 0); in batadv_softif_create_vlan()
603 kref_get(&vlan->refcount); in batadv_softif_create_vlan()
604 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); in batadv_softif_create_vlan()
610 err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_softif_create_vlan()
613 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
616 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
628 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
636 * @vlan: the object to remove
639 struct batadv_softif_vlan *vlan) in batadv_softif_destroy_vlan() argument
645 vlan->vid, "vlan interface destroyed", false); in batadv_softif_destroy_vlan()
647 batadv_sysfs_del_vlan(bat_priv, vlan); in batadv_softif_destroy_vlan()
648 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_vlan()
654 * @proto: protocol of the vlan id
655 * @vid: identifier of the new vlan
657 * Set up all the internal structures for handling the new vlan on top of the
666 struct batadv_softif_vlan *vlan; in batadv_interface_add_vid() local
677 /* if a new vlan is getting created and it already exists, it means that in batadv_interface_add_vid()
683 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_interface_add_vid()
684 if (!vlan) in batadv_interface_add_vid()
688 * be since we received a kill_vid() for this vlan in batadv_interface_add_vid()
690 if (!vlan->kobj) { in batadv_interface_add_vid()
691 ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_interface_add_vid()
693 batadv_softif_vlan_put(vlan); in batadv_interface_add_vid()
699 * flag. This must be added again, even if the vlan object already in batadv_interface_add_vid()
712 * @proto: protocol of the vlan id
713 * @vid: identifier of the deleted vlan
715 * Destroy all the internal structures used to handle the vlan identified by vid
719 * or -ENOENT if the specified vlan id wasn't registered.
725 struct batadv_softif_vlan *vlan; in batadv_interface_kill_vid() local
733 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); in batadv_interface_kill_vid()
734 if (!vlan) in batadv_interface_kill_vid()
737 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_interface_kill_vid()
739 /* finally free the vlan object */ in batadv_interface_kill_vid()
740 batadv_softif_vlan_put(vlan); in batadv_interface_kill_vid()
1118 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_sysfs() local
1122 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_sysfs()
1123 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_sysfs()
1124 if (vlan) { in batadv_softif_destroy_sysfs()
1125 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_sysfs()
1126 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_sysfs()
1144 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_netlink() local
1152 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_netlink()
1153 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_netlink()
1154 if (vlan) { in batadv_softif_destroy_netlink()
1155 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_netlink()
1156 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_netlink()