linux/drivers/net/ethernet/mellanox/mlxsw/spectrum.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/skbuff.h>
#include <linux/if_vlan.h>
#include <linux/if_bridge.h>
#include <linux/workqueue.h>
#include <linux/jiffies.h>
#include <linux/bitops.h>
#include <linux/list.h>
#include <linux/notifier.h>
#include <linux/dcbnl.h>
#include <linux/inetdevice.h>
#include <linux/netlink.h>
#include <linux/jhash.h>
#include <linux/log2.h>
#include <linux/refcount.h>
#include <linux/rhashtable.h>
#include <net/switchdev.h>
#include <net/pkt_cls.h>
#include <net/netevent.h>
#include <net/addrconf.h>
#include <linux/ptp_classify.h>

#include "spectrum.h"
#include "pci.h"
#include "core.h"
#include "core_env.h"
#include "reg.h"
#include "port.h"
#include "trap.h"
#include "txheader.h"
#include "spectrum_cnt.h"
#include "spectrum_dpipe.h"
#include "spectrum_acl_flex_actions.h"
#include "spectrum_span.h"
#include "spectrum_ptp.h"
#include "spectrum_trap.h"

#define MLXSW_SP_FWREV_MINOR
#define MLXSW_SP_FWREV_SUBMINOR

#define MLXSW_SP1_FWREV_MAJOR
#define MLXSW_SP1_FWREV_CAN_RESET_MINOR

static const struct mlxsw_fw_rev mlxsw_sp1_fw_rev =;

#define MLXSW_SP1_FW_FILENAME

#define MLXSW_SP2_FWREV_MAJOR

static const struct mlxsw_fw_rev mlxsw_sp2_fw_rev =;

#define MLXSW_SP2_FW_FILENAME

#define MLXSW_SP3_FWREV_MAJOR

static const struct mlxsw_fw_rev mlxsw_sp3_fw_rev =;

#define MLXSW_SP3_FW_FILENAME

#define MLXSW_SP_LINECARDS_INI_BUNDLE_FILENAME

static const char mlxsw_sp1_driver_name[] =;
static const char mlxsw_sp2_driver_name[] =;
static const char mlxsw_sp3_driver_name[] =;
static const char mlxsw_sp4_driver_name[] =;

static const unsigned char mlxsw_sp1_mac_mask[ETH_ALEN] =;
static const unsigned char mlxsw_sp2_mac_mask[ETH_ALEN] =;

/* tx_hdr_version
 * Tx header version.
 * Must be set to 1.
 */
MLXSW_ITEM32(tx, hdr, version, 0x00, 28, 4);

/* tx_hdr_ctl
 * Packet control type.
 * 0 - Ethernet control (e.g. EMADs, LACP)
 * 1 - Ethernet data
 */
MLXSW_ITEM32(tx, hdr, ctl, 0x00, 26, 2);

/* tx_hdr_proto
 * Packet protocol type. Must be set to 1 (Ethernet).
 */
MLXSW_ITEM32(tx, hdr, proto, 0x00, 21, 3);

/* tx_hdr_rx_is_router
 * Packet is sent from the router. Valid for data packets only.
 */
MLXSW_ITEM32(tx, hdr, rx_is_router, 0x00, 19, 1);

/* tx_hdr_fid_valid
 * Indicates if the 'fid' field is valid and should be used for
 * forwarding lookup. Valid for data packets only.
 */
MLXSW_ITEM32(tx, hdr, fid_valid, 0x00, 16, 1);

/* tx_hdr_swid
 * Switch partition ID. Must be set to 0.
 */
MLXSW_ITEM32(tx, hdr, swid, 0x00, 12, 3);

/* tx_hdr_control_tclass
 * Indicates if the packet should use the control TClass and not one
 * of the data TClasses.
 */
MLXSW_ITEM32(tx, hdr, control_tclass, 0x00, 6, 1);

/* tx_hdr_etclass
 * Egress TClass to be used on the egress device on the egress port.
 */
MLXSW_ITEM32(tx, hdr, etclass, 0x00, 0, 4);

