@@ -1813,14 +1813,141 @@ typedef enum _sai_object_stage_t
18131813typedef enum _sai_health_data_type_t
18141814{
18151815 /** General health data type */
1816- SAI_HEALTH_DATA_TYPE_GENERAL
1816+ SAI_HEALTH_DATA_TYPE_GENERAL ,
1817+
1818+ /** SER health data type */
1819+ SAI_HEALTH_DATA_TYPE_SER
18171820} sai_health_data_type_t ;
18181821
1822+ typedef enum _sai_ser_type_t
1823+ {
1824+ /**
1825+ * @brief Unknown error type
1826+ */
1827+ SAI_SER_TYPE_UNKNOWN = 0 ,
1828+
1829+ /**
1830+ * @brief Parity error
1831+ */
1832+ SAI_SER_TYPE_PARITY = 1 ,
1833+
1834+ /**
1835+ * @brief ECC single bit error
1836+ */
1837+ SAI_SER_TYPE_ECC_SINGLE_BIT = 2 ,
1838+
1839+ /**
1840+ * @brief ECC double bit error
1841+ */
1842+ SAI_SER_TYPE_ECC_DOUBLE_BIT = 3 ,
1843+ } sai_ser_type_t ;
1844+
1845+ typedef enum _sai_ser_correction_type_t
1846+ {
1847+ /**
1848+ * @brief SW takes no action when error happens
1849+ */
1850+ SAI_SER_CORRECTION_TYPE_NO_ACTION = 0 ,
1851+
1852+ /**
1853+ * @brief SW tries to correct but fails
1854+ */
1855+ SAI_SER_CORRECTION_TYPE_FAIL_TO_CORRECT = 1 ,
1856+
1857+ /**
1858+ * @brief SW writes NULL entry to clear the error
1859+ */
1860+ SAI_SER_CORRECTION_TYPE_ENTRY_CLEAR = 2 ,
1861+
1862+ /**
1863+ * @brief Restore entry from SW cache
1864+ */
1865+ SAI_SER_CORRECTION_TYPE_SW_CACHE_RESTORE = 3 ,
1866+
1867+ /**
1868+ * @brief Restore entry from HW cache
1869+ */
1870+ SAI_SER_CORRECTION_TYPE_HW_CACHE_RESTORE = 4 ,
1871+
1872+ /**
1873+ * @brief Memory needs special correction handling
1874+ */
1875+ SAI_SER_CORRECTION_TYPE_SPECIAL = 5 ,
1876+ } sai_ser_correction_type_t ;
1877+
1878+ /**
1879+ * @brief SAI SER log information type
1880+ *
1881+ * @flags strict
1882+ */
1883+ typedef enum _sai_ser_log_type_t
1884+ {
1885+ /**
1886+ * @brief Error happens on memory
1887+ */
1888+ SAI_SER_LOG_TYPE_MEM = 1 << 0 ,
1889+
1890+ /**
1891+ * @brief Error happens on register
1892+ */
1893+ SAI_SER_LOG_TYPE_REG = 1 << 1 ,
1894+
1895+ /**
1896+ * @brief Parity errors detected more than once
1897+ */
1898+ SAI_SER_LOG_TYPE_MULTI = 1 << 2 ,
1899+
1900+ /**
1901+ * @brief Error corrected by SW
1902+ */
1903+ SAI_SER_LOG_TYPE_CORRECTED = 1 << 3 ,
1904+
1905+ /**
1906+ * @brief Restore entry from HW cache
1907+ */
1908+ SAI_SER_LOG_TYPE_ENTRY_INFO = 1 << 4 ,
1909+
1910+ /**
1911+ * @brief Cache data is valid
1912+ */
1913+ SAI_SER_LOG_TYPE_CACHE = 1 << 5 ,
1914+ } sai_ser_log_type_t ;
1915+
1916+ typedef struct _sai_ser_health_data_t
1917+ {
1918+ /** SER type specific fields */
1919+ sai_ser_type_t type ;
1920+
1921+ /** SER correction type specific fields */
1922+ sai_ser_correction_type_t correction_type ;
1923+
1924+ /**
1925+ * @brief SER correction log info (sai_ser_log_type_t)
1926+ *
1927+ * For example, if entry info is present and is coming from cache
1928+ * SAI_SER_LOG_TYPE_ENTRY_INFO | SAI_SER_LOG_TYPE_CACHE
1929+ *
1930+ * @flags sai_ser_log_type_t
1931+ */
1932+ uint32_t ser_log_type ;
1933+ } sai_ser_health_data_t ;
1934+
1935+ /**
1936+ * @extraparam sai_health_data_type_t data_type
1937+ */
1938+ typedef union _sai_health_data_t
1939+ {
1940+ /** @validonly data_type == SAI_HEALTH_DATA_TYPE_SER */
1941+ sai_ser_health_data_t ser ;
1942+ } sai_health_data_t ;
1943+
18191944typedef struct _sai_switch_health_data_t
18201945{
18211946 /** Type of switch health data */
18221947 sai_health_data_type_t data_type ;
18231948
1949+ /** @passparam data_type */
1950+ sai_health_data_t data ;
18241951} sai_switch_health_data_t ;
18251952
18261953/**
0 commit comments