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

Go to the source code of this file.

Data Structures

struct  bfa_trc_s
 
struct  bfa_trc_mod_s
 
struct  bfa_sm_table_s
 
struct  bfa_wc_s
 

Macros

#define BFA_TRC_TS(_trcm)
 
#define BFA_TRC_MOD_SH   10
 
#define BFA_TRC_MOD(__mod)   ((BFA_TRC_ ## __mod) << BFA_TRC_MOD_SH)
 
#define BFA_TRC_FILE(__mod, __submod)
 
#define bfa_trc32(_trcp, _data)   __bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u32)_data)
 
#define bfa_trc(_trcp, _data)   __bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u64)_data)
 
#define bfa_sm_fault(__mod, __event)
 
#define bfa_q_first(_q)   ((void *)(((struct list_head *) (_q))->next))
 
#define bfa_q_next(_qe)   (((struct list_head *) (_qe))->next)
 
#define bfa_q_prev(_qe)   (((struct list_head *) (_qe))->prev)
 
#define bfa_q_qe_init(_qe)
 
#define bfa_q_deq(_q, _qe)
 
#define bfa_q_deq_tail(_q, _qe)
 
#define bfa_q_is_on_q(_q, _qe)   bfa_q_is_on_q_func(_q, (struct list_head *)(_qe))
 
#define bfa_sm_state_decl(oc, st, otype, etype)   static void oc ## _sm_ ## st(otype * fsm, etype event)
 
#define bfa_sm_set_state(_sm, _state)   ((_sm)->sm = (bfa_sm_t)(_state))
 
#define bfa_sm_send_event(_sm, _event)   ((_sm)->sm((_sm), (_event)))
 
#define bfa_sm_get_state(_sm)   ((_sm)->sm)
 
#define bfa_sm_cmp_state(_sm, _state)   ((_sm)->sm == (bfa_sm_t)(_state))
 
#define BFA_SM(_sm)   ((bfa_sm_t)(_sm))
 
#define bfa_fsm_state_decl(oc, st, otype, etype)
 
#define bfa_fsm_set_state(_fsm, _state)
 
#define bfa_fsm_send_event(_fsm, _event)   ((_fsm)->fsm((_fsm), (_event)))
 
#define bfa_fsm_get_state(_fsm)   ((_fsm)->fsm)
 
#define bfa_fsm_cmp_state(_fsm, _state)   ((_fsm)->fsm == (bfa_fsm_t)(_state))
 
#define bfa_swap_3b(_x)
 
#define bfa_hton3b(_x)   bfa_swap_3b(_x)
 
#define bfa_ntoh3b(_x)   bfa_hton3b(_x)
 

Typedefs

typedef void(* bfa_sm_t )(void *sm, int event)
 
typedef void(* bfa_fsm_t )(void *fsm, int event)
 
typedef void(* bfa_wc_resume_t )(void *cbarg)
 

Enumerations

enum  { BFA_TRC_HAL = 1, BFA_TRC_FCS = 2, BFA_TRC_LDRV = 3, BFA_TRC_CNA = 4 }
 

Macro Definition Documentation

#define bfa_fsm_cmp_state (   _fsm,
  _state 
)    ((_fsm)->fsm == (bfa_fsm_t)(_state))

Definition at line 267 of file bfa_cs.h.

#define bfa_fsm_get_state (   _fsm)    ((_fsm)->fsm)

Definition at line 266 of file bfa_cs.h.

#define bfa_fsm_send_event (   _fsm,
  _event 
)    ((_fsm)->fsm((_fsm), (_event)))

Definition at line 265 of file bfa_cs.h.

#define bfa_fsm_set_state (   _fsm,
  _state 
)
Value:
do { \
(_fsm)->fsm = (bfa_fsm_t)(_state); \
_state ## _entry(_fsm); \
} while (0)

Definition at line 260 of file bfa_cs.h.

#define bfa_fsm_state_decl (   oc,
  st,
  otype,
  etype 
)
Value:
static void oc ## _sm_ ## st(otype * fsm, etype event); \
static void oc ## _sm_ ## st ## _entry(otype * fsm)

Definition at line 256 of file bfa_cs.h.

#define bfa_hton3b (   _x)    bfa_swap_3b(_x)

Definition at line 359 of file bfa_cs.h.

#define bfa_ntoh3b (   _x)    bfa_hton3b(_x)

Definition at line 364 of file bfa_cs.h.

#define bfa_q_deq (   _q,
  _qe 
)
Value:
do { \
if (!list_empty(_q)) { \
(*((struct list_head **) (_qe))) = bfa_q_next(_q); \
bfa_q_prev(bfa_q_next(*((struct list_head **) _qe))) = \
(struct list_head *) (_q); \
bfa_q_next(_q) = bfa_q_next(*((struct list_head **) _qe));\
} else { \
*((struct list_head **) (_qe)) = (struct list_head *) NULL;\
} \
} while (0)