/* tx_hdr_port_mid
 * Destination local port for unicast packets.
 * Destination multicast ID for multicast packets.
 *
 * Control packets are directed to a specific egress port, while data
 * packets are transmitted through the CPU port (0) into the switch partition,
 * where forwarding rules are applied.
 */
MLXSW_ITEM32(tx, hdr, port_mid, 0x04, 16, 16);

/* tx_hdr_fid
 * Forwarding ID used for L2 forwarding lookup. Valid only if 'fid_valid' is
 * set, otherwise calculated based on the packet's VID using VID to FID mapping.
 * Valid for data packets only.
 */
MLXSW_ITEM32(tx, hdr, fid, 0x08, 16, 16);

/* tx_hdr_type
 * 0 - Data packets
 * 6 - Control packets
 */
MLXSW_ITEM32(tx, hdr, type, 0x0C, 0, 4);

int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp,
			      unsigned int counter_index, bool clear,
			      u64 *packets, u64 *bytes)
{}

static int mlxsw_sp_flow_counter_clear(struct mlxsw_sp *mlxsw_sp,
				       unsigned int counter_index)
{}

int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp,
				unsigned int *p_counter_index)
{}

void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp,
				unsigned int counter_index)
{}

void mlxsw_sp_txhdr_construct(struct sk_buff *skb,
			      const struct mlxsw_tx_info *tx_info)
{}

int
mlxsw_sp_txhdr_ptp_data_construct(struct mlxsw_core *mlxsw_core,
				  struct mlxsw_sp_port *mlxsw_sp_port,
				  struct sk_buff *skb,
				  const struct mlxsw_tx_info *tx_info)
{}

static bool mlxsw_sp_skb_requires_ts(struct sk_buff *skb)
{}

static int mlxsw_sp_txhdr_handle(struct mlxsw_core *mlxsw_core,
				 struct mlxsw_sp_port *mlxsw_sp_port,
				 struct sk_buff *skb,
				 const struct mlxsw_tx_info *tx_info)
{}

enum mlxsw_reg_spms_state mlxsw_sp_stp_spms_state(u8 state)
{}

int mlxsw_sp_port_vid_stp_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
			      u8 state)
{}

static int mlxsw_sp_base_mac_get(struct mlxsw_sp *mlxsw_sp)
{}

int mlxsw_sp_port_admin_status_set(struct mlxsw_sp_port *mlxsw_sp_port,
				   bool is_up)
{}

static int mlxsw_sp_port_dev_addr_set(struct mlxsw_sp_port *mlxsw_sp_port,
				      const unsigned char *addr)
{}

static int mlxsw_sp_port_dev_addr_init(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int mlxsw_sp_port_mtu_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 mtu)
{}

static int mlxsw_sp_port_swid_set(struct mlxsw_sp *mlxsw_sp,
				  u16 local_port, u8 swid)
{}

int mlxsw_sp_port_vp_mode_set(struct mlxsw_sp_port *mlxsw_sp_port, bool enable)
{}

int mlxsw_sp_port_vid_learning_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
				   bool learn_enable)
{}

int mlxsw_sp_port_security_set(struct mlxsw_sp_port *mlxsw_sp_port, bool enable)
{}

int mlxsw_sp_ethtype_to_sver_type(u16 ethtype, u8 *p_sver_type)
{}

int mlxsw_sp_port_egress_ethtype_set(struct mlxsw_sp_port *mlxsw_sp_port,
				     u16 ethtype)
{}

static int __mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port,
				    u16 vid, u16 ethtype)
{}

static int mlxsw_sp_port_allow_untagged_set(struct mlxsw_sp_port *mlxsw_sp_port,
					    bool allow)
{}

int mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
			   u16 ethtype)
{}

