• Home
  • Raw
  • Download

Lines Matching refs:fcport

30 BFA_MODULE(fcport);
164 static bfa_boolean_t bfa_fcport_send_enable(struct bfa_fcport_s *fcport);
165 static bfa_boolean_t bfa_fcport_send_disable(struct bfa_fcport_s *fcport);
166 static void bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport);
167 static void bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport);
168 static void bfa_fcport_set_wwns(struct bfa_fcport_s *fcport);
170 static void bfa_fcport_scn(struct bfa_fcport_s *fcport,
182 static void bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport,
184 static void bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport,
186 static void bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport,
188 static void bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
190 static void bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
192 static void bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport,
194 static void bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport,
196 static void bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport,
198 static void bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport,
200 static void bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport,
202 static void bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport,
204 static void bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport,
206 static void bfa_fcport_sm_dport(struct bfa_fcport_s *fcport,
208 static void bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport,
210 static void bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport,
2069 bfa_fcport_aen_post(struct bfa_fcport_s *fcport, enum bfa_port_aen_event event) in bfa_fcport_aen_post() argument
2071 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_aen_post()
2078 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa); in bfa_fcport_aen_post()
2079 aen_entry->aen_data.port.pwwn = fcport->pwwn; in bfa_fcport_aen_post()
2082 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq, in bfa_fcport_aen_post()
2090 bfa_fcport_sm_uninit(struct bfa_fcport_s *fcport, in bfa_fcport_sm_uninit() argument
2093 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_uninit()
2100 fcport->use_flash_cfg = BFA_TRUE; in bfa_fcport_sm_uninit()
2102 if (bfa_fcport_send_enable(fcport)) { in bfa_fcport_sm_uninit()
2103 bfa_trc(fcport->bfa, BFA_TRUE); in bfa_fcport_sm_uninit()
2104 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_uninit()
2106 bfa_trc(fcport->bfa, BFA_FALSE); in bfa_fcport_sm_uninit()
2107 bfa_sm_set_state(fcport, in bfa_fcport_sm_uninit()
2125 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_uninit()
2129 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_uninit()
2133 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_uninit()
2138 bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling_qwait() argument
2142 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling_qwait()
2143 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2147 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_enabling_qwait()
2148 bfa_fcport_send_enable(fcport); in bfa_fcport_sm_enabling_qwait()
2152 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2153 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling_qwait()
2167 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_enabling_qwait()
2168 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2169 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling_qwait()
2171 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling_qwait()
2174 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling_qwait()
2186 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_enabling_qwait()
2187 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling_qwait()
2191 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling_qwait()
2192 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling_qwait()
2193 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling_qwait()
2197 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling_qwait()
2202 bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_enabling() argument
2206 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_enabling()
2207 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_enabling()
2212 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_enabling()
2216 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_enabling()
2217 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_enabling()
2219 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_enabling()
2220 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_enabling()
2230 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_enabling()
2231 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_enabling()
2233 bfa_sm_set_state(fcport, in bfa_fcport_sm_enabling()
2236 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_enabling()
2238 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_enabling()
2241 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_enabling()
2245 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_enabling()
2249 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_enabling()
2253 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_enabling()
2254 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_enabling()
2255 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_enabling()
2259 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_enabling()
2264 bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkdown() argument
2267 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_sm_linkdown()
2269 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkdown()
2271 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2275 bfa_fcport_update_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2276 bfa_sm_set_state(fcport, bfa_fcport_sm_linkup); in bfa_fcport_sm_linkdown()
2277 WARN_ON(!fcport->event_cbfn); in bfa_fcport_sm_linkdown()
2278 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2280 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) { in bfa_fcport_sm_linkdown()
2282 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2284 bfa_trc(fcport->bfa, in bfa_fcport_sm_linkdown()
2288 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2292 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2297 bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); in bfa_fcport_sm_linkdown()
2298 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2301 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ONLINE); in bfa_fcport_sm_linkdown()
2304 if (fcport->cfg.qos_enabled && in bfa_fcport_sm_linkdown()
2305 fcport->qos_attr.state != BFA_QOS_ONLINE) in bfa_fcport_sm_linkdown()
2306 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_QOS_NEG); in bfa_fcport_sm_linkdown()
2322 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkdown()
2323 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkdown()
2325 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkdown()
2328 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkdown()
2330 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkdown()
2333 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkdown()
2337 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkdown()
2341 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkdown()
2345 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkdown()
2346 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkdown()
2347 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkdown()
2351 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkdown()
2356 bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport, in bfa_fcport_sm_linkup() argument
2360 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_linkup()
2362 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_linkup()
2372 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_linkup()
2373 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_linkup()
2375 bfa_sm_set_state(fcport, in bfa_fcport_sm_linkup()
2378 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2379 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2380 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2382 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2385 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2388 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_linkup()
2392 bfa_sm_set_state(fcport, bfa_fcport_sm_linkdown); in bfa_fcport_sm_linkup()
2393 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2394 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2395 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_linkup()
2397 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2398 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2401 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2406 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2411 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_linkup()
2412 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2413 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2414 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2417 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2422 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2427 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_linkup()
2428 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2429 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_linkup()
2430 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_linkup()
2431 if (BFA_PORT_IS_DISABLED(fcport->bfa)) { in bfa_fcport_sm_linkup()
2434 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_OFFLINE); in bfa_fcport_sm_linkup()
2439 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2444 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_linkup()
2445 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_linkup()
2446 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_linkup()
2450 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_linkup()
2455 bfa_fcport_sm_disabling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling_qwait() argument
2458 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2462 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_disabling_qwait()
2463 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_disabling_qwait()
2467 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling_qwait()
2468 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2472 bfa_sm_set_state(fcport, bfa_fcport_sm_toggling_qwait); in bfa_fcport_sm_disabling_qwait()
2490 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling_qwait()
2491 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_disabling_qwait()
2495 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_disabling_qwait()
2496 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISCONNECT); in bfa_fcport_sm_disabling_qwait()
2497 bfa_sm_set_state(fcport, bfa_fcport_sm_faa_misconfig); in bfa_fcport_sm_disabling_qwait()
2501 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling_qwait()
2506 bfa_fcport_sm_toggling_qwait(struct bfa_fcport_s *fcport, in bfa_fcport_sm_toggling_qwait() argument
2509 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2513 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_toggling_qwait()
2514 bfa_fcport_send_disable(fcport); in bfa_fcport_sm_toggling_qwait()
2515 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_toggling_qwait()
2516 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_toggling_qwait()
2518 bfa_sm_set_state(fcport, in bfa_fcport_sm_toggling_qwait()
2523 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_toggling_qwait()
2524 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2531 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_toggling_qwait()
2543 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_toggling_qwait()
2544 bfa_reqq_wcancel(&fcport->reqq_wait); in bfa_fcport_sm_toggling_qwait()
2548 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_toggling_qwait()
2553 bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabling() argument
2557 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabling()
2558 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabling()
2562 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_disabling()
2572 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabling()
2573 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabling()
2575 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabling()
2578 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabling()
2580 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabling()
2583 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabling()
2587 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabling()
2599 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabling()
2603 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabling()
2608 bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport, in bfa_fcport_sm_disabled() argument
2612 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad; in bfa_fcport_sm_disabled()
2613 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_disabled()
2623 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_disabled()
2627 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_disabled()
2628 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_disabled()
2630 bfa_sm_set_state(fcport, in bfa_fcport_sm_disabled()
2633 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_disabled()
2635 wwn2str(pwwn_buf, fcport->pwwn); in bfa_fcport_sm_disabled()
2638 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_ENABLE); in bfa_fcport_sm_disabled()
2648 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_disabled()
2652 bfa_sm_set_state(fcport, bfa_fcport_sm_dport); in bfa_fcport_sm_disabled()
2656 bfa_sm_set_state(fcport, bfa_fcport_sm_ddport); in bfa_fcport_sm_disabled()
2660 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_disabled()
2665 bfa_fcport_sm_stopped(struct bfa_fcport_s *fcport, in bfa_fcport_sm_stopped() argument
2668 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_stopped()
2672 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_stopped()
2673 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_stopped()
2675 bfa_sm_set_state(fcport, in bfa_fcport_sm_stopped()
2691 bfa_fcport_sm_iocdown(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocdown() argument
2694 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocdown()
2698 if (bfa_fcport_send_enable(fcport)) in bfa_fcport_sm_iocdown()
2699 bfa_sm_set_state(fcport, bfa_fcport_sm_enabling); in bfa_fcport_sm_iocdown()
2701 bfa_sm_set_state(fcport, in bfa_fcport_sm_iocdown()
2717 bfa_fcport_sm_iocfail(struct bfa_fcport_s *fcport, in bfa_fcport_sm_iocfail() argument
2720 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_iocfail()
2724 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_iocfail()
2728 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_iocfail()
2740 bfa_fcport_sm_dport(struct bfa_fcport_s *fcport, enum bfa_fcport_sm_event event) in bfa_fcport_sm_dport() argument
2742 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_dport()
2755 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_dport()
2759 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_dport()
2763 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_dport()
2767 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_dport()
2772 bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport, in bfa_fcport_sm_ddport() argument
2775 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_ddport()
2780 bfa_sm_set_state(fcport, bfa_fcport_sm_disabled); in bfa_fcport_sm_ddport()
2793 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_ddport()
2797 bfa_sm_set_state(fcport, bfa_fcport_sm_iocfail); in bfa_fcport_sm_ddport()
2801 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_ddport()
2806 bfa_fcport_sm_faa_misconfig(struct bfa_fcport_s *fcport, in bfa_fcport_sm_faa_misconfig() argument
2809 bfa_trc(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2821 if (bfa_fcport_send_disable(fcport)) in bfa_fcport_sm_faa_misconfig()
2822 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling); in bfa_fcport_sm_faa_misconfig()
2824 bfa_sm_set_state(fcport, bfa_fcport_sm_disabling_qwait); in bfa_fcport_sm_faa_misconfig()
2826 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2827 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2828 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_fcport_sm_faa_misconfig()
2830 bfa_fcport_aen_post(fcport, BFA_PORT_AEN_DISABLE); in bfa_fcport_sm_faa_misconfig()
2834 bfa_sm_set_state(fcport, bfa_fcport_sm_stopped); in bfa_fcport_sm_faa_misconfig()
2838 bfa_fcport_reset_linkinfo(fcport); in bfa_fcport_sm_faa_misconfig()
2839 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); in bfa_fcport_sm_faa_misconfig()
2840 bfa_sm_set_state(fcport, bfa_fcport_sm_iocdown); in bfa_fcport_sm_faa_misconfig()
2844 bfa_sm_fault(fcport->bfa, event); in bfa_fcport_sm_faa_misconfig()
2855 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2864 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn()
2875 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2887 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_nf()
2898 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2911 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_dn_up_nf()
2922 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2931 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up()
2942 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2954 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_nf()
2965 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2978 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_nf()
2989 bfa_trc(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
3002 bfa_sm_fault(ln->fcport->bfa, event); in bfa_fcport_ln_sm_up_dn_up_nf()
3012 ln->fcport->event_cbfn(ln->fcport->event_cbarg, ln->ln_event); in __bfa_cb_fcport_event()
3022 bfa_fcport_scn(struct bfa_fcport_s *fcport, enum bfa_port_linkstate event, in bfa_fcport_scn() argument
3025 if (fcport->cfg.trunked && !trunk) in bfa_fcport_scn()
3030 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKUP); in bfa_fcport_scn()
3033 bfa_sm_send_event(&fcport->ln, BFA_FCPORT_LN_SM_LINKDOWN); in bfa_fcport_scn()
3043 struct bfa_fcport_s *fcport = ln->fcport; in bfa_fcport_queue_cb() local
3045 if (fcport->bfa->fcs) { in bfa_fcport_queue_cb()
3046 fcport->event_cbfn(fcport->event_cbarg, event); in bfa_fcport_queue_cb()
3050 bfa_cb_queue(fcport->bfa, &ln->ln_qe, in bfa_fcport_queue_cb()
3070 struct bfa_fcport_s *fcport = cbarg; in bfa_fcport_qresume() local
3072 bfa_sm_send_event(fcport, BFA_FCPORT_SM_QRESUME); in bfa_fcport_qresume()
3076 bfa_fcport_mem_claim(struct bfa_fcport_s *fcport) in bfa_fcport_mem_claim() argument
3078 struct bfa_mem_dma_s *fcport_dma = &fcport->fcport_dma; in bfa_fcport_mem_claim()
3080 fcport->stats_kva = bfa_mem_dma_virt(fcport_dma); in bfa_fcport_mem_claim()
3081 fcport->stats_pa = bfa_mem_dma_phys(fcport_dma); in bfa_fcport_mem_claim()
3082 fcport->stats = (union bfa_fcport_stats_u *) in bfa_fcport_mem_claim()
3093 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_attach() local
3094 struct bfa_port_cfg_s *port_cfg = &fcport->cfg; in bfa_fcport_attach()
3095 struct bfa_fcport_ln_s *ln = &fcport->ln; in bfa_fcport_attach()
3098 fcport->bfa = bfa; in bfa_fcport_attach()
3099 ln->fcport = fcport; in bfa_fcport_attach()
3101 bfa_fcport_mem_claim(fcport); in bfa_fcport_attach()
3103 bfa_sm_set_state(fcport, bfa_fcport_sm_uninit); in bfa_fcport_attach()
3110 fcport->stats_reset_time = tv.tv_sec; in bfa_fcport_attach()
3111 fcport->stats_dma_ready = BFA_FALSE; in bfa_fcport_attach()
3126 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_attach()
3128 INIT_LIST_HEAD(&fcport->stats_pending_q); in bfa_fcport_attach()
3129 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in bfa_fcport_attach()
3131 bfa_reqq_winit(&fcport->reqq_wait, bfa_fcport_qresume, fcport); in bfa_fcport_attach()
3164 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_iocdisable() local
3166 bfa_sm_send_event(fcport, BFA_FCPORT_SM_HWFAIL); in bfa_fcport_iocdisable()
3174 bfa_fcport_update_loop_info(struct bfa_fcport_s *fcport, in bfa_fcport_update_loop_info() argument
3177 fcport->myalpa = loop_info->myalpa; in bfa_fcport_update_loop_info()
3178 fcport->alpabm_valid = in bfa_fcport_update_loop_info()
3180 memcpy(fcport->alpabm.alpa_bm, in bfa_fcport_update_loop_info()
3186 bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_update_linkinfo() argument
3188 struct bfi_fcport_event_s *pevent = fcport->event_arg.i2hmsg.event; in bfa_fcport_update_linkinfo()
3189 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_fcport_update_linkinfo()
3191 fcport->speed = pevent->link_state.speed; in bfa_fcport_update_linkinfo()
3192 fcport->topology = pevent->link_state.topology; in bfa_fcport_update_linkinfo()
3194 if (fcport->topology == BFA_PORT_TOPOLOGY_LOOP) { in bfa_fcport_update_linkinfo()
3195 bfa_fcport_update_loop_info(fcport, in bfa_fcport_update_linkinfo()
3201 fcport->qos_attr = pevent->link_state.qos_attr; in bfa_fcport_update_linkinfo()
3202 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr; in bfa_fcport_update_linkinfo()
3204 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_update_linkinfo()
3205 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr; in bfa_fcport_update_linkinfo()
3207 fcport->fec_state = pevent->link_state.fec_state; in bfa_fcport_update_linkinfo()
3212 if (!fcport->cfg.trunked) in bfa_fcport_update_linkinfo()
3216 fcport->fcoe_vlan = in bfa_fcport_update_linkinfo()
3219 bfa_trc(fcport->bfa, fcport->speed); in bfa_fcport_update_linkinfo()
3220 bfa_trc(fcport->bfa, fcport->topology); in bfa_fcport_update_linkinfo()
3224 bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport) in bfa_fcport_reset_linkinfo() argument
3226 fcport->speed = BFA_PORT_SPEED_UNKNOWN; in bfa_fcport_reset_linkinfo()
3227 fcport->topology = BFA_PORT_TOPOLOGY_NONE; in bfa_fcport_reset_linkinfo()
3228 fcport->fec_state = BFA_FEC_OFFLINE; in bfa_fcport_reset_linkinfo()
3235 bfa_fcport_send_enable(struct bfa_fcport_s *fcport) in bfa_fcport_send_enable() argument
3243 fcport->msgtag++; in bfa_fcport_send_enable()
3248 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_enable()
3250 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_enable()
3251 &fcport->reqq_wait); in bfa_fcport_send_enable()
3256 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_enable()
3257 m->nwwn = fcport->nwwn; in bfa_fcport_send_enable()
3258 m->pwwn = fcport->pwwn; in bfa_fcport_send_enable()
3259 m->port_cfg = fcport->cfg; in bfa_fcport_send_enable()
3260 m->msgtag = fcport->msgtag; in bfa_fcport_send_enable()
3261 m->port_cfg.maxfrsize = cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_send_enable()
3262 m->use_flash_cfg = fcport->use_flash_cfg; in bfa_fcport_send_enable()
3263 bfa_dma_be_addr_set(m->stats_dma_addr, fcport->stats_pa); in bfa_fcport_send_enable()
3264 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo); in bfa_fcport_send_enable()
3265 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi); in bfa_fcport_send_enable()
3270 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_enable()
3278 bfa_fcport_send_disable(struct bfa_fcport_s *fcport) in bfa_fcport_send_disable() argument
3286 fcport->msgtag++; in bfa_fcport_send_disable()
3291 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_disable()
3293 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_disable()
3294 &fcport->reqq_wait); in bfa_fcport_send_disable()
3299 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_disable()
3300 m->msgtag = fcport->msgtag; in bfa_fcport_send_disable()
3305 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh); in bfa_fcport_send_disable()
3311 bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) in bfa_fcport_set_wwns() argument
3313 fcport->pwwn = fcport->bfa->ioc.attr->pwwn; in bfa_fcport_set_wwns()
3314 fcport->nwwn = fcport->bfa->ioc.attr->nwwn; in bfa_fcport_set_wwns()
3316 bfa_trc(fcport->bfa, fcport->pwwn); in bfa_fcport_set_wwns()
3317 bfa_trc(fcport->bfa, fcport->nwwn); in bfa_fcport_set_wwns()
3356 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *)cbarg; in __bfa_cb_fcport_stats_get() local
3363 if (fcport->stats_status == BFA_STATUS_OK) in __bfa_cb_fcport_stats_get()
3366 list_for_each_safe(qe, qen, &fcport->stats_pending_q) { in __bfa_cb_fcport_stats_get()
3367 bfa_q_deq(&fcport->stats_pending_q, &qe); in __bfa_cb_fcport_stats_get()
3369 if (fcport->stats_status == BFA_STATUS_OK) { in __bfa_cb_fcport_stats_get()
3372 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) in __bfa_cb_fcport_stats_get()
3374 &fcport->stats->fcqos); in __bfa_cb_fcport_stats_get()
3377 &fcport->stats->fcoe); in __bfa_cb_fcport_stats_get()
3379 tv.tv_sec - fcport->stats_reset_time; in __bfa_cb_fcport_stats_get()
3382 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_get()
3383 fcport->stats_status); in __bfa_cb_fcport_stats_get()
3385 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3387 INIT_LIST_HEAD(&fcport->stats_pending_q); in __bfa_cb_fcport_stats_get()
3388 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_get()
3395 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_get_timeout() local
3397 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_get_timeout()
3399 if (fcport->stats_qfull) { in bfa_fcport_stats_get_timeout()
3400 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_get_timeout()
3401 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_get_timeout()
3404 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_get_timeout()
3405 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_stats_get_timeout()
3411 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_get() local
3414 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_get()
3417 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_get()
3418 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_get()
3419 bfa_fcport_send_stats_get, fcport); in bfa_fcport_send_stats_get()
3420 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_get()
3421 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_get()
3424 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_get()
3428 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_get()
3429 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_get()
3435 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in __bfa_cb_fcport_stats_clr() local
3446 fcport->stats_reset_time = tv.tv_sec; in __bfa_cb_fcport_stats_clr()
3447 list_for_each_safe(qe, qen, &fcport->statsclr_pending_q) { in __bfa_cb_fcport_stats_clr()
3448 bfa_q_deq(&fcport->statsclr_pending_q, &qe); in __bfa_cb_fcport_stats_clr()
3450 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe, in __bfa_cb_fcport_stats_clr()
3451 fcport->stats_status); in __bfa_cb_fcport_stats_clr()
3453 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3455 INIT_LIST_HEAD(&fcport->statsclr_pending_q); in __bfa_cb_fcport_stats_clr()
3456 fcport->stats_status = BFA_STATUS_OK; in __bfa_cb_fcport_stats_clr()
3463 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_stats_clr_timeout() local
3465 bfa_trc(fcport->bfa, fcport->stats_qfull); in bfa_fcport_stats_clr_timeout()
3467 if (fcport->stats_qfull) { in bfa_fcport_stats_clr_timeout()
3468 bfa_reqq_wcancel(&fcport->stats_reqq_wait); in bfa_fcport_stats_clr_timeout()
3469 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_stats_clr_timeout()
3472 fcport->stats_status = BFA_STATUS_ETIMER; in bfa_fcport_stats_clr_timeout()
3473 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_stats_clr_timeout()
3479 struct bfa_fcport_s *fcport = (struct bfa_fcport_s *) cbarg; in bfa_fcport_send_stats_clear() local
3482 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT); in bfa_fcport_send_stats_clear()
3485 fcport->stats_qfull = BFA_TRUE; in bfa_fcport_send_stats_clear()
3486 bfa_reqq_winit(&fcport->stats_reqq_wait, in bfa_fcport_send_stats_clear()
3487 bfa_fcport_send_stats_clear, fcport); in bfa_fcport_send_stats_clear()
3488 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT, in bfa_fcport_send_stats_clear()
3489 &fcport->stats_reqq_wait); in bfa_fcport_send_stats_clear()
3492 fcport->stats_qfull = BFA_FALSE; in bfa_fcport_send_stats_clear()
3496 bfa_fn_lpu(fcport->bfa)); in bfa_fcport_send_stats_clear()
3497 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh); in bfa_fcport_send_stats_clear()
3504 bfa_trunk_scn(struct bfa_fcport_s *fcport, struct bfi_fcport_trunk_scn_s *scn) in bfa_trunk_scn() argument
3506 struct bfa_fcport_trunk_s *trunk = &fcport->trunk; in bfa_trunk_scn()
3513 bfa_trc(fcport->bfa, fcport->cfg.trunked); in bfa_trunk_scn()
3517 bfa_trc(fcport->bfa, trunk->attr.state); in bfa_trunk_scn()
3518 bfa_trc(fcport->bfa, scn->trunk_state); in bfa_trunk_scn()
3519 bfa_trc(fcport->bfa, scn->trunk_speed); in bfa_trunk_scn()
3525 if (fcport->cfg.trunked && (trunk->attr.state != BFA_TRUNK_DISABLED)) in bfa_trunk_scn()
3539 fcport->speed = tlink->speed; in bfa_trunk_scn()
3540 fcport->topology = BFA_PORT_TOPOLOGY_P2P; in bfa_trunk_scn()
3544 bfa_trc(fcport->bfa, lattr->link_state); in bfa_trunk_scn()
3545 bfa_trc(fcport->bfa, lattr->trunk_wwn); in bfa_trunk_scn()
3546 bfa_trc(fcport->bfa, lattr->fctl); in bfa_trunk_scn()
3547 bfa_trc(fcport->bfa, lattr->speed); in bfa_trunk_scn()
3548 bfa_trc(fcport->bfa, lattr->deskew); in bfa_trunk_scn()
3553 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3557 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3561 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3565 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, in bfa_trunk_scn()
3574 bfa_fcport_scn(fcport, (scn->trunk_state == BFA_TRUNK_ONLINE) ? in bfa_trunk_scn()
3582 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_trunk_iocdisable() local
3588 if (fcport->cfg.trunked) { in bfa_trunk_iocdisable()
3589 if (fcport->trunk.attr.state == BFA_TRUNK_ONLINE) in bfa_trunk_iocdisable()
3590 bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_TRUE); in bfa_trunk_iocdisable()
3592 fcport->trunk.attr.state = BFA_TRUNK_OFFLINE; in bfa_trunk_iocdisable()
3593 fcport->trunk.attr.speed = BFA_PORT_SPEED_UNKNOWN; in bfa_trunk_iocdisable()
3595 fcport->trunk.attr.link_attr[i].trunk_wwn = 0; in bfa_trunk_iocdisable()
3596 fcport->trunk.attr.link_attr[i].fctl = in bfa_trunk_iocdisable()
3598 fcport->trunk.attr.link_attr[i].link_state = in bfa_trunk_iocdisable()
3600 fcport->trunk.attr.link_attr[i].speed = in bfa_trunk_iocdisable()
3602 fcport->trunk.attr.link_attr[i].deskew = 0; in bfa_trunk_iocdisable()
3613 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_init() local
3618 bfa_fcport_set_wwns(fcport); in bfa_fcport_init()
3619 if (fcport->cfg.maxfrsize == 0) in bfa_fcport_init()
3620 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc); in bfa_fcport_init()
3621 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc); in bfa_fcport_init()
3622 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc); in bfa_fcport_init()
3627 WARN_ON(!fcport->cfg.maxfrsize); in bfa_fcport_init()
3628 WARN_ON(!fcport->cfg.rx_bbcredit); in bfa_fcport_init()
3629 WARN_ON(!fcport->speed_sup); in bfa_fcport_init()
3638 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_isr() local
3642 fcport->event_arg.i2hmsg = i2hmsg; in bfa_fcport_isr()
3645 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm)); in bfa_fcport_isr()
3649 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) { in bfa_fcport_isr()
3651 fcport->stats_dma_ready = BFA_TRUE; in bfa_fcport_isr()
3652 if (fcport->use_flash_cfg) { in bfa_fcport_isr()
3653 fcport->cfg = i2hmsg.penable_rsp->port_cfg; in bfa_fcport_isr()
3654 fcport->cfg.maxfrsize = in bfa_fcport_isr()
3655 cpu_to_be16(fcport->cfg.maxfrsize); in bfa_fcport_isr()
3656 fcport->cfg.path_tov = in bfa_fcport_isr()
3657 cpu_to_be16(fcport->cfg.path_tov); in bfa_fcport_isr()
3658 fcport->cfg.q_depth = in bfa_fcport_isr()
3659 cpu_to_be16(fcport->cfg.q_depth); in bfa_fcport_isr()
3661 if (fcport->cfg.trunked) in bfa_fcport_isr()
3662 fcport->trunk.attr.state = in bfa_fcport_isr()
3665 fcport->trunk.attr.state = in bfa_fcport_isr()
3667 fcport->qos_attr.qos_bw = in bfa_fcport_isr()
3669 fcport->use_flash_cfg = BFA_FALSE; in bfa_fcport_isr()
3672 if (fcport->cfg.qos_enabled) in bfa_fcport_isr()
3673 fcport->qos_attr.state = BFA_QOS_OFFLINE; in bfa_fcport_isr()
3675 fcport->qos_attr.state = BFA_QOS_DISABLED; in bfa_fcport_isr()
3677 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3680 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3681 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3683 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3685 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3690 if (fcport->msgtag == i2hmsg.penable_rsp->msgtag) in bfa_fcport_isr()
3691 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); in bfa_fcport_isr()
3695 if (fcport->cfg.bb_cr_enabled) in bfa_fcport_isr()
3696 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE; in bfa_fcport_isr()
3698 fcport->bbcr_attr.state = BFA_BBCR_DISABLED; in bfa_fcport_isr()
3701 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); in bfa_fcport_isr()
3705 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3708 bfa_sm_send_event(fcport, in bfa_fcport_isr()
3711 fcport->qos_attr.qos_bw_op = in bfa_fcport_isr()
3716 bfa_trunk_scn(fcport, i2hmsg.trunk_scn); in bfa_fcport_isr()
3723 if (list_empty(&fcport->stats_pending_q) || in bfa_fcport_isr()
3724 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3727 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3728 fcport->stats_status = i2hmsg.pstatsget_rsp->status; in bfa_fcport_isr()
3729 __bfa_cb_fcport_stats_get(fcport, BFA_TRUE); in bfa_fcport_isr()
3736 if (list_empty(&fcport->statsclr_pending_q) || in bfa_fcport_isr()
3737 (fcport->stats_status == BFA_STATUS_ETIMER)) in bfa_fcport_isr()
3740 bfa_timer_stop(&fcport->timer); in bfa_fcport_isr()
3741 fcport->stats_status = BFA_STATUS_OK; in bfa_fcport_isr()
3742 __bfa_cb_fcport_stats_clr(fcport, BFA_TRUE); in bfa_fcport_isr()
3746 bfa_sm_send_event(fcport, BFA_FCPORT_SM_ENABLE); in bfa_fcport_isr()
3750 bfa_sm_send_event(fcport, BFA_FCPORT_SM_DISABLE); in bfa_fcport_isr()
3768 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_event_register() local
3770 fcport->event_cbfn = cbfn; in bfa_fcport_event_register()
3771 fcport->event_cbarg = cbarg; in bfa_fcport_event_register()
3777 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_enable() local
3785 if (fcport->diag_busy) in bfa_fcport_enable()
3809 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_pbcdisabled() local
3814 bfa_trc(bfa, fcport->pwwn); in bfa_fcport_is_pbcdisabled()
3826 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_speed() local
3830 if (fcport->cfg.trunked == BFA_TRUE) in bfa_fcport_cfg_speed()
3832 if ((fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) && in bfa_fcport_cfg_speed()
3835 if ((speed != BFA_PORT_SPEED_AUTO) && (speed > fcport->speed_sup)) { in bfa_fcport_cfg_speed()
3836 bfa_trc(bfa, fcport->speed_sup); in bfa_fcport_cfg_speed()
3841 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { in bfa_fcport_cfg_speed()
3860 fcport->cfg.speed = speed; in bfa_fcport_cfg_speed()
3871 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_speed() local
3873 return fcport->speed; in bfa_fcport_get_speed()
3882 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_topology() local
3885 bfa_trc(bfa, fcport->cfg.topology); in bfa_fcport_cfg_topology()
3893 (fcport->qos_attr.state != BFA_QOS_DISABLED)) in bfa_fcport_cfg_topology()
3895 if (fcport->cfg.ratelimit != BFA_FALSE) in bfa_fcport_cfg_topology()
3898 (fcport->trunk.attr.state != BFA_TRUNK_DISABLED)) in bfa_fcport_cfg_topology()
3901 (fcport->cfg.speed == BFA_PORT_SPEED_16GBPS)) in bfa_fcport_cfg_topology()
3918 fcport->cfg.topology = topology; in bfa_fcport_cfg_topology()
3928 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_topology() local
3930 return fcport->topology; in bfa_fcport_get_topology()
3939 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_cfg_topology() local
3941 return fcport->cfg.topology; in bfa_fcport_get_cfg_topology()
3947 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_hardalpa() local
3950 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_cfg_hardalpa()
3951 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_cfg_hardalpa()
3953 fcport->cfg.cfg_hardalpa = BFA_TRUE; in bfa_fcport_cfg_hardalpa()
3954 fcport->cfg.hardalpa = alpa; in bfa_fcport_cfg_hardalpa()
3962 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clr_hardalpa() local
3964 bfa_trc(bfa, fcport->cfg.cfg_hardalpa); in bfa_fcport_clr_hardalpa()
3965 bfa_trc(bfa, fcport->cfg.hardalpa); in bfa_fcport_clr_hardalpa()
3967 fcport->cfg.cfg_hardalpa = BFA_FALSE; in bfa_fcport_clr_hardalpa()
3974 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_hardalpa() local
3976 *alpa = fcport->cfg.hardalpa; in bfa_fcport_get_hardalpa()
3977 return fcport->cfg.cfg_hardalpa; in bfa_fcport_get_hardalpa()
3983 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_myalpa() local
3985 return fcport->myalpa; in bfa_fcport_get_myalpa()
3991 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_maxfrsize() local
3994 bfa_trc(bfa, fcport->cfg.maxfrsize); in bfa_fcport_cfg_maxfrsize()
4004 fcport->cfg.maxfrsize = maxfrsize; in bfa_fcport_cfg_maxfrsize()
4011 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_maxfrsize() local
4013 return fcport->cfg.maxfrsize; in bfa_fcport_get_maxfrsize()
4029 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_tx_bbcredit() local
4031 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; in bfa_fcport_set_tx_bbcredit()
4041 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_wwn() local
4043 return fcport->nwwn; in bfa_fcport_get_wwn()
4045 return fcport->pwwn; in bfa_fcport_get_wwn()
4051 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_attr() local
4055 attr->nwwn = fcport->nwwn; in bfa_fcport_get_attr()
4056 attr->pwwn = fcport->pwwn; in bfa_fcport_get_attr()
4061 memcpy(&attr->pport_cfg, &fcport->cfg, in bfa_fcport_get_attr()
4064 attr->pport_cfg.speed = fcport->cfg.speed; in bfa_fcport_get_attr()
4065 attr->speed_supported = fcport->speed_sup; in bfa_fcport_get_attr()
4066 attr->speed = fcport->speed; in bfa_fcport_get_attr()
4070 attr->pport_cfg.topology = fcport->cfg.topology; in bfa_fcport_get_attr()
4071 attr->topology = fcport->topology; in bfa_fcport_get_attr()
4072 attr->pport_cfg.trunked = fcport->cfg.trunked; in bfa_fcport_get_attr()
4075 attr->beacon = fcport->beacon; in bfa_fcport_get_attr()
4076 attr->link_e2e_beacon = fcport->link_e2e_beacon; in bfa_fcport_get_attr()
4080 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); in bfa_fcport_get_attr()
4082 attr->fec_state = fcport->fec_state; in bfa_fcport_get_attr()
4088 if (bfa_ioc_is_disabled(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4090 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc)) in bfa_fcport_get_attr()
4095 attr->fcoe_vlan = fcport->fcoe_vlan; in bfa_fcport_get_attr()
4106 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_stats() local
4109 !fcport->stats_dma_ready) in bfa_fcport_get_stats()
4112 if (!list_empty(&fcport->statsclr_pending_q)) in bfa_fcport_get_stats()
4115 if (list_empty(&fcport->stats_pending_q)) { in bfa_fcport_get_stats()
4116 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4117 bfa_fcport_send_stats_get(fcport); in bfa_fcport_get_stats()
4118 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_get_stats()
4120 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_get_stats()
4122 list_add_tail(&cb->hcb_qe.qe, &fcport->stats_pending_q); in bfa_fcport_get_stats()
4133 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_clear_stats() local
4136 !fcport->stats_dma_ready) in bfa_fcport_clear_stats()
4139 if (!list_empty(&fcport->stats_pending_q)) in bfa_fcport_clear_stats()
4142 if (list_empty(&fcport->statsclr_pending_q)) { in bfa_fcport_clear_stats()
4143 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4144 bfa_fcport_send_stats_clear(fcport); in bfa_fcport_clear_stats()
4145 bfa_timer_start(bfa, &fcport->timer, in bfa_fcport_clear_stats()
4147 fcport, BFA_FCPORT_STATS_TOV); in bfa_fcport_clear_stats()
4149 list_add_tail(&cb->hcb_qe.qe, &fcport->statsclr_pending_q); in bfa_fcport_clear_stats()
4160 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_disabled() local
4162 return bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_disabled()
4170 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_dport() local
4172 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_dport()
4179 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ddport() local
4181 return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) == in bfa_fcport_is_ddport()
4188 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_set_qos_bw() local
4204 (fcport->cfg.topology != BFA_PORT_TOPOLOGY_LOOP)) in bfa_fcport_set_qos_bw()
4205 fcport->cfg.qos_bw = *qos_bw; in bfa_fcport_set_qos_bw()
4213 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_ratelim() local
4215 return fcport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; in bfa_fcport_is_ratelim()
4225 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_faa() local
4228 fcport->cfg.faa_state = state; in bfa_fcport_cfg_faa()
4237 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_ratelim_speed() local
4239 bfa_trc(bfa, fcport->cfg.trl_def_speed); in bfa_fcport_get_ratelim_speed()
4240 return fcport->cfg.trl_def_speed; in bfa_fcport_get_ratelim_speed()
4249 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_beacon() local
4253 bfa_trc(bfa, fcport->beacon); in bfa_fcport_beacon()
4254 bfa_trc(bfa, fcport->link_e2e_beacon); in bfa_fcport_beacon()
4256 fcport->beacon = beacon; in bfa_fcport_beacon()
4257 fcport->link_e2e_beacon = link_e2e_beacon; in bfa_fcport_beacon()
4263 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_linkup() local
4265 return (!fcport->cfg.trunked && in bfa_fcport_is_linkup()
4266 bfa_sm_cmp_state(fcport, bfa_fcport_sm_linkup)) || in bfa_fcport_is_linkup()
4267 (fcport->cfg.trunked && in bfa_fcport_is_linkup()
4268 fcport->trunk.attr.state == BFA_TRUNK_ONLINE); in bfa_fcport_is_linkup()
4274 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_qos_enabled() local
4276 return fcport->cfg.qos_enabled; in bfa_fcport_is_qos_enabled()
4282 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_is_trunk_enabled() local
4284 return fcport->cfg.trunked; in bfa_fcport_is_trunk_enabled()
4290 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_cfg_bbcr() local
4294 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_cfg_bbcr()
4302 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_cfg_bbcr()
4305 if (fcport->cfg.qos_enabled) in bfa_fcport_cfg_bbcr()
4308 if (fcport->cfg.trunked) in bfa_fcport_cfg_bbcr()
4311 if ((fcport->cfg.speed != BFA_PORT_SPEED_AUTO) && in bfa_fcport_cfg_bbcr()
4312 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc))) in bfa_fcport_cfg_bbcr()
4318 if (fcport->cfg.bb_cr_enabled) { in bfa_fcport_cfg_bbcr()
4319 if (bb_scn != fcport->cfg.bb_scn) in bfa_fcport_cfg_bbcr()
4328 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4329 fcport->cfg.bb_scn = bb_scn; in bfa_fcport_cfg_bbcr()
4331 if (!fcport->cfg.bb_cr_enabled) in bfa_fcport_cfg_bbcr()
4334 fcport->cfg.bb_cr_enabled = on_off; in bfa_fcport_cfg_bbcr()
4335 fcport->cfg.bb_scn = 0; in bfa_fcport_cfg_bbcr()
4345 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); in bfa_fcport_get_bbcr_attr() local
4347 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC) in bfa_fcport_get_bbcr_attr()
4350 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP) in bfa_fcport_get_bbcr_attr()
4353 *bbcr_attr = fcport->bbcr_attr; in bfa_fcport_get_bbcr_attr()
5840 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa); in bfa_fcdiag_set_busy_status() local
5843 fcport->diag_busy = BFA_TRUE; in bfa_fcdiag_set_busy_status()
5845 fcport->diag_busy = BFA_FALSE; in bfa_fcdiag_set_busy_status()