1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2014-2021 Broadcom 3 * All rights reserved. 4 */ 5 6 #ifndef _ULP_HA_MGR_H_ 7 #define _ULP_HA_MGR_H_ 8 9 #include "bnxt_ulp.h" 10 11 enum ulp_ha_mgr_state { 12 ULP_HA_STATE_INIT, 13 ULP_HA_STATE_PRIM_RUN, 14 ULP_HA_STATE_PRIM_SEC_RUN, 15 ULP_HA_STATE_SEC_TIMER_COPY, 16 ULP_HA_PRIM_CLOSE 17 }; 18 19 enum ulp_ha_mgr_app_type { 20 ULP_HA_APP_TYPE_NONE, 21 ULP_HA_APP_TYPE_PRIM, 22 ULP_HA_APP_TYPE_SEC 23 }; 24 25 enum ulp_ha_mgr_region { 26 ULP_HA_REGION_LOW, 27 ULP_HA_REGION_HI 28 }; 29 30 struct bnxt_ulp_ha_mgr_info { 31 enum ulp_ha_mgr_app_type app_type; 32 enum ulp_ha_mgr_region region; 33 uint32_t flags; 34 pthread_mutex_t ha_lock; 35 }; 36 37 bool 38 ulp_ha_mgr_is_enabled(struct bnxt_ulp_context *ulp_ctx); 39 40 int32_t 41 ulp_ha_mgr_enable(struct bnxt_ulp_context *ulp_ctx); 42 43 int32_t 44 ulp_ha_mgr_init(struct bnxt_ulp_context *ulp_ctx); 45 46 void 47 ulp_ha_mgr_deinit(struct bnxt_ulp_context *ulp_ctx); 48 49 int32_t 50 ulp_ha_mgr_app_type_get(struct bnxt_ulp_context *ulp_ctx, 51 enum ulp_ha_mgr_app_type *app_type); 52 53 int32_t 54 ulp_ha_mgr_state_get(struct bnxt_ulp_context *ulp_ctx, 55 enum ulp_ha_mgr_state *state); 56 57 int32_t 58 ulp_ha_mgr_open(struct bnxt_ulp_context *ulp_ctx); 59 60 int32_t 61 ulp_ha_mgr_close(struct bnxt_ulp_context *ulp_ctx); 62 63 int32_t 64 ulp_ha_mgr_region_get(struct bnxt_ulp_context *ulp_ctx, 65 enum ulp_ha_mgr_region *region); 66 67 #endif /* _ULP_HA_MGR_H_*/ 68