openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

fcoe.h (21306B)


      1 /*
      2  * 
      3  * 
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      7  * 
      8  * DO NOT EDIT THIS FILE!
      9  * This file is auto-generated.
     10  * Edits to this file will be lost when it is regenerated.
     11  */
     12 
     13 #ifndef __BCM_FCOE_H__
     14 #define __BCM_FCOE_H__
     15 
     16 #include <bcm/types.h>
     17 #include <bcm/stat.h>
     18 
     19 #ifndef BCM_HIDE_DISPATCHABLE
     20 
     21 /* Initialize FCOE module */
     22 extern int bcm_fcoe_init(
     23     int unit);
     24 
     25 /* De-initialize FCOE module */
     26 extern int bcm_fcoe_cleanup(
     27     int unit);
     28 
     29 /* enable/disable FCOE without clearing any FCOE table */
     30 extern int bcm_fcoe_enable_set(
     31     int unit);
     32 
     33 #endif /* BCM_HIDE_DISPATCHABLE */
     34 
     35 typedef uint32 bcm_fcoe_nport_id_t;
     36 
     37 typedef uint32 bcm_fcoe_fcmap_t;
     38 
     39 #define BCM_FCOE_HOST_ROUTE             0x00000001 /* Host FCOE route */
     40 #define BCM_FCOE_SOURCE_ROUTE           0x00000002 /* Source FCOE route */
     41 #define BCM_FCOE_DOMAIN_ROUTE           0x00000004 /* Domain FCOE route */
     42 #define BCM_FCOE_DST_DISCARD            0x00000008 /* Destination match discard */
     43 #define BCM_FCOE_SRC_DISCARD            0x00000010 /* Destination match discard */
     44 #define BCM_FCOE_MULTIPATH              0x00000020 /* Specify ECMP treatment */
     45 #define BCM_FCOE_RPE                    0x00000040 /* Pick up new priority from
     46                                                       Entry */
     47 #define BCM_FCOE_LOCAL_ADDRESS          0x00000080 /* Address belong to switch -
     48                                                       for FCOE_HOST_ROUTE */
     49 #define BCM_FCOE_NO_HOP_COUNT_CHANGE    0x00000100 /* Don't decrement VFP Hop
     50                                                       Count */
     51 #define BCM_FCOE_COPY_TO_CPU            0x00000200 /* Send a Copy to CPU */
     52 #define BCM_FCOE_DEFIP_ENTRY_TYPE_FCOE  0x00000400 /* FCOE Entry in DEFIP table */
     53 
     54 /* FCOE route info */
     55 typedef struct bcm_fcoe_route_s {
     56     uint32 flags;                       /* BCM_FCOE_* flags */
     57     bcm_vrf_t vrf;                      /* Virtual router instance */
     58     bcm_fcoe_nport_id_t nport_id;       /* Destination/Source FC Nport ID */
     59     bcm_fcoe_nport_id_t nport_id_mask;  /* Mask used for Domain/prefix routes */
     60     bcm_cos_t pri;                      /* New priority in packet */
     61     bcm_if_t intf;                      /* L3 intf associated with this address */
     62     bcm_mac_t nexthop_mac;              /* Next-hop mac address */
     63     bcm_gport_t port;                   /* Port */
     64     int lookup_class;                   /* Classification lookup class ID */
     65     bcm_if_t encap_id;                  /* encapsulation index */
     66 } bcm_fcoe_route_t;
     67 
     68 /* Initialize bcm_fcoe_route_t */
     69 extern void bcm_fcoe_route_t_init(
     70     bcm_fcoe_route_t *route);
     71 
     72 #ifndef BCM_HIDE_DISPATCHABLE
     73 
     74 /* Add an entry into the FCOE routing table */
     75 extern int bcm_fcoe_route_add(
     76     int unit, 
     77     bcm_fcoe_route_t *route);
     78 
     79 /* Delete an nport_id entry from the FCOE routing table */
     80 extern int bcm_fcoe_route_delete(
     81     int unit, 
     82     bcm_fcoe_route_t *route);
     83 
     84 /* Delete FCOE entries based on Masked Domain prefix (network) */
     85 extern int bcm_fcoe_route_delete_by_prefix(
     86     int unit, 
     87     bcm_fcoe_route_t *route);
     88 
     89 /* Delete FCOE entries that do/don't match a specified L3 interface */
     90 extern int bcm_fcoe_route_delete_by_interface(
     91     int unit, 
     92     bcm_fcoe_route_t *route);
     93 
     94 /* Deletes all FCOE routing table entries */
     95 extern int bcm_fcoe_route_delete_all(
     96     int unit);
     97 
     98 /* Look up an FCOE routing table entry based on nport id */
     99 extern int bcm_fcoe_route_find(
    100     int unit, 
    101     bcm_fcoe_route_t *route);
    102 
    103 #endif /* BCM_HIDE_DISPATCHABLE */
    104 
    105 #define BCM_FCOE_VSAN_OPTION_REPLACE        0x00000001 /* Replace the VSAN ID */
    106 #define BCM_FCOE_VSAN_CONFIG_NORMALIZED_ZONE_CHECK 0x00000001 /* VSAN normalized zone
    107                                                           check */
    108 #define BCM_FCOE_VSAN_CONFIG_FCOE_ROUTE_ENABLE 0x00000002 /* Enable routing on VSAN */
    109 
    110 /* FCOE VSAN object */
    111 typedef struct bcm_fcoe_vsan_s {
    112     uint32 config_flags;    /* BCM_FCOE_VSAN_CONFIG_* flags */
    113     bcm_if_t l3_intf_id;    /* L3 interface ID */
    114     bcm_fcoe_fcmap_t fcmap; /* Associated FC Map */
    115 } bcm_fcoe_vsan_t;
    116 
    117 /* VSAN controls */
    118 typedef enum bcm_fcoe_vsan_control_e {
    119     bcmFcoeVsanNormalizedZoneCheck = 0, /* FCoE Zone checking is normalized */
    120     bcmFcoeVsanRouteEnable = 1          /* FCoE Routing enable */
    121 } bcm_fcoe_vsan_control_t;
    122 
    123 /* Initialize bcm_fcoe_vsan_t */
    124 extern void bcm_fcoe_vsan_t_init(
    125     bcm_fcoe_vsan_t *vsan);
    126 
    127 #ifndef BCM_HIDE_DISPATCHABLE
    128 
    129 /* Allocate and configure a VSAN */
    130 extern int bcm_fcoe_vsan_create(
    131     int unit, 
    132     uint32 options, 
    133     bcm_fcoe_vsan_t *vsan, 
    134     bcm_fcoe_vsan_id_t *vsan_id);
    135 
    136 /* Destroy a VSAN */
    137 extern int bcm_fcoe_vsan_destroy(
    138     int unit, 
    139     bcm_fcoe_vsan_id_t vsan_id);
    140 
    141 /* Destroy all VSANs */
    142 extern int bcm_fcoe_vsan_destroy_all(
    143     int unit);
    144 
    145 /* Get VSAN controls */
    146 extern int bcm_fcoe_control_vsan_get(
    147     int unit, 
    148     bcm_fcoe_vsan_id_t vsan_id, 
    149     bcm_fcoe_vsan_control_t type, 
    150     int *arg);
    151 
    152 /* Set VSAN controls */
    153 extern int bcm_fcoe_control_vsan_set(
    154     int unit, 
    155     bcm_fcoe_vsan_id_t vsan_id, 
    156     bcm_fcoe_vsan_control_t type, 
    157     int arg);
    158 
    159 /* Get VSAN properties associated with a VSAN ID */
    160 extern int bcm_fcoe_vsan_get(
    161     int unit, 
    162     bcm_fcoe_vsan_id_t vsan_id, 
    163     bcm_fcoe_vsan_t *vsan);
    164 
    165 /* Update VSAN properties associated with a VSAN ID */
    166 extern int bcm_fcoe_vsan_set(
    167     int unit, 
    168     bcm_fcoe_vsan_id_t vsan_id, 
    169     bcm_fcoe_vsan_t *vsan);
    170 
    171 #endif /* BCM_HIDE_DISPATCHABLE */
    172 
    173 /* Actions on packets matching zone check */
    174 typedef enum bcm_fcoe_zone_action_e {
    175     bcmFcoeZoneActionAllow = 0,     /* Allow packets matching the zone check */
    176     bcmFcoeZoneActionDeny = 1,      /* Deny packets matching the zone check */
    177     bcmFcoeZoneActionCopyToCpu = 2, /* Copy-to-CPU packets matching the zone
    178                                        check */
    179     bcmFcoeZoneActionRedirect = 3   /* redirect port to given port */
    180 } bcm_fcoe_zone_action_t;
    181 
    182 /* Device-independent Zone address structure */
    183 typedef struct bcm_fcoe_zone_entry_s {
    184     uint32 flags;                   /* BCM_FCOE_ZONE_* flags - for Future */
    185     bcm_fcoe_vsan_id_t vsan_id;     /* VSAN identifier */
    186     bcm_fcoe_nport_id_t d_id;       /* Destination FC Nport ID */
    187     bcm_fcoe_nport_id_t s_id;       /* Source FC Nport ID */
    188     int class_id;                   /* Class id to Field Processor */
    189     bcm_fcoe_zone_action_t action;  /* Action to take for Zone match packets */
    190     bcm_gport_t dest_port;          /* destination port relevant for redirect
    191                                        action */
    192 } bcm_fcoe_zone_entry_t;
    193 
    194 /* Initialize bcm_fcoe_zone_t */
    195 extern void bcm_fcoe_zone_entry_t_init(
    196     bcm_fcoe_zone_entry_t *zone);
    197 
    198 #ifndef BCM_HIDE_DISPATCHABLE
    199 
    200 /* Add Zone check entry */
    201 extern int bcm_fcoe_zone_add(
    202     int unit, 
    203     bcm_fcoe_zone_entry_t *zone);
    204 
    205 /* Delete all zone check entries matching VSAN ID */
    206 extern int bcm_fcoe_zone_delete_by_vsan(
    207     int unit, 
    208     bcm_fcoe_zone_entry_t *zone);
    209 
    210 /* Delete Zone check entry */
    211 extern int bcm_fcoe_zone_delete(
    212     int unit, 
    213     bcm_fcoe_zone_entry_t *zone);
    214 
    215 /* Delete all zone check entries with matching Source ID */
    216 extern int bcm_fcoe_zone_delete_by_sid(
    217     int unit, 
    218     bcm_fcoe_zone_entry_t *zone);
    219 
    220 /* Delete all zone check entries with matching Destination ID */
    221 extern int bcm_fcoe_zone_delete_by_did(
    222     int unit, 
    223     bcm_fcoe_zone_entry_t *zone);
    224 
    225 /* Delete all zone check entries */
    226 extern int bcm_fcoe_zone_delete_all(
    227     int unit);
    228 
    229 /* Retrieve Zone info */
    230 extern int bcm_fcoe_zone_get(
    231     int unit, 
    232     bcm_fcoe_zone_entry_t *zone);
    233 
    234 #endif /* BCM_HIDE_DISPATCHABLE */
    235 
    236 #define BCM_FCOE_FC_HEADER_TYPE_INGRESS 0x00000001 /* Ingress header type */
    237 #define BCM_FCOE_FC_HEADER_TYPE_EGRESS  0x00000002 /* Egress header type */
    238 
    239 /* Header types for bcm_fcoe_fc_header_type_set/get */
    240 typedef enum bcm_fcoe_fc_header_type_e {
    241     bcmFcoeFcHeaderTypeNone = 0,    /* No header */
    242     bcmFcoeFcHeaderTypeStd = 1,     /* Standard header */
    243     bcmFcoeFcHeaderTypeEncap = 2,   /* Encapsulated header */
    244     bcmFcoeFcHeaderTypeVft = 3,     /* VFT header */
    245     bcmFcoeFcHeaderTypeIfr = 4,     /* IFR Header */
    246     bcmFcoeFcHeaderTypeUnknown = 5, /* Unknown Header */
    247     bcmFcoeFcHeaderTypeCount = 6 
    248 } bcm_fcoe_fc_header_type_t;
    249 
    250 #ifndef BCM_HIDE_DISPATCHABLE
    251 
    252 /* Set FC header type */
    253 extern int bcm_fcoe_fc_header_type_set(
    254     int unit, 
    255     uint32 flags, 
    256     uint8 r_ctl, 
    257     bcm_fcoe_fc_header_type_t hdr_type);
    258 
    259 /* Retrieve FC header type */
    260 extern int bcm_fcoe_fc_header_type_get(
    261     int unit, 
    262     uint32 flags, 
    263     uint8 r_ctl, 
    264     bcm_fcoe_fc_header_type_t *hdr_type);
    265 
    266 #endif /* BCM_HIDE_DISPATCHABLE */
    267 
    268 /* FCOE statistics maintained per VSAN. */
    269 typedef enum bcm_fcoe_vsan_stat_e {
    270     bcmFcoeVsanInPackets = 0,   /* Packets that ingress on fcoe vsan */
    271     bcmFcoeVsanInBytes = 1      /* Bytes that ingress on fcoe vsan */
    272 } bcm_fcoe_vsan_stat_t;
    273 
    274 #ifndef BCM_HIDE_DISPATCHABLE
    275 
    276 /* 
    277  * Allocate flex counter and assign counter index/offset for FCOE VSAN
    278  * ID.
    279  */
    280 extern int bcm_fcoe_vsan_stat_attach(
    281     int unit, 
    282     bcm_fcoe_vsan_id_t vsan, 
    283     uint32 stat_counter_id);
    284 
    285 /* Detach flex counter for FCOE VSAN ID. */
    286 extern int bcm_fcoe_vsan_stat_detach(
    287     int unit, 
    288     bcm_fcoe_vsan_id_t vsan);
    289 
    290 /* Get flex counter for FCOE VSAN ID. */
    291 extern int bcm_fcoe_vsan_stat_counter_get(
    292     int unit, 
    293     bcm_fcoe_vsan_id_t vsan, 
    294     bcm_fcoe_vsan_stat_t stat, 
    295     uint32 num_entries, 
    296     uint32 *counter_indexes, 
    297     bcm_stat_value_t *counter_values);
    298 
    299 /* Get flex counter for FCOE VSAN ID. */
    300 extern int bcm_fcoe_vsan_stat_counter_sync_get(
    301     int unit, 
    302     bcm_fcoe_vsan_id_t vsan, 
    303     bcm_fcoe_vsan_stat_t stat, 
    304     uint32 num_entries, 
    305     uint32 *counter_indexes, 
    306     bcm_stat_value_t *counter_values);
    307 
    308 /* Set flex counter for FCOE VSAN ID. */
    309 extern int bcm_fcoe_vsan_stat_counter_set(
    310     int unit, 
    311     bcm_fcoe_vsan_id_t vsan, 
    312     bcm_fcoe_vsan_stat_t stat, 
    313     uint32 num_entries, 
    314     uint32 *counter_indexes, 
    315     bcm_stat_value_t *counter_values);
    316 
    317 /* Get flex counter ID for FCOE VSAN ID. */
    318 extern int bcm_fcoe_vsan_stat_id_get(
    319     int unit, 
    320     bcm_fcoe_vsan_id_t vsan, 
    321     bcm_fcoe_vsan_stat_t stat, 
    322     uint32 *stat_counter_id);
    323 
    324 #endif /* BCM_HIDE_DISPATCHABLE */
    325 
    326 /* FCOE statistics maintained per route. */
    327 typedef enum bcm_fcoe_route_stat_e {
    328     bcmFcoeRouteInPackets = 0,  /* Packets that ingress on fcoe route */
    329     bcmFcoeRouteInBytes = 1     /* Bytes that ingress on fcoe route */
    330 } bcm_fcoe_route_stat_t;
    331 
    332 #ifndef BCM_HIDE_DISPATCHABLE
    333 
    334 /* Allocate flex counter and assign counter index/offset for FCOE Route */
    335 extern int bcm_fcoe_route_stat_attach(
    336     int unit, 
    337     bcm_fcoe_route_t *route, 
    338     uint32 stat_counter_id);
    339 
    340 /* Detach flex counter for FCOE Route */
    341 extern int bcm_fcoe_route_stat_detach(
    342     int unit, 
    343     bcm_fcoe_route_t *route);
    344 
    345 /* Get flex counter for FCOE Route */
    346 extern int bcm_fcoe_route_stat_counter_get(
    347     int unit, 
    348     bcm_fcoe_route_t *route, 
    349     bcm_fcoe_route_stat_t stat, 
    350     uint32 num_entries, 
    351     uint32 *counter_indexes, 
    352     bcm_stat_value_t *counter_values);
    353 
    354 /* Get flex counter for FCOE Route */
    355 extern int bcm_fcoe_route_stat_counter_sync_get(
    356     int unit, 
    357     bcm_fcoe_route_t *route, 
    358     bcm_fcoe_route_stat_t stat, 
    359     uint32 num_entries, 
    360     uint32 *counter_indexes, 
    361     bcm_stat_value_t *counter_values);
    362 
    363 /* Set flex counter for FCOE Route */
    364 extern int bcm_fcoe_route_stat_counter_set(
    365     int unit, 
    366     bcm_fcoe_route_t *route, 
    367     bcm_fcoe_route_stat_t stat, 
    368     uint32 num_entries, 
    369     uint32 *counter_indexes, 
    370     bcm_stat_value_t *counter_values);
    371 
    372 /* Get flex counter ID for FCOE Route */
    373 extern int bcm_fcoe_route_stat_id_get(
    374     int unit, 
    375     bcm_fcoe_route_t *route, 
    376     bcm_fcoe_route_stat_t stat, 
    377     uint32 *stat_counter_id);
    378 
    379 #endif /* BCM_HIDE_DISPATCHABLE */
    380 
    381 /* FCOE VSAN VFT object */
    382 typedef struct bcm_fcoe_vsan_vft_s {
    383     uint8 r_ctl; 
    384     uint8 version; 
    385     uint8 type; 
    386     uint8 hop_count; 
    387 } bcm_fcoe_vsan_vft_t;
    388 
    389 /* FCOE Interface VSAN ID source */
    390 typedef enum bcm_fcoe_intf_vsan_id_source_e {
    391     bcmFcoeIntfVsanSet = 0,         /* Get VSAN ID from table entry */
    392     bcmFcoeIntfVsanInternal = 1,    /* Get VSAN ID from internal VSAN ID */
    393     bcmFcoeIntfVsanInnerVlan = 2,   /* Get VSAN ID from internal ITAG */
    394     bcmFcoeIntfVsanOuterVlan = 3    /* Get VSAN ID from internal OVID */
    395 } bcm_fcoe_intf_vsan_id_source_t;
    396 
    397 /* FCOE Interface VSAN Priority source */
    398 typedef enum bcm_fcoe_intf_vsan_pri_source_e {
    399     bcmFcoeIntfVsanPriSet = 0,      /* Use VSAN PRI from table entry */
    400     bcmFcoeIntfVsanPriInternal = 1, /* Get VSAN PRI from internal VSAN PRI */
    401     bcmFcoeIntfVsanPriRemark = 2    /* Get VSAN PRI from internal PRI */
    402 } bcm_fcoe_intf_vsan_pri_source_t;
    403 
    404 /* FCOE interface configuration parameters */
    405 typedef struct bcm_fcoe_intf_config_s {
    406     uint32 flags; 
    407     int qos_map_id; 
    408     bcm_fcoe_vsan_id_t vsan; 
    409     uint8 vsan_pri; 
    410     bcm_fcoe_vsan_vft_t vft; 
    411     bcm_fcoe_intf_vsan_id_source_t vsan_source; 
    412     bcm_fcoe_intf_vsan_pri_source_t vsan_pri_source; 
    413 } bcm_fcoe_intf_config_t;
    414 
    415 #define BCM_FCOE_INTF_VFT_DO_NOT_MODIFY 0x00000001 /* Do not modify any existing
    416                                                       VFT header */
    417 #define BCM_FCOE_INTF_VFT_ADD_REPLACE   0x00000002 /* Add or replace VFT header */
    418 #define BCM_FCOE_INTF_VFT_DELETE        0x00000004 /* Delete VFT header if
    419                                                       present */
    420 
    421 #ifndef BCM_HIDE_DISPATCHABLE
    422 
    423 /* Set parameters for FCOE L3 interface */
    424 extern int bcm_fcoe_intf_config_set(
    425     int unit, 
    426     uint32 flags, 
    427     bcm_if_t intf, 
    428     bcm_fcoe_intf_config_t *cfg);
    429 
    430 /* Get parameters for FCOE L3 interface */
    431 extern int bcm_fcoe_intf_config_get(
    432     int unit, 
    433     uint32 flags, 
    434     bcm_if_t intf, 
    435     bcm_fcoe_intf_config_t *cfg);
    436 
    437 #endif /* BCM_HIDE_DISPATCHABLE */
    438 
    439 /* FCOE VSAN Translation actions */
    440 typedef enum bcm_fcoe_vsan_action_e {
    441     bcmFcoeVsanActionNone = 0,      /* Do not modify */
    442     bcmFcoeVsanActionInnerVlan = 1, /* Use Inner Vlan's value */
    443     bcmFcoeVsanActionOuterVlan = 2, /* Use Outer Vlan's value */
    444     bcmFcoeVsanActionReplace = 3,   /* Replace with specified value */
    445     bcmFcoeVsanActionDelete = 4,    /* Delete */
    446     bcmFcoeVsanActionInternal = 5,  /* Replace with Internal value */
    447     bcmFcoeVsanActionCount = 6 
    448 } bcm_fcoe_vsan_action_t;
    449 
    450 /* FCOE VSAN Translate Key types */
    451 typedef enum bcm_fcoe_vsan_translate_key_e {
    452     bcmFcoeVsanTranslateKeyInvalid = -1, /* Invalid Key Type */
    453     bcmFcoeVsanTranslateKeyDoubleVsan = 0, /* Use I-VID[11:0],O-VID[11:0] and
    454                                            VSAN-ID[11:0] */
    455     bcmFcoeVsanTranslateKeyInnerVsan = 1, /* Use I-VID[11:0] and VSAN-ID[11:0] */
    456     bcmFcoeVsanTranslateKeyOuterVsan = 2, /* Use O-VID[11:0] and VSAN-ID[11:0] */
    457     bcmFcoeVsanTranslateKeyDouble = 3,  /* Use O-VID[11:0] and I-VID[11:0] */
    458     bcmFcoeVsanTranslateKeyOuter = 4,   /* Use O-VID[11:0] */
    459     bcmFcoeVsanTranslateKeyInner = 5,   /* Use I-VID[11:0] */
    460     bcmFcoeVsanTranslateKeyOuterTag = 6, /* Use O-TAG[15:0] */
    461     bcmFcoeVsanTranslateKeyInnerTag = 7, /* Use I-TAG[15:0] */
    462     bcmFcoeVsanTranslateKeyOuterPri = 8, /* Use (VLAN-PRI, VLAN-CFI of O-TAG) */
    463     bcmFcoeVsanTranslateKeyPortDouble = 9, /* Use Port, O-VID[11:0] and I-VID[11:0] */
    464     bcmFcoeVsanTranslateKeyPortOuter = 10, /* Use Port, O-VID[11:0] */
    465     bcmFcoeVsanTranslateKeyPortInner = 11, /* Use Port, I-VID[11:0] */
    466     bcmFcoeVsanTranslateKeyPortOuterTag = 12, /* Use Port, O-TAG[15:0] */
    467     bcmFcoeVsanTranslateKeyPortInnerTag = 13, /* Use Port, I-TAG[15:0] */
    468     bcmFcoeVsanTranslateKeyPortOuterPri = 14, /* Use Port, (VLAN-PRI, VLAN-CFI of
    469                                            O-TAG) */
    470     bcmFcoeVsanTranslateKeyPortDoubleVsan = 15, /* Use Port, I-VID[11:0],O-VID[11:0] and
    471                                            VSAN-ID[11:0] */
    472     bcmFcoeVsanTranslateKeyPortInnerVsan = 16, /* Use Port, I-VID[11:0] and
    473                                            VSAN-ID[11:0] */
    474     bcmFcoeVsanTranslateKeyPortOuterVsan = 17 /* Use Port, O-VID[11:0] and
    475                                            VSAN-ID[11:0] */
    476 } bcm_fcoe_vsan_translate_key_t;
    477 
    478 /* FCOE VSAN Translate Key types */
    479 typedef enum bcm_fcoe_vsan_translate_key_egress_e {
    480     bcmFcoeVsanTranslateKeyEgressInvalid = -1, /* Invalid Key Type */
    481     bcmFcoeVsanTranslateKeyEgressDoubleVsan = 0, /* Use I-VID[11:0],O-VID[11:0] and
    482                                            VSAN-ID[11:0] */
    483     bcmFcoeVsanTranslateKeyEgressVsan = 1, /* Use VSAN-ID[11:0] */
    484     bcmFcoeVsanTranslateKeyEgressInnerVsan = 2, /* Use I-VID[11:0] and VSAN-ID[11:0] */
    485     bcmFcoeVsanTranslateKeyEgressOuterVsan = 3, /* Use O-VID[11:0] and VSAN-ID[11:0] */
    486     bcmFcoeVsanTranslateKeyEgressDouble = 4, /* Use O-VID[11:0] and I-VID[11:0] */
    487     bcmFcoeVsanTranslateKeyEgressInner = 5, /* Use I-VID[11:0] */
    488     bcmFcoeVsanTranslateKeyEgressOuter = 6 /* Use O-VID[11:0] */
    489 } bcm_fcoe_vsan_translate_key_egress_t;
    490 
    491 /* Translate Key Configuration. */
    492 typedef struct bcm_fcoe_vsan_translate_key_config_s {
    493     uint32 flags; 
    494     bcm_fcoe_vsan_translate_key_t key_type; 
    495     bcm_vlan_t inner_vlan;              /* Inner Vlan ID to match on */
    496     bcm_vlan_t outer_vlan;              /* Outer Vlan ID to match on */
    497     bcm_fcoe_vsan_id_t vsan;            /* VFT VSAN ID to match on */
    498     bcm_gport_t port;                   /* Port to match on */
    499 } bcm_fcoe_vsan_translate_key_config_t;
    500 
    501 #define BCM_FCOE_VSAN_ACTION_INGRESS    0x00000001 /* Translate at ingress */
    502 #define BCM_FCOE_VSAN_ACTION_EGRESS     0x00000002 /* Translate at egress */
    503 #define BCM_FCOE_VSAN_ACTION_VFT_NONE   0x00000004 /* Indicates no VFT tag is
    504                                                       present */
    505 
    506 /* VLAN/VSAN Translation Action Set. */
    507 typedef struct bcm_fcoe_vsan_action_set_s {
    508     uint32 flags;                       /* BCM_FCOE_VSAN_ACTION_* */
    509     bcm_fcoe_vsan_id_t new_vsan;        /* new VSAN ID to replace with */
    510     uint8 new_vsan_pri;                 /* new VSAN priority to replace with */
    511     bcm_fcoe_vsan_vft_t vft;            /* remaining fields of VFT header */
    512     bcm_if_t ingress_if;                /* TBD */
    513     bcm_fcoe_vsan_action_t dt_vsan;     /* Vsan action when double tagged */
    514     bcm_fcoe_vsan_action_t dt_vsan_pri; /* VSAN Priority action when double
    515                                            tagged */
    516     bcm_fcoe_vsan_action_t it_vsan;     /* Vsan action when single inner tagged */
    517     bcm_fcoe_vsan_action_t it_vsan_pri; /* Vsan Priority action when single
    518                                            inner tagged */
    519     bcm_fcoe_vsan_action_t ot_vsan;     /* Vsan action when single outer tagged */
    520     bcm_fcoe_vsan_action_t ot_vsan_pri; /* Vsan Priority action when single
    521                                            outer tagged */
    522     bcm_fcoe_vsan_action_t ut_vsan;     /* Vsan action when un-tagged */
    523     bcm_fcoe_vsan_action_t ut_vsan_pri; /* Vsan Priority action when un-tagged */
    524     bcm_vlan_action_set_t vlan_action;  /* VLAN actions */
    525 } bcm_fcoe_vsan_action_set_t;
    526 
    527 #ifndef BCM_HIDE_DISPATCHABLE
    528 
    529 /* Add VSAN translation action */
    530 extern int bcm_fcoe_vsan_translate_action_add(
    531     int unit, 
    532     bcm_fcoe_vsan_translate_key_config_t *key, 
    533     bcm_fcoe_vsan_action_set_t *action);
    534 
    535 /* Delete VSAN translation action */
    536 extern int bcm_fcoe_vsan_translate_action_delete(
    537     int unit, 
    538     bcm_fcoe_vsan_translate_key_config_t *key);
    539 
    540 #endif /* BCM_HIDE_DISPATCHABLE */
    541 
    542 /* Initialize bcm_fcoe_intf_config_t */
    543 extern void bcm_fcoe_intf_config_t_init(
    544     bcm_fcoe_intf_config_t *intf);
    545 
    546 /* Initialize bcm_fcoe_vsan_vft_t */
    547 extern void bcm_fcoe_vsan_vft_t_init(
    548     bcm_fcoe_vsan_vft_t *vft);
    549 
    550 /* Initialize bcm_vsan_translate_key_config_t */
    551 extern void bcm_fcoe_vsan_translate_key_config_t_init(
    552     bcm_fcoe_vsan_translate_key_config_t *key_config);
    553 
    554 /* Initialize bcm_vsan_action_set_t */
    555 extern void bcm_fcoe_vsan_action_set_t_init(
    556     bcm_fcoe_vsan_action_set_t *action_set);
    557 
    558 /* bcm_fcoe_zone_traverse_cb */
    559 typedef int (*bcm_fcoe_zone_traverse_cb)(
    560     int unit, 
    561     bcm_fcoe_zone_entry_t *zone, 
    562     void *user_data);
    563 
    564 /* bcm_fcoe_vsan_traverse_cb */
    565 typedef int (*bcm_fcoe_vsan_traverse_cb)(
    566     int unit, 
    567     bcm_fcoe_vsan_id_t vsan_id, 
    568     bcm_fcoe_vsan_t *vsan, 
    569     void *user_data);
    570 
    571 /* bcm_fcoe_route_traverse_cb */
    572 typedef int (*bcm_fcoe_route_traverse_cb)(
    573     int unit, 
    574     bcm_fcoe_route_t *route, 
    575     void *user_data);
    576 
    577 #ifndef BCM_HIDE_DISPATCHABLE
    578 
    579 /* traverse fcoe zone entry and call callback function */
    580 extern int bcm_fcoe_zone_traverse(
    581     int unit, 
    582     uint32 flags, 
    583     bcm_fcoe_zone_traverse_cb trav_fn, 
    584     void *user_data);
    585 
    586 /* traverse fcoe vsan entry and call callback function */
    587 extern int bcm_fcoe_vsan_traverse(
    588     int unit, 
    589     uint32 flags, 
    590     bcm_fcoe_vsan_traverse_cb trav_fn, 
    591     void *user_data);
    592 
    593 /* traverse fcoe route entry and call callback function */
    594 extern int bcm_fcoe_route_traverse(
    595     int unit, 
    596     uint32 flags, 
    597     bcm_fcoe_route_traverse_cb trav_fn, 
    598     void *user_data);
    599 
    600 #endif /* BCM_HIDE_DISPATCHABLE */
    601 
    602 #endif /* __BCM_FCOE_H__ */