static int
mlxsw_sp_port_system_port_mapping_set(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int
mlxsw_sp_port_module_info_parse(struct mlxsw_sp *mlxsw_sp,
				u16 local_port, char *pmlp_pl,
				struct mlxsw_sp_port_mapping *port_mapping)
{}

static int
mlxsw_sp_port_module_info_get(struct mlxsw_sp *mlxsw_sp, u16 local_port,
			      struct mlxsw_sp_port_mapping *port_mapping)
{}

static int
mlxsw_sp_port_module_map(struct mlxsw_sp *mlxsw_sp, u16 local_port,
			 const struct mlxsw_sp_port_mapping *port_mapping)
{}

static void mlxsw_sp_port_module_unmap(struct mlxsw_sp *mlxsw_sp, u16 local_port,
				       u8 slot_index, u8 module)
{}

static int mlxsw_sp_port_open(struct net_device *dev)
{}

static int mlxsw_sp_port_stop(struct net_device *dev)
{}

static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb,
				      struct net_device *dev)
{}

static void mlxsw_sp_set_rx_mode(struct net_device *dev)
{}

static int mlxsw_sp_port_set_mac_address(struct net_device *dev, void *p)
{}

static int mlxsw_sp_port_change_mtu(struct net_device *dev, int mtu)
{}

static int
mlxsw_sp_port_get_sw_stats64(const struct net_device *dev,
			     struct rtnl_link_stats64 *stats)
{}

static bool mlxsw_sp_port_has_offload_stats(const struct net_device *dev, int attr_id)
{}

static int mlxsw_sp_port_get_offload_stats(int attr_id, const struct net_device *dev,
					   void *sp)
{}

int mlxsw_sp_port_get_stats_raw(struct net_device *dev, int grp,
				int prio, char *ppcnt_pl)
{}

static int mlxsw_sp_port_get_hw_stats(struct net_device *dev,
				      struct rtnl_link_stats64 *stats)
{}

static void
mlxsw_sp_port_get_hw_xstats(struct net_device *dev,
			    struct mlxsw_sp_port_xstats *xstats)
{}

static void update_stats_cache(struct work_struct *work)
{}

/* Return the stats from a cache that is updated periodically,
 * as this function might get called in an atomic context.
 */
static void
mlxsw_sp_port_get_stats64(struct net_device *dev,
			  struct rtnl_link_stats64 *stats)
{}

static int __mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port,
				    u16 vid_begin, u16 vid_end,
				    bool is_member, bool untagged)
{}

int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,
			   u16 vid_end, bool is_member, bool untagged)
{}

static void mlxsw_sp_port_vlan_flush(struct mlxsw_sp_port *mlxsw_sp_port,
				     bool flush_default)
{}

static void
mlxsw_sp_port_vlan_cleanup(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan)
{}

struct mlxsw_sp_port_vlan *
mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid)
{}

void mlxsw_sp_port_vlan_destroy(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan)
{}

static int mlxsw_sp_port_add_vid(struct net_device *dev,
				 __be16 __always_unused proto, u16 vid)
{}

int mlxsw_sp_port_kill_vid(struct net_device *dev,
			   __be16 __always_unused proto, u16 vid)
{}

static int mlxsw_sp_setup_tc_block(struct mlxsw_sp_port *mlxsw_sp_port,
				   struct flow_block_offload *f)
{}

static int mlxsw_sp_setup_tc(struct net_device *dev, enum tc_setup_type type,
			     void *type_data)
{}

static int mlxsw_sp_feature_hw_tc(struct net_device *dev, bool enable)
{}

static int mlxsw_sp_feature_loopback(struct net_device *dev, bool enable)
{}

mlxsw_sp_feature_handler;

static int mlxsw_sp_handle_feature(struct net_device *dev,
				   netdev_features_t wanted_features,
				   netdev_features_t feature,
				   mlxsw_sp_feature_handler feature_handler)
{}
static int mlxsw_sp_set_features(struct net_device *dev,
				 netdev_features_t features)
{}

static int mlxsw_sp_port_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
				      struct ifreq *ifr)
{}

static int mlxsw_sp_port_hwtstamp_get(struct mlxsw_sp_port *mlxsw_sp_port,
				      struct ifreq *ifr)
{}

