/*
* Linux network driver for Brocade Converged Network Adapter.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (GPL) Version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
/*
* Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
* All rights reserved
* www.brocade.com
*
* File for interrupt macros and functions
*/
#ifndef __BNA_HW_H__
#define __BNA_HW_H__
#include "bfi_ctreg.h"
/**
*
* SW imposed limits
*
*/
#ifndef BNA_BIOS_BUILD
#define BFI_MAX_TXQ 64
#define BFI_MAX_RXQ 64
#define BFI_MAX_RXF 64
#define BFI_MAX_IB 128
#define BFI_MAX_RIT_SIZE 256
#define BFI_RSS_RIT_SIZE 64
#define BFI_NONRSS_RIT_SIZE 1
#define BFI_MAX_UCMAC 256
#define BFI_MAX_MCMAC 512
#define BFI_IBIDX_SIZE 4
#define BFI_MAX_VLAN 4095
/**
* There are 2 free IB index pools:
* pool1: 120 segments of 1 index each
* pool8: 1 segment of 8 indexes
*/
#define BFI_IBIDX_POOL1_SIZE 116
#define BFI_IBIDX_POOL1_ENTRY_SIZE 1
#define BFI_IBIDX_POOL2_SIZE 2
#define BFI_IBIDX_POOL2_ENTRY_SIZE 2
#define BFI_IBIDX_POOL8_SIZE 1
#define BFI_IBIDX_POOL8_ENTRY_SIZE 8
#define BFI_IBIDX_TOTAL_POOLS 3
#define BFI_IBIDX_TOTAL_SEGS 119 /* (POOL1 + POOL2 + POOL8)_SIZE */
#define BFI_IBIDX_MAX_SEGSIZE 8
#define init_ibidx_pool(name) \
static struct bna_ibidx_pool name[BFI_IBIDX_TOTAL_POOLS] = \
{ \
{ BFI_IBIDX_POOL1_SIZE, BFI_IBIDX_POOL1_ENTRY_SIZE }, \
{ BFI_IBIDX_POOL2_SIZE, BFI_IBIDX_POOL2_ENTRY_SIZE }, \
{ BFI_IBIDX_POOL8_SIZE, BFI_IBIDX_POOL8_ENTRY_SIZE } \
}
/**
* There are 2 free RIT segment pools:
* Pool1: 192 segments of 1 RIT entry each
* Pool2: 1 segment of 64 RIT entry
*/
#define BFI_RIT_SEG_POOL1_SIZE 192
#define BFI_RIT_SEG_POOL1_ENTRY_SIZE 1
#define BFI_RIT_SEG_POOLRSS_SIZE 1
#define BFI_RIT_SEG_POOLRSS_ENTRY_SIZE 64
#define BFI_RIT_SEG_TOTAL_POOLS 2
#define BFI_RIT_TOTAL_SEGS 193 /* POOL1_SIZE + POOLRSS_SIZE */
#define init_ritseg_pool(name) \
static struct bna_ritseg_pool_cfg name[BFI_RIT_SEG_TOTAL_POOLS] = \
{ \
{ BFI_RIT_SEG_POOL1_SIZE, BFI_RIT_SEG_POOL1_ENTRY_SIZE }, \
{ BFI_RIT_SEG_POOLRSS_SIZE, BFI_RIT_SEG_POOLRSS_ENTRY_SIZE } \
}
#else /* BNA_BIOS_BUILD */
#define BFI_MAX_TXQ 1
#define BFI_MAX_RXQ 1
#define BFI_MAX_RXF 1
#define BFI_MAX_IB 2
#define BFI_MAX_RIT_SIZE 2
#define BFI_RSS_RIT_SIZE 64
#define BFI_NONRSS_RIT_SIZE 1
#define BFI_MAX_UCMAC 1
#define BFI_MAX_MCMAC 8
#define BFI_IBIDX_SIZE