1*3126df22SRasesh Mody /* SPDX-License-Identifier: BSD-3-Clause 29adde217SRasesh Mody * Copyright (c) 2016 - 2018 Cavium Inc. 326ae839dSRasesh Mody * All rights reserved. 49adde217SRasesh Mody * www.cavium.com 526ae839dSRasesh Mody */ 626ae839dSRasesh Mody 726ae839dSRasesh Mody #ifndef __ECORE_DCBX_H__ 826ae839dSRasesh Mody #define __ECORE_DCBX_H__ 926ae839dSRasesh Mody 1026ae839dSRasesh Mody #include "ecore.h" 1126ae839dSRasesh Mody #include "ecore_mcp.h" 1226ae839dSRasesh Mody #include "mcp_public.h" 1326ae839dSRasesh Mody #include "reg_addr.h" 1426ae839dSRasesh Mody #include "ecore_hw.h" 1526ae839dSRasesh Mody #include "ecore_hsi_common.h" 1626ae839dSRasesh Mody #include "ecore_dcbx_api.h" 1726ae839dSRasesh Mody 1813c0ec8aSRasesh Mody #define ECORE_DCBX_DSCP_DISABLED 0XFF 1913c0ec8aSRasesh Mody 2026ae839dSRasesh Mody struct ecore_dcbx_info { 2126ae839dSRasesh Mody struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS]; 2226ae839dSRasesh Mody struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS]; 2326ae839dSRasesh Mody struct dcbx_local_params local_admin; 2426ae839dSRasesh Mody struct ecore_dcbx_results results; 2522d07d93SRasesh Mody struct dcb_dscp_map dscp_map; 2622d07d93SRasesh Mody bool dscp_nig_update; 2726ae839dSRasesh Mody struct dcbx_mib operational; 2826ae839dSRasesh Mody struct dcbx_mib remote; 2926ae839dSRasesh Mody struct ecore_dcbx_set set; 3026ae839dSRasesh Mody struct ecore_dcbx_get get; 3126ae839dSRasesh Mody u8 dcbx_cap; 322e2680e0SRasesh Mody u16 iwarp_port; 3326ae839dSRasesh Mody }; 3426ae839dSRasesh Mody 3522d07d93SRasesh Mody struct ecore_dcbx_mib_meta_data { 3622d07d93SRasesh Mody struct lldp_config_params_s *lldp_local; 3722d07d93SRasesh Mody struct lldp_status_params_s *lldp_remote; 3881dba2b2SRasesh Mody struct lldp_received_tlvs_s *lldp_tlvs; 3922d07d93SRasesh Mody struct dcbx_local_params *local_admin; 4022d07d93SRasesh Mody struct dcb_dscp_map *dscp_map; 4122d07d93SRasesh Mody struct dcbx_mib *mib; 4222d07d93SRasesh Mody osal_size_t size; 4322d07d93SRasesh Mody u32 addr; 4422d07d93SRasesh Mody }; 4526ae839dSRasesh Mody 4626ae839dSRasesh Mody /* ECORE local interface routines */ 4726ae839dSRasesh Mody enum _ecore_status_t 4826ae839dSRasesh Mody ecore_dcbx_mib_update_event(struct ecore_hwfn *, struct ecore_ptt *, 4926ae839dSRasesh Mody enum ecore_mib_read_type); 5026ae839dSRasesh Mody 5126ae839dSRasesh Mody enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn); 525f4504bfSRasesh Mody void ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn); 5326ae839dSRasesh Mody void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src, 5426ae839dSRasesh Mody struct pf_update_ramrod_data *p_dest); 5522d07d93SRasesh Mody 5613c0ec8aSRasesh Mody /* Returns TOS value for a given priority */ 5713c0ec8aSRasesh Mody u8 ecore_dcbx_get_dscp_value(struct ecore_hwfn *p_hwfn, u8 pri); 5813c0ec8aSRasesh Mody 5981dba2b2SRasesh Mody enum _ecore_status_t 6081dba2b2SRasesh Mody ecore_lldp_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); 6181dba2b2SRasesh Mody 6226ae839dSRasesh Mody #endif /* __ECORE_DCBX_H__ */ 63