static inline void mlxsw_sp_port_ptp_clear(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int
mlxsw_sp_port_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{}

static const struct net_device_ops mlxsw_sp_port_netdev_ops =;

static int
mlxsw_sp_port_speed_by_width_set(struct mlxsw_sp_port *mlxsw_sp_port)
{}

int mlxsw_sp_port_speed_get(struct mlxsw_sp_port *mlxsw_sp_port, u32 *speed)
{}

int mlxsw_sp_port_ets_set(struct mlxsw_sp_port *mlxsw_sp_port,
			  enum mlxsw_reg_qeec_hr hr, u8 index, u8 next_index,
			  bool dwrr, u8 dwrr_weight)
{}

int mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,
				  enum mlxsw_reg_qeec_hr hr, u8 index,
				  u8 next_index, u32 maxrate, u8 burst_size)
{}

static int mlxsw_sp_port_min_bw_set(struct mlxsw_sp_port *mlxsw_sp_port,
				    enum mlxsw_reg_qeec_hr hr, u8 index,
				    u8 next_index, u32 minrate)
{}

int mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port,
			      u8 switch_prio, u8 tclass)
{}

static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int mlxsw_sp_port_tc_mc_mode_set(struct mlxsw_sp_port *mlxsw_sp_port,
					bool enable)
{}

static int mlxsw_sp_port_overheat_init_val_set(struct mlxsw_sp_port *mlxsw_sp_port)
{}

int
mlxsw_sp_port_vlan_classification_set(struct mlxsw_sp_port *mlxsw_sp_port,
				      bool is_8021ad_tagged,
				      bool is_8021q_tagged)
{}

static int mlxsw_sp_port_label_info_get(struct mlxsw_sp *mlxsw_sp,
					u16 local_port, u8 *port_number,
					u8 *split_port_subnumber,
					u8 *slot_index)
{}

static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u16 local_port,
				bool split,
				struct mlxsw_sp_port_mapping *port_mapping)
{}

static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u16 local_port)
{}

static int mlxsw_sp_cpu_port_create(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_cpu_port_remove(struct mlxsw_sp *mlxsw_sp)
{}

static bool mlxsw_sp_local_port_valid(u16 local_port)
{}

static bool mlxsw_sp_port_created(struct mlxsw_sp *mlxsw_sp, u16 local_port)
{}

static int mlxsw_sp_port_mapping_event_set(struct mlxsw_sp *mlxsw_sp,
					   u16 local_port, bool enable)
{}

struct mlxsw_sp_port_mapping_event {};

static void mlxsw_sp_port_mapping_events_work(struct work_struct *work)
{}

static void
mlxsw_sp_port_mapping_listener_func(const struct mlxsw_reg_info *reg,
				    char *pmlp_pl, void *priv)
{}

static void
__mlxsw_sp_port_mapping_events_cancel(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp)
{}

static void
mlxsw_sp_ports_remove_selected(struct mlxsw_core *mlxsw_core,
			       bool (*selector)(void *priv, u16 local_port),
			       void *priv)
{}

static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp)
{}

static int mlxsw_sp_port_module_info_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_port_module_info_fini(struct mlxsw_sp *mlxsw_sp)
{}

static int
mlxsw_sp_port_split_create(struct mlxsw_sp *mlxsw_sp,
			   struct mlxsw_sp_port_mapping *port_mapping,
			   unsigned int count, const char *pmtdb_pl)
{}

static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp,
					 unsigned int count,
					 const char *pmtdb_pl)
{}

static struct mlxsw_sp_port *
mlxsw_sp_port_get_by_local_port(struct mlxsw_sp *mlxsw_sp, u16 local_port)
{}

static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u16 local_port,
			       unsigned int count,
			       struct netlink_ext_ack *extack)
{}

static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u16 local_port,
				 struct netlink_ext_ack *extack)
{}

static void
mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
				     char *pude_pl, void *priv)
{}

static void mlxsw_sp1_ptp_fifo_event_func(struct mlxsw_sp *mlxsw_sp,
					  char *mtpptr_pl, bool ingress)
{}

static void mlxsw_sp1_ptp_ing_fifo_event_func(const struct mlxsw_reg_info *reg,
					      char *mtpptr_pl, void *priv)
{}

static void mlxsw_sp1_ptp_egr_fifo_event_func(const struct mlxsw_reg_info *reg,
					      char *mtpptr_pl, void *priv)
{}

