X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnx2x%2Fecore_sp.h;h=f295bf5af5e56195dd44a79177bf8d15d240e200;hb=a9ba50efbdf44881ee820c5e8434b263e1fdbf9a;hp=2a7545edc4f6fae6e6c340c3c5db4ff681ed7879;hpb=b5bf7719221dc43bb95833877dcc821655dccf03;p=dpdk.git diff --git a/drivers/net/bnx2x/ecore_sp.h b/drivers/net/bnx2x/ecore_sp.h index 2a7545edc4..f295bf5af5 100644 --- a/drivers/net/bnx2x/ecore_sp.h +++ b/drivers/net/bnx2x/ecore_sp.h @@ -1,59 +1,30 @@ -/*- - * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2007-2013 Broadcom Corporation. * * Eric Davis * David Christensen * Gary Zambrano * * Copyright (c) 2013-2015 Brocade Communications Systems, Inc. + * Copyright (c) 2015-2018 Cavium Inc. * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. + * www.cavium.com */ #ifndef ECORE_SP_H #define ECORE_SP_H -#if __BYTE_ORDER == __LITTLE_ENDIAN -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN -#endif +#include + +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN #ifndef __LITTLE_ENDIAN -#define __LITTLE_ENDIAN +#define __LITTLE_ENDIAN RTE_LITTLE_ENDIAN #endif -#undef BIG_ENDIAN #undef __BIG_ENDIAN -#else /* _BIG_ENDIAN */ -#ifndef BIG_ENDIAN -#define BIG_ENDIAN -#endif +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN #ifndef __BIG_ENDIAN -#define __BIG_ENDIAN +#define __BIG_ENDIAN RTE_BIG_ENDIAN #endif -#undef LITTLE_ENDIAN #undef __LITTLE_ENDIAN #endif @@ -63,7 +34,7 @@ #include "ecore_reg.h" struct bnx2x_softc; -typedef phys_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */ +typedef rte_iova_t ecore_dma_addr_t; /* expected to be 64 bit wide */ typedef volatile int ecore_atomic_t; @@ -140,7 +111,7 @@ typedef rte_spinlock_t ECORE_MUTEX_SPIN; #define ECORE_FCOE_CID(sc) ((sc)->fp[FCOE_IDX(sc)].cl_id) #define ECORE_MEMCMP(_a, _b, _s) memcmp(_a, _b, _s) -#define ECORE_MEMCPY(_a, _b, _s) (void)rte_memcpy(_a, _b, _s) +#define ECORE_MEMCPY(_a, _b, _s) rte_memcpy(_a, _b, _s) #define ECORE_MEMSET(_a, _c, _s) memset(_a, _c, _s) #define ECORE_CPU_TO_LE16(x) htole16(x) @@ -244,8 +215,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *mac, uint32_t len) } while (0) -#define ECORE_MSG(m, ...) \ - PMD_DRV_LOG(DEBUG, m, ##__VA_ARGS__) +#define ECORE_MSG(sc, m, ...) \ + PMD_DRV_LOG(DEBUG, sc, m, ##__VA_ARGS__) typedef struct _ecore_list_entry_t { @@ -1143,10 +1114,10 @@ struct ecore_config_rss_params { /* RSS hash values */ uint32_t rss_key[10]; - /* valid only iff ECORE_RSS_UPDATE_TOE is set */ + /* valid only if ECORE_RSS_UPDATE_TOE is set */ uint16_t toe_rss_bitmap; - /* valid iff ECORE_RSS_TUNNELING is set */ + /* valid if ECORE_RSS_TUNNELING is set */ uint16_t tunnel_value; uint16_t tunnel_mask; }; @@ -1313,14 +1284,14 @@ struct rxq_pause_params { uint16_t bd_th_hi; uint16_t rcq_th_lo; uint16_t rcq_th_hi; - uint16_t sge_th_lo; /* valid iff ECORE_Q_FLG_TPA */ - uint16_t sge_th_hi; /* valid iff ECORE_Q_FLG_TPA */ + uint16_t sge_th_lo; /* valid if ECORE_Q_FLG_TPA */ + uint16_t sge_th_hi; /* valid if ECORE_Q_FLG_TPA */ uint16_t pri_map; }; /* general */ struct ecore_general_setup_params { - /* valid iff ECORE_Q_FLG_STATS */ + /* valid if ECORE_Q_FLG_STATS */ uint8_t stat_id; uint8_t spcl_id; @@ -1339,19 +1310,19 @@ struct ecore_rxq_setup_params { uint8_t fw_sb_id; uint8_t cl_qzone_id; - /* valid iff ECORE_Q_FLG_TPA */ + /* valid if ECORE_Q_FLG_TPA */ uint16_t tpa_agg_sz; uint8_t max_tpa_queues; uint8_t rss_engine_id; - /* valid iff ECORE_Q_FLG_MCAST */ + /* valid if ECORE_Q_FLG_MCAST */ uint8_t mcast_engine_id; uint8_t cache_line_log; uint8_t sb_cq_index; - /* valid iff BXN2X_Q_FLG_SILENT_VLAN_REM */ + /* valid if BXN2X_Q_FLG_SILENT_VLAN_REM */ uint16_t silent_removal_value; uint16_t silent_removal_mask; }; @@ -1362,12 +1333,12 @@ struct ecore_txq_setup_params { uint8_t fw_sb_id; uint8_t sb_cq_index; - uint8_t cos; /* valid iff ECORE_Q_FLG_COS */ + uint8_t cos; /* valid if ECORE_Q_FLG_COS */ uint16_t traffic_type; /* equals to the leading rss client id, used for TX classification*/ uint8_t tss_leading_cl_id; - /* valid iff ECORE_Q_FLG_DEF_VLAN */ + /* valid if ECORE_Q_FLG_DEF_VLAN */ uint16_t default_vlan; }; @@ -1760,7 +1731,7 @@ void ecore_init_mcast_obj(struct bnx2x_softc *sc, * the current command will be enqueued to the tail of the * pending commands list. * - * Return: 0 is operation was successfull and there are no pending completions, + * Return: 0 is operation was successful and there are no pending completions, * negative if there were errors, positive if there are pending * completions. */