2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
19 * bfa_fcs.c BFA FCS main
24 #include "bfa_fcbuild.h"
26 BFA_TRC_FILE(FCS, FCS);
31 struct bfa_fcs_mod_s {
32 void (*attach) (struct bfa_fcs_s *fcs);
33 void (*modinit) (struct bfa_fcs_s *fcs);
34 void (*modexit) (struct bfa_fcs_s *fcs);
37 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
39 static struct bfa_fcs_mod_s fcs_modules[] = {
40 { bfa_fcs_port_attach, NULL, NULL },
41 { bfa_fcs_uf_attach, NULL, NULL },
42 { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
43 bfa_fcs_fabric_modexit },
51 bfa_fcs_exit_comp(void *fcs_cbarg)
53 struct bfa_fcs_s *fcs = fcs_cbarg;
54 struct bfad_s *bfad = fcs->bfad;
56 complete(&bfad->comp);
66 * fcs attach -- called once to initialize data structures at driver attach time
69 bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
70 bfa_boolean_t min_cfg)
73 struct bfa_fcs_mod_s *mod;
77 fcs->min_cfg = min_cfg;
82 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
83 mod = &fcs_modules[i];
90 * fcs initialization, called once after bfa initialization is complete
93 bfa_fcs_init(struct bfa_fcs_s *fcs)
96 struct bfa_fcs_mod_s *mod;
98 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
99 mod = &fcs_modules[i];
106 * FCS update cfg - reset the pwwn/nwwn of fabric base logical port
107 * with values learned during bfa_init firmware GETATTR REQ.
110 bfa_fcs_update_cfg(struct bfa_fcs_s *fcs)
112 struct bfa_fcs_fabric_s *fabric = &fcs->fabric;
113 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
114 struct bfa_ioc_s *ioc = &fabric->fcs->bfa->ioc;
116 port_cfg->nwwn = ioc->attr->nwwn;
117 port_cfg->pwwn = ioc->attr->pwwn;
121 * fcs pbc vport initialization
124 bfa_fcs_pbc_vport_init(struct bfa_fcs_s *fcs)
127 struct bfi_pbc_vport_s pbc_vports[BFI_PBC_MAX_VPORTS];
129 /* Initialize pbc vports */
132 bfa_iocfc_get_pbc_vports(fcs->bfa, pbc_vports);
133 for (i = 0; i < npbc_vports; i++)
134 bfa_fcb_pbc_vport_create(fcs->bfa->bfad, pbc_vports[i]);
140 * FCS driver details initialization.
142 * param[in] fcs FCS instance
143 * param[in] driver_info Driver Details
148 bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
149 struct bfa_fcs_driver_info_s *driver_info)
152 fcs->driver_info = *driver_info;
154 bfa_fcs_fabric_psymb_init(&fcs->fabric);
159 * FCS instance cleanup and exit.
161 * param[in] fcs FCS instance
165 bfa_fcs_exit(struct bfa_fcs_s *fcs)
167 struct bfa_fcs_mod_s *mod;
170 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
172 nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
174 for (i = 0; i < nmods; i++) {
176 mod = &fcs_modules[i];
183 bfa_wc_wait(&fcs->wc);
188 * Fabric module implementation.
191 #define BFA_FCS_FABRIC_RETRY_DELAY (2000) /* Milliseconds */
192 #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */
194 #define bfa_fcs_fabric_set_opertype(__fabric) do { \
195 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
196 == BFA_PORT_TOPOLOGY_P2P) { \
197 if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED) \
198 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \
200 (__fabric)->oper_type = BFA_PORT_TYPE_P2P; \
202 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \
206 * forward declarations
208 static void bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric);
209 static void bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric);
210 static void bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric);
211 static void bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric);
212 static void bfa_fcs_fabric_delay(void *cbarg);
213 static void bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric);
214 static void bfa_fcs_fabric_delete_comp(void *cbarg);
215 static void bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric,
216 struct fchs_s *fchs, u16 len);
217 static void bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
218 struct fchs_s *fchs, u16 len);
219 static void bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric);
220 static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg,
221 struct bfa_fcxp_s *fcxp, void *cbarg,
225 struct fchs_s *rspfchs);
226 static u8 bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric);
227 static bfa_boolean_t bfa_fcs_fabric_is_bbscn_enabled(
228 struct bfa_fcs_fabric_s *fabric);
230 static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
231 enum bfa_fcs_fabric_event event);
232 static void bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
233 enum bfa_fcs_fabric_event event);
234 static void bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
235 enum bfa_fcs_fabric_event event);
236 static void bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
237 enum bfa_fcs_fabric_event event);
238 static void bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
239 enum bfa_fcs_fabric_event event);
240 static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
241 enum bfa_fcs_fabric_event event);
242 static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
243 enum bfa_fcs_fabric_event event);
244 static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
245 enum bfa_fcs_fabric_event event);
246 static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
247 enum bfa_fcs_fabric_event event);
248 static void bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
249 enum bfa_fcs_fabric_event event);
250 static void bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
251 enum bfa_fcs_fabric_event event);
253 * Beginning state before fabric creation.
256 bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
257 enum bfa_fcs_fabric_event event)
259 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
260 bfa_trc(fabric->fcs, event);
263 case BFA_FCS_FABRIC_SM_CREATE:
264 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created);
265 bfa_fcs_fabric_init(fabric);
266 bfa_fcs_lport_init(&fabric->bport, &fabric->bport.port_cfg);
269 case BFA_FCS_FABRIC_SM_LINK_UP:
270 case BFA_FCS_FABRIC_SM_LINK_DOWN:
274 bfa_sm_fault(fabric->fcs, event);
279 * Beginning state before fabric creation.
282 bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
283 enum bfa_fcs_fabric_event event)
285 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
286 bfa_trc(fabric->fcs, event);
289 case BFA_FCS_FABRIC_SM_START:
290 if (bfa_fcport_is_linkup(fabric->fcs->bfa)) {
291 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
292 bfa_fcs_fabric_login(fabric);
294 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
297 case BFA_FCS_FABRIC_SM_LINK_UP:
298 case BFA_FCS_FABRIC_SM_LINK_DOWN:
301 case BFA_FCS_FABRIC_SM_DELETE:
302 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
303 bfa_fcs_fabric_delete(fabric);
307 bfa_sm_fault(fabric->fcs, event);
312 * Link is down, awaiting LINK UP event from port. This is also the
313 * first state at fabric creation.
316 bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
317 enum bfa_fcs_fabric_event event)
319 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
320 bfa_trc(fabric->fcs, event);
323 case BFA_FCS_FABRIC_SM_LINK_UP:
324 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
325 bfa_fcs_fabric_login(fabric);
328 case BFA_FCS_FABRIC_SM_RETRY_OP:
331 case BFA_FCS_FABRIC_SM_DELETE:
332 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
333 bfa_fcs_fabric_delete(fabric);
337 bfa_sm_fault(fabric->fcs, event);
342 * FLOGI is in progress, awaiting FLOGI reply.
345 bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
346 enum bfa_fcs_fabric_event event)
348 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
349 bfa_trc(fabric->fcs, event);
352 case BFA_FCS_FABRIC_SM_CONT_OP:
354 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
356 bfa_fcs_fabric_oper_bbscn(fabric));
357 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED;
359 if (fabric->auth_reqd && fabric->is_auth) {
360 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth);
361 bfa_trc(fabric->fcs, event);
363 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online);
364 bfa_fcs_fabric_notify_online(fabric);
368 case BFA_FCS_FABRIC_SM_RETRY_OP:
369 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi_retry);
370 bfa_timer_start(fabric->fcs->bfa, &fabric->delay_timer,
371 bfa_fcs_fabric_delay, fabric,
372 BFA_FCS_FABRIC_RETRY_DELAY);
375 case BFA_FCS_FABRIC_SM_LOOPBACK:
376 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback);
377 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
378 bfa_fcs_fabric_set_opertype(fabric);
381 case BFA_FCS_FABRIC_SM_NO_FABRIC:
382 fabric->fab_type = BFA_FCS_FABRIC_N2N;
383 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
385 bfa_fcs_fabric_oper_bbscn(fabric));
386 bfa_fcs_fabric_notify_online(fabric);
387 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric);
390 case BFA_FCS_FABRIC_SM_LINK_DOWN:
391 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
392 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
395 case BFA_FCS_FABRIC_SM_DELETE:
396 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
397 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
398 bfa_fcs_fabric_delete(fabric);
402 bfa_sm_fault(fabric->fcs, event);
408 bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
409 enum bfa_fcs_fabric_event event)
411 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
412 bfa_trc(fabric->fcs, event);
415 case BFA_FCS_FABRIC_SM_DELAYED:
416 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
417 bfa_fcs_fabric_login(fabric);
420 case BFA_FCS_FABRIC_SM_LINK_DOWN:
421 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
422 bfa_timer_stop(&fabric->delay_timer);
425 case BFA_FCS_FABRIC_SM_DELETE:
426 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
427 bfa_timer_stop(&fabric->delay_timer);
428 bfa_fcs_fabric_delete(fabric);
432 bfa_sm_fault(fabric->fcs, event);
437 * Authentication is in progress, awaiting authentication results.
440 bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
441 enum bfa_fcs_fabric_event event)
443 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
444 bfa_trc(fabric->fcs, event);
447 case BFA_FCS_FABRIC_SM_AUTH_FAILED:
448 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed);
449 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
452 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS:
453 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online);
454 bfa_fcs_fabric_notify_online(fabric);
457 case BFA_FCS_FABRIC_SM_PERF_EVFP:
458 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp);
461 case BFA_FCS_FABRIC_SM_LINK_DOWN:
462 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
463 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
466 case BFA_FCS_FABRIC_SM_DELETE:
467 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
468 bfa_fcs_fabric_delete(fabric);
472 bfa_sm_fault(fabric->fcs, event);
477 * Authentication failed
480 bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
481 enum bfa_fcs_fabric_event event)
483 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
484 bfa_trc(fabric->fcs, event);
487 case BFA_FCS_FABRIC_SM_LINK_DOWN:
488 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
489 bfa_fcs_fabric_notify_offline(fabric);
492 case BFA_FCS_FABRIC_SM_DELETE:
493 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
494 bfa_fcs_fabric_delete(fabric);
498 bfa_sm_fault(fabric->fcs, event);
503 * Port is in loopback mode.
506 bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
507 enum bfa_fcs_fabric_event event)
509 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
510 bfa_trc(fabric->fcs, event);
513 case BFA_FCS_FABRIC_SM_LINK_DOWN:
514 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
515 bfa_fcs_fabric_notify_offline(fabric);
518 case BFA_FCS_FABRIC_SM_DELETE:
519 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
520 bfa_fcs_fabric_delete(fabric);
524 bfa_sm_fault(fabric->fcs, event);
529 * There is no attached fabric - private loop or NPort-to-NPort topology.
532 bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
533 enum bfa_fcs_fabric_event event)
535 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
536 bfa_trc(fabric->fcs, event);
539 case BFA_FCS_FABRIC_SM_LINK_DOWN:
540 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
541 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
542 bfa_fcs_fabric_notify_offline(fabric);
545 case BFA_FCS_FABRIC_SM_DELETE:
546 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
547 bfa_fcs_fabric_delete(fabric);
550 case BFA_FCS_FABRIC_SM_NO_FABRIC:
551 bfa_trc(fabric->fcs, fabric->bb_credit);
552 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
554 bfa_fcs_fabric_oper_bbscn(fabric));
557 case BFA_FCS_FABRIC_SM_RETRY_OP:
561 bfa_sm_fault(fabric->fcs, event);
566 * Fabric is online - normal operating state.
569 bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
570 enum bfa_fcs_fabric_event event)
572 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
573 bfa_trc(fabric->fcs, event);
576 case BFA_FCS_FABRIC_SM_LINK_DOWN:
577 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
578 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
579 bfa_fcs_fabric_notify_offline(fabric);
582 case BFA_FCS_FABRIC_SM_DELETE:
583 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
584 bfa_fcs_fabric_delete(fabric);
587 case BFA_FCS_FABRIC_SM_AUTH_FAILED:
588 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed);
589 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE);
592 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS:
596 bfa_sm_fault(fabric->fcs, event);
601 * Exchanging virtual fabric parameters.
604 bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
605 enum bfa_fcs_fabric_event event)
607 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
608 bfa_trc(fabric->fcs, event);
611 case BFA_FCS_FABRIC_SM_CONT_OP:
612 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp_done);
615 case BFA_FCS_FABRIC_SM_ISOLATE:
616 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_isolated);
620 bfa_sm_fault(fabric->fcs, event);
625 * EVFP exchange complete and VFT tagging is enabled.
628 bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
629 enum bfa_fcs_fabric_event event)
631 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
632 bfa_trc(fabric->fcs, event);
636 * Port is isolated after EVFP exchange due to VF_ID mismatch (N and F).
639 bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
640 enum bfa_fcs_fabric_event event)
642 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad;
643 char pwwn_ptr[BFA_STRING_32];
645 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
646 bfa_trc(fabric->fcs, event);
647 wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn);
649 BFA_LOG(KERN_INFO, bfad, bfa_log_level,
650 "Port is isolated due to VF_ID mismatch. "
651 "PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.",
652 pwwn_ptr, fabric->fcs->port_vfid,
653 fabric->event_arg.swp_vfid);
657 * Fabric is being deleted, awaiting vport delete completions.
660 bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
661 enum bfa_fcs_fabric_event event)
663 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
664 bfa_trc(fabric->fcs, event);
667 case BFA_FCS_FABRIC_SM_DELCOMP:
668 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
669 bfa_wc_down(&fabric->fcs->wc);
672 case BFA_FCS_FABRIC_SM_LINK_UP:
675 case BFA_FCS_FABRIC_SM_LINK_DOWN:
676 bfa_fcs_fabric_notify_offline(fabric);
680 bfa_sm_fault(fabric->fcs, event);
687 * fcs_fabric_private fabric private functions
691 bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric)
693 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
695 port_cfg->roles = BFA_LPORT_ROLE_FCP_IM;
696 port_cfg->nwwn = fabric->fcs->bfa->ioc.attr->nwwn;
697 port_cfg->pwwn = fabric->fcs->bfa->ioc.attr->pwwn;
701 * Port Symbolic Name Creation for base port.
704 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
706 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
707 char model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
708 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
710 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
712 /* Model name/number */
713 strncpy((char *)&port_cfg->sym_name, model,
714 BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
715 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
716 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
719 strncat((char *)&port_cfg->sym_name, (char *)driver_info->version,
720 BFA_FCS_PORT_SYMBNAME_VERSION_SZ);
721 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
722 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
724 /* Host machine name */
725 strncat((char *)&port_cfg->sym_name,
726 (char *)driver_info->host_machine_name,
727 BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ);
728 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
729 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
733 * If OS Patch Info is not there, do not truncate any bytes from the
734 * OS name string and instead copy the entire OS info string (64 bytes).
736 if (driver_info->host_os_patch[0] == '\0') {
737 strncat((char *)&port_cfg->sym_name,
738 (char *)driver_info->host_os_name,
740 strncat((char *)&port_cfg->sym_name,
741 BFA_FCS_PORT_SYMBNAME_SEPARATOR,
742 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
744 strncat((char *)&port_cfg->sym_name,
745 (char *)driver_info->host_os_name,
746 BFA_FCS_PORT_SYMBNAME_OSINFO_SZ);
747 strncat((char *)&port_cfg->sym_name,
748 BFA_FCS_PORT_SYMBNAME_SEPARATOR,
749 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
751 /* Append host OS Patch Info */
752 strncat((char *)&port_cfg->sym_name,
753 (char *)driver_info->host_os_patch,
754 BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ);
758 port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
762 * bfa lps login completion callback
765 bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
767 struct bfa_fcs_fabric_s *fabric = uarg;
769 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
770 bfa_trc(fabric->fcs, status);
774 fabric->stats.flogi_accepts++;
777 case BFA_STATUS_INVALID_MAC:
779 fabric->stats.flogi_acc_err++;
780 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
784 case BFA_STATUS_EPROTOCOL:
785 switch (fabric->lps->ext_status) {
786 case BFA_EPROTO_BAD_ACCEPT:
787 fabric->stats.flogi_acc_err++;
790 case BFA_EPROTO_UNKNOWN_RSP:
791 fabric->stats.flogi_unknown_rsp++;
797 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
801 case BFA_STATUS_FABRIC_RJT:
802 fabric->stats.flogi_rejects++;
803 if (fabric->lps->lsrjt_rsn == FC_LS_RJT_RSN_LOGICAL_ERROR &&
804 fabric->lps->lsrjt_expl == FC_LS_RJT_EXP_NO_ADDL_INFO)
805 fabric->fcs->bbscn_flogi_rjt = BFA_TRUE;
807 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
811 fabric->stats.flogi_rsp_err++;
812 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
816 fabric->bb_credit = fabric->lps->pr_bbcred;
817 bfa_trc(fabric->fcs, fabric->bb_credit);
819 if (!(fabric->lps->brcd_switch))
820 fabric->fabric_name = fabric->lps->pr_nwwn;
823 * Check port type. It should be 1 = F-port.
825 if (fabric->lps->fport) {
826 fabric->bport.pid = fabric->lps->lp_pid;
827 fabric->is_npiv = fabric->lps->npiv_en;
828 fabric->is_auth = fabric->lps->auth_req;
829 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP);
832 * Nport-2-Nport direct attached
834 fabric->bport.port_topo.pn2n.rem_port_wwn =
835 fabric->lps->pr_pwwn;
836 fabric->fab_type = BFA_FCS_FABRIC_N2N;
837 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
840 bfa_trc(fabric->fcs, fabric->bport.pid);
841 bfa_trc(fabric->fcs, fabric->is_npiv);
842 bfa_trc(fabric->fcs, fabric->is_auth);
845 * Allocate and send FLOGI.
848 bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric)
850 struct bfa_s *bfa = fabric->fcs->bfa;
851 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg;
852 u8 alpa = 0, bb_scn = 0;
854 if (bfa_fcport_get_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP)
855 alpa = bfa_fcport_get_myalpa(bfa);
857 if (bfa_fcs_fabric_is_bbscn_enabled(fabric) &&
858 (!fabric->fcs->bbscn_flogi_rjt))
859 bb_scn = BFA_FCS_PORT_DEF_BB_SCN;
861 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa),
862 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd, bb_scn);
864 fabric->stats.flogi_sent++;
868 bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric)
870 struct bfa_fcs_vport_s *vport;
871 struct list_head *qe, *qen;
873 bfa_trc(fabric->fcs, fabric->fabric_name);
875 bfa_fcs_fabric_set_opertype(fabric);
876 fabric->stats.fabric_onlines++;
879 * notify online event to base and then virtual ports
881 bfa_fcs_lport_online(&fabric->bport);
883 list_for_each_safe(qe, qen, &fabric->vport_q) {
884 vport = (struct bfa_fcs_vport_s *) qe;
885 bfa_fcs_vport_online(vport);
890 bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric)
892 struct bfa_fcs_vport_s *vport;
893 struct list_head *qe, *qen;
895 bfa_trc(fabric->fcs, fabric->fabric_name);
896 fabric->stats.fabric_offlines++;
899 * notify offline event first to vports and then base port.
901 list_for_each_safe(qe, qen, &fabric->vport_q) {
902 vport = (struct bfa_fcs_vport_s *) qe;
903 bfa_fcs_vport_offline(vport);
906 bfa_fcs_lport_offline(&fabric->bport);
908 fabric->fabric_name = 0;
909 fabric->fabric_ip_addr[0] = 0;
913 bfa_fcs_fabric_delay(void *cbarg)
915 struct bfa_fcs_fabric_s *fabric = cbarg;
917 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELAYED);
921 * Computes operating BB_SCN value
924 bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
926 u8 pr_bbscn = fabric->lps->pr_bbscn;
927 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
929 if (!(fcport->cfg.bb_scn_state && pr_bbscn))
932 /* return max of local/remote bb_scn values */
933 return ((pr_bbscn > BFA_FCS_PORT_DEF_BB_SCN) ?
934 pr_bbscn : BFA_FCS_PORT_DEF_BB_SCN);
938 * Check if BB_SCN can be enabled.
941 bfa_fcs_fabric_is_bbscn_enabled(struct bfa_fcs_fabric_s *fabric)
943 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
945 if (bfa_ioc_get_fcmode(&fabric->fcs->bfa->ioc) &&
946 fcport->cfg.bb_scn_state &&
947 !bfa_fcport_is_qos_enabled(fabric->fcs->bfa) &&
948 !bfa_fcport_is_trunk_enabled(fabric->fcs->bfa))
955 * Delete all vports and wait for vport delete completions.
958 bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric)
960 struct bfa_fcs_vport_s *vport;
961 struct list_head *qe, *qen;
963 list_for_each_safe(qe, qen, &fabric->vport_q) {
964 vport = (struct bfa_fcs_vport_s *) qe;
965 bfa_fcs_vport_fcs_delete(vport);
968 bfa_fcs_lport_delete(&fabric->bport);
969 bfa_wc_wait(&fabric->wc);
973 bfa_fcs_fabric_delete_comp(void *cbarg)
975 struct bfa_fcs_fabric_s *fabric = cbarg;
977 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELCOMP);
981 * fcs_fabric_public fabric public functions
985 * Attach time initialization.
988 bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
990 struct bfa_fcs_fabric_s *fabric;
992 fabric = &fcs->fabric;
993 memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s));
996 * Initialize base fabric.
999 INIT_LIST_HEAD(&fabric->vport_q);
1000 INIT_LIST_HEAD(&fabric->vf_q);
1001 fabric->lps = bfa_lps_alloc(fcs->bfa);
1002 WARN_ON(!fabric->lps);
1005 * Initialize fabric delete completion handler. Fabric deletion is
1006 * complete when the last vport delete is complete.
1008 bfa_wc_init(&fabric->wc, bfa_fcs_fabric_delete_comp, fabric);
1009 bfa_wc_up(&fabric->wc); /* For the base port */
1011 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
1012 bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL);
1016 bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
1018 bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);
1026 bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
1028 struct bfa_fcs_fabric_s *fabric;
1033 * Cleanup base fabric.
1035 fabric = &fcs->fabric;
1036 bfa_lps_delete(fabric->lps);
1037 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELETE);
1041 * Fabric module start -- kick starts FCS actions
1044 bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs)
1046 struct bfa_fcs_fabric_s *fabric;
1049 fabric = &fcs->fabric;
1050 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START);
1055 * Link up notification from BFA physical port module.
1058 bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
1060 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
1061 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_UP);
1065 * Link down notification from BFA physical port module.
1068 bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
1070 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
1071 fabric->fcs->bbscn_flogi_rjt = BFA_FALSE;
1072 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN);
1076 * A child vport is being created in the fabric.
1078 * Call from vport module at vport creation. A list of base port and vports
1079 * belonging to a fabric is maintained to propagate link events.
1081 * param[in] fabric - Fabric instance. This can be a base fabric or vf.
1082 * param[in] vport - Vport being created.
1084 * @return None (always succeeds)
1087 bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
1088 struct bfa_fcs_vport_s *vport)
1091 * - add vport to fabric's vport_q
1093 bfa_trc(fabric->fcs, fabric->vf_id);
1095 list_add_tail(&vport->qe, &fabric->vport_q);
1096 fabric->num_vports++;
1097 bfa_wc_up(&fabric->wc);
1101 * A child vport is being deleted from fabric.
1103 * Vport is being deleted.
1106 bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
1107 struct bfa_fcs_vport_s *vport)
1109 list_del(&vport->qe);
1110 fabric->num_vports--;
1111 bfa_wc_down(&fabric->wc);
1116 * Lookup for a vport within a fabric given its pwwn
1118 struct bfa_fcs_vport_s *
1119 bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn)
1121 struct bfa_fcs_vport_s *vport;
1122 struct list_head *qe;
1124 list_for_each(qe, &fabric->vport_q) {
1125 vport = (struct bfa_fcs_vport_s *) qe;
1126 if (bfa_fcs_lport_get_pwwn(&vport->lport) == pwwn)
1135 * Get OUI of the attached switch.
1137 * Note : Use of this function should be avoided as much as possible.
1138 * This function should be used only if there is any requirement
1139 * to check for FOS version below 6.3.
1140 * To check if the attached fabric is a brocade fabric, use
1141 * bfa_lps_is_brcd_fabric() which works for FOS versions 6.3
1146 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
1152 fab_nwwn = fabric->lps->pr_nwwn;
1154 tmp = (u8 *)&fab_nwwn;
1155 oui = (tmp[3] << 8) | tmp[4];
1160 * Unsolicited frame receive handling.
1163 bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
1166 u32 pid = fchs->d_id;
1167 struct bfa_fcs_vport_s *vport;
1168 struct list_head *qe;
1169 struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
1170 struct fc_logi_s *flogi = (struct fc_logi_s *) els_cmd;
1172 bfa_trc(fabric->fcs, len);
1173 bfa_trc(fabric->fcs, pid);
1176 * Look for our own FLOGI frames being looped back. This means an
1177 * external loopback cable is in place. Our own FLOGI frames are
1178 * sometimes looped back when switch port gets temporarily bypassed.
1180 if ((pid == bfa_ntoh3b(FC_FABRIC_PORT)) &&
1181 (els_cmd->els_code == FC_ELS_FLOGI) &&
1182 (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) {
1183 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOOPBACK);
1188 * FLOGI/EVFP exchanges should be consumed by base fabric.
1190 if (fchs->d_id == bfa_hton3b(FC_FABRIC_PORT)) {
1191 bfa_trc(fabric->fcs, pid);
1192 bfa_fcs_fabric_process_uf(fabric, fchs, len);
1196 if (fabric->bport.pid == pid) {
1198 * All authentication frames should be routed to auth
1200 bfa_trc(fabric->fcs, els_cmd->els_code);
1201 if (els_cmd->els_code == FC_ELS_AUTH) {
1202 bfa_trc(fabric->fcs, els_cmd->els_code);
1206 bfa_trc(fabric->fcs, *(u8 *) ((u8 *) fchs));
1207 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
1212 * look for a matching local port ID
1214 list_for_each(qe, &fabric->vport_q) {
1215 vport = (struct bfa_fcs_vport_s *) qe;
1216 if (vport->lport.pid == pid) {
1217 bfa_fcs_lport_uf_recv(&vport->lport, fchs, len);
1221 bfa_trc(fabric->fcs, els_cmd->els_code);
1222 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
1226 * Unsolicited frames to be processed by fabric.
1229 bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
1232 struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
1234 bfa_trc(fabric->fcs, els_cmd->els_code);
1236 switch (els_cmd->els_code) {
1238 bfa_fcs_fabric_process_flogi(fabric, fchs, len);
1243 * need to generate a LS_RJT
1250 * Process incoming FLOGI
1253 bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
1254 struct fchs_s *fchs, u16 len)
1256 struct fc_logi_s *flogi = (struct fc_logi_s *) (fchs + 1);
1257 struct bfa_fcs_lport_s *bport = &fabric->bport;
1259 bfa_trc(fabric->fcs, fchs->s_id);
1261 fabric->stats.flogi_rcvd++;
1263 * Check port type. It should be 0 = n-port.
1265 if (flogi->csp.port_type) {
1267 * @todo: may need to send a LS_RJT
1269 bfa_trc(fabric->fcs, flogi->port_name);
1270 fabric->stats.flogi_rejected++;
1274 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
1275 fabric->lps->pr_bbscn = (be16_to_cpu(flogi->csp.rxsz) >> 12);
1276 bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
1277 bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
1282 bfa_fcs_fabric_send_flogi_acc(fabric);
1283 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
1287 bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
1289 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg;
1290 struct bfa_fcs_lport_n2n_s *n2n_port = &fabric->bport.port_topo.pn2n;
1291 struct bfa_s *bfa = fabric->fcs->bfa;
1292 struct bfa_fcxp_s *fcxp;
1296 fcxp = bfa_fcs_fcxp_alloc(fabric->fcs);
1298 * Do not expect this failure -- expect remote node to retry
1303 reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
1304 bfa_hton3b(FC_FABRIC_PORT),
1305 n2n_port->reply_oxid, pcfg->pwwn,
1307 bfa_fcport_get_maxfrsize(bfa),
1308 bfa_fcport_get_rx_bbcredit(bfa),
1309 bfa_fcs_fabric_oper_bbscn(fabric));
1311 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag,
1312 BFA_FALSE, FC_CLASS_3,
1313 reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric,
1318 * Flogi Acc completion callback.
1321 bfa_fcs_fabric_flogiacc_comp(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
1322 bfa_status_t status, u32 rsp_len,
1323 u32 resid_len, struct fchs_s *rspfchs)
1325 struct bfa_fcs_fabric_s *fabric = cbarg;
1327 bfa_trc(fabric->fcs, status);
1332 * @param[in] fabric - fabric
1333 * @param[in] wwn_t - new fabric name
1338 bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
1341 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad;
1342 char pwwn_ptr[BFA_STRING_32];
1343 char fwwn_ptr[BFA_STRING_32];
1345 bfa_trc(fabric->fcs, fabric_name);
1347 if (fabric->fabric_name == 0) {
1349 * With BRCD switches, we don't get Fabric Name in FLOGI.
1350 * Don't generate a fabric name change event in this case.
1352 fabric->fabric_name = fabric_name;
1354 fabric->fabric_name = fabric_name;
1355 wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport));
1357 bfa_fcs_lport_get_fabric_name(&fabric->bport));
1358 BFA_LOG(KERN_WARNING, bfad, bfa_log_level,
1359 "Base port WWN = %s Fabric WWN = %s\n",
1360 pwwn_ptr, fwwn_ptr);
1365 * Returns FCS vf structure for a given vf_id.
1367 * param[in] vf_id - VF_ID
1370 * If lookup succeeds, retuns fcs vf object, otherwise returns NULL
1373 bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id)
1375 bfa_trc(fcs, vf_id);
1376 if (vf_id == FC_VF_ID_NULL)
1377 return &fcs->fabric;
1383 * Return the list of local logical ports present in the given VF.
1385 * @param[in] vf vf for which logical ports are returned
1386 * @param[out] lpwwn returned logical port wwn list
1387 * @param[in,out] nlports in:size of lpwwn list;
1388 * out:total elements present,
1389 * actual elements returned is limited by the size
1392 bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t lpwwn[], int *nlports)
1394 struct list_head *qe;
1395 struct bfa_fcs_vport_s *vport;
1397 struct bfa_fcs_s *fcs;
1399 if (vf == NULL || lpwwn == NULL || *nlports == 0)
1404 bfa_trc(fcs, vf->vf_id);
1405 bfa_trc(fcs, (uint32_t) *nlports);
1407 lpwwn[i++] = vf->bport.port_cfg.pwwn;
1409 list_for_each(qe, &vf->vport_q) {
1413 vport = (struct bfa_fcs_vport_s *) qe;
1414 lpwwn[i++] = vport->lport.port_cfg.pwwn;
1422 * BFA FCS PPORT ( physical port)
1425 bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event)
1427 struct bfa_fcs_s *fcs = cbarg;
1429 bfa_trc(fcs, event);
1432 case BFA_PORT_LINKUP:
1433 bfa_fcs_fabric_link_up(&fcs->fabric);
1436 case BFA_PORT_LINKDOWN:
1437 bfa_fcs_fabric_link_down(&fcs->fabric);
1446 bfa_fcs_port_attach(struct bfa_fcs_s *fcs)
1448 bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
1452 * BFA FCS UF ( Unsolicited Frames)
1456 * BFA callback for unsolicited frame receive handler.
1458 * @param[in] cbarg callback arg for receive handler
1459 * @param[in] uf unsolicited frame descriptor
1464 bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
1466 struct bfa_fcs_s *fcs = (struct bfa_fcs_s *) cbarg;
1467 struct fchs_s *fchs = bfa_uf_get_frmbuf(uf);
1468 u16 len = bfa_uf_get_frmlen(uf);
1469 struct fc_vft_s *vft;
1470 struct bfa_fcs_fabric_s *fabric;
1473 * check for VFT header
1475 if (fchs->routing == FC_RTG_EXT_HDR &&
1476 fchs->cat_info == FC_CAT_VFT_HDR) {
1477 bfa_stats(fcs, uf.tagged);
1478 vft = bfa_uf_get_frmbuf(uf);
1479 if (fcs->port_vfid == vft->vf_id)
1480 fabric = &fcs->fabric;
1482 fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id);
1485 * drop frame if vfid is unknown
1489 bfa_stats(fcs, uf.vfid_unknown);
1497 fchs = (struct fchs_s *) (vft + 1);
1498 len -= sizeof(struct fc_vft_s);
1500 bfa_trc(fcs, vft->vf_id);
1502 bfa_stats(fcs, uf.untagged);
1503 fabric = &fcs->fabric;
1506 bfa_trc(fcs, ((u32 *) fchs)[0]);
1507 bfa_trc(fcs, ((u32 *) fchs)[1]);
1508 bfa_trc(fcs, ((u32 *) fchs)[2]);
1509 bfa_trc(fcs, ((u32 *) fchs)[3]);
1510 bfa_trc(fcs, ((u32 *) fchs)[4]);
1511 bfa_trc(fcs, ((u32 *) fchs)[5]);
1514 bfa_fcs_fabric_uf_recv(fabric, fchs, len);
1519 bfa_fcs_uf_attach(struct bfa_fcs_s *fcs)
1521 bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs);