Lines Matching refs:fcport

140 static bfa_boolean_t bfa_fcport_send_enable(struct bfa_fcport_s *fcport);
141 static bfa_boolean_t bfa_fcport_send_disable(struct bfa_fcport_s *fcport);
142 static void bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport);
143 static void bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport);
144 static void bfa_fcport_set_wwns(struct bfa_fcport_s *fcport);
146 static void bfa_fcport_scn(struct bfa_fcport_s *fcport,
158 static void bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport,
160 static void bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport,
162 static void bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport,
164 static void bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
166 static void bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
168 static void bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport,
170 static void bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport,
172 static void bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport,
174 static void bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport,
176 static void bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport,
178 static void bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport,
180 static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport,
182 static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport,
184 static void bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport,
186 static void bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport,
2003 bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event) in bfa_fcport_aen_post() argument
2005 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_aen_post()
2012 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa); in bfa_fcport_aen_post()
2013 aen_entry->aen_data.port.pwwn = fcport->pwwn; in bfa_fcport_aen_post()
2016 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq, in bfa_fcport_aen_post()
2024 bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, in bfa_fcport_sm_uninit() argument
2027 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_uninit()
2034 fcport->use_flash_cfg = BFA_TRUE; in bfa_fcport_sm_uninit()
2036 if (bfa_fcport_send_enable(fcport)) { in bfa_fcport_sm_uninit()
2037 bfa_trc(fcport->bfa, BFA_TRUE); in bfa_fcport_sm_uninit()
2038 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_uninit()
2040 bfa_trc(fcport->bfa, BFA_FALSE); in bfa_fcport_sm_uninit()
2041 bfa_sm_set_state(fcport, in bfa_fcport_sm_uninit()
2059 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_uninit()
2063 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_uninit()
2067 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_uninit()
2072 bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling_qwait() argument
2076 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling_qwait()
2077 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2081 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_enabling_qwait()
2082 bfa_fcport_send_enable(fcport); in bfa_fcport_sm_enabling_qwait()
2086 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2087 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling_qwait()
2101 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_enabling_qwait()
2102 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2103 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling_qwait()
2105 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling_qwait()
2108 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling_qwait()
2120 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2121 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling_qwait()
2125 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling_qwait()
2126 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling_qwait()
2127 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling_qwait()
2131 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2136 bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling() argument
2140 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling()
2141 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling()
2146 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_enabling()
2150 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_enabling()
2151 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_enabling()
2153 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_enabling()
2154 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_enabling()
2164 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_enabling()
2165 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_enabling()
2167 bfa_sm_set_state(fcport, in bfa_fcport_sm_enabling()
2170 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling()
2172 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling()
2175 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling()
2179 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling()
2183 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling()
2187 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling()
2188 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling()
2189 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling()
2193 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling()
2198 bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkdown() argument
2201 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_sm_linkdown()
2203 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkdown()
2205 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2209 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2210 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_linkdown()
2211 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_linkdown()
2212 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2214 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { in bfa_fcport_sm_linkdown()
2216 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2218 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2222 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2226 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2231 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_linkdown()
2232 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2235 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); in bfa_fcport_sm_linkdown()
2238 if (fcport->cfg.qos_enabled && in bfa_fcport_sm_linkdown()
2239 fcport->qos_attr.state != BFA_QOS_ONLINE) in bfa_fcport_sm_linkdown()
2240 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_QOS_NEG); in bfa_fcport_sm_linkdown()
2256 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkdown()
2257 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkdown()
2259 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkdown()
2262 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2264 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2267 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkdown()
2271 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkdown()
2275 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkdown()
2279 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2280 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkdown()
2281 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkdown()
2285 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2290 bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkup() argument
2294 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkup()
2296 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkup()
2306 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkup()
2307 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkup()
2309 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkup()
2312 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2313 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2314 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2316 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2319 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2322 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkup()
2326 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_linkup()
2327 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2328 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2329 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2331 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2332 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2335 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2340 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2345 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkup()
2346 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2347 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2348 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2351 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2356 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2361 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkup()
2362 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2363 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2364 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2365 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2368 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2373 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2378 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2379 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2380 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkup()
2384 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkup()
2389 bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling_qwait() argument
2392 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2396 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_disabling_qwait()
2397 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_disabling_qwait()
2401 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling_qwait()
2402 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2406 bfa_sm_set_state(fcport, bfa_fcport_sm_toggling_qwait); in bfa_fcport_sm_disabling_qwait()
2424 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling_qwait()
2425 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2429 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_disabling_qwait()
2430 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_disabling_qwait()
2431 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_disabling_qwait()
2435 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2440 bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_toggling_qwait() argument
2443 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2447 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_toggling_qwait()
2448 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_toggling_qwait()
2449 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_toggling_qwait()
2450 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_toggling_qwait()
2452 bfa_sm_set_state(fcport, in bfa_fcport_sm_toggling_qwait()
2457 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_toggling_qwait()
2458 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2465 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_toggling_qwait()
2477 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_toggling_qwait()
2478 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2482 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2487 bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling() argument
2491 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabling()
2492 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling()
2496 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_disabling()
2506 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabling()
2507 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabling()
2509 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabling()
2512 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabling()
2514 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabling()
2517 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabling()
2521 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling()
2533 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling()
2537 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling()
2542 bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabled() argument
2546 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabled()
2547 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabled()
2557 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabled()
2561 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabled()
2562 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabled()
2564 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabled()
2567 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabled()
2569 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabled()
2572 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabled()
2582 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabled()
2586 bfa_sm_set_state(fcport, bfa_fcport_sm_dport); in bfa_fcport_sm_disabled()
2590 bfa_sm_set_state(fcport, bfa_fcport_sm_ddport); in bfa_fcport_sm_disabled()
2594 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabled()
2599 bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, in bfa_fcport_sm_stopped() argument
2602 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_stopped()
2606 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_stopped()
2607 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_stopped()
2609 bfa_sm_set_state(fcport, in bfa_fcport_sm_stopped()
2625 bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocdown() argument
2628 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocdown()
2632 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_iocdown()
2633 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_iocdown()
2635 bfa_sm_set_state(fcport, in bfa_fcport_sm_iocdown()
2651 bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocfail() argument
2654 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocfail()
2658 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_iocfail()
2662 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_iocfail()
2674 bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, enum bfa_fcport_sm_event event) in bfa_fcport_sm_dport() argument
2676 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_dport()
2689 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_dport()
2693 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_dport()
2697 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_dport()
2701 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_dport()
2706 bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport, in bfa_fcport_sm_ddport() argument
2709 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_ddport()
2714 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_ddport()
2727 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_ddport()
2731 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_ddport()
2735 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_ddport()
2740 bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, in bfa_fcport_sm_faa_misconfig() argument
2743 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2755 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_faa_misconfig()
2756 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_faa_misconfig()
2758 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_faa_misconfig()
2760 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2761 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2762 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_faa_misconfig()
2764 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_faa_misconfig()
2768 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_faa_misconfig()
2772 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2773 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2774 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_faa_misconfig()
2778 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2789 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2798 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2809 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2821 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2832 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2845 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2856 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2865 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2876 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2888 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2899 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2912 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2923 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
2936 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
2946 ln->fcport->event_cbfn(ln->fcport->event_cbarg, ln->ln_event); in __bfa_cb_fcport_event()
2956 bfa_fcport_scn(struct bfa_fcport_s *fcport, enum bfa_port_linkstate event, in bfa_fcport_scn() argument
2959 if (fcport->cfg.trunked && !trunk) in bfa_fcport_scn()
2964 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKUP); in bfa_fcport_scn()
2967 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); in bfa_fcport_scn()
2977 struct bfa_fcport_s *fcport = ln->fcport; in bfa_fcport_queue_cb() local
2979 if (fcport->bfa->fcs) { in bfa_fcport_queue_cb()
2980 fcport->event_cbfn(fcport->event_cbarg, event); in bfa_fcport_queue_cb()
2984 bfa_cb_queue(fcport->bfa, &ln->ln_qe, in bfa_fcport_queue_cb()
3004 struct bfa_fcport_s *fcport = cbarg; in bfa_fcport_qresume() local
3006 bfa_sm_send_event(fcport, BFA_FCPORT_SM_QRESUME); in bfa_fcport_qresume()
3010 bfa_fcport_mem_claim(struct bfa_fcport_s *fcport) in bfa_fcport_mem_claim() argument
3012 struct bfa_mem_dma_s *fcport_dma = &fcport->fcport_dma; in bfa_fcport_mem_claim()
3014 fcport->stats_kva = bfa_mem_dma_virt(fcport_dma); in bfa_fcport_mem_claim()
3015 fcport->stats_pa = bfa_mem_dma_phys(fcport_dma); in bfa_fcport_mem_claim()
3016 fcport->stats = (union bfa_fcport_stats_u *) in bfa_fcport_mem_claim()
3027 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_attach() local
3028 struct bfa_port_cfg_s *port_cfg = &fcport->cfg; in bfa_fcport_attach()
3029 struct bfa_fcport_ln_s *ln = &fcport->ln; in bfa_fcport_attach()
3031 fcport->bfa = bfa; in bfa_fcport_attach()
3032 ln->fcport = fcport; in bfa_fcport_attach()
3034 bfa_fcport_mem_claim(fcport); in bfa_fcport_attach()
3036 bfa_sm_set_state(fcport, bfa_fcport_sm_uninit); in bfa_fcport_attach()
3042 fcport->stats_reset_time = ktime_get_seconds(); in bfa_fcport_attach()
3043 fcport->stats_dma_ready = BFA_FALSE; in bfa_fcport_attach()
3058 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_attach()
3060 INIT_LIST_HEAD(&fcport->stats_pending_q); in bfa_fcport_attach()
3061 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in bfa_fcport_attach()
3063 bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport); in bfa_fcport_attach()
3078 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_iocdisable() local
3080 bfa_sm_send_event(fcport, BFA_FCPORT_SM_HWFAIL); in bfa_fcport_iocdisable()
3088 bfa_fcport_update_loop_info(struct bfa_fcport_s *fcport, in bfa_fcport_update_loop_info() argument
3091 fcport->myalpa = loop_info->myalpa; in bfa_fcport_update_loop_info()
3092 fcport->alpabm_valid = in bfa_fcport_update_loop_info()
3094 memcpy(fcport->alpabm.alpa_bm, in bfa_fcport_update_loop_info()
3100 bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_update_linkinfo() argument
3102 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_update_linkinfo()
3103 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_fcport_update_linkinfo()
3105 fcport->speed = pevent->link_state.speed; in bfa_fcport_update_linkinfo()
3106 fcport->topology = pevent->link_state.topology; in bfa_fcport_update_linkinfo()
3108 if (fcport->topology == BFA_PORT_TOPOLOGY_LOOP) { in bfa_fcport_update_linkinfo()
3109 bfa_fcport_update_loop_info(fcport, in bfa_fcport_update_linkinfo()
3115 fcport->qos_attr = pevent->link_state.qos_attr; in bfa_fcport_update_linkinfo()
3116 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr; in bfa_fcport_update_linkinfo()
3118 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_update_linkinfo()
3119 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; in bfa_fcport_update_linkinfo()
3121 fcport->fec_state = pevent->link_state.fec_state; in bfa_fcport_update_linkinfo()
3126 if (!fcport->cfg.trunked) in bfa_fcport_update_linkinfo()
3130 fcport->fcoe_vlan = in bfa_fcport_update_linkinfo()
3133 bfa_trc(fcport->bfa, fcport->speed); in bfa_fcport_update_linkinfo()
3134 bfa_trc(fcport->bfa, fcport->topology); in bfa_fcport_update_linkinfo()
3138 bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_reset_linkinfo() argument
3140 fcport->speed = BFA_PORT_SPEED_UNKNOWN; in bfa_fcport_reset_linkinfo()
3141 fcport->topology = BFA_PORT_TOPOLOGY_NONE; in bfa_fcport_reset_linkinfo()
3142 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_reset_linkinfo()
3149 bfa_fcport_send_enable(struct bfa_fcport_s *fcport) in bfa_fcport_send_enable() argument
3157 fcport->msgtag++; in bfa_fcport_send_enable()
3162 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_enable()
3164 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_enable()
3165 &fcport->reqq_wait); in bfa_fcport_send_enable()
3170 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_enable()
3171 m->nwwn = fcport->nwwn; in bfa_fcport_send_enable()
3172 m->pwwn = fcport->pwwn; in bfa_fcport_send_enable()
3173 m->port_cfg = fcport->cfg; in bfa_fcport_send_enable()
3174 m->msgtag = fcport->msgtag; in bfa_fcport_send_enable()
3175 m->port_cfg.maxfrsize = cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_send_enable()
3176 m->use_flash_cfg = fcport->use_flash_cfg; in bfa_fcport_send_enable()
3177 bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); in bfa_fcport_send_enable()
3178 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); in bfa_fcport_send_enable()
3179 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); in bfa_fcport_send_enable()
3184 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_enable()
3192 bfa_fcport_send_disable(struct bfa_fcport_s *fcport) in bfa_fcport_send_disable() argument
3200 fcport->msgtag++; in bfa_fcport_send_disable()
3205 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_disable()
3207 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_disable()
3208 &fcport->reqq_wait); in bfa_fcport_send_disable()
3213 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_disable()
3214 m->msgtag = fcport->msgtag; in bfa_fcport_send_disable()
3219 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_disable()
3225 bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) in bfa_fcport_set_wwns() argument
3227 fcport->pwwn = fcport->bfa->ioc.attr->pwwn; in bfa_fcport_set_wwns()
3228 fcport->nwwn = fcport->bfa->ioc.attr->nwwn; in bfa_fcport_set_wwns()
3230 bfa_trc(fcport->bfa, fcport->pwwn); in bfa_fcport_set_wwns()
3231 bfa_trc(fcport->bfa, fcport->nwwn); in bfa_fcport_set_wwns()
3270 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; in __bfa_cb_fcport_stats_get() local
3278 list_for_each_safe(qe, qen, &fcport->stats_pending_q) { in __bfa_cb_fcport_stats_get()
3279 bfa_q_deq(&fcport->stats_pending_q, &qe); in __bfa_cb_fcport_stats_get()
3281 if (fcport->stats_status == BFA_STATUS_OK) { in __bfa_cb_fcport_stats_get()
3284 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) in __bfa_cb_fcport_stats_get()
3286 &fcport->stats->fcqos); in __bfa_cb_fcport_stats_get()
3289 &fcport->stats->fcoe); in __bfa_cb_fcport_stats_get()
3291 time - fcport->stats_reset_time; in __bfa_cb_fcport_stats_get()
3294 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_get()
3295 fcport->stats_status); in __bfa_cb_fcport_stats_get()
3297 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3299 INIT_LIST_HEAD(&fcport->stats_pending_q); in __bfa_cb_fcport_stats_get()
3300 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3307 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_get_timeout() local
3309 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_get_timeout()
3311 if (fcport->stats_qfull) { in bfa_fcport_stats_get_timeout()
3312 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_get_timeout()
3313 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_get_timeout()
3316 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_get_timeout()
3317 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_stats_get_timeout()
3323 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_get() local
3326 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_get()
3329 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_get()
3330 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_get()
3331 bfa_fcport_send_stats_get, fcport); in bfa_fcport_send_stats_get()
3332 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_get()
3333 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_get()
3336 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_get()
3340 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_get()
3341 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_get()
3347 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in __bfa_cb_fcport_stats_clr() local
3355 fcport->stats_reset_time = ktime_get_seconds(); in __bfa_cb_fcport_stats_clr()
3356 list_for_each_safe(qe, qen, &fcport->statsclr_pending_q) { in __bfa_cb_fcport_stats_clr()
3357 bfa_q_deq(&fcport->statsclr_pending_q, &qe); in __bfa_cb_fcport_stats_clr()
3359 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_clr()
3360 fcport->stats_status); in __bfa_cb_fcport_stats_clr()
3362 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3364 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in __bfa_cb_fcport_stats_clr()
3365 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3372 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_clr_timeout() local
3374 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_clr_timeout()
3376 if (fcport->stats_qfull) { in bfa_fcport_stats_clr_timeout()
3377 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_clr_timeout()
3378 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_clr_timeout()
3381 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_clr_timeout()
3382 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_stats_clr_timeout()
3388 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_clear() local
3391 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_clear()
3394 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_clear()
3395 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_clear()
3396 bfa_fcport_send_stats_clear, fcport); in bfa_fcport_send_stats_clear()
3397 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_clear()
3398 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_clear()
3401 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_clear()
3405 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_clear()
3406 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_clear()
3413 bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) in bfa_trunk_scn() argument
3415 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_trunk_scn()
3422 bfa_trc(fcport->bfa, fcport->cfg.trunked); in bfa_trunk_scn()
3426 bfa_trc(fcport->bfa, trunk->attr.state); in bfa_trunk_scn()
3427 bfa_trc(fcport->bfa, scn->trunk_state); in bfa_trunk_scn()
3428 bfa_trc(fcport->bfa, scn->trunk_speed); in bfa_trunk_scn()
3434 if (fcport->cfg.trunked && (trunk->attr.state != BFA_TRUNK_DISABLED)) in bfa_trunk_scn()
3448 fcport->speed = tlink->speed; in bfa_trunk_scn()
3449 fcport->topology = BFA_PORT_TOPOLOGY_P2P; in bfa_trunk_scn()
3453 bfa_trc(fcport->bfa, lattr->link_state); in bfa_trunk_scn()
3454 bfa_trc(fcport->bfa, lattr->trunk_wwn); in bfa_trunk_scn()
3455 bfa_trc(fcport->bfa, lattr->fctl); in bfa_trunk_scn()
3456 bfa_trc(fcport->bfa, lattr->speed); in bfa_trunk_scn()
3457 bfa_trc(fcport->bfa, lattr->deskew); in bfa_trunk_scn()
3462 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3466 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, 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()
3483 bfa_fcport_scn(fcport, (scn->trunk_state == BFA_TRUNK_ONLINE) ? in bfa_trunk_scn()
3491 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_trunk_iocdisable() local
3497 if (fcport->cfg.trunked) { in bfa_trunk_iocdisable()
3498 if (fcport->trunk.attr.state == BFA_TRUNK_ONLINE) in bfa_trunk_iocdisable()
3499 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_TRUE); in bfa_trunk_iocdisable()
3501 fcport->trunk.attr.state = BFA_TRUNK_OFFLINE; in bfa_trunk_iocdisable()
3502 fcport->trunk.attr.speed = BFA_PORT_SPEED_UNKNOWN; in bfa_trunk_iocdisable()
3504 fcport->trunk.attr.link_attr[i].trunk_wwn = 0; in bfa_trunk_iocdisable()
3505 fcport->trunk.attr.link_attr[i].fctl = in bfa_trunk_iocdisable()
3507 fcport->trunk.attr.link_attr[i].link_state = in bfa_trunk_iocdisable()
3509 fcport->trunk.attr.link_attr[i].speed = in bfa_trunk_iocdisable()
3511 fcport->trunk.attr.link_attr[i].deskew = 0; in bfa_trunk_iocdisable()
3522 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_init() local
3527 bfa_fcport_set_wwns(fcport); in bfa_fcport_init()
3528 if (fcport->cfg.maxfrsize == 0) in bfa_fcport_init()
3529 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); in bfa_fcport_init()
3530 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); in bfa_fcport_init()
3531 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); in bfa_fcport_init()
3536 WARN_ON(!fcport->cfg.maxfrsize); in bfa_fcport_init()
3537 WARN_ON(!fcport->cfg.rx_bbcredit); in bfa_fcport_init()
3538 WARN_ON(!fcport->speed_sup); in bfa_fcport_init()
3547 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_isr() local
3551 fcport->event_arg.i2hmsg = i2hmsg; in bfa_fcport_isr()
3554 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm)); in bfa_fcport_isr()
3558 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) { in bfa_fcport_isr()
3560 fcport->stats_dma_ready = BFA_TRUE; in bfa_fcport_isr()
3561 if (fcport->use_flash_cfg) { in bfa_fcport_isr()
3562 fcport->cfg = i2hmsg.penable_rsp->port_cfg; in bfa_fcport_isr()
3563 fcport->cfg.maxfrsize = in bfa_fcport_isr()
3564 cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_isr()
3565 fcport->cfg.path_tov = in bfa_fcport_isr()
3566 cpu_to_be16(fcport->cfg.path_tov); in bfa_fcport_isr()
3567 fcport->cfg.q_depth = in bfa_fcport_isr()
3568 cpu_to_be16(fcport->cfg.q_depth); in bfa_fcport_isr()
3570 if (fcport->cfg.trunked) in bfa_fcport_isr()
3571 fcport->trunk.attr.state = in bfa_fcport_isr()
3574 fcport->trunk.attr.state = in bfa_fcport_isr()
3576 fcport->qos_attr.qos_bw = in bfa_fcport_isr()
3578 fcport->use_flash_cfg = BFA_FALSE; in bfa_fcport_isr()
3581 if (fcport->cfg.qos_enabled) in bfa_fcport_isr()
3582 fcport->qos_attr.state = BFA_QOS_OFFLINE; in bfa_fcport_isr()
3584 fcport->qos_attr.state = BFA_QOS_DISABLED; in bfa_fcport_isr()
3586 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3589 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3590 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3592 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3594 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3599 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) in bfa_fcport_isr()
3600 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3604 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3605 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3607 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3610 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); in bfa_fcport_isr()
3614 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3617 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3620 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3625 bfa_trunk_scn(fcport, i2hmsg.trunk_scn); in bfa_fcport_isr()
3632 if (list_empty(&fcport->stats_pending_q) || in bfa_fcport_isr()
3633 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3636 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3637 fcport->stats_status = i2hmsg.pstatsget_rsp->status; in bfa_fcport_isr()
3638 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_isr()
3645 if (list_empty(&fcport->statsclr_pending_q) || in bfa_fcport_isr()
3646 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3649 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3650 fcport->stats_status = BFA_STATUS_OK; in bfa_fcport_isr()
3651 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_isr()
3655 bfa_sm_send_event(fcport, BFA_FCPORT_SM_ENABLE); in bfa_fcport_isr()
3659 bfa_sm_send_event(fcport, BFA_FCPORT_SM_DISABLE); in bfa_fcport_isr()
3677 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_event_register() local
3679 fcport->event_cbfn = cbfn; in bfa_fcport_event_register()
3680 fcport->event_cbarg = cbarg; in bfa_fcport_event_register()
3686 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_enable() local
3694 if (fcport->diag_busy) in bfa_fcport_enable()
3718 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_pbcdisabled() local
3723 bfa_trc(bfa, fcport->pwwn); in bfa_fcport_is_pbcdisabled()
3735 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_speed() local
3739 if (fcport->cfg.trunked == BFA_TRUE) in bfa_fcport_cfg_speed()
3741 if ((fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) && in bfa_fcport_cfg_speed()
3744 if ((speed != BFA_PORT_SPEED_AUTO) && (speed > fcport->speed_sup)) { in bfa_fcport_cfg_speed()
3745 bfa_trc(bfa, fcport->speed_sup); in bfa_fcport_cfg_speed()
3750 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { in bfa_fcport_cfg_speed()
3769 fcport->cfg.speed = speed; in bfa_fcport_cfg_speed()
3780 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_speed() local
3782 return fcport->speed; in bfa_fcport_get_speed()
3791 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_topology() local
3794 bfa_trc(bfa, fcport->cfg.topology); in bfa_fcport_cfg_topology()
3802 (fcport->qos_attr.state != BFA_QOS_DISABLED)) in bfa_fcport_cfg_topology()
3804 if (fcport->cfg.ratelimit != BFA_FALSE) in bfa_fcport_cfg_topology()
3807 (fcport->trunk.attr.state != BFA_TRUNK_DISABLED)) in bfa_fcport_cfg_topology()
3810 (fcport->cfg.speed == BFA_PORT_SPEED_16GBPS)) in bfa_fcport_cfg_topology()
3827 fcport->cfg.topology = topology; in bfa_fcport_cfg_topology()
3837 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_topology() local
3839 return fcport->topology; in bfa_fcport_get_topology()
3848 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_cfg_topology() local
3850 return fcport->cfg.topology; in bfa_fcport_get_cfg_topology()
3856 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_hardalpa() local
3859 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_cfg_hardalpa()
3860 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_cfg_hardalpa()
3862 fcport->cfg.cfg_hardalpa = BFA_TRUE; in bfa_fcport_cfg_hardalpa()
3863 fcport->cfg.hardalpa = alpa; in bfa_fcport_cfg_hardalpa()
3871 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clr_hardalpa() local
3873 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_clr_hardalpa()
3874 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_clr_hardalpa()
3876 fcport->cfg.cfg_hardalpa = BFA_FALSE; in bfa_fcport_clr_hardalpa()
3883 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_hardalpa() local
3885 *alpa = fcport->cfg.hardalpa; in bfa_fcport_get_hardalpa()
3886 return fcport->cfg.cfg_hardalpa; in bfa_fcport_get_hardalpa()
3892 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_myalpa() local
3894 return fcport->myalpa; in bfa_fcport_get_myalpa()
3900 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_maxfrsize() local
3903 bfa_trc(bfa, fcport->cfg.maxfrsize); in bfa_fcport_cfg_maxfrsize()
3913 fcport->cfg.maxfrsize = maxfrsize; in bfa_fcport_cfg_maxfrsize()
3920 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_maxfrsize() local
3922 return fcport->cfg.maxfrsize; in bfa_fcport_get_maxfrsize()
3938 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_tx_bbcredit() local
3940 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; in bfa_fcport_set_tx_bbcredit()
3950 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_wwn() local
3952 return fcport->nwwn; in bfa_fcport_get_wwn()
3954 return fcport->pwwn; in bfa_fcport_get_wwn()
3960 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_attr() local
3964 attr->nwwn = fcport->nwwn; in bfa_fcport_get_attr()
3965 attr->pwwn = fcport->pwwn; in bfa_fcport_get_attr()
3970 memcpy(&attr->pport_cfg, &fcport->cfg, in bfa_fcport_get_attr()
3973 attr->pport_cfg.speed = fcport->cfg.speed; in bfa_fcport_get_attr()
3974 attr->speed_supported = fcport->speed_sup; in bfa_fcport_get_attr()
3975 attr->speed = fcport->speed; in bfa_fcport_get_attr()
3979 attr->pport_cfg.topology = fcport->cfg.topology; in bfa_fcport_get_attr()
3980 attr->topology = fcport->topology; in bfa_fcport_get_attr()
3981 attr->pport_cfg.trunked = fcport->cfg.trunked; in bfa_fcport_get_attr()
3984 attr->beacon = fcport->beacon; in bfa_fcport_get_attr()
3985 attr->link_e2e_beacon = fcport->link_e2e_beacon; in bfa_fcport_get_attr()
3989 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); in bfa_fcport_get_attr()
3991 attr->fec_state = fcport->fec_state; in bfa_fcport_get_attr()
3997 if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
3999 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4004 attr->fcoe_vlan = fcport->fcoe_vlan; in bfa_fcport_get_attr()
4015 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_stats() local
4018 !fcport->stats_dma_ready) in bfa_fcport_get_stats()
4021 if (!list_empty(&fcport->statsclr_pending_q)) in bfa_fcport_get_stats()
4024 if (list_empty(&fcport->stats_pending_q)) { in bfa_fcport_get_stats()
4025 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4026 bfa_fcport_send_stats_get(fcport); in bfa_fcport_get_stats()
4027 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_get_stats()
4029 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_get_stats()
4031 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4042 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clear_stats() local
4045 !fcport->stats_dma_ready) in bfa_fcport_clear_stats()
4048 if (!list_empty(&fcport->stats_pending_q)) in bfa_fcport_clear_stats()
4051 if (list_empty(&fcport->statsclr_pending_q)) { in bfa_fcport_clear_stats()
4052 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4053 bfa_fcport_send_stats_clear(fcport); in bfa_fcport_clear_stats()
4054 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_clear_stats()
4056 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_clear_stats()
4058 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4069 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_disabled() local
4071 return bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_disabled()
4079 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_dport() local
4081 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_dport()
4088 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ddport() local
4090 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_ddport()
4097 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_qos_bw() local
4113 (fcport->cfg.topology != BFA_PORT_TOPOLOGY_LOOP)) in bfa_fcport_set_qos_bw()
4114 fcport->cfg.qos_bw = *qos_bw; in bfa_fcport_set_qos_bw()
4122 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ratelim() local
4124 return fcport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; in bfa_fcport_is_ratelim()
4134 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_faa() local
4137 fcport->cfg.faa_state = state; in bfa_fcport_cfg_faa()
4146 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_ratelim_speed() local
4148 bfa_trc(bfa, fcport->cfg.trl_def_speed); in bfa_fcport_get_ratelim_speed()
4149 return fcport->cfg.trl_def_speed; in bfa_fcport_get_ratelim_speed()
4158 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_beacon() local
4162 bfa_trc(bfa, fcport->beacon); in bfa_fcport_beacon()
4163 bfa_trc(bfa, fcport->link_e2e_beacon); in bfa_fcport_beacon()
4165 fcport->beacon = beacon; in bfa_fcport_beacon()
4166 fcport->link_e2e_beacon = link_e2e_beacon; in bfa_fcport_beacon()
4172 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_linkup() local
4174 return (!fcport->cfg.trunked && in bfa_fcport_is_linkup()
4175 bfa_sm_cmp_state(fcport, bfa_fcport_sm_linkup)) || in bfa_fcport_is_linkup()
4176 (fcport->cfg.trunked && in bfa_fcport_is_linkup()
4177 fcport->trunk.attr.state == BFA_TRUNK_ONLINE); in bfa_fcport_is_linkup()
4183 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_qos_enabled() local
4185 return fcport->cfg.qos_enabled; in bfa_fcport_is_qos_enabled()
4191 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_trunk_enabled() local
4193 return fcport->cfg.trunked; in bfa_fcport_is_trunk_enabled()
4199 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_bbcr() local
4203 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_cfg_bbcr()
4211 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_cfg_bbcr()
4214 if (fcport->cfg.qos_enabled) in bfa_fcport_cfg_bbcr()
4217 if (fcport->cfg.trunked) in bfa_fcport_cfg_bbcr()
4220 if ((fcport->cfg.speed != BFA_PORT_SPEED_AUTO) && in bfa_fcport_cfg_bbcr()
4221 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc))) in bfa_fcport_cfg_bbcr()
4227 if (fcport->cfg.bb_cr_enabled) { in bfa_fcport_cfg_bbcr()
4228 if (bb_scn != fcport->cfg.bb_scn) in bfa_fcport_cfg_bbcr()
4237 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4238 fcport->cfg.bb_scn = bb_scn; in bfa_fcport_cfg_bbcr()
4240 if (!fcport->cfg.bb_cr_enabled) in bfa_fcport_cfg_bbcr()
4243 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4244 fcport->cfg.bb_scn = 0; in bfa_fcport_cfg_bbcr()
4254 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_bbcr_attr() local
4256 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_get_bbcr_attr()
4259 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_get_bbcr_attr()
4262 *bbcr_attr = fcport->bbcr_attr; in bfa_fcport_get_bbcr_attr()
5701 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa); in bfa_fcdiag_set_busy_status() local
5704 fcport->diag_busy = BFA_TRUE; in bfa_fcdiag_set_busy_status()
5706 fcport->diag_busy = BFA_FALSE; in bfa_fcdiag_set_busy_status()