Lines Matching refs:fcport

29 BFA_MODULE(fcport);
163 static bfa_boolean_t bfa_fcport_send_enable(struct bfa_fcport_s *fcport);
164 static bfa_boolean_t bfa_fcport_send_disable(struct bfa_fcport_s *fcport);
165 static void bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport);
166 static void bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport);
167 static void bfa_fcport_set_wwns(struct bfa_fcport_s *fcport);
169 static void bfa_fcport_scn(struct bfa_fcport_s *fcport,
181 static void bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport,
183 static void bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport,
185 static void bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport,
187 static void bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
189 static void bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
191 static void bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport,
193 static void bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport,
195 static void bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport,
197 static void bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport,
199 static void bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport,
201 static void bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport,
203 static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport,
205 static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport,
207 static void bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport,
209 static void bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport,
2068 bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event) in bfa_fcport_aen_post() argument
2070 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_aen_post()
2077 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa); in bfa_fcport_aen_post()
2078 aen_entry->aen_data.port.pwwn = fcport->pwwn; in bfa_fcport_aen_post()
2081 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq, in bfa_fcport_aen_post()
2089 bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, in bfa_fcport_sm_uninit() argument
2092 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_uninit()
2099 fcport->use_flash_cfg = BFA_TRUE; in bfa_fcport_sm_uninit()
2101 if (bfa_fcport_send_enable(fcport)) { in bfa_fcport_sm_uninit()
2102 bfa_trc(fcport->bfa, BFA_TRUE); in bfa_fcport_sm_uninit()
2103 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_uninit()
2105 bfa_trc(fcport->bfa, BFA_FALSE); in bfa_fcport_sm_uninit()
2106 bfa_sm_set_state(fcport, in bfa_fcport_sm_uninit()
2124 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_uninit()
2128 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_uninit()
2132 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_uninit()
2137 bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling_qwait() argument
2141 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling_qwait()
2142 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2146 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_enabling_qwait()
2147 bfa_fcport_send_enable(fcport); in bfa_fcport_sm_enabling_qwait()
2151 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2152 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling_qwait()
2166 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_enabling_qwait()
2167 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2168 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling_qwait()
2170 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling_qwait()
2173 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling_qwait()
2185 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2186 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling_qwait()
2190 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling_qwait()
2191 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling_qwait()
2192 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling_qwait()
2196 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2201 bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling() argument
2205 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling()
2206 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling()
2211 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_enabling()
2215 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_enabling()
2216 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_enabling()
2218 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_enabling()
2219 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_enabling()
2229 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_enabling()
2230 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_enabling()
2232 bfa_sm_set_state(fcport, in bfa_fcport_sm_enabling()
2235 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling()
2237 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling()
2240 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling()
2244 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling()
2248 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling()
2252 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling()
2253 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling()
2254 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling()
2258 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling()
2263 bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkdown() argument
2266 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_sm_linkdown()
2268 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkdown()
2270 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2274 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2275 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_linkdown()
2276 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_linkdown()
2277 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2279 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { in bfa_fcport_sm_linkdown()
2281 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2283 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2287 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2291 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2296 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_linkdown()
2297 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2300 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); in bfa_fcport_sm_linkdown()
2303 if (fcport->cfg.qos_enabled && in bfa_fcport_sm_linkdown()
2304 fcport->qos_attr.state != BFA_QOS_ONLINE) in bfa_fcport_sm_linkdown()
2305 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_QOS_NEG); in bfa_fcport_sm_linkdown()
2321 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkdown()
2322 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkdown()
2324 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkdown()
2327 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2329 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2332 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkdown()
2336 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkdown()
2340 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkdown()
2344 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2345 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkdown()
2346 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkdown()
2350 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2355 bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkup() argument
2359 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkup()
2361 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkup()
2371 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkup()
2372 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkup()
2374 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkup()
2377 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2378 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2379 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2381 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2384 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2387 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkup()
2391 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_linkup()
2392 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2393 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2394 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2396 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2397 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2400 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2405 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2410 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkup()
2411 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2412 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2413 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2416 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2421 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2426 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkup()
2427 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2428 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2429 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2430 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2433 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2438 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2443 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2444 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2445 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkup()
2449 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkup()
2454 bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling_qwait() argument
2457 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2461 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_disabling_qwait()
2462 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_disabling_qwait()
2466 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling_qwait()
2467 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2471 bfa_sm_set_state(fcport, bfa_fcport_sm_toggling_qwait); in bfa_fcport_sm_disabling_qwait()
2489 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling_qwait()
2490 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2494 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_disabling_qwait()
2495 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_disabling_qwait()
2496 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_disabling_qwait()
2500 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2505 bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_toggling_qwait() argument
2508 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2512 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_toggling_qwait()
2513 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_toggling_qwait()
2514 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_toggling_qwait()
2515 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_toggling_qwait()
2517 bfa_sm_set_state(fcport, in bfa_fcport_sm_toggling_qwait()
2522 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_toggling_qwait()
2523 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2530 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_toggling_qwait()
2542 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_toggling_qwait()
2543 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2547 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2552 bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling() argument
2556 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabling()
2557 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling()
2561 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_disabling()
2571 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabling()
2572 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabling()
2574 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabling()
2577 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabling()
2579 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabling()
2582 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabling()
2586 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling()
2598 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling()
2602 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling()
2607 bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabled() argument
2611 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabled()
2612 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabled()
2622 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabled()
2626 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabled()
2627 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabled()
2629 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabled()
2632 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabled()
2634 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabled()
2637 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabled()
2647 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabled()
2651 bfa_sm_set_state(fcport, bfa_fcport_sm_dport); in bfa_fcport_sm_disabled()
2655 bfa_sm_set_state(fcport, bfa_fcport_sm_ddport); in bfa_fcport_sm_disabled()
2659 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabled()
2664 bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, in bfa_fcport_sm_stopped() argument
2667 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_stopped()
2671 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_stopped()
2672 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_stopped()
2674 bfa_sm_set_state(fcport, in bfa_fcport_sm_stopped()
2690 bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocdown() argument
2693 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocdown()
2697 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_iocdown()
2698 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_iocdown()
2700 bfa_sm_set_state(fcport, in bfa_fcport_sm_iocdown()
2716 bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocfail() argument
2719 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocfail()
2723 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_iocfail()
2727 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_iocfail()
2739 bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, enum bfa_fcport_sm_event event) in bfa_fcport_sm_dport() argument
2741 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_dport()
2754 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_dport()
2758 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_dport()
2762 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_dport()
2766 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_dport()
2771 bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport, in bfa_fcport_sm_ddport() argument
2774 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_ddport()
2779 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_ddport()
2792 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_ddport()
2796 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_ddport()
2800 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_ddport()
2805 bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, in bfa_fcport_sm_faa_misconfig() argument
2808 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2820 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_faa_misconfig()
2821 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_faa_misconfig()
2823 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_faa_misconfig()
2825 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2826 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2827 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_faa_misconfig()
2829 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_faa_misconfig()
2833 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_faa_misconfig()
2837 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2838 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2839 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_faa_misconfig()
2843 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2854 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2863 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2874 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2886 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2897 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2910 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2921 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2930 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2941 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2953 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2964 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2977 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2988 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
3001 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
3011 ln->fcport->event_cbfn(ln->fcport->event_cbarg, ln->ln_event); in __bfa_cb_fcport_event()
3021 bfa_fcport_scn(struct bfa_fcport_s *fcport, enum bfa_port_linkstate event, in bfa_fcport_scn() argument
3024 if (fcport->cfg.trunked && !trunk) in bfa_fcport_scn()
3029 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKUP); in bfa_fcport_scn()
3032 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); in bfa_fcport_scn()
3042 struct bfa_fcport_s *fcport = ln->fcport; in bfa_fcport_queue_cb() local
3044 if (fcport->bfa->fcs) { in bfa_fcport_queue_cb()
3045 fcport->event_cbfn(fcport->event_cbarg, event); in bfa_fcport_queue_cb()
3049 bfa_cb_queue(fcport->bfa, &ln->ln_qe, in bfa_fcport_queue_cb()
3069 struct bfa_fcport_s *fcport = cbarg; in bfa_fcport_qresume() local
3071 bfa_sm_send_event(fcport, BFA_FCPORT_SM_QRESUME); in bfa_fcport_qresume()
3075 bfa_fcport_mem_claim(struct bfa_fcport_s *fcport) in bfa_fcport_mem_claim() argument
3077 struct bfa_mem_dma_s *fcport_dma = &fcport->fcport_dma; in bfa_fcport_mem_claim()
3079 fcport->stats_kva = bfa_mem_dma_virt(fcport_dma); in bfa_fcport_mem_claim()
3080 fcport->stats_pa = bfa_mem_dma_phys(fcport_dma); in bfa_fcport_mem_claim()
3081 fcport->stats = (union bfa_fcport_stats_u *) in bfa_fcport_mem_claim()
3092 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_attach() local
3093 struct bfa_port_cfg_s *port_cfg = &fcport->cfg; in bfa_fcport_attach()
3094 struct bfa_fcport_ln_s *ln = &fcport->ln; in bfa_fcport_attach()
3097 fcport->bfa = bfa; in bfa_fcport_attach()
3098 ln->fcport = fcport; in bfa_fcport_attach()
3100 bfa_fcport_mem_claim(fcport); in bfa_fcport_attach()
3102 bfa_sm_set_state(fcport, bfa_fcport_sm_uninit); in bfa_fcport_attach()
3109 fcport->stats_reset_time = tv.tv_sec; in bfa_fcport_attach()
3110 fcport->stats_dma_ready = BFA_FALSE; in bfa_fcport_attach()
3125 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_attach()
3127 INIT_LIST_HEAD(&fcport->stats_pending_q); in bfa_fcport_attach()
3128 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in bfa_fcport_attach()
3130 bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport); in bfa_fcport_attach()
3163 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_iocdisable() local
3165 bfa_sm_send_event(fcport, BFA_FCPORT_SM_HWFAIL); in bfa_fcport_iocdisable()
3173 bfa_fcport_update_loop_info(struct bfa_fcport_s *fcport, in bfa_fcport_update_loop_info() argument
3176 fcport->myalpa = loop_info->myalpa; in bfa_fcport_update_loop_info()
3177 fcport->alpabm_valid = in bfa_fcport_update_loop_info()
3179 memcpy(fcport->alpabm.alpa_bm, in bfa_fcport_update_loop_info()
3185 bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_update_linkinfo() argument
3187 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_update_linkinfo()
3188 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_fcport_update_linkinfo()
3190 fcport->speed = pevent->link_state.speed; in bfa_fcport_update_linkinfo()
3191 fcport->topology = pevent->link_state.topology; in bfa_fcport_update_linkinfo()
3193 if (fcport->topology == BFA_PORT_TOPOLOGY_LOOP) { in bfa_fcport_update_linkinfo()
3194 bfa_fcport_update_loop_info(fcport, in bfa_fcport_update_linkinfo()
3200 fcport->qos_attr = pevent->link_state.qos_attr; in bfa_fcport_update_linkinfo()
3201 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr; in bfa_fcport_update_linkinfo()
3203 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_update_linkinfo()
3204 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; in bfa_fcport_update_linkinfo()
3206 fcport->fec_state = pevent->link_state.fec_state; in bfa_fcport_update_linkinfo()
3211 if (!fcport->cfg.trunked) in bfa_fcport_update_linkinfo()
3215 fcport->fcoe_vlan = in bfa_fcport_update_linkinfo()
3218 bfa_trc(fcport->bfa, fcport->speed); in bfa_fcport_update_linkinfo()
3219 bfa_trc(fcport->bfa, fcport->topology); in bfa_fcport_update_linkinfo()
3223 bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_reset_linkinfo() argument
3225 fcport->speed = BFA_PORT_SPEED_UNKNOWN; in bfa_fcport_reset_linkinfo()
3226 fcport->topology = BFA_PORT_TOPOLOGY_NONE; in bfa_fcport_reset_linkinfo()
3227 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_reset_linkinfo()
3234 bfa_fcport_send_enable(struct bfa_fcport_s *fcport) in bfa_fcport_send_enable() argument
3242 fcport->msgtag++; in bfa_fcport_send_enable()
3247 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_enable()
3249 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_enable()
3250 &fcport->reqq_wait); in bfa_fcport_send_enable()
3255 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_enable()
3256 m->nwwn = fcport->nwwn; in bfa_fcport_send_enable()
3257 m->pwwn = fcport->pwwn; in bfa_fcport_send_enable()
3258 m->port_cfg = fcport->cfg; in bfa_fcport_send_enable()
3259 m->msgtag = fcport->msgtag; in bfa_fcport_send_enable()
3260 m->port_cfg.maxfrsize = cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_send_enable()
3261 m->use_flash_cfg = fcport->use_flash_cfg; in bfa_fcport_send_enable()
3262 bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); in bfa_fcport_send_enable()
3263 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); in bfa_fcport_send_enable()
3264 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); in bfa_fcport_send_enable()
3269 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_enable()
3277 bfa_fcport_send_disable(struct bfa_fcport_s *fcport) in bfa_fcport_send_disable() argument
3285 fcport->msgtag++; in bfa_fcport_send_disable()
3290 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_disable()
3292 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_disable()
3293 &fcport->reqq_wait); in bfa_fcport_send_disable()
3298 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_disable()
3299 m->msgtag = fcport->msgtag; in bfa_fcport_send_disable()
3304 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_disable()
3310 bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) in bfa_fcport_set_wwns() argument
3312 fcport->pwwn = fcport->bfa->ioc.attr->pwwn; in bfa_fcport_set_wwns()
3313 fcport->nwwn = fcport->bfa->ioc.attr->nwwn; in bfa_fcport_set_wwns()
3315 bfa_trc(fcport->bfa, fcport->pwwn); in bfa_fcport_set_wwns()
3316 bfa_trc(fcport->bfa, fcport->nwwn); in bfa_fcport_set_wwns()
3355 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; in __bfa_cb_fcport_stats_get() local
3362 if (fcport->stats_status == BFA_STATUS_OK) in __bfa_cb_fcport_stats_get()
3365 list_for_each_safe(qe, qen, &fcport->stats_pending_q) { in __bfa_cb_fcport_stats_get()
3366 bfa_q_deq(&fcport->stats_pending_q, &qe); in __bfa_cb_fcport_stats_get()
3368 if (fcport->stats_status == BFA_STATUS_OK) { in __bfa_cb_fcport_stats_get()
3371 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) in __bfa_cb_fcport_stats_get()
3373 &fcport->stats->fcqos); in __bfa_cb_fcport_stats_get()
3376 &fcport->stats->fcoe); in __bfa_cb_fcport_stats_get()
3378 tv.tv_sec - fcport->stats_reset_time; in __bfa_cb_fcport_stats_get()
3381 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_get()
3382 fcport->stats_status); in __bfa_cb_fcport_stats_get()
3384 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3386 INIT_LIST_HEAD(&fcport->stats_pending_q); in __bfa_cb_fcport_stats_get()
3387 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3394 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_get_timeout() local
3396 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_get_timeout()
3398 if (fcport->stats_qfull) { in bfa_fcport_stats_get_timeout()
3399 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_get_timeout()
3400 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_get_timeout()
3403 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_get_timeout()
3404 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_stats_get_timeout()
3410 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_get() local
3413 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_get()
3416 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_get()
3417 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_get()
3418 bfa_fcport_send_stats_get, fcport); in bfa_fcport_send_stats_get()
3419 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_get()
3420 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_get()
3423 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_get()
3427 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_get()
3428 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_get()
3434 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in __bfa_cb_fcport_stats_clr() local
3445 fcport->stats_reset_time = tv.tv_sec; in __bfa_cb_fcport_stats_clr()
3446 list_for_each_safe(qe, qen, &fcport->statsclr_pending_q) { in __bfa_cb_fcport_stats_clr()
3447 bfa_q_deq(&fcport->statsclr_pending_q, &qe); in __bfa_cb_fcport_stats_clr()
3449 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_clr()
3450 fcport->stats_status); in __bfa_cb_fcport_stats_clr()
3452 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3454 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in __bfa_cb_fcport_stats_clr()
3455 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3462 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_clr_timeout() local
3464 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_clr_timeout()
3466 if (fcport->stats_qfull) { in bfa_fcport_stats_clr_timeout()
3467 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_clr_timeout()
3468 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_clr_timeout()
3471 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_clr_timeout()
3472 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_stats_clr_timeout()
3478 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_clear() local
3481 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_clear()
3484 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_clear()
3485 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_clear()
3486 bfa_fcport_send_stats_clear, fcport); in bfa_fcport_send_stats_clear()
3487 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_clear()
3488 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_clear()
3491 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_clear()
3495 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_clear()
3496 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_clear()
3503 bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) in bfa_trunk_scn() argument
3505 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_trunk_scn()
3512 bfa_trc(fcport->bfa, fcport->cfg.trunked); in bfa_trunk_scn()
3516 bfa_trc(fcport->bfa, trunk->attr.state); in bfa_trunk_scn()
3517 bfa_trc(fcport->bfa, scn->trunk_state); in bfa_trunk_scn()
3518 bfa_trc(fcport->bfa, scn->trunk_speed); in bfa_trunk_scn()
3524 if (fcport->cfg.trunked && (trunk->attr.state != BFA_TRUNK_DISABLED)) in bfa_trunk_scn()
3538 fcport->speed = tlink->speed; in bfa_trunk_scn()
3539 fcport->topology = BFA_PORT_TOPOLOGY_P2P; in bfa_trunk_scn()
3543 bfa_trc(fcport->bfa, lattr->link_state); in bfa_trunk_scn()
3544 bfa_trc(fcport->bfa, lattr->trunk_wwn); in bfa_trunk_scn()
3545 bfa_trc(fcport->bfa, lattr->fctl); in bfa_trunk_scn()
3546 bfa_trc(fcport->bfa, lattr->speed); in bfa_trunk_scn()
3547 bfa_trc(fcport->bfa, lattr->deskew); in bfa_trunk_scn()
3552 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3556 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3560 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3564 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3573 bfa_fcport_scn(fcport, (scn->trunk_state == BFA_TRUNK_ONLINE) ? in bfa_trunk_scn()
3581 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_trunk_iocdisable() local
3587 if (fcport->cfg.trunked) { in bfa_trunk_iocdisable()
3588 if (fcport->trunk.attr.state == BFA_TRUNK_ONLINE) in bfa_trunk_iocdisable()
3589 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_TRUE); in bfa_trunk_iocdisable()
3591 fcport->trunk.attr.state = BFA_TRUNK_OFFLINE; in bfa_trunk_iocdisable()
3592 fcport->trunk.attr.speed = BFA_PORT_SPEED_UNKNOWN; in bfa_trunk_iocdisable()
3594 fcport->trunk.attr.link_attr[i].trunk_wwn = 0; in bfa_trunk_iocdisable()
3595 fcport->trunk.attr.link_attr[i].fctl = in bfa_trunk_iocdisable()
3597 fcport->trunk.attr.link_attr[i].link_state = in bfa_trunk_iocdisable()
3599 fcport->trunk.attr.link_attr[i].speed = in bfa_trunk_iocdisable()
3601 fcport->trunk.attr.link_attr[i].deskew = 0; in bfa_trunk_iocdisable()
3612 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_init() local
3617 bfa_fcport_set_wwns(fcport); in bfa_fcport_init()
3618 if (fcport->cfg.maxfrsize == 0) in bfa_fcport_init()
3619 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); in bfa_fcport_init()
3620 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); in bfa_fcport_init()
3621 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); in bfa_fcport_init()
3626 WARN_ON(!fcport->cfg.maxfrsize); in bfa_fcport_init()
3627 WARN_ON(!fcport->cfg.rx_bbcredit); in bfa_fcport_init()
3628 WARN_ON(!fcport->speed_sup); in bfa_fcport_init()
3637 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_isr() local
3641 fcport->event_arg.i2hmsg = i2hmsg; in bfa_fcport_isr()
3644 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm)); in bfa_fcport_isr()
3648 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) { in bfa_fcport_isr()
3650 fcport->stats_dma_ready = BFA_TRUE; in bfa_fcport_isr()
3651 if (fcport->use_flash_cfg) { in bfa_fcport_isr()
3652 fcport->cfg = i2hmsg.penable_rsp->port_cfg; in bfa_fcport_isr()
3653 fcport->cfg.maxfrsize = in bfa_fcport_isr()
3654 cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_isr()
3655 fcport->cfg.path_tov = in bfa_fcport_isr()
3656 cpu_to_be16(fcport->cfg.path_tov); in bfa_fcport_isr()
3657 fcport->cfg.q_depth = in bfa_fcport_isr()
3658 cpu_to_be16(fcport->cfg.q_depth); in bfa_fcport_isr()
3660 if (fcport->cfg.trunked) in bfa_fcport_isr()
3661 fcport->trunk.attr.state = in bfa_fcport_isr()
3664 fcport->trunk.attr.state = in bfa_fcport_isr()
3666 fcport->qos_attr.qos_bw = in bfa_fcport_isr()
3668 fcport->use_flash_cfg = BFA_FALSE; in bfa_fcport_isr()
3671 if (fcport->cfg.qos_enabled) in bfa_fcport_isr()
3672 fcport->qos_attr.state = BFA_QOS_OFFLINE; in bfa_fcport_isr()
3674 fcport->qos_attr.state = BFA_QOS_DISABLED; in bfa_fcport_isr()
3676 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3679 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3680 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3682 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3684 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3689 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) in bfa_fcport_isr()
3690 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3694 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3695 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3697 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3700 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); in bfa_fcport_isr()
3704 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3707 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3710 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3715 bfa_trunk_scn(fcport, i2hmsg.trunk_scn); in bfa_fcport_isr()
3722 if (list_empty(&fcport->stats_pending_q) || in bfa_fcport_isr()
3723 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3726 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3727 fcport->stats_status = i2hmsg.pstatsget_rsp->status; in bfa_fcport_isr()
3728 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_isr()
3735 if (list_empty(&fcport->statsclr_pending_q) || in bfa_fcport_isr()
3736 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3739 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3740 fcport->stats_status = BFA_STATUS_OK; in bfa_fcport_isr()
3741 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_isr()
3745 bfa_sm_send_event(fcport, BFA_FCPORT_SM_ENABLE); in bfa_fcport_isr()
3749 bfa_sm_send_event(fcport, BFA_FCPORT_SM_DISABLE); in bfa_fcport_isr()
3767 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_event_register() local
3769 fcport->event_cbfn = cbfn; in bfa_fcport_event_register()
3770 fcport->event_cbarg = cbarg; in bfa_fcport_event_register()
3776 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_enable() local
3784 if (fcport->diag_busy) in bfa_fcport_enable()
3808 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_pbcdisabled() local
3813 bfa_trc(bfa, fcport->pwwn); in bfa_fcport_is_pbcdisabled()
3825 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_speed() local
3829 if (fcport->cfg.trunked == BFA_TRUE) in bfa_fcport_cfg_speed()
3831 if ((fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) && in bfa_fcport_cfg_speed()
3834 if ((speed != BFA_PORT_SPEED_AUTO) && (speed > fcport->speed_sup)) { in bfa_fcport_cfg_speed()
3835 bfa_trc(bfa, fcport->speed_sup); in bfa_fcport_cfg_speed()
3840 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { in bfa_fcport_cfg_speed()
3859 fcport->cfg.speed = speed; in bfa_fcport_cfg_speed()
3870 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_speed() local
3872 return fcport->speed; in bfa_fcport_get_speed()
3881 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_topology() local
3884 bfa_trc(bfa, fcport->cfg.topology); in bfa_fcport_cfg_topology()
3892 (fcport->qos_attr.state != BFA_QOS_DISABLED)) in bfa_fcport_cfg_topology()
3894 if (fcport->cfg.ratelimit != BFA_FALSE) in bfa_fcport_cfg_topology()
3897 (fcport->trunk.attr.state != BFA_TRUNK_DISABLED)) in bfa_fcport_cfg_topology()
3900 (fcport->cfg.speed == BFA_PORT_SPEED_16GBPS)) in bfa_fcport_cfg_topology()
3917 fcport->cfg.topology = topology; in bfa_fcport_cfg_topology()
3927 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_topology() local
3929 return fcport->topology; in bfa_fcport_get_topology()
3938 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_cfg_topology() local
3940 return fcport->cfg.topology; in bfa_fcport_get_cfg_topology()
3946 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_hardalpa() local
3949 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_cfg_hardalpa()
3950 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_cfg_hardalpa()
3952 fcport->cfg.cfg_hardalpa = BFA_TRUE; in bfa_fcport_cfg_hardalpa()
3953 fcport->cfg.hardalpa = alpa; in bfa_fcport_cfg_hardalpa()
3961 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clr_hardalpa() local
3963 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_clr_hardalpa()
3964 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_clr_hardalpa()
3966 fcport->cfg.cfg_hardalpa = BFA_FALSE; in bfa_fcport_clr_hardalpa()
3973 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_hardalpa() local
3975 *alpa = fcport->cfg.hardalpa; in bfa_fcport_get_hardalpa()
3976 return fcport->cfg.cfg_hardalpa; in bfa_fcport_get_hardalpa()
3982 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_myalpa() local
3984 return fcport->myalpa; in bfa_fcport_get_myalpa()
3990 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_maxfrsize() local
3993 bfa_trc(bfa, fcport->cfg.maxfrsize); in bfa_fcport_cfg_maxfrsize()
4003 fcport->cfg.maxfrsize = maxfrsize; in bfa_fcport_cfg_maxfrsize()
4010 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_maxfrsize() local
4012 return fcport->cfg.maxfrsize; in bfa_fcport_get_maxfrsize()
4028 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_tx_bbcredit() local
4030 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; in bfa_fcport_set_tx_bbcredit()
4040 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_wwn() local
4042 return fcport->nwwn; in bfa_fcport_get_wwn()
4044 return fcport->pwwn; in bfa_fcport_get_wwn()
4050 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_attr() local
4054 attr->nwwn = fcport->nwwn; in bfa_fcport_get_attr()
4055 attr->pwwn = fcport->pwwn; in bfa_fcport_get_attr()
4060 memcpy(&attr->pport_cfg, &fcport->cfg, in bfa_fcport_get_attr()
4063 attr->pport_cfg.speed = fcport->cfg.speed; in bfa_fcport_get_attr()
4064 attr->speed_supported = fcport->speed_sup; in bfa_fcport_get_attr()
4065 attr->speed = fcport->speed; in bfa_fcport_get_attr()
4069 attr->pport_cfg.topology = fcport->cfg.topology; in bfa_fcport_get_attr()
4070 attr->topology = fcport->topology; in bfa_fcport_get_attr()
4071 attr->pport_cfg.trunked = fcport->cfg.trunked; in bfa_fcport_get_attr()
4074 attr->beacon = fcport->beacon; in bfa_fcport_get_attr()
4075 attr->link_e2e_beacon = fcport->link_e2e_beacon; in bfa_fcport_get_attr()
4079 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); in bfa_fcport_get_attr()
4081 attr->fec_state = fcport->fec_state; in bfa_fcport_get_attr()
4087 if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4089 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4094 attr->fcoe_vlan = fcport->fcoe_vlan; in bfa_fcport_get_attr()
4105 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_stats() local
4108 !fcport->stats_dma_ready) in bfa_fcport_get_stats()
4111 if (!list_empty(&fcport->statsclr_pending_q)) in bfa_fcport_get_stats()
4114 if (list_empty(&fcport->stats_pending_q)) { in bfa_fcport_get_stats()
4115 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4116 bfa_fcport_send_stats_get(fcport); in bfa_fcport_get_stats()
4117 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_get_stats()
4119 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_get_stats()
4121 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4132 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clear_stats() local
4135 !fcport->stats_dma_ready) in bfa_fcport_clear_stats()
4138 if (!list_empty(&fcport->stats_pending_q)) in bfa_fcport_clear_stats()
4141 if (list_empty(&fcport->statsclr_pending_q)) { in bfa_fcport_clear_stats()
4142 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4143 bfa_fcport_send_stats_clear(fcport); in bfa_fcport_clear_stats()
4144 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_clear_stats()
4146 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_clear_stats()
4148 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4159 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_disabled() local
4161 return bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_disabled()
4169 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_dport() local
4171 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_dport()
4178 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ddport() local
4180 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_ddport()
4187 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_qos_bw() local
4203 (fcport->cfg.topology != BFA_PORT_TOPOLOGY_LOOP)) in bfa_fcport_set_qos_bw()
4204 fcport->cfg.qos_bw = *qos_bw; in bfa_fcport_set_qos_bw()
4212 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ratelim() local
4214 return fcport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; in bfa_fcport_is_ratelim()
4224 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_faa() local
4227 fcport->cfg.faa_state = state; in bfa_fcport_cfg_faa()
4236 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_ratelim_speed() local
4238 bfa_trc(bfa, fcport->cfg.trl_def_speed); in bfa_fcport_get_ratelim_speed()
4239 return fcport->cfg.trl_def_speed; in bfa_fcport_get_ratelim_speed()
4248 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_beacon() local
4252 bfa_trc(bfa, fcport->beacon); in bfa_fcport_beacon()
4253 bfa_trc(bfa, fcport->link_e2e_beacon); in bfa_fcport_beacon()
4255 fcport->beacon = beacon; in bfa_fcport_beacon()
4256 fcport->link_e2e_beacon = link_e2e_beacon; in bfa_fcport_beacon()
4262 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_linkup() local
4264 return (!fcport->cfg.trunked && in bfa_fcport_is_linkup()
4265 bfa_sm_cmp_state(fcport, bfa_fcport_sm_linkup)) || in bfa_fcport_is_linkup()
4266 (fcport->cfg.trunked && in bfa_fcport_is_linkup()
4267 fcport->trunk.attr.state == BFA_TRUNK_ONLINE); in bfa_fcport_is_linkup()
4273 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_qos_enabled() local
4275 return fcport->cfg.qos_enabled; in bfa_fcport_is_qos_enabled()
4281 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_trunk_enabled() local
4283 return fcport->cfg.trunked; in bfa_fcport_is_trunk_enabled()
4289 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_bbcr() local
4293 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_cfg_bbcr()
4301 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_cfg_bbcr()
4304 if (fcport->cfg.qos_enabled) in bfa_fcport_cfg_bbcr()
4307 if (fcport->cfg.trunked) in bfa_fcport_cfg_bbcr()
4310 if ((fcport->cfg.speed != BFA_PORT_SPEED_AUTO) && in bfa_fcport_cfg_bbcr()
4311 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc))) in bfa_fcport_cfg_bbcr()
4317 if (fcport->cfg.bb_cr_enabled) { in bfa_fcport_cfg_bbcr()
4318 if (bb_scn != fcport->cfg.bb_scn) in bfa_fcport_cfg_bbcr()
4327 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4328 fcport->cfg.bb_scn = bb_scn; in bfa_fcport_cfg_bbcr()
4330 if (!fcport->cfg.bb_cr_enabled) in bfa_fcport_cfg_bbcr()
4333 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4334 fcport->cfg.bb_scn = 0; in bfa_fcport_cfg_bbcr()
4344 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_bbcr_attr() local
4346 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_get_bbcr_attr()
4349 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_get_bbcr_attr()
4352 *bbcr_attr = fcport->bbcr_attr; in bfa_fcport_get_bbcr_attr()
5839 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa); in bfa_fcdiag_set_busy_status() local
5842 fcport->diag_busy = BFA_TRUE; in bfa_fcdiag_set_busy_status()
5844 fcport->diag_busy = BFA_FALSE; in bfa_fcdiag_set_busy_status()