1316485Sdavidcs/* 2316485Sdavidcs * Copyright (c) 2017-2018 Cavium, Inc. 3316485Sdavidcs * All rights reserved. 4316485Sdavidcs * 5316485Sdavidcs * Redistribution and use in source and binary forms, with or without 6316485Sdavidcs * modification, are permitted provided that the following conditions 7316485Sdavidcs * are met: 8316485Sdavidcs * 9316485Sdavidcs * 1. Redistributions of source code must retain the above copyright 10316485Sdavidcs * notice, this list of conditions and the following disclaimer. 11316485Sdavidcs * 2. Redistributions in binary form must reproduce the above copyright 12316485Sdavidcs * notice, this list of conditions and the following disclaimer in the 13316485Sdavidcs * documentation and/or other materials provided with the distribution. 14316485Sdavidcs * 15316485Sdavidcs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16316485Sdavidcs * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17316485Sdavidcs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18316485Sdavidcs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 19316485Sdavidcs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20316485Sdavidcs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21316485Sdavidcs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22316485Sdavidcs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23316485Sdavidcs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24316485Sdavidcs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25316485Sdavidcs * POSSIBILITY OF SUCH DAMAGE. 26316485Sdavidcs * 27316485Sdavidcs * $FreeBSD: stable/11/sys/dev/qlnx/qlnxe/ecore_dcbx.h 337517 2018-08-09 01:17:35Z davidcs $ 28316485Sdavidcs * 29316485Sdavidcs */ 30316485Sdavidcs 31316485Sdavidcs#ifndef __ECORE_DCBX_H__ 32316485Sdavidcs#define __ECORE_DCBX_H__ 33316485Sdavidcs 34316485Sdavidcs#include "ecore.h" 35316485Sdavidcs#include "ecore_mcp.h" 36316485Sdavidcs#include "mcp_public.h" 37316485Sdavidcs#include "reg_addr.h" 38316485Sdavidcs#include "ecore_hw.h" 39316485Sdavidcs#include "ecore_hsi_common.h" 40316485Sdavidcs#include "ecore_dcbx_api.h" 41316485Sdavidcs 42337517Sdavidcs#define ECORE_DCBX_DSCP_DISABLED 0XFF 43337517Sdavidcs 44316485Sdavidcsstruct ecore_dcbx_info { 45316485Sdavidcs struct lldp_status_params_s lldp_remote[LLDP_MAX_LLDP_AGENTS]; 46316485Sdavidcs struct lldp_config_params_s lldp_local[LLDP_MAX_LLDP_AGENTS]; 47316485Sdavidcs struct dcbx_local_params local_admin; 48316485Sdavidcs struct ecore_dcbx_results results; 49316485Sdavidcs struct dcb_dscp_map dscp_map; 50316485Sdavidcs bool dscp_nig_update; 51316485Sdavidcs struct dcbx_mib operational; 52316485Sdavidcs struct dcbx_mib remote; 53316485Sdavidcs struct ecore_dcbx_set set; 54316485Sdavidcs struct ecore_dcbx_get get; 55316485Sdavidcs u8 dcbx_cap; 56316485Sdavidcs u16 iwarp_port; 57316485Sdavidcs}; 58316485Sdavidcs 59316485Sdavidcsstruct ecore_dcbx_mib_meta_data { 60316485Sdavidcs struct lldp_config_params_s *lldp_local; 61316485Sdavidcs struct lldp_status_params_s *lldp_remote; 62337517Sdavidcs struct lldp_received_tlvs_s *lldp_tlvs; 63316485Sdavidcs struct dcbx_local_params *local_admin; 64316485Sdavidcs struct dcb_dscp_map *dscp_map; 65316485Sdavidcs struct dcbx_mib *mib; 66316485Sdavidcs osal_size_t size; 67316485Sdavidcs u32 addr; 68316485Sdavidcs}; 69316485Sdavidcs 70316485Sdavidcs/* ECORE local interface routines */ 71316485Sdavidcsenum _ecore_status_t 72337517Sdavidcsecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 73337517Sdavidcs enum ecore_mib_read_type type); 74316485Sdavidcs 75316485Sdavidcsenum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn); 76337517Sdavidcsvoid ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn); 77316485Sdavidcsvoid ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src, 78316485Sdavidcs struct pf_update_ramrod_data *p_dest); 79316485Sdavidcs 80337517Sdavidcs/* Returns TOS value for a given priority */ 81337517Sdavidcsu8 ecore_dcbx_get_dscp_value(struct ecore_hwfn *p_hwfn, u8 pri); 82337517Sdavidcs 83337517Sdavidcsenum _ecore_status_t 84337517Sdavidcsecore_lldp_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); 85337517Sdavidcs 86316485Sdavidcs#endif /* __ECORE_DCBX_H__ */ 87