Lines Matching full:vlan
142 struct batadv_softif_vlan *vlan; in batadv_interface_set_mac_addr() local
157 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { in batadv_interface_set_mac_addr()
158 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, in batadv_interface_set_mac_addr()
160 batadv_tt_local_add(dev, addr->sa_data, vlan->vid, in batadv_interface_set_mac_addr()
510 * batadv_softif_vlan_release() - release vlan from lists and queue for free
512 * @ref: kref pointer of the vlan object
516 struct batadv_softif_vlan *vlan; in batadv_softif_vlan_release() local
518 vlan = container_of(ref, struct batadv_softif_vlan, refcount); in batadv_softif_vlan_release()
520 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
521 hlist_del_rcu(&vlan->list); in batadv_softif_vlan_release()
522 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
524 kfree_rcu(vlan, rcu); in batadv_softif_vlan_release()
528 * batadv_softif_vlan_put() - decrease the vlan object refcounter and
530 * @vlan: the vlan object to release
532 void batadv_softif_vlan_put(struct batadv_softif_vlan *vlan) in batadv_softif_vlan_put() argument
534 if (!vlan) in batadv_softif_vlan_put()
537 kref_put(&vlan->refcount, batadv_softif_vlan_release); in batadv_softif_vlan_put()
541 * batadv_softif_vlan_get() - get the vlan object for a specific vid
543 * @vid: the identifier of the vlan object to retrieve
545 * Return: the private data of the vlan matching the vid passed as argument or
551 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; in batadv_softif_vlan_get() local
561 vlan = vlan_tmp; in batadv_softif_vlan_get()
566 return vlan; in batadv_softif_vlan_get()
570 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
572 * @vid: the VLAN identifier
578 struct batadv_softif_vlan *vlan; in batadv_softif_create_vlan() local
583 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_softif_create_vlan()
584 if (vlan) { in batadv_softif_create_vlan()
585 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
590 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); in batadv_softif_create_vlan()
591 if (!vlan) { in batadv_softif_create_vlan()
596 vlan->bat_priv = bat_priv; in batadv_softif_create_vlan()
597 vlan->vid = vid; in batadv_softif_create_vlan()
598 kref_init(&vlan->refcount); in batadv_softif_create_vlan()
600 atomic_set(&vlan->ap_isolation, 0); in batadv_softif_create_vlan()
602 kref_get(&vlan->refcount); in batadv_softif_create_vlan()
603 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); in batadv_softif_create_vlan()
609 err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_softif_create_vlan()
612 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
615 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
627 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
635 * @vlan: the object to remove
638 struct batadv_softif_vlan *vlan) in batadv_softif_destroy_vlan() argument
644 vlan->vid, "vlan interface destroyed", false); in batadv_softif_destroy_vlan()
646 batadv_sysfs_del_vlan(bat_priv, vlan); in batadv_softif_destroy_vlan()
647 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_vlan()
653 * @proto: protocol of the the vlan id
654 * @vid: identifier of the new vlan
656 * Set up all the internal structures for handling the new vlan on top of the
665 struct batadv_softif_vlan *vlan; in batadv_interface_add_vid() local
676 /* if a new vlan is getting created and it already exists, it means that in batadv_interface_add_vid()
682 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_interface_add_vid()
683 if (!vlan) in batadv_interface_add_vid()
687 * be since we received a kill_vid() for this vlan in batadv_interface_add_vid()
689 if (!vlan->kobj) { in batadv_interface_add_vid()
690 ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_interface_add_vid()
692 batadv_softif_vlan_put(vlan); in batadv_interface_add_vid()
698 * flag. This must be added again, even if the vlan object already in batadv_interface_add_vid()
711 * @proto: protocol of the the vlan id
712 * @vid: identifier of the deleted vlan
714 * Destroy all the internal structures used to handle the vlan identified by vid
718 * or -ENOENT if the specified vlan id wasn't registered.
724 struct batadv_softif_vlan *vlan; in batadv_interface_kill_vid() local
732 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); in batadv_interface_kill_vid()
733 if (!vlan) in batadv_interface_kill_vid()
736 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_interface_kill_vid()
738 /* finally free the vlan object */ in batadv_interface_kill_vid()
739 batadv_softif_vlan_put(vlan); in batadv_interface_kill_vid()
1121 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_sysfs() local
1125 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_sysfs()
1126 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_sysfs()
1127 if (vlan) { in batadv_softif_destroy_sysfs()
1128 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_sysfs()
1129 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_sysfs()
1147 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_netlink() local
1155 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_netlink()
1156 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_netlink()
1157 if (vlan) { in batadv_softif_destroy_netlink()
1158 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_netlink()
1159 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_netlink()