aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bna/bfa_ioc.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bna/bfa_ioc.h')
-rw-r--r--drivers/net/bna/bfa_ioc.h51
1 files changed, 37 insertions, 14 deletions
diff --git a/drivers/net/bna/bfa_ioc.h b/drivers/net/bna/bfa_ioc.h
index bd48abee781f..bda866ba6e90 100644
--- a/drivers/net/bna/bfa_ioc.h
+++ b/drivers/net/bna/bfa_ioc.h
@@ -19,7 +19,7 @@
19#ifndef __BFA_IOC_H__ 19#ifndef __BFA_IOC_H__
20#define __BFA_IOC_H__ 20#define __BFA_IOC_H__
21 21
22#include "bfa_sm.h" 22#include "bfa_cs.h"
23#include "bfi.h" 23#include "bfi.h"
24#include "cna.h" 24#include "cna.h"
25 25
@@ -97,9 +97,12 @@ struct bfa_ioc_regs {
97/** 97/**
98 * IOC Mailbox structures 98 * IOC Mailbox structures
99 */ 99 */
100typedef void (*bfa_mbox_cmd_cbfn_t)(void *cbarg);
100struct bfa_mbox_cmd { 101struct bfa_mbox_cmd {
101 struct list_head qe; 102 struct list_head qe;
102 u32 msg[BFI_IOC_MSGSZ]; 103 bfa_mbox_cmd_cbfn_t cbfn;
104 void *cbarg;
105 u32 msg[BFI_IOC_MSGSZ];
103}; 106};
104 107
105/** 108/**
@@ -130,6 +133,23 @@ struct bfa_ioc_cbfn {
130}; 133};
131 134
132/** 135/**
136 * IOC event notification mechanism.
137 */
138enum bfa_ioc_event {
139 BFA_IOC_E_ENABLED = 1,
140 BFA_IOC_E_DISABLED = 2,
141 BFA_IOC_E_FAILED = 3,
142};
143
144typedef void (*bfa_ioc_notify_cbfn_t)(void *, enum bfa_ioc_event);
145
146struct bfa_ioc_notify {
147 struct list_head qe;
148 bfa_ioc_notify_cbfn_t cbfn;
149 void *cbarg;
150};
151
152/**
133 * Heartbeat failure notification queue element. 153 * Heartbeat failure notification queue element.
134 */ 154 */
135struct bfa_ioc_hbfail_notify { 155struct bfa_ioc_hbfail_notify {
@@ -141,7 +161,7 @@ struct bfa_ioc_hbfail_notify {
141/** 161/**
142 * Initialize a heartbeat failure notification structure 162 * Initialize a heartbeat failure notification structure
143 */ 163 */
144#define bfa_ioc_hbfail_init(__notify, __cbfn, __cbarg) do { \ 164#define bfa_ioc_notify_init(__notify, __cbfn, __cbarg) do { \
145 (__notify)->cbfn = (__cbfn); \ 165 (__notify)->cbfn = (__cbfn); \
146 (__notify)->cbarg = (__cbarg); \ 166 (__notify)->cbarg = (__cbarg); \
147} while (0) 167} while (0)
@@ -155,25 +175,25 @@ struct bfa_iocpf {
155 175
156struct bfa_ioc { 176struct bfa_ioc {
157 bfa_fsm_t fsm; 177 bfa_fsm_t fsm;
158 struct bfa *bfa; 178 struct bfa *bfa;
159 struct bfa_pcidev pcidev; 179 struct bfa_pcidev pcidev;
160 struct timer_list ioc_timer; 180 struct timer_list ioc_timer;
161 struct timer_list iocpf_timer; 181 struct timer_list iocpf_timer;
162 struct timer_list sem_timer; 182 struct timer_list sem_timer;
163 struct timer_list hb_timer; 183 struct timer_list hb_timer;
164 u32 hb_count; 184 u32 hb_count;
165 struct list_head hb_notify_q; 185 struct list_head notify_q;
166 void *dbg_fwsave; 186 void *dbg_fwsave;
167 int dbg_fwsave_len; 187 int dbg_fwsave_len;
168 bool dbg_fwsave_once; 188 bool dbg_fwsave_once;
169 enum bfi_mclass ioc_mc; 189 enum bfi_mclass ioc_mc;
170 struct bfa_ioc_regs ioc_regs; 190 struct bfa_ioc_regs ioc_regs;
171 struct bfa_ioc_drv_stats stats; 191 struct bfa_ioc_drv_stats stats;
172 bool fcmode; 192 bool fcmode;
173 bool ctdev; 193 bool ctdev;
174 bool cna; 194 bool cna;
175 bool pllinit; 195 bool pllinit;
176 bool stats_busy; /*!< outstanding stats */ 196 bool stats_busy; /*!< outstanding stats */
177 u8 port_id; 197 u8 port_id;
178 198
179 struct bfa_dma attr_dma; 199 struct bfa_dma attr_dma;
@@ -217,9 +237,11 @@ struct bfa_ioc_hwif {
217 BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) 237 BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)
218 238
219#define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++) 239#define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++)
240#define bfa_ioc_stats_hb_count(_ioc, _hb_count) \
241 ((_ioc)->stats.hb_count = (_hb_count))
220#define BFA_IOC_FWIMG_MINSZ (16 * 1024) 242#define BFA_IOC_FWIMG_MINSZ (16 * 1024)
221#define BFA_IOC_FWIMG_TYPE(__ioc) \ 243#define BFA_IOC_FWIMG_TYPE(__ioc) \
222 (((__ioc)->ctdev) ? \ 244 (((__ioc)->ctdev) ? \
223 (((__ioc)->fcmode) ? BFI_IMAGE_CT_FC : BFI_IMAGE_CT_CNA) : \ 245 (((__ioc)->fcmode) ? BFI_IMAGE_CT_FC : BFI_IMAGE_CT_CNA) : \
224 BFI_IMAGE_CB_FC) 246 BFI_IMAGE_CB_FC)
225#define BFA_IOC_FW_SMEM_SIZE(__ioc) \ 247#define BFA_IOC_FW_SMEM_SIZE(__ioc) \
@@ -263,9 +285,10 @@ void bfa_nw_ioc_enable(struct bfa_ioc *ioc);
263void bfa_nw_ioc_disable(struct bfa_ioc *ioc); 285void bfa_nw_ioc_disable(struct bfa_ioc *ioc);
264 286
265void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc); 287void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc);
288bool bfa_nw_ioc_is_disabled(struct bfa_ioc *ioc);
266void bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr); 289void bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr);
267void bfa_nw_ioc_hbfail_register(struct bfa_ioc *ioc, 290void bfa_nw_ioc_notify_register(struct bfa_ioc *ioc,
268 struct bfa_ioc_hbfail_notify *notify); 291 struct bfa_ioc_notify *notify);
269bool bfa_nw_ioc_sem_get(void __iomem *sem_reg); 292bool bfa_nw_ioc_sem_get(void __iomem *sem_reg);
270void bfa_nw_ioc_sem_release(void __iomem *sem_reg); 293void bfa_nw_ioc_sem_release(void __iomem *sem_reg);
271void bfa_nw_ioc_hw_sem_release(struct bfa_ioc *ioc); 294void bfa_nw_ioc_hw_sem_release(struct bfa_ioc *ioc);