/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing permissions
* and limitations under the License.
*/
/*
*/
#ifndef BNXE_H
#define BNXE_H
#include <sys/mac_provider.h>
#include <sys/sysmacros.h>
#include <sys/ethernet.h>
/*
* This really ticks me off! We use 'u' for naming unions
* within structures. Why is 'u' a reserved word!?!?!?
* This undef has been moved to bnxe_debug.h.
*/
//#undef u
#include "version.h"
#include "debug.h"
#include "bcmtype.h"
#include "lm_defs.h"
#include "listq.h"
#include "lm5710.h"
#include "lm.h"
#include "bd_chain.h"
#if !defined(__SunOS_MDB)
#include "command.h"
#endif
#include "bnxe_binding.h"
#if !defined(DBG) && !defined(__SunOS_MDB)
#include "bnxe_debug.h" /* wasn't included by debug.h */
#endif
#ifndef VLAN_TAGSZ
#endif
#define BNXE_RINGS
#define USER_OPTION_NUM_RINGS_MIN 0
#define USER_OPTION_NUM_RINGS_DEFAULT 0
//#define USER_OPTION_RX_DCOPY_THRESH_DEFAULT 0xffffffff
//#define USER_OPTION_TX_DCOPY_THRESH_DEFAULT 0
//#define BNXE_IP_MAXLEN 65535
#define BNXE_PKTHDR_LEN (sizeof(struct ether_vlan_header) + sizeof(struct ip) + sizeof(struct tcphdr) + BNXE_OPTION_LEN)
#define BNXE_LSO_MAXLEN (BNXE_IP_MAXLEN + sizeof(struct ether_vlan_header) - BNXE_PKTHDR_LEN) /* maximum payload */
#ifdef __sparc
#else
#endif
/*
* Adding a two byte offset to the receive buffer aligns the IP header on a
* 16 byte boundary and it would put the TCP payload (assuming a 20 byte IP
* header and 20 byte TCP header) on an 8 byte boundary.
*/
/*
* The following two defines are used for defining limits on Tx packets.
* BNXE_MAX_DMA_HANDLES_PER_PKT is the maximum number of DMA handles that are
* pre-allocated for every Tx buffer descriptor. These DMA handles are used
* for mapping each mblk in the chain when not double copying the packet data
* into the copy buffer. BNXE_MAX_DMA_FRAGS_PER_PKT is based on the hardware
* and represents the maximum number of fragments an outgoing packet can have.
* Note that a single DMA handle can be comprised of multiple fragments which
* is very likely with LSO.
*
* As seen below BNXE_MAX_DMA_FRAGS_PER_PKT is set to 10. The actual firmware
* limit is 13 but 10 is chosen specifically for the case of LSO packets that
* are broken up across a long mblk chain. The firmware utilizes a sliding
* window on a packet's assigned buffer descriptors for LSO. The window is 10
* bds and each window (i.e. bds 1-10, 2-11, 3-12, etc), except the window
* containing the last bd, must contains at least MSS bytes. There are 'rare'
* cases where a packet sent down by the stack will not satisfy this window
* size requirement. Therefore, setting the frag limit to 10 results in any
* long chained packet (i.e. greater than 10 mblks), the trailing mblks will
* get double copied into a single copy buffer and will be pointed to by the
* last bd. This simple change will ensure the sliding window requirement is
* always satisfied. Note, LSO packets with long mblk chains are a rare
* occurance (nicdrv test01 can trigger it).
*/
#define BNXE_TX_RESOURCES_NO_OS_DMA_RES 0x08 /* Unable to allocate DMA resources. (e.g. bind error) */
#define BNXE_TX_GOODXMIT 0
#define BNXE_ROUTE_RING_NONE 0
typedef struct _BnxeDevParams
{
int checksum;
typedef struct _BnxeLinkCfg
{
} BnxeLinkCfg;
typedef struct _BnxePhyCfg
{
} BnxePhyCfg;
typedef struct _BnxeProps
{
} BnxeProps;
typedef struct _BnxeMemBlock
{
void * pBuf;
} BnxeMemBlock;
typedef struct _BnxeMemDma
{
void * pDmaVirt;
} BnxeMemDma;
typedef struct _BnxeMemRegion
{
typedef struct _um_txpacket_t
{
typedef struct _TxQueue
{
} TxQueue;
typedef struct _um_rxpacket_t
{
typedef struct _RxQueue
{
} RxQueue;
typedef struct _RxQueueGroup
{
} RxQueueGroup;
typedef struct _KstatRingMap
{
} KstatRingMap;
typedef struct _BnxeFcoeState
{
typedef struct _BnxeClientStats
{
typedef struct _BnxeFcoeData
{
} BnxeFcoeData;
typedef struct _BnxeIntrBlock
{
int intrCount;
int intrCapability;
typedef struct _BnxeWorkQueueInstance
{
void * pUM;
typedef struct _BnxeWorkQueues
{
/* the following are used against the clientState variable in um_device_t */
(((client) == LM_CLI_IDX_NDIS) ? \
typedef struct _um_device
{
#ifdef BNXE_DEBUG_DMA_LIST
#endif
int instance;
/* the arrays below = LM_SB_CNT() + 1 = 17 */
int intrType;
#ifndef LM_MAX_UC_TABLE_SIZE
#endif
} um_device_t;
/* mioc[ack|nak] return values from ioctl subroutines */
enum ioc_reply
{
};
/* IOCTLs for edebug and firmware upgrade */
struct bnxe_reg_data
{
};
struct bnxe_nvram_data
{
};
/* bnxe_cfg.c */
/* bnxe_mm.c */
int cli_idx);
/* bnxe_gld.c */
/* bnxe_hw.c */
int cid);
int cliIdx,
int cliIdx,
const uint8_t * pMcastAddr,
int cliIdx,
#if (DEVO_REV > 3)
#endif
/* bnxe_intr.c */
/* bnxe_kstat.c */
/* bnxe_rr.c */
/* bnxe_rx.c */
int cliIdx);
int idx,
int numBytes);
int cliIdx);
int cliIdx);
int cliIdx);
int cliIdx);
/* bnxe_tx.c */
int idx,
int idx);
int idx,
int cliIdx);
int cliIdx);
int cliIdx);
/* bnxe_timer.c */
/* bnxe_workq.c */
void * pWorkData,
void (*pWorkCbk)(um_device_t *, void *),
void * pWorkData);
void (*pWorkCbkGeneric)(um_device_t *));
void * pWorkData,
void (*pWorkCbk)(um_device_t *, void *),
void * pWorkData,
void (*pWorkCbkGeneric)(um_device_t *),
/* bnxe_fcoe.c */
int cmd,
void * pData,
int dataLen);
void * wqes[],
int wqeCnt);
void ** ppMap,
void * pMap,
/* bnxe_main.c */
char * BnxeDevName(void * pDev);
extern kmutex_t bnxeLoaderMutex;
extern u32_t bnxeNumPlumbed;
extern BnxeLinkCfg bnxeLinkCfg;
/* undefine this to help with dtrace analysis */
#define BNXE_LOCKS_INLINE
#ifdef BNXE_LOCKS_INLINE
#else /* not BNXE_LOCKS_INLINE */
#endif /* BNXE_LOCKS_INLINE */
}
char * pTag,
char * pTag,
/* XXX yuck (beware return strings lengths with kstat and mdb) */
{
}
{
else { return "None"; }
}
{
else { return "None"; }
}
{
else { return "None"; }
}
#endif /* BNXE_H */