Lines Matching refs:proto
164 __be16 proto; member
169 static bool vlan_hw_filter_capable(const struct net_device *dev, __be16 proto) in vlan_hw_filter_capable() argument
171 if (proto == htons(ETH_P_8021Q) && in vlan_hw_filter_capable()
174 if (proto == htons(ETH_P_8021AD) && in vlan_hw_filter_capable()
181 __be16 proto, u16 vid) in vlan_vid_info_get() argument
186 if (vid_info->proto == proto && vid_info->vid == vid) in vlan_vid_info_get()
192 static struct vlan_vid_info *vlan_vid_info_alloc(__be16 proto, u16 vid) in vlan_vid_info_alloc() argument
199 vid_info->proto = proto; in vlan_vid_info_alloc()
205 static int vlan_add_rx_filter_info(struct net_device *dev, __be16 proto, u16 vid) in vlan_add_rx_filter_info() argument
207 if (!vlan_hw_filter_capable(dev, proto)) in vlan_add_rx_filter_info()
211 return dev->netdev_ops->ndo_vlan_rx_add_vid(dev, proto, vid); in vlan_add_rx_filter_info()
216 static int vlan_kill_rx_filter_info(struct net_device *dev, __be16 proto, u16 vid) in vlan_kill_rx_filter_info() argument
218 if (!vlan_hw_filter_capable(dev, proto)) in vlan_kill_rx_filter_info()
222 return dev->netdev_ops->ndo_vlan_rx_kill_vid(dev, proto, vid); in vlan_kill_rx_filter_info()
243 vdev = vlan_group_get_device(&vlan_info->grp, vid_info->proto, in vlan_for_each()
254 int vlan_filter_push_vids(struct vlan_info *vlan_info, __be16 proto) in vlan_filter_push_vids() argument
261 if (vlan_vid_info->proto == proto) { in vlan_filter_push_vids()
262 err = vlan_add_rx_filter_info(real_dev, proto, in vlan_filter_push_vids()
274 if (vlan_vid_info->proto == proto) in vlan_filter_push_vids()
275 vlan_kill_rx_filter_info(real_dev, proto, in vlan_filter_push_vids()
283 void vlan_filter_drop_vids(struct vlan_info *vlan_info, __be16 proto) in vlan_filter_drop_vids() argument
288 if (vlan_vid_info->proto == proto) in vlan_filter_drop_vids()
290 vlan_vid_info->proto, in vlan_filter_drop_vids()
295 static int __vlan_vid_add(struct vlan_info *vlan_info, __be16 proto, u16 vid, in __vlan_vid_add() argument
302 vid_info = vlan_vid_info_alloc(proto, vid); in __vlan_vid_add()
306 err = vlan_add_rx_filter_info(dev, proto, vid); in __vlan_vid_add()
318 int vlan_vid_add(struct net_device *dev, __be16 proto, u16 vid) in vlan_vid_add() argument
334 vid_info = vlan_vid_info_get(vlan_info, proto, vid); in vlan_vid_add()
336 err = __vlan_vid_add(vlan_info, proto, vid, &vid_info); in vlan_vid_add()
358 __be16 proto = vid_info->proto; in __vlan_vid_del() local
362 err = vlan_kill_rx_filter_info(dev, proto, vid); in __vlan_vid_del()
364 netdev_warn(dev, "failed to kill vid %04x/%d\n", proto, vid); in __vlan_vid_del()
371 void vlan_vid_del(struct net_device *dev, __be16 proto, u16 vid) in vlan_vid_del() argument
382 vid_info = vlan_vid_info_get(vlan_info, proto, vid); in vlan_vid_del()
410 if (!vlan_hw_filter_capable(by_dev, vid_info->proto)) in vlan_vids_add_by_dev()
412 err = vlan_vid_add(dev, vid_info->proto, vid_info->vid); in vlan_vids_add_by_dev()
422 if (!vlan_hw_filter_capable(by_dev, vid_info->proto)) in vlan_vids_add_by_dev()
424 vlan_vid_del(dev, vid_info->proto, vid_info->vid); in vlan_vids_add_by_dev()
444 if (!vlan_hw_filter_capable(by_dev, vid_info->proto)) in vlan_vids_del_by_dev()
446 vlan_vid_del(dev, vid_info->proto, vid_info->vid); in vlan_vids_del_by_dev()