Lines Matching full:vid

42  * @vid: the VLAN ID to look up or allocate
47 static int rtl8366_obtain_mc(struct realtek_smi *smi, int vid, in rtl8366_obtain_mc() argument
54 /* Try to find an existing member config entry for this VID */ in rtl8366_obtain_mc()
58 dev_err(smi->dev, "error searching for VLAN MC %d for VID %d\n", in rtl8366_obtain_mc()
59 i, vid); in rtl8366_obtain_mc()
63 if (vid == vlanmc->vid) in rtl8366_obtain_mc()
67 /* We have no MC entry for this VID, try to find an empty one */ in rtl8366_obtain_mc()
71 dev_err(smi->dev, "error searching for VLAN MC %d for VID %d\n", in rtl8366_obtain_mc()
72 i, vid); in rtl8366_obtain_mc()
76 if (vlanmc->vid == 0 && vlanmc->member == 0) { in rtl8366_obtain_mc()
78 ret = smi->ops->get_vlan_4k(smi, vid, &vlan4k); in rtl8366_obtain_mc()
80 dev_err(smi->dev, "error looking for 4K VLAN MC %d for VID %d\n", in rtl8366_obtain_mc()
81 i, vid); in rtl8366_obtain_mc()
85 vlanmc->vid = vid; in rtl8366_obtain_mc()
91 dev_err(smi->dev, "unable to set/update VLAN MC %d for VID %d\n", in rtl8366_obtain_mc()
92 i, vid); in rtl8366_obtain_mc()
96 dev_dbg(smi->dev, "created new MC at index %d for VID %d\n", in rtl8366_obtain_mc()
97 i, vid); in rtl8366_obtain_mc()
112 ret = smi->ops->get_vlan_4k(smi, vid, &vlan4k); in rtl8366_obtain_mc()
116 vlanmc->vid = vid; in rtl8366_obtain_mc()
122 dev_err(smi->dev, "unable to set/update VLAN MC %d for VID %d\n", in rtl8366_obtain_mc()
123 i, vid); in rtl8366_obtain_mc()
126 dev_dbg(smi->dev, "recycled MC at index %i for VID %d\n", in rtl8366_obtain_mc()
127 i, vid); in rtl8366_obtain_mc()
136 int rtl8366_set_vlan(struct realtek_smi *smi, int vid, u32 member, in rtl8366_set_vlan() argument
144 if (!smi->ops->is_vlan_valid(smi, vid)) in rtl8366_set_vlan()
149 vid, member, untag); in rtl8366_set_vlan()
152 ret = smi->ops->get_vlan_4k(smi, vid, &vlan4k); in rtl8366_set_vlan()
165 vid, vlan4k.member, vlan4k.untag); in rtl8366_set_vlan()
167 /* Find or allocate a member config for this VID */ in rtl8366_set_vlan()
168 ret = rtl8366_obtain_mc(smi, vid, &vlanmc); in rtl8366_set_vlan()
181 dev_err(smi->dev, "failed to commit changes to VLAN MC index %d for VID %d\n", in rtl8366_set_vlan()
182 mc, vid); in rtl8366_set_vlan()
186 vid, vlanmc.member, vlanmc.untag); in rtl8366_set_vlan()
193 unsigned int vid) in rtl8366_set_pvid() argument
199 if (!smi->ops->is_vlan_valid(smi, vid)) in rtl8366_set_pvid()
202 /* Find or allocate a member config for this VID */ in rtl8366_set_pvid()
203 ret = rtl8366_obtain_mc(smi, vid, &vlanmc); in rtl8366_set_pvid()
216 port, vid, mc); in rtl8366_set_pvid()
280 vlanmc.vid = 0; in rtl8366_reset_vlan()
386 u16 vid; in rtl8366_vlan_prepare() local
389 for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++) in rtl8366_vlan_prepare()
390 if (!smi->ops->is_vlan_valid(smi, vid)) in rtl8366_vlan_prepare()
416 u16 vid; in rtl8366_vlan_add() local
419 for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++) in rtl8366_vlan_add()
420 if (!smi->ops->is_vlan_valid(smi, vid)) in rtl8366_vlan_add()
432 for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) { in rtl8366_vlan_add()
438 ret = rtl8366_set_vlan(smi, vid, member, untag, 0); in rtl8366_vlan_add()
442 vid); in rtl8366_vlan_add()
447 ret = rtl8366_set_pvid(smi, port, vid); in rtl8366_vlan_add()
451 port, vid); in rtl8366_vlan_add()
455 vid, port); in rtl8366_vlan_add()
464 u16 vid; in rtl8366_vlan_del() local
469 for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) { in rtl8366_vlan_del()
472 dev_info(smi->dev, "del VLAN %04x\n", vid); in rtl8366_vlan_del()
481 if (vid == vlanmc.vid) { in rtl8366_vlan_del()
491 vlanmc.vid = 0; in rtl8366_vlan_del()
499 vid); in rtl8366_vlan_del()