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_fcoe.h 337517 2018-08-09 01:17:35Z davidcs $ 28316485Sdavidcs * 29316485Sdavidcs */ 30316485Sdavidcs 31316485Sdavidcs#ifndef __ECORE_FCOE_H__ 32316485Sdavidcs#define __ECORE_FCOE_H__ 33316485Sdavidcs 34316485Sdavidcs#include "ecore.h" 35316485Sdavidcs#include "ecore_chain.h" 36316485Sdavidcs#include "ecore_hsi_common.h" 37316485Sdavidcs#include "ecore_hsi_fcoe.h" 38316485Sdavidcs#include "ecore_fcoe_api.h" 39316485Sdavidcs 40316485Sdavidcsstruct ecore_fcoe_info { 41316485Sdavidcs osal_spinlock_t lock; 42316485Sdavidcs osal_list_t free_list; 43316485Sdavidcs}; 44316485Sdavidcs 45337517Sdavidcs#ifdef CONFIG_ECORE_FCOE 46316485Sdavidcsenum _ecore_status_t ecore_fcoe_alloc(struct ecore_hwfn *p_hwfn); 47316485Sdavidcs 48316485Sdavidcsvoid ecore_fcoe_setup(struct ecore_hwfn *p_hwfn); 49316485Sdavidcs 50316485Sdavidcsvoid ecore_fcoe_free(struct ecore_hwfn *p_hwfn); 51337517Sdavidcs#else 52337517Sdavidcsstatic inline enum _ecore_status_t ecore_fcoe_alloc(struct ecore_hwfn OSAL_UNUSED *p_hwfn) 53337517Sdavidcs{ 54337517Sdavidcs return ECORE_INVAL; 55337517Sdavidcs} 56316485Sdavidcs 57337517Sdavidcsstatic inline void ecore_fcoe_setup(struct ecore_hwfn OSAL_UNUSED *p_hwfn) {} 58337517Sdavidcs 59337517Sdavidcsstatic inline void ecore_fcoe_free(struct ecore_hwfn OSAL_UNUSED *p_hwfn) {} 60337517Sdavidcs#endif 61337517Sdavidcs 62337517Sdavidcs#ifndef __EXTRACT__LINUX__THROW__ 63316485Sdavidcsenum _ecore_status_t 64316485Sdavidcsecore_sp_fcoe_conn_offload(struct ecore_hwfn *p_hwfn, 65316485Sdavidcs struct ecore_fcoe_conn *p_conn, 66316485Sdavidcs enum spq_mode comp_mode, 67316485Sdavidcs struct ecore_spq_comp_cb *p_comp_addr); 68316485Sdavidcs 69316485Sdavidcsenum _ecore_status_t 70316485Sdavidcsecore_sp_fcoe_conn_destroy(struct ecore_hwfn *p_hwfn, 71316485Sdavidcs struct ecore_fcoe_conn *p_conn, 72316485Sdavidcs enum spq_mode comp_mode, 73316485Sdavidcs struct ecore_spq_comp_cb *p_comp_addr); 74337517Sdavidcs#endif 75316485Sdavidcs 76316485Sdavidcs#endif /*__ECORE_FCOE_H__*/ 77316485Sdavidcs 78