void mlxsw_sp_rx_listener_no_mark_func(struct sk_buff *skb,
				       u16 local_port, void *priv)
{}

static void mlxsw_sp_rx_listener_mark_func(struct sk_buff *skb, u16 local_port,
					   void *priv)
{}

static void mlxsw_sp_rx_listener_l3_mark_func(struct sk_buff *skb,
					      u16 local_port, void *priv)
{}

void mlxsw_sp_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
			  u16 local_port)
{}

#define MLXSW_SP_RXL_NO_MARK(_trap_id, _action, _trap_group, _is_ctrl)

#define MLXSW_SP_RXL_MARK(_trap_id, _action, _trap_group, _is_ctrl)

#define MLXSW_SP_RXL_L3_MARK(_trap_id, _action, _trap_group, _is_ctrl)

#define MLXSW_SP_EVENTL(_func, _trap_id)

static const struct mlxsw_listener mlxsw_sp_listener[] =;

static const struct mlxsw_listener mlxsw_sp1_listener[] =;

static const struct mlxsw_listener mlxsw_sp2_listener[] =;

static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp_traps_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_traps_fini(struct mlxsw_sp *mlxsw_sp)
{}

static int mlxsw_sp_lag_pgt_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_lag_pgt_fini(struct mlxsw_sp *mlxsw_sp)
{}

#define MLXSW_SP_LAG_SEED_INIT

struct mlxsw_sp_lag {};

static int mlxsw_sp_lag_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_lag_fini(struct mlxsw_sp *mlxsw_sp)
{}

static const struct mlxsw_sp_ptp_ops mlxsw_sp1_ptp_ops =;

static const struct mlxsw_sp_ptp_ops mlxsw_sp2_ptp_ops =;

static const struct mlxsw_sp_ptp_ops mlxsw_sp4_ptp_ops =;

struct mlxsw_sp_sample_trigger_node {};

static const struct rhashtable_params mlxsw_sp_sample_trigger_ht_params =;

static void
mlxsw_sp_sample_trigger_key_init(struct mlxsw_sp_sample_trigger *key,
				 const struct mlxsw_sp_sample_trigger *trigger)
{}

/* RCU read lock must be held */
struct mlxsw_sp_sample_params *
mlxsw_sp_sample_trigger_params_lookup(struct mlxsw_sp *mlxsw_sp,
				      const struct mlxsw_sp_sample_trigger *trigger)
{}

static int
mlxsw_sp_sample_trigger_node_init(struct mlxsw_sp *mlxsw_sp,
				  const struct mlxsw_sp_sample_trigger *trigger,
				  const struct mlxsw_sp_sample_params *params)
{}

static void
mlxsw_sp_sample_trigger_node_fini(struct mlxsw_sp *mlxsw_sp,
				  struct mlxsw_sp_sample_trigger_node *trigger_node)
{}

int
mlxsw_sp_sample_trigger_params_set(struct mlxsw_sp *mlxsw_sp,
				   const struct mlxsw_sp_sample_trigger *trigger,
				   const struct mlxsw_sp_sample_params *params,
				   struct netlink_ext_ack *extack)
{}

void
mlxsw_sp_sample_trigger_params_unset(struct mlxsw_sp *mlxsw_sp,
				     const struct mlxsw_sp_sample_trigger *trigger)
{}

static int mlxsw_sp_netdevice_event(struct notifier_block *unused,
				    unsigned long event, void *ptr);

#define MLXSW_SP_DEFAULT_PARSING_DEPTH
#define MLXSW_SP_INCREASED_PARSING_DEPTH
#define MLXSW_SP_DEFAULT_VXLAN_UDP_DPORT

static void mlxsw_sp_parsing_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_parsing_fini(struct mlxsw_sp *mlxsw_sp)
{}

struct mlxsw_sp_ipv6_addr_node {};

static const struct rhashtable_params mlxsw_sp_ipv6_addr_ht_params =;

static int
mlxsw_sp_ipv6_addr_init(struct mlxsw_sp *mlxsw_sp, const struct in6_addr *addr6,
			u32 *p_kvdl_index)
{}

