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

eav.h (3862B)


      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  */
      9 
     10 #ifndef __BCM_EAV_H__
     11 #define __BCM_EAV_H__
     12 
     13 #include <bcm/types.h>
     14 #include <bcm/port.h>
     15 
     16 /* bcm_eav_control_e */
     17 typedef enum bcm_eav_control_e {
     18     bcmEAVControlTimeBase = 1, 
     19     bcmEAVControlTimeAdjust = 2, 
     20     bcmEAVControlStreamClassAPCP = 7, 
     21     bcmEAVControlStreamClassBPCP = 8 
     22 } bcm_eav_control_t;
     23 
     24 #define BCM_EAV_TIMEREF_MODE_FREERUN        0x0        
     25 #define BCM_EAV_TIMEREF_MODE_PHASE_ADJUSTMENT 0x1        
     26 #define BCM_EAV_TIMEREF_MODE_FREQ_ADJUMENT1 0x2        
     27 #define BCM_EAV_TIMEREF_MODE_FREQ_ADJUMENT2 0x3        
     28 
     29 /* bcm_eav_stream_class_e */
     30 typedef enum bcm_eav_stream_class_e {
     31     bcmEAVCStreamClassA = 0, 
     32     bcmEAVCStreamClassB = 1 
     33 } bcm_eav_stream_class_t;
     34 
     35 #ifndef BCM_HIDE_DISPATCHABLE
     36 
     37 /* Initialize the Ethernet AV module and enable the EAV support globally. */
     38 extern int bcm_eav_init(
     39     int unit);
     40 
     41 /* Enable or disable EAV processing on a port */
     42 extern int bcm_eav_port_enable_get(
     43     int unit, 
     44     bcm_port_t port, 
     45     int *enable);
     46 
     47 /* Enable or disable EAV processing on a port */
     48 extern int bcm_eav_port_enable_set(
     49     int unit, 
     50     bcm_port_t port, 
     51     int enable);
     52 
     53 /* Get the EAV link status of the specified port. */
     54 extern int bcm_eav_link_status_get(
     55     int unit, 
     56     bcm_port_t port, 
     57     int *link);
     58 
     59 /* Set the EAV link status of the specified port */
     60 extern int bcm_eav_link_status_set(
     61     int unit, 
     62     bcm_port_t port, 
     63     int link);
     64 
     65 /* Configure EAV operating modes. */
     66 extern int bcm_eav_control_get(
     67     int unit, 
     68     bcm_eav_control_t type, 
     69     uint32 *arg, 
     70     uint32 *arg2);
     71 
     72 /* Configure EAV operating modes. */
     73 extern int bcm_eav_control_set(
     74     int unit, 
     75     bcm_eav_control_t type, 
     76     uint32 arg, 
     77     uint32 arg2);
     78 
     79 /* 
     80  * Get the timestamp value of the last egressed packet on the specified
     81  * port.
     82  */
     83 extern int bcm_eav_timestamp_get(
     84     int unit, 
     85     bcm_port_t port, 
     86     uint32 *timestamp);
     87 
     88 /* 
     89  * Manage the MAC address for the Time Synchronization protocol.
     90  * Get the destination MAC address for the Time Synchronization protocol.
     91  */
     92 extern int bcm_eav_timesync_mac_set(
     93     int unit, 
     94     bcm_mac_t eav_mac);
     95 
     96 /* 
     97  * Manage the MAC address for the Time Synchronization protocol.
     98  * Get the destination MAC address for the Time Synchronization protocol.
     99  */
    100 extern int bcm_eav_timesync_mac_get(
    101     int unit, 
    102     bcm_mac_t eav_mac);
    103 
    104 /* 
    105  * Manage the MAC address and EtherType used to trap SRP protocol
    106  * packets.
    107  */
    108 extern int bcm_eav_srp_mac_ethertype_set(
    109     int unit, 
    110     bcm_mac_t mac, 
    111     bcm_port_ethertype_t ethertype);
    112 
    113 /* 
    114  * Manage the MAC address and EtherType used to trap SRP protocol
    115  * packets.
    116  */
    117 extern int bcm_eav_srp_mac_ethertype_get(
    118     int unit, 
    119     bcm_mac_t mac, 
    120     bcm_port_ethertype_t *ethertype);
    121 
    122 /* Manage the PCP(priority) value mapping for each EAV class packets. */
    123 extern int bcm_eav_pcp_mapping_set(
    124     int unit, 
    125     bcm_eav_stream_class_t type, 
    126     int pcp, 
    127     int remapped_pcp);
    128 
    129 /* Manage the PCP(priority) value mapping for each EAV class packets. */
    130 extern int bcm_eav_pcp_mapping_get(
    131     int unit, 
    132     bcm_eav_stream_class_t type, 
    133     int *pcp, 
    134     int *remapped_pcp);
    135 
    136 /* Manage the reserved bandwidth for Class A or B stream traffic */
    137 extern int bcm_eav_bandwidth_set(
    138     int unit, 
    139     bcm_port_t port, 
    140     bcm_eav_stream_class_t type, 
    141     uint32 bytes_sec, 
    142     uint32 bytes_burst);
    143 
    144 /* Manage the reserved bandwidth for Class A or B stream traffic */
    145 extern int bcm_eav_bandwidth_get(
    146     int unit, 
    147     bcm_port_t port, 
    148     bcm_eav_stream_class_t type, 
    149     uint32 *bytes_sec, 
    150     uint32 *bytes_burst);
    151 
    152 #endif /* BCM_HIDE_DISPATCHABLE */
    153 
    154 #endif /* __BCM_EAV_H__ */