1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __BFA_SVC_H__
19#define __BFA_SVC_H__
20
21#include "bfa_cs.h"
22#include "bfi_ms.h"
23
24
25
26
27
28#define BFA_SGPG_MIN (16)
29#define BFA_SGPG_MAX (8192)
30
31
32
33
34#define BFA_SGPG_ROUNDUP(_l) (((_l) + (sizeof(struct bfi_sgpg_s) - 1)) \
35 & ~(sizeof(struct bfi_sgpg_s) - 1))
36
37struct bfa_sgpg_wqe_s {
38 struct list_head qe;
39 int nsgpg;
40 int nsgpg_total;
41 void (*cbfn) (void *cbarg);
42 void *cbarg;
43 struct list_head sgpg_q;
44};
45
46struct bfa_sgpg_s {
47 struct list_head qe;
48 struct bfi_sgpg_s *sgpg;
49 union bfi_addr_u sgpg_pa;
50};
51
52
53
54
55
56#define BFA_SGPG_NPAGE(_nsges) (((_nsges) / BFI_SGPG_DATA_SGES) + 1)
57
58
59#define BFA_SGPG_DMA_SEGS \
60 BFI_MEM_DMA_NSEGS(BFA_SGPG_MAX, (uint32_t)sizeof(struct bfi_sgpg_s))
61
62struct bfa_sgpg_mod_s {
63 struct bfa_s *bfa;
64 int num_sgpgs;
65 int free_sgpgs;
66 struct list_head sgpg_q;
67 struct list_head sgpg_wait_q;
68 struct bfa_mem_dma_s dma_seg[BFA_SGPG_DMA_SEGS];
69 struct bfa_mem_kva_s kva_seg;
70};
71#define BFA_SGPG_MOD(__bfa) (&(__bfa)->modules.sgpg_mod)
72#define BFA_MEM_SGPG_KVA(__bfa) (&(BFA_SGPG_MOD(__bfa)->kva_seg))
73
74bfa_status_t bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q,
75 int nsgpgs);
76void bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs);
77void bfa_sgpg_winit(struct bfa_sgpg_wqe_s *wqe,
78 void (*cbfn) (void *cbarg), void *cbarg);
79void bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpgs);
80void bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe);
81
82
83
84
85
86#define BFA_FCXP_MIN (1)
87#define BFA_FCXP_MAX (256)
88#define BFA_FCXP_MAX_IBUF_SZ (2 * 1024 + 256)
89#define BFA_FCXP_MAX_LBUF_SZ (4 * 1024 + 256)
90
91
92#define BFA_FCXP_DMA_SEGS \
93 BFI_MEM_DMA_NSEGS(BFA_FCXP_MAX, \
94 (u32)BFA_FCXP_MAX_IBUF_SZ + BFA_FCXP_MAX_LBUF_SZ)
95
96struct bfa_fcxp_mod_s {
97 struct bfa_s *bfa;
98 struct bfa_fcxp_s *fcxp_list;
99 u16 num_fcxps;
100 struct list_head fcxp_free_q;
101 struct list_head fcxp_active_q;
102 struct list_head wait_q;
103 struct list_head fcxp_unused_q;
104 u32 req_pld_sz;
105 u32 rsp_pld_sz;
106 struct bfa_mem_dma_s dma_seg[BFA_FCXP_DMA_SEGS];
107 struct bfa_mem_kva_s kva_seg;
108};
109
110#define BFA_FCXP_MOD(__bfa) (&(__bfa)->modules.fcxp_mod)
111#define BFA_FCXP_FROM_TAG(__mod, __tag) (&(__mod)->fcxp_list[__tag])
112#define BFA_MEM_FCXP_KVA(__bfa) (&(BFA_FCXP_MOD(__bfa)->kva_seg))
113
114typedef void (*fcxp_send_cb_t) (struct bfa_s *ioc, struct bfa_fcxp_s *fcxp,
115 void *cb_arg, bfa_status_t req_status,
116 u32 rsp_len, u32 resid_len,
117 struct fchs_s *rsp_fchs);
118
119typedef u64 (*bfa_fcxp_get_sgaddr_t) (void *bfad_fcxp, int sgeid);
120typedef u32 (*bfa_fcxp_get_sglen_t) (void *bfad_fcxp, int sgeid);
121typedef void (*bfa_cb_fcxp_send_t) (void *bfad_fcxp, struct bfa_fcxp_s *fcxp,
122 void *cbarg, enum bfa_status req_status,
123 u32 rsp_len, u32 resid_len,
124 struct fchs_s *rsp_fchs);
125typedef void (*bfa_fcxp_alloc_cbfn_t) (void *cbarg, struct bfa_fcxp_s *fcxp);
126
127
128
129
130
131
132struct bfa_fcxp_req_info_s {
133 struct bfa_rport_s *bfa_rport;
134
135
136
137
138
139
140 struct fchs_s fchs;
141 u8 cts;
142 u8 class;
143 u16 max_frmsz;
144 u16 vf_id;
145 u8 lp_tag;
146 u32 req_tot_len;
147};
148
149struct bfa_fcxp_rsp_info_s {
150 struct fchs_s rsp_fchs;
151
152
153 u8 rsp_timeout;
154
155 u8 rsvd2[3];
156 u32 rsp_maxlen;
157};
158
159struct bfa_fcxp_s {
160 struct list_head qe;
161 bfa_sm_t sm;
162 void *caller;
163 struct bfa_fcxp_mod_s *fcxp_mod;
164
165 u16 fcxp_tag;
166 struct bfa_fcxp_req_info_s req_info;
167
168 struct bfa_fcxp_rsp_info_s rsp_info;
169
170 u8 use_ireqbuf;
171 u8 use_irspbuf;
172 u32 nreq_sgles;
173 u32 nrsp_sgles;
174 struct list_head req_sgpg_q;
175 struct list_head req_sgpg_wqe;
176 struct list_head rsp_sgpg_q;
177 struct list_head rsp_sgpg_wqe;
178
179 bfa_fcxp_get_sgaddr_t req_sga_cbfn;
180
181 bfa_fcxp_get_sglen_t req_sglen_cbfn;
182
183 bfa_fcxp_get_sgaddr_t rsp_sga_cbfn;
184
185 bfa_fcxp_get_sglen_t rsp_sglen_cbfn;
186
187 bfa_cb_fcxp_send_t send_cbfn;
188 void *send_cbarg;
189 struct bfa_sge_s req_sge[BFA_FCXP_MAX_SGES];
190
191 struct bfa_sge_s rsp_sge[BFA_FCXP_MAX_SGES];
192
193 u8 rsp_status;
194 u32 rsp_len;
195 u32 residue_len;
196 struct fchs_s rsp_fchs;
197 struct bfa_cb_qe_s hcb_qe;
198 struct bfa_reqq_wait_s reqq_wqe;
199 bfa_boolean_t reqq_waiting;
200};
201
202struct bfa_fcxp_wqe_s {
203 struct list_head qe;
204 bfa_fcxp_alloc_cbfn_t alloc_cbfn;
205 void *alloc_cbarg;
206 void *caller;
207 struct bfa_s *bfa;
208 int nreq_sgles;
209 int nrsp_sgles;
210 bfa_fcxp_get_sgaddr_t req_sga_cbfn;
211 bfa_fcxp_get_sglen_t req_sglen_cbfn;
212 bfa_fcxp_get_sgaddr_t rsp_sga_cbfn;
213 bfa_fcxp_get_sglen_t rsp_sglen_cbfn;
214};
215
216#define BFA_FCXP_REQ_PLD(_fcxp) (bfa_fcxp_get_reqbuf(_fcxp))
217#define BFA_FCXP_RSP_FCHS(_fcxp) (&((_fcxp)->rsp_info.fchs))
218#define BFA_FCXP_RSP_PLD(_fcxp) (bfa_fcxp_get_rspbuf(_fcxp))
219
220#define BFA_FCXP_REQ_PLD_PA(_fcxp) \
221 bfa_mem_get_dmabuf_pa((_fcxp)->fcxp_mod, (_fcxp)->fcxp_tag, \
222 (_fcxp)->fcxp_mod->req_pld_sz + (_fcxp)->fcxp_mod->rsp_pld_sz)
223
224
225#define BFA_FCXP_RSP_PLD_PA(_fcxp) \
226 (bfa_mem_get_dmabuf_pa((_fcxp)->fcxp_mod, (_fcxp)->fcxp_tag, \
227 (_fcxp)->fcxp_mod->req_pld_sz + (_fcxp)->fcxp_mod->rsp_pld_sz) + \
228 (_fcxp)->fcxp_mod->req_pld_sz)
229
230void bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
231
232
233
234
235
236enum bfa_rport_event {
237 BFA_RPORT_SM_CREATE = 1,
238 BFA_RPORT_SM_DELETE = 2,
239 BFA_RPORT_SM_ONLINE = 3,
240 BFA_RPORT_SM_OFFLINE = 4,
241 BFA_RPORT_SM_FWRSP = 5,
242 BFA_RPORT_SM_HWFAIL = 6,
243 BFA_RPORT_SM_QOS_SCN = 7,
244 BFA_RPORT_SM_SET_SPEED = 8,
245 BFA_RPORT_SM_QRESUME = 9,
246};
247
248#define BFA_RPORT_MIN 4
249
250struct bfa_rport_mod_s {
251 struct bfa_rport_s *rps_list;
252 struct list_head rp_free_q;
253 struct list_head rp_active_q;
254 struct list_head rp_unused_q;
255 u16 num_rports;
256 struct bfa_mem_kva_s kva_seg;
257};
258
259#define BFA_RPORT_MOD(__bfa) (&(__bfa)->modules.rport_mod)
260#define BFA_MEM_RPORT_KVA(__bfa) (&(BFA_RPORT_MOD(__bfa)->kva_seg))
261
262
263
264
265#define BFA_RPORT_FROM_TAG(__bfa, _tag) \
266 (BFA_RPORT_MOD(__bfa)->rps_list + \
267 ((_tag) & (BFA_RPORT_MOD(__bfa)->num_rports - 1)))
268
269
270
271
272void bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
273void bfa_rport_res_recfg(struct bfa_s *bfa, u16 num_rport_fw);
274
275
276
277
278struct bfa_rport_info_s {
279 u16 max_frmsz;
280 u32 pid:24,
281 lp_tag:8;
282 u32 local_pid:24,
283 cisc:8;
284 u8 fc_class;
285 u8 vf_en;
286 u16 vf_id;
287 enum bfa_port_speed speed;
288};
289
290
291
292
293struct bfa_rport_s {
294 struct list_head qe;
295 bfa_sm_t sm;
296 struct bfa_s *bfa;
297 void *rport_drv;
298 u16 fw_handle;
299 u16 rport_tag;
300 u8 lun_mask;
301 struct bfa_rport_info_s rport_info;
302 struct bfa_reqq_wait_s reqq_wait;
303 struct bfa_cb_qe_s hcb_qe;
304 struct bfa_rport_hal_stats_s stats;
305 struct bfa_rport_qos_attr_s qos_attr;
306 union a {
307 bfa_status_t status;
308 void *fw_msg;
309 } event_arg;
310};
311#define BFA_RPORT_FC_COS(_rport) ((_rport)->rport_info.fc_class)
312
313
314
315
316
317
318#define BFA_UF_MIN (4)
319#define BFA_UF_MAX (256)
320
321struct bfa_uf_s {
322 struct list_head qe;
323 struct bfa_s *bfa;
324 u16 uf_tag;
325 u16 vf_id;
326 u16 src_rport_handle;
327 u16 rsvd;
328 u8 *data_ptr;
329 u16 data_len;
330 u16 pb_len;
331 void *buf_kva;
332 u64 buf_pa;
333 struct bfa_cb_qe_s hcb_qe;
334 struct bfa_sge_s sges[BFI_SGE_INLINE_MAX];
335};
336
337
338
339
340
341
342
343
344
345typedef void (*bfa_cb_uf_recv_t) (void *cbarg, struct bfa_uf_s *uf);
346
347#define BFA_UF_BUFSZ (2 * 1024 + 256)
348
349struct bfa_uf_buf_s {
350 u8 d[BFA_UF_BUFSZ];
351};
352
353#define BFA_PER_UF_DMA_SZ \
354 (u32)BFA_ROUNDUP(sizeof(struct bfa_uf_buf_s), BFA_DMA_ALIGN_SZ)
355
356
357#define BFA_UF_DMA_SEGS BFI_MEM_DMA_NSEGS(BFA_UF_MAX, BFA_PER_UF_DMA_SZ)
358
359struct bfa_uf_mod_s {
360 struct bfa_s *bfa;
361 struct bfa_uf_s *uf_list;
362 u16 num_ufs;
363 struct list_head uf_free_q;
364 struct list_head uf_posted_q;
365 struct list_head uf_unused_q;
366 struct bfi_uf_buf_post_s *uf_buf_posts;
367
368 bfa_cb_uf_recv_t ufrecv;
369 void *cbarg;
370 struct bfa_mem_dma_s dma_seg[BFA_UF_DMA_SEGS];
371 struct bfa_mem_kva_s kva_seg;
372};
373
374#define BFA_UF_MOD(__bfa) (&(__bfa)->modules.uf_mod)
375#define BFA_MEM_UF_KVA(__bfa) (&(BFA_UF_MOD(__bfa)->kva_seg))
376
377#define ufm_pbs_pa(_ufmod, _uftag) \
378 bfa_mem_get_dmabuf_pa(_ufmod, _uftag, BFA_PER_UF_DMA_SZ)
379
380void bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
381void bfa_uf_res_recfg(struct bfa_s *bfa, u16 num_uf_fw);
382
383
384
385
386struct bfa_lps_s {
387 struct list_head qe;
388 struct bfa_s *bfa;
389 bfa_sm_t sm;
390 u8 bfa_tag;
391 u8 fw_tag;
392 u8 reqq;
393 u8 alpa;
394 u32 lp_pid;
395 bfa_boolean_t fdisc;
396 bfa_boolean_t auth_en;
397 bfa_boolean_t auth_req;
398 bfa_boolean_t npiv_en;
399 bfa_boolean_t fport;
400 bfa_boolean_t brcd_switch;
401 bfa_status_t status;
402 u16 pdusz;
403 u16 pr_bbcred;
404 u8 pr_bbscn;
405 u8 bb_scn;
406 u8 lsrjt_rsn;
407 u8 lsrjt_expl;
408 u8 lun_mask;
409 wwn_t pwwn;
410 wwn_t nwwn;
411 wwn_t pr_pwwn;
412 wwn_t pr_nwwn;
413 mac_t lp_mac;
414 mac_t fcf_mac;
415 struct bfa_reqq_wait_s wqe;
416 void *uarg;
417 struct bfa_cb_qe_s hcb_qe;
418 struct bfi_lps_login_rsp_s *loginrsp;
419 bfa_eproto_status_t ext_status;
420};
421
422struct bfa_lps_mod_s {
423 struct list_head lps_free_q;
424 struct list_head lps_active_q;
425 struct list_head lps_login_q;
426 struct bfa_lps_s *lps_arr;
427 int num_lps;
428 struct bfa_mem_kva_s kva_seg;
429};
430
431#define BFA_LPS_MOD(__bfa) (&(__bfa)->modules.lps_mod)
432#define BFA_LPS_FROM_TAG(__mod, __tag) (&(__mod)->lps_arr[__tag])
433#define BFA_MEM_LPS_KVA(__bfa) (&(BFA_LPS_MOD(__bfa)->kva_seg))
434
435
436
437
438void bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
439
440
441
442
443
444
445#define BFA_FCPORT(_bfa) (&((_bfa)->modules.port))
446
447
448
449
450struct bfa_fcport_ln_s {
451 struct bfa_fcport_s *fcport;
452 bfa_sm_t sm;
453 struct bfa_cb_qe_s ln_qe;
454 enum bfa_port_linkstate ln_event;
455};
456
457struct bfa_fcport_trunk_s {
458 struct bfa_trunk_attr_s attr;
459};
460
461
462
463
464struct bfa_fcport_s {
465 struct bfa_s *bfa;
466 bfa_sm_t sm;
467 wwn_t nwwn;
468 wwn_t pwwn;
469 enum bfa_port_speed speed_sup;
470
471 enum bfa_port_speed speed;
472 enum bfa_port_topology topology;
473 u8 myalpa;
474 u8 rsvd[3];
475 struct bfa_port_cfg_s cfg;
476 bfa_boolean_t use_flash_cfg;
477 struct bfa_qos_attr_s qos_attr;
478 struct bfa_qos_vc_attr_s qos_vc_attr;
479 struct bfa_reqq_wait_s reqq_wait;
480
481 struct bfa_reqq_wait_s svcreq_wait;
482
483 struct bfa_reqq_wait_s stats_reqq_wait;
484
485 void *event_cbarg;
486 void (*event_cbfn) (void *cbarg,
487 enum bfa_port_linkstate event);
488 union {
489 union bfi_fcport_i2h_msg_u i2hmsg;
490 } event_arg;
491 void *bfad;
492 struct bfa_fcport_ln_s ln;
493 struct bfa_cb_qe_s hcb_qe;
494 struct bfa_timer_s timer;
495 u32 msgtag;
496 u8 *stats_kva;
497 u64 stats_pa;
498 union bfa_fcport_stats_u *stats;
499 bfa_status_t stats_status;
500 struct list_head stats_pending_q;
501 struct list_head statsclr_pending_q;
502 bfa_boolean_t stats_qfull;
503 u32 stats_reset_time;
504 bfa_boolean_t diag_busy;
505 bfa_boolean_t beacon;
506 bfa_boolean_t link_e2e_beacon;
507 bfa_boolean_t bbsc_op_state;
508 struct bfa_fcport_trunk_s trunk;
509 u16 fcoe_vlan;
510 struct bfa_mem_dma_s fcport_dma;
511};
512
513#define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport)
514#define BFA_MEM_FCPORT_DMA(__bfa) (&(BFA_FCPORT_MOD(__bfa)->fcport_dma))
515
516
517
518
519void bfa_fcport_init(struct bfa_s *bfa);
520void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
521
522
523
524
525bfa_status_t bfa_fcport_enable(struct bfa_s *bfa);
526bfa_status_t bfa_fcport_disable(struct bfa_s *bfa);
527bfa_status_t bfa_fcport_cfg_speed(struct bfa_s *bfa,
528 enum bfa_port_speed speed);
529enum bfa_port_speed bfa_fcport_get_speed(struct bfa_s *bfa);
530bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa,
531 enum bfa_port_topology topo);
532enum bfa_port_topology bfa_fcport_get_topology(struct bfa_s *bfa);
533bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
534bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
535u8 bfa_fcport_get_myalpa(struct bfa_s *bfa);
536bfa_status_t bfa_fcport_clr_hardalpa(struct bfa_s *bfa);
537bfa_status_t bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize);
538u16 bfa_fcport_get_maxfrsize(struct bfa_s *bfa);
539u8 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa);
540void bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr);
541wwn_t bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node);
542void bfa_fcport_event_register(struct bfa_s *bfa,
543 void (*event_cbfn) (void *cbarg,
544 enum bfa_port_linkstate event), void *event_cbarg);
545bfa_boolean_t bfa_fcport_is_disabled(struct bfa_s *bfa);
546enum bfa_port_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa);
547
548void bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit, u8 bb_scn);
549bfa_boolean_t bfa_fcport_is_ratelim(struct bfa_s *bfa);
550void bfa_fcport_beacon(void *dev, bfa_boolean_t beacon,
551 bfa_boolean_t link_e2e_beacon);
552bfa_boolean_t bfa_fcport_is_linkup(struct bfa_s *bfa);
553bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
554 struct bfa_cb_pending_q_s *cb);
555bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa,
556 struct bfa_cb_pending_q_s *cb);
557bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
558bfa_boolean_t bfa_fcport_is_trunk_enabled(struct bfa_s *bfa);
559bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
560void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state);
561
562
563
564
565struct bfa_rport_s *bfa_rport_create(struct bfa_s *bfa, void *rport_drv);
566void bfa_rport_online(struct bfa_rport_s *rport,
567 struct bfa_rport_info_s *rport_info);
568void bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed);
569void bfa_cb_rport_online(void *rport);
570void bfa_cb_rport_offline(void *rport);
571void bfa_cb_rport_qos_scn_flowid(void *rport,
572 struct bfa_rport_qos_attr_s old_qos_attr,
573 struct bfa_rport_qos_attr_s new_qos_attr);
574void bfa_cb_rport_qos_scn_prio(void *rport,
575 struct bfa_rport_qos_attr_s old_qos_attr,
576 struct bfa_rport_qos_attr_s new_qos_attr);
577
578
579
580
581#define BFA_RPORT_TAG_INVALID 0xffff
582#define BFA_LP_TAG_INVALID 0xff
583void bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
584void bfa_rport_unset_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
585bfa_boolean_t bfa_rport_lunmask_active(struct bfa_rport_s *rp);
586wwn_t bfa_rport_get_pwwn(struct bfa_s *bfa, struct bfa_rport_s *rp);
587struct bfa_rport_s *bfa_rport_get_by_wwn(struct bfa_s *bfa, u16 vf_id,
588 wwn_t *lpwwn, wwn_t rpwwn);
589void *bfa_cb_get_rp_by_wwn(void *arg, u16 vf_id, wwn_t *lpwwn, wwn_t rpwwn);
590
591
592
593
594struct bfa_fcxp_s *bfa_fcxp_alloc(void *bfad_fcxp, struct bfa_s *bfa,
595 int nreq_sgles, int nrsp_sgles,
596 bfa_fcxp_get_sgaddr_t get_req_sga,
597 bfa_fcxp_get_sglen_t get_req_sglen,
598 bfa_fcxp_get_sgaddr_t get_rsp_sga,
599 bfa_fcxp_get_sglen_t get_rsp_sglen);
600void bfa_fcxp_alloc_wait(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe,
601 bfa_fcxp_alloc_cbfn_t alloc_cbfn,
602 void *cbarg, void *bfad_fcxp,
603 int nreq_sgles, int nrsp_sgles,
604 bfa_fcxp_get_sgaddr_t get_req_sga,
605 bfa_fcxp_get_sglen_t get_req_sglen,
606 bfa_fcxp_get_sgaddr_t get_rsp_sga,
607 bfa_fcxp_get_sglen_t get_rsp_sglen);
608void bfa_fcxp_walloc_cancel(struct bfa_s *bfa,
609 struct bfa_fcxp_wqe_s *wqe);
610void bfa_fcxp_discard(struct bfa_fcxp_s *fcxp);
611
612void *bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp);
613void *bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp);
614
615void bfa_fcxp_free(struct bfa_fcxp_s *fcxp);
616
617void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
618 u16 vf_id, u8 lp_tag,
619 bfa_boolean_t cts, enum fc_cos cos,
620 u32 reqlen, struct fchs_s *fchs,
621 bfa_cb_fcxp_send_t cbfn,
622 void *cbarg,
623 u32 rsp_maxlen, u8 rsp_timeout);
624bfa_status_t bfa_fcxp_abort(struct bfa_fcxp_s *fcxp);
625u32 bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp);
626u32 bfa_fcxp_get_maxrsp(struct bfa_s *bfa);
627void bfa_fcxp_res_recfg(struct bfa_s *bfa, u16 num_fcxp_fw);
628
629static inline void *
630bfa_uf_get_frmbuf(struct bfa_uf_s *uf)
631{
632 return uf->data_ptr;
633}
634
635static inline u16
636bfa_uf_get_frmlen(struct bfa_uf_s *uf)
637{
638 return uf->data_len;
639}
640
641
642
643
644void bfa_uf_recv_register(struct bfa_s *bfa, bfa_cb_uf_recv_t ufrecv,
645 void *cbarg);
646void bfa_uf_free(struct bfa_uf_s *uf);
647
648
649
650
651
652u32 bfa_lps_get_max_vport(struct bfa_s *bfa);
653struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa);
654void bfa_lps_delete(struct bfa_lps_s *lps);
655void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa,
656 u16 pdusz, wwn_t pwwn, wwn_t nwwn,
657 bfa_boolean_t auth_en, u8 bb_scn);
658void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz,
659 wwn_t pwwn, wwn_t nwwn);
660void bfa_lps_fdisclogo(struct bfa_lps_s *lps);
661void bfa_lps_set_n2n_pid(struct bfa_lps_s *lps, u32 n2n_pid);
662u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
663u32 bfa_lps_get_base_pid(struct bfa_s *bfa);
664u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid);
665void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status);
666void bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status);
667void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg);
668void bfa_cb_lps_cvl_event(void *bfad, void *uarg);
669
670
671bfa_status_t bfa_faa_enable(struct bfa_s *bfa,
672 bfa_cb_iocfc_t cbfn, void *cbarg);
673bfa_status_t bfa_faa_disable(struct bfa_s *bfa,
674 bfa_cb_iocfc_t cbfn, void *cbarg);
675bfa_status_t bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr,
676 bfa_cb_iocfc_t cbfn, void *cbarg);
677
678
679
680
681struct bfa_fcdiag_qtest_s {
682 struct bfa_diag_qtest_result_s *result;
683 bfa_cb_diag_t cbfn;
684 void *cbarg;
685 struct bfa_timer_s timer;
686 u32 status;
687 u32 count;
688 u8 lock;
689 u8 queue;
690 u8 all;
691 u8 timer_active;
692};
693
694struct bfa_fcdiag_lb_s {
695 bfa_cb_diag_t cbfn;
696 void *cbarg;
697 void *result;
698 bfa_boolean_t lock;
699 u32 status;
700};
701
702struct bfa_fcdiag_s {
703 struct bfa_s *bfa;
704 struct bfa_trc_mod_s *trcmod;
705 struct bfa_fcdiag_lb_s lb;
706 struct bfa_fcdiag_qtest_s qtest;
707};
708
709#define BFA_FCDIAG_MOD(__bfa) (&(__bfa)->modules.fcdiag)
710
711void bfa_fcdiag_intr(struct bfa_s *bfa, struct bfi_msg_s *msg);
712
713bfa_status_t bfa_fcdiag_loopback(struct bfa_s *bfa,
714 enum bfa_port_opmode opmode,
715 enum bfa_port_speed speed, u32 lpcnt, u32 pat,
716 struct bfa_diag_loopback_result_s *result,
717 bfa_cb_diag_t cbfn, void *cbarg);
718bfa_status_t bfa_fcdiag_queuetest(struct bfa_s *bfa, u32 ignore,
719 u32 queue, struct bfa_diag_qtest_result_s *result,
720 bfa_cb_diag_t cbfn, void *cbarg);
721bfa_status_t bfa_fcdiag_lb_is_running(struct bfa_s *bfa);
722
723#endif
724