static void mlxsw_sp_ipv6_addr_fini(struct mlxsw_sp *mlxsw_sp,
				    struct mlxsw_sp_ipv6_addr_node *node)
{}

int mlxsw_sp_ipv6_addr_kvdl_index_get(struct mlxsw_sp *mlxsw_sp,
				      const struct in6_addr *addr6,
				      u32 *p_kvdl_index)
{}

void
mlxsw_sp_ipv6_addr_put(struct mlxsw_sp *mlxsw_sp, const struct in6_addr *addr6)
{}

static int mlxsw_sp_ipv6_addr_ht_init(struct mlxsw_sp *mlxsw_sp)
{}

static void mlxsw_sp_ipv6_addr_ht_fini(struct mlxsw_sp *mlxsw_sp)
{}

static int mlxsw_sp_init(struct mlxsw_core *mlxsw_core,
			 const struct mlxsw_bus_info *mlxsw_bus_info,
			 struct netlink_ext_ack *extack)
{}

static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
			  const struct mlxsw_bus_info *mlxsw_bus_info,
			  struct netlink_ext_ack *extack)
{}

static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
			  const struct mlxsw_bus_info *mlxsw_bus_info,
			  struct netlink_ext_ack *extack)
{}

static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core,
			  const struct mlxsw_bus_info *mlxsw_bus_info,
			  struct netlink_ext_ack *extack)
{}

static int mlxsw_sp4_init(struct mlxsw_core *mlxsw_core,
			  const struct mlxsw_bus_info *mlxsw_bus_info,
			  struct netlink_ext_ack *extack)
{}

static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
{}

static const struct mlxsw_config_profile mlxsw_sp1_config_profile =;

static const struct mlxsw_config_profile mlxsw_sp2_config_profile =;

/* Reduce number of LAGs from full capacity (256) to the maximum supported LAGs
 * in Spectrum-2/3, to avoid regression in number of free entries in the PGT
 * table.
 */
#define MLXSW_SP4_CONFIG_PROFILE_MAX_LAG

static const struct mlxsw_config_profile mlxsw_sp4_config_profile =;

static void
mlxsw_sp_resource_size_params_prepare(struct mlxsw_core *mlxsw_core,
				      struct devlink_resource_size_params *kvd_size_params,
				      struct devlink_resource_size_params *linear_size_params,
				      struct devlink_resource_size_params *hash_double_size_params,
				      struct devlink_resource_size_params *hash_single_size_params)
{}

static int mlxsw_sp1_resources_kvd_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp2_resources_kvd_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp_resources_span_register(struct mlxsw_core *mlxsw_core)
{}

static int
mlxsw_sp_resources_rif_mac_profile_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp_resources_rifs_register(struct mlxsw_core *mlxsw_core)
{}

static int
mlxsw_sp_resources_port_range_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp1_resources_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp2_resources_register(struct mlxsw_core *mlxsw_core)
{}

static int mlxsw_sp_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
				  const struct mlxsw_config_profile *profile,
				  u64 *p_single_size, u64 *p_double_size,
				  u64 *p_linear_size)
{}

static void mlxsw_sp_ptp_transmitted(struct mlxsw_core *mlxsw_core,
				     struct sk_buff *skb, u16 local_port)
{}

static struct mlxsw_driver mlxsw_sp1_driver =;

static struct mlxsw_driver mlxsw_sp2_driver =;

static struct mlxsw_driver mlxsw_sp3_driver =;

static struct mlxsw_driver mlxsw_sp4_driver =;

bool mlxsw_sp_port_dev_check(const struct net_device *dev)
{}

static int mlxsw_sp_lower_dev_walk(struct net_device *lower_dev,
				   struct netdev_nested_priv *priv)
{}

struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find(struct net_device *dev)
{}

struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev)
{}

struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find_rcu(struct net_device *dev)
{}

int mlxsw_sp_parsing_depth_inc(struct mlxsw_sp *mlxsw_sp)
{}

void mlxsw_sp_parsing_depth_dec(struct mlxsw_sp *mlxsw_sp)
{}

