• Home
  • Raw
  • Download

Lines Matching +full:dp +full:- +full:bridge

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
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 */
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,
249 struct dsa_port *dp; member
300 /* Disallow bridge core from requesting different VLAN awareness
301 * settings on ports if not hardware-supported
314 * @untag_bridge_pvid will force the DSA receive path to pop the bridge's
316 * between a vlan_filtering=0 and vlan_filtering=1 bridge device.
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()
342 struct dsa_port *dp; in dsa_to_port() local
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()
346 return dp; 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()
409 const struct dsa_port *dp = dsa_to_port(ds, port); in dsa_upstream_port() local
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()
418 static inline bool dsa_port_is_vlan_filtering(const struct dsa_port *dp) in dsa_port_is_vlan_filtering() argument
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
538 * Bridge integration
542 struct net_device *bridge);
544 struct net_device *bridge);
611 * Cross-chip operations
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()
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()
875 int dsa_port_get_phy_strings(struct dsa_port *dp, uint8_t *data);
876 int dsa_port_get_ethtool_phy_stats(struct dsa_port *dp, uint64_t *data);
877 int dsa_port_get_phy_sset_count(struct dsa_port *dp);
908 * module_dsa_tag_drivers() - Helper macro for registering DSA tag
930 * module_dsa_tag_driver() - Helper macro for registering a single DSA tag