Definition at line 171 of file bfa_cs.h.

#define bfa_q_deq_tail (   _q,
  _qe 
)
Value:
{ \
if (!list_empty(_q)) { \
*((struct list_head **) (_qe)) = bfa_q_prev(_q); \
bfa_q_next(bfa_q_prev(*((struct list_head **) _qe))) = \
(struct list_head *) (_q); \
bfa_q_prev(_q) = bfa_q_prev(*(struct list_head **) _qe);\
} else { \
*((struct list_head **) (_qe)) = (struct list_head *) NULL;\
} \
}

Definition at line 185 of file bfa_cs.h.

#define bfa_q_first (   _q)    ((void *)(((struct list_head *) (_q))->next))

Definition at line 156 of file bfa_cs.h.

#define bfa_q_is_on_q (   _q,
  _qe 
)    bfa_q_is_on_q_func(_q, (struct list_head *)(_qe))

Definition at line 212 of file bfa_cs.h.

#define bfa_q_next (   _qe)    (((struct list_head *) (_qe))->next)

Definition at line 157 of file bfa_cs.h.

#define bfa_q_prev (   _qe)    (((struct list_head *) (_qe))->prev)

Definition at line 158 of file bfa_cs.h.

#define bfa_q_qe_init (   _qe)
Value:
{ \
bfa_q_next(_qe) = (struct list_head *) NULL; \
bfa_q_prev(_qe) = (struct list_head *) NULL; \
}

Definition at line 163 of file bfa_cs.h.

#define BFA_SM (   _sm)    ((bfa_sm_t)(_sm))

Definition at line 243 of file bfa_cs.h.

#define bfa_sm_cmp_state (   _sm,
  _state 
)    ((_sm)->sm == (bfa_sm_t)(_state))

Definition at line 233 of file bfa_cs.h.

#define bfa_sm_fault (   __mod,
  __event 
)
Value:
do { \
bfa_trc(__mod, (((u32)0xDEAD << 16) | __event)); \
printk(KERN_ERR "Assertion failure: %s:%d: %d", \
__FILE__, __LINE__, (__event)); \
} while (0)

Definition at line 149 of file bfa_cs.h.

#define bfa_sm_get_state (   _sm)    ((_sm)->sm)

Definition at line 232 of file bfa_cs.h.

#define bfa_sm_send_event (   _sm,
  _event 
)    ((_sm)->sm((_sm), (_event)))

Definition at line 231 of file bfa_cs.h.

#define bfa_sm_set_state (   _sm,
  _state 
)    ((_sm)->sm = (bfa_sm_t)(_state))

Definition at line 230 of file bfa_cs.h.

#define bfa_sm_state_decl (   oc,
  st,
  otype,
  etype 
)    static void oc ## _sm_ ## st(otype * fsm, etype event)

Definition at line 227 of file bfa_cs.h.

#define bfa_swap_3b (   _x)
Value:
((((_x) & 0xff) << 16) | \
((_x) & 0x00ff00) | \
(((_x) & 0xff0000) >> 16))

Definition at line 353 of file bfa_cs.h.

#define bfa_trc (   _trcp,
  _data 
)    __bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u64)_data)

Definition at line 94 of file bfa_cs.h.

#define bfa_trc32 (   _trcp,
  _data 
)    __bfa_trc((_trcp)->trcmod, __trc_fileno, __LINE__, (u32)_data)

Definition at line 92 of file bfa_cs.h.

#define BFA_TRC_FILE (   __mod,
  __submod 
)
Value:
static int __trc_fileno = ((BFA_TRC_ ## __mod ## _ ## __submod) | \
BFA_TRC_MOD(__mod))

Definition at line 87 of file bfa_cs.h.

#define BFA_TRC_MOD (   __mod)    ((BFA_TRC_ ## __mod) << BFA_TRC_MOD_SH)

Definition at line 82 of file bfa_cs.h.

#define BFA_TRC_MOD_SH   10

Definition at line 81 of file bfa_cs.h.

#define BFA_TRC_TS (   _trcm)
Value:
({ \
(tv.tv_sec*1000000+tv.tv_usec); \
})

Definition at line 35 of file bfa_cs.h.

Typedef Documentation

typedef void(* bfa_fsm_t)(void *fsm, int event)

Definition at line 248 of file bfa_cs.h.

typedef void(* bfa_sm_t)(void *sm, int event)

Definition at line 219 of file bfa_cs.h.

typedef void(* bfa_wc_resume_t)(void *cbarg)

Definition at line 284 of file bfa_cs.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
BFA_TRC_HAL 
BFA_TRC_FCS 
BFA_TRC_LDRV 
BFA_TRC_CNA 

Definition at line 75 of file bfa_cs.h.