Lines Matching full:vlan
3 * INET 802.1Q VLAN
8 * VLAN Home Page: http://www.candelatech.com/~greear/vlan.html
15 * - Flush MC-list on VLAN destroy.
30 #include "vlan.h"
36 * Create the VLAN header for an arbitrary protocol layer
49 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_hard_header() local
55 if (!(vlan->flags & VLAN_FLAG_REORDER_HDR)) { in vlan_dev_hard_header()
58 vlan_tci = vlan->vlan_id; in vlan_dev_hard_header()
71 skb->protocol = vlan->vlan_proto; in vlan_dev_hard_header()
72 type = ntohs(vlan->vlan_proto); in vlan_dev_hard_header()
81 dev = vlan->real_dev; in vlan_dev_hard_header()
88 static inline netdev_tx_t vlan_netpoll_send_skb(struct vlan_dev_priv *vlan, struct sk_buff *skb) in vlan_netpoll_send_skb() argument
91 return netpoll_send_skb(vlan->netpoll, skb); in vlan_netpoll_send_skb()
101 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_hard_start_xmit() local
106 /* Handle non-VLAN frames if they are sent to us, for example by DHCP. in vlan_dev_hard_start_xmit()
111 if (veth->h_vlan_proto != vlan->vlan_proto || in vlan_dev_hard_start_xmit()
112 vlan->flags & VLAN_FLAG_REORDER_HDR) { in vlan_dev_hard_start_xmit()
114 vlan_tci = vlan->vlan_id; in vlan_dev_hard_start_xmit()
116 __vlan_hwaccel_put_tag(skb, vlan->vlan_proto, vlan_tci); in vlan_dev_hard_start_xmit()
119 skb->dev = vlan->real_dev; in vlan_dev_hard_start_xmit()
122 return vlan_netpoll_send_skb(vlan, skb); in vlan_dev_hard_start_xmit()
129 stats = this_cpu_ptr(vlan->vlan_pcpu_stats); in vlan_dev_hard_start_xmit()
135 this_cpu_inc(vlan->vlan_pcpu_stats->tx_dropped); in vlan_dev_hard_start_xmit()
159 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_set_ingress_priority() local
161 if (vlan->ingress_priority_map[vlan_prio & 0x7] && !skb_prio) in vlan_dev_set_ingress_priority()
162 vlan->nr_ingress_mappings--; in vlan_dev_set_ingress_priority()
163 else if (!vlan->ingress_priority_map[vlan_prio & 0x7] && skb_prio) in vlan_dev_set_ingress_priority()
164 vlan->nr_ingress_mappings++; in vlan_dev_set_ingress_priority()
166 vlan->ingress_priority_map[vlan_prio & 0x7] = skb_prio; in vlan_dev_set_ingress_priority()
172 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_set_egress_priority() local
178 mp = vlan->egress_priority_map[skb_prio & 0xF]; in vlan_dev_set_egress_priority()
182 vlan->nr_egress_mappings--; in vlan_dev_set_egress_priority()
184 vlan->nr_egress_mappings++; in vlan_dev_set_egress_priority()
192 mp = vlan->egress_priority_map[skb_prio & 0xF]; in vlan_dev_set_egress_priority()
205 vlan->egress_priority_map[skb_prio & 0xF] = np; in vlan_dev_set_egress_priority()
207 vlan->nr_egress_mappings++; in vlan_dev_set_egress_priority()
216 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_change_flags() local
217 u32 old_flags = vlan->flags; in vlan_dev_change_flags()
224 vlan->flags = (old_flags & ~mask) | (flags & mask); in vlan_dev_change_flags()
226 if (netif_running(dev) && (vlan->flags ^ old_flags) & VLAN_FLAG_GVRP) { in vlan_dev_change_flags()
227 if (vlan->flags & VLAN_FLAG_GVRP) in vlan_dev_change_flags()
233 if (netif_running(dev) && (vlan->flags ^ old_flags) & VLAN_FLAG_MVRP) { in vlan_dev_change_flags()
234 if (vlan->flags & VLAN_FLAG_MVRP) in vlan_dev_change_flags()
260 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_open() local
261 struct net_device *real_dev = vlan->real_dev; in vlan_dev_open()
265 !(vlan->flags & VLAN_FLAG_LOOSE_BINDING)) in vlan_dev_open()
286 ether_addr_copy(vlan->real_dev_addr, real_dev->dev_addr); in vlan_dev_open()
288 if (vlan->flags & VLAN_FLAG_GVRP) in vlan_dev_open()
291 if (vlan->flags & VLAN_FLAG_MVRP) in vlan_dev_open()
295 !(vlan->flags & VLAN_FLAG_BRIDGE_BINDING)) in vlan_dev_open()
312 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_stop() local
313 struct net_device *real_dev = vlan->real_dev; in vlan_dev_stop()
325 if (!(vlan->flags & VLAN_FLAG_BRIDGE_BINDING)) in vlan_dev_stop()
492 * vlan network devices have devices nesting below it, and are a special
523 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_passthru_hard_header() local
524 struct net_device *real_dev = vlan->real_dev; in vlan_passthru_hard_header()
538 .name = "vlan",
545 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_init() local
546 struct net_device *real_dev = vlan->real_dev; in vlan_dev_init()
557 if (vlan->flags & VLAN_FLAG_BRIDGE_BINDING) in vlan_dev_init()
570 …netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work corr… in vlan_dev_init()
591 if (vlan_hw_offload_capable(real_dev->features, vlan->vlan_proto)) { in vlan_dev_init()
605 vlan->vlan_pcpu_stats = netdev_alloc_pcpu_stats(struct vlan_pcpu_stats); in vlan_dev_init()
606 if (!vlan->vlan_pcpu_stats) in vlan_dev_init()
616 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_uninit() local
619 for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) { in vlan_dev_uninit()
620 while ((pm = vlan->egress_priority_map[i]) != NULL) { in vlan_dev_uninit()
621 vlan->egress_priority_map[i] = pm->next; in vlan_dev_uninit()
639 * checksum offload on the vlan device. in vlan_dev_fix_features()
653 const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_ethtool_get_link_ksettings() local
655 return __ethtool_get_link_ksettings(vlan->real_dev, cmd); in vlan_ethtool_get_link_ksettings()
669 const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_ethtool_get_ts_info() local
670 const struct ethtool_ops *ops = vlan->real_dev->ethtool_ops; in vlan_ethtool_get_ts_info()
671 struct phy_device *phydev = vlan->real_dev->phydev; in vlan_ethtool_get_ts_info()
676 return ops->get_ts_info(vlan->real_dev, info); in vlan_ethtool_get_ts_info()
728 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_netpoll_setup() local
729 struct net_device *real_dev = vlan->real_dev; in vlan_dev_netpoll_setup()
744 vlan->netpoll = netpoll; in vlan_dev_netpoll_setup()
752 struct vlan_dev_priv *vlan= vlan_dev_priv(dev); in vlan_dev_netpoll_cleanup() local
753 struct netpoll *netpoll = vlan->netpoll; in vlan_dev_netpoll_cleanup()
758 vlan->netpoll = NULL; in vlan_dev_netpoll_cleanup()
812 struct vlan_dev_priv *vlan = vlan_dev_priv(dev); in vlan_dev_free() local
814 free_percpu(vlan->vlan_pcpu_stats); in vlan_dev_free()
815 vlan->vlan_pcpu_stats = NULL; in vlan_dev_free()