• Home
  • Raw
  • Download

Lines Matching +full:dsa +full:- +full:specific

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
4 * Copyright (c) 2008-2009 Marvell Semiconductor
20 #include <linux/platform_data/dsa.h>
79 /* Used to determine which traffic should match the DSA filter in
88 * address, in which case the DSA master would drop packets on ingress
97 * DSA layer on top of the DSA CPU/management net_device instance. This is
106 #define DSA_TAG_DRIVER_ALIAS "dsa_tag-"
116 u8 priv[48 - sizeof(struct dsa_skb_cb)];
119 #define DSA_SKB_CB(skb) ((struct dsa_skb_cb *)((skb)->cb))
122 ((void *)(skb)->cb + offsetof(struct __dsa_skb_cb, priv))
127 /* Notifier chain for switch-wide events */
141 * this dsa switch tree instance.
148 /* List of DSA links composing the routing table */
225 * Give the switch driver somewhere to hang its per-port private data
243 /* TODO: ideally DSA ports would have a single dp->link_dp member,
244 * and no dst->rtable nor this struct dsa_link would be needed,
301 * settings on ports if not hardware-supported
314 * @untag_bridge_pvid will force the DSA receive path to pop the bridge's
321 * should be retrieved from here and not from the per-port settings.
341 struct dsa_switch_tree *dst = ds->dst; in dsa_to_port()
344 list_for_each_entry(dp, &dst->ports, list) in dsa_to_port()
345 if (dp->ds == ds && dp->index == p) in dsa_to_port()
353 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_UNUSED; in dsa_is_unused_port()
358 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_CPU; in dsa_is_cpu_port()
363 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_DSA; in dsa_is_dsa_port()
368 return dsa_to_port(ds, p)->type == DSA_PORT_TYPE_USER; in dsa_is_user_port()
376 for (p = 0; p < ds->num_ports; p++) in dsa_user_ports()
386 struct dsa_switch_tree *dst = ds->dst; in dsa_routing_port()
389 list_for_each_entry(dl, &dst->rtable, list) in dsa_routing_port()
390 if (dl->dp->ds == ds && dl->link_dp->ds->index == device) in dsa_routing_port()
391 return dl->dp->index; in dsa_routing_port()
393 return ds->num_ports; in dsa_routing_port()
400 if (device == ds->index) in dsa_towards_port()
410 const struct dsa_port *cpu_dp = dp->cpu_dp; in dsa_upstream_port()
415 return dsa_towards_port(ds, cpu_dp->ds->index, cpu_dp->index); in dsa_upstream_port()
420 const struct dsa_switch *ds = dp->ds; in dsa_port_is_vlan_filtering()
422 if (ds->vlan_filtering_is_global) in dsa_port_is_vlan_filtering()
423 return ds->vlan_filtering; in dsa_port_is_vlan_filtering()
425 return dp->vlan_filtering; in dsa_port_is_vlan_filtering()
489 * ethtool Wake-on-LAN
611 * Cross-chip operations
644 * If the switch needs to account for the DSA tag on the CPU port, this
702 return dl_priv->ds; in dsa_devlink_to_ds()
708 struct devlink *dl = port->devlink; in dsa_devlink_port_to_ds()
711 return dl_priv->ds; in dsa_devlink_port_to_ds()
716 return port->index; in dsa_devlink_port_to_port()
730 return dev->dsa_ptr && dev->dsa_ptr->rcv; in netdev_uses_dsa()
739 return !dev->dsa_ptr->filter || dev->dsa_ptr->filter(skb, dev); in dsa_can_decode()
744 /* All DSA tags that push the EtherType to the right (basically all except tail
749 * - offset: the (B - A) difference between:
751 * B. the current skb->data (aka ETH_HLEN bytes into the frame, aka 2 bytes
756 * - proto: the value of the real EtherType.
762 const struct dsa_device_ops *ops = skb->dev->dsa_ptr->tag_ops; in dsa_tag_generic_flow_dissect()
763 int tag_len = ops->overhead; in dsa_tag_generic_flow_dissect()
766 *proto = ((__be16 *)skb->data)[(tag_len / 2) - 1]; in dsa_tag_generic_flow_dissect()
773 int err = -EOPNOTSUPP; in __dsa_netdevice_ops_check()
775 if (!dev->dsa_ptr) in __dsa_netdevice_ops_check()
778 if (!dev->dsa_ptr->netdev_ops) in __dsa_netdevice_ops_check()
794 ops = dev->dsa_ptr->netdev_ops; in dsa_ndo_do_ioctl()
796 return ops->ndo_do_ioctl(dev, ifr, cmd); in dsa_ndo_do_ioctl()
802 return -EOPNOTSUPP; in dsa_ndo_do_ioctl()
842 return info->dev; in dsa_notifier_info_to_dev()
868 /* Broadcom tag specific helpers to insert and extract queue/port number */
908 * module_dsa_tag_drivers() - Helper macro for registering DSA tag
912 * Helper macro for DSA tag drivers which do not do anything special
930 * module_dsa_tag_driver() - Helper macro for registering a single DSA tag
934 * Helper macro for DSA tag drivers which do not do anything special