text: /*
   * DO NOT EDIT THIS FILE!
   * This file is auto-generated.
   * Edits to this file will be lost when it is regenerated.
   *
   * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
   * 
   * Copyright 2007-2020 Broadcom Inc. All rights reserved.
   */
  
  #include <bcm/mirror.h>
  #include <bcm_int/ltsw/cosq.h>
  
  #include <bcm_int/ltsw/mbcm/mirror.h>
  #include <bcm_int/ltsw/xgs/mirror.h>
  #include "sub_dispatch.h"
  
  #include <shr/shr_debug.h>
  #include <bcmltd/chip/bcmltd_str.h>
  
  /******************************************************************************
   * Local definitions
   */
  
  #define BSL_LOG_MODULE BSL_LS_BCM_MIRROR
  
  /******************************************************************************
   * Private functions
   */
  
  static int
  bcm56990_a0_ltsw_mirror_init(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_init(unit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_deinit(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_deinit(unit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_encap_add(
      int unit,
      bool egr,
      bcm_mirror_destination_t *mirror_dest,
      int *index)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_encap_add(unit, egr, mirror_dest, index));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_encap_delete(
      int unit,
      bcm_mirror_destination_t *mirror_dest,
      int index)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_encap_delete(unit, mirror_dest, index));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_encap_get(
      int unit,
      int index,
      bcm_mirror_destination_t *mirror_dest)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_encap_get(unit, index, mirror_dest));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_session_add(
      int unit,
      int session_id,
      bcmint_mirror_session_entry_t *session)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_session_add(unit, session_id, session));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_session_delete(
      int unit,
      int session_id,
      bool egr,
      bool cosq_mod)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_session_delete(unit, session_id, egr, cosq_mod));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_session_get(
      int unit,
      int session_id,
      bcmint_mirror_session_entry_t *session)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_session_get(unit, session_id, session));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_enable_get(
      int unit,
      bcmint_mirror_source_t *source,
      int *enable,
      int *instance_id)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_enable_get(unit, source, enable, instance_id));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_enable_set(
      int unit,
      bcmint_mirror_source_t *source,
      int mc_bmp,
      int enable,
      int *instance_id)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_enable_set(unit, source, mc_bmp, enable, instance_id));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_misc_init(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_misc_init(unit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_misc_deinit(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_misc_deinit(unit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_sampler_seed_set(
      int unit,
      bcmi_ltsw_mirror_sampler_seed_type_t type,
      int value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_sampler_seed_set(unit, type, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_sampler_seed_get(
      int unit,
      bcmi_ltsw_mirror_sampler_seed_type_t type,
      int *value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_sampler_seed_get(unit, type, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_sample_version_set(
      int unit,
      int value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_sample_version_set(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_sample_version_get(
      int unit,
      int *value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_sample_version_get(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_psamp_ipfix_version_set(
      int unit,
      int value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_psamp_ipfix_version_set(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_psamp_ipfix_version_get(
      int unit,
      int *value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_psamp_ipfix_version_get(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_psamp_epoch_set(
      int unit,
      int value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_psamp_epoch_set(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_psamp_epoch_get(
      int unit,
      int *value)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_psamp_epoch_get(unit, value));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_uc_cos_set(
      int unit,
      int uc_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_uc_cos_set(unit, uc_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_uc_cos_get(
      int unit,
      int *uc_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_uc_cos_get(unit, uc_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_mc_cos_set(
      int unit,
      int mc_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_mc_cos_set(unit, mc_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_mc_cos_get(
      int unit,
      int *mc_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_mc_cos_get(unit, mc_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_cpu_cos_set(
      int unit,
      int cpu_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_cpu_cos_set(unit, cpu_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_cpu_cos_get(
      int unit,
      int *cpu_cos)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_cpu_cos_get(unit, cpu_cos));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_invalid_vlan_drop_set(
      int unit,
      int enable)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_invalid_vlan_drop_set(unit, enable));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_invalid_vlan_drop_get(
      int unit,
      int *enable)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_invalid_vlan_drop_get(unit, enable));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_pkt_checks_set(
      int unit,
      int enable)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_pkt_checks_set(unit, enable));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_pkt_checks_get(
      int unit,
      int *enable)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_pkt_checks_get(unit, enable));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_destination_validate(
      int unit,
      bcm_mirror_destination_t *mirror_dest)
  {
      bcmi_ltsw_cosq_port_map_info_t info;
      bcm_port_t local_port;
  
      SHR_FUNC_ENTER(unit);
  
      /* Do not support. */
      if ((mirror_dest->flags & BCM_MIRROR_DEST_ID_SHARE) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_MTP_ADD) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_MTP_REPLACE) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_MTP_DELETE) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_INT_PRI_SET) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_TUNNEL_TRILL) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_TUNNEL_WITH_SPAN_ID) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_TUNNEL_RSPAN) ||
          (mirror_dest->flags & BCM_MIRROR_DEST_TUNNEL_ETAG) ||
          (mirror_dest->flags2 & BCM_MIRROR_DEST_FLAGS2_IFA) ||
          (mirror_dest->flags2 & BCM_MIRROR_DEST_FLAGS2_INT_PROBE) ||
          (mirror_dest->flags2 & BCM_MIRROR_DEST_FLAGS2_TRUE_EGRESS)) {
          SHR_ERR_EXIT(SHR_E_UNAVAIL);
      }
  
      if (mirror_dest->flags & BCM_MIRROR_DEST_TUNNEL_NIV) {
          SHR_ERR_EXIT(SHR_E_UNAVAIL);
      }
  
      /* Mirroring to Trunk group is not supported. */
      if (BCM_GPORT_IS_TRUNK(mirror_dest->gport)) {
          SHR_ERR_EXIT(SHR_E_UNAVAIL);
      }
  
      /* TD4-like mirror to loopback port mechanism is not supported. */
      if (mirror_dest->flags2 & BCM_MIRROR_DEST_FLAGS2_LOOPBACK_ENABLE) {
          SHR_ERR_EXIT(SHR_E_UNAVAIL);
      }
  
      /* Get local port first. */
      SHR_IF_ERR_VERBOSE_EXIT
          (bcmi_ltsw_mirror_local_port_get(unit,
                                           mirror_dest->gport,
                                           NULL,
                                           &local_port));
  
      /* Get UC/MC queue number. */
      SHR_IF_ERR_VERBOSE_EXIT
          (bcmi_ltsw_cosq_port_map_info_get(unit, local_port, &info));
  
      /*
       * Only mc queue is used for TM Mirror-on-drop.
       * Check if the cosq exceeds the maximum queue number for MMU MOD.
       * or cosq = 0 for Ingress MOD. (Ingress MOD doesn't need cosq.)
       */
      if (!((mirror_dest->cosq == 0) ||
            ((mirror_dest->cosq >= info.num_uc_q) &&
              (mirror_dest->cosq < (info.num_uc_q + info.num_mc_q))))) {
          SHR_ERR_EXIT(SHR_E_PARAM);
      }
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_vlan_get(
      int unit,
      bcm_port_t port,
      uint16_t *tpid,
      uint16_t *vlan)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_vlan_get(unit, port, tpid, vlan));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_vlan_set(
      int unit,
      bcm_port_t port,
      uint16_t tpid,
      uint16_t vlan)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_vlan_set(unit, port, tpid, vlan));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_payload_zero_control_multi_get(
      int unit,
      bcm_mirror_payload_zero_info_t *pyld_zero_cfg,
      int num_elems)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_payload_zero_control_multi_get(unit, pyld_zero_cfg, num_elems));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_payload_zero_control_multi_set(
      int unit,
      bcm_mirror_payload_zero_info_t *pyld_zero_cfg,
      int num_elems)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_payload_zero_control_multi_set(unit, pyld_zero_cfg, num_elems));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_payload_zero_profile_create(
      int unit,
      bcm_mirror_payload_zero_offsets_t *mirror_payload_offset_info,
      uint32 flags,
      uint32 * profile_index)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_payload_zero_profile_create(unit, mirror_payload_offset_info, flags, profile_index));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_payload_zero_profile_destroy(
      int unit,
      uint32 flags,
      uint32 profile_index)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_payload_zero_profile_destroy(unit, flags, profile_index));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_group_create(
      int unit,
      bcm_mirror_ingress_mod_event_t *event_array,
      int num_events,
      bcm_mirror_ingress_mod_event_group_t *group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_group_create(unit, event_array, num_events, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_group_destroy(
      int unit,
      bcm_mirror_ingress_mod_event_group_t group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_group_destroy(unit, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_group_get_all(
      int unit,
      bcm_mirror_ingress_mod_event_group_t *group_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_group_get_all(unit, group_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_group_event_get(
      int unit,
      bcm_mirror_ingress_mod_event_group_t group,
      bcm_mirror_ingress_mod_event_t *event_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_group_event_get(unit, group, event_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_create(
      int unit,
      bcm_mirror_ingress_mod_event_profile_t *profile,
      int *profile_id)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_create(unit, profile, profile_id));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_destroy(
      int unit,
      int profile_id)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_destroy(unit, profile_id));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_get_all(
      int unit,
      int *profile_id_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_get_all(unit, profile_id_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_cfg_get(
      int unit,
      int profile_id,
      bcm_mirror_ingress_mod_event_profile_t *profile)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_cfg_get(unit, profile_id, profile));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_add(
      int unit,
      int profile_id,
      bcm_mirror_ingress_mod_event_group_t group,
      int hit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_group_add(unit, profile_id, group, hit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_delete(
      int unit,
      int profile_id,
      bcm_mirror_ingress_mod_event_group_t group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_group_delete(unit, profile_id, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_get_all(
      int unit,
      int profile_id,
      bcm_mirror_ingress_mod_event_group_t *group_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_group_get_all(unit, profile_id, group_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_get(
      int unit,
      int profile_id,
      bcm_mirror_ingress_mod_event_group_t group,
      int *hit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_ingress_mod_event_profile_group_get(unit, profile_id, group, hit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_create(
      int unit,
      bcm_mirror_multi_dip_entry_num_t num_entries,
      bcm_ip_t *ipv4_addr_array,
      bcm_mirror_multi_dip_group_t *group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv4_create(unit, num_entries, ipv4_addr_array, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_destroy(
      int unit,
      bcm_mirror_multi_dip_group_t group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv4_destroy(unit, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_get_all(
      int unit,
      bcm_mirror_multi_dip_group_t *ipv4_group_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv4_get_all(unit, ipv4_group_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_get(
      int unit,
      bcm_mirror_multi_dip_group_t group,
      bcm_ip_t *ipv4_addr_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv4_get(unit, group, ipv4_addr_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_create(
      int unit,
      bcm_mirror_multi_dip_entry_num_t num_entries,
      bcm_ip6_t *ipv6_addr_array,
      bcm_mirror_multi_dip_group_t *group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv6_create(unit, num_entries, ipv6_addr_array, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_destroy(
      int unit,
      bcm_mirror_multi_dip_group_t group)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv6_destroy(unit, group));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_get_all(
      int unit,
      bcm_mirror_multi_dip_group_t *ipv6_group_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv6_get_all(unit, ipv6_group_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_get(
      int unit,
      bcm_mirror_multi_dip_group_t group,
      bcm_ip6_t *ipv6_addr_array,
      int *count)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_group_ipv6_get(unit, group, ipv6_addr_array, count));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  static int
  bcm56990_a0_ltsw_mirror_multi_dip_dump(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (xgs_ltsw_mirror_multi_dip_dump(unit));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  /*!
   * \brief Mirror driver function variable for bcm56990_a0 device.
   */
  static mbcm_ltsw_mirror_drv_t bcm56990_a0_ltsw_mirror_drv = {
      .mirror_init = bcm56990_a0_ltsw_mirror_init,
      .mirror_deinit = bcm56990_a0_ltsw_mirror_deinit,
      .mirror_encap_add = bcm56990_a0_ltsw_mirror_encap_add,
      .mirror_encap_delete = bcm56990_a0_ltsw_mirror_encap_delete,
      .mirror_encap_get = bcm56990_a0_ltsw_mirror_encap_get,
      .mirror_session_add = bcm56990_a0_ltsw_mirror_session_add,
      .mirror_session_delete = bcm56990_a0_ltsw_mirror_session_delete,
      .mirror_session_get = bcm56990_a0_ltsw_mirror_session_get,
      .mirror_enable_get = bcm56990_a0_ltsw_mirror_enable_get,
      .mirror_enable_set = bcm56990_a0_ltsw_mirror_enable_set,
      .mirror_misc_init = bcm56990_a0_ltsw_mirror_misc_init,
      .mirror_misc_deinit = bcm56990_a0_ltsw_mirror_misc_deinit,
      .mirror_sampler_seed_set = bcm56990_a0_ltsw_mirror_sampler_seed_set,
      .mirror_sampler_seed_get = bcm56990_a0_ltsw_mirror_sampler_seed_get,
      .mirror_sample_version_set = bcm56990_a0_ltsw_mirror_sample_version_set,
      .mirror_sample_version_get = bcm56990_a0_ltsw_mirror_sample_version_get,
      .mirror_psamp_ipfix_version_set = bcm56990_a0_ltsw_mirror_psamp_ipfix_version_set,
      .mirror_psamp_ipfix_version_get = bcm56990_a0_ltsw_mirror_psamp_ipfix_version_get,
      .mirror_psamp_epoch_set = bcm56990_a0_ltsw_mirror_psamp_epoch_set,
      .mirror_psamp_epoch_get = bcm56990_a0_ltsw_mirror_psamp_epoch_get,
      .mirror_uc_cos_set = bcm56990_a0_ltsw_mirror_uc_cos_set,
      .mirror_uc_cos_get = bcm56990_a0_ltsw_mirror_uc_cos_get,
      .mirror_mc_cos_set = bcm56990_a0_ltsw_mirror_mc_cos_set,
      .mirror_mc_cos_get = bcm56990_a0_ltsw_mirror_mc_cos_get,
      .mirror_cpu_cos_set = bcm56990_a0_ltsw_mirror_cpu_cos_set,
      .mirror_cpu_cos_get = bcm56990_a0_ltsw_mirror_cpu_cos_get,
      .mirror_invalid_vlan_drop_set = bcm56990_a0_ltsw_mirror_invalid_vlan_drop_set,
      .mirror_invalid_vlan_drop_get = bcm56990_a0_ltsw_mirror_invalid_vlan_drop_get,
      .mirror_pkt_checks_set = bcm56990_a0_ltsw_mirror_pkt_checks_set,
      .mirror_pkt_checks_get = bcm56990_a0_ltsw_mirror_pkt_checks_get,
      .mirror_destination_validate = bcm56990_a0_ltsw_mirror_destination_validate,
      .mirror_vlan_get = bcm56990_a0_ltsw_mirror_vlan_get,
      .mirror_vlan_set = bcm56990_a0_ltsw_mirror_vlan_set,
      .mirror_payload_zero_control_multi_get = bcm56990_a0_ltsw_mirror_payload_zero_control_multi_get,
      .mirror_payload_zero_control_multi_set = bcm56990_a0_ltsw_mirror_payload_zero_control_multi_set,
      .mirror_payload_zero_profile_create = bcm56990_a0_ltsw_mirror_payload_zero_profile_create,
      .mirror_payload_zero_profile_destroy = bcm56990_a0_ltsw_mirror_payload_zero_profile_destroy,
      .mirror_ingress_mod_event_group_create = bcm56990_a0_ltsw_mirror_ingress_mod_event_group_create,
      .mirror_ingress_mod_event_group_destroy = bcm56990_a0_ltsw_mirror_ingress_mod_event_group_destroy,
      .mirror_ingress_mod_event_group_get_all = bcm56990_a0_ltsw_mirror_ingress_mod_event_group_get_all,
      .mirror_ingress_mod_event_group_event_get = bcm56990_a0_ltsw_mirror_ingress_mod_event_group_event_get,
      .mirror_ingress_mod_event_profile_create = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_create,
      .mirror_ingress_mod_event_profile_destroy = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_destroy,
      .mirror_ingress_mod_event_profile_get_all = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_get_all,
      .mirror_ingress_mod_event_profile_cfg_get = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_cfg_get,
      .mirror_ingress_mod_event_profile_group_add = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_add,
      .mirror_ingress_mod_event_profile_group_delete = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_delete,
      .mirror_ingress_mod_event_profile_group_get_all = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_get_all,
      .mirror_ingress_mod_event_profile_group_get = bcm56990_a0_ltsw_mirror_ingress_mod_event_profile_group_get,
      .mirror_multi_dip_group_ipv4_create = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_create,
      .mirror_multi_dip_group_ipv4_destroy = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_destroy,
      .mirror_multi_dip_group_ipv4_get_all = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_get_all,
      .mirror_multi_dip_group_ipv4_get = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv4_get,
      .mirror_multi_dip_group_ipv6_create = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_create,
      .mirror_multi_dip_group_ipv6_destroy = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_destroy,
      .mirror_multi_dip_group_ipv6_get_all = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_get_all,
      .mirror_multi_dip_group_ipv6_get = bcm56990_a0_ltsw_mirror_multi_dip_group_ipv6_get,
      .mirror_multi_dip_dump = bcm56990_a0_ltsw_mirror_multi_dip_dump
  };
  
  /******************************************************************************
   * Public functions
   */
  
  int
  bcm56990_a0_ltsw_mirror_drv_attach(int unit)
  {
      SHR_FUNC_ENTER(unit);
  
      SHR_IF_ERR_VERBOSE_EXIT
          (mbcm_ltsw_mirror_drv_set(unit, &bcm56990_a0_ltsw_mirror_drv));
  
      SHR_IF_ERR_VERBOSE_EXIT
          (bcm56990_a0_sub_drv_attach(unit, &bcm56990_a0_ltsw_mirror_drv,
                                      BCM56990_A0_SUB_DRV_BCM56990_Ax,
                                      BCM56990_A0_SUB_MOD_MIRROR));
  
  exit:
      SHR_FUNC_EXIT();
  }
  
  /*!
   * \brief Attach functions for other members.
   */
  #define BCM56990_A0_DRV_ATTACH_ENTRY(_dn,_vn,_pf,_pd,_r0) \
  int _vn##_ltsw_mirror_drv_attach(int unit) \
  { \
      SHR_FUNC_ENTER(unit); \
      SHR_IF_ERR_VERBOSE_EXIT \
          (mbcm_ltsw_mirror_drv_set(unit, &bcm56990_a0_ltsw_mirror_drv)); \
      SHR_IF_ERR_VERBOSE_EXIT \
          (bcm56990_a0_sub_drv_attach(unit, &bcm56990_a0_ltsw_mirror_drv, \
                                      BCM56990_A0_SUB_DRV_BCM5699x, \
                                      BCM56990_A0_SUB_MOD_MIRROR)); \
  exit: \
      SHR_FUNC_EXIT(); \
  }
  #include "sub_devlist.h"
  