int mlxsw_sp_parsing_vxlan_udp_dport_set(struct mlxsw_sp *mlxsw_sp,
					 __be16 udp_dport)
{}

static void
mlxsw_sp_port_lag_uppers_cleanup(struct mlxsw_sp_port *mlxsw_sp_port,
				 struct net_device *lag_dev)
{}

static struct mlxsw_sp_lag *
mlxsw_sp_lag_create(struct mlxsw_sp *mlxsw_sp, struct net_device *lag_dev,
		    struct netlink_ext_ack *extack)
{}

static int
mlxsw_sp_lag_destroy(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_lag *lag)
{}

static int mlxsw_sp_lag_col_port_add(struct mlxsw_sp_port *mlxsw_sp_port,
				     u16 lag_id, u8 port_index)
{}

static int mlxsw_sp_lag_col_port_remove(struct mlxsw_sp_port *mlxsw_sp_port,
					u16 lag_id)
{}

static int mlxsw_sp_lag_col_port_enable(struct mlxsw_sp_port *mlxsw_sp_port,
					u16 lag_id)
{}

static int mlxsw_sp_lag_col_port_disable(struct mlxsw_sp_port *mlxsw_sp_port,
					 u16 lag_id)
{}

static struct mlxsw_sp_lag *
mlxsw_sp_lag_find(struct mlxsw_sp *mlxsw_sp, struct net_device *lag_dev)
{}

static struct mlxsw_sp_lag *
mlxsw_sp_lag_get(struct mlxsw_sp *mlxsw_sp, struct net_device *lag_dev,
		 struct netlink_ext_ack *extack)
{}

static void
mlxsw_sp_lag_put(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_lag *lag)
{}

static bool
mlxsw_sp_master_lag_check(struct mlxsw_sp *mlxsw_sp,
			  struct net_device *lag_dev,
			  struct netdev_lag_upper_info *lag_upper_info,
			  struct netlink_ext_ack *extack)
{}

static int mlxsw_sp_port_lag_index_get(struct mlxsw_sp *mlxsw_sp,
				       u16 lag_id, u8 *p_port_index)
{}

static int mlxsw_sp_lag_uppers_bridge_join(struct mlxsw_sp_port *mlxsw_sp_port,
					   struct net_device *lag_dev,
					   struct netlink_ext_ack *extack)
{}

static void
mlxsw_sp_lag_uppers_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
				 struct net_device *lag_dev)
{}

static int mlxsw_sp_port_lag_join(struct mlxsw_sp_port *mlxsw_sp_port,
				  struct net_device *lag_dev,
				  struct netlink_ext_ack *extack)
{}

static void mlxsw_sp_port_lag_leave(struct mlxsw_sp_port *mlxsw_sp_port,
				    struct net_device *lag_dev)
{}

static int mlxsw_sp_lag_dist_port_add(struct mlxsw_sp_port *mlxsw_sp_port,
				      u16 lag_id)
{}

static int mlxsw_sp_lag_dist_port_remove(struct mlxsw_sp_port *mlxsw_sp_port,
					 u16 lag_id)
{}

static int
mlxsw_sp_port_lag_col_dist_enable(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int
mlxsw_sp_port_lag_col_dist_disable(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static int mlxsw_sp_port_lag_changed(struct mlxsw_sp_port *mlxsw_sp_port,
				     struct netdev_lag_lower_state_info *info)
{}

static int mlxsw_sp_port_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
				 bool enable)
{}

static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static void mlxsw_sp_port_ovs_leave(struct mlxsw_sp_port *mlxsw_sp_port)
{}

static bool mlxsw_sp_bridge_has_multiple_vxlans(struct net_device *br_dev)
{}

static bool mlxsw_sp_bridge_vxlan_vlan_is_valid(struct net_device *br_dev)
{}

static bool mlxsw_sp_bridge_vxlan_is_valid(struct net_device *br_dev,
					   struct netlink_ext_ack *extack)
{}

static bool mlxsw_sp_netdev_is_master(struct net_device *upper_dev,
				      struct net_device *dev)
{}

static int __mlxsw_sp_netdevice_event(struct mlxsw_sp *mlxsw_sp,
				      unsigned long event, void *ptr,
				      bool process_foreign);

static int mlxsw_sp_netdevice_validate_uppers(struct mlxsw_sp *mlxsw_sp,
					      struct net_device *dev,
					      struct netlink_ext_ack *extack)
{}

static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
					       struct net_device *dev,
					       unsigned long event, void *ptr,
					       bool replay_deslavement)
{}

