Lines Matching refs:fcport
148 static bfa_boolean_t bfa_fcport_send_enable(struct bfa_fcport_s *fcport);
149 static bfa_boolean_t bfa_fcport_send_disable(struct bfa_fcport_s *fcport);
150 static void bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport);
151 static void bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport);
152 static void bfa_fcport_set_wwns(struct bfa_fcport_s *fcport);
154 static void bfa_fcport_scn(struct bfa_fcport_s *fcport,
166 static void bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport,
168 static void bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport,
170 static void bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport,
172 static void bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
174 static void bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
176 static void bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport,
178 static void bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport,
180 static void bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport,
182 static void bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport,
184 static void bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport,
186 static void bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport,
188 static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport,
190 static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport,
192 static void bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport,
194 static void bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport,
2011 bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event) in bfa_fcport_aen_post() argument
2013 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_aen_post()
2020 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa); in bfa_fcport_aen_post()
2021 aen_entry->aen_data.port.pwwn = fcport->pwwn; in bfa_fcport_aen_post()
2024 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq, in bfa_fcport_aen_post()
2032 bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, in bfa_fcport_sm_uninit() argument
2035 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_uninit()
2042 fcport->use_flash_cfg = BFA_TRUE; in bfa_fcport_sm_uninit()
2044 if (bfa_fcport_send_enable(fcport)) { in bfa_fcport_sm_uninit()
2045 bfa_trc(fcport->bfa, BFA_TRUE); in bfa_fcport_sm_uninit()
2046 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_uninit()
2048 bfa_trc(fcport->bfa, BFA_FALSE); in bfa_fcport_sm_uninit()
2049 bfa_sm_set_state(fcport, in bfa_fcport_sm_uninit()
2067 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_uninit()
2071 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_uninit()
2075 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_uninit()
2080 bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling_qwait() argument
2084 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling_qwait()
2085 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2089 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_enabling_qwait()
2090 bfa_fcport_send_enable(fcport); in bfa_fcport_sm_enabling_qwait()
2094 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2095 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling_qwait()
2109 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_enabling_qwait()
2110 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2111 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling_qwait()
2113 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling_qwait()
2116 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling_qwait()
2128 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2129 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling_qwait()
2133 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling_qwait()
2134 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling_qwait()
2135 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling_qwait()
2139 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2144 bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling() argument
2148 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling()
2149 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling()
2154 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_enabling()
2158 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_enabling()
2159 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_enabling()
2161 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_enabling()
2162 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_enabling()
2172 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_enabling()
2173 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_enabling()
2175 bfa_sm_set_state(fcport, in bfa_fcport_sm_enabling()
2178 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling()
2180 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling()
2183 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling()
2187 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling()
2191 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling()
2195 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling()
2196 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling()
2197 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling()
2201 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling()
2206 bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkdown() argument
2209 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_sm_linkdown()
2211 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkdown()
2213 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2217 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2218 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_linkdown()
2219 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_linkdown()
2220 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2222 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { in bfa_fcport_sm_linkdown()
2224 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2226 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2230 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2234 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2239 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_linkdown()
2240 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2243 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); in bfa_fcport_sm_linkdown()
2246 if (fcport->cfg.qos_enabled && in bfa_fcport_sm_linkdown()
2247 fcport->qos_attr.state != BFA_QOS_ONLINE) in bfa_fcport_sm_linkdown()
2248 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_QOS_NEG); in bfa_fcport_sm_linkdown()
2264 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkdown()
2265 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkdown()
2267 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkdown()
2270 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2272 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2275 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkdown()
2279 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkdown()
2283 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkdown()
2287 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2288 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkdown()
2289 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkdown()
2293 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2298 bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkup() argument
2302 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkup()
2304 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkup()
2314 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkup()
2315 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkup()
2317 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkup()
2320 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2321 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2322 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2324 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2327 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2330 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkup()
2334 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_linkup()
2335 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2336 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2337 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2339 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2340 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2343 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2348 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2353 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkup()
2354 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2355 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2356 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2359 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2364 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2369 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkup()
2370 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2371 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2372 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2373 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2376 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2381 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2386 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2387 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2388 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkup()
2392 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkup()
2397 bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling_qwait() argument
2400 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2404 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_disabling_qwait()
2405 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_disabling_qwait()
2409 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling_qwait()
2410 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2414 bfa_sm_set_state(fcport, bfa_fcport_sm_toggling_qwait); in bfa_fcport_sm_disabling_qwait()
2432 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling_qwait()
2433 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2437 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_disabling_qwait()
2438 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_disabling_qwait()
2439 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_disabling_qwait()
2443 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2448 bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_toggling_qwait() argument
2451 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2455 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_toggling_qwait()
2456 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_toggling_qwait()
2457 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_toggling_qwait()
2458 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_toggling_qwait()
2460 bfa_sm_set_state(fcport, in bfa_fcport_sm_toggling_qwait()
2465 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_toggling_qwait()
2466 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2473 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_toggling_qwait()
2485 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_toggling_qwait()
2486 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2490 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2495 bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling() argument
2499 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabling()
2500 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling()
2504 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_disabling()
2514 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabling()
2515 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabling()
2517 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabling()
2520 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabling()
2522 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabling()
2525 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabling()
2529 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling()
2541 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling()
2545 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling()
2550 bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabled() argument
2554 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabled()
2555 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabled()
2565 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabled()
2569 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabled()
2570 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabled()
2572 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabled()
2575 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabled()
2577 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabled()
2580 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabled()
2590 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabled()
2594 bfa_sm_set_state(fcport, bfa_fcport_sm_dport); in bfa_fcport_sm_disabled()
2598 bfa_sm_set_state(fcport, bfa_fcport_sm_ddport); in bfa_fcport_sm_disabled()
2602 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabled()
2607 bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, in bfa_fcport_sm_stopped() argument
2610 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_stopped()
2614 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_stopped()
2615 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_stopped()
2617 bfa_sm_set_state(fcport, in bfa_fcport_sm_stopped()
2633 bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocdown() argument
2636 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocdown()
2640 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_iocdown()
2641 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_iocdown()
2643 bfa_sm_set_state(fcport, in bfa_fcport_sm_iocdown()
2659 bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocfail() argument
2662 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocfail()
2666 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_iocfail()
2670 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_iocfail()
2682 bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, enum bfa_fcport_sm_event event) in bfa_fcport_sm_dport() argument
2684 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_dport()
2697 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_dport()
2701 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_dport()
2705 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_dport()
2709 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_dport()
2714 bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport, in bfa_fcport_sm_ddport() argument
2717 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_ddport()
2722 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_ddport()
2735 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_ddport()
2739 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_ddport()
2743 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_ddport()
2748 bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, in bfa_fcport_sm_faa_misconfig() argument
2751 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2763 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_faa_misconfig()
2764 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_faa_misconfig()
2766 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_faa_misconfig()
2768 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2769 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2770 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_faa_misconfig()
2772 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_faa_misconfig()
2776 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_faa_misconfig()
2780 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2781 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2782 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_faa_misconfig()
2786 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2797 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2806 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2817 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2829 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2840 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2853 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2864 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2873 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2884 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2896 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2907 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2920 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2931 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
2944 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
2954 ln->fcport->event_cbfn(ln->fcport->event_cbarg, ln->ln_event); in __bfa_cb_fcport_event()
2964 bfa_fcport_scn(struct bfa_fcport_s *fcport, enum bfa_port_linkstate event, in bfa_fcport_scn() argument
2967 if (fcport->cfg.trunked && !trunk) in bfa_fcport_scn()
2972 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKUP); in bfa_fcport_scn()
2975 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); in bfa_fcport_scn()
2985 struct bfa_fcport_s *fcport = ln->fcport; in bfa_fcport_queue_cb() local
2987 if (fcport->bfa->fcs) { in bfa_fcport_queue_cb()
2988 fcport->event_cbfn(fcport->event_cbarg, event); in bfa_fcport_queue_cb()
2992 bfa_cb_queue(fcport->bfa, &ln->ln_qe, in bfa_fcport_queue_cb()
3012 struct bfa_fcport_s *fcport = cbarg; in bfa_fcport_qresume() local
3014 bfa_sm_send_event(fcport, BFA_FCPORT_SM_QRESUME); in bfa_fcport_qresume()
3018 bfa_fcport_mem_claim(struct bfa_fcport_s *fcport) in bfa_fcport_mem_claim() argument
3020 struct bfa_mem_dma_s *fcport_dma = &fcport->fcport_dma; in bfa_fcport_mem_claim()
3022 fcport->stats_kva = bfa_mem_dma_virt(fcport_dma); in bfa_fcport_mem_claim()
3023 fcport->stats_pa = bfa_mem_dma_phys(fcport_dma); in bfa_fcport_mem_claim()
3024 fcport->stats = (union bfa_fcport_stats_u *) in bfa_fcport_mem_claim()
3035 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_attach() local
3036 struct bfa_port_cfg_s *port_cfg = &fcport->cfg; in bfa_fcport_attach()
3037 struct bfa_fcport_ln_s *ln = &fcport->ln; in bfa_fcport_attach()
3039 fcport->bfa = bfa; in bfa_fcport_attach()
3040 ln->fcport = fcport; in bfa_fcport_attach()
3042 bfa_fcport_mem_claim(fcport); in bfa_fcport_attach()
3044 bfa_sm_set_state(fcport, bfa_fcport_sm_uninit); in bfa_fcport_attach()
3050 fcport->stats_reset_time = ktime_get_seconds(); in bfa_fcport_attach()
3051 fcport->stats_dma_ready = BFA_FALSE; in bfa_fcport_attach()
3066 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_attach()
3068 INIT_LIST_HEAD(&fcport->stats_pending_q); in bfa_fcport_attach()
3069 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in bfa_fcport_attach()
3071 bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport); in bfa_fcport_attach()
3086 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_iocdisable() local
3088 bfa_sm_send_event(fcport, BFA_FCPORT_SM_HWFAIL); in bfa_fcport_iocdisable()
3096 bfa_fcport_update_loop_info(struct bfa_fcport_s *fcport, in bfa_fcport_update_loop_info() argument
3099 fcport->myalpa = loop_info->myalpa; in bfa_fcport_update_loop_info()
3100 fcport->alpabm_valid = in bfa_fcport_update_loop_info()
3102 memcpy(fcport->alpabm.alpa_bm, in bfa_fcport_update_loop_info()
3108 bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_update_linkinfo() argument
3110 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_update_linkinfo()
3111 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_fcport_update_linkinfo()
3113 fcport->speed = pevent->link_state.speed; in bfa_fcport_update_linkinfo()
3114 fcport->topology = pevent->link_state.topology; in bfa_fcport_update_linkinfo()
3116 if (fcport->topology == BFA_PORT_TOPOLOGY_LOOP) { in bfa_fcport_update_linkinfo()
3117 bfa_fcport_update_loop_info(fcport, in bfa_fcport_update_linkinfo()
3123 fcport->qos_attr = pevent->link_state.qos_attr; in bfa_fcport_update_linkinfo()
3124 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr; in bfa_fcport_update_linkinfo()
3126 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_update_linkinfo()
3127 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; in bfa_fcport_update_linkinfo()
3129 fcport->fec_state = pevent->link_state.fec_state; in bfa_fcport_update_linkinfo()
3134 if (!fcport->cfg.trunked) in bfa_fcport_update_linkinfo()
3138 fcport->fcoe_vlan = in bfa_fcport_update_linkinfo()
3141 bfa_trc(fcport->bfa, fcport->speed); in bfa_fcport_update_linkinfo()
3142 bfa_trc(fcport->bfa, fcport->topology); in bfa_fcport_update_linkinfo()
3146 bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_reset_linkinfo() argument
3148 fcport->speed = BFA_PORT_SPEED_UNKNOWN; in bfa_fcport_reset_linkinfo()
3149 fcport->topology = BFA_PORT_TOPOLOGY_NONE; in bfa_fcport_reset_linkinfo()
3150 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_reset_linkinfo()
3157 bfa_fcport_send_enable(struct bfa_fcport_s *fcport) in bfa_fcport_send_enable() argument
3165 fcport->msgtag++; in bfa_fcport_send_enable()
3170 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_enable()
3172 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_enable()
3173 &fcport->reqq_wait); in bfa_fcport_send_enable()
3178 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_enable()
3179 m->nwwn = fcport->nwwn; in bfa_fcport_send_enable()
3180 m->pwwn = fcport->pwwn; in bfa_fcport_send_enable()
3181 m->port_cfg = fcport->cfg; in bfa_fcport_send_enable()
3182 m->msgtag = fcport->msgtag; in bfa_fcport_send_enable()
3183 m->port_cfg.maxfrsize = cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_send_enable()
3184 m->use_flash_cfg = fcport->use_flash_cfg; in bfa_fcport_send_enable()
3185 bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); in bfa_fcport_send_enable()
3186 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); in bfa_fcport_send_enable()
3187 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); in bfa_fcport_send_enable()
3192 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_enable()
3200 bfa_fcport_send_disable(struct bfa_fcport_s *fcport) in bfa_fcport_send_disable() argument
3208 fcport->msgtag++; in bfa_fcport_send_disable()
3213 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_disable()
3215 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_disable()
3216 &fcport->reqq_wait); in bfa_fcport_send_disable()
3221 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_disable()
3222 m->msgtag = fcport->msgtag; in bfa_fcport_send_disable()
3227 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_disable()
3233 bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) in bfa_fcport_set_wwns() argument
3235 fcport->pwwn = fcport->bfa->ioc.attr->pwwn; in bfa_fcport_set_wwns()
3236 fcport->nwwn = fcport->bfa->ioc.attr->nwwn; in bfa_fcport_set_wwns()
3238 bfa_trc(fcport->bfa, fcport->pwwn); in bfa_fcport_set_wwns()
3239 bfa_trc(fcport->bfa, fcport->nwwn); in bfa_fcport_set_wwns()
3278 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; in __bfa_cb_fcport_stats_get() local
3286 list_for_each_safe(qe, qen, &fcport->stats_pending_q) { in __bfa_cb_fcport_stats_get()
3287 bfa_q_deq(&fcport->stats_pending_q, &qe); in __bfa_cb_fcport_stats_get()
3289 if (fcport->stats_status == BFA_STATUS_OK) { in __bfa_cb_fcport_stats_get()
3292 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) in __bfa_cb_fcport_stats_get()
3294 &fcport->stats->fcqos); in __bfa_cb_fcport_stats_get()
3297 &fcport->stats->fcoe); in __bfa_cb_fcport_stats_get()
3299 time - fcport->stats_reset_time; in __bfa_cb_fcport_stats_get()
3302 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_get()
3303 fcport->stats_status); in __bfa_cb_fcport_stats_get()
3305 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3307 INIT_LIST_HEAD(&fcport->stats_pending_q); in __bfa_cb_fcport_stats_get()
3308 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3315 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_get_timeout() local
3317 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_get_timeout()
3319 if (fcport->stats_qfull) { in bfa_fcport_stats_get_timeout()
3320 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_get_timeout()
3321 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_get_timeout()
3324 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_get_timeout()
3325 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_stats_get_timeout()
3331 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_get() local
3334 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_get()
3337 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_get()
3338 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_get()
3339 bfa_fcport_send_stats_get, fcport); in bfa_fcport_send_stats_get()
3340 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_get()
3341 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_get()
3344 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_get()
3348 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_get()
3349 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_get()
3355 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in __bfa_cb_fcport_stats_clr() local
3363 fcport->stats_reset_time = ktime_get_seconds(); in __bfa_cb_fcport_stats_clr()
3364 list_for_each_safe(qe, qen, &fcport->statsclr_pending_q) { in __bfa_cb_fcport_stats_clr()
3365 bfa_q_deq(&fcport->statsclr_pending_q, &qe); in __bfa_cb_fcport_stats_clr()
3367 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_clr()
3368 fcport->stats_status); in __bfa_cb_fcport_stats_clr()
3370 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3372 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in __bfa_cb_fcport_stats_clr()
3373 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3380 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_clr_timeout() local
3382 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_clr_timeout()
3384 if (fcport->stats_qfull) { in bfa_fcport_stats_clr_timeout()
3385 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_clr_timeout()
3386 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_clr_timeout()
3389 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_clr_timeout()
3390 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_stats_clr_timeout()
3396 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_clear() local
3399 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_clear()
3402 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_clear()
3403 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_clear()
3404 bfa_fcport_send_stats_clear, fcport); in bfa_fcport_send_stats_clear()
3405 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_clear()
3406 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_clear()
3409 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_clear()
3413 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_clear()
3414 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_clear()
3421 bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) in bfa_trunk_scn() argument
3423 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_trunk_scn()
3430 bfa_trc(fcport->bfa, fcport->cfg.trunked); in bfa_trunk_scn()
3434 bfa_trc(fcport->bfa, trunk->attr.state); in bfa_trunk_scn()
3435 bfa_trc(fcport->bfa, scn->trunk_state); in bfa_trunk_scn()
3436 bfa_trc(fcport->bfa, scn->trunk_speed); in bfa_trunk_scn()
3442 if (fcport->cfg.trunked && (trunk->attr.state != BFA_TRUNK_DISABLED)) in bfa_trunk_scn()
3456 fcport->speed = tlink->speed; in bfa_trunk_scn()
3457 fcport->topology = BFA_PORT_TOPOLOGY_P2P; in bfa_trunk_scn()
3461 bfa_trc(fcport->bfa, lattr->link_state); in bfa_trunk_scn()
3462 bfa_trc(fcport->bfa, lattr->trunk_wwn); in bfa_trunk_scn()
3463 bfa_trc(fcport->bfa, lattr->fctl); in bfa_trunk_scn()
3464 bfa_trc(fcport->bfa, lattr->speed); in bfa_trunk_scn()
3465 bfa_trc(fcport->bfa, lattr->deskew); in bfa_trunk_scn()
3470 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3474 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3478 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3482 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3491 bfa_fcport_scn(fcport, (scn->trunk_state == BFA_TRUNK_ONLINE) ? in bfa_trunk_scn()
3499 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_trunk_iocdisable() local
3505 if (fcport->cfg.trunked) { in bfa_trunk_iocdisable()
3506 if (fcport->trunk.attr.state == BFA_TRUNK_ONLINE) in bfa_trunk_iocdisable()
3507 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_TRUE); in bfa_trunk_iocdisable()
3509 fcport->trunk.attr.state = BFA_TRUNK_OFFLINE; in bfa_trunk_iocdisable()
3510 fcport->trunk.attr.speed = BFA_PORT_SPEED_UNKNOWN; in bfa_trunk_iocdisable()
3512 fcport->trunk.attr.link_attr[i].trunk_wwn = 0; in bfa_trunk_iocdisable()
3513 fcport->trunk.attr.link_attr[i].fctl = in bfa_trunk_iocdisable()
3515 fcport->trunk.attr.link_attr[i].link_state = in bfa_trunk_iocdisable()
3517 fcport->trunk.attr.link_attr[i].speed = in bfa_trunk_iocdisable()
3519 fcport->trunk.attr.link_attr[i].deskew = 0; in bfa_trunk_iocdisable()
3530 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_init() local
3535 bfa_fcport_set_wwns(fcport); in bfa_fcport_init()
3536 if (fcport->cfg.maxfrsize == 0) in bfa_fcport_init()
3537 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); in bfa_fcport_init()
3538 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); in bfa_fcport_init()
3539 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); in bfa_fcport_init()
3544 WARN_ON(!fcport->cfg.maxfrsize); in bfa_fcport_init()
3545 WARN_ON(!fcport->cfg.rx_bbcredit); in bfa_fcport_init()
3546 WARN_ON(!fcport->speed_sup); in bfa_fcport_init()
3555 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_isr() local
3559 fcport->event_arg.i2hmsg = i2hmsg; in bfa_fcport_isr()
3562 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm)); in bfa_fcport_isr()
3566 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) { in bfa_fcport_isr()
3568 fcport->stats_dma_ready = BFA_TRUE; in bfa_fcport_isr()
3569 if (fcport->use_flash_cfg) { in bfa_fcport_isr()
3570 fcport->cfg = i2hmsg.penable_rsp->port_cfg; in bfa_fcport_isr()
3571 fcport->cfg.maxfrsize = in bfa_fcport_isr()
3572 cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_isr()
3573 fcport->cfg.path_tov = in bfa_fcport_isr()
3574 cpu_to_be16(fcport->cfg.path_tov); in bfa_fcport_isr()
3575 fcport->cfg.q_depth = in bfa_fcport_isr()
3576 cpu_to_be16(fcport->cfg.q_depth); in bfa_fcport_isr()
3578 if (fcport->cfg.trunked) in bfa_fcport_isr()
3579 fcport->trunk.attr.state = in bfa_fcport_isr()
3582 fcport->trunk.attr.state = in bfa_fcport_isr()
3584 fcport->qos_attr.qos_bw = in bfa_fcport_isr()
3586 fcport->use_flash_cfg = BFA_FALSE; in bfa_fcport_isr()
3589 if (fcport->cfg.qos_enabled) in bfa_fcport_isr()
3590 fcport->qos_attr.state = BFA_QOS_OFFLINE; in bfa_fcport_isr()
3592 fcport->qos_attr.state = BFA_QOS_DISABLED; in bfa_fcport_isr()
3594 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3597 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3598 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3600 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3602 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3607 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) in bfa_fcport_isr()
3608 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3612 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3613 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3615 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3618 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); in bfa_fcport_isr()
3622 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3625 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3628 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3633 bfa_trunk_scn(fcport, i2hmsg.trunk_scn); in bfa_fcport_isr()
3640 if (list_empty(&fcport->stats_pending_q) || in bfa_fcport_isr()
3641 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3644 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3645 fcport->stats_status = i2hmsg.pstatsget_rsp->status; in bfa_fcport_isr()
3646 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_isr()
3653 if (list_empty(&fcport->statsclr_pending_q) || in bfa_fcport_isr()
3654 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3657 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3658 fcport->stats_status = BFA_STATUS_OK; in bfa_fcport_isr()
3659 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_isr()
3663 bfa_sm_send_event(fcport, BFA_FCPORT_SM_ENABLE); in bfa_fcport_isr()
3667 bfa_sm_send_event(fcport, BFA_FCPORT_SM_DISABLE); in bfa_fcport_isr()
3685 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_event_register() local
3687 fcport->event_cbfn = cbfn; in bfa_fcport_event_register()
3688 fcport->event_cbarg = cbarg; in bfa_fcport_event_register()
3694 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_enable() local
3702 if (fcport->diag_busy) in bfa_fcport_enable()
3726 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_pbcdisabled() local
3731 bfa_trc(bfa, fcport->pwwn); in bfa_fcport_is_pbcdisabled()
3743 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_speed() local
3747 if (fcport->cfg.trunked == BFA_TRUE) in bfa_fcport_cfg_speed()
3749 if ((fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) && in bfa_fcport_cfg_speed()
3752 if ((speed != BFA_PORT_SPEED_AUTO) && (speed > fcport->speed_sup)) { in bfa_fcport_cfg_speed()
3753 bfa_trc(bfa, fcport->speed_sup); in bfa_fcport_cfg_speed()
3758 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { in bfa_fcport_cfg_speed()
3777 fcport->cfg.speed = speed; in bfa_fcport_cfg_speed()
3788 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_speed() local
3790 return fcport->speed; in bfa_fcport_get_speed()
3799 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_topology() local
3802 bfa_trc(bfa, fcport->cfg.topology); in bfa_fcport_cfg_topology()
3810 (fcport->qos_attr.state != BFA_QOS_DISABLED)) in bfa_fcport_cfg_topology()
3812 if (fcport->cfg.ratelimit != BFA_FALSE) in bfa_fcport_cfg_topology()
3815 (fcport->trunk.attr.state != BFA_TRUNK_DISABLED)) in bfa_fcport_cfg_topology()
3818 (fcport->cfg.speed == BFA_PORT_SPEED_16GBPS)) in bfa_fcport_cfg_topology()
3835 fcport->cfg.topology = topology; in bfa_fcport_cfg_topology()
3845 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_topology() local
3847 return fcport->topology; in bfa_fcport_get_topology()
3856 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_cfg_topology() local
3858 return fcport->cfg.topology; in bfa_fcport_get_cfg_topology()
3864 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_hardalpa() local
3867 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_cfg_hardalpa()
3868 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_cfg_hardalpa()
3870 fcport->cfg.cfg_hardalpa = BFA_TRUE; in bfa_fcport_cfg_hardalpa()
3871 fcport->cfg.hardalpa = alpa; in bfa_fcport_cfg_hardalpa()
3879 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clr_hardalpa() local
3881 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_clr_hardalpa()
3882 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_clr_hardalpa()
3884 fcport->cfg.cfg_hardalpa = BFA_FALSE; in bfa_fcport_clr_hardalpa()
3891 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_hardalpa() local
3893 *alpa = fcport->cfg.hardalpa; in bfa_fcport_get_hardalpa()
3894 return fcport->cfg.cfg_hardalpa; in bfa_fcport_get_hardalpa()
3900 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_myalpa() local
3902 return fcport->myalpa; in bfa_fcport_get_myalpa()
3908 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_maxfrsize() local
3911 bfa_trc(bfa, fcport->cfg.maxfrsize); in bfa_fcport_cfg_maxfrsize()
3921 fcport->cfg.maxfrsize = maxfrsize; in bfa_fcport_cfg_maxfrsize()
3928 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_maxfrsize() local
3930 return fcport->cfg.maxfrsize; in bfa_fcport_get_maxfrsize()
3946 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_tx_bbcredit() local
3948 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; in bfa_fcport_set_tx_bbcredit()
3958 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_wwn() local
3960 return fcport->nwwn; in bfa_fcport_get_wwn()
3962 return fcport->pwwn; in bfa_fcport_get_wwn()
3968 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_attr() local
3972 attr->nwwn = fcport->nwwn; in bfa_fcport_get_attr()
3973 attr->pwwn = fcport->pwwn; in bfa_fcport_get_attr()
3978 memcpy(&attr->pport_cfg, &fcport->cfg, in bfa_fcport_get_attr()
3981 attr->pport_cfg.speed = fcport->cfg.speed; in bfa_fcport_get_attr()
3982 attr->speed_supported = fcport->speed_sup; in bfa_fcport_get_attr()
3983 attr->speed = fcport->speed; in bfa_fcport_get_attr()
3987 attr->pport_cfg.topology = fcport->cfg.topology; in bfa_fcport_get_attr()
3988 attr->topology = fcport->topology; in bfa_fcport_get_attr()
3989 attr->pport_cfg.trunked = fcport->cfg.trunked; in bfa_fcport_get_attr()
3992 attr->beacon = fcport->beacon; in bfa_fcport_get_attr()
3993 attr->link_e2e_beacon = fcport->link_e2e_beacon; in bfa_fcport_get_attr()
3997 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); in bfa_fcport_get_attr()
3999 attr->fec_state = fcport->fec_state; in bfa_fcport_get_attr()
4005 if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4007 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4012 attr->fcoe_vlan = fcport->fcoe_vlan; in bfa_fcport_get_attr()
4023 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_stats() local
4026 !fcport->stats_dma_ready) in bfa_fcport_get_stats()
4029 if (!list_empty(&fcport->statsclr_pending_q)) in bfa_fcport_get_stats()
4032 if (list_empty(&fcport->stats_pending_q)) { in bfa_fcport_get_stats()
4033 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4034 bfa_fcport_send_stats_get(fcport); in bfa_fcport_get_stats()
4035 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_get_stats()
4037 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_get_stats()
4039 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4050 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clear_stats() local
4053 !fcport->stats_dma_ready) in bfa_fcport_clear_stats()
4056 if (!list_empty(&fcport->stats_pending_q)) in bfa_fcport_clear_stats()
4059 if (list_empty(&fcport->statsclr_pending_q)) { in bfa_fcport_clear_stats()
4060 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4061 bfa_fcport_send_stats_clear(fcport); in bfa_fcport_clear_stats()
4062 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_clear_stats()
4064 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_clear_stats()
4066 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4077 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_disabled() local
4079 return bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_disabled()
4087 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_dport() local
4089 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_dport()
4096 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ddport() local
4098 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_ddport()
4105 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_qos_bw() local
4121 (fcport->cfg.topology != BFA_PORT_TOPOLOGY_LOOP)) in bfa_fcport_set_qos_bw()
4122 fcport->cfg.qos_bw = *qos_bw; in bfa_fcport_set_qos_bw()
4130 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ratelim() local
4132 return fcport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; in bfa_fcport_is_ratelim()
4142 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_faa() local
4145 fcport->cfg.faa_state = state; in bfa_fcport_cfg_faa()
4154 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_ratelim_speed() local
4156 bfa_trc(bfa, fcport->cfg.trl_def_speed); in bfa_fcport_get_ratelim_speed()
4157 return fcport->cfg.trl_def_speed; in bfa_fcport_get_ratelim_speed()
4166 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_beacon() local
4170 bfa_trc(bfa, fcport->beacon); in bfa_fcport_beacon()
4171 bfa_trc(bfa, fcport->link_e2e_beacon); in bfa_fcport_beacon()
4173 fcport->beacon = beacon; in bfa_fcport_beacon()
4174 fcport->link_e2e_beacon = link_e2e_beacon; in bfa_fcport_beacon()
4180 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_linkup() local
4182 return (!fcport->cfg.trunked && in bfa_fcport_is_linkup()
4183 bfa_sm_cmp_state(fcport, bfa_fcport_sm_linkup)) || in bfa_fcport_is_linkup()
4184 (fcport->cfg.trunked && in bfa_fcport_is_linkup()
4185 fcport->trunk.attr.state == BFA_TRUNK_ONLINE); in bfa_fcport_is_linkup()
4191 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_qos_enabled() local
4193 return fcport->cfg.qos_enabled; in bfa_fcport_is_qos_enabled()
4199 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_trunk_enabled() local
4201 return fcport->cfg.trunked; in bfa_fcport_is_trunk_enabled()
4207 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_bbcr() local
4211 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_cfg_bbcr()
4219 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_cfg_bbcr()
4222 if (fcport->cfg.qos_enabled) in bfa_fcport_cfg_bbcr()
4225 if (fcport->cfg.trunked) in bfa_fcport_cfg_bbcr()
4228 if ((fcport->cfg.speed != BFA_PORT_SPEED_AUTO) && in bfa_fcport_cfg_bbcr()
4229 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc))) in bfa_fcport_cfg_bbcr()
4235 if (fcport->cfg.bb_cr_enabled) { in bfa_fcport_cfg_bbcr()
4236 if (bb_scn != fcport->cfg.bb_scn) in bfa_fcport_cfg_bbcr()
4245 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4246 fcport->cfg.bb_scn = bb_scn; in bfa_fcport_cfg_bbcr()
4248 if (!fcport->cfg.bb_cr_enabled) in bfa_fcport_cfg_bbcr()
4251 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4252 fcport->cfg.bb_scn = 0; in bfa_fcport_cfg_bbcr()
4262 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_bbcr_attr() local
4264 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_get_bbcr_attr()
4267 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_get_bbcr_attr()
4270 *bbcr_attr = fcport->bbcr_attr; in bfa_fcport_get_bbcr_attr()
5712 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa); in bfa_fcdiag_set_busy_status() local
5715 fcport->diag_busy = BFA_TRUE; in bfa_fcdiag_set_busy_status()
5717 fcport->diag_busy = BFA_FALSE; in bfa_fcdiag_set_busy_status()