36 #define BFA_LPS_MIN_LPORTS (1)
37 #define BFA_LPS_MAX_LPORTS (256)
42 #define BFA_LPS_MAX_VPORTS_SUPP_CB 255
43 #define BFA_LPS_MAX_VPORTS_SUPP_CT 190
53 #define BFA_PORT_IS_DISABLED(bfa) \
54 ((bfa_fcport_is_disabled(bfa) == BFA_TRUE) || \
55 (bfa_ioc_is_disabled(&bfa->ioc) == BFA_TRUE))
88 #define bfa_rport_offline_cb(__rp) do { \
89 if ((__rp)->bfa->fcs) \
90 bfa_cb_rport_offline((__rp)->rport_drv); \
92 bfa_cb_queue((__rp)->bfa, &(__rp)->hcb_qe, \
93 __bfa_cb_rport_offline, (__rp)); \
97 #define bfa_rport_online_cb(__rp) do { \
98 if ((__rp)->bfa->fcs) \
99 bfa_cb_rport_online((__rp)->rport_drv); \
101 bfa_cb_queue((__rp)->bfa, &(__rp)->hcb_qe, \
102 __bfa_cb_rport_online, (__rp)); \
110 static void hal_fcxp_rx_plog(
struct bfa_s *bfa,
struct bfa_fcxp_s *fcxp,
112 static void hal_fcxp_tx_plog(
struct bfa_s *bfa,
u32 reqlen,
114 static void bfa_fcxp_qresume(
void *cbarg);
115 static void bfa_fcxp_queue(
struct bfa_fcxp_s *fcxp,
123 static void bfa_lps_attach(
struct bfa_s *bfa,
void *bfad,
126 static void bfa_lps_detach(
struct bfa_s *bfa);
127 static void bfa_lps_start(
struct bfa_s *bfa);
128 static void bfa_lps_stop(
struct bfa_s *bfa);
129 static void bfa_lps_iocdisable(
struct bfa_s *bfa);
130 static void bfa_lps_login_rsp(
struct bfa_s *bfa,
133 static void bfa_lps_logout_rsp(
struct bfa_s *bfa,
135 static void bfa_lps_reqq_resume(
void *lps_arg);
136 static void bfa_lps_free(
struct bfa_lps_s *lps);
137 static void bfa_lps_send_login(
struct bfa_lps_s *lps);
138 static void bfa_lps_send_logout(
struct bfa_lps_s *lps);
139 static void bfa_lps_send_set_n2n_pid(
struct bfa_lps_s *lps);
140 static void bfa_lps_login_comp(
struct bfa_lps_s *lps);
141 static void bfa_lps_logout_comp(
struct bfa_lps_s *lps);
142 static void bfa_lps_cvl_event(
struct bfa_lps_s *lps);
152 static void bfa_lps_sm_online_n2n_pid_wait(
struct bfa_lps_s *lps,
163 static void bfa_fcport_update_linkinfo(
struct bfa_fcport_s *fcport);
164 static void bfa_fcport_reset_linkinfo(
struct bfa_fcport_s *fcport);
165 static void bfa_fcport_set_wwns(
struct bfa_fcport_s *fcport);
172 static void bfa_fcport_stats_get_timeout(
void *cbarg);
173 static void bfa_fcport_stats_clr_timeout(
void *cbarg);
174 static void bfa_trunk_iocdisable(
struct bfa_s *bfa);
179 static void bfa_fcport_sm_uninit(
struct bfa_fcport_s *fcport,
181 static void bfa_fcport_sm_enabling_qwait(
struct bfa_fcport_s *fcport,
183 static void bfa_fcport_sm_enabling(
struct bfa_fcport_s *fcport,
185 static void bfa_fcport_sm_linkdown(
struct bfa_fcport_s *fcport,
187 static void bfa_fcport_sm_linkup(
struct bfa_fcport_s *fcport,
189 static void bfa_fcport_sm_disabling(
struct bfa_fcport_s *fcport,
191 static void bfa_fcport_sm_disabling_qwait(
struct bfa_fcport_s *fcport,
193 static void bfa_fcport_sm_toggling_qwait(
struct bfa_fcport_s *fcport,
195 static void bfa_fcport_sm_disabled(
struct bfa_fcport_s *fcport,
197 static void bfa_fcport_sm_stopped(
struct bfa_fcport_s *fcport,
199 static void bfa_fcport_sm_iocdown(
struct bfa_fcport_s *fcport,
201 static void bfa_fcport_sm_iocfail(
struct bfa_fcport_s *fcport,
203 static void bfa_fcport_sm_dport(
struct bfa_fcport_s *fcport,
205 static void bfa_fcport_sm_faa_misconfig(
struct bfa_fcport_s *fcport,
249 static void __bfa_cb_rport_online(
void *cbarg,
251 static void __bfa_cb_rport_offline(
void *cbarg,
271 static void bfa_rport_sm_offline_pending(
struct bfa_rport_s *
rp,
273 static void bfa_rport_sm_delete_pending(
struct bfa_rport_s *
rp,
277 static void bfa_rport_sm_fwcreate_qfull(
struct bfa_rport_s *
rp,
279 static void bfa_rport_sm_fwdelete_qfull(
struct bfa_rport_s *
rp,
281 static void bfa_rport_sm_deleting_qfull(
struct bfa_rport_s *
rp,
302 bfa_get_log_time(
void)
309 system_time = tv.tv_sec;
322 if (plkd_validate_logrec(pl_rec)) {
333 pl_recp->
tv = bfa_get_log_time();
366 bfa_plog_add(plog, &lp);
388 for (i = 0; i < num_ints; i++)
393 bfa_plog_add(plog, &lp);
403 u32 *tmp_int = (
u32 *) fchdr;
409 ints[0] = tmp_int[0];
410 ints[1] = tmp_int[1];
411 ints[2] = tmp_int[4];
423 u32 *tmp_int = (
u32 *) fchdr;
429 ints[0] = tmp_int[0];
430 ints[1] = tmp_int[1];
431 ints[2] = tmp_int[4];
472 bfa_reqq_winit(&fcxp->
reqq_wqe, bfa_fcxp_qresume, fcxp);
488 u16 nsegs,
idx, per_seg_fcxp;
505 if (num_fcxps >= per_seg_fcxp) {
506 num_fcxps -= per_seg_fcxp;
508 per_seg_fcxp * per_fcxp_sz);
511 num_fcxps * per_fcxp_sz);
538 claim_fcxps_mem(mod);
542 bfa_fcxp_detach(
struct bfa_s *bfa)
547 bfa_fcxp_start(
struct bfa_s *bfa)
552 bfa_fcxp_stop(
struct bfa_s *bfa)
557 bfa_fcxp_iocdisable(
struct bfa_s *bfa)
576 __bfa_fcxp_send_cbfn, fcxp);
621 *r_sga_cbfn = sga_cbfn;
622 *r_sglen_cbfn = sglen_cbfn;
650 bfa_fcxp_init_reqrsp(fcxp, bfa,
653 nreq_sgles, req_sga_cbfn, req_sglen_cbfn);
655 bfa_fcxp_init_reqrsp(fcxp, bfa,
658 nrsp_sgles, rsp_sga_cbfn, rsp_sglen_cbfn);
740 hal_fcxp_rx_plog(mod->
bfa, fcxp, fcxp_rsp);
759 __bfa_fcxp_send_cbfn, fcxp);
780 reqlen +
sizeof(
struct fchs_s), fchs,
785 reqlen +
sizeof(
struct fchs_s),
790 reqlen +
sizeof(
struct fchs_s), fchs);
806 &fcxp_rsp->
fchs, pld_w0);
823 bfa_fcxp_qresume(
void *cbarg)
831 bfa_fcxp_queue(fcxp, send_req);
863 send_req->
cts = reqi->
cts;
956 bfa_fcxp_init(fcxp, caller, bfa, nreq_sgles, nrsp_sgles, req_sga_cbfn,
957 req_sglen_cbfn, rsp_sga_cbfn, rsp_sglen_cbfn);
1053 void *cbarg,
u32 rsp_maxlen,
u8 rsp_timeout)
1074 fcxp->
send_cbfn = cbfn ? cbfn : bfa_fcxp_null_comp;
1088 bfa_fcxp_queue(fcxp, send_req);
1109 void *
caller,
int nreq_sgles,
1169 switch (msg->
mhdr.msg_id) {
1195 for (i = 0; i < (mod->
num_fcxps - num_fcxp_fw); i++) {
1196 if (i < ((mod->
num_fcxps - num_fcxp_fw) / 2)) {
1226 bfa_lps_send_login(lps);
1238 bfa_lps_logout_comp(lps);
1299 "FDISC Fail (RJT or timeout)");
1303 "FLOGI Fail (RJT or timeout)");
1305 bfa_lps_login_comp(lps);
1334 bfa_lps_send_login(lps);
1372 bfa_lps_send_logout(lps);
1382 bfa_lps_cvl_event(lps);
1392 bfa_lps_send_set_n2n_pid(lps);
1417 bfa_lps_send_set_n2n_pid(lps);
1431 bfa_lps_cvl_event(lps);
1460 bfa_lps_logout_comp(lps);
1484 bfa_lps_send_logout(lps);
1545 for (i = 0; i < mod->
num_lps; i++, lps++) {
1549 bfa_reqq_winit(&lps->
wqe, bfa_lps_reqq_resume, lps);
1555 bfa_lps_detach(
struct bfa_s *bfa)
1560 bfa_lps_start(
struct bfa_s *bfa)
1565 bfa_lps_stop(
struct bfa_s *bfa)
1573 bfa_lps_iocdisable(
struct bfa_s *bfa)
1650 struct bfa_s *bfa = first_lps->
bfa;
1659 while (count && qe) {
1705 bfa_lps_reqq_resume(
void *lps_arg)
1729 bfa_lps_send_login(
struct bfa_lps_s *lps)
1758 bfa_lps_send_logout(
struct bfa_lps_s *lps)
1777 bfa_lps_send_set_n2n_pid(
struct bfa_lps_s *lps)
1813 bfa_lps_login_comp(
struct bfa_lps_s *lps)
1815 if (!lps->
bfa->fcs) {
1848 bfa_lps_logout_comp(
struct bfa_lps_s *lps)
1850 if (!lps->
bfa->fcs) {
1880 bfa_lps_cvl_event(
struct bfa_lps_s *lps)
1882 if (!lps->
bfa->fcs) {
2001 for (i = 0, lps = mod->
lps_arr; i < mod->num_lps; i++, lps++) {
2046 switch (m->
mhdr.msg_id) {
2056 bfa_lps_rx_cvl_event(bfa, msg.
cvl_event);
2076 aen_entry->aen_data.port.pwwn = fcport->
pwwn;
2099 if (bfa_fcport_send_enable(fcport)) {
2105 bfa_fcport_sm_enabling_qwait);
2135 bfa_fcport_sm_enabling_qwait(
struct bfa_fcport_s *fcport,
2145 bfa_fcport_send_enable(fcport);
2168 wwn2str(pwwn_buf, fcport->
pwwn);
2170 "Base port disabled: WWN = %s\n", pwwn_buf);
2188 bfa_fcport_reset_linkinfo(fcport);
2213 bfa_fcport_update_linkinfo(fcport);
2227 if (bfa_fcport_send_disable(fcport))
2231 bfa_fcport_sm_disabling_qwait);
2235 wwn2str(pwwn_buf, fcport->
pwwn);
2237 "Base port disabled: WWN = %s\n", pwwn_buf);
2250 bfa_fcport_reset_linkinfo(fcport);
2272 bfa_fcport_update_linkinfo(fcport);
2280 pevent->
link_state.attr.vc_fcf.fcf.fipenabled);
2282 pevent->
link_state.attr.vc_fcf.fcf.fipfailed);
2284 if (pevent->
link_state.attr.vc_fcf.fcf.fipfailed)
2287 "FIP FCF Discovery Failed");
2291 "FIP FCF Discovered");
2295 wwn2str(pwwn_buf, fcport->
pwwn);
2297 "Base port online: WWN = %s\n", pwwn_buf);
2301 if (fcport->
cfg.qos_enabled &&
2319 if (bfa_fcport_send_disable(fcport))
2323 bfa_fcport_sm_disabling_qwait);
2327 wwn2str(pwwn_buf, fcport->
pwwn);
2329 "Base port disabled: WWN = %s\n", pwwn_buf);
2342 bfa_fcport_reset_linkinfo(fcport);
2369 if (bfa_fcport_send_disable(fcport))
2373 bfa_fcport_sm_disabling_qwait);
2375 bfa_fcport_reset_linkinfo(fcport);
2379 wwn2str(pwwn_buf, fcport->
pwwn);
2381 "Base port offline: WWN = %s\n", pwwn_buf);
2384 "Base port disabled: WWN = %s\n", pwwn_buf);
2390 bfa_fcport_reset_linkinfo(fcport);
2394 wwn2str(pwwn_buf, fcport->
pwwn);
2397 "Base port offline: WWN = %s\n", pwwn_buf);
2401 "Base port (WWN = %s) "
2402 "lost fabric connectivity\n", pwwn_buf);
2409 bfa_fcport_reset_linkinfo(fcport);
2410 wwn2str(pwwn_buf, fcport->
pwwn);
2413 "Base port offline: WWN = %s\n", pwwn_buf);
2417 "Base port (WWN = %s) "
2418 "lost fabric connectivity\n", pwwn_buf);
2425 bfa_fcport_reset_linkinfo(fcport);
2427 wwn2str(pwwn_buf, fcport->
pwwn);
2430 "Base port offline: WWN = %s\n", pwwn_buf);
2434 "Base port (WWN = %s) "
2435 "lost fabric connectivity\n", pwwn_buf);
2441 bfa_fcport_reset_linkinfo(fcport);
2452 bfa_fcport_sm_disabling_qwait(
struct bfa_fcport_s *fcport,
2460 bfa_fcport_send_disable(fcport);
2492 bfa_fcport_reset_linkinfo(fcport);
2503 bfa_fcport_sm_toggling_qwait(
struct bfa_fcport_s *fcport,
2511 bfa_fcport_send_disable(fcport);
2512 if (bfa_fcport_send_enable(fcport))
2516 bfa_fcport_sm_enabling_qwait);
2569 if (bfa_fcport_send_enable(fcport))
2573 bfa_fcport_sm_enabling_qwait);
2577 wwn2str(pwwn_buf, fcport->
pwwn);
2579 "Base port enabled: WWN = %s\n", pwwn_buf);
2624 if (bfa_fcport_send_enable(fcport))
2628 bfa_fcport_sm_enabling_qwait);
2632 wwn2str(pwwn_buf, fcport->
pwwn);
2634 "Base port enabled: WWN = %s\n", pwwn_buf);
2665 if (bfa_fcport_send_enable(fcport))
2669 bfa_fcport_sm_enabling_qwait);
2691 if (bfa_fcport_send_enable(fcport))
2695 bfa_fcport_sm_enabling_qwait);
2765 bfa_fcport_sm_faa_misconfig(
struct bfa_fcport_s *fcport,
2780 if (bfa_fcport_send_disable(fcport))
2785 bfa_fcport_reset_linkinfo(fcport);
2797 bfa_fcport_reset_linkinfo(fcport);
2984 if (fcport->
cfg.trunked && !trunk)
3004 if (fcport->
bfa->fcs) {
3010 __bfa_cb_fcport_event, ln);
3014 #define FCPORT_STATS_DMA_SZ (BFA_ROUNDUP(sizeof(union bfa_fcport_stats_u), \
3027 bfa_fcport_qresume(
void *cbarg)
3060 bfa_fcport_mem_claim(fcport);
3088 bfa_reqq_winit(&fcport->
reqq_wait, bfa_fcport_qresume, fcport);
3092 bfa_fcport_detach(
struct bfa_s *bfa)
3100 bfa_fcport_start(
struct bfa_s *bfa)
3109 bfa_fcport_stop(
struct bfa_s *bfa)
3112 bfa_trunk_iocdisable(bfa);
3119 bfa_fcport_iocdisable(
struct bfa_s *bfa)
3124 bfa_trunk_iocdisable(bfa);
3131 bfa_fcport_update_loop_info(
struct bfa_fcport_s *fcport,
3138 loop_info->
alpabm.alpa_bm,
3143 bfa_fcport_update_linkinfo(
struct bfa_fcport_s *fcport)
3152 bfa_fcport_update_loop_info(fcport,
3164 if (!fcport->
cfg.trunked)
3265 fcport->
pwwn = fcport->
bfa->ioc.attr->pwwn;
3266 fcport->
nwwn = fcport->
bfa->ioc.attr->nwwn;
3306 __bfa_cb_fcport_stats_get(
void *cbarg,
bfa_boolean_t complete)
3325 bfa_fcport_qos_stats_swap(&ret->
fcqos,
3328 bfa_fcport_fcoe_stats_swap(&ret->
fcoe,
3330 ret->
fcoe.secs_reset =
3345 bfa_fcport_stats_get_timeout(
void *cbarg)
3357 __bfa_cb_fcport_stats_get(fcport,
BFA_TRUE);
3361 bfa_fcport_send_stats_get(
void *cbarg)
3371 bfa_fcport_send_stats_get, fcport);
3385 __bfa_cb_fcport_stats_clr(
void *cbarg,
bfa_boolean_t complete)
3413 bfa_fcport_stats_clr_timeout(
void *cbarg)
3425 __bfa_cb_fcport_stats_clr(fcport,
BFA_TRUE);
3429 bfa_fcport_send_stats_clear(
void *cbarg)
3439 bfa_fcport_send_stats_clear, fcport);
3476 state_prev = trunk->
attr.state;
3481 lattr = &trunk->
attr.link_attr[
i];
3524 if ((state_prev != trunk->
attr.state) ||
3532 bfa_trunk_iocdisable(
struct bfa_s *bfa)
3540 if (fcport->
cfg.trunked) {
3547 fcport->
trunk.attr.link_attr[
i].trunk_wwn = 0;
3548 fcport->
trunk.attr.link_attr[
i].fctl =
3550 fcport->
trunk.attr.link_attr[
i].link_state =
3552 fcport->
trunk.attr.link_attr[
i].speed =
3554 fcport->
trunk.attr.link_attr[
i].deskew = 0;
3570 bfa_fcport_set_wwns(fcport);
3571 if (fcport->
cfg.maxfrsize == 0)
3597 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->
sm));
3599 switch (msg->
mhdr.msg_id) {
3606 fcport->
cfg.maxfrsize =
3608 fcport->
cfg.path_tov =
3610 fcport->
cfg.q_depth =
3613 if (fcport->
cfg.trunked)
3614 fcport->
trunk.attr.state =
3617 fcport->
trunk.attr.state =
3624 if (fcport->
cfg.qos_enabled)
3645 if (i2hmsg.
event->link_state.linkstate_rsn ==
3654 i2hmsg.
event->link_state.qos_attr.qos_bw_op;
3658 bfa_trunk_scn(fcport, i2hmsg.
trunk_scn);
3671 __bfa_cb_fcport_stats_get(fcport,
BFA_TRUE);
3684 __bfa_cb_fcport_stats_clr(fcport,
BFA_TRUE);
3706 void (*cbfn) (
void *cbarg,
3815 return fcport->
speed;
3881 return fcport->
cfg.topology;
3894 fcport->
cfg.hardalpa = alpa;
3916 *alpa = fcport->
cfg.hardalpa;
3917 return fcport->
cfg.cfg_hardalpa;
3941 if ((maxfrsize !=
FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1)))
3944 fcport->
cfg.maxfrsize = maxfrsize;
3953 return fcport->
cfg.maxfrsize;
3971 fcport->
cfg.tx_bbcredit = (
u8)tx_bbcredit;
3972 fcport->
cfg.bb_scn = bb_scn;
3986 return fcport->
nwwn;
3988 return fcport->
pwwn;
4023 attr->
port_state = bfa_sm_to_state(hal_port_sm_table, fcport->
sm);
4040 #define BFA_FCPORT_STATS_TOV 1000
4059 bfa_fcport_send_stats_get(fcport);
4061 bfa_fcport_stats_get_timeout,
4086 bfa_fcport_send_stats_clear(fcport);
4088 bfa_fcport_stats_clr_timeout,
4104 return bfa_sm_to_state(hal_port_sm_table, fcport->
sm) ==
4114 return (bfa_sm_to_state(hal_port_sm_table, fcport->
sm) ==
4126 if ((qos_bw->
high == 0) || (qos_bw->
med == 0) || (qos_bw->
low == 0))
4129 if ((qos_bw->
high + qos_bw->
med + qos_bw->
low) != 100)
4132 if ((qos_bw->
med > qos_bw->
high) || (qos_bw->
low > qos_bw->
med) ||
4138 fcport->
cfg.qos_bw = *qos_bw;
4173 return fcport->
cfg.trl_def_speed;
4185 bfa_trc(bfa, link_e2e_beacon);
4198 return (!fcport->
cfg.trunked &&
4200 (fcport->
cfg.trunked &&
4209 return fcport->
cfg.qos_enabled;
4217 return fcport->
cfg.trunked;
4273 if (bfa_rport_send_fwcreate(rp))
4345 bfa_rport_send_fwcreate(rp);
4388 if (bfa_rport_send_fwdelete(rp))
4396 if (bfa_rport_send_fwdelete(rp))
4408 bfa_rport_send_fwspeed(rp);
4484 bfa_rport_send_fwdelete(rp);
4523 if (bfa_rport_send_fwcreate(rp))
4581 bfa_rport_send_fwdelete(rp);
4600 bfa_rport_sm_delete_pending(
struct bfa_rport_s *rp,
4609 if (bfa_rport_send_fwdelete(rp))
4631 bfa_rport_sm_offline_pending(
struct bfa_rport_s *rp,
4640 if (bfa_rport_send_fwdelete(rp))
4686 if (bfa_rport_send_fwcreate(rp))
4726 bfa_rport_qresume(
void *cbarg)
4766 for (i = 0; i < mod->
num_rports; i++, rp++) {
4778 bfa_reqq_winit(&rp->
reqq_wait, bfa_rport_qresume, rp);
4788 bfa_rport_detach(
struct bfa_s *bfa)
4793 bfa_rport_start(
struct bfa_s *bfa)
4798 bfa_rport_stop(
struct bfa_s *bfa)
4803 bfa_rport_iocdisable(
struct bfa_s *bfa)
4943 switch (m->
mhdr.msg_id) {
4994 for (i = 0; i < (mod->
num_rports - num_rport_fw); i++) {
5059 wwn_t lp_wwn, rp_wwn;
5075 wwn_t lp_wwn, rp_wwn;
5100 u16 nsegs,
idx, per_seg_sgpg, num_sgpg;
5108 num_sgpg = cfg->
drvcfg.num_sgpgs;
5114 if (num_sgpg >= per_seg_sgpg) {
5115 num_sgpg -= per_seg_sgpg;
5117 per_seg_sgpg * sgpg_sz);
5120 num_sgpg * sgpg_sz);
5138 u16 i,
idx, nsegs, per_seg_sgpg, num_sgpg;
5143 } sgpg_pa, sgpg_pa_tmp;
5145 INIT_LIST_HEAD(&mod->
sgpg_q);
5152 num_sgpg = cfg->
drvcfg.num_sgpgs;
5169 WARN_ON(sgpg_pa.pa & (sgpg_sz - 1));
5171 per_seg_sgpg = (seg_ptr->
mem_len - (
u32)align_len) / sgpg_sz;
5173 for (i = 0; num_sgpg > 0 && i < per_seg_sgpg; i++, num_sgpg--) {
5174 memset(hsgpg, 0,
sizeof(*hsgpg));
5175 memset(sgpg, 0,
sizeof(*sgpg));
5179 hsgpg->
sgpg_pa = sgpg_pa_tmp.addr;
5184 sgpg_pa.pa += sgpg_sz;
5192 bfa_sgpg_detach(
struct bfa_s *bfa)
5197 bfa_sgpg_start(
struct bfa_s *bfa)
5202 bfa_sgpg_stop(
struct bfa_s *bfa)
5207 bfa_sgpg_iocdisable(
struct bfa_s *bfa)
5221 for (i = 0; i < nsgpgs; i++) {
5240 list_splice_tail_init(sgpg_q, &mod->
sgpg_q);
5256 if (wqe->
nsgpg == 0) {
5306 INIT_LIST_HEAD(&wqe->
sgpg_q);
5339 for (i = 0, uf_bp_msg = ufm->
uf_buf_posts; i < ufm->num_ufs;
5371 for (i = 0, uf = ufm->
uf_list; i < ufm->num_ufs; i++, uf++) {
5391 claim_uf_post_msgs(ufm);
5400 u32 num_ufs = cfg->
fwcfg.num_uf_bufs;
5402 u16 nsegs,
idx, per_seg_uf = 0;
5408 if (num_ufs >= per_seg_uf) {
5409 num_ufs -= per_seg_uf;
5438 bfa_uf_detach(
struct bfa_s *bfa)
5481 while ((uf = bfa_uf_get(uf_mod)) !=
NULL) {
5499 buf = &uf_buf->
d[0];
5504 fchs = (
struct fchs_s *)uf_buf;
5520 (
struct fchs_s *)buf, pld_w0);
5530 bfa_uf_stop(
struct bfa_s *bfa)
5535 bfa_uf_iocdisable(
struct bfa_s *bfa)
5547 bfa_uf_put(ufm, uf);
5552 bfa_uf_start(
struct bfa_s *bfa)
5597 switch (msg->
mhdr.msg_id) {
5615 for (i = 0; i < (mod->
num_ufs - num_uf_fw); i++) {
5636 static void bfa_dport_sm_disabled(
struct bfa_dport_s *dport,
5638 static void bfa_dport_sm_enabling_qwait(
struct bfa_dport_s *dport,
5640 static void bfa_dport_sm_enabling(
struct bfa_dport_s *dport,
5642 static void bfa_dport_sm_enabled(
struct bfa_dport_s *dport,
5644 static void bfa_dport_sm_disabling_qwait(
struct bfa_dport_s *dport,
5646 static void bfa_dport_sm_disabling(
struct bfa_dport_s *dport,
5648 static void bfa_dport_qresume(
void *cbarg);
5649 static void bfa_dport_req_comp(
struct bfa_dport_s *dport,
5655 #define BFA_DIAG_QTEST_TOV 1000
5661 bfa_fcdiag_set_busy_status(
struct bfa_fcdiag_s *fcdiag)
5665 if (fcdiag->
lb.lock)
5689 bfa_reqq_winit(&dport->
reqq_wait, bfa_dport_qresume, dport);
5695 bfa_fcdiag_iocdisable(
struct bfa_s *bfa)
5701 if (fcdiag->
lb.lock) {
5703 fcdiag->
lb.cbfn(fcdiag->
lb.cbarg, fcdiag->
lb.status);
5704 fcdiag->
lb.lock = 0;
5705 bfa_fcdiag_set_busy_status(fcdiag);
5712 bfa_fcdiag_detach(
struct bfa_s *bfa)
5717 bfa_fcdiag_start(
struct bfa_s *bfa)
5722 bfa_fcdiag_stop(
struct bfa_s *bfa)
5727 bfa_fcdiag_queuetest_timeout(
void *cbarg)
5735 fcdiag->
qtest.timer_active = 0;
5739 if (fcdiag->
qtest.all)
5745 fcdiag->
qtest.lock = 0;
5780 if (!fcdiag->
qtest.timer_active) {
5786 fcdiag->
qtest.count--;
5797 if (fcdiag->
qtest.count > 0) {
5798 status = bfa_fcdiag_queuetest_send(fcdiag);
5803 }
else if (fcdiag->
qtest.all > 0 &&
5806 fcdiag->
qtest.queue++;
5807 status = bfa_fcdiag_queuetest_send(fcdiag);
5816 if (fcdiag->
qtest.timer_active) {
5818 fcdiag->
qtest.timer_active = 0;
5826 fcdiag->
qtest.lock = 0;
5841 fcdiag->
lb.status = rsp->
res.status;
5843 fcdiag->
lb.cbfn(fcdiag->
lb.cbarg, fcdiag->
lb.status);
5844 fcdiag->
lb.lock = 0;
5845 bfa_fcdiag_set_busy_status(fcdiag);
5885 switch (msg->
mhdr.msg_id) {
5887 bfa_fcdiag_loopback_comp(fcdiag,
5991 if (fcdiag->
lb.lock) {
5996 fcdiag->
lb.lock = 1;
5998 loopback.
speed = speed;
6002 fcdiag->
lb.cbfn = cbfn;
6003 fcdiag->
lb.cbarg = cbarg;
6005 bfa_fcdiag_set_busy_status(fcdiag);
6008 status = bfa_fcdiag_loopback_send(fcdiag, &loopback);
6038 if (fcdiag->
qtest.lock) {
6044 fcdiag->
qtest.lock = 1;
6045 fcdiag->
qtest.cbfn = cbfn;
6046 fcdiag->
qtest.cbarg = cbarg;
6052 fcdiag->
qtest.result->count = 0;
6056 fcdiag->
qtest.result->queue = (
u8)queue;
6057 fcdiag->
qtest.queue = (
u8)queue;
6058 fcdiag->
qtest.all = 0;
6060 fcdiag->
qtest.result->queue = 0;
6061 fcdiag->
qtest.queue = 0;
6062 fcdiag->
qtest.all = 1;
6064 status = bfa_fcdiag_queuetest_send(fcdiag);
6069 bfa_fcdiag_queuetest_timeout, fcdiag,
6071 fcdiag->
qtest.timer_active = 1;
6133 bfa_dport_sm_enabling_qwait(
struct bfa_dport_s *dport,
6203 bfa_dport_sm_disabling_qwait(
struct bfa_dport_s *dport,
6280 bfa_dport_qresume(
void *cbarg)
6291 bfa_cb_fcdiag_dport(dport, msg->status);