static int mlxsw_sp_netdevice_port_lower_event(struct net_device *dev,
					       unsigned long event, void *ptr)
{}

static int mlxsw_sp_netdevice_port_event(struct net_device *lower_dev,
					 struct net_device *port_dev,
					 unsigned long event, void *ptr,
					 bool replay_deslavement)
{}

/* Called for LAG or its upper VLAN after the per-LAG-lower processing was done,
 * to do any per-LAG / per-LAG-upper processing.
 */
static int mlxsw_sp_netdevice_post_lag_event(struct net_device *dev,
					     unsigned long event,
					     void *ptr)
{}

static int mlxsw_sp_netdevice_lag_event(struct net_device *lag_dev,
					unsigned long event, void *ptr)
{}

static int mlxsw_sp_netdevice_port_vlan_event(struct net_device *vlan_dev,
					      struct net_device *dev,
					      unsigned long event, void *ptr,
					      u16 vid, bool replay_deslavement)
{}

static int mlxsw_sp_netdevice_lag_port_vlan_event(struct net_device *vlan_dev,
						  struct net_device *lag_dev,
						  unsigned long event,
						  void *ptr, u16 vid)
{}

static int mlxsw_sp_netdevice_bridge_vlan_event(struct mlxsw_sp *mlxsw_sp,
						struct net_device *vlan_dev,
						struct net_device *br_dev,
						unsigned long event, void *ptr,
						u16 vid, bool process_foreign)
{}

static int mlxsw_sp_netdevice_vlan_event(struct mlxsw_sp *mlxsw_sp,
					 struct net_device *vlan_dev,
					 unsigned long event, void *ptr,
					 bool process_foreign)
{}

static int mlxsw_sp_netdevice_bridge_event(struct mlxsw_sp *mlxsw_sp,
					   struct net_device *br_dev,
					   unsigned long event, void *ptr,
					   bool process_foreign)
{}

static int mlxsw_sp_netdevice_macvlan_event(struct net_device *macvlan_dev,
					    unsigned long event, void *ptr)
{}

static int mlxsw_sp_netdevice_vxlan_event(struct mlxsw_sp *mlxsw_sp,
					  struct net_device *dev,
					  unsigned long event, void *ptr)
{}

static int __mlxsw_sp_netdevice_event(struct mlxsw_sp *mlxsw_sp,
				      unsigned long event, void *ptr,
				      bool process_foreign)
{}

static int mlxsw_sp_netdevice_event(struct notifier_block *nb,
				    unsigned long event, void *ptr)
{}

static const struct pci_device_id mlxsw_sp1_pci_id_table[] =;

static struct pci_driver mlxsw_sp1_pci_driver =;

static const struct pci_device_id mlxsw_sp2_pci_id_table[] =;

static struct pci_driver mlxsw_sp2_pci_driver =;

static const struct pci_device_id mlxsw_sp3_pci_id_table[] =;

static struct pci_driver mlxsw_sp3_pci_driver =;

static const struct pci_device_id mlxsw_sp4_pci_id_table[] =;

static struct pci_driver mlxsw_sp4_pci_driver =;

static int __init mlxsw_sp_module_init(void)
{}

static void __exit mlxsw_sp_module_exit(void)
{}

module_init();
module_exit(mlxsw_sp_module_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_DEVICE_TABLE(pci, mlxsw_sp1_pci_id_table);
MODULE_DEVICE_TABLE(pci, mlxsw_sp2_pci_id_table);
MODULE_DEVICE_TABLE(pci, mlxsw_sp3_pci_id_table);
MODULE_DEVICE_TABLE(pci, mlxsw_sp4_pci_id_table);
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();