Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
bfa_ioc.h File Reference
#include "bfa_cs.h"
#include "bfi.h"
#include "cna.h"

Go to the source code of this file.

Data Structures

struct  bfa_pcidev
 
struct  bfa_dma
 
struct  bfa_ioc_regs
 
struct  bfa_mbox_cmd
 
struct  bfa_ioc_mbox_mod
 
struct  bfa_ioc_cbfn
 
struct  bfa_ioc_notify
 
struct  bfa_iocpf
 
struct  bfa_ioc
 
struct  bfa_ioc_hwif
 
struct  bfa_flash
 

Macros

#define BFA_IOC_TOV   3000 /* msecs */
 
#define BFA_IOC_HWSEM_TOV   500 /* msecs */
 
#define BFA_IOC_HB_TOV   500 /* msecs */
 
#define BFA_IOC_POLL_TOV   200 /* msecs */
 
#define BNA_DBG_FWTRC_LEN
 
#define BFA_DMA_ALIGN_SZ   256
 
#define BFI_SMEM_CB_SIZE   0x200000U /* ! 2MB for crossbow */
 
#define BFI_SMEM_CT_SIZE   0x280000U /* ! 2.5MB for catapult */
 
#define bfa_dma_be_addr_set(dma_addr, pa)   __bfa_dma_be_addr_set(&dma_addr, (u64)pa)
 
#define bfa_alen_set(__alen, __len, __pa)   __bfa_alen_set(__alen, __len, (u64)__pa)
 
#define bfa_ioc_notify_init(__notify, __cbfn, __cbarg)
 
#define bfa_ioc_pcifn(__ioc)   ((__ioc)->pcidev.pci_func)
 
#define bfa_ioc_devid(__ioc)   ((__ioc)->pcidev.device_id)
 
#define bfa_ioc_bar0(__ioc)   ((__ioc)->pcidev.pci_bar_kva)
 
#define bfa_ioc_portid(__ioc)   ((__ioc)->port_id)
 
#define bfa_ioc_asic_gen(__ioc)   ((__ioc)->asic_gen)
 
#define bfa_ioc_fetch_stats(__ioc, __stats)   (((__stats)->drv_stats) = (__ioc)->stats)
 
#define bfa_ioc_clr_stats(__ioc)   memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats))
 
#define bfa_ioc_maxfrsize(__ioc)   ((__ioc)->attr->maxfrsize)
 
#define bfa_ioc_rx_bbcredit(__ioc)   ((__ioc)->attr->rx_bbcredit)
 
#define bfa_ioc_speed_sup(__ioc)   BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop)
 
#define bfa_ioc_get_nports(__ioc)   BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)
 
#define bfa_ioc_stats(_ioc, _stats)   ((_ioc)->stats._stats++)
 
#define bfa_ioc_stats_hb_count(_ioc, _hb_count)   ((_ioc)->stats.hb_count = (_hb_count))
 
#define BFA_IOC_FWIMG_MINSZ   (16 * 1024)
 
#define BFA_IOC_FW_SMEM_SIZE(__ioc)
 
#define BFA_IOC_FLASH_CHUNK_NO(off)   (off / BFI_FLASH_CHUNK_SZ_WORDS)
 
#define BFA_IOC_FLASH_OFFSET_IN_CHUNK(off)   (off % BFI_FLASH_CHUNK_SZ_WORDS)
 
#define BFA_IOC_FLASH_CHUNK_ADDR(chunkno)   (chunkno * BFI_FLASH_CHUNK_SZ_WORDS)
 
#define bfa_ioc_pll_init_asic(__ioc)
 
#define bfa_ioc_isr_mode_set(__ioc, __msix)
 
#define bfa_ioc_ownership_reset(__ioc)   ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))
 
#define bfa_ioc_lpu_read_stat(__ioc)
 

Typedefs

typedef void(* bfa_mbox_cmd_cbfn_t )(void *cbarg)
 
typedef void(* bfa_ioc_mbox_mcfunc_t )(void *cbarg, struct bfi_mbmsg *m)
 
typedef void(* bfa_ioc_enable_cbfn_t )(void *bfa, enum bfa_status status)
 
typedef void(* bfa_ioc_disable_cbfn_t )(void *bfa)
 
typedef void(* bfa_ioc_hbfail_cbfn_t )(void *bfa)
 
typedef void(* bfa_ioc_reset_cbfn_t )(void *bfa)
 
typedef void(* bfa_ioc_notify_cbfn_t )(void *, enum bfa_ioc_event)
 
typedef void(* bfa_cb_flash )(void *cbarg, enum bfa_status status)
 

Enumerations

enum  bfa_ioc_event { BFA_IOC_E_ENABLED = 1, BFA_IOC_E_DISABLED = 2, BFA_IOC_E_FAILED = 3 }
 

Functions

bool bfa_nw_ioc_mbox_queue (struct bfa_ioc *ioc, struct bfa_mbox_cmd *cmd, bfa_mbox_cmd_cbfn_t cbfn, void *cbarg)
 
void bfa_nw_ioc_mbox_isr (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_mbox_regisr (struct bfa_ioc *ioc, enum bfi_mclass mc, bfa_ioc_mbox_mcfunc_t cbfn, void *cbarg)
 
void bfa_nw_ioc_set_ct_hwif (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_set_ct2_hwif (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_ct2_poweron (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_attach (struct bfa_ioc *ioc, void *bfa, struct bfa_ioc_cbfn *cbfn)
 
void bfa_nw_ioc_auto_recover (bool auto_recover)
 
void bfa_nw_ioc_detach (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_pci_init (struct bfa_ioc *ioc, struct bfa_pcidev *pcidev, enum bfi_pcifn_class clscode)
 
u32 bfa_nw_ioc_meminfo (void)
 
void bfa_nw_ioc_mem_claim (struct bfa_ioc *ioc, u8 *dm_kva, u64 dm_pa)
 
void bfa_nw_ioc_enable (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_disable (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_error_isr (struct bfa_ioc *ioc)
 
bool bfa_nw_ioc_is_disabled (struct bfa_ioc *ioc)
 
bool bfa_nw_ioc_is_operational (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_get_attr (struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr)
 
void bfa_nw_ioc_notify_register (struct bfa_ioc *ioc, struct bfa_ioc_notify *notify)
 
bool bfa_nw_ioc_sem_get (void __iomem *sem_reg)
 
void bfa_nw_ioc_sem_release (void __iomem *sem_reg)
 
void bfa_nw_ioc_hw_sem_release (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_fwver_get (struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr)
 
bool bfa_nw_ioc_fwver_cmp (struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr)
 
mac_t bfa_nw_ioc_get_mac (struct bfa_ioc *ioc)
 
void bfa_nw_ioc_debug_memclaim (struct bfa_ioc *ioc, void *dbg_fwsave)
 
int bfa_nw_ioc_debug_fwtrc (struct bfa_ioc *ioc, void *trcdata, int *trclen)
 
int bfa_nw_ioc_debug_fwsave (struct bfa_ioc *ioc, void *trcdata, int *trclen)
 
void bfa_nw_ioc_timeout (void *ioc)
 
void bfa_nw_ioc_hb_check (void *ioc)
 
void bfa_nw_iocpf_timeout (void *ioc)
 
void bfa_nw_iocpf_sem_timeout (void *ioc)
 
u32bfa_cb_image_get_chunk (enum bfi_asic_gen asic_gen, u32 off)
 
u32 bfa_cb_image_get_size (enum bfi_asic_gen asic_gen)
 
enum bfa_status bfa_nw_flash_get_attr (struct bfa_flash *flash, struct bfa_flash_attr *attr, bfa_cb_flash cbfn, void *cbarg)
 
enum bfa_status bfa_nw_flash_update_part (struct bfa_flash *flash, u32 type, u8 instance, void *buf, u32 len, u32 offset, bfa_cb_flash cbfn, void *cbarg)
 
enum bfa_status bfa_nw_flash_read_part (struct bfa_flash *flash, u32 type, u8 instance, void *buf, u32 len, u32 offset, bfa_cb_flash cbfn, void *cbarg)
 
u32 bfa_nw_flash_meminfo (void)
 
void bfa_nw_flash_attach (struct bfa_flash *flash, struct bfa_ioc *ioc, void *dev)
 
void bfa_nw_flash_memclaim (struct bfa_flash *flash, u8 *dm_kva, u64 dm_pa)
 

Macro Definition Documentation

#define bfa_alen_set (   __alen,
  __len,
  __pa 
)    __bfa_alen_set(__alen, __len, (u64)__pa)

Definition at line 66 of file bfa_ioc.h.

#define BFA_DMA_ALIGN_SZ   256

Definition at line 50 of file bfa_ioc.h.

#define bfa_dma_be_addr_set (   dma_addr,
  pa 
)    __bfa_dma_be_addr_set(&dma_addr, (u64)pa)

Definition at line 57 of file bfa_ioc.h.

#define bfa_ioc_asic_gen (   __ioc)    ((__ioc)->asic_gen)

Definition at line 224 of file bfa_ioc.h.

#define bfa_ioc_bar0 (   __ioc)    ((__ioc)->pcidev.pci_bar_kva)

Definition at line 222 of file bfa_ioc.h.

#define bfa_ioc_clr_stats (   __ioc)    memset(&(__ioc)->stats, 0, sizeof((__ioc)->stats))

Definition at line 227 of file bfa_ioc.h.

#define bfa_ioc_devid (   __ioc)    ((__ioc)->pcidev.device_id)

Definition at line 221 of file bfa_ioc.h.

#define bfa_ioc_fetch_stats (   __ioc,
  __stats 
)    (((__stats)->drv_stats) = (__ioc)->stats)

Definition at line 225 of file bfa_ioc.h.

#define BFA_IOC_FLASH_CHUNK_ADDR (   chunkno)    (chunkno * BFI_FLASH_CHUNK_SZ_WORDS)

Definition at line 245 of file bfa_ioc.h.

#define BFA_IOC_FLASH_CHUNK_NO (   off)    (off / BFI_FLASH_CHUNK_SZ_WORDS)

Definition at line 243 of file bfa_ioc.h.

#define BFA_IOC_FLASH_OFFSET_IN_CHUNK (   off)    (off % BFI_FLASH_CHUNK_SZ_WORDS)

Definition at line 244 of file bfa_ioc.h.

#define BFA_IOC_FW_SMEM_SIZE (   __ioc)
Value:

Definition at line 240 of file bfa_ioc.h.

#define BFA_IOC_FWIMG_MINSZ   (16 * 1024)

Definition at line 239 of file bfa_ioc.h.

#define bfa_ioc_get_nports (   __ioc)    BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)

Definition at line 233 of file bfa_ioc.h.

#define BFA_IOC_HB_TOV   500 /* msecs */

Definition at line 28 of file bfa_ioc.h.

#define BFA_IOC_HWSEM_TOV   500 /* msecs */

Definition at line 27 of file bfa_ioc.h.

#define bfa_ioc_isr_mode_set (   __ioc,
  __msix 
)
Value:
do { \
if ((__ioc)->ioc_hwif->ioc_isr_mode_set) \
((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)); \
} while (0)

Definition at line 261 of file bfa_ioc.h.

#define bfa_ioc_lpu_read_stat (   __ioc)
Value:
do { \
if ((__ioc)->ioc_hwif->ioc_lpu_read_stat) \
((__ioc)->ioc_hwif->ioc_lpu_read_stat(__ioc)); \
} while (0)

Definition at line 268 of file bfa_ioc.h.

#define bfa_ioc_maxfrsize (   __ioc)    ((__ioc)->attr->maxfrsize)

Definition at line 229 of file bfa_ioc.h.

#define bfa_ioc_notify_init (   __notify,
  __cbfn,
  __cbarg 
)
Value:
do { \
(__notify)->cbfn = (__cbfn); \
(__notify)->cbarg = (__cbarg); \
} while (0)

Definition at line 152 of file bfa_ioc.h.

#define bfa_ioc_ownership_reset (   __ioc)    ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))

Definition at line 265 of file bfa_ioc.h.

#define bfa_ioc_pcifn (   __ioc)    ((__ioc)->pcidev.pci_func)

Definition at line 220 of file bfa_ioc.h.

#define bfa_ioc_pll_init_asic (   __ioc)
Value:
((__ioc)->ioc_hwif->ioc_pll_init((__ioc)->pcidev.pci_bar_kva, \
(__ioc)->asic_mode))

Definition at line 257 of file bfa_ioc.h.

#define BFA_IOC_POLL_TOV   200 /* msecs */

Definition at line 29 of file bfa_ioc.h.

#define bfa_ioc_portid (   __ioc)    ((__ioc)->port_id)

Definition at line 223 of file bfa_ioc.h.

#define bfa_ioc_rx_bbcredit (   __ioc)    ((__ioc)->attr->rx_bbcredit)

Definition at line 230 of file bfa_ioc.h.

#define bfa_ioc_speed_sup (   __ioc)    BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop)

Definition at line 231 of file bfa_ioc.h.

#define bfa_ioc_stats (   _ioc,
  _stats 
)    ((_ioc)->stats._stats++)

Definition at line 236 of file bfa_ioc.h.

#define bfa_ioc_stats_hb_count (   _ioc,
  _hb_count 
)    ((_ioc)->stats.hb_count = (_hb_count))

Definition at line 237 of file bfa_ioc.h.

#define BFA_IOC_TOV   3000 /* msecs */

Definition at line 26 of file bfa_ioc.h.

#define BFI_SMEM_CB_SIZE   0x200000U /* ! 2MB for crossbow */

Definition at line 53 of file bfa_ioc.h.

#define BFI_SMEM_CT_SIZE   0x280000U /* ! 2.5MB for catapult */

Definition at line 54 of file bfa_ioc.h.

#define BNA_DBG_FWTRC_LEN
Value:
BFI_IOC_TRC_HDR_SZ)

Definition at line 30 of file bfa_ioc.h.

Typedef Documentation

typedef void(* bfa_cb_flash)(void *cbarg, enum bfa_status status)

Definition at line 323 of file bfa_ioc.h.

typedef void(* bfa_ioc_disable_cbfn_t)(void *bfa)

Definition at line 126 of file bfa_ioc.h.

typedef void(* bfa_ioc_enable_cbfn_t)(void *bfa, enum bfa_status status)

Definition at line 125 of file bfa_ioc.h.

typedef void(* bfa_ioc_hbfail_cbfn_t)(void *bfa)

Definition at line 127 of file bfa_ioc.h.

typedef void(* bfa_ioc_mbox_mcfunc_t)(void *cbarg, struct bfi_mbmsg *m)

Definition at line 114 of file bfa_ioc.h.

typedef void(* bfa_ioc_notify_cbfn_t)(void *, enum bfa_ioc_event)

Definition at line 143 of file bfa_ioc.h.

typedef void(* bfa_ioc_reset_cbfn_t)(void *bfa)

Definition at line 128 of file bfa_ioc.h.

typedef void(* bfa_mbox_cmd_cbfn_t)(void *cbarg)

Definition at line 105 of file bfa_ioc.h.

Enumeration Type Documentation

Enumerator:
BFA_IOC_E_ENABLED 
BFA_IOC_E_DISABLED 
BFA_IOC_E_FAILED 

Definition at line 137 of file bfa_ioc.h.

Function Documentation

u32* bfa_cb_image_get_chunk ( enum bfi_asic_gen  asic_gen,
u32  off 
)

Definition at line 66 of file cna_fwimg.c.

u32 bfa_cb_image_get_size ( enum bfi_asic_gen  asic_gen)

Definition at line 81 of file cna_fwimg.c.

void bfa_nw_flash_attach ( struct bfa_flash flash,
struct bfa_ioc ioc,
void dev 
)

bfa_nw_flash_attach - Flash attach API.

: flash structure : ioc structure : device structure

Definition at line 2695 of file bfa_ioc.c.

enum bfa_status bfa_nw_flash_get_attr ( struct bfa_flash flash,
struct bfa_flash_attr attr,
bfa_cb_flash  cbfn,
void cbarg 
)

bfa_nw_flash_get_attr - Get flash attribute.

: flash structure : flash attribute structure : callback function : callback argument

Return status.

Definition at line 2736 of file bfa_ioc.c.

void bfa_nw_flash_memclaim ( struct bfa_flash flash,
u8 dm_kva,
u64  dm_pa 
)

bfa_nw_flash_memclaim - Claim memory for flash

: flash structure : pointer to virtual memory address : physical memory address

Definition at line 2716 of file bfa_ioc.c.

u32 bfa_nw_flash_meminfo ( void  )

Definition at line 2682 of file bfa_ioc.c.

enum bfa_status bfa_nw_flash_read_part ( struct bfa_flash flash,
u32  type,
u8  instance,
void buf,
u32  len,
u32  offset,
bfa_cb_flash  cbfn,
void cbarg 
)

bfa_nw_flash_read_part - Read flash partition.

: flash structure : flash partition type : flash partition instance : read data buffer : data buffer length : offset relative to the partition starting address : callback function : callback argument

Return status.

Definition at line 2825 of file bfa_ioc.c.

enum bfa_status bfa_nw_flash_update_part ( struct bfa_flash flash,
u32  type,
u8  instance,
void buf,
u32  len,
u32  offset,
bfa_cb_flash  cbfn,
void cbarg 
)

bfa_nw_flash_update_part - Update flash partition.

: flash structure : flash partition type : flash partition instance : update data buffer : data buffer length : offset relative to the partition starting address : callback function : callback argument

Return status.

Definition at line 2776 of file bfa_ioc.c.

void bfa_nw_ioc_attach ( struct bfa_ioc ioc,
void bfa,
struct bfa_ioc_cbfn cbfn 
)

bfa_nw_ioc_attach - IOC attach time initialization and setup.

: memory for IOC : driver instance structure

Definition at line 1951 of file bfa_ioc.c.

void bfa_nw_ioc_auto_recover ( bool  auto_recover)

Definition at line 1876 of file bfa_ioc.c.

void bfa_nw_ioc_ct2_poweron ( struct bfa_ioc ioc)

Definition at line 439 of file bfa_ioc_ct.c.

int bfa_nw_ioc_debug_fwsave ( struct bfa_ioc ioc,
void trcdata,
int trclen 
)

Definition at line 1761 of file bfa_ioc.c.

int bfa_nw_ioc_debug_fwtrc ( struct bfa_ioc ioc,
void trcdata,
int trclen 
)

Definition at line 1730 of file bfa_ioc.c.

void bfa_nw_ioc_debug_memclaim ( struct bfa_ioc ioc,
void dbg_fwsave 
)

Definition at line 2088 of file bfa_ioc.c.

void bfa_nw_ioc_detach ( struct bfa_ioc ioc)

Definition at line 1969 of file bfa_ioc.c.

void bfa_nw_ioc_disable ( struct bfa_ioc ioc)

Definition at line 2080 of file bfa_ioc.c.

void bfa_nw_ioc_enable ( struct bfa_ioc ioc)

Definition at line 2071 of file bfa_ioc.c.

void bfa_nw_ioc_error_isr ( struct bfa_ioc ioc)

Definition at line 2187 of file bfa_ioc.c.

bool bfa_nw_ioc_fwver_cmp ( struct bfa_ioc ioc,
struct bfi_ioc_image_hdr fwhdr 
)

Definition at line 1314 of file bfa_ioc.c.

void bfa_nw_ioc_fwver_get ( struct bfa_ioc ioc,
struct bfi_ioc_image_hdr fwhdr 
)

Definition at line 1294 of file bfa_ioc.c.

void bfa_nw_ioc_get_attr ( struct bfa_ioc ioc,
struct bfa_ioc_attr ioc_attr 
)

Definition at line 2373 of file bfa_ioc.c.

mac_t bfa_nw_ioc_get_mac ( struct bfa_ioc ioc)

Definition at line 2401 of file bfa_ioc.c.

void bfa_nw_ioc_hb_check ( void ioc)

Definition at line 1487 of file bfa_ioc.c.

void bfa_nw_ioc_hw_sem_release ( struct bfa_ioc ioc)

Definition at line 1216 of file bfa_ioc.c.

bool bfa_nw_ioc_is_disabled ( struct bfa_ioc ioc)

Definition at line 2196 of file bfa_ioc.c.

bool bfa_nw_ioc_is_operational ( struct bfa_ioc ioc)

Definition at line 2204 of file bfa_ioc.c.

void bfa_nw_ioc_mbox_isr ( struct bfa_ioc ioc)

Treat IOC message class as special.

Try to send pending mailbox commands

Definition at line 2156 of file bfa_ioc.c.

bool bfa_nw_ioc_mbox_queue ( struct bfa_ioc ioc,
struct bfa_mbox_cmd cmd,
bfa_mbox_cmd_cbfn_t  cbfn,
void cbarg 
)

bfa_nw_ioc_mbox_queue - Queue a mailbox command request to firmware.

: IOC instance : Mailbox command

Waits if mailbox is busy. Responsibility of caller to serialize

If a previous command is pending, queue new command

If mailbox is busy, queue command for poll timer

mailbox is free – queue command to firmware

Definition at line 2120 of file bfa_ioc.c.

void bfa_nw_ioc_mbox_regisr ( struct bfa_ioc ioc,
enum bfi_mclass  mc,
bfa_ioc_mbox_mcfunc_t  cbfn,
void cbarg 
)

Definition at line 2102 of file bfa_ioc.c.

void bfa_nw_ioc_mem_claim ( struct bfa_ioc ioc,
u8 dm_kva,
u64  dm_pa 
)

bfa_nw_ioc_mem_claim - Initialize IOC dma memory

: kernel virtual address of IOC dma memory : physical address of IOC dma memory

dma memory for firmware attribute

Definition at line 2053 of file bfa_ioc.c.

u32 bfa_nw_ioc_meminfo ( void  )

Definition at line 2065 of file bfa_ioc.c.

void bfa_nw_ioc_notify_register ( struct bfa_ioc ioc,
struct bfa_ioc_notify notify 
)

Definition at line 2213 of file bfa_ioc.c.

void bfa_nw_ioc_pci_init ( struct bfa_ioc ioc,
struct bfa_pcidev pcidev,
enum bfi_pcifn_class  clscode 
)

bfa_nw_ioc_pci_init - Setup IOC PCI properties.

: PCI device information for this IOC

Initialize IOC and device personality

Set asic specific interfaces.

Definition at line 1983 of file bfa_ioc.c.

bool bfa_nw_ioc_sem_get ( void __iomem sem_reg)

Definition at line 1107 of file bfa_ioc.c.

void bfa_nw_ioc_sem_release ( void __iomem sem_reg)

Definition at line 1128 of file bfa_ioc.c.

void bfa_nw_ioc_set_ct2_hwif ( struct bfa_ioc ioc)

Definition at line 98 of file bfa_ioc_ct.c.

void bfa_nw_ioc_set_ct_hwif ( struct bfa_ioc ioc)

Definition at line 92 of file bfa_ioc_ct.c.

void bfa_nw_ioc_timeout ( void ioc)

Definition at line 1419 of file bfa_ioc.c.

void bfa_nw_iocpf_sem_timeout ( void ioc)

Definition at line 2469 of file bfa_ioc.c.

void bfa_nw_iocpf_timeout ( void ioc)

Definition at line 2455 of file bfa_ioc.c.